-
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
zebra: add LSP entry to nexthop via recursive #12469
Conversation
A couple of top-level questions: the description here is too lean. How will this new lookup solve the problem you're trying to describe? The existing recursive check is probably trying to avoid a situation where some next-hop doesn't speak mpls at all - or doesn't understand the label stack. How can you ensure that won't happen? |
It would be better not to be working from "master" in your fork - it would be better to work from a branch in your fork. |
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.
Must have docs for this, and it should be included in a topotest as well.
(safi == SAFI_UNICAST && !peer->afc[afi][safi] && | ||
peer->afc[afi][SAFI_LABELED_UNICAST] && | ||
CHECK_FLAG(peer->af_flags[afi][SAFI_LABELED_UNICAST], | ||
PEER_FLAG_REFLECTOR_CLIENT))) |
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.
you can't add this much unconditional change without ... a comment explaining exactly what these additional terms mean.
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.
Commit log was updated with a comment.
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.
That's good, from the commit-log pov, but it's really what I asked for? I'd like to see a comment here in the code, where this very particular decision is being taken. Otherwise, someone who is trying to follow the logic bears the burden of doing a git blame, walking through the code, and searching the git history in order to locate the comment.
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.
Done.
zebra/rib.h
Outdated
@@ -416,6 +416,7 @@ extern struct route_entry *rib_match_ipv6_multicast(vrf_id_t vrf_id, | |||
|
|||
extern struct route_entry *rib_lookup_ipv4(struct prefix_ipv4 *p, | |||
vrf_id_t vrf_id); | |||
extern struct route_entry *rib_lookup(struct prefix *p, vrf_id_t vrf_id); |
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.
Do we really need yet-another copy of the "lookup a route" logic for this purpose?
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.
There is only ipv4 lookup available, no ipv6 lookup was found. changing the prototype of "rib_lookup_ipv4" will lead to code impact as other functions use it. Instead of creating ipv6_lookup, the generic rib_lookup was added.
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.
looks like route_node_lookup() is widely used - won't that work?
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.
Finally we do not need another copy, as you are suggesting. The rib_lookup_ipv4
evolved to rib_lookup
with generic ipv4 ipv6 functionality in new version.
zebra/zebra_mpls.c
Outdated
@@ -197,10 +200,29 @@ static int lsp_install(struct zebra_vrf *zvrf, mpls_label_t label, | |||
*/ | |||
for (nexthop = re->nhe->nhg.nexthop; | |||
nexthop; nexthop = nexthop->next) { | |||
nexthop_via_recursive = nexthop; | |||
/* Skip inactive and recursive entries. */ |
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.
Old comment?
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.
Will be fixed
zebra/zebra_mpls.c
Outdated
} | ||
|
||
re_recursive = rib_lookup(&p, zvrf->vrf->vrf_id); | ||
nexthop_via_recursive = re_recursive->nhe->nhg.nexthop; |
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.
what if the lookup doesn't succeed?
and again, we have to have a comment describing what this branch is trying to do.
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.
Indeed, the code should also cope with this situation.
* vtysh configuration of "mpls fec resolve-via-recursive" | ||
*/ | ||
void zebra_mpls_fec_recursive_seamless_enabled(bool status, | ||
struct zebra_vrf *zvrf) |
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.
Add zvrf apis to the zvrf module, not the zebra_mpls module?
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.
Reply: thanks will be moved to zvrf module
zebra/zebra_mpls_vty.c
Outdated
return write; | ||
} | ||
|
||
/* Enable seamless MPLS */ | ||
DEFUN (mpls_fec_recursive_seamless, |
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.
DEFPY now, please, and you can use one block that includes the 'no' form.
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.
Understood, it is going to be addressed.
zebra/zebra_rib.c
Outdated
@@ -641,15 +641,56 @@ struct route_entry *rib_lookup_ipv4(struct prefix_ipv4 *p, vrf_id_t vrf_id) | |||
return NULL; | |||
} | |||
|
|||
struct route_entry *rib_lookup(struct prefix *p, vrf_id_t vrf_id) |
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.
Adding another copy of the route-lookup logic is pretty unappealing. Is this absolutely necessary (and correct)?
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.
There is only ipv4 lookup available, no ipv6 lookup was found. changing the prototype of "rib_lookup_ipv4" will lead to code impact as other functions use it. Instead of creating ipv6_lookup, the generic rib_lookup was added.
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.
To further this point a cut-n-paste of code just fixing up struct prefix_ipv4
to struct prefix_ipv6
is a big hard no from me. Abstract to the generic functionality and replace all the places that rib_lookup_ipv4 is used with just a plain old rib_lookup. I'm not interested in cut-n-paste code.
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.
Thanks for this comment. In new version of the PATCH,
struct route_entry *rib_lookup_ipv4
will be replaced by
struct route_entry *rib_lookup
with generic functionality for ipv4 and ipv6 prefixes with replacement of all occurrences in the code without cut-n-paste.
zebra/zebra_rib.c
Outdated
|
||
if (re->type != ZEBRA_ROUTE_BGP) | ||
if ((re->type != ZEBRA_ROUTE_BGP) && | ||
!zvrf->zebra_mpls_fec_recursive_seamless) |
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.
Again, why this change?
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.
when a FEC entry is added in zebra on
reception of a BGP labeled unicast update, an LSP entry is
created. That LSP entry is resolved by using the re route entry
which is also installed by BGP labeled unicast.
This route entry is not available when we face with i-bgp
peering session.
Actually, the BGP labeled unicast is working over an
LSP network, but associated BGP labeled unicast entries are not selected.
This change disables the (re->type != ZEBRA_ROUTE_BGP) check.
Thus we rely on the available network entry.
Without this modification we have:
east-vm# show mpls table
Inbound Label Type Nexthop Outbound Label
-------------------------------------------------------
1011 SR (IS-IS) 10.125.0.1 implicit-null
1033 SR (IS-IS) 10.126.0.3 implicit-null
1044 SR (IS-IS) 10.126.0.3 1044
30000 SR (IS-IS) 10.125.0.1 implicit-null
30001 SR (IS-IS) 10.126.0.3 implicit-null
After this modification we have:
east-vm# show mpls table
Inbound Label Type Nexthop Outbound Label
-------------------------------------------------------
17 SR (IS-IS) 10.125.0.1 implicit-null
19 SR (IS-IS) 10.126.0.3 implicit-null
20 SR (IS-IS) 10.126.0.3 1044
1011 SR (IS-IS) 10.125.0.1 implicit-null
1033 SR (IS-IS) 10.126.0.3 implicit-null
1044 SR (IS-IS) 10.126.0.3 1044
30000 SR (IS-IS) 10.125.0.1 implicit-null
30001 SR (IS-IS) 10.126.0.3 implicit-null
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.
Please look at all the places where this function is called. We can't just return true in all of those paths.
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.
Hello, I updated the description with IETF document that highlights the approach proposed by these series of patches ( I hope this might help )
Continuous Integration Result: SUCCESSFULContinuous Integration Result: SUCCESSFULCongratulations, this patch passed basic tests Tested-by: NetDEF / OpenSourceRouting.org CI System CI System Testrun URL: https://ci1.netdef.org/browse/FRR-PULLREQ2-8760/ This is a comment from an automated CI system. Warnings Generated during build:Checkout code: Successful with additional warnings
|
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.
And also... tests + docs?
The description was updated. I supposed too that recursive check is probably present to avoid the case when next-hop is not an mpls hop. This patch is optional feature enabled by the vtysh command only where network operator ensures that setup is properly configured. |
For next pull request, I will pay attention. Thank you. |
I will work on this, Thanks. |
I will work on this. |
Why are you trying to use bgp-lu here at all, when you don't have hop-by-hop peers? If you announced recursive ip routes, they'd be installed to use the SR LSPs just fine - I think?
|
zebra/zebra_mpls.c
Outdated
nhlfe = nhlfe_add(lsp, lsp_type, | ||
nexthop_via_recursive->type, | ||
&nexthop->gate, | ||
nexthop_via_recursive->ifindex, | ||
nexthop->nh_label->num_labels, | ||
nexthop->nh_label->label, |
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.
trying to be clearer about the question here: so this says "send an mpls packet with the LU labels on a link where there's no assurance that those labels mean anything. and the destination mac will be ... for an address that doesn't exist on the link." so ... how can that be meaningful to do?
zebra/zebra_mpls.c
Outdated
p.prefixlen = IPV6_MAX_BITLEN; | ||
} | ||
|
||
re_recursive = rib_lookup(&p, zvrf->vrf->vrf_id); |
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'm willing to bet that this 1st commit in the tree needs rib_lookup to work. This will not even compile. I'm not interested in taking code that will fail me when I have a git bisect. Please take the time and make sure the code will work and compile in sequence
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'm working on the new version that has the code which compiles in sequence. Thank you for the comment.
There needs to be doc changes as well as an topotest or two to show this new feature working |
I'm currently working on 3 topotests, thanks. What doc changes exactly do you have in mind? (Please note I updated the topic with IETF document, this might help). |
d3e54f4
to
45eae20
Compare
45eae20
to
fc53649
Compare
Continuous Integration Result: FAILEDContinuous Integration Result: FAILEDSee below for issues. This is a comment from an automated CI system. Get source / Pull Request: SuccessfulBuilding Stage: SuccessfulBasic Tests: FailedTopotests Ubuntu 18.04 i386 part 6: Failed (click for details)Topology Test Results are at https://ci1.netdef.org/browse/FRR-PULLREQ2-TOPO6U18I386-9034/test Topology Tests failed for Topotests Ubuntu 18.04 i386 part 6 Topotests Ubuntu 18.04 arm8 part 1: Failed (click for details)Topotests Ubuntu 18.04 arm8 part 1: Unknown Log URL: https://ci1.netdef.org/browse/FRR-PULLREQ2-9034/artifact/TOPO1U18ARM8/TopotestDetails/ Topotests Ubuntu 18.04 arm8 part 1: No useful log foundTopotests Ubuntu 18.04 arm8 part 6: Failed (click for details)Topotests Ubuntu 18.04 arm8 part 6: Unknown Log URL: https://ci1.netdef.org/browse/FRR-PULLREQ2-9034/artifact/TOPO6U18ARM8/TopotestDetails/ Topotests Ubuntu 18.04 arm8 part 6: No useful log foundTopotests debian 10 amd64 part 6: Failed (click for details)Topology Test Results are at https://ci1.netdef.org/browse/FRR-PULLREQ2-TOPO6DEB10AMD64-9034/test Topology Tests failed for Topotests debian 10 amd64 part 6 Topotests Ubuntu 18.04 amd64 part 6: Failed (click for details)Topology Test Results are at https://ci1.netdef.org/browse/FRR-PULLREQ2-TOPO6U18AMD64-9034/test Topology Tests failed for Topotests Ubuntu 18.04 amd64 part 6 Topotests debian 10 amd64 part 4: Failed (click for details)Topology Test Results are at https://ci1.netdef.org/browse/FRR-PULLREQ2-TOPO4DEB10AMD64-9034/test Topology Tests failed for Topotests debian 10 amd64 part 4 Successful on other platforms/tests
Warnings Generated during build:Checkout code: Successful with additional warningsTopotests Ubuntu 18.04 i386 part 6: Failed (click for details)Topology Test Results are at https://ci1.netdef.org/browse/FRR-PULLREQ2-TOPO6U18I386-9034/test Topology Tests failed for Topotests Ubuntu 18.04 i386 part 6 Topotests Ubuntu 18.04 arm8 part 1: Failed (click for details)Topotests Ubuntu 18.04 arm8 part 1: Unknown Log URL: https://ci1.netdef.org/browse/FRR-PULLREQ2-9034/artifact/TOPO1U18ARM8/TopotestDetails/ Topotests Ubuntu 18.04 arm8 part 1: No useful log foundTopotests Ubuntu 18.04 arm8 part 6: Failed (click for details)Topotests Ubuntu 18.04 arm8 part 6: Unknown Log URL: https://ci1.netdef.org/browse/FRR-PULLREQ2-9034/artifact/TOPO6U18ARM8/TopotestDetails/ Topotests Ubuntu 18.04 arm8 part 6: No useful log foundTopotests debian 10 amd64 part 6: Failed (click for details)Topology Test Results are at https://ci1.netdef.org/browse/FRR-PULLREQ2-TOPO6DEB10AMD64-9034/test Topology Tests failed for Topotests debian 10 amd64 part 6 Topotests Ubuntu 18.04 amd64 part 6: Failed (click for details)Topology Test Results are at https://ci1.netdef.org/browse/FRR-PULLREQ2-TOPO6U18AMD64-9034/test Topology Tests failed for Topotests Ubuntu 18.04 amd64 part 6 Topotests debian 10 amd64 part 4: Failed (click for details)Topology Test Results are at https://ci1.netdef.org/browse/FRR-PULLREQ2-TOPO4DEB10AMD64-9034/test Topology Tests failed for Topotests debian 10 amd64 part 4
|
Continuous Integration Result: FAILEDContinuous Integration Result: FAILEDSee below for issues. This is a comment from an automated CI system. Get source / Pull Request: SuccessfulBuilding Stage: SuccessfulBasic Tests: FailedTopotests Ubuntu 18.04 i386 part 6: Failed (click for details)Topology Test Results are at https://ci1.netdef.org/browse/FRR-PULLREQ2-TOPO6U18I386-9036/test Topology Tests failed for Topotests Ubuntu 18.04 i386 part 6 Topotests debian 10 amd64 part 6: Failed (click for details)Topology Test Results are at https://ci1.netdef.org/browse/FRR-PULLREQ2-TOPO6DEB10AMD64-9036/test Topology Tests failed for Topotests debian 10 amd64 part 6 Topotests Ubuntu 18.04 arm8 part 6: Failed (click for details)Topotests Ubuntu 18.04 arm8 part 6: Unknown Log URL: https://ci1.netdef.org/browse/FRR-PULLREQ2-9036/artifact/TOPO6U18ARM8/TopotestDetails/ Topotests Ubuntu 18.04 arm8 part 6: No useful log foundTopotests Ubuntu 18.04 amd64 part 6: Failed (click for details)Topology Test Results are at https://ci1.netdef.org/browse/FRR-PULLREQ2-TOPO6U18AMD64-9036/test Topology Tests failed for Topotests Ubuntu 18.04 amd64 part 6 Topotests debian 10 amd64 part 4: Failed (click for details)Topology Test Results are at https://ci1.netdef.org/browse/FRR-PULLREQ2-TOPO4DEB10AMD64-9036/test Topology Tests failed for Topotests debian 10 amd64 part 4 Successful on other platforms/tests
Warnings Generated during build:Checkout code: Successful with additional warningsTopotests Ubuntu 18.04 i386 part 6: Failed (click for details)Topology Test Results are at https://ci1.netdef.org/browse/FRR-PULLREQ2-TOPO6U18I386-9036/test Topology Tests failed for Topotests Ubuntu 18.04 i386 part 6 Topotests debian 10 amd64 part 6: Failed (click for details)Topology Test Results are at https://ci1.netdef.org/browse/FRR-PULLREQ2-TOPO6DEB10AMD64-9036/test Topology Tests failed for Topotests debian 10 amd64 part 6 Topotests Ubuntu 18.04 arm8 part 6: Failed (click for details)Topotests Ubuntu 18.04 arm8 part 6: Unknown Log URL: https://ci1.netdef.org/browse/FRR-PULLREQ2-9036/artifact/TOPO6U18ARM8/TopotestDetails/ Topotests Ubuntu 18.04 arm8 part 6: No useful log foundTopotests Ubuntu 18.04 amd64 part 6: Failed (click for details)Topology Test Results are at https://ci1.netdef.org/browse/FRR-PULLREQ2-TOPO6U18AMD64-9036/test Topology Tests failed for Topotests Ubuntu 18.04 amd64 part 6 Topotests debian 10 amd64 part 4: Failed (click for details)Topology Test Results are at https://ci1.netdef.org/browse/FRR-PULLREQ2-TOPO4DEB10AMD64-9036/test Topology Tests failed for Topotests debian 10 amd64 part 4
|
fc53649
to
20ad0f5
Compare
Continuous Integration Result: FAILEDContinuous Integration Result: FAILEDTest incomplete. See below for issues. This is a comment from an automated CI system. Get source / Pull Request: SuccessfulBuilding Stage: SuccessfulBasic Tests: IncompleteTopotests Ubuntu 18.04 arm8 part 8: Failed (click for details)Topotests Ubuntu 18.04 arm8 part 8: Unknown Log URL: https://ci1.netdef.org/browse/FRR-PULLREQ2-9050/artifact/TOPO8U18AMD64/TopotestDetails/ Topotests Ubuntu 18.04 arm8 part 8: No useful log foundTopotests Ubuntu 18.04 i386 part 6: Failed (click for details)Topology Test Results are at https://ci1.netdef.org/browse/FRR-PULLREQ2-TOPO6U18I386-9050/test Topology Tests failed for Topotests Ubuntu 18.04 i386 part 6 Topotests Ubuntu 18.04 i386 part 7: Incomplete(check logs for details)Topotests Ubuntu 18.04 arm8 part 6: Failed (click for details)Topotests Ubuntu 18.04 arm8 part 6: Unknown Log URL: https://ci1.netdef.org/browse/FRR-PULLREQ2-9050/artifact/TOPO6U18ARM8/TopotestDetails/ Topotests Ubuntu 18.04 arm8 part 6: No useful log foundTopotests debian 10 amd64 part 6: Failed (click for details)Topology Test Results are at https://ci1.netdef.org/browse/FRR-PULLREQ2-TOPO6DEB10AMD64-9050/test Topology Tests failed for Topotests debian 10 amd64 part 6 Topotests Ubuntu 18.04 amd64 part 6: Failed (click for details)Topology Test Results are at https://ci1.netdef.org/browse/FRR-PULLREQ2-TOPO6U18AMD64-9050/test Topology Tests failed for Topotests Ubuntu 18.04 amd64 part 6 Topotests debian 10 amd64 part 4: Failed (click for details)Topology Test Results are at https://ci1.netdef.org/browse/FRR-PULLREQ2-TOPO4DEB10AMD64-9050/test Topology Tests failed for Topotests debian 10 amd64 part 4 Topotests debian 10 amd64 part 3: Incomplete(check logs for details)Successful on other platforms/tests
|
I don't think that there's really any value in referring to a draft that expired in ... 2014 or 2015. We use the word "recursive" in most places when we want to refer to nexthop resolution - and it seems like that's what you're attempting to use here - so let's use that keyword for LSPs also, unless there's some compelling reason to introduce a new term. |
I'm all for leveraging the work we're already doing to resolve recursive IP routes. But I think I still don't follow the logic that you're proposing for LSPs. If an mpls frame with a composite label stack arrives at the boundary between the IGP and BGP, what happens, exactly? How does that last IGP hop know what to do with the BGP label advertised to and imposed at the source? |
Continuous Integration Result: FAILEDSee below for issues. This is a comment from an automated CI system. Get source / Pull Request: SuccessfulBuilding Stage: SuccessfulBasic Tests: FailedTopotests debian 10 amd64 part 1: Failed (click for details)Topology Test Results are at https://ci1.netdef.org/browse/FRR-PULLREQ2-TOPO1DEB10AMD64-11210/test Topology Tests failed for Topotests debian 10 amd64 part 1 Successful on other platforms/tests
|
ci:rerun |
1 similar comment
ci:rerun |
Continuous Integration Result: SUCCESSFULCongratulations, this patch passed basic tests Tested-by: NetDEF / OpenSourceRouting.org CI System CI System Testrun URL: https://ci1.netdef.org/browse/FRR-PULLREQ2-11212/ This is a comment from an automated CI system. |
Continuous Integration Result: SUCCESSFULCongratulations, this patch passed basic tests Tested-by: NetDEF / OpenSourceRouting.org CI System CI System Testrun URL: https://ci1.netdef.org/browse/FRR-PULLREQ2-11213/ This is a comment from an automated CI system. |
b628643
to
528d9c3
Compare
Commands added: r3# configure r3(config)# mpls fec MPLS FEC table label Label configuration ldp Label Distribution Protocol lsp Establish label switched path r3(config)# mpls fec mpls fec nexthop-resolution Authorise nexthop resolution over all labeled routes. r3(config)# mpls fec mpls fec nexthop-resolution r3# configure r3(config)# vrf default r3(config-vrf)# mpls fec MPLS FEC table r3(config-vrf)# mpls fec mpls fec nexthop-resolution Authorise nexthop resolution over all labeled routes. r3(config-vrf)# mpls fec nexthop-resolution east-vm# show running-config Building configuration... ... ! mpls fec nexthop-resolution ! ... Signed-off-by: Dmytro Shytyi <dmytro.shytyi@6wind.com>
Upon reconfiguring nexthop-resolution updates, update the lsp entries accordingly. If fec nexthop-resolution becomes true, then call again fec_change_update_lsp() for each fec entry available. If fec nexthop-resolution becomes false, then call again fec_change_update_lsp() for each fec entry available, and if the update fails, uninstall any lsp related with the fec entry. In the case lsp_install() and no lsp entry could be created or updated, then consider this call as a failure, and return -1. Co-developed-by: Dmytro Shytyi <dmytro.shytyi@6wind.com> Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com> Signed-off-by: Dmytro Shytyi <dmytro.shytyi@6wind.com>
This commit addresses an issue that happens when using bgp labeled unicast peering with a rr client, with a received prefix which is the local ip address of the bgp session. When using bgp ipv4 labeled session, the local prefix is received by a peer, and finds out that the proposed prefix and its next-hop are the same. To avoid a route loop locally, no nexthop entry is referenced for that prefix, and the route will not be selected. As it has been done for ipv4-unicast, apply the following fix for labeled address families: when the received peer is a route reflector, the prefix has to be selected, even if the route can not be installed locally. Fixes: f874552 ("bgpd: authorise to select bgp self peer prefix on rr case") Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com> Signed-off-by: Dmytro Shytyi <dmytro.shytyi@6wind.com>
There are two ways of iterating over nexthops of a given route entry. - Either only the main nexthop are taken into account (which is the case today when attempting to install an LSP entry on a BGP connected labeled route. - Or by taking into account nexthops that are resolved and linked in nexthop->resolved of the previous nexthop which has RECURSIVE flag set. This second case has to be taken into account in the case where recursive routes may be used to install an LSP entry. Introduce a new API in nexthop that will parse over the appropriate nexthop, if the nexthop-resolution flag is turned on or not on the given VRF. Use that API in the lsp_install() function so as to walk over the appropriate nexthops. Co-developed-by: Dmytro Shytyi <dmytro.shytyi@6wind.com> Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com> Signed-off-by: Dmytro Shytyi <dmytro.shytyi@6wind.com>
When an LSP entry is created from a FEC entry, multiple labels may now be appended to the LSP entry, instead of one single. Upon lsp creation, the LSP trace will display all the labels appended. Signed-off-by: Dmytro Shytyi <dmytro.shytyi@6wind.com>
Until now, when a FEC entry is added in zebra, driven by the reception of a BGP labeled unicast update, an LSP entry is created. That LSP entry is resolved by using the route entry which is also installed by BGP labeled unicast. This route entry is not available when we face with i-bgp peering session. I-BGP labeled sessions are used to establish IP connectivity across separate IGPs. The below dumps illustrate a 3 IGP topology. An attempt to create connectivity between the north and the south machines is done. The 3 separate IGPs are configured in Segment routing: - north-east - east-west - west-south We create BGP peerings between each endpoint of each IGP: - iBGP between (north) and (east) - iBGP between (east) and (west) - iBGP between (west) and (south) Before that patch, the FEC entries could not be resolved on the east machine: Before: east-vm# show mpls fec 192.0.2.1/32 Label: 18 Client list: bgp(fd 48) 192.0.2.5/32 Label: 17 Client list: bgp(fd 48) 192.0.2.7/32 Label: 19 Client list: bgp(fd 48) east-vm# show mpls table Inbound Label Type Nexthop Outbound Label -------------------------------------------------------- 1011 SR (OSPF) 192.168.2.2 1011 1022 SR (OSPF) 192.168.2.2 implicit-null 11044 SR (IS-IS) 192.168.3.4 implicit-null 11055 SR (IS-IS) 192.168.3.4 11055 30000 SR (OSPF) 192.168.2.2 implicit-null 30001 SR (OSPF) 192.168.2.2 implicit-null 36000 SR (IS-IS) 192.168.3.4 implicit-null east-vm# show ip route [..] B 192.0.2.1/32 [200/0] via 192.0.2.1 inactive, label implicit-null, weight 1, 00:17:45 O>* 192.0.2.1/32 [110/20] via 192.168.2.2, r3-eth0, label 1011, weight 1, 00:17:47 O>* 192.0.2.2/32 [110/10] via 192.168.2.2, r3-eth0, label implicit-null, weight 1, 00:17:47 O 192.0.2.3/32 [110/0] is directly connected, lo, weight 1, 00:17:57 C>* 192.0.2.3/32 is directly connected, lo, 00:18:03 I>* 192.0.2.4/32 [115/20] via 192.168.3.4, r3-eth1, label implicit-null, weight 1, 00:17:59 B 192.0.2.5/32 [200/0] via 192.0.2.5 inactive, label implicit-null, weight 1, 00:17:56 I>* 192.0.2.5/32 [115/30] via 192.168.3.4, r3-eth1, label 11055, weight 1, 00:17:58 B> 192.0.2.7/32 [200/0] via 192.0.2.5 (recursive), label 19, weight 1, 00:17:45 * via 192.168.3.4, r3-eth1, label 11055/19, weight 1, 00:17:45 [..] After command "mpls fec nexthop-resolution" was applied, the FEC entries will resolve over any non BGP route that has a labeled path selected. east-vm# show mpls table Inbound Label Type Nexthop Outbound Label -------------------------------------------------------- 17 SR (IS-IS) 192.168.3.4 11055 18 SR (OSPF) 192.168.2.2 1011 19 BGP 192.168.3.4 11055/19 1011 SR (OSPF) 192.168.2.2 1011 1022 SR (OSPF) 192.168.2.2 implicit-null 11044 SR (IS-IS) 192.168.3.4 implicit-null 11055 SR (IS-IS) 192.168.3.4 11055 30000 SR (OSPF) 192.168.2.2 implicit-null 30001 SR (OSPF) 192.168.2.2 implicit-null 36000 SR (IS-IS) 192.168.3.4 implicit-null Co-developed-by: Dmytro Shytyi <dmytro.shytyi@6wind.com> Signed-off-by: Dmytro Shytyi <dmytro.shytyi@6wind.com> Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Change the comment in the code that refers to ZEBRA_FLAG_XXX defines. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com> Signed-off-by: Dmytro Shytyi <dmytro.shytyi@6wind.com>
Because the nhlfe label stack may contain more than one label, ensure to copy all labels. Co-developed-by: Dmytro Shytyi <dmytro.shytyi@6wind.com> Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com> Signed-off-by: Dmytro Shytyi <dmytro.shytyi@6wind.com>
There are 3 tests with OSPF, IS-IS, BGP and MPLS configured: 1. Check the status of BGP session between North and South == Established 2. Check the connectivity with "ping South -I North" 3. Check the label on the West. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com> Signed-off-by: Dmytro Shytyi <dmytro.shytyi@6wind.com>
FEC nexthop entry resolution over MPLS networks Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com> Signed-off-by: Dmytro Shytyi <dmytro.shytyi@6wind.com>
528d9c3
to
3d17479
Compare
Continuous Integration Result: FAILEDTest incomplete. See below for issues. This is a comment from an automated CI system. Get source / Pull Request: SuccessfulBuilding Stage: SuccessfulBasic Tests: IncompleteAddresssanitizer topotests part 4: Incomplete(check logs for details)Successful on other platforms/tests
|
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
The goal consists in establishing IP connectivity
between two CPEs, where in the middle there are:
a) 3 separate IGPs configured in Segment routing
b) BGP peerings are established between each endpoint of each IGP
This patch allows to create an additional LSP
path forged by labeled iBGP.
There is an issue when creating this additional
LSP path, since the traffic from north to south
is dropped on east, and the traffic from south
to north is dropped on west.
The reason behind this is that labeled iBGP fails
to find a BGP route to install its LSP, because
there is an other IGP LSP.
This patch allows to create an additional LSP
path forged by labeled IBGP. This addition LSP
path will sit on top of an existing LSP path forged by an existing IGP.
Before:
After command "mpls fec recursive-via-nexthop" was applied:
UPDATE:
When a FEC entry is registered, a BGP labeled route may not be
available to create an LSP entry. This is the case when trying
to forge an additional LSP path with BGP, on top of an IGP LSP path.
The following command authorises the creation of an additional
BGP labeled LSP path over an IGP LSP path:
A topology consists of multiple segments:
UPDATE2:
The topology of topotest presented in this pull request is described by this figure:
Commands examples:
"Seamless-resolve" is disabled with command:
and r3 has the next mpls table:
"Seamless-resolve" is enabled with command:
and r3 has the next mpls table: