ArticleslgStudy

computer science

Traceroute

Traceroute is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Traceroute rather than just read about it. In short: In computing, traceroute and tracert are diagnostic command-line interface commands for displaying possible routes (paths) and transit delays of packets across an Internet Protocol (IP) network. The ping utility only computes the final round-trip times from the destination point, while route-tracing utilities can show more detail, such as the round-trip times of the packets received from each successive host (remote…

Traceroute — main illustration
Traceroute — illustration

Key takeaways

  • Traceroute belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Traceroute to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Traceroute from memory before moving on to harder problems.

Reference excerpt

In computing, traceroute and tracert are diagnostic command-line interface commands for displaying possible routes (paths) and transit delays of packets across an Internet Protocol (IP) network. The ping utility only computes the final round-trip times from the destination point, while route-tracing utilities can show more detail, such as the round-trip times of the packets received from each successive host (remote node) along the route to a destination and the sum of the mean times in each hop as a measure of the total time spent to establish the connection. For Internet Protocol Version 6 (IPv6), the tool sometimes has the name traceroute6 and tracert6.

Implementations A command is available in many modern operating systems, generally named traceroute in Unix-like systems such as FreeBSD, macOS, and Linux and named tracert in Windows and ReactOS.

On Linux, tracepath is a utility similar to traceroute, with the primary difference of not requiring superuser privileges. Tracepath is part of the iputils group that contains the package ping. The functionality was available graphically in macOS, but has been deprecated since the release of macOS Big Sur. Windows NT-based operating systems also provide PathPing, which combines the functionality of ping with that of tracert. On Unix-like operating systems, traceroute sends, by default, a sequence of User Datagram Protocol (UDP) packets, with destination port numbers ranging from 33434 to 33534; the implementations of traceroute shipped with Linux, FreeBSD, NetBSD, OpenBSD, DragonFly BSD, and macOS include an option to use ICMP Echo Request packets (-I), or any arbitrary protocol (-P) such as UDP, TCP using TCP SYN packets, or ICMP. On Windows, tracert sends ICMP Echo Request packets, rather than the UDP packets traceroute sends by default. The time-to-live (TTL) value, also known as hop limit, is used in determining the intermediate routers being traversed towards the destination. Traceroute sends packets with TTL values that gradually increase from packet to packet, starting with TTL value of one. Routers decrement TTL values of packets by one when routing and discard packets whose TTL value has reached zero, returning the ICMP error message ICMP Time Exceeded. For the first set of packets, the first router receives the packet, decrements the TTL value and drops the packet because it then has TTL value zero. The router sends an ICMP Time Exceeded message back to the source. The next set of packets are given a TTL value of two, so the first router forwards the packets, but the second router drops them and replies with ICMP Time Exceeded. Proceeding in this way, traceroute uses the returned ICMP Time Exceeded messages to build a list of routers that packets traverse, until the destination is reached and returns an ICMP Destination Unreachable message if UDP packets are being used or an ICMP Echo Reply message if ICMP Echo messages are being used. The timestamp values returned for each router along the path are the delay (latency) values, typically measured in milliseconds for each packet. The sender expects a reply within a configured number of seconds. If a packet is not acknowledged within the expected interval, an asterisk is displayed. The Internet Protocol does not require packets to take the same route towards a particular destination, thus hosts listed might be hosts that other packets have traversed. If the host at hop #N does not reply, the hop is skipped in the output. If a network has a firewall and operates both Windows and Unix-like systems, more than one protocol must be enabled inbound through the firewall for traceroute to work and receive replies. Some traceroute implementations use TCP packets, such as tcptraceroute and layer four traceroute (lft). PathPing is a utility introduced with Windows NT that combines ping and traceroute functionality. MTR is an enhanced version of ICMP traceroute available for Unix-like and Windows systems. The various implementations of traceroute all rely on ICMP Time Exceeded (type 11) packets being sent to the source. Cisco's implementation of traceroute also uses a sequence of UDP datagrams, each with incrementing TTL values, to an invalid port number at the remote host; by default, UDP port 33434 is used. An extended version of this command (known as the extended traceroute command) can change the destination port number used by the UDP probe messages.

Usage

Most implementations include options to specify the number of queries to send per hop, time to wait for a response, the hop limit and port to use. Invoking traceroute with no options displays the list of available options For Linux, man traceroute presents more details, including the displayed error flags.

The selected arguments to the traceroute command are:

-n disable name resolution -w wait for three seconds instead of default five -q send out only one query to each hop instead of default three -m limit the maximum number of hops to 16 before giving up instead of default 30 — with example.com as the final host. On line 8 and 9 (TTLs 8 and 9) it shows asterisks where the router did not respond within the timeout.

Value Traceroute can help identify incorrect routing table definitions or firewalls that may be blocking ICMP traffic, or high port UDP in Unix ping, to a site. A correct traceroute response does not guarantee connectivity for applications as a firewall may permit ICMP packets but not permit packets of other protocols. Traceroute is used by penetration testers to gather information about network infrastructure and IP address ranges around a given host. Traceroute can be used to optimize data download. If there are multiple mirrors available for the same resource, each mirror can be traced to find the fastest.

Origins The traceroute manual page states that the original traceroute program was written by Van Jacobson in 1987 from a suggestion by Steve Deering, and that Guy Almes and Matt Mathis also had the idea concurrent with Deering. The author of the ping program, Mike Muuss, states on his website that traceroute was written using kernel ICMP support that he had earlier coded to enable raw ICMP sockets when he first wrote the ping program.

… excerpt ends here. Continue reading the full article.

Illustrations

Traceroute: Router addresses can be superimposed upon maps of their physical locations. This example shows a request from New Zealand to an IP address in Massachusetts which takes a route that passes through Europe.
Router addresses can be superimposed upon maps of their physical locations. This example shows a request from New Zealand to an IP address in Massachusetts which takes a route that passes through Europe.

Worked examples

Example 1 — a first encounter with Traceroute

Start with the simplest possible case. Write down what Traceroute claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Traceroute before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Traceroute ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Traceroute

In research
Traceroute appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Traceroute in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Traceroute is common in secondary-school and first-year university syllabi. It links to neighbouring topics Free network management software, Network analyzers, Windows commands, so understanding it makes those chapters shorter.
In everyday life
Look for Traceroute outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Traceroute” →

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Traceroute in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Traceroute means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Traceroute out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Traceroute in simple terms?

In computing, traceroute and tracert are diagnostic command-line interface commands for displaying possible routes (paths) and transit delays of packets across an Internet Protocol (IP) network. The ping utility only computes the final round-trip times from the destination point, while route-tracin…

Why does Traceroute matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Traceroute?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Traceroute.

Tags

  • Free network management software
  • Network analyzers
  • Windows commands

Keep exploring