Friday, March 13, 2009

Carrier MPLS ASN in BGP as-path

If you have PE-CE routing as OSPF, you might take a look the as-path in your BGP table.

The topology is

ce1----ospf----pe1-----mp-bgp------pe2----ospf---ce2----eBGP----R3

Any type 5 LSA in ce1 learn from pe1 will be still as external in ce2, No doubt about it. When pe2 redistrbute type 5 LAS from MP-BGP routing table, pe2 will do something extra. The pe2 router add tag in the type 5 LSA, by default the tag is equal to MPLS VPN BGP ASN(RFC 1745) . The cisco.com doc indicate,
"The default value is calculated based on the BGP autonomous system number of the MPLS VPN backbone.
The four highest bits are set to 1101 according to RFC 1745.
The lowest 16 bits map the BGP autonomous system number of the MPLS VPN backbone. "

So, if you see the tag in type 5 LSA, if will apend into BGP as-path. This is because the route was
originated by some other means or IGP. The BGP process in ce2 router will watch the Tag value,
if it's start with 1101 in binary format, it will be copy to the BGP as-path.
If it's not start from 1101 it will not copy into BGP as-path. The format of the Tag is sub-fields as:

First bit as has been generated automatically by an ASBR or not.
Second 2 bits,

the combination are "1000" "1001" "1010" "1011" , The RFC 1745 indicate

OSPF routes with this tag setting SHOULD be exported with the BGP/IDRP attributes,
ORIGIN=, PATH=.

So next time if your MPLS backbone ASN is in the as-path, Watch this out.

No comments: