← All system designs

Tools & Practice

ping, traceroute, tcpdump, curl, dig — and Python socket programming for UDP and TCP.

7 items 4 Foundational 3 Intermediate

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 refused and 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.sendall is what you want over plain send for TCP

Related topics

Items (7)

Search ESC

Keyboard shortcuts

Shortcuts are disabled while typing in inputs.