ice
ice copied to clipboard
How Pion WebRTC handle ICE role conflict
pion webrtc environment. Version: [email protected]
What did you do? we use pion webrtc as client,ice role is contrlolling,remote webrtc as server,ice role is controlling,in this case,an end-to-end not solve the problem of conflict of ice, pion webrtc no solution to the conflict, causing the ice connection to fail.
What did you expect? Hope that the pion webrtc can solve the problem of ice role conflict.
Hey @xianchuhan
This would be a great change! I don't think it would be that challenging either.
In selection.go
we have dedicated logic for controlling/controlled. We could add some heuristics to detect if the other side is controlling as well, and then we could switch to controlled. I believe the ICE RFC has explicit instructions on how to do this.
Hi @Sean-Der
In peerconnection. go SetRemoteDescription function,through the simple judgment to set the end of the ICE role,In pion webrtc code do not see the logic of conflict resolution.
As you say, we need According to the ice rfc specification to solve the problem of ice role conflict.
I don't believe the ICE Role goes in the SessionDescription. If you make the Offer you are the controlling ICE Agent. The only thing that can influence that would be ice-lite
. So I don't believe there is any more logic we need to put in SetRemoteDescription
What could happen is that a ICE Agent could incorrectly being in controlling (or controlled mode) and it wouldn't be communicated via the Session Description. This needs to be handled in this package like this
Thank you very much for your answer.
Just as you say,when the browser as webrtc client, its ice role is controlling,pion webrtc as server,its ice role is controlled.in some cases,there will be another scenario,browser and pion webrtc turn channel established, then stun channel building,audio and video data is sent from the browser turn switch to stun channels, but pion webrtc remains from the turn and receives data,that led to not receive each other over the data.
Whether pion webrtc can support ice Channel switch? For example, you can switch from turn to stun.
Yes Pion supports switching between srflx and relay candidates. After a use_candidate
is emitted it stays with TURN or STUN.
If you want to switch after the Selected pair has been chosen you can do a ice-restart
Thank you very much.
I try this approach.