What Is an ASN (Autonomous System Number)?

An Autonomous System Number (ASN) is a unique number assigned to a network, such as an ISP, cloud provider or large company, that controls its own routing on the internet. Routers use ASNs with the Border Gateway Protocol (BGP) to decide which networks a packet should cross to reach its destination.

What an autonomous system is

The internet is not one network but tens of thousands of independently operated networks joined together. Each of these is called an autonomous system (AS). RFC 1930 describes an AS as a connected group of IP prefixes run by one or more network operators with a single, clearly defined routing policy. In plain terms, an AS is a network that decides for itself how traffic enters and leaves it.

Your home broadband provider is an AS. So are large content and cloud companies, universities, mobile carriers and the backbone networks that carry traffic between countries. Each one is identified by its ASN, written with an "AS" prefix, such as AS13335.

An AS "originates" the blocks of IP addresses it is responsible for. When you look up an IP address, the ASN tells you which network is announcing it to the rest of the internet, which is often more informative than the address alone. You can see the ASN for your own connection on the WhatsMyIPNumber home page.

How BGP uses ASNs to route traffic

Autonomous systems exchange routing information using the Border Gateway Protocol (BGP). The process works roughly like this:

  1. Announcement. An AS tells its neighbours, "I can deliver traffic for these IP prefixes", for example 203.0.113.0/24.
  2. Propagation. Each neighbour passes the announcement on to its own neighbours, adding its ASN to a list called the AS_PATH.
  3. Selection. A router that hears several paths to the same prefix chooses one based on local policy, commercial relationships and, all else being equal, preferring the shorter AS_PATH.
  4. Forwarding. Packets for that prefix are sent toward the chosen neighbour, which repeats the process until they arrive.

The AS_PATH also prevents loops: if a router sees its own ASN already in a path, it rejects the route. BGP between different autonomous systems is called external BGP (eBGP), while BGP used to distribute routes inside a single AS is internal BGP (iBGP).

Peering and transit

Networks connect under two broad kinds of agreement. In transit, a customer pays a provider to carry its traffic to the rest of the internet. In peering, two networks exchange traffic destined for each other's customers, often without payment, either over a direct link or at an Internet Exchange Point (IXP) where many networks meet. These relationships explain why traffic sometimes takes a surprisingly indirect route: BGP follows business policy, not geography.

ASN formats and number ranges

ASNs were originally 16-bit numbers, giving 65,536 possible values. As those ran short, 32-bit ASNs were introduced (now defined in RFC 6793), raising the ceiling to 4,294,967,296 values. Modern equipment supports both, and 32-bit ASNs are allocated routinely.

RangePurpose
0Reserved; not used for routing
1–64495Public 16-bit ASNs assigned to networks
64496–64511Reserved for documentation and examples (RFC 5398)
64512–65534Private use, like private IP ranges (RFC 6996)
23456AS_TRANS, a placeholder that lets older 16-bit routers handle 32-bit ASNs
65536–65551Reserved for documentation (32-bit)
4200000000–4294967294Private use (32-bit)

Private ASNs are used inside organisations or between a customer and its provider, and should be stripped before routes are announced to the wider internet.

Examples of well-known ASNs

Some ASNs appear so often in lookups that network engineers recognise them on sight:

ASNNetwork
AS15169Google
AS13335Cloudflare
AS16509Amazon (AWS)
AS8075Microsoft
AS32934Meta (Facebook)
AS7922Comcast
AS3356Lumen (formerly Level 3)
AS174Cogent

Large organisations often operate several ASNs, for different regions, acquired companies or separate business units.

Who assigns ASNs

The Internet Assigned Numbers Authority (IANA) hands blocks of ASNs to five Regional Internet Registries (RIRs), which assign them to organisations in their region:

  • ARIN for the United States, Canada and parts of the Caribbean
  • RIPE NCC for Europe, the Middle East and parts of Central Asia
  • APNIC for the Asia-Pacific region
  • LACNIC for Latin America and parts of the Caribbean
  • AFRINIC for Africa

An organisation usually needs its own ASN when it connects to two or more upstream providers (multihoming) or otherwise needs its own routing policy. A small business with a single ISP does not need one; it simply uses addresses from its provider's AS. The registration details for an ASN, including the holder's name and contacts, are published through WHOIS and RDAP, which our guide to WHOIS and RDAP explains.

How to find the ASN behind an IP address

Using our tools

Enter any IPv4 or IPv6 address into the IP Lookup tool to see its ASN and the organisation behind it, along with approximate location. For registration records, including the network range, the RIR and abuse contacts, use the WHOIS Lookup.

From the command line

Team Cymru runs a free public IP-to-ASN mapping service that you can query with a standard WHOIS client:

whois -h whois.cymru.com " -v 8.8.8.8"

The result lists the origin ASN, the announced prefix, the country code, the registry and the AS name.

Why ASNs matter in practice

  • Identifying connection type. An IP in a residential ISP's AS looks very different from one in a cloud provider's AS. Fraud-prevention, streaming and anti-abuse systems use this to spot traffic coming from data centres, proxies or VPN services.
  • Troubleshooting. Traceroute tools that show ASNs make it easy to see where traffic leaves one network and enters another, which helps pinpoint where delays or packet loss begin.
  • Security and abuse handling. When attacks originate from a particular network, administrators can contact its abuse desk or, in extreme cases, filter its prefixes.
  • Understanding geolocation. The AS holder's registered country can influence where geolocation databases place an address, one reason results are sometimes wrong. See how accurate IP geolocation is.

When routing goes wrong

BGP was designed on the assumption that networks would announce only what they are entitled to. Mistakes and misuse can therefore have wide effects. In February 2008, a Pakistani ISP announced a more specific route for part of YouTube's address space while trying to block the site domestically; the announcement leaked to the global internet and made YouTube unreachable for much of the world for around two hours. In October 2021, a configuration change caused Facebook's network to withdraw the BGP routes for its DNS servers, taking Facebook, Instagram and WhatsApp offline for several hours.

To reduce the risk of such incidents, networks increasingly use RPKI (Resource Public Key Infrastructure). Address holders publish signed Route Origin Authorisations stating which ASN may announce their prefixes, and other networks can reject announcements that do not match.

Tip: If you want to know whether a site is served from a content delivery network, look up its IP address. An ASN belonging to a CDN rather than the company itself is a strong clue.

Frequently asked questions

Does my home internet connection have an ASN?

Your connection does not have its own ASN, but your ISP does. Your public IP address belongs to a prefix announced by your ISP's autonomous system.

Is an ASN the same as an IP address range?

No. An ASN identifies a network, and that network announces one or more IP address ranges (prefixes). One ASN can originate thousands of prefixes.

Can an ASN tell me who is using a specific IP?

It tells you which organisation routes the address, such as an ISP or hosting company, not which customer or person is using it. Only the ISP can map an address to a subscriber.

How many ASNs exist?

Over 100,000 ASNs have been assigned by the regional registries, and a large share of them are actively announcing routes at any given time. The exact figures change daily and are published by the RIRs.

Try it yourself

Put this guide into practice with our free tools.

Keep reading

Copied to clipboard