Description

Understanding the behaviour of the Constrained Shortest Path First (CSPF) algorithm in relation to Label Switched Paths (LSPs) is crucial, especially when multiple LSPs share the same setup priority. This article aims to clarify the expected ordering of LSPs when CSPF rebuild queuing occurs.

Solution

In Multiprotocol Label Switching (MPLS) networks, the CSPF algorithm is used to compute the most efficient path for LSPs, taking into account constraints such as bandwidth, administrative weights, and other path attributes. When network changes occur (e.g., a link goes down or the network topology changes), CSPF may need to recalculate paths for existing LSPs.

LSPs have both setup and holding priorities that dictate how they are established and maintained in the network. The setup priority determines the order in which LSPs are established when competing for resources. However, when multiple LSPs have the same setup priority and a CSPF rebuild is triggered, the router must queue the LSPs for path recalculation.

 Expected Ordering of LSPs with the Same Setup Priority

When multiple LSPs share the same setup priority, the Juniper router must decide the order in which these LSPs are processed during a CSPF rebuild. The expected behaviour is as follows:

1. First Come, First Served (FCFS) Basis:

   LSPs are processed in the order they were added to the queue. The LSP that was first affected by the network change and added to the CSPF rebuild queue will be the first to have its path recalculated. This ensures that older LSPs are given priority in processing over newer ones, assuming they have the same setup priority.

2. Stable and Deterministic Ordering:

   If LSPs have the same setup priority and enter the queue simultaneously due to a network-wide event, the router will handle them in a stable order. This order is typically based on the internal identification or configuration order of the LSPs. 

3. Bandwidth Availability and Path Constraints: 

   If two or more LSPs share the same setup priority and have similar requirements (e.g., bandwidth, explicit paths), the router will attempt to satisfy the requirements in the order defined by the queue. However, if resources are insufficient for all queued LSPs, some LSPs may not be able to be established or might be rerouted over suboptimal paths.

4. Rate Limiting and Throttling:

   Juniper routers may implement rate limiting or throttling mechanisms to avoid excessive CPU utilization during large-scale CSPF rebuilds. This means that even with a queue, there could be controlled delays between processing each LSP.

5. Prioritization of High-Priority LSPs: 

   LSPs with higher setup priorities will always preempt LSPs with lower setup priorities. However, if the LSPs have the same setup priority, they will be processed according to their position in the rebuild queue.

 Example Scenario

Consider a scenario where there are five LSPs (A, B, C, D, and E) configured on a Juniper router, all with a setup priority of 3. If a network topology change triggers a CSPF recalculation:

- LSP A is first affected by the change and added to the CSPF rebuild queue.
- LSP B and LSP C are affected simultaneously and are next in the queue.
- LSP D and LSP E are added last.

In this case, the router will handle LSPs in the following order: A, B, C, D, E.

If another network change occurs while LSP A is being processed, **LSP A** will complete its processing first, followed by **B**, **C**, **D**, and **E**.

 Best Practices


- Monitor CSPF Queues: Regularly monitor CSPF queues to understand the order of LSP processing and any potential delays.
- Optimize Network Topology: Ensure that the network topology and LSP configurations minimize the need for frequent CSPF recalculations.
- Leverage Setup Priority: Use varying setup priorities to better control the processing order of critical LSPs.

 Conclusion

Understanding the ordering of LSPs during CSPF rebuild queuing is essential for network administrators working with Juniper routers. By following the principles outlined in this article, administrators can better anticipate the behaviour of their network and optimize LSP configuration for efficient and reliable service delivery.

For more detailed guidance or specific scenarios, consult the Juniper technical documentation or reach out to Juniper support.

Modification History

2024-08-28 : Article Created