Another function of the Transport layer is to employ flow control mechanisms to ensure that systems don’t send data at rates beyond what the receiving system can handle. In network environments, systems use a portion of memory referred to as buffer space to hold data that has been received more quickly than they can process it. However, once this buffer space fills, systems run the risk of dropping data that they can’t find room for. To account for this, the Transport layer on the receiving machine will pass status information to the sender, asking it to stop sending segments if its buffers become full. Once buffer space becomes available, another message is passed to the sender allowing it to resume transmission.
In order to try and regulate the flow of data between the sending and receiving systems right from the start, systems using connection-oriented communication negotiate what is referred to as a window size. The window regulates how much data can be sent before acknowledgements must be received. Once acknowledgements for data sent have been received, the sender can resume the sending of data. Some protocols (such as TCP) implement this using what are known as sliding windows.
This is best illustrated with an example. Let’s say that as part of establishing a connection, two systems agree on an 8K window size. If the sender is preparing to transfer 20K of data, it can send off the first 8K (say segments 1 through 8) before having to wait for acknowledgements. Once acknowledgements for segments 1 through 3 are received, segments 9 through 11 can be sent, and so on. The window slides as acknowledgements are received, allowing more data to be sent. When data is sent, a retransmit timer is also set at the source machine. If an acknowledgement is not received before the timer expires (perhaps because of a network problem or congestion), the sender resends the data, and resets the timer. When a receiving system’s buffers are full, it will send back a message with a zero window size.
Tip: When a protocol (like TCP) uses sliding windows for flow control, the relationship between segments sent and acknowledgements received is usually not one-to-one. For example, a destination host can generally confirm receipt of many segments with a single acknowledgement.
Other methods of flow control found at the Transport layer include multiplexing and parallelization. Multiplexing involves combining multiple segments along a single channel to better utilize bandwidth. Parallelization is a technique used on slower networks, increasing throughput by passing data to the network in parallel streams.
A great example of multiplexing is found in the HTTP 1.1 protocol, which uses TCP. Previously, browsing a website required a separate connection for each and every object to be downloaded – this included all graphics, html files, and so forth. By multiplexing different transport segments over a single connection, HTTP 1.1 eliminates the overhead associated with setting up and tearing down multiple connections.