LDP/IGP Sync (OSPF)
Load ospfv2.cfg
Configure LDP authentication for R2 on R3, using pass LDP23. Do not configure R2.
Configure LDP for all routers using autoconfig under OSPF.
Configure LDP sync so that all traffic from R1 to XR2 is always sent over R2-R4 instead of R2-R3 when LDP is not up between R2-R3.
Configure the R2-R3 link so that the IGP waits for LDP to be up for 20 seconds before reducing the metric.
Answer
Explanation
Although the feature may sound complex, LDP/IGP sync is fairly simple. The problem it solves is if the IGP converges before LDP converges (perhaps before LDP has finished exchanging labels), routing may find a best path that is temporarily unlabeled, breaking any LSPs and VPNs running over those LSPs. To solve this issue, the IGP advertises the link metric as the max value, and when LDP is fully converged, the metric is reduced to the regular metric of the link. This discourages the use of the link by the IGP until LDP is fully converged, hence the IGP is “in sync” with LDP.
LDP/IGP sync comes with two parameters that are important:
Sync delay timer
Configurable on both IOS-XE and IOS-XR
Controls how long the IGP waits to reduce the metric value once LDP is converged
Default value is 0 seconds
Holddown timer
Configurable only on IOS-XE
Controls how long IGP will wait to hear LDP hellos before finally giving up and establishing an IGP adjacency, and then setting metric to max value
Default value is infinite on IOS-XE
Does not appear to be implemented on IOS-XR
You could consider the default value 0 on IOS-XR
Naturally, LDP/IGP sync is configured under the IGP process as follows:
We can only configure the sync delay under each interface individually.
We set the holddown timer in IOS-XE globally:
Verification
First examine R2’s routing table and notice that no paths are via R3. R2 does not have an LDP session established with R3 due to the mismatched auth. This is a sign that the LDP/IGP sync feature is working.
If we look at the OSPF interface cost, we see that the Gi2.23 cost is still 1, which is a little confusing. You might expect this to be 65535.
However, if you inspect the router’s Router LSA, you can see that the metric is indeed set to the maximum. The interface’s “regular” or “configured” cost is 1, which is what is reflected in the previous output.
A handy command for verifying LDP/IGP sync is show mpls ldp igp sync. We can see on R2 that Gi1.23 is currently in a status of “sync not achieved; peer reachable.”
If we remove the authentication on R3, we should see that LDP is established. OSPF should then wait 20 seconds before changing the metric value back to 1. We can see this timer using the same show command as seen above.
Sync holddown
Let’s breifly explore the sync holddown feature. This is only configurable on IOS-XE. This feature is kind of complicated, because it seems to only be in use when the interface detects no LDP Hellos at all on the other side. So to simulate this, we will need to completely remove LDP on R3 Gi2.23.
However, the other problem is that R2 has already formed an OSPF adjacency with R3. So we need to clear OSPF on R2 now.
Now we can see that R2 has no OSPF adjacency at all with R3:
If we look at the OSPF status for this interface, we see that the state is DOWN (waiting for LDP). The interface is waiting to hear LDP Hellos. Without received LDP Hellos, the OSPF neighborship will never form.
If we change the holddown timer to something low, such as 10 seconds, we should see that eventually OSPF gives up and forms the adjacency anyways, albeit with max metric on the link. This seems better to me than waiting indefinitely, as that could cause a serious outage in production.
Note that IOS-XR does not appear to implement this holddown timer. First, we can see that this parameter is not visible in the show output:
Second, if we make the same change, we can see that OSPF still forms:
The sync status is “not ready”, meaning unsynchronized, but the OSPF neighborship still forms, unlike IOS-XE:
To me this seems better, because you can never cause an outage due to disabling LDP on IOS-XR when implementing IGP/LDP sync.
Last updated