Skip to content

Commit df6c396

Browse files
refactor: Simplify path selection
## Description Fewer special cases in selection of the best path, in preparation to integrating user transports into path selection. This should keep the current logic completey unchanged, but make it easier to add additional paths without a maze of special cases. Implemented rules: - bias for ipv6 (IPV6_RTT_ADVANTAGE) - available (currently ipv4/ipv6) takes precendence over backup (currently relay) - switching between different transports in the same category (available or backup) only happens if the advantage is bigger than RTT_SWITCHING_MIN_IP to avoid toggling The purpose is to be able to integrate user transports more easily. Each user transport id would get a flag if it is considered available or backup (default backup?), and a rtt bias (default 0). Then you would add user transports to the selection process without any special cases. I guess available or backup are not the right categories here. The meaning would be standard (a transport that has a theoretical chance to become *the best* transport) and fallback (a transport of last resort that you want to get rid of asap as soon as you have another option, regardless of rtt). E.g. a BLE transport would always be a fallback transport because available bandwidth is very limited regardless of rtt. ## Breaking Changes None ## Notes & open questions ## Change checklist <!-- Remove any that are not relevant. --> - [ ] Self-review. - [ ] Documentation updates following the [style guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text), if relevant. - [ ] Tests if relevant. - [ ] All breaking changes documented. - [ ] List all breaking changes in the above "Breaking Changes" section. - [ ] Open an issue or PR on any number0 repos that are affected by this breaking change. Give guidance on how the updates should be handled or do the actual updates themselves. The major ones are: - [ ] [`quic-rpc`](https://github.com/n0-computer/quic-rpc) - [ ] [`iroh-gossip`](https://github.com/n0-computer/iroh-gossip) - [ ] [`iroh-blobs`](https://github.com/n0-computer/iroh-blobs) - [ ] [`dumbpipe`](https://github.com/n0-computer/dumbpipe) - [ ] [`sendme`](https://github.com/n0-computer/sendme) --------- Co-authored-by: Friedel Ziegelmayer <me@dignifiedquire.com>
1 parent 1729243 commit df6c396

2 files changed

Lines changed: 233 additions & 132 deletions

File tree

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ updates:
2323
timezone: "America/New_York"
2424
ignore:
2525
- dependency-name: "*"
26-
- update-types: ["version-update:semver-patch"]
26+
update-types: ["version-update:semver-patch"]
2727
- package-ecosystem: docker
2828
directory: docker
2929
schedule:

0 commit comments

Comments
 (0)