Interview Prep/Networking/Sockets, ports, TIME_WAIT and conntrack

On a client, `ss -tan state syn-sent` shows hundreds of connections to the same backend stuck there.

BeginnerTroubleshootingSockets, ports, TIME_WAIT and conntrack
Answer

Likely causes → The client sent SYNs and got nothing back: a firewall/security group drops them, the server is down, there's no return route, or the server's SYN queue is overflowing.

Diagnose →

ss -tan state syn-sent | awk '{print $4}' | sort | uniq -c
sudo tcpdump -ni eth0 'host <backend> and tcp[tcpflags] & (tcp-syn|tcp-rst) != 0'
nc -vz -w 3 <backend> <port>

Run the same tcpdump on the backend: SYNs not arriving = path/firewall; arriving but no SYN-ACK = server-side issue.

Fix → Open the port in the SG/firewall, fix routing, or fix the server backlog. Set sane connect timeouts in clients so they fail fast instead of piling up.

Prevent → Synthetic TCP checks to critical dependencies and connect-timeout metrics in the client.

All Networking questions Roadmap: Networking for DevOps

More on Sockets, ports, TIME_WAIT and conntrack