Skip to content

Implement SPED (STUN Protocol for Embedding DTLS)#876

Open
fippo wants to merge 3 commits into
pion:mainfrom
fippo:sped-remainder
Open

Implement SPED (STUN Protocol for Embedding DTLS)#876
fippo wants to merge 3 commits into
pion:mainfrom
fippo:sped-remainder

Conversation

@fippo

@fippo fippo commented Jan 19, 2026

Copy link
Copy Markdown
Contributor

(based on #914 )

Part of pion/webrtc#3335

@codecov

codecov Bot commented Jan 19, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.00000% with 29 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.26%. Comparing base (6e0640f) to head (95838f7).

Files with missing lines Patch % Lines
piggyback.go 77.67% 21 Missing and 4 partials ⚠️
agent.go 80.00% 3 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #876      +/-   ##
==========================================
- Coverage   88.44%   88.26%   -0.19%     
==========================================
  Files          45       46       +1     
  Lines        5886     6014     +128     
==========================================
+ Hits         5206     5308     +102     
- Misses        469      491      +22     
- Partials      211      215       +4     
Flag Coverage Δ
go 88.26% <80.00%> (-0.19%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@fippo fippo force-pushed the sped-remainder branch 5 times, most recently from 10ebcd0 to 53df31e Compare January 30, 2026 17:37
@fippo fippo marked this pull request as ready for review March 26, 2026 18:53
fippo added a commit to fippo/pion-ice that referenced this pull request Apr 24, 2026
which will be used in pion#876 where the presence of some
attributes depends on whether they were used in the
original request.
fippo added a commit to fippo/pion-ice that referenced this pull request Apr 25, 2026
which will be used in pion#876 where the presence of some
attributes depends on whether they were used in the
original request.
fippo added a commit to fippo/pion-ice that referenced this pull request Apr 25, 2026
which will be used in pion#876 where the presence of some
attributes depends on whether they were used in the
original request.
fippo added a commit to fippo/pion-ice that referenced this pull request Apr 25, 2026
which will be used in pion#876 where the presence of some
attributes depends on whether they were used in the
original request.
fippo added a commit to fippo/pion-ice that referenced this pull request Apr 25, 2026
which will be used in pion#876 where the presence of some
attributes depends on whether they were used in the
original request.
fippo added a commit to fippo/pion-ice that referenced this pull request Apr 25, 2026
which will be used in pion#876 where the presence of some
attributes depends on whether they were used in the
original request.
fippo added a commit to fippo/pion-ice that referenced this pull request Apr 25, 2026
which will be used in pion#876 where the presence of some
attributes depends on whether they were used in the
original request.
fippo added a commit that referenced this pull request Apr 25, 2026
which will be used in #876 where the presence of some
attributes depends on whether they were used in the
original request.

(split from that to make review simpler, no functional changes)
@fippo fippo force-pushed the sped-remainder branch 2 times, most recently from 1ea6639 to c7f08eb Compare May 4, 2026 12:55
@fippo fippo force-pushed the sped-remainder branch from 2f3305b to 95838f7 Compare May 15, 2026 17:49
@JoTurk JoTurk self-requested a review June 2, 2026 12:59
@cnderrauber

Copy link
Copy Markdown
Member

Thank you for this great feature! I have integrated this into the livekit SFU and made some connectivity checks, found 2 regression cases:

  1. The ice-lite agent doesn't ping the remote actively, so the piggyback packets will be sent in response to the remote peer's connectivity check, cost longer than the non-sped case. Fixing this could conflict with spec, maybe we can mark it as an exception.
  2. When a remote peer sends a done signal after the agent is connected while still having inflight piggyback packets, it will mark the state to complete and doesn't have a chance to flush the packets. And also the Piggyback() will swallow all dtls packets but return true in this state (complete after connected).

Both are fixed in our fork livekit@85afccd, livekit@5eec925. Will merge them back to upstream once this PR is merged if they make sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants