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

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.
@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.

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.

1 participant