Skip to content

Add support for aggressive nomination in controlling agent #73

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Mar 17, 2025

Conversation

mickel8
Copy link
Member

@mickel8 mickel8 commented Mar 12, 2025

RFC 5245 requires data to be only sent on selected pair. Hence, there is aggressive nomination that includes UseCandidate flag in every connectivity check to speedup connection establishment time.

RFC 8445 removes aggressive nomination and assumes that data can be sent on any valid pair i.e. pair for, which a connectivity check without UseCandidate flag passes.

So far, we have been relying on RFC 8445. However, some implementaitons still require a pair to be nominated by the controlling side before they can start sending data. In our case, pair nomination happens when we finish gathering local candidates, eoc flag is set and checklist has been finished. Overall, this might take even 10 seconds. Such situation happens when connecting with Pion or Firefox.

To mitigate this issue we can either set eoc flag manually (the other side might not always send such indication and our eoc timeout is pretty high) or use aggresive nomination.

This PR adds support for aggressive nomination when we are the controlling side, preserving also the old mode. Agressive nomination is turned on by default as that's how all browsers work anyway.
It also aims to compute candidate and pair priorities correctly as they are crucial for aggressive nomination to work predictable.

IMPORTANT

There are two edge-case where aggressive nomination will fail.

The first one, see: https://bugzilla.mozilla.org/show_bug.cgi?id=1954423

The second one, when we receive binding request from remote host candidate that we treat as prflx as it has not been trickled yet. This will result in pairs with different priorities on both sides.

@mickel8 mickel8 force-pushed the aggressive-nomination branch 3 times, most recently from f1208f1 to 7e3aad5 Compare March 12, 2025 13:20
@mickel8 mickel8 force-pushed the aggressive-nomination branch from 7e3aad5 to 72e2a46 Compare March 12, 2025 13:21
Copy link

codecov bot commented Mar 12, 2025

Codecov Report

Attention: Patch coverage is 88.57143% with 8 lines in your changes missing coverage. Please review.

Project coverage is 84.36%. Comparing base (b58acee) to head (72953cd).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
lib/ex_ice/priv/conn_check_handler/controlling.ex 70.58% 5 Missing ⚠️
lib/ex_ice/priv/candidate.ex 81.81% 2 Missing ⚠️
lib/ex_ice/priv/conn_check_handler/controlled.ex 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #73      +/-   ##
==========================================
+ Coverage   84.11%   84.36%   +0.24%     
==========================================
  Files          25       25              
  Lines        1719     1772      +53     
==========================================
+ Hits         1446     1495      +49     
- Misses        273      277       +4     
Files with missing lines Coverage Δ
lib/ex_ice/candidate.ex 80.55% <ø> (-0.53%) ⬇️
lib/ex_ice/ice_agent.ex 61.42% <ø> (ø)
lib/ex_ice/priv/candidate_base.ex 92.85% <ø> (-0.48%) ⬇️
lib/ex_ice/priv/gatherer.ex 93.33% <100.00%> (+0.15%) ⬆️
lib/ex_ice/priv/ice_agent.ex 87.11% <100.00%> (+0.55%) ⬆️
lib/ex_ice/priv/conn_check_handler/controlled.ex 93.87% <50.00%> (+0.06%) ⬆️
lib/ex_ice/priv/candidate.ex 88.88% <81.81%> (-11.12%) ⬇️
lib/ex_ice/priv/conn_check_handler/controlling.ex 86.36% <70.58%> (-5.95%) ⬇️

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b58acee...72953cd. Read the comment docs.

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

@mickel8 mickel8 marked this pull request as ready for review March 17, 2025 14:26
@mickel8 mickel8 merged commit a110e16 into master Mar 17, 2025
4 checks passed
@mickel8 mickel8 deleted the aggressive-nomination branch March 17, 2025 16:23
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.

1 participant