Label Distribution Protocol
Label Distribution Protocol
© 2012 Cisco and/or its affiliates. All rights reserved. SPCORE v1.01—1-1
Objectives
• Describe LDP is the protocol used to exchange the MPLS labels
• Describe how LDP neighbor adjacency is established
• Describe the LDP Link Hello Message
• Describe the LDP Session Negotiation
• Describe the use of the LDP Targeted Hello Message to form LDP
neighbor adjaceny between non directly connected LSRs
• Describe LDP Session Protection using a backup targeted hello
• Describe LDP Graceful Restart and NonStop Routing (NSR)
• Describe how the forwarding structures used by MPLS are
populated
• Explain the LSP
• Explain the MPLS Label Allocation and Distribution process
• Show how IP packets are propagated across an MPLS domain
• Define the steady state condition when all the labels are exchanged
by LDP and the LIBs, LFIBs and FIBs are completely populated
© 2012 Cisco and/or its affiliates. All rights reserved. SPCORE v1.01—1-2
Objectives (Cont.)
• Explain Label Advertisement Control and Label Acceptance Control
• Explain the how IP Aggregation in the core can break an LSP into two
segments
• Describe loop detection using the MPLS TTL field
• Describe the disabling of TTL propagation to hide the core routers in the
MPLS domain
• Show a steady state condition in the MPLS domain
• Show how a link failure is managed in an MPLS domain
• Show how a link recovery is managed in an MPLS domain
• Describe the three IP switching mechanisms (Process Switching, Fast
Switching and Cisco Express Forwarding)
• Explain the sequence of events that occurs when process switching and
fast switching are used for destinations that are learned through BGP
• Explain the sequence of events that occurs when CEF switching is used
for destinations that are learned through BGP
• Describe CEF on Cisco IOS XE and Cisco IOS XR platforms
• Describe the show commands used to monitor CEF operations
© 2012 Cisco and/or its affiliates. All rights reserved. SPCORE v1.01—1-3
Label Distribution Protocol
• MPLS introduces a label field that is used for forwarding decisions.
• Although labels are locally significant, they must be advertised to
directly reachable peers.
- Option 1 is to include this parameter in existing IP routing protocols.
- Option 2 is to create a new protocol to exchange labels.
• The second option has been used, because there are too many existing
IP routing protocols that would have to be modified to carry labels.
• The new protocol is called Label Distribution Protocol (LDP).
© 2012 Cisco and/or its affiliates. All rights reserved. SPCORE v1.01—1-4
LDP Neighbor Session Establishment
MPLS/IP
UDP: Hello
TCP: Labels
Well-Known Multicast IP Well-Known Port Optional TLV Used to 6-Byte TLV Identifying
Address Identifying All Number Identify Source IP Router and Label
Routers on Subnet Used for LDP Address for LDP Session Space
• Hello messages are sent to all routers that are reachable through an
interface.
• LDP uses well-known port number 646 with UDP for hello messages.
• A 6-byte LDP identifier (TLV) identifies the router
(first 4 bytes) and label space (last 2 bytes).
• The source address that is used for an LDP session can be set by
adding the transport address TLV to the hello message.
© 2012 Cisco and/or its affiliates. All rights reserved. SPCORE v1.01—1-6
LDP Neighbor Discovery
© 2012 Cisco and/or its affiliates. All rights reserved. SPCORE v1.01—1-7
LDP Session Negotiation
© 2012 Cisco and/or its affiliates. All rights reserved. SPCORE v1.01—1-8
LDP Discovery of Nonadjacent Neighbors
• LDP neighbor discovery of nonadjacent neighbors differs from normal
discovery only in the addressing of hello packets:
- Hello packets use unicast IP addresses instead of multicast addresses.
• When a neighbor is discovered, the mechanism to establish a session
is the same
Targeted
Hello
Primary Link
Link Hello
© 2012 Cisco and/or its affiliates. All rights reserved. SPCORE v1.01—1-9
LDP Session Protection
R2
Targeted
R1 R3
Traffic Hello
Primary Link
X
Link Hello
Session
• When a link comes up, IP converges earlier and much faster than MPLS LDP:
- This may result in MPLS traffic loss until MPLS convergence.
• The LDP session protection minimizes traffic loss, provides faster
convergence, and protects existing LDP (link) sessions.
• Backup targeted hellos maintain LDP sessions when primary link adjacencies
go down.
© 2012 Cisco and/or its affiliates. All rights reserved. SPCORE v1.01—1-10
LDP Graceful Restart and Nonstop Routing
• LDP graceful restart provides a control plane mechanism to ensure high
availability and allows detection and recovery from failure conditions
while preserving NSF services.
• Graceful restart recovers from control plane failures without impacting
forwarding.
• Without LDP graceful restart, when an established session fails, the
corresponding forwarding states are cleaned immediately from the
restarting and peer nodes:
- In this example, LDP forwarding restarts from the beginning, causing a
potential loss of data and connectivity.
• LDP NSR functionality makes failures, such as RP failover, invisible to
routing peers with minimal to no disruption of convergence performance.
• LDP NSR does not require protocol extensions and does not force
software upgrades on other routers in the network.
© 2012 Cisco and/or its affiliates. All rights reserved. SPCORE v1.01—1-11
Forwarding Structures
• Forwarding structures that are used by MPLS need to be populated.
• The FIB is populated two ways:
- A routing table, which is populated by a routing protocol
- An MPLS label that is added to the FIB by LDP
• The LFIB is populated by LDP.
• LDP is responsible for the advertisement and redistribution of MPLS
labels between MPLS routers.
© 2012 Cisco and/or its affiliates. All rights reserved. SPCORE v1.01—1-12
Label-Switched Path
• An LSP is a sequence of LSRs that forwards labeled packets of a
certain forwarding equivalence class.
- MPLS unicast IP forwarding builds LSPs based on the output of IP routing
protocols.
- LDP advertises labels only for individual segments in the LSP.
• LSPs are unidirectional.
- Return traffic uses a different LSP (usually the reverse path because most
routing protocols provide symmetrical routing).
• An LSP can take a different path from the one chosen by an IP routing
protocol (MPLS TE).
© 2012 Cisco and/or its affiliates. All rights reserved. SPCORE v1.01—1-13
LSP Building
© 2012 Cisco and/or its affiliates. All rights reserved. SPCORE v1.01—1-14
LSP Building (Cont.)
C F Network X
A
LIB (G)
D
Network LSR Label
X Local 34
77 16
p
po
34 I X I pop
LFIB (D)
In Out Next Hop
B
G 34 pop I
LIB (A)
E H
Network LSR Label
X Local 33 LIB (B) LIB (D)
X B 77 Network LSR Label Network LSR Label
X Local 77 X Local 16
X D 16 X G 34
LFIB (A)
In Out Next Hop LFIB (B) LFIB (D)
33 77 B In Out Next Hop In Out Next Hop
77 16 D 16 34 G
© 2012 Cisco and/or its affiliates. All rights reserved. SPCORE v1.01—1-15
Label Allocation and Distribution
Label allocation and distribution in a MPLS network follows
these steps:
1. IP routing protocols build the IP routing table.
2. Each LSR assigns a label to every destination in the IP routing table
independently.
3. LSRs announce their assigned labels to all other LSRs.
4. Every LSR builds its LIB, LFIB, and FIB data structures based on
received labels.
© 2012 Cisco and/or its affiliates. All rights reserved. SPCORE v1.01—1-16
Label Allocation
Label for X is 21 Label for X is 25 Label for X is 34 Label for X is POP
IP
MPLS/IP
A B C D
Network X
• A router that receives a label from a next hop also stores the label
in the FIB.
© 2012 Cisco and/or its affiliates. All rights reserved. SPCORE v1.01—1-18
Label Advertisement (Cont.)
4. Router B receives a label
from C and stores it.
• A router stores a label from a neighbor, even if the neighbor is not a next
hop for a destination.
© 2012 Cisco and/or its affiliates. All rights reserved. SPCORE v1.01—1-19
Label Advertisement (Cont.)
5. Router D advertises
POP for network X.
IP X Local POP
MPLS/IP
A B C D
X = POP
Network X
© 2012 Cisco and/or its affiliates. All rights reserved. SPCORE v1.01—1-23
Label Control
Label Advertisement Control:
• For scalability and security reasons
• LDP configured to perform outbound filtering for local label
advertisement, for one or more prefixes to one more peers
• Also referred to as LDP outbound
© 2012 Cisco and/or its affiliates. All rights reserved. SPCORE v1.01—1-24
Impact of IP Aggregation on LSPs
Aggregation
Point
10.1.0.0/16 10.1.0.0/16 10.1.1.0/24 10.1.1.0/24 IGP
10.1.0.0/16 10.1.0.0/16
L = 23 L= pop
IP
MPLS/IP
A B C D E
10.1.1.0/24
© 2012 Cisco and/or its affiliates. All rights reserved. SPCORE v1.01—1-26
Loop Detection
• LDP relies on loop detection mechanisms that are built into the IGPs
that are used to determine the path.
• If, however, a loop is generated (that is, misconfiguration with static
routes), the TTL field in the label header is used to prevent the
indefinite looping of packets.
• TTL functionality in the label header is equivalent to TTL in the IP
headers.
• TTL is usually copied from the IP headers to the label headers
(TTL propagation).
© 2012 Cisco and/or its affiliates. All rights reserved. SPCORE v1.01—1-27
Normal TTL Operation
The TTL is decreased IP The TTL is decreased
and copied into the
Label and copied back into The
label header. TTL TTL TTL field of the IP header.
IP
A B C D
5 4 4 3 4 2
© 2012 Cisco and/or its affiliates. All rights reserved. SPCORE v1.01—1-28
Disabling TTL Propagation
• TTL propagation can be disabled.
• The IP TTL value is not copied into the TTL field of the label, and the
label TTL is not copied back into the IP TTL.
• Instead, the value 255 is assigned to the label header TTL field on the
ingress LSR.
• Disabling TTL propagation hides core routers in the MPLS domain.
• Traceroute across an MPLS domain does not show any core routers.
© 2012 Cisco and/or its affiliates. All rights reserved. SPCORE v1.01—1-29
Impact of Disabling TTL Propagation
• Traceroute across an MPLS domain does not show core routers.
• TTL propagation must be disabled on all label switch routers.
• Mixed configurations (some LSRs with TTL propagation enabled and
some LSRs with TTL propagation disabled) could result in faulty
traceroute output.
• TTL propagation can be enabled for forwarded traffic only.
© 2012 Cisco and/or its affiliates. All rights reserved. SPCORE v1.01—1-30
Steady State Operation
Routing Table (B) FIB (B)
Network Next Hop Network LSR Label
X C X C 47
IP
MPLS/IP
A B C D
Network X
LIB (B)
Network LSR Label
E
X Local 25 LFIB (B)
X C 47 In Out Next Hop
X E 75 25 47 C
• Steady state occurs after the LSRs have exchanged the labels and the
LIB, LFIB, and FIB data structures are completely populated.
© 2012 Cisco and/or its affiliates. All rights reserved. SPCORE v1.01—1-31
Link Failure Actions
Routing Table (B) FIB (B)
Network Next Hop Network LSR Label
X C X C 47
IP
MPLS/IP
A B C D
X Network X
LIB (B)
Network LSR Label
E
X Local 25 LFIB (B)
X C 47 In Out Next Hop
X E 75 25 47 C
• Routing protocol neighbors and LDP neighbors are lost after a link
failure.
• Entries are removed from various data structures.
© 2012 Cisco and/or its affiliates. All rights reserved. SPCORE v1.01—1-32
Routing Protocol Convergence
Routing Table (B) FIB (B)
Network Next Hop Network LSR Label
X E X E --
IP
MPLS/IP
A B C D
X Network X
LIB (B)
Network LSR Label E
X Local 25 LFIB (B)
X C 47 In Out Next Hop
X E 75 25 47 C
X Network X
LIB (B)
Network LSR Label
E
X Local 25 LFIB (B)
X C 47 In Out Next Hop
X E 75 25 75 E
• The LFIB and labeling information in the FIB are rebuilt immediately
after the routing protocol convergence, based on labels stored in the
LIB.
© 2012 Cisco and/or its affiliates. All rights reserved. SPCORE v1.01—1-34
MPLS Convergence After a Link Failure
• MPLS convergence in frame-mode MPLS does not affect the overall
convergence time.
• MPLS convergence occurs immediately after the routing protocol
convergence, based on the labels that are already stored in the LIB.
© 2012 Cisco and/or its affiliates. All rights reserved. SPCORE v1.01—1-35
Link Recovery
Routing Table (B) FIB (B)
Network Next Hop Network LSR Label
X E X E 75
IP
MPLS/IP
A B C D
Network X
LIB (B)
Network LSR Label
E
X Local 25 LFIB (B)
X C 47 In Out Next Hop
X E 75 25 75 E
© 2012 Cisco and/or its affiliates. All rights reserved. SPCORE v1.01—1-36
Link Recovery (Cont.)
Routing Table (B) FIB (B)
Network Next Hop Network LSR Label
X C X C 47
IP
MPLS/IP
A B C D
Network X
LIB (B)
Network LSR Label
E
X Local 25 LFIB (B)
X C 47 In Out Next Hop
X E 75 25 47 C
© 2012 Cisco and/or its affiliates. All rights reserved. SPCORE v1.01—1-38
Evolution of Switching Mechanisms
The Cisco IOS platform supports three IP switching mechanisms:
• Routing table-driven switching—process switching
- Full lookup for every packet
• Cache-driven switching—fast switching
- Most recent destinations entered in the cache
- First packet always process-switched
• Topology-driven switching
- Cisco Express Forwarding (prebuilt FIB table)
© 2012 Cisco and/or its affiliates. All rights reserved. SPCORE v1.01—1-39
Cisco Express Forwarding
Cisco IOS XE Software:
• Label switching requires that Cisco Express Forwarding be enabled on
the router.
• Cisco Express Forwarding requires a software image that includes
Cisco Express Forwarding and IP routing enabled on the device.
• Cisco Express Forwarding is enabled by default on the Cisco ASR 1000
Series Aggregation Services Routers.
Router# show ip cef
Prefix Next Hop Interface
[...]
10.2.61.8/24 192.168.100.1 FastEthernet1/0/0
192.168.101.1 FastEthernet2/1/0
© 2012 Cisco and/or its affiliates. All rights reserved. SPCORE v1.01—1-40
Cisco Express Forwarding
Cisco IOS XR Software:
• Label switching on a Cisco router requires that Cisco Express
Forwarding be enabled.
• Cisco Express Forwarding is mandatory for Cisco IOS XR
software, and it does not need to be enabled explicitly.
• Cisco Express Forwarding offers these benefits:
- Improved performance
- Scalability
- Resilience
© 2012 Cisco and/or its affiliates. All rights reserved. SPCORE v1.01—1-41
Standard IP Switching
© 2012 Cisco and/or its affiliates. All rights reserved. SPCORE v1.01—1-42
Cisco Express Forwarding Switching
© 2012 Cisco and/or its affiliates. All rights reserved. SPCORE v1.01—1-43
Monitoring IPv4 Cisco Express Forwarding
© 2012 Cisco and/or its affiliates. All rights reserved. SPCORE v1.01—1-44
Summary
• MPLS uses LDP to exchange labels.
• UDP multicast is used to discover adjacent LDP neighbors, while TCP
is used to establish a session.
• LDP link hello message contains destination IP address, destination
port and the actual hello message.
• LDP session negotiation is a three-step process.
• An MPLS-enabled router can be configured to send a directed LDP
hello message as a unicast UDP packet that is specifically addressed
to the nonadjacent router.
• LDP session protection lets you configure LDP to automatically protect
sessions with all or a given set of peers.
• LDP graceful restart provides a control plane mechanism to ensure
high availability and allows detection and recovery from failure
condition.
• MPLS uses two forwarding structures which have to be populated
using routing protocol and LDP.
© 2012 Cisco and/or its affiliates. All rights reserved. SPCORE v1.01—1-45
Summary (Cont.)
• A label-switched path (LSP) is a sequence of LSRs that forwards
labeled packets for a particular Forwarding Equivalence Class (FEC).
• Labels are generated locally and then advertised to adjacent routers.
• PHP optimizes MPLS performance (one less LFIB lookup).
• MPLS is fully functional when the routing protocol and LDP have
populated all the tables. Such a state is called the steady state.
• You can configure LDP to perform outbound filtering for local label
advertisement for one or more prefixes to one or more LDP peers.
• Route summarization in an MPLS-enabled networks breaks LSP into
two paths.
• The TTL functionality in MPLS is equivalent to that of traditional IP
forwarding.
• TTL propagation can be disabled to hide the core routers from the end
users.
© 2012 Cisco and/or its affiliates. All rights reserved. SPCORE v1.01—1-46
Summary (Cont.)
• Although it takes longer for LDP to exchange labels (compared with an
IGP), a network can use the FIB table in the meantime.
• Link recovery requires that an LDP session be established (or
reestablished), which adds to the convergence time of LDP.
• The Cisco IOS platform supports three IP switching mechanisms:
process switching, fast switching, and CEF.
• In standard IP switching, the first packet that arrives is process
switched and all subsequent packets are fast switched.
• In CEF switching, the FIB table is built in advance before a packet for
a destination is received.
• On IOS and IOS XE, CEF is required for MPLS.
• CEF is enabled on Cisco IOS XR and cannot be disabled.
• To monitor CEF, you can use various show commands.
© 2012 Cisco and/or its affiliates. All rights reserved. SPCORE v1.01—1-47
© 2012 Cisco and/or its affiliates. All rights reserved. SPCORE v1.01—1-48