Skip to content

test(proto): Implement bandwidth-limited routing#720

Open
matheus23 wants to merge 5 commits into
mainfrom
matheus23/throughput-testing
Open

test(proto): Implement bandwidth-limited routing#720
matheus23 wants to merge 5 commits into
mainfrom
matheus23/throughput-testing

Conversation

@matheus23

@matheus23 matheus23 commented Jun 23, 2026

Copy link
Copy Markdown
Member

Description

  • Refactors the RoutingDecision::Deliver case to give it a recv_time: Instant field. This allows Routing to decide when to deliver packets.
  • Adds a BwLimitedRouting routing implementation that implements a queue that delays packets the more packets are queued and tail-drops packets at a certain max queue length.
  • Adds a throughput test as a quick way of testing noq-proto and its congestion control against BwLimitedRouting.

Breaking Changes

None. Test changes only.

Notes & open questions

Started this work because it might be really useful in catching regressions in congestion control, and to prepare work for when we send on multiple paths simultaneously.

Still draft because this needs a little more work in the test itself (it doesn't actually assert anything yet).

But we can now generate neat pictures from noq-proto itself!
image

The qlog file for this is generated in 0.2 seconds on my machine, even though it is a simulated 10MB transfer over a 1MB/s connection, so this simulates ~10s of actual time.
The other neat thing about it is that it is fairly deterministic. There's still some sources of randomness in noq, but all of the "measured" transfer speeds fall into a 1% range.

Change checklist

  • Self-review.
  • Documentation updates following the style guide, if relevant.
  • Tests if relevant.
  • All breaking changes documented.

@matheus23 matheus23 self-assigned this Jun 23, 2026
@github-actions

github-actions Bot commented Jun 23, 2026

Copy link
Copy Markdown

Documentation for this PR has been generated and is available at: https://n0-computer.github.io/noq/pr/720/docs/noq/

Last updated: 2026-06-26T17:21:25Z

@github-actions

github-actions Bot commented Jun 23, 2026

Copy link
Copy Markdown

Performance Comparison Report

796d86b12e6a3fb99971fa3de246a15dd55fbbd1 - artifacts

Raw Benchmarks (localhost)

Scenario noq upstream Delta CPU (avg/max)
large-single 5587.6 Mbps 7896.7 Mbps -29.2% 95.8% / 100.0%
medium-concurrent 5418.7 Mbps 7983.6 Mbps -32.1% 94.8% / 99.5%
medium-single 3991.1 Mbps 4615.6 Mbps -13.5% 98.1% / 151.0%
small-concurrent 3954.0 Mbps 5292.2 Mbps -25.3% 93.3% / 102.0%
small-single 3600.8 Mbps 4674.9 Mbps -23.0% 93.7% / 102.0%

Netsim Benchmarks (network simulation)

Condition noq upstream Delta
ideal N/A 4022.5 Mbps N/A
lan N/A 810.4 Mbps N/A
wan N/A 83.8 Mbps N/A

Summary

noq is 26.0% slower on average

---
0c79f22c7b2a70f628e475829b347a670890bcb6 - artifacts

Raw Benchmarks (localhost)

Scenario noq upstream Delta CPU (avg/max)
large-single 5450.5 Mbps 7744.4 Mbps -29.6% 94.0% / 99.0%
medium-concurrent 5256.1 Mbps 7767.4 Mbps -32.3% 94.2% / 99.0%
medium-single 3800.0 Mbps 4748.9 Mbps -20.0% 93.9% / 100.0%
small-concurrent 3835.1 Mbps 5358.7 Mbps -28.4% 90.8% / 99.1%
small-single 3516.7 Mbps 4798.9 Mbps -26.7% 89.3% / 97.2%

Netsim Benchmarks (network simulation)

Condition noq upstream Delta
ideal 3086.8 Mbps 4092.4 Mbps -24.6%
lan 782.4 Mbps 810.4 Mbps -3.5%
lossy 69.8 Mbps 69.8 Mbps ~0%
wan 83.8 Mbps 83.8 Mbps ~0%

Summary

noq is 27.0% slower on average

---
9cedbd99a9c48819bd910f8618c569c92465a93f - artifacts

Raw Benchmarks (localhost)

Scenario noq upstream Delta CPU (avg/max)
large-single 5450.8 Mbps 8057.1 Mbps -32.3% 96.7% / 98.2%
medium-concurrent 5469.7 Mbps 7652.7 Mbps -28.5% 96.7% / 98.0%
medium-single 4089.4 Mbps 4563.3 Mbps -10.4% 95.9% / 98.3%
small-concurrent 3791.2 Mbps 5214.6 Mbps -27.3% 97.7% / 100.0%
small-single 3551.4 Mbps 4622.5 Mbps -23.2% 96.0% / 98.3%

Netsim Benchmarks (network simulation)

Condition noq upstream Delta
ideal 3030.9 Mbps 4064.0 Mbps -25.4%
lan 782.4 Mbps 803.1 Mbps -2.6%
lossy 69.8 Mbps 69.8 Mbps ~0%
wan 83.8 Mbps 83.8 Mbps ~0%

Summary

noq is 25.1% slower on average

@n0bot n0bot Bot added this to iroh Jun 23, 2026
@github-project-automation github-project-automation Bot moved this to 🚑 Needs Triage in iroh Jun 23, 2026
Comment thread noq-proto/src/tests/multipath.rs
Comment thread noq-proto/src/tests/util.rs
Comment thread noq-proto/src/tests/util.rs
@matheus23 matheus23 force-pushed the matheus23/throughput-testing branch from 0c79f22 to 9cedbd9 Compare June 26, 2026 17:18
@matheus23 matheus23 marked this pull request as ready for review June 26, 2026 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🚑 Needs Triage

Development

Successfully merging this pull request may close these issues.

2 participants