Transport Layer
UDP and TCP — multiplexing, reliable delivery, flow control, congestion control, the algorithms that make the Internet work.
The transport layer is the most-asked-about networking topic in interviews because almost everything you build runs on top of it. UDP is short (a header, a checksum, a payload); TCP is long (handshake, flow control, congestion control, retransmission, teardown). Both reward depth — engineers who can explain AIMD or the three-way handshake clearly stand out.
The modern story includes QUIC (a transport built on UDP that solves TCP's connection-establishment cost) — worth knowing as part of HTTP/3's adoption.
Key concepts
- Transport multiplexes app traffic onto IP — ports are how
- UDP is fire-and-forget; TCP adds reliability, ordering, flow control, congestion control
- Three-way handshake (SYN, SYN-ACK, ACK) opens; four-way (FIN, ACK, FIN, ACK) closes
- Sliding window + cumulative ACK is how Go-Back-N and TCP both work
- Congestion control (AIMD, slow start, fast retransmit) is what prevents Internet collapse
Reference template
// TCP's machinery, in order
1. Open (3-way handshake)
2. Reliable (sequence numbers, ACKs, retransmits)
3. In-order (receiver buffers + reorders)
4. Flow (advertised window — receiver-side limit)
5. Congestion (cwnd — sender-side limit)
6. Close (4-way: FIN/ACK both ways) Adapt to your problem; the structure is the load-bearing part.
Common pitfalls
- Confusing flow control (receiver protection) with congestion control (network protection)
- Forgetting that TCP without window scaling caps at 64KB in-flight — fine on LAN, terrible across continents
- Treating UDP as 'fast TCP' — UDP has zero delivery guarantees, you write them at the app layer (or use QUIC)
- Skipping TLS overhead when reasoning about HTTP performance
Related topics
Items (7)
- What Is the Transport Layer?
End-to-end delivery over an unreliable IP network. Multiplexing, demultiplexing, and the reliability spectrum.
Concept Foundational - UDP — User Datagram Protocol
Connectionless, unreliable, lightweight. The header, the checksum, and the cases where UDP is the right answer.
Building Block Foundational - TCP Fundamentals — Header, Handshake, Teardown
Three-way handshake, four-way close, sequence/ack numbers, the flags (SYN/ACK/FIN/RST/PSH/URG), what each enables.
Building Block Foundational - Reliable Data Transfer — ARQ, Sliding Window, Go-Back-N
Stop-and-wait → Go-Back-N → Selective Repeat. The recipe TCP refines into its flow- and congestion-control machinery.
Concept Intermediate - TCP Flow Control and Window Scaling
The receive window, advertised window, zero-window probes, and the window-scaling option that fixed the 64KB limit.
Building Block Intermediate - TCP Congestion Control — AIMD, Slow Start, Fast Retransmit
The four canonical algorithms (slow start, congestion avoidance, fast retransmit, fast recovery) and why AIMD converges to fairness.
Building Block Intermediate - SYN Floods and TCP-Layer Attacks
Half-open connections, SYN cookies, retransmission timeouts — the security and resilience knobs on TCP.
Concept Intermediate