Example for Configuring Synchronization Between LDP and IGP
Networking Requirements
As shown in Figure 3-30, P1, P2, P3, and PE2 exist on an MPLS backbone network, and OSPF runs between each two devices. Two LSPs are established between PE1 and PE2. The LSP PE1 -> P1 -> P2 -> PE2 is the primary LSP, while the LSP PE1 -> P1 -> P3 -> PE2 is the backup LSP. When the primary LSP recovers, IGP traffic is switched back to the primary LSP earlier than LDP traffic because IGP route convergence is faster than LDP convergence. As a result, LSP traffic is lost. The LSP traffic loss needs to be prevented on the MPLS network where primary and backup LSPs are configured.
Configuration Roadmap
To meet the preceding requirements, configure synchronization between LDP and IGP. The configuration roadmap is as follows:
Enable synchronization between LDP and IGP on the interfaces at both ends of the link between P1 (crossing node of the primary and backup LSPs) and P2 (LDP neighboring node on the primary LSP).
Set the values of Hold-down timer, Hold-max-cost timer and Delay timer on the interfaces at both ends of the link between P1 and P2.
Procedure
- Configure IP addresses for interfaces.
# Configure P1. The configurations of P2, P3, and PE2 are similar to the configuration of P1, and are not mentioned here.
<Huawei> system-view [Huawei] sysname P1 [P1] interface loopback 1 [P1-LoopBack1] ip address 10.10.1.1 32 [P1-LoopBack1] quit [P1] interface gigabitethernet 1/0/0 [P1-GigabitEthernet1/0/0] ip address 10.1.1.1 24 [P1-GigabitEthernet1/0/0] quit [P1] interface gigabitethernet 2/0/0 [P1-GigabitEthernet2/0/0] ip address 10.3.1.1 24 [P1-GigabitEthernet2/0/0] quit
- Configure OSPF to advertise the network segments connecting
to interfaces on each node and to advertise the routes of hosts with
LSR IDs.
# Configure P1. The configurations of P2, P3, and PE2 are similar to the configuration of P1, and are not mentioned here.
[P1] ospf 1 [P1-ospf-1] area 0 [P1-ospf-1-area-0.0.0.0] network 10.10.1.1 0.0.0.0 [P1-ospf-1-area-0.0.0.0] network 10.1.1.0 0.0.0.255 [P1-ospf-1-area-0.0.0.0] network 10.3.1.0 0.0.0.255 [P1-ospf-1-area-0.0.0.0] quit [P1-ospf-1] quit
- Set the cost of GE2/0/0 on P1 to 1000.
[P1] interface gigabitethernet 2/0/0 [P1-GigabitEthernet2/0/0] ospf cost 1000 [P1-GigabitEthernet2/0/0] quit
When the configurations are complete, run the display ip routing-table command on each node. The command output shows that the nodes have learned routes from each other. The outbound interface of P1-to-P2 route is GE1/0/0. P1 is used as an example.
[P1] display ip routing-table Route Flags: R - relay, D - download to fib, T - to vpn-instance ------------------------------------------------------------------------------ Routing Tables: Public Destinations : 16 Routes : 16 Destination/Mask Proto Pre Cost Flags NextHop Interface 10.10.1.1/32 Direct 0 0 D 127.0.0.1 LoopBack1 10.10.1.2/32 OSPF 10 1 D 10.1.1.2 GigabitEthernet1/0/0 10.10.1.3/32 OSPF 10 3 D 10.1.1.2 GigabitEthernet1/0/0 10.10.1.4/32 OSPF 10 2 D 10.1.1.2 GigabitEthernet1/0/0 10.1.1.0/24 Direct 0 0 D 10.1.1.1 GigabitEthernet1/0/0 10.1.1.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet1/0/0 10.1.1.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet1/0/0 10.2.1.0/24 OSPF 10 2 D 10.1.1.2 GigabitEthernet1/0/0 10.3.1.0/24 Direct 0 0 D 10.3.1.1 GigabitEthernet2/0/0 10.3.1.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet2/0/0 10.3.1.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet2/0/0 10.4.1.0/24 OSPF 10 3 D 10.1.1.2 GigabitEthernet1/0/0 127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0 127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0 127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0 255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
- Enable MPLS and MPLS LDP on each node and each interface.
# Configure P1.
[P1] mpls lsr-id 10.10.1.1 [P1] mpls [P1-mpls] quit [P1] mpls ldp [P1-mpls-ldp] quit [P1] interface gigabitethernet 1/0/0 [P1-GigabitEthernet1/0/0] mpls [P1-GigabitEthernet1/0/0] mpls ldp [P1-GigabitEthernet1/0/0] quit [P1] interface gigabitethernet 2/0/0 [P1-GigabitEthernet2/0/0] mpls [P1-GigabitEthernet2/0/0] mpls ldp [P1-GigabitEthernet2/0/0] quit
# Configure P2.
[P2] mpls lsr-id 10.10.1.2 [P2] mpls [P2-mpls] quit [P2] mpls ldp [P2-mpls-ldp] quit [P2] interface gigabitethernet 1/0/0 [P2-GigabitEthernet1/0/0] mpls [P2-GigabitEthernet1/0/0] mpls ldp [P2-GigabitEthernet1/0/0] quit [P2] interface gigabitethernet 2/0/0 [P2-GigabitEthernet2/0/0] mpls [P2-GigabitEthernet2/0/0] mpls ldp [P2-GigabitEthernet2/0/0] quit
# Configure P3.
[P3] mpls lsr-id 10.10.1.3 [P3] mpls [P3-mpls] quit [P3] mpls ldp [P3-mpls-ldp] quit [P3] interface gigabitethernet 1/0/0 [P3-GigabitEthernet1/0/0] mpls [P3-GigabitEthernet1/0/0] mpls ldp [P3-GigabitEthernet1/0/0] quit [P3] interface gigabitethernet 2/0/0 [P3-GigabitEthernet2/0/0] mpls [P3-GigabitEthernet2/0/0] mpls ldp [P3-GigabitEthernet2/0/0] quit
# Configure PE2.
[PE2] mpls lsr-id 10.10.1.4 [PE2] mpls [PE2-mpls] quit [PE2] mpls ldp [PE2-mpls-ldp] quit [PE2] interface gigabitethernet 1/0/0 [PE2-GigabitEthernet1/0/0] mpls [PE2-GigabitEthernet1/0/0] mpls ldp [PE2-GigabitEthernet1/0/0] quit [PE2] interface gigabitethernet 2/0/0 [PE2-GigabitEthernet2/0/0] mpls [PE2-GigabitEthernet2/0/0] mpls ldp [PE2-GigabitEthernet2/0/0] quit
When the configurations are complete, LDP sessions are established between neighboring nodes. Run the display mpls ldp session command on each node. The command output shows that LDP session status is Operational. P1 is used as an example.
[P1] display mpls ldp session LDP Session(s) in Public Network Codes: LAM(Label Advertisement Mode), SsnAge Unit(DDDD:HH:MM) A '*' before a session means the session is being deleted. ------------------------------------------------------------------------------ PeerID Status LAM SsnRole SsnAge KASent/Rcv ------------------------------------------------------------------------------ 10.10.1.2:0 Operational DU Passive 000:00:56 227/227 10.10.1.3:0 Operational DU Passive 000:00:56 227/227 ------------------------------------------------------------------------------ TOTAL: 2 session(s) Found.
- Enable synchronization between LDP and IGP on the interfaces
at both ends of the link between P1 and P2.
# Configure P1.
[P1] interface gigabitethernet 1/0/0 [P1-GigabitEthernet1/0/0] ospf ldp-sync [P1-GigabitEthernet1/0/0] quit
# Configure P2.
[P2] interface gigabitethernet 1/0/0 [P2-GigabitEthernet1/0/0] ospf ldp-sync [P2-GigabitEthernet1/0/0] quit
- Set the value of Hold-down timer on the interfaces at both
ends of the link between P1 and P2.
# Configure P1.
[P1] interface gigabitethernet 1/0/0 [P1-GigabitEthernet1/0/0] ospf timer ldp-sync hold-down 8 [P1-GigabitEthernet1/0/0] quit
# Configure P2.
[P2] interface gigabitethernet 1/0/0 [P2-GigabitEthernet1/0/0] ospf timer ldp-sync hold-down 8 [P2-GigabitEthernet1/0/0] quit
- Set the value of Hold-max-cost timer on the interfaces
at both ends of the link between P1 and P2.
# Configure P1.
[P1] interface gigabitethernet 1/0/0 [P1-GigabitEthernet1/0/0] ospf timer ldp-sync hold-max-cost 9 [P1-GigabitEthernet1/0/0] quit
# Configure P2.
[P2] interface gigabitethernet 1/0/0 [P2-GigabitEthernet1/0/0] ospf timer ldp-sync hold-max-cost 9 [P2-GigabitEthernet1/0/0] quit
- Set the value of Delay timer on the interfaces at both
ends of the link between P1 and P2.
# Configure P1.
[P1] interface gigabitethernet 1/0/0 [P1-GigabitEthernet1/0/0] mpls ldp timer igp-sync-delay 6 [P1-GigabitEthernet1/0/0] quit
# Configure P2.
[P2] interface gigabitethernet 1/0/0 [P2-GigabitEthernet1/0/0] mpls ldp timer igp-sync-delay 6 [P2-GigabitEthernet1/0/0] quit
- Verify the configuration.
# Run the display ospf ldp-sync command on P1. The command output shows that the interface status is Sync-Achieved.
[P1] display ospf ldp-sync interface gigabitethernet 1/0/0 Interface GigabitEthernet1/0/0 HoldDown Timer: 8 HoldMaxCost Timer: 9 LDP State: Up OSPF Sync State: Sync-Achieved
Configuration Files
P1 configuration file
# sysname P1 # mpls lsr-id 10.10.1.1 mpls # mpls ldp # interface GigabitEthernet1/0/0 ip address 10.1.1.1 255.255.255.0 ospf ldp-sync ospf timer ldp-sync hold-down 8 ospf timer ldp-sync hold-max-cost 9 mpls mpls ldp mpls ldp timer igp-sync-delay 6 # interface GigabitEthernet2/0/0 ip address 10.3.1.1 255.255.255.0 ospf cost 1000 mpls mpls ldp # interface LoopBack1 ip address 10.10.1.1 255.255.255.255 # ospf 1 area 0.0.0.0 network 10.10.1.1 0.0.0.0 network 10.1.1.0 0.0.0.255 network 10.3.1.0 0.0.0.255 # return
P2 configuration file
# sysname P2 # mpls lsr-id 10.10.1.2 mpls # mpls ldp # interface GigabitEthernet1/0/0 ip address 10.1.1.2 255.255.255.0 ospf ldp-sync ospf timer ldp-sync hold-down 8 ospf timer ldp-sync hold-max-cost 9 mpls mpls ldp mpls ldp timer igp-sync-delay 6 # interface GigabitEthernet2/0/0 ip address 10.2.1.1 255.255.255.0 mpls mpls ldp # interface LoopBack1 ip address 10.10.1.2 255.255.255.255 # ospf 1 area 0.0.0.0 network 10.10.1.2 0.0.0.0 network 10.1.1.0 0.0.0.255 network 10.2.1.0 0.0.0.255 # return
P3 configuration file
# sysname P3 # mpls lsr-id 10.10.1.3 mpls # mpls ldp # interface GigabitEthernet1/0/0 ip address 10.3.1.2 255.255.255.0 mpls mpls ldp # interface GigabitEthernet2/0/0 ip address 10.4.1.1 255.255.255.0 mpls mpls ldp # ospf 1 area 0.0.0.0 network 10.10.1.3 0.0.0.0 network 10.3.1.0 0.0.0.255 network 10.4.1.0 0.0.0.255 # return
PE2 configuration file
# sysname PE2 # mpls lsr-id 10.10.1.4 mpls # mpls ldp # interface GigabitEthernet1/0/0 ip address 10.2.1.2 255.255.255.0 mpls mpls ldp # interface GigabitEthernet2/0/0 ip address 10.4.1.2 255.255.255.0 mpls mpls ldp # interface LoopBack1 ip address 10.10.1.4 255.255.255.255 # ospf 1 area 0.0.0.0 network 10.10.1.4 0.0.0.0 network 10.2.1.0 0.0.0.255 network 10.4.1.0 0.0.0.255 # return