Skip to content

feat: implement MASQUE connect-udp #2796

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 18 commits into
base: main
Choose a base branch
from
Draft

Conversation

mxinden
Copy link
Member

@mxinden mxinden commented Jul 17, 2025

Implements RFC 9298.


cd masque-go
go run ./cmd/proxy/main.go -t "https://127.0.0.1/masque?h={target_host}&p={target_port}" -b "127.0.0.1:4433" -k key.pem -c cert.pem
cargo run --bin neqo-server -- 'localhost:12345' --db ./test-fixture/db
cargo run --bin neqo-client -- --stats --output-read-data --proxy "https://127.0.0.1:4433/masque?h=127.0.0.1&p=12345" "https://127.0.0.1:12345/42"

@mxinden mxinden force-pushed the connect-udp branch 2 times, most recently from 6ca95fe to 4893499 Compare July 20, 2025 18:46
Copy link

github-actions bot commented Jul 20, 2025

Client/server transfer results

Performance differences relative to 02b78b8.

Transfer of 33554432 bytes over loopback, min. 100 runs. All unit-less numbers are in milliseconds.

Client vs. server (params) Mean ± σ Min Max MiB/s ± σ Δ main Δ main
google vs. google 451.8 ± 3.8 445.9 462.7 70.8 ± 8.4
google vs. neqo (cubic, paced) 272.3 ± 3.9 264.9 287.3 117.5 ± 8.2 0.4 0.1%
msquic vs. msquic 126.2 ± 14.4 110.6 214.6 253.5 ± 2.2
msquic vs. neqo (cubic, paced) 142.9 ± 13.7 125.0 212.0 223.9 ± 2.3 -7.4 -4.9%
neqo vs. google (cubic, paced) 753.6 ± 4.6 722.4 763.6 42.5 ± 7.0 💚 -2.0 -0.3%
neqo vs. msquic (cubic, paced) 155.9 ± 4.4 148.5 173.0 205.3 ± 7.3 -0.8 -0.5%
neqo vs. neqo (cubic) 90.4 ± 6.1 80.7 127.5 353.9 ± 5.2 💚 -2.8 -3.0%
neqo vs. neqo (cubic, paced) 89.6 ± 4.1 83.9 104.8 357.1 ± 7.8 💚 -4.9 -5.2%
neqo vs. neqo (reno) 91.0 ± 4.5 80.6 98.6 351.7 ± 7.1 -0.2 -0.3%
neqo vs. neqo (reno, paced) 91.0 ± 4.6 81.8 102.4 351.7 ± 7.0 💚 -3.3 -3.5%
neqo vs. quiche (cubic, paced) 192.4 ± 4.6 186.7 213.1 166.3 ± 7.0 💚 -1.2 -0.6%
neqo vs. s2n (cubic, paced) 222.8 ± 4.7 213.4 232.6 143.6 ± 6.8 1.0 0.5%
quiche vs. neqo (cubic, paced) 156.8 ± 4.5 147.4 182.2 204.0 ± 7.1 💔 5.5 3.6%
quiche vs. quiche 143.0 ± 3.9 136.4 153.6 223.7 ± 8.2
s2n vs. neqo (cubic, paced) 171.0 ± 4.9 161.0 182.1 187.1 ± 6.5 💔 1.8 1.1%
s2n vs. s2n 251.1 ± 35.0 231.9 423.7 127.4 ± 0.9

Download data for profiler.firefox.com or download performance comparison data.

@mxinden mxinden force-pushed the connect-udp branch 3 times, most recently from 843c209 to b9aa6f2 Compare July 21, 2025 16:34
}

#[derive(Debug)]
pub struct ConnectUdpSession {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider naming this:

Suggested change
pub struct ConnectUdpSession {
pub struct Session {

impl Display for WebTransportRequest {
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
write!(f, "WebTransport session {}", self.stream_handler)
}
}

impl Display for ConnectUdpRequest {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ordering is a bit odd here. Either all types first, then all implementations; or, all definitions for the same type together.

anti_replay, fixture_init, now, CountingConnectionIdGenerator, DEFAULT_ADDR, DEFAULT_ALPN_H3,
DEFAULT_KEYS, DEFAULT_SERVER_NAME,
};
#[test]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#[test]
#[test]

echo.py Outdated
import socket

HOST = '127.0.0.1' # Listen on all interfaces
PORT = 12345 # Arbitrary non-privileged port
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using process.argv[] for these. I'd want tests that include IPv6 as well.

Copy link

github-actions bot commented Aug 4, 2025

Benchmark results

Performance differences relative to 02b78b8.

1-conn/1-100mb-resp/mtu-1504 (aka. Download)/client: No change in performance detected.
       time:   [205.21 ms 205.57 ms 205.97 ms]
       thrpt:  [485.51 MiB/s 486.46 MiB/s 487.31 MiB/s]
change:
       time:   [−0.0151% +0.2522% +0.5275%] (p = 0.07 > 0.05)
       thrpt:  [−0.5248% −0.2516% +0.0152%]

Found 3 outliers among 100 measurements (3.00%)
1 (1.00%) high mild
2 (2.00%) high severe

1-conn/10_000-parallel-1b-resp/mtu-1504 (aka. RPS)/client: 💚 Performance has improved.
       time:   [295.05 ms 296.60 ms 298.13 ms]
       thrpt:  [33.542 Kelem/s 33.715 Kelem/s 33.893 Kelem/s]
change:
       time:   [−6.4650% −5.8618% −5.2441%] (p = 0.00 < 0.05)
       thrpt:  [+5.5344% +6.2268% +6.9119%]

Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) low mild

1-conn/1-1b-resp/mtu-1504 (aka. HPS)/client: No change in performance detected.
       time:   [28.293 ms 28.391 ms 28.504 ms]
       thrpt:  [35.083   B/s 35.222   B/s 35.344   B/s]
change:
       time:   [−0.5704% +0.0527% +0.6468%] (p = 0.87 > 0.05)
       thrpt:  [−0.6426% −0.0527% +0.5737%]

Found 7 outliers among 100 measurements (7.00%)
3 (3.00%) low mild
4 (4.00%) high severe

1-conn/1-100mb-req/mtu-1504 (aka. Upload)/client: Change within noise threshold.
       time:   [203.98 ms 204.28 ms 204.64 ms]
       thrpt:  [488.67 MiB/s 489.52 MiB/s 490.24 MiB/s]
change:
       time:   [−0.9912% −0.7714% −0.5518%] (p = 0.00 < 0.05)
       thrpt:  [+0.5548% +0.7774% +1.0012%]

Found 2 outliers among 100 measurements (2.00%)
1 (1.00%) high mild
1 (1.00%) high severe

decode 4096 bytes, mask ff: No change in performance detected.
       time:   [11.609 µs 11.651 µs 11.699 µs]
       change: [−0.6540% −0.2229% +0.1765%] (p = 0.30 > 0.05)

Found 16 outliers among 100 measurements (16.00%)
4 (4.00%) low severe
2 (2.00%) low mild
2 (2.00%) high mild
8 (8.00%) high severe

decode 1048576 bytes, mask ff: No change in performance detected.
       time:   [3.0615 ms 3.0710 ms 3.0822 ms]
       change: [−0.4843% −0.0037% +0.4757%] (p = 0.97 > 0.05)

Found 9 outliers among 100 measurements (9.00%)
9 (9.00%) high severe

decode 4096 bytes, mask 7f: No change in performance detected.
       time:   [19.430 µs 19.489 µs 19.549 µs]
       change: [−0.6347% +0.2698% +1.3559%] (p = 0.61 > 0.05)

Found 24 outliers among 100 measurements (24.00%)
1 (1.00%) low severe
2 (2.00%) low mild
21 (21.00%) high severe

decode 1048576 bytes, mask 7f: No change in performance detected.
       time:   [5.0819 ms 5.0933 ms 5.1064 ms]
       change: [−0.3588% +0.0043% +0.3569%] (p = 0.97 > 0.05)

Found 14 outliers among 100 measurements (14.00%)
1 (1.00%) low mild
13 (13.00%) high severe

decode 4096 bytes, mask 3f: No change in performance detected.
       time:   [5.5303 µs 5.5597 µs 5.5946 µs]
       change: [−1.1663% −0.0402% +0.7540%] (p = 0.95 > 0.05)

Found 6 outliers among 100 measurements (6.00%)
6 (6.00%) high severe

decode 1048576 bytes, mask 3f: No change in performance detected.
       time:   [1.7647 ms 1.7731 ms 1.7829 ms]
       change: [−0.8530% +0.3136% +1.2647%] (p = 0.60 > 0.05)

Found 10 outliers among 100 measurements (10.00%)
10 (10.00%) high severe

coalesce_acked_from_zero 1+1 entries: No change in performance detected.
       time:   [88.266 ns 88.591 ns 88.936 ns]
       change: [−0.5985% −0.0326% +0.5125%] (p = 0.91 > 0.05)

Found 13 outliers among 100 measurements (13.00%)
10 (10.00%) high mild
3 (3.00%) high severe

coalesce_acked_from_zero 3+1 entries: No change in performance detected.
       time:   [105.97 ns 106.28 ns 106.61 ns]
       change: [−0.6725% −0.2197% +0.2307%] (p = 0.34 > 0.05)

Found 9 outliers among 100 measurements (9.00%)
9 (9.00%) high severe

coalesce_acked_from_zero 10+1 entries: No change in performance detected.
       time:   [105.34 ns 105.61 ns 105.97 ns]
       change: [−0.3004% +0.1562% +0.6655%] (p = 0.55 > 0.05)

Found 17 outliers among 100 measurements (17.00%)
4 (4.00%) low severe
1 (1.00%) low mild
4 (4.00%) high mild
8 (8.00%) high severe

coalesce_acked_from_zero 1000+1 entries: No change in performance detected.
       time:   [88.876 ns 93.003 ns 102.15 ns]
       change: [−1.2861% +1.7016% +6.6204%] (p = 0.61 > 0.05)

Found 11 outliers among 100 measurements (11.00%)
5 (5.00%) high mild
6 (6.00%) high severe

RxStreamOrderer::inbound_frame(): Change within noise threshold.
       time:   [107.95 ms 108.02 ms 108.09 ms]
       change: [+0.1497% +0.4002% +0.5687%] (p = 0.00 < 0.05)

Found 11 outliers among 100 measurements (11.00%)
9 (9.00%) low mild
1 (1.00%) high mild
1 (1.00%) high severe

sent::Packets::take_ranges: :green_heart: Performance has improved.
       time:   [5.0879 µs 5.1546 µs 5.2115 µs]
       change: [−41.678% −35.644% −21.268%] (p = 0.00 < 0.05)

Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) high severe

transfer/pacing-false/varying-seeds: Change within noise threshold.
       time:   [36.622 ms 36.710 ms 36.804 ms]
       change: [+0.2906% +0.6217% +0.9602%] (p = 0.00 < 0.05)

Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) high severe

transfer/pacing-true/varying-seeds: Change within noise threshold.
       time:   [37.613 ms 37.711 ms 37.811 ms]
       change: [+0.4973% +0.9030% +1.2941%] (p = 0.00 < 0.05)

Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) high mild

transfer/pacing-false/same-seed: Change within noise threshold.
       time:   [36.499 ms 36.556 ms 36.614 ms]
       change: [+0.2462% +0.5364% +0.8033%] (p = 0.00 < 0.05)

Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) high mild

transfer/pacing-true/same-seed: No change in performance detected.
       time:   [37.990 ms 38.080 ms 38.182 ms]
       change: [−0.4986% −0.1967% +0.1292%] (p = 0.24 > 0.05)

Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) high severe

Download data for profiler.firefox.com or download performance comparison data.

@mxinden mxinden force-pushed the connect-udp branch 2 times, most recently from 0a016ff to 98ab4fb Compare August 8, 2025 11:01
Copy link

github-actions bot commented Aug 8, 2025

Failed Interop Tests

QUIC Interop Runner, client vs. server, differences relative to c535de9.

neqo-latest as client

neqo-latest as server

All results

Succeeded Interop Tests

QUIC Interop Runner, client vs. server

neqo-latest as client

neqo-latest as server

Unsupported Interop Tests

QUIC Interop Runner, client vs. server

neqo-latest as client

neqo-latest as server

Copy link

codecov bot commented Aug 11, 2025

Codecov Report

❌ Patch coverage is 81.23810% with 197 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.05%. Comparing base (02b78b8) to head (5a68477).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2796      +/-   ##
==========================================
- Coverage   95.49%   93.05%   -2.44%     
==========================================
  Files         115      117       +2     
  Lines       34439    35052     +613     
  Branches    34439    35052     +613     
==========================================
- Hits        32887    32618     -269     
- Misses       1545     1608      +63     
- Partials        7      826     +819     
Components Coverage Δ
neqo-common 96.49% <46.66%> (-1.35%) ⬇️
neqo-crypto 82.91% <ø> (-6.87%) ⬇️
neqo-http3 92.32% <81.73%> (-2.10%) ⬇️
neqo-qpack 93.82% <ø> (-2.09%) ⬇️
neqo-transport 94.40% <ø> (-2.16%) ⬇️
neqo-udp 80.39% <ø> (-10.79%) ⬇️

@larseggert
Copy link
Collaborator

Should we have some MASQUE bench?

@mxinden
Copy link
Member Author

mxinden commented Aug 11, 2025

Yes. I have a work-in-progress MASQUE proxy server implementation here. Adding a benchmark similar to the Download benchmark will thus be doable.

mxinden added a commit to mxinden/neqo that referenced this pull request Aug 15, 2025
Also to stay consistent with upcoming MASQUE connect-udp implementation.
See Martin's comment in
mozilla#2796 (comment).
mxinden added a commit to mxinden/neqo that referenced this pull request Aug 23, 2025
mxinden added a commit to mxinden/neqo that referenced this pull request Aug 23, 2025
mxinden added a commit to mxinden/neqo that referenced this pull request Aug 23, 2025
mxinden added a commit to mxinden/neqo that referenced this pull request Aug 24, 2025
mxinden added a commit to mxinden/neqo that referenced this pull request Aug 24, 2025
mxinden added a commit to mxinden/neqo that referenced this pull request Aug 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants