MPLS Label Assignment and Distribution Link to heading

1. Discovering LDP Neighbors Link to heading

Session Establishment

Step 1: LDP Discovery Link to heading

  • 2 methods of neighbor discovery:
    • Basic: discover directly connected LSR neighbors. An LSR sends out periodic Hellos as UDP (port 646) to multicast address 224.0.0.2.
    • Extended: discover non-directly connected neighbors. An LSR sends out unicast Targeted Hellos as UDP to the IP address of the targeted LSR. # mpls ldp neighbor 192.168.1.1 targeted ldp

Step 2: LDP Session Establishment Link to heading

  • After the exchange of Hellos, LDP session is established:
    • 2 LSRs elect ative and passive roles by comparing the source IP address.
    • TCP (port 646) is used to establish the session.
    • Negotiate parameters by using Initialization messages.

2. Frame-mode MPLS Link to heading

MPLS Label Space: Link to heading

  • Per-Interface: Labels are assigned per FEC per interface => Packets are forwarded based on both the incoming label and interface.
  • Per-platform: Labels assigned per FEC are the same on any interface => Packets are forwarded based on incoming label only.

MPLS Label distribution modes: Link to heading

  • Downstream on-demand: each LSR sends a label binding request to its downstream router only (ex: RSVP for TE).
  • Unsolicited Downstream: each LSR automatically distributes its label bindings to all peers without a request message.

MPLS Label retention modes: Link to heading

  • Liberal: every label received from a neighbor is retained in LIB => Advantage: quick reaction to topology changes.
  • Conservative: label will only be retained if the sending LSR is the next hop downstream router for the specific FEC => Advantage: more secure than liberal mode.

MPLS Label Control modes: Link to heading

  • Independent label distribution: An LSR assigns a local binding to a FEC as soon as it realizes its existence in the routing table, does not wait to receive any labels from other LSR.
  • Ordered label distribution: An LSR assigns a local binding to a FEC only if it recognizes it is the egress LSR for that FEC or if it receives a label binding from the next hop LSR.

Frame-mode MPLS parameters include: Link to heading

  • Per-platform label address space
  • Unsolicited downstream label distribution
  • Independent control for label allocation
  • Liberal label retention

MPLS L3 VPN Link to heading

Topology

Task 1 Link to heading

Configure in ISP:

  • OSPF 1 Area 0 on all routers.
  • BGP on R1 and R3, using Lo0 to form peering.
  • MPLS on all routers.

Configuration Link to heading

hostname R1
int l0
    ip add 1.1.1.1 255.255.255.255
int f0/0
    no shut
    ip add 192.168.12.1 255.255.255.0
int f0/1
    no shut
    ip add 192.168.14.1 255.255.255.0

int f1/0
    no shut
    ip add 192.168.16.1 255.255.255.0

int f1/1
    no shut
    ip add 192.168.18.1 255.255.255.0

router ospf 1
    net 1.1.1.1 0.0.0.0 area 0
    net 192.168.12.0 0.0.0.255 area 0

router bgp 123
    neighbor 3.3.3.3 remote-as 123
    neighbor 3.3.3.3 update-source l0

int f0/0
    mpls ip
hostname R2

int f0/0
    no shut
    ip add 192.168.12.2 255.255.255.0

int f0/1
    no shut
    ip add 192.168.23.2 255.255.255.0

router ospf 1
    net 192.168.12.0 0.0.0.255 area 0
    net 192.168.23.0 0.0.0.255 area 0

int range f0/0-1
    mpls ip
hostname R3

int l0
    ip add 3.3.3.3 255.255.255.255

int f0/0
    no shut
    ip add 192.168.23.3 255.255.255.0

int f0/1
    no shut
    ip add 192.168.35.3 255.255.255.0

int f1/0
    no shut
    ip add 192.168.37.3 255.255.255.0

int f1/1
    no shut
    ip add 192.168.39.3 255.255.255.0

router ospf 1
    net 3.3.3.3 0.0.0.0 area 0
    net 192.168.23.0 0.0.0.255 area 0

router bgp 123
    neighbor 1.1.1.1 remote-as 123
    neighbor 1.1.1.1 update-source l0

int f0/0
    mpls ip

Verification Link to heading

R1#show ip bgp
BGP router identifier 1.1.1.1, local AS number 123
BGP table version is 1, main routing table version 1

Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
3.3.3.3         4          123       2       2        1    0    0 00:00:18        0

R1#show mpls int
Interface              IP            Tunnel   BGP Static Operational
FastEthernet0/0        Yes (ldp)     No       No  No     Yes

Task 2 Link to heading

Configure in Customer A:

  • Create VRF A on router R1 and R3 (RD = 1:1, RT = 10:10).
  • Configure Static route on all routers.
  • Redistribute Static to MP-BGP

Configuration Link to heading

The exchange of IPv4 routes between BGP neighbors is enabled by default.

=> no bgp default ipv4-unicast disables the default exchange.

=> Neighbors that need to receive IPv4 routes have to be activated for route exchange.

R1(config)#

ip vrf A
    rd 1:1
    route-target 10:10

int f0/1
    ip vrf forward A
    ip add 192.168.14.1 255.255.255.0

ip route vrf A 4.4.4.4 255.255.255.255 192.168.14.4

router bgp 123
    no bgp default ipv4-unicast
    address-family vpnv4
        neighbor 3.3.3.3 activate
        neighbor 3.3.3.3 send-community extended

    address-family ipv4 vrf A
        redistribute static
R3(config)#

ip vrf A
    rd 1:1
    route-target 10:10

int f0/1
    ip vrf forward A
    ip add 192.168.35.3 255.255.255.0

ip route vrf A 5.5.5.5 255.255.255.255 192.168.35.5

router bgp 123
    no bgp default ipv4-unicast
    address-family vpnv4
        neighbor 1.1.1.1 activate
        neighbor 1.1.1.1 send-community extended

    address-family ipv4 vrf A
        redistribute static
hostname R4

int l0
    ip add 4.4.4.4 255.255.255.255

int f0/0
    no shut
    ip add 192.168.14.4 255.255.255.0

ip route 5.5.5.5 255.255.255.255 192.168.14.1
hostname R5

int l0
    ip add 5.5.5.5 255.255.255.255

int f0/0
    no shut
    ip add 192.168.35.5 255.255.255.0

ip route 4.4.4.4 255.255.255.255 192.168.35.3

Verification Link to heading

R1#show ip bgp vpnv4 vrf A
BGP table version is 4, local router ID is 1.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
              x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found
     Network          Next Hop            Metric LocPrf Weight Path
Route Distinguisher: 1:1 (default for vrf A)
 *>  4.4.4.4/32       192.168.14.4             0         32768 ?
 *>i 5.5.5.5/32       3.3.3.3                  0    100      0 ?

R4#ping 5.5.5.5 source 4.4.4.4
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 5.5.5.5, timeout is 2 seconds:
Packet sent with a source address of 4.4.4.4
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 500/662/784 ms

Task 3 Link to heading

Configure in Customer B:

  • Create VRF B on router R1 and R3 (RD = 2:2, RT = 20:20).
  • Configure MPLS VPN to connect 2 sides R4 and R5.
  • Configure EIGRP 100 on all routers.
  • Redistribute EIGRP to MP-BGP.
  • Redistribute only 1 route Lo0 from MP-BGP to EIGRP (using route-map).

Configuration Link to heading

R1(config)#

ip vrf B
    rd 2:2
    route-target 20:20

int f1/0
    ip vrf forward B
    ip add 192.168.16.1 255.255.255.0

router eigrp 100
    address-family ipv4 vrf B autonomous-system 100
        no auto
        net 192.168.16.0 0.0.0.255

router bgp 123
    address-family ipv4 vrf B
        redistribute eigrp 100

ip access-list standard CUSTB
    permit host 7.7.7.7

route-map CUSTB_REDISTRIBUTE permit 10
    match ip add CUSTB

router eigrp 100
    address-family ipv4 vrf B autonomous-system 100
        default-metric 100000 10 255 1 1500
        redistribute bgp 123 route-map CUSTB_REDISTRIBUTE
R3(config)#

ip vrf B
    rd 2:2
    route-target 20:20

int f1/0
    ip vrf forward B
    ip add 192.168.37.3 255.255.255.0

router eigrp 100
    address-family ipv4 vrf B autonomous-system 100
        no auto
        net 192.168.37.0 0.0.0.255

router bgp 123
    address-family ipv4 vrf B
        redistribute eigrp 100

ip access-list standard CUSTB
    permit host 6.6.6.6

route-map CUSTB_REDISTRIBUTE permit 10
    match ip add CUSTB

router eigrp 100
    address-family ipv4 vrf B autonomous-system 100
        default-metric 100000 10 255 1 1500
        redistribute bgp 123 route-map CUSTB_REDISTRIBUTE
hostname R6

int l0
    ip add 6.6.6.6 255.255.255.255

int f0/0
    no shut
    ip add 192.168.16.6 255.255.255.0

router eigrp 100
    no auto
    net 6.6.6.6 0.0.0.0
    net 192.168.16.0 0.0.0.255
hostname R7

int l0
    ip add 7.7.7.7 255.255.255.255

int f0/0
    no shut
    ip add 192.168.37.7 255.255.255.0

router eigrp 100
    no auto
    net 7.7.7.7 0.0.0.0
    net 192.168.37.0 0.0.0.255

Verification Link to heading

R1#show ip bgp vpnv4 vrf B
     Network          Next Hop            Metric LocPrf Weight Path
Route Distinguisher: 2:2 (default for vrf B)
 *>  6.6.6.6/32       192.168.16.6        156160         32768 ?
 *>i 7.7.7.7/32       3.3.3.3             156160    100      0 ?
 *>  192.168.16.0     0.0.0.0                  0         32768 ?
 *>i 192.168.37.0     3.3.3.3                  0    100      0 ?

R6#show ip route eigrp
      7.0.0.0/32 is subnetted, 1 subnets
D        7.7.7.7 [90/158720] via 192.168.16.1, 00:00:31, FastEthernet0/0

R6#ping 7.7.7.7 source 6.6.6.6
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 7.7.7.7, timeout is 2 seconds:
Packet sent with a source address of 6.6.6.6
!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 520/599/700 ms

Task 4 Link to heading

Configure in Customer C:

  • Create VRF C on router R1 and R3 (RD = 3:3, RT = 30:30).
  • Configure MPLS VPN to connect 2 sides R8 and R9.
  • Configure OSPF 100 Area 0 on all routers.
  • Redistribute OSPF to MP-BGP.
  • Redistribute only 1 route Lo0 from MP-BGP to OSPF (using route-map).

Configuration Link to heading

R1(config)#

ip vrf C
    rd 3:3
    route-target 30:30

int f1/1
    ip vrf forward C
    ip add 192.168.18.1 255.255.255.0

router ospf 100 vrf C
    net 192.168.18.0 0.0.0.255 area 0

router bgp 123
    address-family ipv4 vrf C
        redistribute ospf 100

ip access-list standard CUSTC
    permit host 9.9.9.9

route-map CUSTC_REDISTRIBUTE permit 10
    match ip add CUSTC

router ospf 100 vrf C
    redistribute bgp 123 route-map CUSTC_REDISTRIBUTE subnets
R3(config)#

ip vrf C
    rd 3:3
    route-target 30:30

int f1/1
    ip vrf forward C
    ip add 192.168.39.3 255.255.255.0

router ospf 100 vrf C
    net 192.168.39.0 0.0.0.255 area 0

router bgp 123
    address-family ipv4 vrf C
        redistribute ospf 100

ip access-list standard CUSTC
    permit host 8.8.8.8

route-map CUSTC_REDISTRIBUTE permit 10
    match ip add CUSTC

router ospf 100 vrf C
    redistribute bgp 123 route-map CUSTC_REDISTRIBUTE subnets
hostname R8

int l0
    ip add 8.8.8.8 255.255.255.255

int f0/0
    no shut
    ip add 192.168.18.8 255.255.255.0

router ospf 100
    net 8.8.8.8 0.0.0.0 area 0
    net 192.168.18.0 0.0.0.255 area 0
hostname R9

int l0
    ip add 9.9.9.9 255.255.255.255

int f0/0
    no shut
    ip add 192.168.39.9 255.255.255.0

router ospf 100
    net 9.9.9.9 0.0.0.0 area 0
    net 192.168.39.0 0.0.0.255 area 0

Verification Link to heading

R1#show ip bgp vpnv4 all
     Network          Next Hop            Metric LocPrf Weight Path
Route Distinguisher: 1:1 (default for vrf A)
 *>  4.4.4.4/32       192.168.14.4             0         32768 ?
 *>i 5.5.5.5/32       3.3.3.3                  0    100      0 ?
Route Distinguisher: 2:2 (default for vrf B)
 *>  6.6.6.6/32       192.168.16.6        156160         32768 ?
 *>i 7.7.7.7/32       3.3.3.3             156160    100      0 ?
 *>  192.168.16.0     0.0.0.0                  0         32768 ?
 *>i 192.168.37.0     3.3.3.3                  0    100      0 ?
Route Distinguisher: 3:3 (default for vrf C)
 *>  8.8.8.8/32       192.168.18.8             2         32768 ?
 *>i 9.9.9.9/32       3.3.3.3                  2    100      0 ?
 *>  192.168.18.0     0.0.0.0                  0         32768 ?
 *>i 192.168.39.0     3.3.3.3                  0    100      0 ?

R8#show ip route ospf
      9.0.0.0/32 is subnetted, 1 subnets
O IA     9.9.9.9 [110/3] via 192.168.18.1, 00:00:21, FastEthernet0/0

R8#ping 9.9.9.9 source 8.8.8.8
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 9.9.9.9, timeout is 2 seconds:
Packet sent with a source address of 8.8.8.8
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 544/750/924 ms

MPLS Traffic Engineering Link to heading

Topology

hostname R1

int l0
    ip add 1.1.1.1 255.255.255.255
    ip ospf 1 area 0
    ip ospf net point-to-point

int f0/0
    ip add 192.168.16.1 255.255.255.0
    no shut
    ip ospf 1 area 6

int f0/1
    ip add 192.168.12.1 255.255.255.0
    no shut
    ip ospf 1 area 0

router ospf 1
    area 6 stub no-sum

mpls label range 100 199

int f0/1
    mpls ip
    exit

mpls traffic-eng tunnels

router ospf 1
    mpls traffic-eng router-id l0
    mpls traffic-eng area 0

int f0/1
    mpls traffic-eng tunnels
    ip rsvp bandwidth 100000 100000
hostname R2

int l0
    ip add 2.2.2.2 255.255.255.255
    ip ospf 1 area 0
    ip ospf net point-to-point

int f0/0
    ip add 192.168.12.2 255.255.255.0
    no shut
    ip ospf 1 area 0

int f0/1
    ip add 192.168.23.2 255.255.255.0
    no shut
    ip ospf 1 area 0

int f1/0
    ip add 192.168.24.2 255.255.255.0
    no shut
    ip ospf 1 area 0

router ospf 1

mpls label range 200 299

int range f0/0-1,f1/0
    mpls ip
    exit

mpls traffic-eng tunnels

router ospf 1
    mpls traffic-eng router-id l0
    mpls traffic-eng area 0

int range f0/0-1,f1/0
    mpls traffic-eng tunnels
    ip rsvp bandwidth 100000 100000
hostname R3

int l0
    ip add 3.3.3.3 255.255.255.255
    ip ospf 1 area 0
    ip ospf net point-to-point

int f0/0
    ip add 192.168.23.3 255.255.255.0
    no shut
    ip ospf 1 area 0

int f0/1
    ip add 192.168.34.3 255.255.255.0
    no shut
    ip ospf 1 area 0

router ospf 1

mpls label range 300 399

int range f0/0-1
    mpls ip
    exit

mpls traffic-eng tunnels

router ospf 1
    mpls traffic-eng router-id l0
    mpls traffic-eng area 0

int range f0/0-1
    mpls traffic-eng tunnels
    ip rsvp bandwidth 100000 100000
hostname R4

int l0
    ip add 4.4.4.4 255.255.255.255
    ip ospf 1 area 0
    ip ospf net point-to-point

int f0/0
    ip add 192.168.45.4 255.255.255.0
    no shut
    ip ospf 1 area 0

int f0/1
    ip add 192.168.34.4 255.255.255.0
    no shut
    ip ospf 1 area 0

int f1/0
    ip add 192.168.24.4 255.255.255.0
    no shut
    ip ospf 1 area 0

router ospf 1

mpls label range 400 499

int range f0/0-1,f1/0
    mpls ip
    exit

mpls traffic-eng tunnels

router ospf 1
    mpls traffic-eng router-id l0
    mpls traffic-eng area 0

int range f0/0-1,f1/0
    mpls traffic-eng tunnels
    ip rsvp bandwidth 100000 100000
hostname R5

int l0
    ip add 5.5.5.5 255.255.255.255
    ip ospf 1 area 0
    ip ospf net point-to-point

int f0/0
    ip add 192.168.57.5 255.255.255.0
    no shut
    ip ospf 1 area 7

int f0/1
    ip add 192.168.45.5 255.255.255.0
    no shut
    ip ospf 1 area 0

router ospf 1
    area 7 stub no-sum

mpls label range 500 599

int f0/1
    mpls ip
    exit

mpls traffic-eng tunnels

router ospf 1
    mpls traffic-eng router-id l0
    mpls traffic-eng area 0

int f0/1
    mpls traffic-eng tunnels
    ip rsvp bandwidth 100000 100000

Configure in R1 a tunnel R1 to R5 via R3

R1(config)#

ip explicit-path name VIA_P3 enable
    index 10 next 2.2.2.2
    index 20 next 3.3.3.3
    index 30 next 4.4.4.4
    index 40 next 5.5.5.5

int tunnel1
    ip unnumbered Loopback0
    tunnel mode mpls traffic-eng
    tunnel destination 5.5.5.5
    tunnel mpls traffic-eng autoroute announce
    tunnel mpls traffic-eng priority 3 3
    tunnel mpls traffic-eng bandwidth 10000
    tunnel mpls traffic-eng path-option 1 explicit name VIA_P3

Configure R6 and R7 in stub networks

hostname R6

int l0
    ip add 6.6.6.6 255.255.255.255
    ip ospf 1 area 6
    ip ospf net point-to-point

int f0/0
    ip add 192.168.16.6 255.255.255.0
    ip ospf 1 area 6
    no shut

router ospf 1
    area 6 stub
hostname R7

int l0
    ip add 7.7.7.7 255.255.255.255
    ip ospf 1 area 7
    ip ospf net point-to-point

int f0/0
    ip add 192.168.57.7 255.255.255.0
    ip ospf 1 area 7
    no shut

router ospf 1
    area 7 stub