2.5.Layer 4: The Transport Layer
Last updated
Was this helpful?
Last updated
Was this helpful?
The transport layer, acts as a dividing line between the upper layers and lower layers of the OSI model.
Specifically, messages are taken from upper layers (Layers 5–7) and are encapsulated into segments for transmission to the lower layers (Layers 1–3).
Similarly, data streams coming from lower layers are decapsulated and sent to Layer 5 (the session layer), or some other upper layer, depending on the protocol.
Two common transport layer protocols include Transmission Control Protocol (TCP) and User Datagram Protocol (UDP):
1.1.Transmission Control Protocol (TCP)
A connection-oriented transport
protocol.
Connection-oriented transport protocols provide reliable transport, in that if a segment is dropped, the sender can detect that drop and retransmit that dropped segment.
Based on acknowledgments, a sender can determine which segments were successfully received and which segments need to be transmitted again.
1.2.User Datagram Protocol (UDP)
A connectionless transport protocol.
Connectionless transport protocols provide unreliable transport, in that if a segment is dropped, the sender is unaware of the drop, and no retransmission occurs.
Just as Layer 2 and Layer 3 each offer flow control services, flow control services also exist at Layer 4. Two common flow control approaches at Layer 4 are as follows:
2.1.Windowing
As illustrated in Figure , TCP uses a sliding window, where the window size begins with one segment.
If there is a successful acknowledgment of that one segment (that is, the receiver sends an acknowledgment asking for the next segment), the window size doubles to two segments.
Upon successful receipt of those two segments, the next window contains four segments.
This exponential increase in window size continues until the receiver does not acknowledge successful receipt of all segments within a certain time period (known as the round-trip time [RTT], which is sometimes called real transfer time ), or until a configured maximum window size is reached.
2.2.Buffering
With buffering, a device (for example, a router) allocates a chunk of memory (sometimes called a buffer or a queue ) to store segments if bandwidth is not currently available to transmit those segments.
A queue has a finite capacity, however, and can overflow (that is, drop segments) in the event of sustained network congestion.