Q&A-2Map an end-to-end packet path for diagnosis.
Answer
What I'd say first
Assume one failing flow, client 10.20.1.5:44312 → VIP 10.0.0.10:443, and that I have access to the hosts and the routers. I walk the path once forward and once in reverse, and at every boundary I record the same four things: the 5-tuple as it exists there, the encapsulation, the effective MTU, and the state that decides forwarding (route, conntrack, ACL, LB session). I do both directions because the forward path is usually healthy: the break is almost always on the return, where NAT rewrites the tuple, ECMP picks a different box, or a stateful device has no entry.
The walk
Forward, hop by hop:
- Client host.
ip route get 10.0.0.10→via 10.20.1.1 dev eth0 src 10.20.1.5. That one line gives me source selection and the first nexthop. - First router.
ip route get 10.0.0.10shows the chosen nexthop;ip route show 10.0.0.0/8shows whether it is multipath. ECMP hashes the 5-tuple, so a different source port can take a different path: that is the asymmetry seed. - LB / NAT. The VIP is DNAT'd to a backend, say
10.30.0.7:8443, and often SNAT'd to the LB address.conntrack -L -p tcp --dport 443on the LB shows the exact rewrite and the reply tuple. - Tunnel. If the backend is reached over VXLAN, the packet gains 50 bytes of outer header (20 IP + 8 UDP + 8 VXLAN + 14 inner Ethernet). On a 1500-byte underlay that leaves 1450 for the inner packet.
- Server.
ss -tlnpconfirms something is listening on10.30.0.7:8443.
Reverse: the server replies from 10.30.0.7:8443 to whatever the LB SNAT'd to. If the LB is stateful and the reply lands on a different LB instance (ECMP again), there is no conntrack entry and the packet is dropped or RST.
Commands I actually run
ip route get <dst>at each L3 hop: exact route, source, nexthop.conntrack -Lon the NAT/LB: the rewrite and reply tuple.tcpdump -ni eth0 'host 10.20.1.5 and port 443'on both ends, timestamps compared: shows where the packet stops.ping -M do -s 1472 <dst>: 1472 + 28 = 1500; a failure here means MTU, not routing.ss -tnpfor socket state,ethtool -Sfor drops.
Trade-offs
Capturing at every hop is definitive but slow and needs access everywhere; bisecting (capture at the midpoint, then halve) finds the break in log2(hops) captures. Stateless ACLs are cheap but cannot tell you about NAT; conntrack is authoritative but only exists on the box that created the entry, so it is useless for a path that bypasses it.
Failure modes
- Asymmetric ECMP: forward and reverse take different routers, and a stateful firewall on one path drops the return. Symptom: SYN reaches the server, SYN-ACK never returns. Detect with
tcpdumpon both ends. - MTU black hole: small packets pass, large ones vanish. Symptom: handshake completes, TLS ClientHello stalls. Detect with
ping -M do. - Multi-leg proxy: client→proxy and proxy→server are separate TCP connections with separate tuples; a capture on one leg tells you nothing about the other. Detect by matching the proxy's own socket via
ss.
Curated: · Written: · Reviewed:
Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.