awesome-everything RU
↑ Back to the climb

Networking & Protocols

The physical link: code and trace reading

Crux Read a BDP calculation, an ethtool counter dump, an SQM shaping config, and a leaf oversubscription sum — then pick the read a senior engineer would make.
Your altitude — climbing toward senior
ZeroJuniorMiddleSenior
You are at senior altitude — in orbit
◷ 14 min

Physical-link problems are diagnosed in counters, configs, and back-of-envelope sums — not prose. Read each artifact, predict the behaviour, and choose the move a senior engineer makes first.

Goal

Practise the loop you run on every link incident: read the number or the config, decide whether you are fighting physics or a misconfiguration, and reach for the right lever.

Snippet 1 — the receive window on a fat pipe

# Intercontinental fibre: 10 Gbps link, 160 ms RTT (NYC -> Sydney)
bandwidth_bps = 10_000_000_000
rtt_s         = 0.160
bdp_bytes     = bandwidth_bps * rtt_s / 8       # bytes in flight at saturation

rcv_window    = 64 * 1024                        # legacy default, no window scaling
print(bdp_bytes)                                 # 200_000_000  -> 200 MB
print(bdp_bytes / rcv_window)                    # ~3125

Snippet 2 — the interface counters

$ ethtool -S eth0 | grep -E 'rx_crc|rx_errors|link'
     rx_crc_errors: 48213
     rx_errors:     48213
$ ethtool eth0 | grep -E 'Speed|Duplex'
     Speed: 1000Mb/s
     Duplex: Full

Snippet 3 — the SQM shaping config

# tc / CAKE on the WAN egress of a 40 Mbps-uplink home router
tc qdisc replace dev wan root cake bandwidth 36Mbit docsis
#                                            ^^^^^^^ shaped BELOW the 40 Mbps line rate

Snippet 4 — the leaf oversubscription sum

# One leaf switch in a GPU pod
downlinks_to_servers = 8 * 200e9      # 8 servers x 200 Gbps RoCE NICs
uplinks_to_spines    = 2 * 400e9      # 2 x 400 Gbps to spines

oversub = downlinks_to_servers / uplinks_to_spines
# = 1.6 Tbps / 0.8 Tbps = 2.0   ->  2:1
Recap

Every artifact pointed at the same separation: a 64 KB window on a 200 MB-BDP path is a throughput bug (raise the window, not the cable); climbing rx_crc_errors is a corrupted signal (swap the cable/SFP, never ignore it); CAKE shaped below line rate moves the bottleneck queue where you can discipline it; and a 2:1 leaf throttles an all-to-all collective by half. Read the number, decide physics-versus-config, then pick the matching lever.

Continue the climb ↑The physical link: audit and tame a real link
shortcuts expand
search
K
prev piece
k
next piece
j
cycle tier
t
this menu
?
sources3
expand
  1. 01
  2. 02
  3. 03

Trademarks belong to their respective owners. Editorial reference only.