traceroute
traceroute
The traceroute
command is a network diagnostic tool used to track the path that a packet takes from the source machine to the destination host. It also provides the round-trip time (RTT) for each hop along the route. This is particularly useful for identifying points of failure or latency within a network.
How traceroute
Works
traceroute
Workstraceroute
works by sending packets with incrementing Time-To-Live (TTL) values. Each router along the path to the destination host decrements the TTL value by 1 before forwarding the packet. When the TTL value reaches zero, the router returns an ICMP "Time Exceeded" message back to the source. By starting with a TTL of 1 and incrementing by 1 for each subsequent set of packets, traceroute
can determine the routers along the path to the destination host.
Basic Syntax
The basic syntax of the traceroute
command is:
destination: The IP address or hostname of the target host.
Common Options
Basic Traceroute Command:
This command traces the path to
google.com
.Specify Number of Queries per Hop:
This sends 3 probe packets per hop (default is 3).
Specify the Maximum Number of Hops:
This sets the maximum number of hops to 20 (default is 30).
Specify the Initial TTL Value:
This sets the initial TTL value to 5.
Specify the Packet Size:
This sets the size of probe packets to 64 bytes.
Use ICMP ECHO Instead of UDP:
This uses ICMP ECHO instead of the default UDP packets.
Use TCP SYN Instead of UDP:
This uses TCP SYN packets instead of UDP packets.
Example Usage
Basic Traceroute:
This traces the route to Google's public DNS server.
Traceroute with ICMP ECHO:
This uses ICMP ECHO requests instead of UDP packets.
Traceroute with a Specific Number of Queries per Hop:
This sends 5 queries per hop.
Traceroute with TCP SYN Packets:
This uses TCP SYN packets for tracing the route.
Analyzing Output
The typical output of a traceroute
command looks like this:
Hop Number: The first column indicates the hop number.
Hostname and IP Address: The second column shows the hostname and IP address of the router at each hop.
Round-Trip Times: The subsequent columns show the round-trip time for each of the three queries sent to each hop.
Conclusion
The traceroute
command is a powerful tool for diagnosing network issues, particularly for identifying where delays or failures occur along the route to a destination. It is particularly useful for network administrators and engineers in pinpointing problematic routers or network segments. For more detailed information, consult the traceroute
man page:
help
breakdown
Last updated