Master the fundamental concepts of raw sockets through this focused micro-challenge.
Traceroute maps the path to a destination like 8.8.8.8 by exploiting the IP TTL field. Every router decrements TTL by one. When TTL hits zero, the router sends ICMP Time Exceeded (type 11, code 0) back to you.
Send packets with increasing TTL starting at 1:
1: expires at first hop (e.g. 192.168.1.1)2: expires at second hop30: reaches destination 8.8.8.8When the destination is finally reached:
3, code 3)0)cLoading…
Standard sockets may not expose TTL control on all platforms. Raw sockets or IPPROTO_ICMP sockets let you set the value directly.
This task asks you to document traceroute logic with hop numbers and expected ICMP responses. Van Jacobson's original 1988 traceroute used exactly this TTL-expiry behavior, and network engineers still rely on it to localize latency or packet loss in a path. The mtr tool on every Linux box still increments TTL and reads ICMP Time Exceeded messages the same way.
Implement a C program that documents traceroute logic.
Requirements:
Success Criteria:
Three hints are available for this task, revealed one at a time inside the code workspace so you can struggle productively before seeing them.
All starter code and reference implementations are available for your local setup.
View on Github