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

16-bit Public ASNs
Range: 1 - 64,511
Description: Original ASN format, globally unique
Usage: Large ISPs, major organizations
Examples:
AS7018 - AT&T
AS15169 - Google
AS32934 - Facebook
16-bit Private ASNs
Range: 64,512 - 65,534
Description: For private use, not routed on internet
Usage: Internal networks, testing, private peering
Examples:
AS64512 - Common private ASN
AS65001 - Lab networks
32-bit Public ASNs
Range: 65,536 - 4,199,999,999
Description: Extended format due to exhaustion of 16-bit
Usage: New allocations since 2009
Examples:
AS200000+ - Newer organizations

BGP (Border Gateway Protocol) Basics

BGP is the routing protocol that connects Autonomous Systems together

Key BGP Concepts

BGP Speaker
Definition: A router that runs BGP and can announce/receive routes
Example: ISP edge routers, content delivery network nodes
BGP Peer/Neighbor
Definition: Two ASes that directly exchange routing information
Example: Your ISP peers with other ISPs and content networks
Route Advertisement
Definition: Announcing which IP prefixes your AS can reach
Example: AS15169 announces it can reach 8.8.8.0/24
AS Path
Definition: List of ASNs a route has passed through
Example: Path: AS100 -> AS200 -> AS300 shows route traversal

BGP Types

TypeDescriptionUsagePort
eBGP (External BGP)BGP between different Autonomous SystemsInter-ISP routing, connecting to internetTCP 179
iBGP (Internal BGP)BGP within the same Autonomous SystemDistributing external routes within large networksTCP 179

How IP Addresses Map to ASNs

Every public IP address belongs to exactly one ASN

How It Works

  1. RIRs allocate IP blocks to organizations
  2. Organizations get assigned an ASN if they need BGP routing
  3. The ASN announces (advertises) their IP prefixes via BGP
  4. Internet routers learn which ASN controls which IP ranges
  5. Traffic destined for those IPs is routed toward that ASN

Real-World Examples

IP RangeASNOrganizationDescription
8.8.8.0/24AS15169Google LLCGoogle's public DNS servers
1.1.1.0/24AS13335CloudflareCloudflare's public DNS and CDN
157.240.0.0/16AS32934FacebookFacebook's social media platform
192.0.2.0/24N/ATEST-NET-1Documentation range, not routed

ASN Lookup Tools

How to find which ASN owns an IP address

WHOIS Query
whois 8.8.8.8
Command-line lookup for IP ownership
Shows: AS15169 Google LLC
BGP Looking Glass
Web-based tools
View BGP routing tables from ISP perspective
Shows AS path and route information
Online ASN Tools
Various websites
User-friendly ASN and IP lookup services
ASN lookup databases and APIs

Common Lookup Commands

Try These 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

Major ISP: AS7018
Organization: AT&T
Role: Provides internet connectivity to millions of customers
IP Blocks: Hundreds of different IP ranges
Peering: Connects to other ISPs, content networks, enterprises
Content Network: AS15169
Organization: Google
Role: Serves content globally with low latency
IP Blocks: 8.8.8.0/24, many others worldwide
Peering: Peers with ISPs and other content networks
Enterprise: AS64496
Organization: Large Corporation
Role: Multi-homed for redundancy and performance
IP Blocks: Corporate public IP ranges
Peering: Connects to multiple ISPs for redundancy
University: AS11537
Organization: University Network
Role: Provides connectivity for campus and research
IP Blocks: Educational institution IP ranges
Peering: Connects to commercial ISPs and research networks

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

Slow connections to specific websites

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

Cannot reach certain IP ranges

Likely Cause: BGP routing issues or filtering

Investigation: Use traceroute and BGP looking glass tools

Solution: Verify BGP advertisements and routing policies

Asymmetric routing problems

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

Understanding Your ISP

Find out your ISP's ASN and peering relationships

Action: Use whois lookup on your public IP address

Network Troubleshooting

Use ASN information to understand connectivity issues

Action: Learn traceroute and BGP looking glass tools

For Enterprises

Consider getting your own ASN for multi-homing

Action: Evaluate benefits of redundant ISP connections

Quick Facts to Remember

Key Points
AS numbers are globally unique identifiers
Every public IP address is announced by exactly one ASN
BGP is the only protocol that connects different ASes
Private ASNs (64512-65534) are not routed on the internet
AS path length affects routing decisions (shorter is preferred)
Large organizations often have multiple ASNs for different purposes