Interview Prep/Networking/Connectivity: refused, timed out, no route

A client gets `Connection reset by peer` in the middle of a request.

IntermediateTroubleshootingConnectivity: refused, timed out, no route
Answer

Likely causes → The server process crashed or closed the socket with unread data, an idle timeout on a middlebox (NAT, firewall, LB) expired and it sent RST, or a proxy hit a limit (request size, header size).

Diagnose →

sudo tcpdump -ni any host 10.0.3.7 and 'tcp[tcpflags] & tcp-rst != 0' -w rst.pcap
journalctl -u myapp --since -10min
dmesg -T | grep -i -E 'oom|killed'

Capture on both ends: if the server never sent the RST, a middlebox did.

Fix → Fix the crash, raise the middlebox idle timeout, or enable TCP keepalives below that timeout.

Prevent → Keep client idle timeouts shorter than every middlebox timeout in the path.

All Networking questions Roadmap: Networking for DevOps

More on Connectivity: refused, timed out, no route