Mpls LDP and Basic Configuration
Mpls LDP and Basic Configuration
MPLS Configuration
APNIC Technical Workshop
2
MPLS Builders
Which protocols can set up
Label Switched Path?
Pure Signaling Routing Protocols
MPLS Protocols with Extensions
Most classic
and
widespread
LDP BGP
RSVP-TE IGP
3
Advantages of LDP
• Reliability
– LDP uses reliable TCP as the transport protocol for all but the
discovery messages.
• Auto provision
– Abilities to set up LSPs dynamically based on routing information
• Plug-and-play
– Simple deployment and configuration
• Support for a large number of LSPs
4
LDP Identifier
• An LDP Identifier is a six octet quantity used to identify an
LSR label space.
4 byte 2 byte
5
Label Space – Per Platform
• In per-platform label space, one single label is assigned to a
destination network and announced to all neighbors. The label
must be locally unique and valid on all incoming interfaces.
Prefix Out Label
100.1.1.0/24 100
200.1.1.0/24 200
R1
E1/1 100.1.1.0/24
E1/2 200.1.1.0/24
R3
R2
In Label Prefix
Prefix Out Label 100 100.1.1.0/24
100.1.1.0/24 100 200 200.1.1.0/24
200.1.1.0/24 200
6
Label Space – Per Interface
• In per-interface label space, local labels are assigned to IP
destination prefixes on a per-interface basis. These labels must
be unique on a per-interface basis.
Prefix Out Label
100.1.1.0/24 1/300
200.1.1.0/24 1/200
R1
ATM4/1 100.1.1.0/24
ATM4/2 200.1.1.0/24
R3
R2
In Label In Interface Prefix
Prefix Out Label 1/300 ATM 4/1 100.1.1.0/24
100.1.1.0/24 1/400 1/200 ATM 4/1 200.1.1.0/24
200.1.1.0/24 1/500 1/400 ATM 4/2 100.1.1.0/24
1/500 ATM 4/2 200.1.1.0/24
7
LDP Operations
Step 1
Neighbor Discovery
Step 2
Session Establishment
Step 3
Label Distribution
8
LDP Messages
Category Function Message Name
Discovery Announce and maintain the Hello
presence of an LSR in a network
Session Establish, maintain, and Initialization
terminate sessions between LDP
peers Keepalive
Label Create, change, and delete label Label Release
Distribution mappings for FECs
Label Request
Label Abort Request
Label Mapping
Label Withdrawal
Notification Provide advisory information and Notification
to signal error information
(Not list all the messages)
9
LDP Neighbor Discovery (1)
• Basic Discovery – Directly connected peer
– LDP Hello messages are UDP messages that are sent on the links to
the “all routers on this subnet” multicast IP address - 224.0.0.2. The
UDP port used for LDP is 646.
UDP: Hello
(2.2.2.2:1064 → 224.0.0.2:646)
LDP
R2: 2.2.2.2
UDP: Hello
(1.1.1.1:1050 → 224.0.0.2:646)
NO_MPLS
LDP
R1: 1.1.1.1 R3: 3.3.3.3
UDP: Hello
(4.4.4.4:1027 → 224.0.0.2:646)
LDP
R4: 4.4.4.4
10
LDP Neighbor Discovery (2)
• Extended Discovery – Non-directly connected peer
– LDP sessions between non-directly connected LSRs are supported by LDP Extended
Discovery.
11
LDP Session Establishment and Maintenance
Initialization Message
Initialization Message
Keepalive Message
Keepalive Message
Session UP Session UP
12
Label Distribution and Management
• After LDP sessions are established, labels will be distributed
between LDP peers. The label distribution mode used depends
on the interface and the implementation.
DoD
Label Advertisement (Downstream on Demand)
Mode DU
(Downstream Unsolicited)
Liberal
Label Retention Mode
Conservative
13
Label Distribution Control Mode
- Ordered
• In Ordered control mode, an LSR would only assign a local label
for the IGP prefixes that are marked as directly connected in its
routing table or also for the IGP prefixes for which it has already
received a label from the nexthop router.
Upstream Downstream
R1 R2 2
R3 1
R4
3
Label Mapping Label Mapping Label Mapping
To 100.1.1.1/32 To 100.1.1.1/32 To 100.1.1.1/32
Label=100 Label=200 Label=300
14
Label Distribution Control Mode - Independent
• In the independent mode, each LSR creates a local binding for a
particular FEC as soon as it recognizes the FEC. Usually, this
means that the prefix for the FEC is in its routing table.
Upstream Downstream
R1 R2 R3 2
R4
1
Label Mapping Label Mapping
To 100.1.1.1/32 To 100.1.1.1/32
Label=100 Label=300
15
Label Advertisement Mode - Downstream on Demand
Upstream Downstream
Label Request Label Request Label Request
for 100.1.1.1/32 for 100.1.1.1/32 for 100.1.1.1/32
R1 R2 R3 R4
Label Mapping Label Mapping Label Mapping
To 100.1.1.1/32 To 100.1.1.1/32 To 100.1.1.1/32
Label=100 Label=200 Label=300
16
Label Advertisement Mode - Downstream Unsolicited
Upstream Downstream
R1 R2 R3 R4
Label Mapping Label Mapping Label Mapping
To 100.1.1.1/32 To 100.1.1.1/32 To 100.1.1.1/32
Label=100 Label=200 Label=300
17
Label Retention Mode - Liberal
• In the liberal mode, an LSR keeps all received remote
labels in the LIB, but not all are used to forward packets.
Upstream Downstream
100.1.1.1/32 500(Liberal)
Label Mapping
To 100.1.1.1/32
Label=200
R1 R2 R3 R4
LDP
FE
R5 R6
18
Label Retention Mode - Conservative
• An LSR that is running this mode does not store all remote
labels in the LIB, but it stores only the remote label that is
associated with the next-hop LSR for a particular FEC.
Upstream To 100.1.1.1/32,
Downstream
NH= R3
Prefix Out Label
100.1.1.1/32 200
Label Mapping
To 100.1.1.1/32
Label=200
R1 R2 R3 R4
LDP
ATM
R5 R6
19
Label Distribution Scheme Summary
• Cisco IOS can support:
Control Distribution Retention Label Space
Ordered DU Liberal
DoD
20
LDP Session Protection (1)
• Without LDP session protection, if the link between R1 and R2 fails, the LDP
direct link adjacency fails.
LDP Session
R1 R2
R3
21
LDP Session Protection (2)
• MPLS LDP Session Protection uses LDP Targeted Hellos to
protect LDP sessions.
Targeted LDP Session
LDP Session
R1 R2
On R1 and R2:
1. Establish 2 • The LDP link adjacency is
LDP sessions
2. Enable LDP removed when the link goes
session down, but the targeted
protection
R3 adjacency keeps the LDP
session up.
22
Questions?
Basic MPLS
Configuration
24
Configuration Example
• Task: Configure MPLS LDP on Cisco IOS (Version 15.2) to
set up MPLS LSP only for loopback addresses.
• Prerequisite configuration:
– 1. IP address configuration on all the routers
– 2. IGP configuration on all the routers
R1 R2 R3 R4
MPLS Network
25
Step 1: Enable MPLS & LDP
• Configuration steps:
– 1. Configure basic MPLS and LDP on all the routers.
R1 configuration:
R1(config)# ip cef
To make MPLS work, CEF switching is mandatory.
R1(config)# mpls label range 100 199
Specifying the label range for this router start from
100 to 199.
R1(config)# mpls ldp router-id loopback 0 force
Forcing LDP router ID to be loopback 0 address.
R1(config)# interface ethernet 1/0
R1(config-if)# mpls ip
IP MPLS is enabled on the interface.
R1(config-if)# mpls label protocol ldp
Label distribution protocol is LDP.
26
Check MPLS Interface
• Using show mpls interfaces command verifies that interfaces have been
configured to use LDP:
27
Check LDP Discovery
• Check LDP discovery
28
Check LDP Neighbors
• Check LDP neighbors on R1
Operational is the
stable state of LDP
session.
29
Check LDP Neighbors
• Check LDP neighbors on R2
R2#show mpls ldp neighbor
Peer LDP Ident: 10.0.0.3:0; Local LDP Ident 10.0.0.2:0
TCP connection: 10.0.0.3.28664 - 10.0.0.2.646
State: Oper; Msgs sent/rcvd: 36/36; Downstream
Up time: 00:12:12
LDP discovery sources: Multiple links
FastEthernet0/0, Src IP addr: 10.23.1.2 between two routers
FastEthernet0/1, Src IP addr: 10.23.2.2 still mean single
Addresses bound to peer LDP Ident:
10.23.1.2 10.23.2.2 10.34.0.1 10.0.0.3
LDP session.
Peer LDP Ident: 10.0.0.1:0; Local LDP Ident 10.0.0.2:0
TCP connection: 10.0.0.1.646 - 10.0.0.2.48548
State: Oper; Msgs sent/rcvd: 36/36; Downstream
Up time: 00:11:40
LDP discovery sources:
Ethernet1/0, Src IP addr: 10.12.0.1
Addresses bound to peer LDP Ident:
10.12.0.1 10.0.0.1
Fa0/0 Fa0/0
E1/0 E1/0 10.23.1.0/30 E1/0 E1/0
.1 .2
.1 10.12.0.0/30 .2 10.23.2.0/30 .1 10.34.0.0/30 .2
Fa0/1 Fa0/1
R1 R2 R3 R4
30
Check LDP Label Information Base
• Check LDP LIB
R2#show mpls ldp bindings
lib entry: 10.0.0.1/32, rev 24
local binding: label: 206
remote binding: lsr: 10.0.0.3:0, label: 302
remote binding: lsr: 10.0.0.1:0, label: imp-null
lib entry: 10.0.0.2/32, rev 18
local binding: label: imp-null
remote binding: lsr: 10.0.0.3:0, label: 301
remote binding: lsr: 10.0.0.1:0, label: 101
lib entry: 10.0.0.3/32, rev 22
local binding: label: 205
remote binding: lsr: 10.0.0.3:0, label: imp-null
remote binding: lsr: 10.0.0.1:0, label: 100
...........(omitted)
31
Check Label Forwarding Table
• Check label forwarding table
32
Step 2: Configure Conditional Label Distribution
• Only set up LSP for loopback addresses.
– 2.1 Create prefix-list on each router, all the loopback addresses are
in 10.0.0.0/24 block.
R1(config)#ip prefix-list ALL-LOOPBACK seq 5 permit
10.0.0.0/24 le 32
33
Verify the Results of Conditional Label Distribution
• Before the configuration.
R1#show mpls ldp bindings
lib entry: 10.0.0.1/32, rev 51
local binding: label: imp-null
remote binding: lsr: 10.0.0.2:0, label: 206
lib entry: 10.0.0.2/32, rev 52
local binding: label: 101
remote binding: lsr: 10.0.0.2:0, label: imp-null
lib entry: 10.0.0.3/32, rev 53 Entries for all the
local binding: label: 100 prefixes in IP routing
remote binding: lsr: 10.0.0.2:0, label: 205 table.
lib entry: 10.0.0.4/32, rev 54
local binding: label: 107
remote binding: lsr: 10.0.0.2:0, label: 204
lib entry: 10.12.0.0/30, rev 71
local binding: label: imp-null
remote binding: lsr: 10.0.0.2:0, label: imp-null
lib entry: 10.23.1.0/30, rev 72
local binding: label: 102
remote binding: lsr: 10.0.0.2:0, label: imp-null
lib entry: 10.23.2.0/30, rev 73
local binding: label: 103
remote binding: lsr: 10.0.0.2:0, label: imp-null
lib entry: 10.34.0.0/30, rev 75
local binding: label: 104
remote binding: lsr: 10.0.0.2:0, label: 200
34
Verify the Results of Conditional Label Distribution
• After configure on all the routers.
35
Check the LSP
• Check the LSP for 10.0.0.4 from R1 to R3
R1#show mpls forwarding-table 10.0.0.4 32
Local Outgoing Prefix Bytes Label Outgoing Next Hop
Label Label or Tunnel Id Switched interface
107 204 10.0.0.4/32 0 Et1/0 10.12.0.2
36
Explicit-null Label
• Explicit Null label can be used to keep the QoS information.
Local Label Null Local Label 204 Local Label 300 Local Label Explicit-n
Out Interface E1/0 Out Interface Fa0/0 Fa0/1 Out Interface E1/0 Out Interface --
Out Label 204 Out Label 300 Out Label Explicit-n Out Label --
Fa0/1 Fa0/1
R1 R2 R3 R4
37
Additional Task: Using Explicit-null Label
• Explicit-null configuration on R4:
Out label is
explicit-null
38
Questions?