ThisCalculator

Everyday

Autonomous System Number: What It Is & How It Works

Updated · Standard formula, shown below

An Autonomous System Number (ASN) is a unique identifier that allows a network of IP addresses to exchange routing information with other networks on the internet. You need an ASN if you operate a large, multi-homed network (connected to two or more internet service providers) and want to control your own routing policies. This article explains what an ASN is, how it works, how to get one, and common issues network operators face.

Background: Why ASNs Exist

The internet is not a single network but a collection of thousands of independent networks called Autonomous Systems (ASes). Each AS is managed by a single organization—an ISP, a large enterprise, a university, or a cloud provider—and has its own routing policy. For these networks to exchange traffic, they need a common addressing scheme for routing. The ASN provides that scheme, acting like a postal code for the internet’s routing system.

Without ASNs, routers would have to store every possible route to every IP prefix, which would be unmanageable. Instead, they use the Border Gateway Protocol (BGP) to exchange routes, and BGP identifies each network by its ASN. This allows the internet to scale to billions of devices.

How ASNs Work: The Technical Details

An ASN is a 32-bit number (in the current standard) represented as a plain integer, ranging from 0 to 4,294,967,295. Older 16-bit ASNs range from 1 to 65,535. The Internet Assigned Numbers Authority (IANA) allocates ASNs to Regional Internet Registries (RIRs), which then assign them to organizations.

When two networks connect, they use BGP to announce the IP prefixes they own. Each announcement includes the ASN of the announcing network. Routers use this information to build a path to each prefix, and they prefer shorter paths (fewer AS hops) or paths with specific policies. If a network has multiple upstream providers, it can use its ASN to implement traffic engineering—for example, preferring one provider for inbound traffic and another for outbound.

ASNs are also used in the AS_PATH attribute of BGP, which lists the sequence of ASNs a route has traversed. This helps prevent routing loops and allows operators to filter routes based on the origin ASN.

How to Get an ASN

To obtain an ASN, you must apply to the RIR that covers your region. The five RIRs are:

  • ARIN (North America)
  • RIPE NCC (Europe, Middle East, Central Asia)
  • APNIC (Asia-Pacific)
  • LACNIC (Latin America and the Caribbean)
  • AFRINIC (Africa)

The application process typically requires you to justify the need for an ASN. Common justifications include:

  • You are multi-homed (connected to two or more ISPs) and need to announce your own prefixes.
  • You are an ISP or hosting provider that needs to announce customer prefixes.
  • You need to implement a specific routing policy that requires a unique ASN.

Most RIRs charge an annual fee for ASN registration, which varies by region and membership type. Once approved, you receive an ASN and can start announcing your prefixes via BGP.

Public vs. Private ASNs

Not every network needs a public ASN. For internal BGP (iBGP) or when connecting to a single upstream provider, you can use a private ASN from the range 64512–65534 (16-bit) or 4200000000–4294967294 (32-bit). These are not globally unique and are not announced on the public internet. They are useful for internal routing or for customers who do not need their own public ASN but still want to run BGP with their provider.

Public ASNs are globally unique and are required for any network that announces prefixes to the internet. If you are multi-homed, you must have a public ASN to avoid conflicts.

Common Problems and Misconceptions

One common misconception is that an ASN is the same as an IP address. They are different: an IP address identifies a device or a network interface, while an ASN identifies an entire routing domain. Another misconception is that you need an ASN to connect to the internet. In reality, most small networks use a single ISP and do not need an ASN; they simply use the ISP’s routing.

Common problems with ASNs include:

  • ASN hijacking: when a malicious actor announces a prefix with your ASN, causing traffic to be routed to them. This is mitigated by using RPKI (Resource Public Key Infrastructure) to cryptographically verify route announcements.
  • BGP route leaks: when a network accidentally announces routes it should not, causing traffic to be misrouted. This can be avoided by implementing proper filtering and using BGP best practices.
  • Running out of 16-bit ASNs: the pool of 16-bit ASNs was nearly exhausted, leading to the adoption of 32-bit ASNs. Many older routers may not support 32-bit ASNs, so compatibility checks are necessary.

ASN vs. IP Address: Key Differences

To clarify, here is a side-by-side comparison:

  • Purpose: IP addresses locate a device on a network; ASNs identify a network’s routing policy.
  • Scope: IP addresses are hierarchical and assigned to interfaces; ASNs are flat and assigned to organizations.
  • Use in BGP: IP prefixes are announced; ASNs are used in the path to determine reachability.
  • Example: Your home router has a private IP like 192.168.1.1, but it does not have an ASN because it is not a multi-homed AS.

Costs and Alternatives

The cost of an ASN varies by RIR. For example, ARIN charges an annual fee based on the size of your network, while RIPE NCC charges a flat membership fee. The costs are generally low (tens to hundreds of dollars per year) for small networks. There is no alternative to a public ASN if you need to multi-home, but you can avoid an ASN by using a single provider or by using a provider-independent IP address without BGP (which is not possible for multi-homing).

Frequently Asked Questions

Do I need an ASN for my business? Only if you are multi-homed or need to announce your own IP prefixes. If you use a single ISP and are fine with their routing, you do not need an ASN.

What is the difference between ASN and BGP? ASN is a number that identifies a network; BGP is the protocol that exchanges routing information between networks. BGP uses ASNs to build paths.

Can I choose my own ASN? No, ASNs are assigned by RIRs. You cannot pick a random number; it must be allocated to you.

What is ASN hijacking? It is when someone else announces your IP prefix with their ASN, causing traffic to be diverted. This can be mitigated with RPKI and BGP filtering.

How long does it take to get an ASN? It depends on the RIR and the completeness of your application. It can take from a few days to a few weeks.

Can I use a private ASN on the internet? No, private ASNs are not propagated on the internet. They are only for internal use.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.