BGP Private And Public AS Range
Similar to what happens with IP addresses, ASNs (Autonomous System Numbers) have to be unique on the Internet. The main reason for this is that BGP uses the AS number for its loop prevention mechanism. When BGP learns about a route that has its own AS number in its path then it will be discarded.
Here’s an example:
Above we have three routers, R1 and R3 are using the same AS number. Once R1 sends an update, R2 will accept it but R3 will not since the AS number is the same.
To prevent the above from happening, IANA is in control of the AS numbers (similar to public IP addresses). If you want an AS number for the Internet then you’ll have to request one. They started with 16-bit AS numbers (also called 2-byte AS numbers) that were assigned like this:
0: reserved.
1 - 64.495: public AS numbers.
64.496 – 64.511 – reserved to use in documentation.
64.512 – 65.534 – private AS numbers.
65.535 – reserved.
The 1- 64.495 public AS range is pretty small so there are similar issues to the IPv4 public IP addresses, there aren’t enough numbers. Right now (December 2016) there are no more AS numbers left that could be assigned by IANA from the first range of AS numbers (16-bits integers called 2-byte AS numbers in RFC 1771).
To get more AS numbers, an extension has been created that supports 32-bit AS numbers (also called 4-octed AS numbers in RFC-4893). This means we have about 4.294.967.296 AS numbers that we can use. AS numbers from this new range have been assigned to new requests.