Download Understanding the Role of Transport Layer in Data Communication and Reliability and more Slides Computer Networks in PDF only on Docsity!
TCP and UDP
Layer 3 of the TCP/IP protocol stack. Transport layer
I. Introduction. On a single device, people can use multiple services such as e-mail, the web, and instant messaging to send messages or retrieve information. Applications such as e-mail clients, web browsers, and instant messaging clients allow people to use computers and networks to send messages and find information. Data from each of these applications is packaged, transported, and delivered to the appropriate server daemon or application on the destination device. The processes described in the OSI Transport layer accept data from the Application layer and prepare it for addressing at the Network layer. The Transport layer is responsible for the overall end-to-end transfer of application data. The role of the Transport layer is encapsulating application data for use by the Network layer. The Transport layer also encompasses these functions: a). Enables multiple applications to communicate over the network at the same time on a single device b). Ensures that, if required, all the data is received reliably and in order by the correct application c). Employs error handling mechanisms
II. Purpose of Transport Layer
- Tracking the individual communication between applications on the source and destination hosts: Any host may have multiple applications that are communicating across the network. Each of these applications will be communicating with one or more applications on remote hosts. It is the responsibility of the Transport layer to maintain the multiple communication streams between these applications.
- Segmenting data and managing each piece: As each application creates a stream data to be sent to a remote application, this data must be prepared to be sent across the media in manageable pieces. The Transport layer protocols describe services that segment this data from the Application layer. This includes the encapsulation required on each piece of data. Each piece of application data requires headers to be added at the Transport layer to indicate to which communication it is associated.
- Identifying the different applications: In order to pass data streams to the proper applications, the Transport layer must identify the target application. To accomplish this, the Transport layer assigns an application an identifier. The TCP/IP protocols call this identifier a port number. Each software process that needs to access the network is assigned a port number unique in that host. This port number is used in the transport layer header to indicate to which application that piece of data is associated. III. Reliable Communication Different applications have different requirements for their data, and therefore different Transport protocols have been developed to meet these requirements. A Transport layer protocol can implement is a method to ensure reliable delivery of the data. In networking terms, reliability means ensuring that each piece of data that the source sends arrives at the destination. At the Transport layer the three basic operations of reliability are: a) tracking transmitted data b) acknowledging received data c) retransmitting any unacknowledged data
This requires the processes of Transport layer of the source to keep track of all the data pieces
of each conversation and the retransmit any of data that did were not acknowledged by
the destination. The Transport layer of the receiving host must also track the data as it is
received and acknowledge the receipt of the data.
These reliability processes place additional overhead on the network resources due to the
acknowledgement, tracking, and retransmission. To support these reliability operations,
more control data is exchanged between the sending and receiving hosts. This control
information is contained in the Transport Layer header.
2. Determining the Need for Reliability Applications, such as databases, web pages, and e-mail, require that all of the sent data arrive at the destination in its original condition, in order for the data to be useful. Any missing data could cause a corrupt communication that is either incomplete or unreadable. Therefore, these applications are designed to use a Transport layer protocol that implements reliability. The additional network overhead is considered to be required for these applications. Other applications are more tolerant of the loss of small amounts of data. For example, if one or two segments of a video stream fail to arrive, it would only create a momentary disruption in the stream. This may appear as distortion in the image but may not even be noticeable to the user.
V. Transmition Control Protocol ( TCP) The reliability of TCP communication is performed using connection-oriented sessions. Before a host using TCP sends data to another host, the Transport layer initiates a process to create a connection with the destination.
- Establishes a session between source host and source destination (this ensures that each host is prepared and aware for the connection).
- The destination host sends acknowledgements to the source for the segments that it receives.
- As the source receives an acknowledgement, it knows that the data has been successfully delivered and can quit tracking that data.
- If the source does not receive an acknowledgement within a predetermined amount of time, it retransmits that data to the destination.
- The establishment of the sessions creates overhead in the form of additional segments being exchanged.
- There is also additional overhead on the individual hosts created by the necessity to keep track of which segments are awaiting acknowledgement and by the retransmission process.
TCP Segment Structure
- Source port (16 bits) โ identifies the sending port
- Destination port (16 bits) โ identifies the receiving port
- Sequence number (32 bits) โ has a dual role
- If the SYN flag is set, then this is the initial sequence number. The sequence number of the actual first data byte (and the acknowledged number in the corresponding ACK) will then be this sequence number plus 1.
- If the SYN flag is clear, then this is the sequence number of the first data byte
- Acknowledgment number (32 bits)
- Data offset (4 bits) โ specifies the size of the TCP header in 32-bit words
- Reserved (4 bits) โ for future use and should be set to zero
- Flags (8 bits) (aka Control bits) โ contains 8 1-bit flags
- Window (16 bits) โ the size of the receive window, which specifies the number of bytes that the receiver is currently willing to receive.
- Checksum (16 bits) โ The 16-bit checksum field is used for error-checking of the header and data
- Urgent pointer (16 bits) โ if the URG flag is set, then this 16-bit field is an offset from the sequence number indicating the last urgent data byte.
TCP Connection Establishment
A sends SYN request to B
B sends ACK response and SYN request to A
A sends ACK response to B
TCP Connection Termination
A sends FIN request to B
B sends ACK response to A
B sends FIN request to A
A sends ACK response to B
TCP Segment Reassembly When services send data using TCP, segments may arrive at their destination out of order. For the original message to be understood by the recipient, the data in these segments is reassembled into the original order. Sequence numbers are assigned in the header of each packet to achieve this goal.