Skip to content

Transport: count datagrams actually sent per session - #4030

Open
jesup wants to merge 1 commit into
users/jesup/expose_watermark_max_agefrom
users/jesup/datagram_counting
Open

jesup wants to merge 1 commit into
users/jesup/expose_watermark_max_agefrom
users/jesup/datagram_counting

Conversation

@jesup

@jesup jesup commented Sep 30, 2026

Copy link
Copy Markdown
Member

No description provided.

@jesup

jesup commented Sep 30, 2026 •

Copy link
Copy Markdown
Member Author

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The accounting paths, reset semantics, teardown behavior, and relevant edge cases are consistently implemented and tested.

Review effort: Balanced
Findings: None

What changed in this PR

Adds per-session accounting for QUIC datagrams written into packets or rejected by path-MTU limits.

Changes:

  • Tracks sent and too-big datagram counts per session.
  • Preserves pending counts when removing session queues.
  • Adds transport-level coverage for counting and reset behavior.
File Description
neqo-transport/​src/​quic_datagrams.rs Classifies dequeued datagrams and exposes counters.
neqo-transport/​src/​lib.rs Re-exports the removal summary type.
neqo-transport/​src/​datagram_queue.rs Stores counters and defines DroppedDatagrams.
neqo-transport/​src/​connection/​tests/​datagram.rs Tests sent, too-big, and teardown counts.
neqo-transport/​src/​connection/​mod.rs Adds public per-session accounting APIs.
neqo-http3/​src/​features/​extended_connect/​session.rs Adapts session cleanup to the new return type.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@codecov

codecov Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.92%. Comparing base (ad03a20) to head (c5b0e4b).

Additional details and impacted files
@@                          Coverage Diff                          @@
##           users/jesup/expose_watermark_max_age    #4030   +/-   ##
=====================================================================
  Coverage                                 96.92%   96.92%           
=====================================================================
  Files                                       119      119           
  Lines                                     41486    41524   +38     
  Branches                                  41486    41524   +38     
=====================================================================
+ Hits                                      40210    40249   +39     
+ Misses                                     1252     1251    -1     
  Partials                                     24       24           
Flag Coverage Δ
freebsd 94.44% <100.00%> (-0.01%) ⬇️
linux 97.14% <100.00%> (+<0.01%) ⬆️
macos 95.29% <100.00%> (-0.01%) ⬇️
windows 95.38% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
neqo-common 99.31% <ø> (ø)
neqo-http3 95.39% <100.00%> (ø)
neqo-qpack 96.97% <ø> (ø)
neqo-transport 97.89% <100.00%> (+<0.01%) ⬆️
neqo-udp 95.37% <ø> (ø)
mtu 89.13% <ø> (ø)

@codspeed

codspeed Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Merging this PR will improve performance by 5.55%

⚡ 13 improved benchmarks
✅ 86 untouched benchmarks

Performance Changes

Mode Benchmark BASE HEAD Efficiency
⚡ WallTime 1-conn/1-100mb-resp (aka. Download) 52.3 ms 46.9 ms +11.41%
⚡ WallTime 1-conn/1-100mb-req (aka. Upload) 51.4 ms 47.9 ms +7.18%
⚡ WallTime walltime/pacing-true/same-seed 2.1 ms 2 ms +6.68%
⚡ WallTime walltime/pacing-true/varying-seeds 2.1 ms 2 ms +5.57%
⚡ WallTime walltime/pacing-false/varying-seeds 2.1 ms 2 ms +5.56%
⚡ WallTime 1-conn/10_000-parallel-1b-resp (aka. RPS) 69.2 ms 65.9 ms +5.04%
⚡ WallTime walltime/10-streams/each-1048576-bytes 29.3 ms 27.9 ms +4.92%
⚡ WallTime walltime/1000-streams/each-1000-bytes 11.7 ms 11.1 ms +4.74%
⚡ WallTime walltime/1-streams/each-4194304-bytes 11 ms 10.5 ms +4.71%
⚡ WallTime walltime/pacing-false/same-seed 2 ms 2 ms +4.62%
⚡ WallTime 1-conn/1-1b-resp (aka. HPS) 3 ms 2.9 ms +4.47%
⚡ WallTime walltime/1-streams/each-1000-bytes 131.3 µs 126.4 µs +3.9%
⚡ WallTime walltime/1000-streams/each-1-bytes 3.8 ms 3.6 ms +3.58%

Tip

Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.


Comparing users/jesup/datagram_counting (c5b0e4b) with users/jesup/expose_watermark_max_age (ad03a20)

Open in CodSpeed

Comment thread neqo-transport/src/quic_datagrams.rs
DatagramQueue gains a sent counter, incremented by write_frames when a
datagram is actually handed to the packet builder (not merely accepted
into the queue), and drained via QuicDatagrams::take_session_sent_count /
Connection::take_session_sent_datagrams.  A datagram dropped at
packet-build time for not fitting the path MTU is counted separately,
drained via Connection::take_session_too_big_datagrams; both counts are
also returned by drop_session_datagrams.

Nothing reads these yet; the next commit uses them for a per-session
aggregate stat.
@jesup
jesup force-pushed the users/jesup/expose_watermark_max_age branch from db25390 to ad03a20 Compare October 2, 2026 21:48
@jesup
jesup force-pushed the users/jesup/datagram_counting branch from 4e60ccb to c5b0e4b Compare October 2, 2026 21:48
@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Failed Interop Tests

QUIC Interop Runner, client vs. server, differences relative to users/jesup/expose_watermark_max_age at ad03a20.

neqo-pr as clientneqo-pr as server
neqo-pr vs. go-x-net: BP BA
neqo-pr vs. haproxy: BP BA
neqo-pr vs. kwik: 🚀DC ⚠️H Z ⚠️A L1 C1
neqo-pr vs. lsquic: L1 C1
neqo-pr vs. msquic: Z A L1 C1 🚀C2
neqo-pr vs. mvfst: A ⚠️BA
neqo-pr vs. neqo: Z A
neqo-pr vs. nginx: BP BA
neqo-pr vs. ngtcp2: Z L1 CM
neqo-pr vs. picoquic: Z A ⚠️BP BA
neqo-pr vs. quic-go: A
neqo-pr vs. quiche: BP BA
neqo-pr vs. s2n-quic: CM
neqo-pr vs. tquic: S BP BA
neqo-pr vs. xquic: S R Z A L1 C1
aioquic vs. neqo-pr: CM
go-x-net vs. neqo-pr: CM
kwik vs. neqo-pr: BP BA CM
linuxquic vs. neqo-pr: ⚠️CM
msquic vs. neqo-pr: CM
mvfst vs. neqo-pr: Z L1 C1 CM
neqo vs. neqo-pr: run cancelled after 20 min
openssl vs. neqo-pr: LR M A CM
quic-go vs. neqo-pr: CM
quic-zig vs. neqo-pr: 🚀C1 CM
quiche vs. neqo-pr: ⚠️C1 CM
quinn vs. neqo-pr: 🚀L1 ⚠️C1 V2 CM
s2n-quic vs. neqo-pr: ⚠️B CM
tquic vs. neqo-pr: CM
xquic vs. neqo-pr: M CM
All results

Succeeded Interop Tests

QUIC Interop Runner, client vs. server

neqo-pr as client

neqo-pr as server

Unsupported Interop Tests

QUIC Interop Runner, client vs. server

neqo-pr as client

neqo-pr as server

@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Benchmark results

No significant performance differences relative to ad03a20.

All results
transfer/1-conn/1-100mb-req (aka. Upload)/mtu-1500
       time:   [50.741 ms 50.769 ms 50.796 ms]
       thrpt:  [1.9225 GiB/s 1.9236 GiB/s 1.9246 GiB/s]
Found 3 outliers among 100 measurements (3.00%)
2 (2.00%) low mild
1 (1.00%) high mild
transfer/1-conn/1-100mb-resp (aka. Download)/mtu-1500
       time:   [51.960 ms 52.001 ms 52.041 ms]
       thrpt:  [1.8765 GiB/s 1.8780 GiB/s 1.8794 GiB/s]
Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) high mild
transfer/1-conn/1-1b-resp (aka. HPS)/mtu-1500
       time:   [2.9582 ms 2.9600 ms 2.9617 ms]
       thrpt:  [337.64   B/s 337.84   B/s 338.04   B/s]
Found 3 outliers among 100 measurements (3.00%)
1 (1.00%) high mild
2 (2.00%) high severe
transfer/1-conn/10_000-parallel-1b-resp (aka. RPS)/mtu-1500
       time:   [66.193 ms 66.468 ms 66.747 ms]
       thrpt:  [149.82 Kelem/s 150.45 Kelem/s 151.07 Kelem/s]
Found 2 outliers among 100 measurements (2.00%)
1 (1.00%) low mild
1 (1.00%) high mild
streams-flow-controlled/walltime/1-streams/each-4194304-bytes
       time:   [10.287 ms 10.291 ms 10.294 ms]
       thrpt:  [388.58 MiB/s 388.71 MiB/s 388.83 MiB/s]
Found 6 outliers among 100 measurements (6.00%)
6 (6.00%) high mild
streams-flow-controlled/walltime/10-streams/each-1048576-bytes
       time:   [28.640 ms 28.647 ms 28.655 ms]
       thrpt:  [348.98 MiB/s 349.07 MiB/s 349.16 MiB/s]
Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) high mild
streams/walltime/1-streams/each-1000-bytes
       time:   [129.20 µs 129.73 µs 130.40 µs]
       thrpt:  [7.3134 MiB/s 7.3515 MiB/s 7.3814 MiB/s]
Found 4 outliers among 100 measurements (4.00%)
4 (4.00%) high mild
streams/walltime/1000-streams/each-1-bytes
       time:   [3.8470 ms 3.8581 ms 3.8689 ms]
       thrpt:  [252.41 KiB/s 253.12 KiB/s 253.85 KiB/s]
streams/walltime/1000-streams/each-1000-bytes
       time:   [11.382 ms 11.387 ms 11.391 ms]
       thrpt:  [83.720 MiB/s 83.753 MiB/s 83.786 MiB/s]
transfer/walltime/pacing-false/same-seed
       time:   [2.0652 ms 2.0664 ms 2.0677 ms]
       thrpt:  [1.8892 GiB/s 1.8903 GiB/s 1.8914 GiB/s]
transfer/walltime/pacing-false/varying-seeds
       time:   [2.0549 ms 2.0562 ms 2.0577 ms]
       thrpt:  [1.8984 GiB/s 1.8998 GiB/s 1.9010 GiB/s]
transfer/walltime/pacing-true/same-seed
       time:   [2.1149 ms 2.1170 ms 2.1196 ms]
       thrpt:  [1.8429 GiB/s 1.8452 GiB/s 1.8470 GiB/s]
transfer/walltime/pacing-true/varying-seeds
       time:   [2.0997 ms 2.1013 ms 2.1035 ms]
       thrpt:  [1.8571 GiB/s 1.8589 GiB/s 1.8604 GiB/s]

Instructions per cycle

Criterion reported no significant timing changes.

All benchmarks
Benchmark IPC before IPC after ΔIPC
transfer/walltime/pacing-true/same-seed 2.89 2.83 -2.2%
streams-flow-controlled/walltime/10-streams/each-1048576-bytes 3.21 3.15 -1.6%
transfer/1-conn/10_000-parallel-1b-resp (aka. RPS)/mtu-1500 3.24 3.21 -1.0%
streams/walltime/1000-streams/each-1000-bytes 3.11 3.08 -0.9%
streams-flow-controlled/walltime/1-streams/each-4194304-bytes 3.02 3.04 +0.8%
transfer/walltime/pacing-false/varying-seeds 2.88 2.86 -0.7%
transfer/1-conn/1-100mb-resp (aka. Download)/mtu-1500 3.18 3.20 +0.4%
streams/walltime/1-streams/each-1000-bytes 2.52 2.53 +0.4%
transfer/walltime/pacing-true/varying-seeds 2.87 2.88 +0.4%
transfer/walltime/pacing-false/same-seed 2.90 2.89 -0.2%
streams/walltime/1000-streams/each-1-bytes 3.31 3.32 +0.1%
transfer/1-conn/1-1b-resp (aka. HPS)/mtu-1500 2.25 2.25 +0.1%
transfer/1-conn/1-100mb-req (aka. Upload)/mtu-1500 3.19 3.19 +0.1%
Profiles for profiler.firefox.com (62)

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

@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Client/server transfer results

Performance differences relative to ad03a20.

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

Client vs. server Mean±σ Min–Max Median±MAD MiB/s±σ ΔMedian
google-neqo-cubic 69.8 ± 0.4 68.6 – 71.0 69.8 ± 0.3 458.3 ± 2.4 💔 +0.8 (+1.2%)
neqo-neqo-cubic 19.4 ± 0.1 19.1 – 19.7 19.4 ± 0.2 1648.1 ± 12.7 💚 -0.2 (-1.0%)

Table above only shows statistically significant changes. See all results below.

All results

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

Client vs. server Mean±σ Min–Max Median±MAD MiB/s±σ ΔMedian
google-google 135.1 ± 0.5 133.7 – 136.4 135.1 ± 0.5 236.9 ± 0.9
google-neqo-cubic 69.8 ± 0.4 68.6 – 71.0 69.8 ± 0.3 458.3 ± 2.4 💔 +0.8 (+1.2%)
neqo-google-cubic 234.1 ± 56.2 175.9 – 494.1 226.1 ± 35.4 136.7 ± 32.8 -1.3 (-0.6%)
neqo-neqo-cubic 19.4 ± 0.1 19.1 – 19.7 19.4 ± 0.2 1648.1 ± 12.7 💚 -0.2 (-1.0%)
neqo-neqo-cubic-nopacing 19.1 ± 0.2 18.6 – 19.5 19.1 ± 0.2 1675.7 ± 15.4 +0.1 (+0.7%)
neqo-neqo-newreno 19.2 ± 0.2 18.9 – 19.8 19.2 ± 0.2 1662.9 ± 14.2 -0.1 (-0.8%)
neqo-neqo-newreno-nopacing 18.8 ± 0.2 18.4 – 19.2 18.8 ± 0.1 1700.4 ± 14.7 -0.1 (-0.3%)
neqo-quiche-cubic 33.3 ± 0.3 32.8 – 34.5 33.4 ± 0.3 959.5 ± 8.4 +0.2 (+0.7%)
neqo-s2n-cubic 38.2 ± 0.3 37.6 – 38.9 38.2 ± 0.2 837.2 ± 5.7 -0.0 (-0.0%)
quiche-neqo-cubic 38.2 ± 0.4 37.5 – 39.7 38.1 ± 0.3 838.8 ± 9.0 +0.0 (+0.1%)
quiche-quiche 38.7 ± 0.2 38.3 – 39.9 38.7 ± 0.2 826.7 ± 5.2
s2n-neqo-cubic 112.6 ± 0.3 111.8 – 113.4 112.5 ± 0.3 284.2 ± 0.9 -0.1 (-0.1%)
s2n-s2n ⚠️ 169.4 ± 29.7 136.9 – 262.0 159.6 ± 1.0 188.9 ± 33.1

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

This branch has not been deployed

No deployments
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