Approach: capture the TCP conversation between the two microservices, then inspect for retransmissions, out-of-order packets, duplicate ACKs, zero-window, and SACK info. Use tcpdump for capture and Wireshark/tshark display filters to detect patterns.Useful TCP fields / packet patterns that indicate loss:- Retransmission: same TCP sequence number sent again. Wireshark tags: tcp.analysis.retransmission or tcp.analysis.fast_retransmission.- Fast retransmit: sender retransmits after triple duplicate ACKs; look for tcp.analysis.fast_retransmission and preceding 3+ duplicate ACKs (same ACK number, increasing repetition).- Duplicate ACKs: ACKs with identical ack field repeated (tcp.analysis.duplicate_ack).- Out-of-order: tcp.analysis.out_of_order — receiver sees seq not matching expected.- Zero window: window size = 0 (TCP header field) indicates receiver can't accept data.- SACK blocks: presence or absence of SACK options helps infer recovery behavior.- Retransmit due to timeout: retransmit with longer RTT and no preceding duplicate ACKs.- TCP reset (RST) or excessive retransmits → connection issues.tcpdump capture examples (replace IP_A, IP_B, PORT):bash
# Capture all TCP between two hosts on interface eth0, full packet, write pcap
sudo tcpdump -i eth0 -s 0 -w /tmp/micro.pcap host 10.0.1.5 and host 10.0.1.8 and tcp
# Capture specific service port (e.g., port 8080)
sudo tcpdump -i eth0 -s 0 -w /tmp/micro.pcap host 10.0.1.5 and host 10.0.1.8 and tcp port 8080
# Capture and print verbose packets with sequence/ack info (useful short live check)
sudo tcpdump -i eth0 -n -vvv 'host 10.0.1.5 and host 10.0.1.8 and tcp' -c 200
Inspect with Wireshark/tshark:bash
# Open in Wireshark: analyze tcp.analysis.* flags, follow TCP stream, enable expert info
wireshark /tmp/micro.pcap
# Use tshark to list retransmissions / duplicate ACKs
tshark -r /tmp/micro.pcap -Y "tcp.analysis.retransmission || tcp.analysis.fast_retransmission || tcp.analysis.duplicate_ack" -T fields -e frame.number -e ip.src -e tcp.srcport -e ip.dst -e tcp.dstport -e tcp.seq -e tcp.ack -e tcp.window_size
# Show duplicate ACK count trends
tshark -r /tmp/micro.pcap -Y "tcp.analysis.duplicate_ack" -T fields -e frame.number -e tcp.ack
Quick live Wireshark display filters:- tcp.analysis.retransmission- tcp.analysis.fast_retransmission- tcp.analysis.duplicate_ack- tcp.analysis.out_of_order- tcp.window_size == 0- tcp contains "SACK" or tcp.options.sackTroubleshooting steps:- Capture both sides (client & server IPs) to confirm where retransmit originates.- Correlate timestamps and RTTs (tcp.analysis.ack_rtt) to see if retransmits follow timeouts.- Check NIC error counters, kube CNI logs, and iptables/iptables-save for drops if retransmits are frequent.- If you see many duplicate ACKs followed by fast retransmit → likely intermediate packet loss. If retransmits without duplicate ACKs and long delay → possible path loss or severe congestion/timeouts.Edge notes:- In high-throughput environments use -s 0 and write to disk to avoid truncation.- Add 'and not port 22' to tcpdump filter to avoid SSH noise when capturing from remote hosts.