How Does Traceroute Work?

Traceroute is a network diagnostic tool that maps the path packets take from your computer to a destination. It reveals every router hop along the way, showing you the actual network path — which may differ significantly from what the BGP AS path suggests.

The TTL Trick

Traceroute works by exploiting the Time To Live (TTL) field in IP packets. Every IP packet has a TTL value that starts at some number (typically 64 or 128) and decreases by 1 at each router hop. When the TTL reaches 0, the router discards the packet and sends back an ICMP Time Exceeded message to the sender.

Traceroute sends a series of packets with incrementally increasing TTL values:

  1. Send a packet with TTL=1 — the first router decrements it to 0, drops the packet, and sends back an error. Now you know the first router's IP.
  2. Send a packet with TTL=2 — the second router drops it and replies. Now you know the second hop.
  3. Continue until the packet reaches the destination, which sends a different reply indicating the trace is complete.

Most traceroute implementations send three probes per hop to measure latency at each point.

What Traceroute Shows

A typical traceroute output shows:

Traceroute vs BGP AS Path

Traceroute shows the actual forwarding path of packets, while the BGP AS path shows the control plane path — the sequence of autonomous systems the route advertisement traversed. These often align, but they can differ because:

Using a BGP looking glass alongside traceroute gives you a complete picture: the looking glass shows the AS-level view, while traceroute shows the router-level path.

Variants

Try looking up the IPs you see in a traceroute to identify which autonomous systems they belong to:

See BGP routing data in real time

Open Looking Glass
More Articles
What is BGP? The Internet's Routing Protocol Explained
What is an Autonomous System (AS)?
What is a BGP Looking Glass?
How to Look Up an IP Address's BGP Route
Understanding BGP AS Paths
What is RPKI? Securing BGP Routing
What is DNS? The Internet's Phone Book
What is an IP Address?
IPv4 vs IPv6: What's the Difference?
What is a Network Prefix (CIDR)?
What is an Internet Exchange Point (IXP)?
What is Peering? How Networks Interconnect
What is a CDN? Content Delivery Networks Explained
What is DNS over HTTPS (DoH)?
What is a BGP Hijack?
What are TLDs? Top-Level Domains Explained
What is Anycast? One IP, Many Servers
What is a Subnet? IP Subnetting Explained