Tools & Practice
ping, traceroute, tcpdump, curl, dig — and Python socket programming for UDP and TCP.
Networking knowledge sticks when you can actually probe a network. The Tools & Practice topic covers the half-dozen CLI tools every engineer uses to debug network issues (ping, traceroute, tcpdump, curl, dig, nslookup), the Python socket APIs that let you write UDP and TCP clients/servers from scratch, and four hands-on programming projects — a multi-client UDP chat app, a distance-vector (RIP) routing simulator, Dijkstra's shortest-path for link-state routing, and a spanning-tree simulator. Build at least one to make the theory stick.
A working ping/traceroute/tcpdump diagnosis loop is one of the most underrated debugging skills a backend engineer can have. The Python socket exercises are the cheapest way to internalise UDP vs TCP semantics; the four projects above raise the bar from 'I read about RIP' to 'I implemented RIP'.
Key concepts
- ping uses ICMP echo; traceroute uses TTL exhaustion to map hops
- tcpdump captures at the link layer; Wireshark gives you a UI for the same
- curl is the universal HTTP client — verbose mode shows headers, timing, redirects
- dig (preferred over nslookup) shows the DNS resolution tree clearly
- Python `socket` is a thin wrapper over BSD sockets — the API is small
- Implementing a routing protocol (RIP, Dijkstra/OSPF, STP) once cements it forever
Reference template
// Network-debug loop
1. Is the host reachable? (ping)
2. Where does the path break? (traceroute)
3. What's on the wire? (tcpdump -i any -nn 'port 443')
4. Does the app speak it? (curl -v)
5. Is DNS the problem? (dig @8.8.8.8 example.com) Adapt to your problem; the structure is the load-bearing part.
Common pitfalls
- Reading
Connection refusedand assuming the network — it's almost always the service - Trusting traceroute hop names — many routers don't respond or rate-limit ICMP
- Capturing tcpdump without filtering — you'll drown in unrelated traffic
- Forgetting that
socket.sendallis what you want over plainsendfor TCP
Related topics
Items (7)
- Tools — ping, traceroute, tcpdump, curl, dig
The six commands you actually use to debug networks. Read packets, follow paths, resolve names, talk HTTP.
Building Block Foundational - Python Sockets — UDP Client/Server
socket() + bind() + sendto/recvfrom. The simplest network programs that teach the model.
Building Block Foundational - Project — A Multi-Client UDP Chat App
A small but realistic project: many clients, one relay server, broadcast over UDP. The framing, the keep-alive, the cleanup.
Building Block Foundational - Python Sockets — TCP Client/Server
socket() + connect/listen/accept + sendall/recv. Custom framing, blocking vs non-blocking, the patterns that scale.
Building Block Foundational - Project — A Distance-Vector (RIP) Routing Simulator
Build a small network of router processes that exchange distance vectors, converge to shortest paths, and survive a link failure.
Building Block Intermediate - Project — Dijkstra's Shortest-Path for Link-State Routing
From a link-state database to a forwarding table in O((V+E) log V). The algorithm OSPF runs on every router.
Building Block Intermediate - Project — Simulating the Spanning Tree Protocol
A loop-free spanning tree over a switched-LAN graph: root election, port roles, BPDU exchange, the convergence walk.
Building Block Intermediate