0
0
Linux CLIscripting~10 mins

traceroute for path tracing in Linux CLI - Step-by-Step Execution

Choose your learning style9 modes available
Concept Flow - traceroute for path tracing
Start traceroute command
Send packet with TTL=1
Receive response from first router
Increase TTL by 1
Send packet with new TTL
Receive response from next router
Repeat until destination reached or max hops
Display full path
End
Traceroute sends packets with increasing TTL to find each router on the path to the destination, showing the route step-by-step.
Execution Sample
Linux CLI
traceroute example.com

# Shows each hop from your computer to example.com
This command traces the path packets take from your computer to example.com, listing each router along the way.
Execution Table
StepTTL ValuePacket SentResponse Received FromActionOutput
11Packet with TTL=1Router 1 IPPrint hop 1 info1 192.168.1.1 1.123 ms 1.045 ms 1.010 ms
22Packet with TTL=2Router 2 IPPrint hop 2 info2 10.0.0.1 10.234 ms 10.198 ms 10.150 ms
33Packet with TTL=3Router 3 IPPrint hop 3 info3 172.16.0.1 20.345 ms 20.300 ms 20.250 ms
44Packet with TTL=4example.com IPPrint hop 4 info4 93.184.216.34 30.456 ms 30.400 ms 30.350 ms
55Packet with TTL=5* * *No response, stop* * *
Exit----Destination reached or max hops exceeded
💡 Stops when destination responds or max hops reached; here destination responded at TTL=4.
Variable Tracker
VariableStartAfter 1After 2After 3After 4After 5Final
TTL123455Stopped
Current Hop IPNone192.168.1.110.0.0.1172.16.0.193.184.216.34*Destination reached
Response Time (ms)None1.12310.23420.34530.456*N/A
Key Moments - 3 Insights
Why does traceroute increase the TTL value with each packet?
Increasing TTL lets each packet reach one hop further. This is shown in execution_table rows where TTL goes from 1 to 5, revealing each router step-by-step.
What does it mean when traceroute shows '* * *' for a hop?
It means no response was received from that hop. In the execution_table row 5, TTL=5 shows '* * *', indicating no reply, so traceroute stops.
How does traceroute know it reached the destination?
When the response comes from the destination IP, as in row 4 of execution_table, traceroute stops because the path is complete.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table, what is the TTL value when the response is from example.com?
A4
B3
C5
D1
💡 Hint
Check the 'TTL Value' column where 'Response Received From' is example.com IP in execution_table row 4.
At which step does traceroute stop sending packets?
AAfter step 3
BAfter step 5
CAfter step 4
DAfter step 1
💡 Hint
Look at the exit_note and the last successful response in execution_table.
If the router at TTL=3 did not respond, what would the output show at step 3?
ARouter 3 IP with times
B* * *
CDestination IP
DNo output
💡 Hint
Refer to execution_table row 5 where no response shows '* * *'.
Concept Snapshot
traceroute command sends packets with increasing TTL
Each TTL reveals one more router on the path
Stops when destination replies or max hops reached
Shows IP and response times for each hop
'* * *' means no reply from that hop
Useful to find network path and delays
Full Transcript
Traceroute works by sending packets with a time-to-live (TTL) starting at 1. Each router along the path decreases TTL by 1. When TTL reaches zero, the router replies with its IP. Traceroute increases TTL step-by-step to discover each router on the path to the destination. It stops when the destination replies or the max hops limit is reached. Output shows each hop's IP and response times. If a router does not reply, traceroute shows '* * *'. This helps visualize the path and delays in the network.