ICMP and the Role of Ping and Traceroute
Understand the ICMP control protocol that sits beside IP, and how ping and traceroute use it to diagnose reachability and routing.
ICMP and the Role of Ping and Traceroute is a free Linux Networking & TCP/IP for Developers lesson on CoddyKit — lesson 4 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Linux Networking & TCP/IP for Developers learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
What Is ICMP?
The Internet Control Message Protocol (ICMP) carries control and error messages for the IP layer. It is not used to send application data; it reports problems like unreachable hosts and assists diagnostics.
ICMP Sits Beside IP
ICMP messages are wrapped in IP packets but ICMP is considered part of the network layer. Unlike TCP or UDP, it has no ports, only message types and codes.
Common Message Types
Key ICMP types include:
- Echo Request / Echo Reply (used by ping).
- Destination Unreachable.
- Time Exceeded (used by traceroute).
How Ping Works
ping sends an ICMP Echo Request and waits for an Echo Reply. The round-trip time tells you latency, and missing replies suggest packet loss or an unreachable host.
ping -c 4 example.comReading Ping Output
Ping reports time per packet and a summary with packet loss and min/avg/max round-trip times. Consistent times mean a healthy path; jitter or loss points to network trouble.
The TTL Field
Every IP packet carries a Time To Live (TTL) that decrements at each router. When it hits zero the router drops the packet and sends back an ICMP Time Exceeded message. Traceroute exploits exactly this.
How Traceroute Works
traceroute sends packets with increasing TTL: 1, then 2, then 3. Each router along the path returns a Time Exceeded message, revealing the hops between you and the destination.
traceroute example.comReading Traceroute Hops
Each line is one hop with three timing samples. Asterisks mean no reply from that hop, which can be normal if a router is configured not to answer.
When ICMP Is Blocked
Many firewalls drop ICMP for security. A failed ping does not always mean the host is down; it may simply not answer Echo Requests. Verify with a TCP-based check too.
traceroute -T -p 443 example.comContinuous Monitoring
For ongoing path monitoring, mtr combines ping and traceroute, continuously updating per-hop loss and latency, which is excellent for spotting an intermittent bad hop.
mtr example.comSetting Packet Size
You can vary the ping payload size to test how a path handles larger packets, which helps uncover MTU or fragmentation issues.
ping -c 4 -s 1400 example.comQuick Check
Test your ICMP knowledge.
Recap
You learned the role of ICMP.
- ICMP carries control/error messages for IP, with no ports.
- Ping uses Echo Request/Reply for reachability and latency.
- Traceroute uses TTL and Time Exceeded to map the path; blocked ICMP can hide a live host.
Frequently asked questions
Is the “ICMP and the Role of Ping and Traceroute” lesson free?
Yes — the full text of “ICMP and the Role of Ping and Traceroute” is free to read here on the web, and the Linux Networking & TCP/IP for Developers course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Linux Networking & TCP/IP for Developers course, upgrade to CoddyKit PRO.
What will I learn in “ICMP and the Role of Ping and Traceroute”?
Understand the ICMP control protocol that sits beside IP, and how ping and traceroute use it to diagnose reachability and routing. You practise Linux Networking & TCP/IP for Developers with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Linux Networking & TCP/IP for Developers?
No prior experience is required. Linux Networking & TCP/IP for Developers on CoddyKit is structured for beginners through advanced learners; this is — lesson 4 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “ICMP and the Role of Ping and Traceroute” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Linux Networking & TCP/IP for Developers lesson?
Yes. Every Linux Networking & TCP/IP for Developers lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- Understanding TCP/IP Model
- IP Addressing & Subnetting
- TCP and UDP Fundamentals
- ICMP and the Role of Ping and Traceroute