When an UPDATE message carries information about a particular prefix, it is also possible to “piggy-back” MPLS label mapping information for that prefix. The ability to carry label information in BGP (RFC 3107 ) builds on the Multi-Protocol BGP extension MP_REACH_NLRI attribute using AFI 1 (IPv4) with SAFI 4 (NLRI with MPLS labels) to indicate the presence of a label. The NLRI of the MP_REACH_NLRI attribute is encoded as one or more triples in the form <length, label, prefix>.
The output shown in Debug 5-1 gives an example of a MP_REACH_NLRI for a labeled BGP Address Family with prefix 192.0.2.22/32 and label 262138 using the encoding shown in Figure 5-1. A BGP speaker can withdraw a previously advertised prefix and label simply by listing the NLRI of a previously advertised route in the withdrawn routes field of an MP_UNREACH_NLRI attribute. In this case, the label information carried as part of the NLRI should be set to 0.
Debug 5-1: Labeled BGP Prefix
2 2013/05/16 10:03:57.33 UTC MINOR: DEBUG #2001 vprn100 Peer 2: 192.168.0.2 "Peer 2: 192.168.0.2: UPDATE Peer 2: 192.168.0.2 - Received BGP UPDATE: Withdrawn Length = 0 Total Path Attr Length = 41 Flag: 0x90 Type: 14 Len: 17 Multiprotocol Reachable NLRI: Address Family IPV4-Labeled NextHop len 4 NextHop 192.168.0.2 192.0.2.22/32 Label 262138 Flag: 0x40 ...