16. STUN Extensions【STUN扩展】

原文链接:https://datatracker.ietf.org/doc/html/rfc8445#section-16

16. STUN Extensions【STUN扩展】

16.1. Attributes【属性】

This specification defines four STUN attributes: PRIORITY, USE-CANDIDATE, ICE-CONTROLLED, and ICE-CONTROLLING.
该规范定义了四个 STUN 属性:PRIORITY、USE-CANDIDATE、ICE-CONTROLLED 和 ICE-CONTROLLING。

The PRIORITY attribute indicates the priority that is to be associated with a peer-reflexive candidate, if one will be discovered by this check. It is a 32-bit unsigned integer and has an attribute value of 0x0024.
PRIORITY 属性指示与peer-reflexive候选相关联的优先级,如果此检查将发现一个。 它是一个 32 位无符号整数,属性值为 0x0024

The USE-CANDIDATE attribute indicates that the candidate pair resulting from this check will be used for transmission of data. 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.
USE-CANDIDATE 属性指示由该检查产生的候选对将用于数据传输。 属性没有内容(属性的Length字段为零); 它用作一个标志,属性值为 0x0025。

The ICE-CONTROLLED attribute is present in a Binding request. The attribute 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.
ICE-CONTROLLED 属性存在于绑定请求中。 该属性表明客户端认为它当前处于受控角色。该属性的内容是一个网络字节序的64位无符号整数,其中包含一个随机数。

The number is used for solving role conflicts, when it is referred to as the “tiebreaker value”.
该数字用于解决角色冲突,当它被称为“界定值”时。

An ICE agent MUST use the same number for all Binding requests, for all streams, within an ICE session, unless it has received a 487 response, in which case it MUST change the number (Section 7.2.5.1). The agent MAY change the number when an ICE restart occurs.
ICE 代理必须对 ICE 会话中的所有绑定请求、所有流使用相同的编号,除非它收到 487 响应,在这种情况下它必须更改编号(第 7.2.5.1 节)。当 ICE 重新启动时,代理可以更改数字。

The ICE-CONTROLLING attribute is present in a Binding request. The attribute 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.
ICE-CONTROLLING 属性存在于绑定请求中。该属性表明客户端认为它当前处于控制角色。该属性的内容是一个网络字节序的64位无符号整数,其中包含一个随机数。

As for the ICE-CONTROLLED attribute, the number is used for solving role conflicts.
和 ICE-CONTROLLED 属性一样,数字用于解决角色冲突。

An agent MUST use the same number for all Binding requests, for all streams, within an ICE session, unless it has received a 487 response, in which case it MUST change the number (Section 7.2.5.1). The agent MAY change the number when an ICE restart occurs.
ICE 代理必须对 ICE 会话中的所有绑定请求、所有流使用相同的编号,除非它收到 487 响应,在这种情况下它必须更改编号(第 7.2.5.1 节)。当 ICE 重新启动时,代理可以更改数字。

16.2. New Error-Response Codes【新的错误响应码】

This specification defines a single error-response code:
该规范定义了一个错误响应代码:

487 (Role Conflict): The Binding request contained either the ICE-CONTROLLING or ICE-CONTROLLED attribute, indicating an ICE role that conflicted with the server.
487(角色冲突):绑定请求包含 ICE-CONTROLLING 或 ICE-CONTROLLED 属性,指示与服务器冲突的 ICE 角色。

The remote server compared the tiebreaker values of the client and the server and determined that the client needs to switch roles.
远端服务器比较了客户端和服务器的“界定值”,确定客户端需要切换角色。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值