1 / 50

Introduction to Transport Layer: Protocols, Processes, and Socket Address

This article provides an overview of the transport layer, including its protocols, processes, and the concept of socket address. It also discusses the importance of the transport layer in delivering reliable and cost-effective data transport.

anaf
Télécharger la présentation

Introduction to Transport Layer: Protocols, Processes, and Socket Address

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Unit IV : Transport Layer 6 Hrs • Introduction to Transport Layer: • Introduction • Transport-Layer Protocols • Transport Layer Protocols: • Introduction • User Datagram Protocol • Transmission Control Protocol • Stream Control Transmission Protocol (SCTP) Text Book : Behrouz A. Foruzan, “Data Communication and Networking”, 5E, Tata McGraw-Hill,2013

  2. Syllabus Details • TCP, UDP frame formats to be shown in wireshark. • With TCP the handshaking to be shown indicating server with well known port no., the Flags

  3. TRANSPORT LAYER

  4. Transport Layer The transport layer is responsible for process-to-process (Application programs) delivery of the message. 2 processes communicate in client server relation ship.Network layer treats every packet separately Types of data deliveries

  5. TRANSPORT LAYER • Client-Server paradigm: • A process on local host called client needs service from a process on remote host ie server. • Both processes have same name ex. http client http server • Todays OS supports multiuser and multiprogramming environment. • So remote computer can run multiple server programs while the a client machine can run multiple client programs • We have local host with local process and remote host with remote process • For accessing the processes we require port numbers • IP address selects the host while port number selects the process.

  6. Port numbers: or service point address Port number ranges: 0 – 1023 : Well known port numbers assigned and controlled by IANA 1024 – 49151 are not assigned or controlled by IANA 49152 – 65 535 Dynamic port numbers not registered or controlled and are called Ephemeral ports.

  7. TRANSPORT LAYER • Socket Address : • Process to Process delivery needs 2 identifiers IP address and Port nos. • Combination of IP address and Port no. is called socket • There are client socket and server socket

  8. TRANSPORT LAYER • Multiplexing and Demultiplexing: • At sender side multiplexing is done as many processes need to send packet but only one transport layer is present (many to one) • At the receiver demultiplexing is done as transport layer takes packets from Network layer and delivers each message to appropriate process based on port number

  9. TRANSPORT LAYER • Transport layer provides a reliable , cost effective data transport from source machine to destination machine irrespective of physical networkusing the services provided by network layer. • The hardware or software who does this work is called transport entity which is located in kernel of operating system or on NIC card or a separate process. • Services provided to upper layers : • connection oriented and connection less • It is provided to improve quality of service as user does not have any control on subnet . • Flow control • Layers 1 to 4 are transport service providers and above 4 are transport service user. • Primary function of transport layer is to increase quality of service provided by network layer.

  10. NETWORK LAYER • Quality of service expected for different applications :

  11. NETWORK LAYER • Flow Characteristics: • Reliability: Lack of reliability means losing a packet or acknowledgement resulting into retransmission. Email File Transfer and internet access have high reliable transmission than telephony or audio conferencing • Delay: Tolerance level of an application for Source to destination delay. Telephony , audio and video conferencing and remote login need minimum delay while file transfer, emails delay is not important. • Jitter : variation in delay for packet belonging to same flow. Variation in packet delay should be low for audio and video conferencing • Bandwidth: BW required for video conferencing should be large as compared to requirements of emails

  12. TRANSPORT LAYER • The quality of service parameters are : • Connection establishment delay : • Time between transport connection requested and confirmation of service received by user. It should be small. • Connection establishment failure probability: • Chance of connection being not established in specific time period. • Throughput: • It indicates number of bytes of user data transferred per second • Transit time : • Time between a message being sent by the transport user on source machine and that received on destination machine. • Residual error ratio : • Number of lost or garbled messages as fraction of total sent • Protection: • It provides the facility to protect from unauthorized reading or modifying transmitted data.

  13. TRANSPORT LAYER • Priority: • Provides facility to indicate which connections are important than other, and in congestion the highest priority connection gets service. • Resilience: probability that transport layer terminates the connection due to internal error. • Option negotiation: • If transport layer realizes that it cannot achieve desired goals but can achieve lower goal. Then it negotiates with the end user about the acceptable data rate. If the user agrees then only the connection is established. • Once the options are negotiated they are maintained throughout the life of the connection • These QOS parameters are specified when a connection is requested

  14. TRANSPORT LAYER • Service primitives : • Listen ,Connect ,Send, Receive,Disconnect • TPDU (transport protocol data unit) are messages send from transport entity to other transport entity • TPDUs are in packets of network layer which are in frames of DLL. • When frame comes it is processed by DLL and packet is send to network layer. It processes the packet and send the TPDU to transport layer with the payload. FRAME HEADER PACKET HEADER TPDU HEADER TPDU PAYLOAD

  15. TRANSPORT LAYER • Elements of transport layer protocol • DLL and the transport layer deal with error correction, sequencing flow control etc. • Transport layer connects through the subnet while DLL connects through physical media. • Explicit destination addressing is required in transport layer which is not the case with DLL • Storage capacity is present in transport layer • Initial connection establishment is complex in transport layer. • Flow control and buffering is required in both but in transport layer it is required on large scale or size.

  16. Three-step connection establishment SYN : 0x02 SYN + ACK : 0x12 ACK : 0x10

  17. Four-step connection termination SYN : 0x02 SYN + ACK : 0x12 ACK : 0x10 FIN : 0X01 FIN+ACK : 0X11 PUSH + ACK: 0x18

  18. TRANSPORT LAYER • Internet transport protocol : • TCP :Transmission Control Protocol : connection oriented • UDP: User Data Protocol : connection less protocol • SCTP: Stream Control Transmission Protocol • TCP : • It provides reliable end to end byte stream transmission(boundaries are not preserved) • Each machine supporting TCP has a transport entity who accepts user data stream from local processor breaks it into pieces less than 64Kbytes (generally 1460 bytes Ethernet frame, TCP and IP header 20 bytes each) and sends each piece as separate IP datagram. • When IP datagram with TCP data arrives it is given to TCP entity which reconstructs original byte stream. • TCP entity is software and TCP protocol is set of rules.

  19. TRANSPORT LAYER • TCP service model: • TCP service is obtained by having both sender and receiver create end points called sockets. • Each socket has socket number consisting of IP address of host and 16 bit number for local host address called as port. • TSAP(transport service access point) is called port. • To transmit data a connection has to be established between the socket of sender and receiver. • Socket can be used for multiple connections at the same time. • Port numbers below 1024are well known ports and are used for standard operation.

  20. TRANSPORT LAYER • TCP service model: • when application passes data TCP may send the data immediately or buffer it . • A PUSH flag is used which tells TCP not to delay the data transmission. • Urgent data : When DEL or CRTL C is pressed the TCP stops accumulating data and transmit everything it has for the connection immediately. The sending application puts some control information in data stream and gives to TCP with urgent flag. • When urgent data is received at the receiver , its application is interrupted so as to stop its work.

  21. TCP segment format

  22. TRANSPORT LAYER • TCP protocol: • Every byte on TCP connection has 32 bit sequence number for acknowledgements and window mechanism • Data exchange between TCP entities takes place in form of segments. • TCP Segment has fixed 20 bytes header followed by variable size data bytes. • Segment size is decided by : • Each TCP segment should fit in IP payload field of 65,535 bytes. • Segment must fit in maximum transfer unit(MTU) of each network which is predefined . • If packet is large then it has to be split into segments. But overhead of 40 bytes(20 + 20) header of TCP and IP is present.

  23. TRANSPORT LAYER • TCP protocol: • TCP uses sliding window protocol (acknowledgement number is next expected sequence number and not the last correctly received frame) • All TCP connections are full duplex and point to point. • It does not support multicasting and broadcasting.

  24. TRANSPORT LAYER • Source and destination ports : • They identify local end points of connection • Well known ports are defined by IANA (Internet Assigned Numbers Authority) • Port address plus the IP address gives the unique end point address. • Sequence number and Acknowledgment number : they are 32 bits long. • Data offset(TCP header length) : it tells how many 32 bit words are present in TCP packet. It tells start of data in the segment.next six bits are not used and then comes the flags.

  25. TRANSPORT LAYER • Flags : Control bits that identify the purpose of the segment: • URG : 1 indicates use of urgent pointer .There is urgent data that should be delivered as quickly as possible. • ACK :Acknowledge reception of a valid segment. 1 indicates ack. no. is valid. • PSH :indicates pushed data.Request that the data be passed to the application as soon as possible with out buffering. • RST :Reset the connection if host has crashed or to reject invalid segment. • SYN : used to establish connection. Connection request has Ack = 0 and SYN = 1 indicating piggybacking is not used.ACK =1 SYN = 1 indicates connection reply. SYN with ACK is used to distinguish between connection request and connection accepted. • FIN :is used to release connection. It tells sender has no more data to transmit.

  26. TRANSPORT LAYER • Window size: (sliding window protocol) Flow control in TCP uses variable size window.The amount of data that the receiver is willing to accept i.e. How many bytes data can be send starting at the byte acknowledged. • Checksum :a number that is computed to ensure the integrity the segment header and data. It is set to 0 and data field is padded out with extra zero bytes if its length is odd number . • The checksum algorithm adds up all 16 bit words in 1s complement and then take 1s complement of the sum • Pseudo header is included in TCP and UDP checksum which contains source and destination address, protocol number, TCP = 6, TCP segment length • Options : • Each host can specify maximum TCP payload that can be accepted • Selective repeat or go back n can be specified.

  27. TRANSPORT LAYER • TCP Connection Management: • Connections are established using TCP with 3 way handshake. • To establish connection 1 side waits for the incoming connection by executing Listen and Accept primitives • Other side executes Connect primitive specifying the IP address and the port to which it wants to connect, maximum TCP segment size is accepted. • The Connect primitive sends TCP segment with SYN =1 and ACK =0 and waits for response. • When segment arrives the destination TCP entity checks if process has done Listen on the port given in destination field if not it sends reply RST bit 1 to reject the connection • If process is Listening to port, that process is given incoming TCP segment. If it accepts it gives an acknowledgement. • Listen: allocates space to queue incoming calls.

  28. Connection establishment using three-way handshaking

  29. Data transfer

  30. Connection termination using three-way handshaking

  31. Well-known ports used by TCP

  32. TRANSPORT LAYER • UPD :User Data Protocol : • It gives a facility to send data with out establishing the connection. • In UDP only 1 request and 1 response is present. • UDP segment has 8 byte header • Source and destination ports identify the end points. • UDP length includes header and data • UDP checksum : UDP header and data are padded out to even numbers of bytes if needed. checksum is 0 if not computed for such a data where quality does not matter digitized voice. • DNS systems use UDP to send and receive short messages between client and server. 32 bits Source port Destination Port UDP Length UDP checksum

  33. Application Application-layer protocol Underlying Transport Protocol electronic mail SMTP  TCP remote terminal access  Telnet  TCP Web HTTP  TCP file transfer FTP  TCP remote file server NFS  typically UDP streaming multimedia proprietary  typically UDP Internet telephony proprietary  typically UDP Network Management SNMP typically UDP Routing Protocol RIP typically UDP Name Translation DNS typically UDP

  34. Well-known ports used with UDP

  35. SCTP: Stream Control Transmission Protocol • Stream Control Transmission Protocol (SCTP) is a new reliable, message-oriented transport layer protocol. • SCTP is a message-oriented, reliable protocol that combines the best features of UDP and TCP • SCTP designed for Internet applications that have recently been introduced • Some SCTP applications are :

  36. SCTP: Stream Control Transmission Protocol • Features of SCTP: • A connection is said as association • It can involve multiple stream service in each connection • So if there is block on one stream, data can be passed on from other. • The SCTP has multiple IP addresses for each end i.e. multihoming. • SCTP can have multiple source and destination • It offers full duplex communication • Data in SCTP is referred as Chunk • Numbering is done as Transmission Sequence No.(TSN) instead of seq. no . in TCP, TSN is 32 bit • Stream Identifier (SI) is used to differentiate between the data streams. • To differentiate between different data chunks of same stream SCTP uses Stream Sequence number (SSN) • TCP has segments and SCTP has packets • Control Info. and data info. are carried on separate chunks. So ack. are given in data and control chunk resp. • Data Chunks are identified using TSN, SI and SSN

  37. Multiple-stream concept An association in SCTP can involve multiple streams

  38. Transmission Seq. no. 1 Stream Identifier 1 Stream Identifier 2 Stream Identifier 3 SSN 1 SSN2 SSN 3 Stream Sequence number SSN for every data Chunk

  39. Multihoming concept • SCTP association allows multiple IP addresses for each end. • In SCTP, a data chunk is numbered using a TSN • To distinguish between different streams, SCTP uses an SI. • To distinguish between different data chunks belonging to the same stream, SCTP uses SSNs. • TCP has segments; SCTP has packets. • In SCTP, control information and data information are carried in separate chunks.

  40. Data chunks are identified by three items: TSN, SI, and SSN. TSN is a cumulative number identifying the association; SI defines the stream; SSN defines the chunk in a stream. In SCTP, acknowledgment numbers are used to acknowledge only data chunks; control chunks are acknowledged by other control chunks if necessary.

  41. SCTP packet format General header In an SCTP packet, control chunks come before data chunks

  42. Chunks A connection in SCTP is called an association No other chunk is allowed in a packet carrying an INIT or INIT ACK chunk. A COOKIE ECHO or a COOKIE ACK chunk can carry data chunks

  43. Four-way handshaking In SCTP, only DATA chunks consume TSNs; DATA chunks are the only chunks that are acknowledged.

  44. Simple data transfer The acknowledgment in SCTP defines the cumulative TSN, the TSN of the last data chunk received in order.

  45. Association termination

  46. Benefits of SCTP include: • Multihoming support, where one (or both) endpoints of a connection can consist of more than one IP address, enabling transparent fail-over between redundant network paths. • Delivery of data in chunks within independent streams - this eliminates unnecessary head of line blocking , as opposed to TCP byte-stream delivery. • Path Selection and Monitoring - Selects a "primary" data transmission path and tests the connectivity of the transmission path. • Validation and Acknowledgment mechanisms - Protects against flooding attacks and provides notification of duplicated or missing data chunks. • Improved error detection suitable for jumbo Ethernet frames.

  47. Comparison of TCP UDP and SCTP

  48. Feature Name TCP UDP SCTP Connection Oriented Yes No Yes Reliable Transport Yes No Yes Preserve Message No Yes Yes preserved Ordered Delivery Yes No Yes Unordered Delivery No Yes Yes Data Checksum Yes Yes Yes Path MTU Yes No Yes Congestion Control Yes No Yes Multiple streams No No Yes Multi-homing No No Yes support Bundling No No Yes

More Related