Versatile Routing and Services with BGP: Understanding and Implementing BGP in SR-OS
by Alcatel-Lucent, Colin Bookham
Chapter 5
Labeled Unicast IPv4
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.
Figure 5-1 MP_REACH_NLRI Labeled BGP Encoding

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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access