Skip to content

Expose the bytes in the SCTP association's own queues and the send buffer that bounds them - #6

Merged
onebeastchris merged 1 commit into
opencollab-incubator:mainfrom
electronicboy:shane/sctp-send-queue-stats
Nov 27, 2026
Merged

onebeastchris merged 1 commit into
opencollab-incubator:mainfrom
electronicboy:shane/sctp-send-queue-stats

Conversation

@electronicboy

@electronicboy electronicboy commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

Exposes the three SCTP stats added in opencollab-incubator/libdatachannel#4 (merged) on SctpStats:

  • sendQueueBytes(): bytes the association has accepted for sending and not had acknowledged, sent or not. DataChannel.bufferedAmount() only counts what usrsctp would not take yet, so up to a whole send buffer (1 MiB by default) waited below it unseen.
  • sendBufferSize(): the bound on that queue, so a reader can tell how full it is and confirm SctpSettings.sendBufferSize took effect.
  • receiveQueueBytes(): received bytes awaiting reassembly or ordering, the byte counterpart of pendingChunks().

libdatachannel

Syncs jni/libdatachannel to opencollab-incubator/libdatachannel@0b158812, which has opencollab-incubator/libdatachannel#4 (these stats) and opencollab-incubator/libdatachannel#5 (the cwnd-based max burst setting). It's rebased onto main, and the temporary commit that fetched the submodule from electronicboy/libdatachannel is gone.

Testing

NativeTransportProbe now:

  • sets sendBufferSize(512 KiB) and asserts sendBufferSize() reports exactly 524288;
  • sends 32 × 16 KiB from the host and asserts the send queue holds at least one unacknowledged message, then drains to 0.

Run locally against an Mbed TLS build of the natives (no OpenSSL headers on that machine): all 15 probe scenarios pass, with peaks of 354–376 KB queued. The OpenSSL-dependent native test executables, the other probes and the release builds were not run locally.

@electronicboy
electronicboy force-pushed the shane/sctp-send-queue-stats branch from 130c1eb to 36e0b0a Compare November 25, 2026 12:45
@electronicboy
electronicboy marked this pull request as ready for review November 25, 2026 12:46
@onebeastchris
onebeastchris merged commit ba4473a into opencollab-incubator:main Nov 27, 2026
9 checks passed
onebeastchris added a commit to CloudburstMC/Network that referenced this pull request Nov 27, 2026
This brings in upstream improvements, mainly:

usrsctp changes:
- opencollab-incubator/usrsctp#1 (Restart T3-rtx on a new cumulative ack in the express SACK path)

libdatachannel:
- opencollab-incubator/libdatachannel#4 (Report the bytes in the SCTP association's own queues)
- opencollab-incubator/libdatachannel#5 (Make usrsctp's cwnd-based max burst a setting)
- opencollab-incubator/libdatachannel#6 (Pull in usrsctp changes)

libdatachannel-java:
- opencollab-incubator/libdatachannel-java#6 (Expose the bytes in the SCTP association's own queues and the send buffer that bounds them)
- opencollab-incubator/libdatachannel-java#7 (Expose usrsctp's cwnd-based max burst as a setting)
- opencollab-incubator/libdatachannel-java#8 (Sync jni/libdatachannel to latest fork update)
- opencollab-incubator/libdatachannel-java#9 (fix: windows handles leak (x86_64) due to libstdc++ issue)
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.

2 participants