MP-BGP Basics: Address Families, VPNv4, and EVPN

MP-BGP Basics: Address Families, VPNv4, and EVPN

BGP-4 was born to carry one thing: IPv4 unicast routes across the internet. MP-BGP is the small, elegant extension that let the same protocol carry everything else — IPv6, MPLS VPNs, multicast, and the EVPN control plane that runs modern data-centre fabrics. Understanding MP-BGP is really understanding one idea: address families, and the two attributes that carry them. This walk-through goes from that idea to Route Distinguishers, Route Targets, and EVPN.

1. Why BGP needed a multiprotocol extension

Original BGP-4 hard-coded IPv4 unicast into the UPDATE message: the reachable prefixes (NLRI) and the next-hop were plain IPv4 fields. That worked until the internet needed IPv6, VPNs, and multicast through the same sessions. Rather than invent a new protocol, MP-BGP (RFC 4760) added Multiprotocol Extensions — a way to carry any address family inside BGP without touching the base message format.

Why BGP needed MP-BGPNET BY MEBGP-4 (original)IPv4 unicast onlyNLRI and next-hop are IPv4 fieldsMP-BGP (RFC 4760)any address family on one sessionIPv6, VPNv4, multicast, EVPN…

2. Address families — AFI and SAFI

The whole mechanism rests on labelling each route with what kind of route it is. An AFI (Address Family Identifier) names the protocol family — 1 for IPv4, 2 for IPv6, 25 for L2VPN — and a SAFI (Subsequent AFI) refines it — 1 unicast, 2 multicast, 128 MPLS VPN, 70 EVPN. A BGP session can run many AFI/SAFI pairs at once, each with its own table, all over a single TCP connection.

AFI / SAFINET BY MEAFISAFIAddress family1 (IPv4)1 (unicast)IPv4 unicast — the classic internet table2 (IPv6)1 (unicast)IPv6 unicast1 (IPv4)128 (MPLS VPN)VPNv4 — L3VPN customer routes25 (L2VPN)70 (EVPN)EVPN — MAC/IP for fabrics

3. The two attributes that carry it all

MP-BGP adds exactly two optional, non-transitive path attributes. MP_REACH_NLRI advertises reachable prefixes for a given AFI/SAFI, and crucially carries the next-hop for that family inside it. MP_UNREACH_NLRI withdraws them. Being optional non-transitive matters: a router that does not understand an address family simply ignores the attribute rather than mangling it, which is why MP-BGP deployed smoothly across mixed networks.

MP_REACH and MP_UNREACHNET BY MEMP_REACH_NLRIadvertise prefixes for an AFI/SAFIcarries the family next-hopMP_UNREACH_NLRIwithdraw those prefixesoptional, non-transitive

4. The Route Distinguisher — making overlaps unique

In an MPLS L3VPN, two customers may both use 10.0.0.0/8 — identical prefixes that BGP must keep apart. The Route Distinguisher (RD) solves this: an 8-byte value prepended to the IPv4 prefix to form a 96-bit VPNv4 route that is globally unique. The RD is purely for uniqueness — it carries no policy. A common mistake is to think the RD controls which VPN a route joins; it does not. That is the Route Target’s job.

Route DistinguisherNET BY MECustomer A10.0.0.0/8Customer B: 10.0.0.0/8+RD65000:1 : 10.0.0.0/8 (VPNv4, unique)RD 65000:1 prepended65000:2 : 10.0.0.0/8 (now distinct)

5. The Route Target — who imports what

If the RD makes routes unique, the Route Target (RT) decides where they go. An RT is an extended community attached to a VPNv4 route on export, and each VRF is configured with a list of RTs to import. A route is pulled into a VRF only if one of its attached export RTs matches that VRF’s import list. This is the knob that builds VPN topologies — full mesh, hub-and-spoke, extranet — all by choosing which RTs each site exports and imports.

Route TargetNET BY MESite A (VRF)export RT 100:1Site B (VRF)import RT 100:1route tagged RT 100:1B imports 100:1 -> route installed; a site not importing it never sees the routeRT is policy; RD is only uniqueness — do not confuse the two

6. MP-BGP as the MPLS L3VPN control plane

Put it together and you have the service that pays for a lot of backbones. Provider-edge (PE) routers run MP-iBGP between them — usually through route reflectors — and advertise VPNv4 routes: RD + customer prefix, tagged with RTs, and carrying an MPLS label. The core (P routers) never sees customer routes at all; it only switches labels. Customer isolation, overlapping addresses, and scale all fall out of this one design.

MPLS L3VPN control planeNET BY MEPE 1PE 2MPLS core (P)label switching onlyMP-iBGP: VPNv4 (RD+prefix, RT, label)The core carries no customer routes — only the PEs hold VPNv4 state

7. EVPN — MP-BGP for Layer 2

The newest and most important use is EVPN (AFI 25, SAFI 70): MP-BGP as the control plane for Layer-2 and data-centre fabrics. Instead of flood-and-learn, switches advertise MAC and MAC/IP bindings as BGP routes (EVPN Type 2), so the fabric learns reachability through routing, not flooding. Paired with a VXLAN data plane, EVPN gives multi-tenant, loop-free, actively-multipathed Layer-2 at scale — the modern spine-leaf standard, and all of it rides on the same two MP-BGP attributes.

EVPN control planeNET BY MELeaf 1learns MAC X locallyLeaf 2installs MAC X via BGPEVPN Type 2 (MAC/IP)MAC reachability advertised as BGP routes — no flood-and-learn

8. Capability negotiation — opt-in per family

None of this activates by accident. When two routers open a BGP session, each advertises a Multiprotocol Capability in the OPEN message listing the AFI/SAFI pairs it supports. An address family is exchanged only if both peers advertise it. This is why a VPNv4 session that will not come up is so often a one-sided address-family configuration — the capability simply was not offered on both ends, so the family never negotiates.

Capability negotiationNET BY MERouter ARouter BOPEN: I support IPv4, VPNv4OPEN: I support IPv4, VPNv4Both advertise VPNv4 -> it activates; one-sided config -> the family never comes up

Takeaways

MP-BGP is one idea executed cleanly: tag every route with an address family, carry it in two optional attributes, and let unaware routers ignore what they cannot parse. On that foundation sit the Route Distinguisher (uniqueness), the Route Target (policy), MPLS L3VPN, and EVPN. Keep RD and RT distinct, remember that families are opt-in per peer, and the densest BGP deployments become readable.

Mokrane ASSAM

Comments are closed.