Skip to content
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

Speed up RTC exchange, exclude non-VPN paths from the RTC scheme #2881

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bor1go
Copy link

@bor1go bor1go commented Feb 18, 2025

  1. Add Key(RouteTarget)->uint64.
  2. Add map[Key(rt)]map[*Path]{} to globalRib VPN 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.
  5. Non-VPN paths must not depend on RTC.

This is about complexity of RTC.

  1. Currently, filtering a single VPN path before sending requires O(n) operations, where n is the number of RTs in the RF_RTC_UC table. Constructing a list of VPNs takes O(nm) operations, where m is the number of VPN paths (filterpath).
  2. When a new RT is received, filtering VPNs to respond (propagateUpdate) requires O(m) operations.

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))

@bor1go
Copy link
Author

bor1go commented Feb 21, 2025

@fujita could you please take a look at it, if it is possible?
I attempted to optimize the RTC by reducing linear and quadratic complexity for large numbers of paths.

@fujita
Copy link
Member

fujita commented Feb 24, 2025

Specifically, for each VPN GRT, it necessitates

What' VPN GRT?

@bor1go
Copy link
Author

bor1go commented Feb 24, 2025

What' VPN GRT?

I meant global rib tables for VPN families.

@bor1go bor1go force-pushed the rtc-fork branch 3 times, most recently from 5819e58 to 8127e3a Compare February 24, 2025 15:05
@bor1go
Copy link
Author

bor1go commented Mar 6, 2025

@fujita could you take a look at it again, please?
This approach could be helpful with big numbers of routes and route targets.

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.
@bor1go
Copy link
Author

bor1go commented Mar 31, 2025

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:

  1. Adds Key(RouteTarget)->uint64.
  2. Adds map[Key(rt)]map[*Path]{} to globalRib tables for fast making path list by RT.
  3. Adds map[Key(rt)]int to Adj RTC tables for fast filtering paths by RTs.
  4. Adds tests on pp.1-3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants