Transport Layer Protocols - TCP, UDP, Ports, and Reliability
Transport layer protocols connect applications across hosts. TCP emphasizes reliable byte streams, while UDP provides lightweight datagrams with minimal overhead.
Key Takeaways
TCP and UDP both use ports to identify applications.
TCP provides reliability, ordering, and flow control.
UDP provides low-overhead datagram delivery.
Transport headers sit inside IP packets.
What the transport layer does
The transport layer sits above IP and below application protocols. It identifies application endpoints with ports and defines how data should be delivered between hosts.
TCP vs UDP at this layer
TCP creates a reliable ordered byte stream with connection state. UDP sends independent datagrams without built-in delivery guarantees. Both are essential because applications have different needs.
How transport headers appear in packets
An IP packet indicates TCP or UDP with its protocol field. The transport header then starts with ports and continues with either TCP control fields or UDP length and checksum.
Practical Reference
| Item | Value | Analysis Note |
|---|---|---|
| TCP | Reliable stream | Connection setup and acknowledgments. |
| UDP | Datagram transport | Small fixed header and no handshake. |
| Ports | Application endpoints | Used by both TCP and UDP. |
| Payload | Application data | DNS, HTTP, TLS, and more. |
FAQ
Is HTTP a transport layer protocol?
No. HTTP is an application layer protocol. It usually runs over TCP, and modern HTTP can also use QUIC over UDP.
Which transport protocol is faster?
UDP has less built-in overhead, but application performance depends on reliability needs, network loss, and implementation.