In a recent class I was asked for some details on BGP Autonomous System (AS or ASN) Numbers. I thought I would document and provide a more complete answer here for others to learn from as well.
What is the AS Number?
Let's begin with a definition. An Autonomous System Number (AS number or simply ASN) is a special number assigned by IANA (the Internet Assigned Numbers Authority) used primarilly with Border Gateway Protocol (BGP) and EIGRP that uniquely identifies a network under a single technical administration that has a unique routing policy, or is multi-homed to the public Internet. This ASN is required if you are to run the BGP routing protocol and peer with your next tier Internet provider, and it is required when running BGP between service providers at peering points and Internet Exchanges (IX). Each autonmous system must have a globally unique ASN so that the network IP address blocks appear to come from a unique network on the Internet. BGP uses AS numbers to buils a path of networks (AS Paths) to determine the shortest path to a destination network prefix indicating where in the Internet a prefix is located.
There are 16-bit AS numbers and newer 32-bit AS numbers which were created when the original 16 bit ASN pool from IANA approached exhaustion, and the ASN field was extended the field from 16 to 32 bits [additional references: RFC4893 and RFC5398].
ASN's can represent both IPv4 and IPv6 prefixes in networks.
Here is a short table that provides a breakdown of both the 16 bit and 32 bit address assignments. The newer 32 bit version of the ASN includes all the 16 bit numbers for backwards compatibility.
As stated earlier, IANA controls the AS Number assignments. However, they assign blocks of AS numbers to the Regional Internet Registries or RiR's.
Individual companies and providers in turn get their AS numbers from their local RIR. The RIR that applies to you or your company is based on your physical location. You must formally apply to the RIR to obtain an ASN. ASN's are usually provided for a 'container fee' which is a fancy way of saying that they will charge you money to open an account and place the AS number under your account. You do not own the AS number, instead, think of it as a lease.
Each RIR has their own web page and you must download or complete forms to apply for your ASN. Below is a list of the RIRs and associated links:
AMERICAS/AFRICA - American Registry for Internet Numbers (ARIN)
There are a limited number of ASN available, so the RIR's are very selective about whom they grant an ASN to. You will need to demonstrate the following:
That you have a connection to more than one ISP (or will in the next 30 days). This is called being 'multi-homed'.
You will be asked to specify the exterior routing protocol used to communicate with your ISP (this is exclusively BGP today)
You will be asked to provide the AS numbers (ASN) of all your ISP's.
You may be asked to provide the IP addresses of your ISP's routers to which you connect. You will already know this information as it will be provided when the ISP provides your circuit, but you can discover it with a traceroute if the connection is already working.
You and your ISP must already have an identity on file in the RIR's database
You must have blocks of IP addresses that need routing. You obtain IP addresses from RIR's as well.
You must demonstrate a need to utilize BGP with an organizationally unique route policy OR be multi-homed.
The Difference Between Public and Private ASN's
As shown in the chart above, there are both public ASN's and private ASN's. Several RFC's outline which addresses are private and which are public, including some special-use ASN's for documentation and/or sample code and for AS number pool transitions. The most used are the public and private ASN's.
An ASN in the public range is globally unique and may be announced on the global Internet to your ISP or at an internet exchange point (peering point) via BGP. ASN's are used to uniquely identify networks or systems of networks which appear to the outside world to be running a single consistent routing policy. Prefixes are 'seen' to originate from these public ASN by the exterior gateway routing protocol (BGP). This ensures that routes lead back to a unique source of a given range of IP addresses.
The private ASN should not be seen on the global Internet (they shouldn't be announced via your exterior gateway routing protocol). Private AS numbers are used by ISP's who use BGP confederations or in private networks. Private AS numbers are also sometimes used to provide an AS number to customers with multiple connections to their ISP, but who have no connections to any other Internet service provider. This is becoming more and more rare. Use of private ASN is more frequent in private networks that will never communicate directly with the Internet. Most ISPs utilize route filters to reject routes that contain private ASN's.
A Bibliography of Associated RFC's
I have compiled a bibliography of associated BGP/ASN RFC's below. Am I missing any? Please comment below.
Bates, Tony J., Ravi Chandra, Yakov Rekhter, and Dave Katz. 2007. “Multiprotocol Extensions for BGP-4.” Request for Comments RFC 4760. Internet Engineering Task Force. https://doi.org/10.17487/RFC4760.
Borkenhagen, Jay, Randy Bush, Ron Bonica, and Serpil Bayraktar. 2019. “Policy Behavior for Well-Known BGP Communities.” Request for Comments RFC 8642. Internet Engineering Task Force. https://doi.org/10.17487/RFC8642.
Chen, Enke, John Scudder, Prodosh Mohapatra, and Keyur Patel. 2015. “Revised Error Handling for BGP UPDATE Messages.” Request for Comments RFC 7606. Internet Engineering Task Force. https://doi.org/10.17487/RFC7606.
Chen, Enke, and Quaizar Vohra. 2007. “BGP Support for Four-Octet AS Number Space.” Request for Comments RFC 4893. Internet Engineering Task Force. https://doi.org/10.17487/RFC4893.
Haas, Jeffrey, and Jon Mitchell. 2014. “Reservation of Last Autonomous System (AS) Numbers.” Request for Comments RFC 7300. Internet Engineering Task Force. https://doi.org/10.17487/RFC7300.
Hawkinson, John A., and Tony J. Bates. 1996. “Guidelines for Creation, Selection, and Registration of an Autonomous System (AS).” Request for Comments RFC 1930. Internet Engineering Task Force. https://doi.org/10.17487/RFC1930.
Huston, Geoff. 2008. “Autonomous System (AS) Number Reservation for Documentation Use.” Request for Comments RFC 5398. Internet Engineering Task Force. https://doi.org/10.17487/RFC5398.
Li, Tony, Ravi Chandra, and Paul S. Traina. 1996. “BGP Communities Attribute.” Request for Comments RFC 1997. Internet Engineering Task Force. https://doi.org/10.17487/RFC1997.
Meyer, David, and Keyur Patel. 2006. “BGP-4 Protocol Analysis.” Request for Comments RFC 4274. Internet Engineering Task Force. https://doi.org/10.17487/RFC4274.
Mitchell, Jon. 2013. “Autonomous System (AS) Reservation for Private Use.” Request for Comments RFC 6996. Internet Engineering Task Force. https://doi.org/10.17487/RFC6996.
Rekhter, Yakov, Tony J. Bates, Ravi Chandra, and Dave Katz. 1998. “Multiprotocol Extensions for BGP-4.” Request for Comments RFC 2283. Internet Engineering Task Force. https://doi.org/10.17487/RFC2283.
Traina, Paul S., John Scudder, and Danny R. McPherson. 2007. “Autonomous System Confederations for BGP.” Request for Comments RFC 5065. Internet Engineering Task Force. https://doi.org/10.17487/RFC5065.
Vohra, Quaizar, and Enke Chen. 2012. “BGP Support for Four-Octet Autonomous System (AS) Number Space.” Request for Comments RFC 6793. Internet Engineering Task Force. https://doi.org/10.17487/RFC6793.