Review & Cheat Sheet

[!TIP] Study Method: Use the Flashcards to test your “Active Recall”. If you get stuck, go back to the relevant chapter.

1. Interactive Flashcards (Active Recall)

Master the core concepts before moving to the next module.

What is the "Head-of-Line Blocking" problem in HTTP/1.1?
One slow request blocks all subsequent ones on the same TCP connection. Solved by HTTP/2 Multiplexing.
Why UDP for Gaming/VoIP?
UDP prioritizes Latency over Reliability. No retransmissions means no "waiting" for old frames.
gRPC vs REST Speed?
gRPC is faster due to Protobuf (Binary) and HTTP/2 (Persistent/Multiplexed).
Connection Migration?
HTTP/3 (QUIC) uses Connection IDs instead of IP:Port, allowing seamless network switching.
How does BBR Congestion Control work?
It actively probes the network for Max Bandwidth and Min RTT, rather than waiting for packet loss like CUBIC.
Why are L7 Load Balancers slower than L4?
L7 must decrypt TLS, parse headers (User Space), and re-encrypt. L4 just forwards packets in Kernel Space (eBPF).
What is the "Thundering Herd" in WebSockets?
When a server restarts, all clients reconnect at once, DDoS-ing the system. Solved by adding Jitter.
Can Browsers speak raw gRPC?
No. Browsers lack low-level HTTP/2 framing access. You need gRPC-Web and an Envoy Proxy.
Which CLI tool is best for debugging DNS resolution?
dig (Domain Information Groper). e.g., dig google.com.
Which CLI tool debugs SSL/TLS Handshakes?
openssl s_client. Useful for checking certificate expiry and issuer chains.
What is the first step of a Web Request (before TCP)?
DNS Resolution. The browser must resolve the domain to an IP address (via UDP Port 53).
What is "Fanout" in a Chat System?
The process of delivering one incoming message to multiple subscribers (often using Redis Pub/Sub).
What makes QPACK different from HPACK?
QPACK (HTTP/3) allows out-of-order header compression, preventing HOL blocking if a packet is lost. HPACK (HTTP/2) requires strict ordering.
What is gRPC Status Code 0?
OK. Unlike HTTP 200, gRPC uses an Enum where 0 = Success.
What is eBPF/XDP?
A kernel technology allowing sandboxed programs to run in the OS kernel. Used for ultra-fast L4 Load Balancing and packet filtering.
Key benefit of TLS 1.3 over 1.2?
Faster Handshake (1 RTT vs 2 RTT) and removed obsolete insecure cipher suites.
What is "Backpressure"?
A feedback mechanism where a slow consumer tells the producer to slow down (e.g., TCP Window Size = 0).
What is "Idempotency"?
The property where performing an operation multiple times has the same effect as performing it once (e.g., retrying a Payment).
What is MTU and why does it matter?
Maximum Transmission Unit (usually 1500 bytes). Sending packets larger than MTU causes IP Fragmentation, where a single lost fragment requires retransmitting the whole packet.
What is Nagle's Algorithm vs Delayed ACK?
A "deadlock" where Sender waits for data and Receiver waits for ACK. Fix with TCP_NODELAY.
What is ALPN?
Application-Layer Protocol Negotiation. How TLS negotiates HTTP/2 (h2) support during the handshake.
Why do WebSockets need Sticky Sessions?
Because WebSockets are stateful. If a connection drops, the Load Balancer must send the user back to the same server.
What is Context Propagation (Deadlines)?
Passing the remaining time (Timeout) from Service A → B → C to prevent cascading hangs.
What is ICMP used for?
Error reporting (e.g., "Destination Unreachable", "Time Exceeded"). It is a helper protocol for IP.
What is WebTransport?
A modern API over HTTP/3 allowing both reliable streams and unreliable datagrams (like UDP) in the browser.
CUBIC vs BBR Congestion Control?
CUBIC slows down on Packet Loss. BBR ignores loss and models the network based on Bandwidth & RTT.
What is the risk of using 0-RTT in QUIC?
Replay Attacks. Since the request is sent with the first packet, an attacker can capture it and send it again. Solved by only using 0-RTT for GET requests.
What is "TCP Fast Open" (TFO)?
A mechanism to send data in the SYN packet, achieving 0-RTT for subsequent connections. Saves 1 full RTT.
How do SYN Cookies protect against DDoS?
By encoding connection state in the Sequence Number rather than allocating RAM (TCB) for half-open connections.
What is "Varint" encoding in Protobuf?
Variable-length integer encoding that uses only 1 byte for numbers < 128. MSB is the continuation bit.
What is "UDP Hole Punching"?
A NAT traversal technique where P2P clients send packets to each other to create temporary mappings in their routers.

2. Protocol Decision Matrix (Cheat Sheet)

Requirement Best Choice The "Why"
Public API (Stripe, Twilio) REST / JSON Interoperability. Every language supports JSON.
Internal Microservices gRPC (Protobuf) Extreme speed + Type safety via .proto files.
Real-Time Chat / Games WebSockets True bidirectional (Full Duplex) low latency.
Unstable Mobile Nets HTTP/3 (QUIC) No HOL blocking at L4; Connection Migration.
Video Conferencing UDP / WebRTC Latency is king. Dropping frames is okay.

3. The “Network Warrior” Checklist

Before moving to Module 03, ensure you can explain:

  1. How a packet travels from L4 → L3 → L2 (Encapsulation).
  2. Why TCP Flow Control (Receiver RAM) is different from Congestion Control (Network Bandwidth).
  3. What a TCP Offload Engine (TOE) does and why it saves CPU.
  4. How HPACK/QPACK solve the “Binary Branch Predictor” problem in CPUs.
  5. Why Connection Migration in QUIC is the ultimate fix for the “Parking Lot Problem”.

Module 02: COMPLETE

You have mastered the foundational plumbing of the Internet.

Proceed to Module 03

4. Module 02 Mnemonic Recall

All the memory aids from this module in one place:

Mnemonic Stands For Chapter
P-D-N-T-S-P-A “Please Do Not Throw Sausage Pizza Away” — 7 OSI layers bottom to top Ch 01: OSI Model
Ping → Telnet → Curl The 3-step debugging ladder (L3 → L4 → L7) Ch 01: Debugging
R for Receiver Flow Control (rwnd) protects the Receiver’s buffer Ch 02: TCP
C for Crowd Congestion Control (cwnd) protects the Internet (the Crowd) Ch 02: TCP
1 Car → Many Lanes → Open Highway HTTP/1.1 → HTTP/2 → HTTP/3 evolution Ch 03: HTTP
Jitter = Thundering Herd Fix Random reconnect delay prevents the self-DDoS Ch 04: WebSockets
Varints = Micro-Optimization Byte-saving integer encoding for internal wire speed Ch 05: gRPC
Deadline Budget Propagation Pass remaining timeout, not a fresh timeout, to downstream services Ch 05: gRPC

5. Staff Engineer Challenge: The “Network Stack” Scenario

The Scenario: Your team is building a global ride-sharing platform. Engineers want to use WebSockets for driver location updates, REST for the booking API, and UDP for the voice chat feature.

The Questions:

  1. A driver’s phone switches from WiFi to 4G mid-trip. The WebSocket drops. What is the minimum code change to make this seamless? (Hint: which HTTP version?)
  2. Your gRPC booking service shows 100% traffic on Server A, 0% on Server B. What is the most likely cause, and what is the fix?
  3. You hit 100,000 concurrent driver WebSocket connections and your server runs out of file descriptors. What two system-level changes fix this?