JAnus ice交渉プロセスに失敗したいくつかの記録
12473 ワード
@janus ice交渉プロセスに失敗したレコード
JAnus ice交渉プロセスに失敗したいくつかの記録
従来のノミネートは、交渉中にcontrolling側がbinding requestを送信する際に確認フラグを携帯せず、すべての交渉が完了した後にすべてのcandidateを評価し、最後に確認を表すために再びフラグビット付き要求を送信する. で急進的な指名方式controllingはbinding requestを送信すると対応するフラグビットを携帯し、この二次連通性テストが完了すると、接続を選択し、このような場合、二次的なbinding requestは送信されない.
ICEは以下のstunのattributeを拡張し、6.1のフラグビットはUSE_CANDIDATE,controllingはcandidateを選択するとbinding requestにそのフラグビットを携帯しますが、controlledはbinding responseとbinding requestではそのフラグビットを携帯しません.
JAnus ice交渉プロセスに失敗したいくつかの記録
Lite Implementations:
一般にiceサーバは実装可能であり、このモードではbinding requestリクエストのみを受信し、返信する.binding requestリクエストは相手に自発的に送信されません.もしサーバーがずっとパブリックネットワークIPの下にあるならば、このモードを使用することができます.サーバーはcandidateを収集せず、stun binding requestテストだけを受け、2つのエンド、1つがfull 1つのliteであれば、liteエンドはcontroledに違いありません.
Full Implementations:
このモードはbinding requestを受信もbinding requestを送信もよい.すなわちfullモードはcontrolldとしてもcontrollingとしてもよく,offerを発起するのはcontrolingである.
https://tools.ietf.org/html/rfc5245#section-5.2 Determining Roleの詳細
ではcontroledとcontrolingの違いは何ですか?
controlling agentは、すべての有効な候補者の中からメディアに適した1つを見つけて任命する.以下の2つの方法が使用できます.REGULAR NOMINATIONとAGGRESSIVE NOMINATIONで.regular nominationでは、the controlling agentは、少なくとも1つの有効な候補者が見つかるまで検査を継続させる.そして、これらの有効な候補者の中から選択し、任命された候補者ペアに2回目のSTUNリクエストを送信する.
2つのノミネート方式
With regular nomination, the controlling agent lets the checks
continue until at least one valid candidate pair for each media
stream is found. Then, it picks amongst those that are valid, and
sends a second STUN request on its NOMINATED candidate pair, but this
time with a flag set to tell the peer that this pair has been
nominated for use. This is shown in Figure 4.
L R
- -
STUN request -> \ L's
<- STUN response / check
<- STUN request \ R's
STUN response -> / check
STUN request + flag -> \ L's
<- STUN response / check
Figure 4: Regular Nomination
Once the STUN transaction with the flag completes, both sides cancel
any future checks for that media stream. ICE will now send media
using this pair. The pair an ICE agent is using for media is called
the SELECTED PAIR.
In aggressive nomination, the controlling agent puts the flag in
every STUN request it sends. This way, once the first check
succeeds, ICE processing is complete for that media stream and the
controlling agent doesn't have to send a second STUN request. The
selected pair will be the highest-priority valid pair whose check
succeeded. Aggressive nomination is faster than regular nomination,
but gives less flexibility. Aggressive nomination is shown in
Figure 5.
L R
- -
STUN request + flag -> \ L's
<- STUN response / check
<- STUN request \ R's
STUN response -> / check
Figure 5: Aggressive Nomination
Once all of the media streams are completed, the controlling endpoint
sends an updated offer if the candidates in the m and c lines for the
media stream (called the DEFAULT CANDIDATES) don't match ICE's
SELECTED CANDIDATES.
stun binding requestフラグビット
ICEは以下のstunのattributeを拡張し、6.1のフラグビットはUSE_CANDIDATE,controllingはcandidateを選択するとbinding requestにそのフラグビットを携帯しますが、controlledはbinding responseとbinding requestではそのフラグビットを携帯しません.
This specification defines four new attributes, PRIORITY, USE-
CANDIDATE, ICE-CONTROLLED, and ICE-CONTROLLING.
The PRIORITY attribute indicates the priority that is to be
associated with a peer reflexive candidate, should one be discovered
by this check. It is a 32-bit unsigned integer, and has an attribute
value of 0x0024.
The USE-CANDIDATE attribute indicates that the candidate pair
resulting from this check should be used for transmission of media.
The attribute has no content (the Length field of the attribute is
zero); it serves as a flag. It has an attribute value of 0x0025.
The ICE-CONTROLLED attribute is present in a Binding request and
indicates that the client believes it is currently in the controlled
role. The content of the attribute is a 64-bit unsigned integer in
network byte order, which contains a random number used for tie-
breaking of role conflicts.
The ICE-CONTROLLING attribute is present in a Binding request and
indicates that the client believes it is currently in the controlling
role. The content of the attribute is a 64-bit unsigned integer in
network byte order, which contains a random number used for tie-
breaking of role conflicts.
Janusサーバでのcontrolling判定
Janus controlled, 。 log , , janus_ice_set_local 。
[3814770425474886] Setting ICE locally: got OFFER (1 audios, 1 videos)
[3814770425474886] Creating ICE agent (ICE Full mode, controlled)