MPLS VPN
MPLS VPN
MPLS VPN
MPLS/BGP VPNs
Literature
Practical BGP: Chapter 10
MPLS repetition,
see for example http://www.csc.kth.se/utbildning/kth/kurser/DD2490/ipro111/lectures/MPLS.pdf
Reference:
JunOS Cookbook: Chapter 14 and 15
Junos software 10.1 VPNs Configuration Guide
draft-kompella-ppvpn-l2vpn-03.txt, Layer 2 VPN Over Tunnels
Motivation to VPN
Companies and organizations wish to connect their local
offices, collect data in an isolated network, or have personel
working from their home or while travelling.
Leased lines are expensive, it makes sense to use IP and
the Internet.
The motivation for VPNs is therefore primary economical
Main
LAN
IP-network
Point-to-point
tunnels
LAN
IP network
LAN
5
Provider-based VPNs
CE - Customer Edge
PE - Provider Edge (BGP)
P - Provider (no BGP)
CE
PE
PE
CE
P
P
CE
CE
PE
PE
L2VPN Pseudowires
(customer view)
L2VPN Pseduowires
(customer view)
10
VPLS is dynamic
L2VPN is static
Note: only one circuit per site
11
AS 65100
10.2.1.0/24
10.1.1.0/24
12
L2VPN pseudo-wire
Static, multipoint overlay solution
Setup point-to-point L2 connections between every site in
the VPN
Pseudo-wires
13
CE
Site 2
PE
P
P
PE
PE
pseudo-wires full
mesh
Site 3
CE
14
15
Site 1
Site 2
PE
P
P
PE
PE
pseudo-wires full
mesh
Site 3
16
CE-PE issues
Since CE-PE communication needs to distinguish between
different circuits, it is common to use virtual connections, as
CE-PE circuits, such as VLANs. You assign one VLAN per
wire.
There are many link-layers. You need to configure which
encapsulation you use. We use 'ethernet-vlan', but it is
possible to use other encapsulation types and translate
between them using 'translational cross-connects'
VPLS does not need VLANs, since only one connection is
required, but there are still encapsulation issues
17
18
Constructing VPNs
Before we go into details about configuring L2VPN, you
need to understand some intrinsics about how VPNs are
constructed.
You need to understand:
Route distinguisher
VRFs
Route targets
19
L3VPN
L3VPN is a peer-type and dynamic VPN using BGP and MPLS
It connects IP-subnetworks belonging to the same private network.
Each customer may use the same adress space, such as 1918 addresses
Each customer site is modelled as a separate AS customer interior
routing runs independently at each site
An address conversion scheme makes each customer VPN route unique
within the provider's network
Multiple routing and forwarding tables are supported on each PE
separating different customer routing information
BGP is used as a signalling protocol to setup VPN connections between
customer sites.
RSVP (or LDP) is used to setup the MPLS paths
MPLS multistacking is used to keep provider's network free of customer
routing information
Disadvantage: Provider imports customer routing tables
Encryption by other means, security by trusting the provider
20
L3VPN example
CE
192.16.100.0/24
192.16.100.0/24
CE
PE
CE
AS 65100
PE
10.2.1.0/24
P
P
CE
CE
PE
10.1.1.0/24
PE
10.1.1.0/24
21
CE to PE routing
The local PE learns routes from the local customer CE
Static routing, eBGP, RIP, or some other IGP
Customer should be able to decide
Often the customer wants a separate routing protocol for
the CE-PE peering (eg. so OSPF link-state is not propagated
to the provider)
22
CE to PE routing (example)
I
192.16.100.0/24
192.16.100.0/24
H
OSPF
B
static
routing
AS 65100
C
F
RIP
eBGP
G
10.1.1.0/24
E
10.1.1.0/24
23
24
Overlapping addresses:
Route Distinguisher
How does a provider keep different client prefixes unique?
Eg: Red and blue VPN both have 10.1.1.0/24
A new address class is used, where a unique prefix is
prepended to the VPN route
This unique prefix is called a route distinguisher (RD)
A new (L3VPN) route is written:
<route distinguisher>::<IPv4addr>/<prefixlen>
8 bytes
Route Distinguisher
4 bytes
IPv4 address/site
25
1 byte
Data
6-7 bytes
4 bytes
Route Distinguisher
Type 0:
2 bytes
2 bytes
4 bytes
Type/Subtype
AS#
Number
2 bytes
Type 1:
IPv4 address
Type/Subtype
4 bytes
IP#
IPv4 address
2 bytes
Number
IPv4 address
26
I
192.16.100.0/24
192.16.100.0/24
H
B
RD: 192.30.200.3:1
RD: 192.30.200.4:2
AS 65100
D
C
F
RD: 192.30.200.2:2
G
10.1.1.0/24
RD: 192.30.200.1:1
J
10.1.1.0/24
27
192.30.200.3:1::192.168.100.0/24
192.30.200.2:2::10.1.1.0/24
192.30.200.1:1::10.1.1.0/24
192.30.200.4:2::192.168.100.0/24
192.30.200.3
192.30.200.2
192.30.200.1
192.30.200.4
28
Operation
A CE announces a prefix to a PE
Eg 192.168.100.0/24 to B by H
The PEs receives the route, strips the route distinguisher and
announces it to the local matching CE
Eg 192.168.100.0/24 to J by E
29
192.16.100.0/24
H
B
RD: 192.30.200.3:1
RD: 192.30.200.4:2
AS 65100
D
C
F
RD: 192.30.200.2:2
G
10.1.1.0/24
RD: 192.30.200.1:1
J
10.1.1.0/24
30
31
Virtual
...
Physical
32
inet.0
Routing protocol 3
RIB
inet.0
inet6.0
inet.1
inet.2
inet.3
bgp.l3vpn
Example:
main.inet.0
__juniper_private1__.inet.0
VPN-IPv4 routes
mpls.0
MPLS label-switch table
33
VRF in a PE
Example: A router with two customers instances: VRF1 and VRF2.
VRF table
VRF1
VRF1
VRF_m
ain
VRF2
VRF_m
ain
VRF2
VRF table
34
Internal nodes (P-nodes) are only aware of outer tags (PE to PE)
With RSVP you set up the outer tag
outer:
LSP label
inner:
VPN label
VRF1
VRF1
2
23
VRF_m
ain
VRF_m
ain
23
VRF2
VRF2
35
Route Target
36
import
192.168.100.0/24
10.1.1.0/24
192.168.100.0/24
export
RD: 192.30.200.3:1
RD: 192.30.200.1:1
10.1.1.0/24
VRF:
37
Route target
The purpose of the route target (RT) extended community is
to tag the VPN-IPv4 routes with VPN information
Rules are then based on route targets
The route target has the same format as the routedistinguisher
AS#:number (type 0) Used in lab
IP#:number (type 1)
Example:
RT 65100:100 - blue VPN
RT 65100:3 - red VPN
I
192.16.100.0/24
192.16.100.0/24
H
B
RD: 192.30.200.3:1
import: 65100:100
export: 65100:100
RD: 192.30.200.4:2
import: 65100:3
export: 65100:3
AS 65100
D
C
F
RD: 192.30.200.2:2
import: 65100:3
export: 65100:3
10.1.1.0/24
RD: 192.30.200.1:1
import: 65100:100
export: 65100:100
E
J
10.1.1.0/24
39
Extranet
The Extranet is defined between the upper two customer sites
Note that the prefixes have been changed to be unique
And the route targets are unique per PE
I
192.16.101.0/24
192.16.102.0/24
H
B
RD: 192.30.200.3:1
import: 65100:12
65100:21
export: 65100:22
AS 65100
D
C
RD: 192.30.200.4:2
import: 65100:11
65100:22
export: 65100:12
F
RD: 192.30.200.2:2
import: 65100:12
export: 65100:11
RD: 192.30.200.1:1
import: 65100:22
export: 65100:21
10.1.1.0/24
10.1.1.0/24
J
40
Hub-and-spoke VPN
All traffic passes via a HUB
Filtering / security purposes
Note the two peerings at A
I
10.1.3.0/24
10.1.4.0/24
H
B
RD: 192.30.200.3:1
import: 65100:200
export: 65100:100
AS 65100
RD: 192.30.200.4:2
import: 65100:200
export: 65100:100
C
RD: 192.30.200.2:2
export: 65100:200
F
A
RD: 192.30.200.1:1
import: 65100:200
export: 65100:100
import: 65100:100
Filtering
10.1.1.0/24
iBGP
J
41
42
MPLS backbone
Backbone
RTC1
RTB3
RTB4
RTC2
RTB1
RTB2
RTC3
RTC4
43
L2VPN setup
10.1.3.0/30
VLANID: 514
10.1.2.0/30
10.1.1.0/30
VLANID: 512 VLANID: 513
.1 .2
.1 .1
.2
.2
Customer Edge (CE)
RTD2
RTA2
RTE2
44
45
193.10.255.5:10:1:1/96
*[L2VPN/170/101]02:45:38,metric21
Indirect
193.10.255.6:10:2:1/96
*[BGP/170]01:36:41,localpref100,from193.10.255.6
ASpath:I
>viaso0/1/0.0,labelswitchedpathbtoc
193.10.255.13:10:3:1/96
*[BGP/170]01:38:11,localpref100,from193.10.255.13
ASpath:I
>viaso0/1/0.0,labelswitchedpathbtod
46
Configuring L2VPN
Setup the backbone: ISIS, MPLS, RSVP, IBGP
Enable 'l2vpn signaling' as bgp protocol family
Setup encapsulation
'ethernet-vlan'
L2VPN routes:
<RD>:<site>:1/96
Example: 193.10.255.5:10:3:1/96
47
48
L3VPN setup
Provider Edge (PE)
.1
10.1.2.0/30
.1
10.1.1.0/30
.2
.2
.1
10.1.3.0/30
.2
Customer Edge (CE)
RTD3
RTA3
RTE3
49
LAB overview
Backbone
RTB3
RTB4
RTC1
RTC2
RTC2
RTC2
RTE4
L3VPN #4
L1VPN #1
RTE2 RTE3
L3VPN #3
RTE1
L2VPN #2
RTA4
L3VPN #4
RTA2 RTA3
L3VPN #3
RTA1
RTB2
L2VPN #2
L3VPN #3
L2VPN #2
L2VPN #1
RTD4
L2VPN #1
RTD2 RTD3
L3VPN #4
RTD1
RTB1
51