fix(proto): Use approximate comparison for network paths#635
Merged
Conversation
This logs the network path of newly accepted connections and when a packet is discarded because it is from the wrong network path. This helps with figuring out why things are wrong.
|
Documentation for this PR has been generated and is available at: https://n0-computer.github.io/noq/pr/635/docs/noq/ Last updated: 2026-05-05T10:58:55Z |
Performance Comparison Report
|
| Scenario | noq | upstream | Delta | CPU (avg/max) |
|---|---|---|---|---|
| large-single | 5651.3 Mbps | 7998.6 Mbps | -29.3% | 96.3% / 149.0% |
| medium-concurrent | 5504.5 Mbps | 7996.7 Mbps | -31.2% | 96.5% / 148.0% |
| medium-single | 3790.0 Mbps | 4749.6 Mbps | -20.2% | 90.0% / 98.0% |
| small-concurrent | 3869.2 Mbps | 5450.2 Mbps | -29.0% | 93.8% / 101.0% |
| small-single | 3518.5 Mbps | 4834.0 Mbps | -27.2% | 95.9% / 152.0% |
Netsim Benchmarks (network simulation)
| Condition | noq | upstream | Delta |
|---|---|---|---|
| ideal | 3086.5 Mbps | 4061.7 Mbps | -24.0% |
| lan | 796.4 Mbps | 810.3 Mbps | -1.7% |
| lossy | 69.9 Mbps | 55.9 Mbps | +25.0% |
| wan | 83.8 Mbps | 83.8 Mbps | ~0% |
Summary
noq is 26.8% slower on average
91def2afd949d0fa92ed83a61c3927701bc20a89 - artifacts
Raw Benchmarks (localhost)
| Scenario | noq | upstream | Delta | CPU (avg/max) |
|---|---|---|---|---|
| large-single | 5902.4 Mbps | 7856.2 Mbps | -24.9% | 97.6% / 98.9% |
| medium-concurrent | 5506.4 Mbps | 7657.1 Mbps | -28.1% | 96.5% / 98.0% |
| medium-single | 3876.0 Mbps | 4749.2 Mbps | -18.4% | 95.7% / 98.1% |
| small-concurrent | 3877.4 Mbps | 5476.7 Mbps | -29.2% | 97.7% / 99.8% |
| small-single | 3601.5 Mbps | 4852.7 Mbps | -25.8% | 97.0% / 98.9% |
Netsim Benchmarks (network simulation)
| Condition | noq | upstream | Delta |
|---|---|---|---|
| ideal | 3072.6 Mbps | 4138.3 Mbps | -25.8% |
| lan | 782.4 Mbps | 810.4 Mbps | -3.4% |
| lossy | 69.8 Mbps | 69.8 Mbps | ~0% |
| wan | 83.8 Mbps | 83.8 Mbps | ~0% |
Summary
noq is 25.0% slower on average
546615756d5b791b73c0bde861d27b29a572d561 - artifacts
Raw Benchmarks (localhost)
| Scenario | noq | upstream | Delta | CPU (avg/max) |
|---|---|---|---|---|
| large-single | 5800.4 Mbps | 7880.4 Mbps | -26.4% | 98.1% / 99.3% |
| medium-concurrent | 5468.0 Mbps | 7777.3 Mbps | -29.7% | 96.5% / 98.3% |
| medium-single | 4079.6 Mbps | 4749.6 Mbps | -14.1% | 96.8% / 98.8% |
| small-concurrent | 3884.9 Mbps | 5345.5 Mbps | -27.3% | 97.2% / 99.6% |
| small-single | 3589.7 Mbps | 4868.5 Mbps | -26.3% | 96.3% / 98.6% |
Netsim Benchmarks (network simulation)
| Condition | noq | upstream | Delta |
|---|---|---|---|
| ideal | 3086.9 Mbps | 4118.2 Mbps | -25.0% |
| lan | 782.4 Mbps | 810.4 Mbps | -3.4% |
| lossy | 55.9 Mbps | 55.9 Mbps | ~0% |
| wan | 83.8 Mbps | 83.8 Mbps | ~0% |
Summary
noq is 24.8% slower on average
cf9b826161d5d238aaa1de6d9d140b4d4e9373f7 - artifacts
No results available
0b4c02bc026947c782686c4f6f34540458f8b02c - artifacts
Raw Benchmarks (localhost)
| Scenario | noq | upstream | Delta | CPU (avg/max) |
|---|---|---|---|---|
| large-single | 5376.5 Mbps | 7982.5 Mbps | -32.6% | 95.0% / 99.0% |
| medium-concurrent | 5483.7 Mbps | 7760.7 Mbps | -29.3% | 94.5% / 98.8% |
| medium-single | 3827.9 Mbps | 4749.7 Mbps | -19.4% | 97.6% / 148.0% |
| small-concurrent | 3732.7 Mbps | 5232.7 Mbps | -28.7% | 90.7% / 98.8% |
| small-single | 3461.2 Mbps | 4811.1 Mbps | -28.1% | 93.9% / 102.0% |
Netsim Benchmarks (network simulation)
| Condition | noq | upstream | Delta |
|---|---|---|---|
| ideal | 3170.3 Mbps | 4070.5 Mbps | -22.1% |
| lan | 782.5 Mbps | 824.3 Mbps | -5.1% |
| lossy | 69.8 Mbps | 55.9 Mbps | +25.0% |
| wan | 83.8 Mbps | 83.8 Mbps | ~0% |
Summary
noq is 26.9% slower on average
11662db79877ae7d7b6352d3ec1c6d7ccda61e08 - artifacts
Raw Benchmarks (localhost)
| Scenario | noq | upstream | Delta | CPU (avg/max) |
|---|---|---|---|---|
| large-single | 5279.8 Mbps | 7955.1 Mbps | -33.6% | 96.6% / 98.1% |
| medium-concurrent | 5664.9 Mbps | 7751.4 Mbps | -26.9% | 96.4% / 97.9% |
| medium-single | 4158.5 Mbps | 4717.4 Mbps | -11.8% | 96.1% / 98.1% |
| small-concurrent | 3816.6 Mbps | 5367.1 Mbps | -28.9% | 97.7% / 99.6% |
| small-single | 3522.8 Mbps | 4713.4 Mbps | -25.3% | 96.2% / 98.4% |
Netsim Benchmarks (network simulation)
| Condition | noq | upstream | Delta |
|---|---|---|---|
| ideal | 3114.4 Mbps | 3869.2 Mbps | -19.5% |
| lan | 782.4 Mbps | 806.4 Mbps | -3.0% |
| lossy | 69.8 Mbps | 61.1 Mbps | +14.3% |
| wan | 83.8 Mbps | 83.8 Mbps | ~0% |
Summary
noq is 25.0% slower on average
flub
commented
May 5, 2026
Because we only update the PathData::network_path after the frames have been processed we need to hunt down all the places where we check for this condition it seems. Which makes sense.
Also use better variable name conventions
dignifiedquire
approved these changes
May 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
When the local IP is not yet set on a network path we need to do our network path comparisons with
is_probably_same_pathso that we accept this difference. We can not accept the local_ip earlier because for probing packets it should not be set. This requires a few fixed in various places where network paths are compared.Additionally when doing these network path changes we are not allowed to depend on the PathData existing, it only gets created later for new paths.
Breaking Changes
n/a
Notes & open questions
Testing this is difficult, it relies on the strange way that transports are setup in iroh. Which is not even a notion that noq has at this time. I'll think about it but not sure I can come up with a test. I've created #637 to follow up on this.
Change checklist