Study of traceroute Command

 

Experiment

Study of traceroute Command

๐ŸŽฏ Aim

To trace the path taken by packets from the source to a destination host using the traceroute command.


๐Ÿ“˜ Objective

By the end of this experiment, students will be able to:

  • Identify intermediate routers (hops) in a network path
  • Measure delay at each hop
  • Analyze routing behavior in networks
  • Diagnose network delays and failures

๐Ÿ“– Theory

The traceroute command is used to:

  • Track the path packets take to reach a destination
  • Display each intermediate router (hop)

๐Ÿ‘‰ It works by manipulating the TTL (Time To Live) field:

  • Sends packets with increasing TTL values (1, 2, 3, …)
  • Each router decreases TTL by 1
  • When TTL reaches 0, the router sends back an ICMP “Time Exceeded” message

๐Ÿ‘‰ This helps identify each hop along the route.


๐Ÿงพ Syntax

traceroute [options] <destination>
  • <destination> → IP address or domain name

๐Ÿ”ง Common Options

  • -n → Do not resolve hostnames (faster)
  • -m <max_hops> → Set maximum hops
  • -q <queries> → Number of probes per hop
  • -w <wait_time> → Wait time for response
  • -I → Use ICMP instead of UDP

๐Ÿงฐ Prerequisites

  • Linux system
  • Internet connectivity
  • traceroute installed

Installation:

sudo apt install traceroute

๐Ÿ”ฌ Procedure & Commands

1️⃣ Trace Route to a Website

traceroute google.com

2️⃣ Trace Using IP Address

traceroute 8.8.8.8

3️⃣ Disable Hostname Resolution

traceroute -n google.com

4️⃣ Limit Maximum Hops

traceroute -m 10 google.com

5️⃣ Use ICMP Mode

traceroute -I google.com

๐Ÿ–ฅ️ Sample Output

traceroute mec.ac.in traceroute to mec.ac.in (172.67.179.117), 30 hops max, 60 byte packets 1 _gateway (14.139.184.209) 0.573 ms 0.845 ms 0.838 ms 2 * * * 3 * * * 4 10.255.221.33 (10.255.221.33) 22.921 ms 10.255.222.33 (10.255.222.33) 22.914 ms 22.908 ms 5 dsl-tn-085.99.246.61.airtelbroadband.in (61.246.99.85) 32.630 ms 32.622 ms 32.617 ms 6 * * 116.119.61.206 (116.119.61.206) 160.389 ms 7 162.158.20.18 (162.158.20.18) 185.576 ms 185.568 ms 185.205 ms 8 162.158.20.48 (162.158.20.48) 174.281 ms 162.158.20.55 (162.158.20.55) 201.434 ms 201.427 ms 9 172.67.179.117 (172.67.179.117) 174.260 ms 174.253 ms 181.788 ms

๐Ÿ” Output Interpretation

FieldMeaning
Hop number    Step in the route
IP/hostname    Router at that hop
ms values    Round-trip times
* * *    No response (timeout/firewall)

๐Ÿ“ Exercises for Students

  1. Trace route to a popular website and count hops.
  2. Identify your default gateway (first hop).
  3. Compare results with and without -n.
  4. Observe delays at different hops.
  5. Find where packet loss occurs (* * *).

❓ Viva Questions

  • What is the purpose of traceroute?
  • How does TTL help in traceroute?
  • Why do some hops show * * *?
  • Difference between ping and traceroute?
  • What is a hop?

⚠️ Precautions

  • Some routers block ICMP/UDP → incomplete results
  • Results may vary due to dynamic routing
  • Use responsibly in lab environments

✅ Result

The traceroute command is a powerful diagnostic tool used to analyze network paths and delays, helping in troubleshooting connectivity issues.

Comments

Popular posts from this blog

Networks Lab PCCSL507 Semester 5 KTU CS 2024 Scheme - Dr Binu V P

Analysis of HTTP Protocol using Wireshark

Study and Use of ifconfig Command