Skip to content
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

Candidate type is not changed from peer-reflexive to host #622

Open
sirzooro opened this issue Sep 15, 2023 · 1 comment
Open

Candidate type is not changed from peer-reflexive to host #622

sirzooro opened this issue Sep 15, 2023 · 1 comment

Comments

@sirzooro
Copy link
Contributor

Your environment.

  • Version: pion v3.1.60, pion/ice v2.3.2

What did you do?

Two pion-based peers establish WebRTC connection with ICE trickle enabled.

What did you expect?

When both peers are on the same network (especially in tests where both are in the same process), both of them selects host-host pair as a best one and reports it via peer.SCTP().Transport().ICETransport().OnSelectedCandidatePairChange() callback. I am interested in last reported pair.

What happened?

When ICE trickle is enabled, there is race condition between ICE candidate sent via websocket and STUN request. When latter one arrives first, pion/ice selects host-prflx pair as a best one and reports it via callback mentioned above.

My code differentiated between direct host-host connections and other ones, so sometimes it works incorrectly.

Related part of ICE Trickle RFC: https://www.rfc-editor.org/rfc/rfc8838#section-11-2.4.2.1

@sirzooro
Copy link
Contributor Author

I read RFCs for ICE and ICE Trickle, and found that they do not specify how candidate pair should be nominated, so this is up to pion to decide and it may work correctly.
I also found that pion has SettingEngine.timeout.ICEPrflxAcceptanceMinWait option (set to 0 by default), but looks that it does not work properly - I set it to 1 second for testing and I still see that peer reflexive candidate is selected.

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

No branches or pull requests

1 participant