-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
isisd: Fix the calculated metric and backup routes for IPv4 local connected routes. #16659
base: master
Are you sure you want to change the base?
Conversation
Please use a short and direct title for the PR, as it is stand, from reading the title only, I can't tell what you are trying to do. IS this what you are trying to say?:
|
89c8315
to
c6cd7fa
Compare
…nected routes The IPv4 directly connected route prefix exists in both the root LSP and the root's neighbor LSP: When generating vertices for directly connected route prefixes with a metric of 0 based on the root LSP, the isis_spf_preload_tent_ip_reach_cb function only generates vertices of type VTYPE_IPREACH_INTERNAL without distinguishing between area->oldmetric and area->newmetric. When generating vertices for the directly connected route prefix based on the neighbor LSP, the isis_spf_process_lsp function will generate vertices of type VTYPE_IPREACH_INTERNAL and VTYPE_IPREACH_TE based on area->oldmetric and area->newmetric, where the vertex metric is the sum of the metric from the root IS to the neighbor IS and from the neighbor IS to the root IS, respectively. If area->newmetric==1, the same directly connected route prefix will have both VTYPE_IPREACH_INTERNAL vertices with a metric of 0 and VTYPE_IPREACH_TE vertices with a non-zero metric. During route generation, the isis_spf_loop function will prioritize selecting VTYPE_IPREACH_TE vertices, leading to incorrect metrics for the directly connected routes. Supplement topotest modifications. Directly connected routes with incorrect ISIS cost calculations should not appear in the RIB. Signed-off-by: zhou-run <[email protected]>
Okay. I have updated the PR title. |
I previously submitted this PR in #16056, and it passed the basic tests. However, it was reverted in #16160 because the basic tests failed when merging into other branches. Upon reviewing the failed topotests, it was found that the cause was incorrect metric calculations for local direct routes and the generation of backup routes for local direct routes. Now I have fixed these topotests. @ton31337 @riw777 @odd22 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just looked again ... this is removing a lot of code ... can you explain why removing the check for these networks is the correct fix, and whether this is going to reduce coverage in other protocols?
The routes I removed are all IPv4 local direct routes. ISIS should calculate these networks the same way as IPv6 local direct routes, with a metric value of 0 instead of 20. This way, when these routes are passed down to Zebra, they will be compared with the kernel's local direct routes, and the ISIS-generated routes with the same metric value will be removed.
The IPv4 local connected routes calculated by ISIS will never be selected in the FIB, and these IPv4 local connected routes do not need to have backup routes, so they will not affect the coverage of other protocols. |
Kernel routes and isis routes have different AD, and as such isis metrics will never be compared to kernel metrics( as if that even means anything) Talking about metric makes no sense to me. Can you try your explanation again? As that I am now more confused than before |
You're right. The IPv4 local route in ISIS is not compared with the kernel route. Instead, in
|
Is there any case where it would be selected? I'm really hesitant to remove this much code to solve a problem that may, in theory, only happen sometimes ... |
As the primary route, it's indeed unlikely to be selected unless the kernel does not generate a direct route. However, a direct route can generate a backup route, which allows traffic to reroute back to the local prefix through the backup if the connection fails. Just like the route that was deleted below.
|
The IPv4 directly connected route prefix exists in both the root LSP and the root's neighbor LSP:
isis_spf_preload_tent_ip_reach_cb()
function only generates vertices of typeVTYPE_IPREACH_INTERNAL
without distinguishing betweenarea->oldmetric
andarea->newmetric
.isis_spf_process_lsp()
function will generate vertices of typeVTYPE_IPREACH_INTERNAL
andVTYPE_IPREACH_TE
based onarea->oldmetric
andarea->newmetric
, where the vertex metric is the sum of the metric from the root IS to the neighbor IS and from the neighbor IS to the root IS, respectively.If area->newmetric==1, the same directly connected route prefix will have both
VTYPE_IPREACH_INTERNAL
vertices with a metric of 0 andVTYPE_IPREACH_TE
vertices with a non-zero metric. During route generation, theisis_spf_loop()
function will prioritize selectingVTYPE_IPREACH_TE
vertices, leading to incorrect metrics for the directly connected routes. Of course, the depth of thisVTYPE_IPREACH_TE
vertex is always greater than 1, which will cause thespf_vertex_check_is_affected()
function to fail thevertex->depth == 1
condition check for this local route vertex. As a result, a backup route will be generated for the local route when LFA or TI-LFA is configured.Supplement topotest modifications. Directly connected routes with incorrect ISIS cost calculations should not appear in the RIB. Similarly, we should not calculate backup routes for local direct routes.
Signed-off-by: zhou-run [email protected]