Skip to content

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

Description

@domenkozar

ML-DSA-65 raw-public-key authentication produces much larger TLS flights than Ed25519 in n0-computer/iroh#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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    • Status
      🚑 Needs Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions