Skip to content

add fair-routing strategy with SWRR over PBAT-eligible routes - #91

Open
zebastian wants to merge 1 commit into
nasa-jpl:integrationfrom
zebastian:fair-routing
Open

add fair-routing strategy with SWRR over PBAT-eligible routes#91
zebastian wants to merge 1 commit into
nasa-jpl:integrationfrom
zebastian:fair-routing

Conversation

@zebastian

Copy link
Copy Markdown
Contributor

Introduce a CGR route-selection mode that stripes non-critical bundles across all routes whose terminus PBAT is within a configurable window of the best route, weighted by each route's path bottleneck xmitRate via smooth weighted round-robin (SWRR). Default behaviour is unchanged: shortest-pbat is selected at ionInitialize.

Two new ionrc management commands:
m routing-strategy { shortest-pbat | fair-routing }
m allow-routing-delay (default 1000 ms)

Strategy and window are persisted in IonDB and cached in IonVdb; critical-bundle forwarding (loadCriticalBestRoutesList) is unaffected.

CGR changes (libcgr.c):

  • Extract proximate-nodes enumeration into buildProximateNodesList(), shared by critical and fair-routing paths.
  • Add loadFairRoutesList(): one best route per first-hop neighbour, then prune by PBAT <= minPbat + allowDelaySec.
  • Add SWRR table on CgrRtgObject (fairRrEntries, fairRrSetHash, fairRrTotalWeight) plus FairRrEntry. The eligible-set hash (FNV-1a-64 over sorted toFqnn) lets cgr_pick_fair_route reuse currentWeight state across calls and rebuild only when the set changes; detachRoutingObject tears the table down.
  • ipnfw routes non-critical bundles through cgr_pick_fair_route when the strategy is fair and >1 route is eligible.

@zebastian

Copy link
Copy Markdown
Contributor Author

this is WIP.
I still need to finish the test case and also a showcase video of the behaviour.
Also i need to re-check the runtime performance.

Anyway i think this is a good alternative for the shortest-pbat routung strategy.
Let me know what you think.

@zebastian

Copy link
Copy Markdown
Contributor Author

see showcase video link here: https://www.youtube.com/watch?v=5micweulp0s

@zebastian

Copy link
Copy Markdown
Contributor Author

ready for review: see test case and showcase video attached

Introduce a CGR route-selection mode that stripes non-critical bundles
across all routes whose terminus PBAT is within a configurable window
of the best route, weighted by each route's path bottleneck xmitRate
via smooth weighted round-robin (SWRR). Default behaviour is unchanged:
shortest-pbat is selected at ionInitialize.

Two new ionrc management commands:
  m routing-strategy { shortest-pbat | fair-routing }
  m allow-routing-delay <msec>           (default 1000 ms)

Strategy and window are persisted in IonDB and cached in IonVdb;
critical-bundle forwarding (loadCriticalBestRoutesList) is unaffected.

CGR changes (libcgr.c):
- Extract proximate-nodes enumeration into buildProximateNodesList(),
  shared by critical and fair-routing paths.
- Add loadFairRoutesList(): one best route per first-hop neighbour,
  then prune by PBAT <= minPbat + allowDelaySec.
- Add SWRR table on CgrRtgObject (fairRrEntries, fairRrSetHash,
  fairRrTotalWeight) plus FairRrEntry. The eligible-set hash
  (FNV-1a-64 over sorted toFqnn) lets cgr_pick_fair_route reuse
  currentWeight state across calls and rebuild only when the set
  changes; detachRoutingObject tears the table down.
- ipnfw routes non-critical bundles through cgr_pick_fair_route
  when the strategy is fair and >1 route is eligible.

Add the fair-routing-stripe test: it exercises the strategy over a
6-node LTP topology with two nested, unevenly weighted split points,
sends 24 non-critical bundles from N1 to N4, and asserts the exact
per-node forwarded counts (N2=6, N3=18, N5=2, N6=4) and that all 24
are delivered.

The routing-object lists follow the #1048 hardening convention and are
created with sm_list_create_unlocked, so no per-list semaphore is
allocated for the SWRR table.
@iondev33

Copy link
Copy Markdown
Collaborator

@zebastian Thank you for this submission.

The best approach forward for ION here to instead of incorporating your change into the core of CGR, which is CCSDS SABR standard, we can setup a policy routing API and use your update as a "plug-in" demonstration of enhancement/updates that goes beyond the specification.

We've had discussion of setting up routing policy plug-in for a while and it's probably time to get it done. We have planned to look into that for 4.2.1 (this Fall/Winter) so please check back in with us on that.

@iondev33 iondev33 self-assigned this Jul 29, 2026
@iondev33 iondev33 added the enhancement New feature or request label Jul 29, 2026
@iondev33 iondev33 added this to the ION 4.2.1 milestone Jul 29, 2026
@zebastian

Copy link
Copy Markdown
Contributor Author

@iondev33 you mean to generalize a possible routing backend as a binary application with a fixed api,
eg cgrrouteswrr implementing a contract of a general routing backend, which can then be used as eg:

ionrc
...
m routing-backend cgrrouteswrr
...
?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants