Situation: I observe ~1% packet loss and high TCP retransmits between datacenters. I’d run a targeted, methodical set of tests to isolate where packets are dropped and why.Initial checks (host-side)- Check interface & error counters: - ethtool -S eth0; ip -s link show eth0 — look for rx_errors, tx_errors, dropped, fifo, overruns.- Check CPU/interrupt saturation: top/iostat, /proc/interrupts, softirq counters.Active throughput tests- Run iperf3 (TCP and UDP) between hosts to reproduce and measure:bash
# server
iperf3 -s
# client
iperf3 -c server -P 8 -t 60
# UDP
iperf3 -c server -u -b 1G -t 30
- Look for throughput drops, jitter, and packet loss on UDP test.Path and latency diagnostics- Run mtr (long run) to map loss per hop:bash
mtr --report --report-cycles 100 <remote>
- Identify hop where loss spikes—if mid-path, network device likely; if only at destination, host/LB issue.Packet captures- Capture on both endpoints and on suspected transit devices with tcpdump:bash
tcpdump -i eth0 -s 0 -w hostA.pcap host hostB
tcpdump -i eth0 -s 0 -w lb.pcap host hostB
Signatures to inspect in pcap (use Wireshark/tshark):- Retransmit patterns: repeated identical seq ranges, fast retransmit (duplicate ACKs), or RTO retransmits (long gaps before retransmit).- Duplicate ACKs frequency: many dup ACKs before retransmit ⇒ likely loss on path (congestion or single-link loss).- SACK blocks: presence and SACK negotiation shows selective loss handling.- Out-of-order packets: many out-of-order frames before dup ACKs ⇒ switching/routing issues or asymmetric path.- ICMP Destination Unreachable or TTL exceeded messages.- TCP window sizes and zero-window events (receiver-side congestion).- Check for TCP reset bursts (misconfigured LB/firewall).Correlate timing & counters- Compare host NIC dropped counters timestamped with pcap times. If host increments drops but pcap shows packets sent to NIC, likely NIC driver/hardware.- If pcap at sender shows packet leaves, but no arrival at receiver capture and intermediate hop shows loss in mtr—path device problem.- If mtr shows uniform small loss across many hops ⇒ possible upstream congestion.- If loss only when LB is in-path and captures show SYNs/ACKs dropped or resets near LB ⇒ misconfigured load balancer (e.g., health checks, ephemeral port exhaustion, flow table limits).Determining cause — checklist- Congestion: UDP iperf shows loss/jitter; tail drops in router queues; ECN marks present (if enabled); loss correlated with high utilization on interfaces (ifInOctets).- Faulty hardware/driver: interface error counters (rx_errors, crc) increase; pcap shows corrupted frames or link-level errors; replacing NIC or moving endpoint resolves.- Misconfigured load balancer: losses only when traffic goes through LB; captures show asymmetric NAT, TCP termination issues, or connection tracking timeouts; LB metrics (conn table full, high CPU) match.Follow-ups & mitigations- If congestion: enable QoS, increase buffers, tune TCP (BBR/CUBIC tuning, cong avoidance), or add capacity.- If hardware: replace cable/NIC, update firmware/driver, verify SFP transceivers.- If LB misconfig: adjust timeouts, scale backend pool, review SNAT/conn tracking, enable keepalives/health checks.I’d document findings, include pcaps and counters, and recommend targeted remediation based on which signature and counters point to.