Module Review
In this module, we explored the logic of end-to-end communication:
Key Takeaways
- TCP: Reliable, connection-oriented protocol that handles multiplexing, flow control, congestion control, and ordered delivery at the cost of higher latency and OS kernel overhead.
- UDP: Fast, stateless, connectionless protocol that provides simple multiplexing with virtually no overhead, ideal for real-time applications where packet loss is acceptable.
- Multiplexing: Both TCP and UDP use ports to distinguish between multiple applications running on the same host.
- Flow Control: Uses a sliding window mechanism bounded by the receiver’s available buffer space to prevent the sender from overwhelming the receiver.
- Congestion Control: Uses algorithms like Slow Start and AIMD to infer network capacity based on packet loss and prevent routers from overflowing.
- Reliability: Achieved via sequence numbers for ordering, checksums for integrity, and retransmission timers (RTO) with cumulative or selective ACKs for loss recovery.
Flashcards
What is the size of the UDP header?
8 Bytes.
What is the difference between SYN and ACK?
SYN (Synchronize) requests a new connection. ACK (Acknowledge) confirms receipt of a segment.
What mechanism prevents a fast sender from overwhelming a slow receiver?
Flow Control (Sliding Window).
What does AIMD stand for in congestion control?
Additive Increase, Multiplicative Decrease.
Why is UDP preferred for live gaming or video streaming?
It provides lower latency by omitting handshakes and retransmissions.
Cheat Sheet
| Concept | Description | Key Components/Values |
|---|---|---|
| TCP | Reliable, connection-oriented, high overhead | 20-60 byte header, Handshake, Sequence/ACKs, State |
| UDP | Best-effort, connectionless, low overhead | 8 byte header (Src Port, Dest Port, Len, Checksum) |
| Flow Control | Protects receiver’s memory buffer | Sliding Window, Receiver Window (rwnd), Zero Window |
| Congestion Control | Protects network routers from dropping packets | Congestion Window (cwnd), Slow Start, AIMD |
| Reliability | Ensures data integrity and delivery | Checksum (Integrity), Retransmission Timer (Loss) |
Quick Revision
- TCP 3-Way Handshake: SYN → SYN-ACK → ACK.
- TCP 4-Way Teardown: FIN → ACK → FIN → ACK.
- Congestion Collapse: Occurs when router queues fill up and massive packet loss triggers synchronized retransmissions.
- Slow Start: Exponential growth of the congestion window until a threshold is met.
- AIMD: Linear growth during stable periods, halved window upon packet loss.
- Hardware Offload: Modern NICs can compute TCP/UDP checksums directly to save CPU overhead.
Next Steps
In the next module, we reach the top of the stack: the Application Layer. We’ll explore HTTP, DNS, SMTP, and how your favorite apps talk to the world.
Review the Networks Glossary for term definitions.