Commit df6c396
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
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
0 commit comments