This chapter will examine the role of the Transport layer in encapsulating application data for use by the Network layer.
Consider a computer connected to a network that is simultaneously receiving and sending e-mail and instant messages, viewing websites, and conducting a VoIP phone call.
What applications need reliability?
The two most common Transport layer protocols of TCP/IP protocol suite are Transmission Control Protocol (TCP) and User Datagram Protocol (UDP). Both protocols manage the communication of multiple applications.
The key distinction between TCP and UDP is reliability.
Within the TCP segment header, there are six 1-bit fields that contain control information used to manage the TCP processes. Each of these fields is only 1 bit and, therefore, has only two values: 1 or 0. When a bit value is set to 1, it indicates what control information is contained in the segment. SYN bit is used in establishing a TCP connection to synchronize the sequence numbers between both endpoints. ACK bit is used to acknowledge the remote host’s sequence numbers, declaring that the information in the acknowledgment field is valid. PSH flag is set on the sending side, and tells the TCP stack to flush all buffers and send any outstanding data up to and including the data that had the PSH flag set. When the receiving TCP sees the PSH flag, it too must flush its buffers and pass the information up to the application. URG bit indicates that the urgent pointer field has a valid pointer to data that should be treated urgently and be transmitted before non-urgent data. RST bit tells the receiving TCP stack to immediately abort the connection. FIN bit is used to indicate that the client will send no more data (but will continue to listen for data).
1. Syn = Prev Syn+1; 2. Ack = Rx Syn+1;
In the above example, the initial window size for a TCP session represented is set to 3000 bytes. When the sender has transmitted 3000 bytes, it waits for an acknowledgement of these bytes before transmitting more segments in this session. Once the sender has received this acknowledgement from the receiver, the sender can transmit an additional 3000 bytes.
Another way to control the data flow is to use dynamic window sizes.