What is an ASN? Autonomous System Numbers Explained
Last updated
An ASN, or Autonomous System Number, is a unique number that identifies a network on the internet. An autonomous system is a group of IP prefixes run by one operator under a single routing policy - typically an ISP, hosting company, cloud provider or large organization. When networks exchange routes using BGP, the ASN is how they say who originates a prefix and which networks a route passes through. AS13335, for example, is Cloudflare; AS15169 is Google. ASNs are assigned by the five Regional Internet Registries.
What an autonomous system is
RFC 1930 describes an autonomous system as a connected group of IP prefixes run by one or more network operators with a single, clearly defined routing policy. The important words are "single routing policy": an AS is not defined by size or by company, but by the fact that the rest of the internet can treat it as one unit when deciding how to reach its addresses.
In practice one organization usually has one ASN, even if it operates in many countries. Large organizations sometimes run several (for example after acquisitions, or to separate a content network from an access network), and small organizations without their own routing policy have none at all - their addresses are announced by their provider's AS.
The ASN appears in two places in BGP. It identifies the two sides when a session is set up, and it is added to the AS-path of every route an AS passes on. The last ASN in a path is the origin AS: the network that announced the prefix in the first place. That is why "which ASN is this IP in?" is the first question in almost every network investigation.
16-bit and 32-bit ASNs
The original ASN space was 16 bits wide, allowing numbers from 0 to 65535. As the internet grew that pool ran low, so RFC 4893 (now RFC 6793) extended it to 32 bits, allowing numbers up to 4294967295. Today the registries assign mostly 32-bit numbers, which is why recently registered networks typically have six-digit numbers or larger, while long-established networks hold low numbers.
32-bit ASNs can be written in two notations (RFC 5396). The plain form (asplain) is the decimal number. The older asdot form splits it into the high and low 16 bits:
| asplain | asdot | Note |
|---|---|---|
| 64500 | 64500 | Numbers below 65536 look the same in both notations |
| 65536 | 1.0 | The first 32-bit-only ASN |
| 196618 | 3.10 | 3 x 65536 + 10 |
| 4200000000 | 64086.59904 | Start of the 32-bit private range |
Routers that do not understand 4-byte ASNs see the placeholder AS23456 (AS_TRANS) in place of a 32-bit ASN, while the real path travels in a separate attribute. Seeing AS23456 in a path on a modern router means the 4-byte path could not be reconstructed, which points to old software or a misconfiguration somewhere along the way.
Reserved and private ASN ranges
Not every number is a real network. Several ranges are reserved by RFC and must never appear as an origin in the global routing table:
| Range | Purpose | Defined in |
|---|---|---|
| 0 | Not a valid origin; used in AS0 ROAs to mark prefixes that must not be routed | RFC 7607 |
| 23456 | AS_TRANS placeholder for 4-byte ASNs | RFC 6793 |
| 64496-64511 | Documentation and examples | RFC 5398 |
| 64512-65534 | Private use (16-bit) | RFC 6996 |
| 65535 | Reserved | RFC 7300 |
| 65536-65551 | Documentation and examples (32-bit) | RFC 5398 |
| 4200000000-4294967294 | Private use (32-bit) | RFC 6996 |
| 4294967295 | Reserved | RFC 7300 |
Private ASNs are the ASN equivalent of RFC 1918 addresses. They are fine inside a network or between a customer and a single provider - many single-homed customers run BGP with their ISP using a private ASN, which the ISP removes before announcing the routes onward. If a private ASN shows up in a path on the public internet, someone forgot to strip it.
How to get an ASN
Public ASNs come from the Regional Internet Registry that serves your region: AFRINIC, APNIC, ARIN, LACNIC or RIPE NCC. IANA hands blocks of numbers to the RIRs; the RIRs assign individual numbers to organizations, either directly to members or through sponsoring LIRs and national registries, depending on the region.
Policies differ between the registries. Several still ask for a routing need, typically that you plan to connect to more than one other network (multihoming) or have another technical reason why your routing must differ from your provider's; the RIPE NCC removed its multihoming requirement in 2014 (policy proposal 2014-03), so check your registry's current policy. The usual steps are:
- Open an account with your RIR (in most regions this means becoming a member and signing its service agreement) or, where the RIR allows it, have an existing member such as a sponsoring LIR request the ASN on your behalf.
- Prepare the justification: who your upstream providers or peers will be and why you need your own policy.
- Submit the request through the RIR portal or your sponsor. The RIR creates the registration (in some regions an aut-num object in its database).
- Configure BGP with your providers, publish routing information (IRR route objects and RPKI ROAs for your prefixes) and, ideally, an ASPA object listing your providers.
ASNs can also change hands: the registries publish ASN transfers in the same logs as IP address transfers, which you can browse in the transfer statistics.
How to look up an ASN
To find the ASN behind an IP address, look the address up: the origin AS of the most specific announced prefix is the network that routes it. From a terminal:
$ curl ipctl.io/ip/8.8.8.8/asn
AS15169To see what an ASN is, use the ASN lookup or the registry's own whois service. The RIR record tells you who holds the number; routing data tells you what the network actually does:
$ curl ipctl.io/as/24940
AS: AS24940
Name: HETZNER-AS Hetzner Online GmbH
Country: DE
RIR: RIPENCC
Status: allocated
...
$ whois -h whois.ripe.net AS24940An ASN page such as AS24940 combines both views: the registration (holder, country, registry, allocation date) and the live routing picture - the prefixes the AS announces, how much address space that is, its RPKI coverage, its upstream providers and its published ASPA.
What an ASN tells you in practice
Because every routed IP address belongs to a prefix and every prefix has an origin AS, the ASN is the natural pivot point for investigating who runs a piece of the internet:
- Abuse handling: the ASN leads to the operator and its abuse contact, and shows whether an address belongs to a hosting provider, an access network or a content network.
- Routing troubleshooting: the AS-path shows which networks traffic crosses, and unexpected origins point to hijacks or misconfigurations.
- Peering and transit decisions: an ASN's prefix count, address space and upstreams show how large a network is and how it is connected.
- Security posture: RPKI coverage and a published ASPA show how carefully a network protects its own routes.
Frequently Asked Questions
What does ASN stand for?
Autonomous System Number. It uniquely identifies an autonomous system - a network with its own routing policy - on the internet.
How do I find the ASN for an IP address?
Look the IP up and the result shows its origin ASN. For example, an IP lookup for 1.1.1.1 shows AS13335 (Cloudflare). From a terminal, curl ipctl.io/ip/1.1.1.1/asn prints just the ASN.
Who assigns ASNs?
IANA allocates blocks of numbers to the five Regional Internet Registries - AFRINIC, APNIC, ARIN, LACNIC and RIPE NCC - which assign individual ASNs to organizations in their regions.
What is the difference between a 16-bit and 32-bit ASN?
16-bit ASNs range from 0 to 65535 and were the original format. 32-bit ASNs extend the range to about 4.29 billion. Both work the same way in BGP on modern routers.
Do I need an ASN to use BGP?
To announce your own prefixes to more than one provider, yes. A customer connected to a single provider can often run BGP with a private ASN that the provider strips before announcing the routes onward.
Can one organization have several ASNs?
Yes. Large organizations sometimes run separate ASNs for separate networks or keep the ASNs of acquired companies. Each ASN should still represent one routing policy.