Multiprotocol BGP end to end: AFI/SAFI, L3VPN (RD vs RT), EVPN route types, 6PE/6VPE, and how one session carries every address family.
Plain BGP-4 only knew how to advertise IPv4 unicast prefixes. Multiprotocol BGP (MP-BGP,
RFC 4760) generalizes it: the same TCP session, the same finite-state machine, the same path
attributes — but now it can carry any address family (IPv6, VPNv4, EVPN, multicast,
flowspec) side by side. The reachability info is moved out of the classic IPv4-only NLRI
fields into two new attributes so BGP itself stays protocol-agnostic:
A route is identified by an AFI/SAFI pair (Address Family / Subsequent Address Family). Reachable prefixes ride in MP_REACH_NLRI (which also carries the next-hop), and withdrawals ride in MP_UNREACH_NLRI. Everything else —AS_PATH,LOCAL_PREF,MED, communities — is reused unchanged across all families.
Three additions turn BGP-4 into a multiprotocol control plane. They are the whole story, so keep them straight:
| Piece | Type | Purpose |
|---|---|---|
| MP_REACH_NLRI | Path attribute 14 (optional, non-transitive) | Carries <AFI, SAFI, next-hop, NLRI...> — the reachable prefixes for one family, plus their next-hop. Replaces the IPv4-only NLRI + NEXT_HOP for non-IPv4 families. |
| MP_UNREACH_NLRI | Path attribute 15 (optional, non-transitive) | Carries <AFI, SAFI, NLRI...> to withdraw prefixes of that family. The multiprotocol equivalent of the Withdrawn Routes field. |
| Multiprotocol capability | OPEN capability (code 1) | Each peer advertises which (AFI, SAFI) pairs it supports. A family is active on the session only if both sides advertised it. No new session per family. |
NEXT_HOP attribute.AFI names the network-layer protocol (IPv4=1, IPv6=2, L2VPN=25); SAFI qualifies what kind of route it is.
The pair is what you configure under address-family and what capability negotiation exchanges.
| Family | AFI | SAFI | Carries |
|---|---|---|---|
| IPv4 unicast | 1 | 1 | Plain Internet IPv4 routes. |
| IPv6 unicast | 2 | 1 | Plain Internet IPv6 routes. |
| IPv4 labeled-unicast (BGP-LU) | 1 | 4 | IPv4 prefix + MPLS label — inter-AS / seamless MPLS, SR label distribution. |
| IPv6 labeled-unicast (6PE) | 2 | 4 | IPv6 prefix + label over an MPLS IPv4 core. |
| VPNv4 (L3VPN) | 1 | 128 | RD + IPv4 prefix + VPN label — MPLS L3VPN customer routes. |
| VPNv6 (6VPE) | 2 | 128 | RD + IPv6 prefix + VPN label. |
| L2VPN EVPN | 25 | 70 | MAC/IP, Ethernet A-D, multicast, ES, IP-prefix routes for VXLAN/MPLS. |
| MVPN (multicast VPN) | 1 / 2 | 5 | C-multicast / auto-discovery routes for NG-MVPN. |
| IPv4/IPv6 multicast (RPF) | 1 / 2 | 2 | Separate RPF topology for multicast (MBGP). |
| Flowspec | 1 / 2 | 133 (134 for VPN) | Traffic-filtering rules (RFC 8955) — distributed ACL/DDoS mitigation. |
| RT Constraint | 1 | 132 | Route-Target membership NLRI (RFC 4684) — see scaling. |
SAFI 128 (VPNv4/VPNv6) and SAFI 70 (EVPN) do not carry a bare IP prefix. They carry a structured NLRI — a Route Distinguisher prepended to make it globally unique, plus labels — and rely on Route Targets (extended communities) to decide which VRFs import it. RD and RT are different things; mixing them up is the #1 way to fail an L3VPN question.
An MPLS L3VPN (RFC 4364) lets many customers share one provider core while keeping their routing tables
isolated — even when two customers use the same 10.0.0.0/8. Two orthogonal problems, two
different mechanisms:
ASN:nn (type 0), IP:nn (type 1). E.g. 65000:100.export RT is stamped on routes leaving a VRF; import RT selects which incoming
VPNv4 routes get installed into that VRF's routing table.RD = uniqueness (structural), RT = reachability policy (who imports). You can change a customer's connectivity by editing RTs without touching the RD; you cannot fix overlapping-prefix collisions with RTs.
/32), reachable via
the IGP + LDP/SR in the core. This is why next-hop matters: the P routers in the core know nothing
about VPNv4 or customer prefixes — they only label-switch toward the egress PE's loopback. Losing the
loopback route (or the label to it) breaks the VPN even though BGP is up.PE2# show bgp vpnv4 unicast all 10.1.1.0/24
BGP routing table entry for 65000:100:10.1.1.0/24, version 7
└──RD──┘└──prefix──┘
Paths: (1 available, best #1)
Local
192.0.2.1 (metric 20) from 192.0.2.9 (192.0.2.9) ← next-hop = PE1 loopback (via RR 192.0.2.9)
Origin IGP, localpref 100, valid, internal, best
Extended Community: RT:65000:100 ← Route Target (import policy)
mpls labels in/out nolabel/24016 ← VPN label allocated by PE1
Originator: 192.0.2.1, Cluster list: 192.0.2.9
PE1 (site A) P core (label switching) PE2 (site B)
VRF CUST-A VRF CUST-A
export RT 65000:100 ──▶ VPNv4: RD 65000:100 : 10.1.1.0/24 ──▶ import RT 65000:100
redistribute CE route next-hop 192.0.2.1, VPN label 24016 installs into CUST-A RIB
RT:65000:100 (RD stripped, plain 10.1.1.0/24)
The receiving PE runs its normal BGP best path, then for each VRF checks: does any import RT match an RT on the route? If yes, it strips the RD and installs the plain customer prefix into that VRF, with the VPN label recorded for forwarding.
EVPN (RFC 7432 for MPLS, RFC 8365 for VXLAN) uses MP-BGP (AFI 25 / SAFI 70) to distribute MAC and IP reachability, replacing flood-and-learn bridging with a BGP control plane. Like L3VPN it uses RD + RT; the difference is the NLRI is typed. Know the five route types:
| Type | Name | What it does |
|---|---|---|
| 1 | Ethernet Auto-Discovery (A-D) | Per-ES and per-EVI. Enables multihoming: fast withdrawal (mass MAC withdraw on link failure) and aliasing (load-balance to all PEs on an ES). |
| 2 | MAC/IP Advertisement | The workhorse: advertises a host MAC (L2) and optionally its MAC+IP binding (for ARP/ND suppression and L3 routing). Carries MAC mobility sequence. |
| 3 | Inclusive Multicast Ethernet Tag | Builds the BUM (broadcast/unknown-unicast/multicast) replication list per BD — ingress replication or an underlay multicast group. |
| 4 | Ethernet Segment (ES) | Discovers PEs attached to the same multihomed ES and runs Designated Forwarder (DF) election (which PE forwards BUM to the CE). |
| 5 | IP Prefix Route | Advertises an IP prefix (subnet/summary) decoupled from any MAC — pure L3, for routing to prefixes, external nets, or silent hosts. |
| EVPN-VXLAN | EVPN-MPLS | |
|---|---|---|
| Encap | VXLAN (UDP/4789), VNI identifies the L2/L3 segment | MPLS label identifies the EVI/BD |
| Underlay | Plain IP fabric (leaf/spine), IGP + often no LDP | MPLS core (LDP/RSVP/SR) |
| Typical use | Data-center fabrics | Service-provider / metro |
| Control plane | Identical — MP-BGP EVPN, same 5 route types, same RD/RT model | |
::ffff:192.0.2.1).