Transport Layer Services
Transport Layer Services
The transport layer occupies a unique position in networking models: it is the second layer in the
TCP/IP model (above the Network layer) and the fourth layer in the OSI model (below the Session
layer and above the Network layer). It is fundamentally an end-to-end layer, meaning it oversees the
delivery of data from the source host to the destination host, focusing on the processes running on
those hosts rather than the intermediate network devices (which are handled by lower layers). This
end-to-end responsibility distinguishes it from the hop-to-hop focus of the Network layer. The
transport layer encapsulates data into units called segments (in TCP) or datagrams (in UDP), which
include headers with critical control information like port numbers and sequence numbers.
The transport layer acts as a bridge between the upper-layer applications and the lower-layer
network infrastructure, ensuring seamless data transfer across potentially unreliable networks.
o The transport layer receives a message (a stream of bytes) from the Application
layer.
o It performs segmentation, dividing the message into smaller chunks (segments) to fit
within network constraints, such as the Maximum Segment Size (MSS), which is
derived from the network’s Maximum Transmission Unit (MTU) minus header
overhead.
▪ Source and destination port numbers: To identify the sending and receiving
processes (e.g., port 80 for HTTP).
o The segmented data is then passed to the Network layer for encapsulation into
packets and transmission over the network.
o The transport layer receives segments from the Network layer (after they’ve been
stripped of IP headers).
This bidirectional process ensures that applications can communicate reliably without needing to
handle low-level network details.
The transport layer performs several critical functions to enable robust communication. Below is a
detailed breakdown of each responsibility:
1. Process-to-Process Delivery
• Concept: Unlike the Data Link layer (which uses MAC addresses for device-to-device delivery)
or the Network layer (which uses IP addresses for host-to-host routing), the transport layer
ensures process-to-process delivery by identifying specific applications or services running
on a host.
• Mechanism: It uses port numbers, 16-bit identifiers (ranging from 0 to 65,535), to pinpoint
processes. Ports are categorized as:
o Well-known ports (0–1023): Assigned to standard services (e.g., 22 for SSH, 80 for
HTTP).
• Example: A web browser (ephemeral port 49152) on Host A communicates with a web
server (port 80) on Host B. The transport layer ensures the browser’s request reaches the
server process, not another application like an email server (port 25).
• Technical Detail: The combination of an IP address and port number forms a socket (e.g.,
192.168.1.1:80), uniquely identifying each endpoint in a connection.
2. End-to-End Connection Between Hosts
• Concept: The transport layer establishes and manages connections between the source and
destination hosts, ensuring data flows reliably from end to end.
• Protocols:
▪ Use Cases: File transfers (FTP), email (SMTP), web browsing (HTTP/HTTPS).
▪ Use Cases: Real-time applications like video streaming (e.g., RTP over UDP),
DNS queries, and VoIP.
• Details: TCP maintains connection state (e.g., ESTABLISHED, FIN_WAIT) using a finite state
machine, while UDP is stateless, sending each datagram without tracking prior interactions.
• Example: TCP ensures a downloaded file is complete, while UDP allows a video to play even
if some frames are dropped, prioritizing speed.
3. Multiplexing and Demultiplexing
• Concept: The transport layer enables multiple applications on a single host to share the
network connection simultaneously.
o Collects data from various processes (e.g., a browser, email client, and chat app).
o Combines the data into a single stream of segments, each tagged with source and
destination ports.
o Example: A host sends HTTP data (port 80) and SMTP data (port 25) in interleaved
segments over the same IP connection.
o Distributes the data to the correct process (e.g., HTTP to the browser, SMTP to the
email client).
• Technical Detail: This relies on the socket concept (IP + port) and the transport layer’s ability
to parse headers efficiently.
• Concept: Congestion occurs when too much data floods the network, overwhelming routers
and causing packet loss. The transport layer mitigates this, primarily via TCP.
• Mechanisms:
▪ Multiplicative Decrease: Halves the sending rate upon detecting packet loss
(e.g., via duplicate ACKs or timeouts).
• UDP Note: UDP doesn’t provide congestion control—applications using UDP must implement
it if needed.
• Example: During a file download, TCP slows down if the network is congested, preventing
further packet loss, while UDP might continue sending, risking dropped packets in a video
stream.
5. Data Integrity and Error Correction
• Concept: Ensures data arrives uncorrupted and complete, a key feature of TCP but optional
in UDP.
• Mechanisms:
o Checksum: Each segment includes a 16-bit checksum calculated over the header and
data. The receiver recomputes it; if it mismatches, the segment is discarded, and TCP
requests retransmission (via timeout or lack of ACK).
o Sequence Numbers: Track segment order and detect missing or duplicated data.
Example: If segments 1, 2, and 4 arrive, TCP requests retransmission of 3.
o Negative ACKs (NACKs): Rarely used in TCP but supported in some protocols to
explicitly request missing data.
• UDP Detail: Includes a checksum but doesn’t retransmit—error handling is left to the
application.
• Example: TCP ensures a financial transaction’s data is intact, while UDP might tolerate minor
corruption in a live audio stream.
6. Flow Control
• Concept: Prevents a fast sender from overwhelming a slow receiver, ensuring no data is lost
due to buffer overflow.
o The sender limits its transmission to this size, pausing if the window reaches zero.
o As the receiver processes data, the window “slides” forward, allowing more
transmissions.
• Details: The window size is dynamic, shrinking under heavy load and expanding as the
receiver catches up.
• Example: A server sending a large file adjusts its rate based on the client’s ability to process,
avoiding buffer overruns.
The transport layer supports various protocols, each tailored to specific needs. Here’s a detailed look
at the most notable ones:
Conclusion