Tuesday, September 13, 2022

BGP 16-bits and 32-bits ASN

 A complete table of 16-bits and 32-bits ASN

NumberBitsDescriptionReference
016Reserved for RPKI unallocated space invalidation[11]RFC6483, RFC7607
1 - 2345516Public ASNs
2345616Reserved for AS Pool TransitionRFC6793
23457 - 6449516Public ASNs
64496 - 6451116Reserved for use in documentation/sample codeRFC5398
64512 - 6553416Private ASNsRFC1930, RFC6996
6553516ReservedRFC7300
65536 - 6555132Reserved for use in documentation and sample codeRFC4893, RFC5398
65552 - 13107132Reserved
131072 - 419999999932Public 32-bit ASNs
4200000000 - 429496729432Private ASNsRFC6996
429496729532ReservedRFC7300

Understanding BGP 4-byte ASN

BGP Autonomous System Number (ASN) is a 2-byte (16-bits) entity. 2-bytes give 65536 possible numbers, of which, 0, 23456, 65535 and 64512- 65534 (private ASN) are reserved by IANA. Of the remaining, 39000+ ASNs are already used.

RFC 4893 discusses about 4-byte ASN. 4-bytes provide ASNs ranging from 0 to 4294967296. 0-65535 are called mappable-ASN. The 4-byte ASN can be represented in one of three ways-

1. asplain - simple decimal representation of the ASN. For example, ASN 7747 will be represented as 7747, while 123456 will be represented as 123456.

2. asdot+ - breaks the number up in two 16-bit values as low-order and high-order, separated by a dot. All the 2-byte ASNs can be represented in the low-order value. For example, ASN 65535 will be 0.65535, 65536 will be 1.0, 65537 will be 1.1 and so on. The last ASN 4294967296 will be 65535.65535.

3. asdot - it is a mixture of asplain and asdot+. Any ASN in the 2-byte range is represented as asplain and any ASN above the 2-byte range is represented as asdot+. For example, 65535 will be 65535 while 65536 will be 1.0. Cisco uses this form of implementation.

ASN role in BGP

BGP carries ASN in-
    - OPEN messages
    - AS_PATH attribute
    - AGGREGATOR attribute
    - COMMUNITY attribute

Terminology
Old BGP Speaker- BGP Speaker running 2-byte ASN
New BGP Speaker- BGP Speaker running 4-byte ASN