What is an ASN?
Understanding Autonomous System Numbers, BGP basics, and how IP addresses map to ASNs in internet routing.
What is an Autonomous System (AS)?
An Autonomous System (AS) is a collection of IP networks and routers under the control of one organization that presents a common routing policy to the internet. Each AS is identified by a unique number called an ASN (Autonomous System Number). Think of an AS as an independent piece of the internet - like an ISP, a large company, or a university - that can make its own decisions about how to route traffic.
ASN (Autonomous System Number)
ASNs are unique numbers that identify each Autonomous System. They work like postal codes for internet routing - they help routers know which organization controls which IP addresses. ASNs are assigned by Regional Internet Registries (RIRs) and are essential for Border Gateway Protocol (BGP) routing.
ASN Number Ranges
1 - 64,511
64,512 - 65,534
65,536 - 4,199,999,999
BGP (Border Gateway Protocol) Basics
BGP is the routing protocol that connects Autonomous Systems together
Key BGP Concepts
Example: ISP edge routers, content delivery network nodes
Example: Your ISP peers with other ISPs and content networks
Example: AS15169 announces it can reach 8.8.8.0/24
Example: Path: AS100 -> AS200 -> AS300 shows route traversal
BGP Types
Type | Description | Usage | Port |
---|---|---|---|
eBGP (External BGP) | BGP between different Autonomous Systems | Inter-ISP routing, connecting to internet | TCP 179 |
iBGP (Internal BGP) | BGP within the same Autonomous System | Distributing external routes within large networks | TCP 179 |
How IP Addresses Map to ASNs
Every public IP address belongs to exactly one ASN
How It Works
- RIRs allocate IP blocks to organizations
- Organizations get assigned an ASN if they need BGP routing
- The ASN announces (advertises) their IP prefixes via BGP
- Internet routers learn which ASN controls which IP ranges
- Traffic destined for those IPs is routed toward that ASN
Real-World Examples
IP Range | ASN | Organization | Description |
---|---|---|---|
8.8.8.0/24 | AS15169 | Google LLC | Google's public DNS servers |
1.1.1.0/24 | AS13335 | Cloudflare | Cloudflare's public DNS and CDN |
157.240.0.0/16 | AS32934 | Facebook's social media platform | |
192.0.2.0/24 | N/A | TEST-NET-1 | Documentation range, not routed |
ASN Lookup Tools
How to find which ASN owns an IP address
Shows: AS15169 Google LLC
Shows AS path and route information
ASN lookup databases and APIs
Common Lookup Commands
whois -h whois.radb.net 8.8.8.8
dig TXT 8.8.8.8.origin.asn.cymru.com
curl ipinfo.io/8.8.8.8
Real-World AS Examples
Benefits of the AS System
- Enables internet-scale routing between organizations
- Provides routing policy control and traffic engineering
- Allows redundant connections for improved reliability
- Enables direct peering between content and eyeball networks
- Supports internet growth through hierarchical addressing
- Facilitates network troubleshooting and security analysis
Troubleshooting with ASN Information
Likely Cause: Poor BGP routing or lack of direct peering
Investigation: Check AS path length and peering relationships
Solution: Contact ISP about peering or use different DNS/CDN
Likely Cause: BGP routing issues or filtering
Investigation: Use traceroute and BGP looking glass tools
Solution: Verify BGP advertisements and routing policies
Likely Cause: Different AS paths for inbound vs outbound traffic
Investigation: Check BGP path attributes and policies
Solution: Adjust BGP policies or consider additional peering
Getting Started with ASN Knowledge
Find out your ISP's ASN and peering relationships
Action: Use whois lookup on your public IP address
Use ASN information to understand connectivity issues
Action: Learn traceroute and BGP looking glass tools
Consider getting your own ASN for multi-homing
Action: Evaluate benefits of redundant ISP connections