-
Notifications
You must be signed in to change notification settings - Fork 86
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
IP-in-IP does not compose with ECMP routes #90
Comments
I’ve spent some time looking at the work that would be needed, and it's quite hard. I think it would be better for us to spend equivalent time and effort on rethinking and eliminating the BIRD code hacks that we’ve made for IP-in-IP, replacing them with
I will record the relevant history, and my analysis, in following comments here. |
I began a discussion on the BIRD ML in 2016, about upstreaming our BIRD patches for IP-in-IP: https://bird.network.cz/pipermail/bird-users/2016-September/010629.html The maintainer (Ondrej)’s response to that was that we should only need to change BIRD to allow setting “onlink” and “iface” from a filter, and then we could achieve everything else we need in config. I now think that is probably true, and the right way to go. In fact, it might only be “onlink” that we need a code change for, because I think there is already a writable “ifname” property that a filter can set. I began the changes, for extending our current hacks for ECMP, as you can see at nelljerram@fdf04ac. However, the thing that is hard, about that, is that we don’t have storage equivalent to orig_gw for the possible paths of an ECMP route. We could probably add that, but it would need understanding when and how the route merging happens in BIRD, and from a quick look that did not seem straightforward. As I researched this, it started looking like we might actually not need orig_gw at all, because that information is probably already available as the BA_NEXT_HOP eattr. That led me down the path of reviewing our overall design here, and of whether we need all our current hacks. |
Here is a review of our current BIRD code changes, and the filter config that we use in conjunction with those:
(Another view of the same thing is at #37 (comment), but I believe the ASCII art above is a better representation of the BIRD internal architecture, and it also shows where the relevant import and export filters are involved.) |
(In addition to the points above where code is actually doing things, there are these infrastructure changes, between upstream and our fork, to facilitate the above:
) |
Other useful input is from the PR at #21. The contributor was proposing to update the iface for a tunnel route in the BIRD routing table, instead of only when exporting it to the local kernel. At the time I favoured a less dramatic change, but I now think the contributor’s approach may have been along better lines. |
Putting all of that together, it now seems to me that - maybe -
Ideally, then, we’d upstream the “onlink” setting capability, and then we’d no longer need our own BIRD fork. However, there are these things I’m not yet sure about, and that need more review or testing:
Finally, after all that, we still need to work out how to do the equivalent of that import filter code for each path of an ECMP route. But I think it would be much easier to ask about that - and to upstream any further code changes that might be needed for it - if we were using the upstream BIRD code. |
The first step of the above plan - removing the orig_gw field and using BA_NEXT_HOP instead - has been done by #75 and projectcalico/node#380. Tigera themselves have no current schedule for pursuing other pieces of the plan above, so contributions would be very welcome. |
Hi team. This message is just to inform you that latest bird release (2.0.12) implemented setting the onlink attribute on routes https://gitlab.nic.cz/labs/bird/-/commit/7144c9ca46f092da33a4e051bbce8f973a3bd8c4 |
Thanks @rcarpa . It would take a bit of work for us to update from our current code based on 1.6.8, but we certainly might do that in future, and it's useful to know that a version of this particular tweak is now upstream. |
I have confirmed that the following version still has the issue.
Is there any version that have fixed this issue? |
@jjqq2013 , you probably miss-understood my comment. It's about vanila upstream bird 2.0.12 supporting a feature which would allow the calico project to switch from their old fork of bird to upstream bird. When this is done, ECMP support should (tm) improve. I think it would even be possible to advertise multiple routes to the same node via bgp add-path and solve the issue of imbalanced traffic to services having externalTrafficPolicy = Local. However, as of today, there was no work done to perform this migration on the calico side. This issue is not fixed yet. Also, I have no links to the calico development team, but I would assume nobody is even working on it yet ;) |
@rcarpa thank you for your explanation. I am new to this project. To be sure that the issue is same, please let me explain the issue I am facing. If it is a different issue, I will create a new ticket. There is a server with has following ip routes, i.e., ECMP
What I expect is the BIRD create ip routes like:
according to actual peer status. However, the actual result is like:
A notable thing is that: if I don't use ECMP, then BIRD works. i.e., if I change the route from
to
then BIRD will produce
PS, the BIRD config actually does not matter that much, because it can produce expected above result when not using ECMP. Just in case, let me paste part of BIRD config:
|
I think the issue I mentioned happens like this:
Am I correct? |
If my thought is correct, I guess I need find where the logic of
It would be greatly appreciated If anyone can point out the location. For now, I am checking Coder' Document such as https://bird.network.cz/?get_doc&v=20&f=prog.html#toc2.2 to understand the source. |
My static analysis shows that BIRD seems can not import following ECMP routes from protocol kernel
There is a also proof from the log:
It happens like this:
The warning happened in Normally BIRD prepare hostentry with
(Another place which set RTD_UNREACHABLE is unrelated, it is in
So, I come up with following workarounds, hope either of them works, the essential idea is to tell BIRD that there is an route to any external routers.
(since Calico-BIRD only produce kernel route entries for those need IPIP tunnel, any router being treated as alive is OK).
|
Fixed this issue in jjqq2013@716e545. I have tested in an actual environment, seems works well. Sorry I don't have much time to create a complete PR. |
I'm working on Kubernetes networking, with calico cni plugin. I want to configure the BGP BIRD that is available in the ProjectCalico repo. But that static routing format that is supported in vanilla BIRD is not supported by Calico BIRD project.
but this doesnt work anymore with calico BIRD I'm expecting the correct format of static routing for the calico bird conf file |
@kavana-14 https://github.com/projectcalico/bird.git is currently still based on BIRD v1.6.8, and the BIRD config format changed between 1.6.x and 2.x. So that explains your observations. I'm not sure it was a very big format change; I think it was mostly adding the
in the BIRD ipv4 config, and
in the BIRD ipv6 config. Longer term, we are working on removing the differences between Calico BIRD and BIRD v1.6.8, and once we have done that it should become much easier for us to update to a current upstream BIRD. |
@nelljerram. With calico-bird we are also observing as below:
Is there a way one address family redistributing routes for both ipv4 and ipv6? |
In current Calico the v4 and v6 BIRD processing are independent of each other.
If you are seeing ipv4 problems, I recommend we focus first on that. What |
@nelljerram. Tried the same thing in Vanilla BIRD, that configuration is working for both ipv4 and ipv6 static routes. output of ip r:
|
Great. So is there a remaining problem at the moment? |
@nelljerram. I think ip r output was from Vanilla BIRD, But while configuring the Calico's BIRD still the IPv6 address is not parsing. Part of the code from cf-lex.l
bird.conf:
output: |
Yes, as the error says, Calico BIRD doesn't support forwarding to an IPv4 prefix via an IPv6 gateway. |
@nelljerram Why don't it support both ipv4 and ipv6 static routes. Why only either ipv4 or ipv6? |
In a dual ToR setup (attempt), with ECMP routes to some node loopback IPs and pod /26 blocks, we tried enabling IP-in-IP (to address a separate bootstrapping issue), and observed that most of the routes did not change to IP-in-IP routes:
In fact, only the non-ECMP routes change to go via the IP-in-IP tunnel device tunl0.
On reviewing the BIRD code, it's clear this is because of lack of support in the BIRD code. There are two places where the code handles EA_KRT_TUNNEL, and in both places the handling is also conditional on RTD_ROUTER - which means "a route with a single path". In both places we would need to add corresponding code for RTD_MULTIPATH.
Does this matter?
Well, it depends if there are any use cases for ECMP routes while IP-in-IP is in use. The dual ToR work unconditionally added "merge paths on" to the BIRD config, which means that any TSEE deployment would program an ECMP route if it received more than one possible path for a given prefix. We should perhaps make that conditional somehow.
The text was updated successfully, but these errors were encountered: