perf(proto): investigate opt-in first-flight controls for large handshakes

Open
#806 5 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Active
Tech stack
rust

Research direction

Start with experiments/noq-first-flight for the reproduction commands, trace-level log, prototype patch, and comparison report. Read the linked traces and burst-sweep results to understand the amplification and pacing behavior. Done means assessing whether opt-in Initial-flight sizing and bounded Handshake pacing credits fit noq, while defaults and existing amplification, congestion, and send-rate checks remain unchanged.

Written by the indexing model from the issue text.

Description

ML-DSA-65 raw-public-key authentication produces much larger TLS flights than Ed25519 in https://github.com/n0-computer/iroh/pull/4534. At 100 ms RTT without loss, mutual authentication takes about 288 ms versus 152 ms in untraced runs.

Full trace-level log: both endpoints, Ed25519 followed by ML-DSA-65. This log uses unmodified noq/noq-proto 1.3.0; tracing adds a little overhead. Source and reproduction commands.

In the PQ handshake:

  • The server queues 5,556 Handshake CRYPTO bytes, versus 392 for Ed25519 (line 293). Its first packets are paced about 27 ms apart, then it blocks on the amplification limit (line 348). The returning client ACK allows it to finish the flight.
  • The client subsequently queues 5,356 Handshake CRYPTO bytes, versus 181, spread across another ~28 ms (line 433).

An external prototype tests two opt-in changes: one additional 1,200-byte padded client Initial to supply server send allowance, and finite extra Handshake pacing credits. Amplification, congestion and explicit send-rate checks remain in place. Together these reduce the clean-link PQ median to about 152 ms, but short queues can make bursts slower than the control.

Would configurable Initial-flight size and bounded Handshake pacing credits fit noq, or would you approach this differently? Defaults would stay unchanged. Prototype/test diff and comparison results are available for review; real-network follow-up timings are exploratory because other host work overlapped.

Related: #66, #507. Investigation and preparation used AI assistance.

Dominant language
Rust
Stars
454
Forks
98
Avg merge
2d 8h
Merged PRs (30d)
19

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from n0-computer/noq

All issues in n0-computer/noq

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.