SR-TE Dynamic Policy with Margin
Load basic.isis.sr.vpnv4.enabled.cfg
Configure the TE metric on the R1-R4 link to be cost = 15, and the IGP metric to be 10.
Configure an SR-TE policy which uses TE metric on R1 using R7 as the endpoint. By default, only one path will be found. Using margin, allow for ECMP as long as the paths are within a TE metric margin of 20.
Answer
Explanation
The “margin” feature allows you to do ECMP on paths that are within the same margin of metric. This is often used when optimizing latency, allowing you to use ECMP paths that have very close latency values. Without this, you might overload one path, when another path is unused because it has only 1msec more latency. (Note that when using margin for latency, latency is measured in nanoseconds, so you must use a margin of 1000 for 1 msec in metric difference).
To use this feature, you simply add metric margin absolute|relative under the candidate-path. The absolute value compares the absolute metric value between potential paths. If a path’s metric is within the absolute value margin of the best path, it is used for ECMP. The relative value uses a percentage. If a path’s metric is within the percentage margin of the best path’s metric, it is used for ECMP.
Before adding this, we can see that only one path is used:
We’ll now add a margin of 20 (absolute).
The margin value is shown under “show segment-routing traffic-eng policy.” You can only use absolute margin or relative margin, not both at the same time.
If we look at the forwarding details, we see both R3 and R4 are used now.
Note that it appears that the underlying IGP cost of all paths must be the same, while the measured metric (TE or latency) can vary within the margin. So the IGP path to 7.7.7.1 must itself be ECMP via R3 and R4.
We can validate this by setting the IGP cost to R4 to be 11. Now only R3 is used as the nexthop for the policy. This is somewhat counterintuitive to me, since it seems both paths should still be used, as the TE metric is still within the specified margin.
Last updated