feat(usrsctp): add component (sctplab/usrsctp + ESP-IDF lwIP integration)#1063
Draft
vikramdattu wants to merge 1 commit into
Draft
feat(usrsctp): add component (sctplab/usrsctp + ESP-IDF lwIP integration)#1063vikramdattu wants to merge 1 commit into
vikramdattu wants to merge 1 commit into
Conversation
…ion) Adds usrsctp — userspace SCTP stack (RFC 4960) wrapping cisco-style sctplab/usrsctp pinned at 2e1ab10. Used by WebRTC data channels (SCTP-over-DTLS-over-UDP) and by other consumers that need a portable SCTP implementation on platforms without a kernel SCTP. Pairs naturally with libwebsockets and libsrtp in the WebRTC transport neighbourhood. PR espressif#1060 (libsrtp) + PR espressif#1061 (libwebsockets) sit on the same migration track from idf-extra-components. Five ESP-IDF-specific patches are applied at configure time, see patches/README.md: 0001 — LWIP routing layer for usrsctp's userspace 'conn' transport. Upstream PR sctplab/usrsctp#743 in flight; folds in once it lands. 0002 — sin6 overflow fix for the on-stack sockaddr_in6 slot. 0003 — ESP_PLATFORM thread-safe netif APIs (stays downstream). 0004 — SPIRAM-backed worker thread stacks for the usrsctp service tasks (stays downstream). 0005 — Buildability fix for the Linux target after 0001 (folds when 0001 lands upstream). Tests: test_apps/ — embedded Unity smoke on esp32 + esp32c3 host_test/ — Linux-target socket-lifecycle test examples/get_started/ — minimal init/shutdown sanity app .github/workflows/usrsctp__build.yml — CI matrix gated on the 'usrsctp' label, matches the lws_build.yml pattern Verified locally: pre-commit clean, get_started example builds clean on esp32. (Previously prepared as idf-extra-components#754 (Draft); relocated to esp-protocols where it sits alongside libwebsockets / libsrtp / asio.)
Collaborator
|
Question (before review): Wouldn't it be easier to support linux/BSD like socket API with usrsctp upstream? |
Contributor
Author
|
@david-cermak Yes, that's exactly the direction — the actual LWIP socket integration is already up at sctplab/usrsctp#743 (open, awaiting review). Until it lands, this component pins our fork; once merged upstream, the esp-protocols wrapper shrinks to build glue only. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Draft — sits behind #1060 (libsrtp) + #1061 (libwebsockets) on the same migration track from idf-extra-components. Will flip to ready-for-review after either lands and we apply the consistent review feedback here.
Summary
Adds
usrsctp— userspace SCTP stack (RFC 4960) wrapping sctplab/usrsctp pinned at commit2e1ab10. Used by WebRTC data channels (SCTP-over-DTLS-over-UDP) and by other consumers that need a portable SCTP implementation on platforms without a kernel SCTP.Pairs naturally with
libwebsocketsandlibsrtpin the WebRTC transport neighbourhood — that's the reason for landing here rather than in idf-extra-components.Patches
Five ESP-IDF-specific patches applied at configure time. See
patches/README.mdfor the full ledger.conntransport routes packets through lwIP for the espnetif pathESP_PLATFORM: thread-safe netif APIsfeat(esp): allocate usrsctp thread stacks from SPIRAMLayout
Local verification
pre-commitclean (yaml/copyright/astyle/codespell/eradicate/yapf/isort/flake8).examples/get_started/builds clean on esp32 with IDF v5.5..github/workflows/usrsctp__build.ymlmirrors thelws_build.yml/libsrtp__build.ymlpattern — label-gated onusrsctp. Maintainer drops the label and CI builds the get_started + test_apps matrix onrelease-v5.4/release-v5.5plus the host_test runs on the Linux target.esp_usrsctp) drives the WebRTC data-channel transport for our ESP32-P4 KVS WebRTC port in production.Previously
Initially prepared as espressif/idf-extra-components#754 (Draft). Moved here per discussion with @euripedesrocha — esp-protocols is the right neighbourhood for transport-stack components.
Related
libsrtp(SRTP/SRTCP packet protection, sibling on the WebRTC transport path)libwebsocketsKconfig toggles + submodule bumpcc @euripedesrocha @david-cermak