1. TCP internals
ss -ti shows per-socket TCP info including the current congestion window and round-trip time.
ss -tiTyporithm · hard
Step 1 of 8 · intro card
L4 — Transport Layer
Flow control protects the receiver: the advertised receive window (rwnd) caps how much unacknowledged data is in flight. Congestion control protects the network: the sender's congestion window (cwnd) grows via slow start then congestion avoidance (cubic/bbr). ACKs clock the window, and window scaling enables large windows on high bandwidth-delay paths.
Flow control keeps a fast sender from overwhelming a slow receiver. The receiver advertises a receive window (rwnd) — the amount of data it can buffer — and the sender keeps in-flight, unacknowledged data within that limit.
Congestion control instead protects the shared network. The sender maintains a congestion window (cwnd) that grows from a small value during slow start, then more cautiously during congestion avoidance. Algorithms like cubic and bbr decide exactly how cwnd reacts to ACKs and loss.
The sender may send only up to the smaller of rwnd and cwnd. Incoming ACKs clock the window forward, releasing more data as bytes are confirmed. On long, fast paths the basic 16-bit window is too small, so window scaling multiplies it to keep the pipe full.
rwnd (receiver) is flow control; cwnd (sender) is congestion control.
cwnd grows via slow start, then congestion avoidance (cubic/bbr).
Window scaling enables large windows on high bandwidth-delay paths.
ss -ti
sysctl net.ipv4.tcp_congestion_control
# rwnd (receiver) vs cwnd (sender)
sysctl net.ipv4.tcp_window_scaling
tc qdisc showConnect each part of the code to the concept before you type.
ss -ti shows per-socket TCP info including the current congestion window and round-trip time.
ss -tiThis sysctl reports the active congestion-control algorithm, such as cubic or bbr.
sysctl net.ipv4.tcp_congestion_controlrwnd is the receiver's flow-control window; cwnd is the sender's congestion window. The sender uses the smaller of the two.
# rwnd (receiver) vs cwnd (sender)Window scaling lets the advertised window exceed 64 KB, needed for high bandwidth-delay paths.
sysctl net.ipv4.tcp_window_scalingtc qdisc show lists the queueing disciplines that shape how packets leave each interface.
tc qdisc showRead the concept map and follow the code breakdown.
Type the implementation, repair mistakes and work through every recall exercise.
Use the final check without hints; revisit weak concepts in short practice sessions.