An Autonomous System (AS) is: A collection of IP networks and routers under a single administrative domain that presents a common routing policy to the Internet. These might be an ISP, a cloud provider, a large enterprise that is running external BGP, a content provider (such as Google or Meta), to identify each of these an Autonomous System Number (ASN) is used.
BGP uses ASNs to:
- Identify routing domains, which belong to a particular organisation.
- Create the AS_PATH which is attached to routes within the Route Table.
- Prevent routing loops (by using the AS_PATH attribute)
- Apply routing policy between AS.
What is an Autonomous System Number (ASN)?
An Autonomous System Number (ASN) is a globally unique identifier assigned to an AS, in the case of a Public ASN. However, there also exists a Private ASN which is used within an organisation’s network and is not exposed to the public Internet.
You’ll see these ASN referenced in various places in BGP, for example the AS_PATH attribute where you can see the Autonomous Systems (ASs) that a route has passed through.
AS_PATH: 3356 15169 13335
- AS3356 (Lumen)
- AS15169 (Google)
- AS13335 (Cloudflare)
AS Number Ranges (Formats)
There are two ASN number formats, the 16-bit ASN and 32-bit ASN.
| Type | Size | Range |
|---|---|---|
| 16-bit ASN | 2 bytes | 0 – 65535 |
| 32-bit ASN | 4 bytes | 0 – 4294967295 |
Originally, ASNs were 16-bit only. But when the Internet grew and numbers started running out, 32-bit ASNs were introduced (RFC 4893), as you can tell 0-65535 is not enough for today’s Internet. You may also see these expressed in dotted notation, we’ll cover this later in the article.
Public and Private AS Number
ASNs, like with IPv4 and IPv6 IP Addresses (RFC1918) there are ranges of these ASNs that are reserved for “Private” usage, so you can use these within your internal network because they are never used on the public Internet, these are:
- 16-bit Private ASN Range: 64512 – 65534
- 32-bit Private ASN Range: 4200000000 – 4294967294
AS Number Notation Formats
There are two main ways to represent ASNs, one is: ASPLAIN (Asplain Format), the other is ASDOT (Dotted Format).
Originally there were 2 bytes AS numbers, in the range 1-65535, where 1024 of those 64512-65534 reserved for private AS numbers.
After January 2009, the AS numbers were extended to 4 bytes, to increase the number of available AS Numbers from 65536 to 4294967295.
There are three-ways to express these 4-byte AS numbers:
- Asplain
- Asdot
- Asdot+
ASPLAIN (Asplain Format)
This would look like AS65551 (or AS 65551), and is just a decimal representation of the full 32-bit number.
ASDOT (Dotted Format)
Asdot format, means that you represent any AS numbers less than 65535 using the ASPLAIN notation and any AS numbers above 65535 with the asdot+ notation.
Note: its worth noting that 65535 can also be represented as ASDOT+ because in some cases it may need to be otherwise it may in some cases be ambiguous. In this case the high order bits (first 16 bits) will be 0, we’ll explain why in the next section, and the low order bits (second 16 bits) will be the value, so 65535 in this case, so we could represent this as 0.65535.
ASDOT+ (Dotted Plus Format)
With ASDOT you are representing a 32-bit ASN as two 16-bit values, why? When 32-bit ASNs were introduced, older routers only understood 16-bit numbers, To remain backward compatible, 32-bit ASNs were represented in dotted format.
Most systems will use ASPLAIN, however using ASDOT can be useful to represent (like in our labs) certain configurations of BGP Confederations so they are easier to read, for example: 65001.0, 65001.1, 65001.2 it kinda shows how the AS .0, .1 and .2 are sub-AS within the AS 65001.
There are some maths involved, but understanding this will be helpful for you to work out what is going on if you ever see these.
ASDOT represents AS numbers less than 65536 using the ASPLAIN notation and AS numbers above 65536 with the ASDOT+ notation, let’s work through some examples:
Example 1 – Convert from ASPlain to ASDOT+ for an ASN of: AS 65530
We take the AS 65530, because it is less than 65536, there is no calculation to be done. But, if we wanted to represent it as ASDOT+ notation, and being ASDOT+ splits the representation of the AS Number into two 16-bit parts (high and lower order values, with a dot in the middle), and being that all the older AS Numbers can fit in the low order value, it would be:
- AS 65530 becomes 0.65530
Other examples:
- AS 744 becomes 0.744
- AS 34563 becomes 0.34563
Example 2 – Convert from ASPlain to ASDOT+ for an ASN of: AS 70424
Because the AS 70424 is greater than 65536, representing it in the ASDOT+ notation means we need to perform a calculation, but in reality what you are doing is continuing to count swapping over to the higher order bit values.
- AS 65535 becomes 0.65535
- AS 65536 becomes 1.0
- AS 65537 becomes 1.1
- AS 65537 becomes 1.2
- And so on….
That’s fine, but counting like that isn’t ideal to get to your ASN, so instead you can perform a calculation.
If you want to convert from ASPLAIN to ASDOT+ you need to see how many times you can divide the ASPLAIN number by 65536, the integer is then what is used for the high order value (the first 16 bits), i.e. you ignore any remainder.
You then take your ASPLAIN number and subtract (65536 * integer) to get the low order value (second 16 bits) this is basically the Modulus (finding the remainder), so the following:
Integer (high order bits) = ASPLAIN / 65536
Remainder (low order bits) = ASPLAIN - (Integer * 65536)
ASDOT+ Value = Integer.Remainder
So to convert AS 70424 from ASPLAIN to ASDOT+ would be the following, oh, and remember BODMAS when dealing with the brackets!
Integer (high order bits)
70424 / 65536 = 1
Remainder (low order bits)
70424 - (1 * 65536) = 4888
ASDOT+ Value
1.4888
So:
- AS 70424 becomes 1.4888
Another example:
- AS 1023484 becomes 15.40444
1023484 / 65536 = 15
1023484 - (15 * 65536) = 40444
15.40444
Example 3 – Convert from ASDOT+ to ASPLAIN for an ASN of: 13.2323
What about converting the other way, i.e. from ASDOT+ to ASPLAIN?
Well, if its any with a zero in the high order bit, its easy, you just take the low order bits and that is your ASPLAIN value, e.g. 0.65530 becomes 65530.
But what about an ASN that larger than 65536 thus is written like our example: AS 13.2323? Let’s find out!
(High Order Bits x 65536) + Low Order Bits = ASPLAIN
So to convert AS 13.2323 it would be:
(13 x 65536) + 2323 = 854291
So:
- AS 13.2323 becomes 854291
Special/Reserved ASN Ranges
There are a few AS Numbers that are reserved for special use, these are given below:
0 – Invalid
23456 – AS_TRANS
65535 – Reserved
4294967295 – Reserved
AS_TRANS (23456)
The AS_TRANS AS Number is a special number that is used when a 32-Bit ASN passes through a router that only supports 16-Bit ASNs.
Essentially if you have a BGP Router that only supports 16-Bit ASNs, something that is now increasingly rare; the router substitutes that ASN with AS 23456. Then the real ASN is stored within a special BGP attribute called AS4_PATH. Of course if in the path there were multiple 32-Bit ASNs, these would also be replaced with AS 23456 and stored within the AS4_PATH attribute – the router knows that although AS23456 is referenced, which of the ASNs within the attribute relates to what.
Who Assigns/Allocates Autonomous System (AS) Numbers?
ASN allocation follows a global hierarchy, similar to IP address allocation.
At the top level IANA (Internet Assigned Numbers Authority) manages the global ASN pool, they allocate large ASN blocks to the Regional Internet Registries (RIRs), it does not allocate ASNs direct to organisations or companies.
Then you have the Regional Internet Registries (RIRs) that IANA allocate to, they manage ASNs for particular areas of the world. It’s these RIRs that actually allocate to organisations, ISPs, enterprises, content providers, cloud operators, Internet Exchanges (IX) etc.
| Region | RIR |
|---|---|
| Europe, Middle East | RIPE NCC |
| North America | ARIN |
| Asia Pacific | APNIC |
| Latin America | LACNIC |
| Africa | AFRINIC |
So for the UK it would be RIPE NCC.
However, most companies don’t actually apply directly to the RIR, they normally go via a Local Internet Registry (LIR), which is normally an ISP or hosting provider (who is a member of RIPE) and allocates you IP ranges (IPv4 and IPv6) as well as ASN(s) to their customers. Within this there are two approaches: Direct Assignment – You become a member of RIPE and receive your own ASN (which you can take with you between ISPs), or a Sponsored or Provider-Assigned allocation where your ISP sponsors your ASN allocation via RIPE.
Private ASNs
These are not allocated to organisations, by either of these bodies, it is up to the organisation to manage their own allocation of these themselves, no registration is required.
- 64512–65534
- 4200000000–4294967294
Important Distinction: Ownership
When you receive a public ASN:
- You don’t “own” it permanently like some property.
- It is allocated to you as long as you meet RIR membership / policy requirements.
- If you cease operations, it returns to the registry pool.
Example in Extreme Networks XOS Configuration
To see this in action on Extreme Networks switches, the below example illustrates how the ASDOT+ and ASPLAIN formats are used on the actual configurations:
Below is adding a BGP neighbour on a switch (which has the configure bgp as-display-format asdot set), you would add:
create bgp neighbor 1.1.1.1 remote-AS-number 4200000001 multi-hop
Due to the command: configure bgp as-display-format asdot, it actually shows up in the configuration as the ASDOT (ASDOT+) notation, for example:
create bgp neighbor 1.1.1.1 remote-AS-number 64086.59905 multi-hop