Skip to content

fix(proto): Use approximate comparison for network paths#635

Merged
flub merged 8 commits intomainfrom
flub/log-network-paths
May 5, 2026
Merged

fix(proto): Use approximate comparison for network paths#635
flub merged 8 commits intomainfrom
flub/log-network-paths

Conversation

@flub
Copy link
Copy Markdown
Collaborator

@flub flub commented May 4, 2026

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_path so 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

  • Self-review.

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.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 4, 2026

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

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 4, 2026

Performance Comparison Report

1cbf055c3d81e70d3d3ff9e7172b6f5156855f82 - artifacts

Raw Benchmarks (localhost)

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 flub marked this pull request as draft May 4, 2026 15:45
@n0bot n0bot Bot added this to iroh May 4, 2026
@github-project-automation github-project-automation Bot moved this to 🚑 Needs Triage in iroh May 4, 2026
@flub flub changed the title chore(proto): Log more network paths fix(proto): Update local IP before checking matching network path May 4, 2026
@flub flub marked this pull request as ready for review May 4, 2026 18:38
@flub flub requested a review from dignifiedquire May 4, 2026 18:38
Comment thread noq-proto/src/connection/mod.rs Outdated
flub added 4 commits May 5, 2026 12:03
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
@flub flub changed the title fix(proto): Update local IP before checking matching network path fix(proto): Use probably_same_path for network path comparisons more May 5, 2026
@flub flub changed the title fix(proto): Use probably_same_path for network path comparisons more fix(proto): Use probably_same_path for network path comparisons May 5, 2026
@flub flub changed the title fix(proto): Use probably_same_path for network path comparisons fix(proto): Use approximate comparison for network paths May 5, 2026
@flub flub enabled auto-merge May 5, 2026 10:55
@flub flub added this pull request to the merge queue May 5, 2026
Merged via the queue into main with commit 9e1f1ad May 5, 2026
37 of 38 checks passed
@flub flub deleted the flub/log-network-paths branch May 5, 2026 11:11
@github-project-automation github-project-automation Bot moved this from 🚑 Needs Triage to ✅ Done in iroh May 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

2 participants