Skip to content

Stabilize ICE-lite priorities across IPv4/IPv6 gather order - #6

Merged
cnderrauber merged 1 commit into
warp-4.4.8from
dz/stable-lite-candidate-priorities
Nov 9, 2026
Merged

cnderrauber merged 1 commit into
warp-4.4.8from
dz/stable-lite-candidate-priorities

Conversation

@davidzhao

Copy link
Copy Markdown
Member

ICE-lite priorities currently depend on whether IPv4 or IPv6 candidates gather first. A migration target can therefore advertise a lower priority than the still-live source, causing Chrome to prune the target and leave migration waiting for ICE nomination.

Reserve odd local-preference slots for IPv6 and even slots for IPv4. This keeps each family's priorities stable across gather order and single/dual-stack nodes while retaining unique priorities. The fix belongs on warp-4.4.8, the ICE fork used by the DTLS 1.3/WARP stack; it does not change DTLS roles.

Validation:

  • Regression tests cover UDP, active/passive TCP, multiple addresses, and single-stack nodes; they fail on the base branch.
  • Chrome 157 reproduction with the source kept alive, WARP enabled, and DTLS server role: fails before, passes after in both migration directions, including destination ICE nomination/connection.
  • Go 1.25 suite and targeted race checks pass, except an existing IPv6 TCP/mDNS timeout also reproduced on the unchanged base branch. Lint reports no new issues.

Staging has not been changed; it will need a dependency pin after this is merged. Mixed-version nodes can still advertise the old priorities during rollout.

@cnderrauber
cnderrauber merged commit f747420 into warp-4.4.8 Nov 9, 2026
13 of 16 checks passed
cnderrauber added a commit that referenced this pull request Nov 9, 2026
cnderrauber added a commit that referenced this pull request Nov 9, 2026
* Revert "fix: stabilize ICE-lite priorities across address families (#6)"

This reverts commit f747420.

* Stabilize ICE-lite priorities like libwebrtc

History:
PR pion#959 let ICE-lite agents pick the best pair locally without sending
checks. All lite host candidates had the same priority, so with
several candidates the two sides could pick different pairs and fail
to connect. pion#968 fixed that by stepping each new lite candidate down
from the default until its priority was unique. That made priorities
depend on gather order: the same address could get a different
priority on another node, or depending on whether the node was
single- or dual-stack.

The main problem is that Pion doesn't have local preference like
libwebrtc, instead of doing other hacks this adds:
`(counter << 8) | address precedence`. The low byte is the RFC 6724
precedence of the address (IPv6 40, IPv4 30, and so on), so address
families never collide. The counter drops only to separate candidates
of the same family. A candidate's priority no longer depends on gather
order or on whether the agent is single- or dual-stack.

Unlike libwebrtc, the high byte is not a network adapter preference,
since Pion has no adapter types.

---------

Co-authored-by: Jo Turk <git@joturk.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants