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-websys or 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.
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-directrelay -> browser path.Observed behavior
Connection establishment and control traffic succeed. Once transfer data starts, the relay reports:
The peers then observe:
For local validation, reducing
libp2p_webrtc_utils::stream::MAX_MSG_LENfrom 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?
maxMessageSize, where available.webrtc-websysor relay paths.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.