Technical Tip: BGP four-byte AS Path (RFC 4893) support in FortiOS
Description
Solution
- What's new in FortiOS 4.0MR2
- Dynamic Routing (FortiOS 5.2)
The impact this will have on the 'old' BGP speaker is that this 'old' BGP speaker believes it is peering with Autonomous System ‘23456’ (a two-byte AS) instead of the real 4-octet AS.
This behavior is the standard interoperability rule defined in RFC 6793 (under Section 5 - 'Transition' and 'Backward Compatibility') to allow modern 4-byte BGP speakers to talk to very old routers that only understand the original 2-byte AS field (pre-RFC 4893/6793). FortiOS implements it fully and automatically as of FortiOS 4.0 MR2 and above.
These new 4-byte AS numbers (ranging from 65536 to 4294967295) can be written in three ways:
- Asplain:
- All ASNs are written in decimal.
- Example: 655900, 213141, 429496, 429496729, 429496729.
- Asdot:
- ASNs less than 65536 are represented by Asdot using the asplain notation.
- Example: 200, 3000, 35986, 65412.
- Asdot+:
- ASNs above 65536 are represented by Asdot+: high order 16-bit value in decimal>.<low order 16-bit value in decimal>.
  
The ASNs from 1 to 65535 can be written as follows 0.200, 0.3000, 0.35986, 0.65412, 0.65535
The ASNs above 65536 can be written as follows:
- Formula to calculate Asdot+:
- High order bit value = asplain / 65536.
- Low order bit value = asplain - (high order bit value * 65536).
- Asdot+ = high order 16-bit value in decimal>.<low order 16-bit value in decimal.
Example: Converting Asplain 429496729 to Asdot+:
- High order bit value = 429496729 / 65536 = 6553.
- Low order bit value = 429496729 - ( 6553 * 65536) = 39321.
- Asdot+ = 6553.39321.
Some online tools are available for converting Asplain to Asdot+.
Asdot and Asdot+ are supported in FortiOS 7.2.1 and above.
More information is available in RFC 5396.  
