ASN and BGP Routing: How Internet Traffic Finds Its Path
Understand how Autonomous System Numbers (ASN) and BGP routing determine the path your data takes across the internet, and why it matters for performance.
Every time you load a webpage, send an email, or run a traceroute, your data passes through multiple independent networks before reaching its destination. The system that determines which networks and what path your traffic takes is governed by two foundational internet technologies: Autonomous System Numbers (ASN) and the Border Gateway Protocol (BGP).
What Is an Autonomous System?
An Autonomous System (AS) is a large network or group of networks operated by a single organization — an ISP, a cloud provider, a university, or a large corporation. Each AS is identified by a unique number called an ASN. For example:
- AS15169 — Google
- AS13335 — Cloudflare
- AS16509 — Amazon (AWS)
- AS3356 — Lumen (Level 3), a major backbone provider
There are over 110,000 active ASNs on the internet today. Each one controls how traffic is routed within its own network and how it connects to other networks.
How BGP Works
BGP is the routing protocol that autonomous systems use to exchange reachability information. Think of it as the postal routing system of the internet. Every AS announces to its neighbors which IP address ranges (prefixes) it can reach. These announcements propagate across the internet, building a global routing table that every router uses to make forwarding decisions.
When your data needs to travel from AS-A to AS-C, BGP determines the path. If AS-A peers directly with AS-C, the traffic takes a direct route. If not, it may pass through AS-B as a transit provider. BGP selects the best path based on several factors:
- AS path length — shorter paths (fewer AS hops) are generally preferred
- Local preference — each AS can set policies to prefer certain routes (e.g., prefer cheaper transit over expensive peering)
- Business relationships — customer routes are preferred over peer routes, which are preferred over transit routes
- Origin type — routes originated by the AS itself are preferred over learned routes
Why ASN and BGP Matter for Performance
BGP routing decisions are based on policy and business relationships, not latency or performance. This means the path your traffic takes is not necessarily the fastest. A packet from Paris to Frankfurt might traverse a router in London if the AS policies dictate that route, adding unnecessary latency.
Understanding which ASNs your traffic passes through helps explain performance issues. Common scenarios include:
- Suboptimal routing — traffic taking a geographically longer path due to BGP policy
- Congested peering points — the interconnection between two ASNs is overloaded, causing packet loss and latency spikes
- Route leaks — a misconfigured AS accidentally announces routes it shouldn't, redirecting traffic through unintended paths
- AS path prepending — an AS intentionally makes its path appear longer to influence inbound traffic, which can affect your route
How Traceroute Reveals BGP Routing
When you run a traceroute, each hop has an IP address that belongs to a specific AS. By mapping IP addresses to their ASNs, you can see exactly which networks your traffic traverses and where it crosses from one AS to another. These AS boundaries are often where performance changes — for better or worse.
Tools like TraceMapper automatically resolve ASN information for every hop, showing you the operator name and AS number alongside latency and geolocation data. This makes it straightforward to identify which network is responsible for a performance issue.
Key Takeaways
- The internet is a network of networks, each identified by an ASN
- BGP determines the path between ASNs based on policy, not performance
- Performance issues often occur at AS boundaries (peering and transit points)
- Traceroute with ASN resolution reveals which networks carry your traffic
- Understanding ASN and BGP gives you the vocabulary to diagnose routing issues and communicate effectively with network operators
Next time you see high latency in a traceroute, check where the AS boundaries are. The bottleneck is often at the handoff between two networks — and knowing which networks are involved is the first step to getting the issue resolved.