WebRTC relay path can reject the default 16 KiB framed message size
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 5.6k
- Forks
- 1.3k
- Avg merge
- 8h 47m
- Merged PRs (30d)
- 19
Description
Thank you for maintaining the WebRTC transport.
We observed that the default 16 KiB WebRTC framing limit can exceed the effective SCTP/DataChannel message limit on a real browser -> webrtc-direct relay -> browser path.
Observed behavior
Connection establishment and control traffic succeed. Once transfer data starts, the relay reports:
outbound packet larger than maximum message size
The peers then observe:
connection is closed
unexpected end of file
For local validation, reducing libp2p_webrtc_utils::stream::MAX_MSG_LEN from 16 KiB to 8 KiB allowed the same browser-to-browser transfer to complete repeatedly.
Why I am opening an issue before a PR
The 16 KiB value follows the RFC 8831 guidance for non-interleaved messages. I do not think changing the global default to 8 KiB is necessarily the right fix: it could unnecessarily reduce throughput for native WebRTC users.
Could you advise on the preferred design direction?
- Derive the framing limit from the effective SCTP/WebRTC
maxMessageSize, where available. - Expose the maximum WebRTC frame/message size as transport configuration.
- Use a conservative default only for
webrtc-websysor relay paths. - Proactively fragment before the underlying SCTP/DataChannel layer rejects an oversized message.
I can provide full relay logs, browser console logs, and a minimal reproduction if useful. I would be happy to prepare a PR once there is agreement on the desired API and behavior.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with libp2p_webrtc_utils::stream::MAX_MSG_LEN and reproduce the browser -> webrtc-direct relay -> browser transfer described in the issue. Compare the effective SCTP/DataChannel message limit with the 16 KiB framing limit and review the four proposed design directions. Done means an agreed API and behavior that lets the transfer complete without unnecessarily reducing native WebRTC throughput.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- audio-video-rtc, networking
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100