Sub topic 7
MPLS Layer 3 VPNs: how a provider carries many customers
This chapter assumes you know the CE, PE, and P router roles, how MPLS labels are pushed, swapped, and popped, and what BGP does at a conceptual level. VRFs, route distinguishers, and route targets get their own chapter, so here they appear only as far as the overall model needs.
The problem the provider solves
A provider has hundreds of customers on one shared MPLS core. Two of them may both use 10.1.0.0/16 internally. The provider must keep their traffic and routes apart without building a separate network for each customer.
An MPLS Layer 3 VPN does this with three pieces:
- Separate routing tables on the PE. Each customer gets its own virtual routing table, called a VRF.
- Route exchange between PEs. The PEs share customer routes using MP-BGP.
- A label stack. Packets cross the core with two labels, one for the path and one for the customer.
Who sees what
The customer's CE router speaks ordinary IP to the PE. It runs a static route, OSPF, or eBGP, and it knows nothing about MPLS. The P routers in the core carry only labeled packets and hold no customer routes at all. Only the PEs know about customers.
Following a packet
- CE-A1 sends an IP packet to PE1. PE1 looks up the destination in the VRF tied to that interface, not in the global table.
- The lookup result names the remote PE (PE2) and a VPN label. PE2 advertised that label for the customer prefix.
- PE1 pushes the VPN label (inner), then the transport label (outer). The transport label is the LDP label for the LSP leading to PE2's loopback.
- P routers swap only the outer label. They never read the inner one or the customer's IP header.
- The last P router pops the outer label (penultimate hop popping). PE2 receives the packet with only the VPN label.
- PE2 uses the VPN label to find the right VRF, removes the label, and forwards plain IP to CE-A2.
How routes travel
PE1 learns customer prefixes from CE-A1 into the VRF. It then exports them into MP-BGP as VPNv4 routes. Each route carries a route distinguisher, which makes overlapping prefixes unique, and a route target, which says which VRFs may import it. PE2 imports matching routes into its own VRF and passes them to CE-A2. The next hop of each route is PE1's loopback, so the core's IGP and LDP must have a labeled path to it.
Useful checks on a PE:
show ip route vrf CUST_A
show bgp vpnv4 unicast all summary
show mpls forwarding-table vrf CUST_ACommon errors
- Missing route-target import or export. The BGP session is up but the remote VRF stays empty.
- Interface not placed in the VRF. Applying
vrf forwardingafter the IP address wipes the address, so reconfigure it. Without the VRF, the customer's traffic lands in the global table. - No
send-community extendedunder the VPNv4 neighbor. Route targets are carried as extended communities. If they are not sent, no routes get imported. - No LSP to the remote PE loopback. The control plane looks healthy, but forwarding fails. Check that
mpls ipis on every core link. - Loopback not reachable or not used for BGP. Use loopbacks as the iBGP source so the next hop is stable.
Exercise
Two customers both use 10.1.0.0/16. Why does the provider core still forward their traffic correctly, and which labels does a P router read?
Show answer
Each customer has its own VRF on the PEs, and MP-BGP route distinguishers make the overlapping prefixes unique VPNv4 routes. The inner VPN label tells the egress PE which VRF to use. A P router reads only the outer transport label and never looks at the VPN label or the customer's IP header.