As discussed in the BGP chapter overview the uses of BGP have increased well beyond Internet IPv4 routing because of its support for multi-protocol extensions, or more simply MP-BGP. MP-BGP allows BGP peers to exchange routes for NLRI other than IPv4 prefixes - for example IPv6 prefixes, Layer 3 VPN routes, Layer 2 VPN routes, FlowSpec rules, and so on. A BGP router that supports MP-BGP indicates the types of routes it wants to exchange with a peer by including the corresponding AFI (Address Family Identifier) and SAFI (Subsequent Address Family Identifier) values in the MP-BGP capability of its OPEN message. The two peers forming a session do not need to indicate support for the same address families. As long as there is one AFI/SAFI in common the session establishes and routes associated with all the common AFI/SAFI can be exchanged between the peers.
The list of AFI/SAFI advertised in the MP-BGP capability is controlled entirely by the family commands. The AFI/SAFI supported by the SR OS and the method of configuring the AFI/SAFI support is summarized in Table: Multi-protocol BGP support in SR OS.
| Name | AFI | SAFI | Configuration commands | 
|---|---|---|---|
IPv4 unicast  | 
1  | 
1  | 
family ipv4  | 
IPv4 multicast  | 
1  | 
2  | 
family mcast-ipv4  | 
IPv4 labeled unicast  | 
1  | 
4  | 
family label-ipv4  | 
NG-MVPN IPv4  | 
1  | 
5  | 
family mvpn-ipv4  | 
MDT-SAFI  | 
1  | 
66  | 
family mdt-safi  | 
VPN-IPv4  | 
1  | 
128  | 
family vpn-ipv4  | 
VPN-IPv4 multicast  | 
1  | 
129  | 
family mcast-vpn-ipv4  | 
RT constrain  | 
1  | 
132  | 
family route-target  | 
IPv4 flow-spec  | 
1  | 
133  | 
family flow-ipv4  | 
IPv6 unicast  | 
2  | 
1  | 
family ipv6  | 
IPv6 multicast  | 
2  | 
2  | 
family mcast-ipv6  | 
IPv6 labeled unicast  | 
2  | 
4  | 
family label-ipv6  | 
NG-MVPN IPv6  | 
2  | 
5  | 
family mvpn-ipv6  | 
VPN-IPv6  | 
2  | 
128  | 
family vpn-ipv6  | 
IPv6 flow-spec  | 
2  | 
133  | 
family flow-ipv6  | 
Multi-segment PW  | 
25  | 
6  | 
family ms-pw  | 
L2 VPN  | 
25  | 
65  | 
family l2-vpn  | 
EVPN  | 
25  | 
70  | 
family evpn  | 
To advertise reachable routes of a particular AFI/SAFI a BGP router includes a single MP_REACH_NLRI attribute in the UPDATE message. The MP_REACH_NLRI attribute encodes the AFI, the SAFI, the BGP next-hop and all the reachable NLRI. To withdraw routes of a particular AFI/SAFI a BGP router includes a single MP_UNREACH_NLRI attribute in the UPDATE message. The MP_UNREACH_NLRI attribute encodes the AFI, the SAFI and all the withdrawn NLRI. While it is valid to advertise and withdraw IPv4 unicast routes using the MP_REACH_NLRI and MP_UNREACH_NLRI attributes, SRĀ OS always uses the IPv4 fields of the UPDATE message to convey reachable and unreachable IPv4 unicast routes.