0
0
Computer Networksknowledge~10 mins

ICMP and ping/traceroute in Computer Networks - Step-by-Step Execution

Choose your learning style9 modes available
Concept Flow - ICMP and ping/traceroute
Start: User runs ping/traceroute
Send ICMP Echo Request
Packet travels through network routers
Destination receives request
Destination sends ICMP Echo Reply
Reply travels back through routers
User receives ICMP Echo Reply
Display response time or route info
End
The user sends an ICMP Echo Request using ping or traceroute, which travels through routers to the destination. The destination replies with an ICMP Echo Reply, which returns to the user, allowing measurement of response time or path.
Execution Sample
Computer Networks
ping 8.8.8.8
traceroute 8.8.8.8
Sends ICMP Echo Requests to 8.8.8.8 and traces the route packets take through the network.
Analysis Table
StepActionPacket TypeSourceDestinationResult
1User sends ping commandICMP Echo RequestUser PC8.8.8.8Packet created and sent
2Packet reaches Router 1ICMP Echo RequestUser PC8.8.8.8Router forwards packet
3Packet reaches Router 2ICMP Echo RequestUser PC8.8.8.8Router forwards packet
4Packet reaches DestinationICMP Echo RequestUser PC8.8.8.8Destination receives request
5Destination sends replyICMP Echo Reply8.8.8.8User PCReply packet created
6Reply reaches Router 2ICMP Echo Reply8.8.8.8User PCRouter forwards reply
7Reply reaches Router 1ICMP Echo Reply8.8.8.8User PCRouter forwards reply
8Reply reaches User PCICMP Echo Reply8.8.8.8User PCUser receives reply
9User displays ping resultN/AN/AN/AShows response time
10Traceroute sends packets with increasing TTLICMP Echo Request with TTL=1User PC8.8.8.8First router replies with Time Exceeded
11Traceroute sends packet with TTL=2ICMP Echo Request with TTL=2User PC8.8.8.8Second router replies with Time Exceeded
12Traceroute continues increasing TTLICMP Echo Request with TTL=nUser PC8.8.8.8Routers reply until destination reached
13Destination replies to tracerouteICMP Echo Reply8.8.8.8User PCTraceroute ends showing full path
💡 Ping ends after receiving reply or timeout; traceroute ends after destination reply or max hops reached.
State Tracker
VariableStartAfter Step 1After Step 4After Step 5After Step 8After Step 13
Packet TypeNoneICMP Echo RequestICMP Echo RequestICMP Echo ReplyICMP Echo ReplyN/A
SourceUser PCUser PCUser PC8.8.8.88.8.8.8N/A
Destination8.8.8.88.8.8.88.8.8.8User PCUser PCN/A
TTL (for traceroute)N/A12nnN/A
Response ReceivedNoNoNoYesYesYes
Key Insights - 3 Insights
Why does ping send an ICMP Echo Request and expect an Echo Reply?
Ping uses ICMP Echo Request to check if the destination is reachable. The Echo Reply confirms the destination received the request and is responding, as shown in steps 1, 4, and 5 of the execution_table.
How does traceroute find the path to the destination?
Traceroute sends packets with increasing TTL values. Each router decreases TTL by 1 and replies with 'Time Exceeded' when TTL hits zero, revealing its address. This is shown in steps 10 to 12.
Why might some routers not reply during traceroute?
Some routers block ICMP messages or do not send 'Time Exceeded' replies, causing missing hops in traceroute results. This is why traceroute may show '*' or timeouts in some steps.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table at step 5. What packet type does the destination send back?
AICMP Echo Reply
BICMP Echo Request
CTime Exceeded
DTCP SYN
💡 Hint
Check the 'Packet Type' column at step 5 in the execution_table.
At which step does the user first receive a reply from the destination?
AStep 4
BStep 8
CStep 5
DStep 10
💡 Hint
Look for when 'User receives reply' in the 'Result' column of execution_table.
If the TTL in traceroute packets is always 1, what will happen according to the execution_table?
ANo replies are received
BThe destination replies immediately
COnly the first router replies with Time Exceeded
DAll routers reply simultaneously
💡 Hint
Refer to step 10 where TTL=1 causes first router to reply.
Concept Snapshot
ICMP is a network protocol used for sending control messages.
Ping sends ICMP Echo Requests to check if a host is reachable.
The host replies with ICMP Echo Replies.
Traceroute uses ICMP with increasing TTL to map the path.
Routers send 'Time Exceeded' messages when TTL expires.
This helps diagnose network paths and delays.
Full Transcript
ICMP is a protocol used to send messages like Echo Requests and Echo Replies between computers on a network. When you use ping, your computer sends an ICMP Echo Request to a destination IP address. The destination replies with an Echo Reply if reachable. This exchange helps measure if the destination is online and how long the message took. Traceroute works by sending ICMP packets with a small TTL value that increases with each attempt. Each router along the path decreases the TTL by one and sends back a 'Time Exceeded' message when TTL reaches zero. This way, traceroute learns the route packets take to reach the destination. The execution table shows each step of sending and receiving these packets, including routers forwarding packets and replying. Understanding these steps helps diagnose network connectivity and delays.