BGP Routing Protocol Federal Law Author: Xiaoda 2025-05-22 10:21:57
In large autonomous systems (AS), the traditional iBGP fully connected architecture faces severe challenges. When the network scales to hundreds of routers, maintaining n(n-1)/2 session connections not only consumes equipment resources, but also increases the complexity of routing policy management. BGP Confederation is a key technology to solve this problem. Through the innovative design of logical partitioning, it realizes the hierarchical routing management while maintaining the integrity of AS.
Related features of Confederation
The NEXT HOP attribute outside the Confederation is retained within the Confederation
The MED attribute of the routes published to the Confederation is retained throughout the
The LOCAL_PREF attribute of the route is preserved throughout the federation
In the federation, the member AS number is pushed into the AS PATH, but not announced outside the federation, and the TYPE3 and 4 AS PATH are used
The federation AS number in the AS PATH is used to avoid loops within the federation
By defining AS123 as a federation AS (large AS) and establishing member ASs (small ASs: AS64512 and 64513) in the federation AS, the problem of IBGP route delivery can be solved.
In the figure, R1 and R2 have a federation iBGP relationship, while R2 and R3 have a federation eBGP relationship. Within the federation, R1 and R2 both belong to AS64512, and R3 belongs to AS64513. However, to the outside of the federation, R1, R2, and R3 are all AS123, and the outside world has no idea of the existence of AS64512 and AS64513.
R1, R2, R3, R4, and R5 use all direct interfaces to establish BGP neighbor relationships.
R1 configuration:
R2 configuration:
For R2, R2 is a common EBGP neighbor (AS64513) and has nothing to do with me. The establishment of the federation will be problematic. Therefore, the bgp confederation peers 64513 command needs to be added on R2. R2 regards AS64513 as its federation eBGP peer. If there are multiple members in the federation, specify:
R3 configuration:
After the configuration is completed, trace to the lo interface address of R5 on R4:
Four types of AS_PATH path attributes
AS_SEQUENCE: Ordered AS number set
AS_CONFED_SEQUENCE: Federation ordered AS number set
AS_SET: Unordered AS number set
AS_CONFED_SET: Federation unordered AS number set
Enable loopback1 interface on R4 and assign an IP address:
BGP table on R1:
BGP table on R2:
BGP table on R3:
Capture packets on R2's e0/1 interface, capture the AS_PATH carried in the NLRI attribute of 44.1.1.1/32, and the AS number is 400:
Capture packets on R3's e0/1 interface, capture the AS_PATH carried in the NLRI attribute of 44.1.1.1/32, and the AS numbers are 64512 and 400 respectively:
Capture packets on R5's e0/0 interface and capture the AS_PATH carried in the NLRI attribute of 44.1.1.1/32. The AS numbers are 123 and 400 respectively:
It can be seen that the AS_CONFED_SEQUENCE attribute is used to prevent loops within the federation (this attribute will not leave the federation), and the above AS_SEQUENCE attribute will be passed to R5 along with the route of 44.1.1.1/32. Therefore, when capturing the route of 44.1.1.1/32 on R5, AS_CONFED_QUENN cannot be seen.