-
Notifications
You must be signed in to change notification settings - Fork 728
Speed up RTC exchange, exclude non-VPN paths from the RTC scheme #2881
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
base: master
Are you sure you want to change the base?
Conversation
@fujita could you please take a look at it, if it is possible? |
What' VPN GRT? |
I meant global rib tables for VPN families. |
5819e58
to
8127e3a
Compare
@fujita could you take a look at it again, please? |
I made some changes: the approach that distinguished between VPN and non-VPN families was wrong. Now all families are could be use in the RTC scheme. And current PR:
|
1914fde
to
177fee0
Compare
Hello, @fujita , |
1. Add Key(RouteTarget)->uint64. 2. Add map[Key(rt)]map[*Path]{} to globalRib tables for fast making path list by RT. 3. Add map[Key(rt)]int to Adj RTC tables for fast filtering paths by RTs. 4. Add tests on pp.1-3.
Hello, @fujita , When a large number of RTs are loaded into GoBGP, the RTC filter becomes dramatically slow. I measured the performance on two GoBGPs running on the same PC. I loaded paths on one server and RTs on another, then established peering. For example, if we have 10 paths with the same RT:
The performance depends on the average number of paths per RT and the total number of RTs. I modified the filter process to use maps instead of nested loops. Now it works much faster, with O(1) complexity instead of O(nm). We are using this change in our environment and have not encountered any issues in this code so far. |
This is about complexity of RTC.
This PR proposes a new approach that potentially reduces the complexity to O(1) for filtering and retrieving VPN paths, assuming the map container is used effectively. However, this approach requires additional memory. Specifically, for each VPN GRT, it necessitates:
n*L*m*sizeof(*Path) , where L is the average number of extRTs in the Path, m - number of paths, n - number of known RTs +
n*sizeof(RouterID) - to store interested on RT peers +
n*sizeof(uint64) - for indexing RTs
Additionally, for each Adj RF_RTC_UC table, the memory requirement is approximately:
n*(sizeof(uint64)+sizeof(int))