Tooling & Debugging
The commands to reach for when something is slow or unreachable. The module opens with a ladder that maps a symptom to the layer and the tool that answers it fastest, then works through the tools: ping and mtr for the path, dig for DNS, ss, nc, lsof and ip for sockets and interfaces, curl and openssl s_client for HTTP and TLS, and tcpdump and Wireshark for the packets themselves. It ends with a lab that reproduces each failure on your own machine so you have seen what it looks like.
What you will be able to answer
- Given a symptom such as "the site is slow" or "connection refused", which layer do you check first and with which command?
- How do you read packet loss, TTL and per-hop latency in
pingandmtrwithout blaming a router that merely rate-limits ICMP? - What do
digflags like+trace,+shortand@resolvertell you, and why candigresolve a name that your application cannot? - How do you find which process owns a port, what state a socket is in, and which interface and route a packet will use?
- How do the
curl -wtiming fields separate DNS, TCP, TLS and server wait, and what doesopenssl s_clientshow about a certificate chain? - How do you capture and filter traffic with
tcpdump, and what do retransmissions, resets and the handshake look like in Wireshark? - How do you reproduce a drop versus a reject, a reset, a connect timeout, and packet loss or latency locally?