Add usrsctp component (sctplab/usrsctp + ESP-IDF lwIP integration) (IEC-545)#754
Draft
vikramdattu wants to merge 2 commits into
Draft
Add usrsctp component (sctplab/usrsctp + ESP-IDF lwIP integration) (IEC-545)#754vikramdattu wants to merge 2 commits into
vikramdattu wants to merge 2 commits into
Conversation
…ion)
Adds the usrsctp wrapper component: sctplab/usrsctp 0.9.5 as a submodule
(pinned at 2e1ab10) plus the ESP-IDF build glue and five local patches.
usrsctp is a portable userland implementation of the SCTP protocol
(RFC 4960). It is the standard SCTP stack used by WebRTC data channels
(SCTP-over-DTLS-over-UDP) and by other consumers that need SCTP on
platforms without a kernel-level SCTP implementation.
What's bundled:
- usrsctplib/ (the library proper) registered as the component's
in-repo includes; CMakeLists pulls the lib into ESP-IDF's build
graph and links against lwip / mbedtls / pthread / freertos.
- Five build-time patches applied via 'git apply' at configure time
(idempotent — already-applied patches are skipped):
0001 LWIP support (the big one — see sctplab/usrsctp#743,
upstream PR in flight; will be dropped once it lands)
0002 sin6 buffer overflow fix
0003 ESP_PLATFORM thread-safe netif API
0004 SPIRAM-backed worker thread stacks (memory-constrained
targets like ESP32-C5 / C6)
0005 Linux-target buildability for the 'Added LWIP support' patch
- Embedded smoke test (test_apps/) and host-side socket-lifecycle test
(host_test/) for the IDF Linux target.
- Kconfig knobs (USRSCTP_DEBUG, USRSCTP_THREAD_STACK_IN_SPIRAM,
USRSCTP_USE_MBEDTLS_SHA1).
Targets: full ESP32 family (esp32 / s2 / s3 / c3 / c5 / c6 / p4) plus
the IDF Linux target for host-side testing.
Naming follows the idf-extra-components convention for upstream-library
wrappers — bare upstream project name (matches usrsctp's own naming
even though the artifact is libusrsctp.a; see cbor, nghttp, freetype,
zlib, etc. which all match their upstream project's primary name).
- .idf_build_apps.toml: add usrsctp/.build-test-rules.yml entry so build_apps picks up the new component during repo-wide CI runs. - .github/workflows/upload_component.yml: add usrsctp to the 'components:' list so 'compote component upload' processes the tarball on push to master. - .github/ISSUE_TEMPLATE/bug-report.yml: add usrsctp to the component dropdown so users can file bugs against it. All three entries inserted alphabetically.
Contributor
Author
|
Heads-up — moving this to espressif/esp-protocols instead of idf-extra-components, on the same migration track as the libsrtp PR (#753 → espressif/esp-protocols#1060). New PR: espressif/esp-protocols#1063 (Draft — sits behind #1060 + #1061 on the migration train, will flip to ready-for-review once either lands and we apply consistent review feedback). Component name and patch set carry over unchanged; conventions adapted to esp-protocols ( Closing this once the esp-protocols PR lands. |
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.
Summary
Adds
usrsctp— an ESP-IDF wrapper around upstream sctplab/usrsctp (0.9.5). Submodule pinned at2e1ab10, with five build-time patches applied at configure time.usrsctp is a portable userland implementation of SCTP (RFC 4960). It's the standard SCTP stack used by WebRTC data channels (SCTP-over-DTLS-over-UDP) and by other consumers that need SCTP on platforms without a kernel-level implementation. Pairs naturally with the
libsrtp2component (PR #753) for the WebRTC use case.Why a new component
We've been carrying this as a downstream component on the AWS KVS WebRTC SDK port for ESP32, in production on ESP32-P4 for the camera/WebRTC workstream. Bringing it into idf-extra-components so any IDF project can
add-dependency espressif/usrsctp.Naming
Bare upstream project name, matching the idf-extra-components convention (cf.
cbor,nghttp,freetype,zlib, etc., which all match the upstream project's primary name — even when the install artifact is calledlib<name>.a).Searchable tag synonyms in
idf_component.yml:sctp,sctplab,esp_usrsctp,esp_sctp,libusrsctp,webrtc,data-channel,rfc4960.Commits
feat(usrsctp): add component (sctplab/usrsctp + ESP-IDF lwIP integration)— wrapper sources,usrsctp/usrsctpas a submodule gitlink at2e1ab10, root.gitmodulesentry, five build-time patches inpatches/.ci: register usrsctp in CI manifests—.idf_build_apps.toml, upload-componentcomponents:, bug-report dropdown. Alphabetical.Patches
Five local patches in
patches/, applied viagit apply --check-gated loop inCMakeLists.txt(idempotent — already-applied patches are skipped):ESP_PLATFORM: add support for thread-safe netif APIfeat(esp): allocate usrsctp thread stacks from SPIRAMSee
patches/README.mdfor the ledger.Layout
Build / test verification (local)
test_apps/onesp32: ✅ builds cleantest_apps/onesp32c3: ✅ builds cleanhost_test/on IDF Linux target: ✅ builds clean + binary runs (usrsctp host_test: PASS, exit 0)examples/get_started/builds clean.github/consistency_check.pypassesesp_usrsctp) drives the WebRTC data-channel transport for our ESP32-P4 KVS WebRTC port in production.License
Apache-2.0 AND BSD-3-Clause— ESP-IDF port glue is Apache-2.0; the bundledusrsctp/submodule remains under upstream's BSD-3-Clause.Related
libsrtp2component (PR feat(libsrtp2): add component (libsrtp 2.8.0 + ESP-IDF mbedTLS port) (IEC-542) #753) — the SRTP/SRTCP packet-protection partner for the WebRTC SRTP path.Reviews welcome — happy to split the patch series further, rename the option knobs, or rework anything that doesn't fit.