1. 程式人生 > >webrtc ice 協商一些記錄

webrtc ice 協商一些記錄

參考規範:https://tools.ietf.org/html/rfc5245

 

Lite Implementations: 一般是ice伺服器可以實現,這種模式下,只接受binding request請求,並且回覆。 不會主動傳送binding request請求給對方

To make it easier for these devices to
   support ICE, ICE defines a special type of implementation called LITE
   (in contrast to the normal FULL implementation).  A lite
   implementation doesn
't gather candidates; it includes only host candidates for any media stream. Lite agents do not generate connectivity checks or run the state machines, though they need to be able to respond to connectivity checks. When a lite implementation connects with a full implementation, the full agent takes the role of the controlling agent, and the lite agent takes on the controlled role. When two lite implementations connect, no checks are sent.

Full Implementations: ice客戶端實現,這種模式既可以收binding request,也可以發binding request.

 

controlled 和 controlling角色確定: 

https://tools.ietf.org/html/rfc5245#section-5.2  Determining Role 有詳細描述

這裡只記錄其中一種情況:

One agent full, one lite:  The full agent MUST take the controlling
      role, and the lite agent MUST take the controlled role.  The full
      agent will form check lists, run the ICE state machines, and
      generate connectivity checks.  That agent will execute the logic
      
in Section 8.1 to nominate pairs that will be selected by ICE, and use the logic in Section 8.1.2 to end ICE. The lite implementation will just listen for connectivity checks, receive them and respond to them, and then conclude ICE as described in Section 8.2. For the lite implementation, the state of ICE processing for each media stream is considered to be Running, and the state of ICE overall is Running.

也就是 full agent必須是 controlling role, lite agent 是controlled