-
Notifications
You must be signed in to change notification settings - Fork 78
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
feat: prepare data structure to fetch prefix len/net mask from BMP #676
feat: prepare data structure to fetch prefix len/net mask from BMP #676
Conversation
It would need to be configurable for people getting this information from multiple sources (BMP and flow), similar to what is done for the AS number. |
a9b9e24
to
6b31237
Compare
I've implemented an first draft for that option. |
I think 0 is fine to ignore. If the default route matches, it's like we don't really have the prefix length. |
6b31237
to
1a49665
Compare
1a49665
to
d887f35
Compare
Tests are there, should be ready from my side. |
You don't seem to use data from BMP yet? The current changes look good. |
We're currently experimenting with a local bmp setup, which also returns a bmp.LookupResult. |
155cf21
to
17209df
Compare
We've discussed this again, and would prefer if there is a certain way to differ between "we have no route information for this flow" and "this flow was sent out the default route". |
If you have a default route, you'll never get the second case, as the BMP component will fallback to the default route. Testing if != 255 is an additional operation ClickHouse will have to do when working with network prefixes, making it slower. |
The BMP component should either report "no prefix" (=255) in this case, or have an LPM result (once implemented). The LPM result could be an default route, e.g. for non-fulltable installations. |
The BMP component will fallback to any matching prefix, whatever this is the right router or the right nexthop. As soon as you have a default route somewhere, it will be matched. I don't think this is worth adding a second conditional (a test that would run on all rows for everybody). |
I totally understand your point about the performance impact - this sounds like a problem we do not want to create. However, I do not understand the idea behind enriching the flow with any matching data instead of making sure that the "real"/original details are used. I currently do not have any specific implementation in mind, but it seems worthwhile to try and find one solving the correctness issue at hand while minimizing the performance impact. |
Is the correctness issue about unknown prefix length or about BMP falling back to any available route? The later is intentional as it seems better to have an info that is likely to be correct (on the paper, routers in the same AS should share the same routing table) than having the info missing. This could be made configurable. |
I think a config option for this behavior would be useful. Even better would be to store the information about falling back in some kind of "uncertainty flag", I think. This would allow to differentiate between strictly correct and hopefully correct data after the recording. However, I have the impression that this is only related the current MR and does not really solve my concern here. I would rather handle the failing prefix lookup explicitly instead of relying on some other component/behavior to ensure useful data. Do we have any option where we differentiate between lookup failures and falling back to the default values for the data type? |
For this MR, I'd propose to continue as it is now, using 0 (implicit default route) as the default/fallback value. |
No, there is no such mechanism. BGP being a distributed system, strictness seems a goal that wouldn't work anyway. A route may disappear a reappear a few seconds later and only the router would know the exact route used at the moment the flow was generated. The fallback makes it work for most people instead of having an option that makes the setup not work and me handling the support for this. |
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.
Little point in accepting this PR right now: it needs to implement the TODO part.
I have implemented the prefix length/netmask to the BMP component, however, due to the lack of a proper BMP testing setup, this is not fully verified yet. |
Thanks! |
Currently, the NetMask for Source/Destination is not set from the BMP component, but instead directly when parsing the flow.
It might be wanted to set the NetMask as result of the BMP Lookup.
This PR does the following changes: