Transport Layer Protocols
The Transport Layer operates exactly between the Application Layer and the Network Layer. While the Network Layer successfully routes packets between different devices, the Transport Layer ensures that data reaches the specific software process running on those devices.
To achieve this process to process delivery, the Transport Layer relies on 16 bit port numbers and specialized protocols that dictate exactly how data is managed, ordered, and delivered.
1. User Datagram Protocol (UDP)
UDP is a connectionless transport protocol. It is incredibly fast but highly unreliable. It does not establish a connection before sending data, it does not check if the data arrived, and it never retransmits lost packets.
Because it skips all error checking and connection overhead, it is used when raw speed is far more important than perfect accuracy. For example, during a live video call or online gaming, dropping a few frames of data is acceptable, but waiting for retransmissions would cause terrible lag.
UDP Segment Header Fields
- Source Port (16 bits): Identifies the exact application sending the data.
- Destination Port (16 bits): Identifies the exact application receiving the data.
- Length (16 bits): The total size of the UDP header plus the data.
- Checksum (16 bits): Provides basic error detection for the header and data.
| Advantages of UDP | Disadvantages of UDP |
|---|---|
| Extremely fast data transmission with no setup delay. | No guarantee of delivery. |
| Low overhead because the header is only 8 bytes. | No congestion control, which can flood networks. |
| Supports broadcast and multicast communication. | No sequencing; packets may arrive out of order. |
2. Transmission Control Protocol (TCP)
TCP is the exact opposite of UDP. It is a strictly connection oriented protocol that provides guaranteed, reliable, and error free data delivery. It establishes a virtual connection using a three way handshake before any data is sent.
For example, when you download a file or load a webpage, every single byte must arrive perfectly. If a packet is lost, TCP automatically detects the loss and forces a retransmission until the data is whole.
TCP Segment Header Fields
- Source and Destination Ports: Identify the sending and receiving applications.
- Sequence Number: Tracks the exact order of the bytes being sent.
- Acknowledgement Number: Indicates the exact next byte the receiver expects to get.
- Control Flags: Special bits like SYN, ACK, and FIN used to manage the connection state.
- Window Size: Used for flow control to explicitly tell the sender how much data the receiver can currently handle.
| Advantages of TCP | Disadvantages of TCP |
|---|---|
| Guarantees reliable, error free data transmission. | Significantly slower compared to UDP. |
| Provides both flow control and congestion control. | High overhead due to a large 20 to 60 byte header. |
| Automatically retransmits any lost or corrupted packets. | Does not support broadcast or multicast. |
3. Stream Control Transmission Protocol (SCTP)
SCTP is a modern, reliable, connection oriented protocol that combines the speed of UDP with the reliability of TCP.
Its greatest feature is Multihoming. If a computer has multiple network connections (like wired and wireless simultaneously), SCTP can use multiple paths for a single connection. For example, if the wireless connection suddenly drops during a secure telephony call, SCTP will seamlessly failover to the wired connection without dropping the call.
Detailed Comparison: TCP vs UDP
| Feature | Transmission Control Protocol (TCP) | User Datagram Protocol (UDP) |
|---|---|---|
| Connection Type | Connection Oriented. | Connectionless. |
| Reliability | High reliability with guaranteed delivery. | Low reliability with best effort delivery. |
| Speed | Slower due to handshakes and acknowledgements. | Extremely fast. |
| Error Checking | Extensive checking with mandatory retransmission. | Basic checksum only, no retransmission. |
| Header Size | Variable (20 to 60 bytes). | Fixed at exactly 8 bytes. |
| Primary Use Case | Web browsing, email, and secure file transfers. | Live video streaming, voice calls, and fast paced gaming. |
Sort the Concepts
Test your knowledge! Sort the characteristics into the correct protocol.
