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

5、ICE Candidate Gathering and Exchange【ICE Candidate 收集和交换】

As part of ICE processing, both the initiating and responding agents gather candidates, prioritize and eliminate redundant candidates, and exchange candidate information with the peer as defined by the using protocol (ICE usage). Specifics of the candidate-encoding mechanism and the semantics of candidate information exchange is out of scope of this specification.
作为ICE处理的一部分,发起和响应代理均会收集候选者,确定优先级并消除冗余候选者,并根据使用协议(ICE用法)定义与对等方交换候选者信息。 候选编码机制的详细信息以及候选信息交换的语义超出了本规范的范围。

5.1. Full Implementation 【全实现】

5.1.1. Gathering Candidates 【收集候选者地址】

An ICE agent gathers candidates when it believes that communication is imminent.
ICE代理认为即将进行交流时便会收集candidate。

An initiating agent can do this based on a user interface cue or on an explicit request to initiate a session.
发起代理可以基于用户界面提示或发起会话的显式请求来执行此操作。

Every candidate has a transport address. It also has a type and a base.
每个candidate 都有一个运输地址。 它还具有类型和base。

Four types are defined and gathered by this specification – host candidates, server-reflexive candidates, peer-reflexive candidates, and relayed candidates.
本规范定义和收集了四种类型-host candidates, server-reflexive candidates, peer-reflexive candidates, 和 relayed candidates

The server-reflexive candidates are gathered using STUN or TURN, and relayed candidates are obtained through TURN.
server-reflexive candidates用STUN或TURN收集,relayed candidates用TURN收集。

Peer-reflexive candidates are obtained in later phases of ICE, as a consequence of connectivity checks.
由于进行了连接检查,因此在ICE的后续阶段中收集Peer-reflexive candidate。

The process for gathering candidates at the responding agent is identical to the process for the initiating agent.
响应代理处收集候选者地址的过程与发起代理处的过程相同。

It is RECOMMENDED that the responding agent begin this process immediately on receipt of the candidate information, prior to alerting the user of the application associated with the ICE session.
建议响应代理在收到候选信息后立即开始此过程,然后再提醒用户与 ICE 会话相关联的应用程序。

5.1.1.1****. Host Candidates

Host candidates are obtained by binding to ports on an IP address attached to an interface (physical or virtual, including VPN interfaces) on the host.
主机候选是通过绑定到连接到主机上的接口(物理或虚拟,包括 VPN 接口)的 IP 地址上的端口来获得的。

For each component of each data stream the ICE agent wishes to use, the agent SHOULD obtain a candidate on each IP address that the host has, with the exceptions listed below.
对于 ICE 代理希望使用的每个数据流的每个组件,代理应该在主机拥有的每个 IP 地址上获取一个候选地址,下面列出的例外情况除外:

The agent obtains each candidate by binding to a UDP port on the specific IP address.
代理通过绑定到特定 IP 地址上的 UDP 端口来获取每个候选对象。

A host candidate (and indeed every candidate) is always associated with a specific component for which it is a candidate. Each component has an ID assigned to it, called the “component ID”.
一个host candidate(实际上是每个候选者)总是与一个候选者的特定组件相关联。 每个组件都有一个分配给它的 ID,称为“组件 ID”。

For RTP/RTCP data streams, unless both RTP and RTCP are multiplexed in the same UDP port (RTP/RTCP multiplexing), the RTP itself has a component ID of 1, and RTCP has a component ID of 2. In case of RTP/ RTCP multiplexing, a component ID of 1 is used for both RTP and RTCP.
对于 RTP/RTCP 数据流,除非 RTP 和 RTCP 在同一个 UDP 端口复用(RTP/RTCP 复用),否则 RTP 本身的组件 ID 为 1,而 RTCP 的组件 ID 为 2。 RTCP 复用,RTP 和 RTCP 都使用组件 ID 1。

When candidates are obtained, unless the agent knows for sure that RTP/RTCP multiplexing will be used (i.e., the agent knows that the other agent also supports, and is willing to use, RTP/RTCP multiplexing), or unless the agent only supports RTP/RTCP multiplexing, the agent MUST obtain a separate candidate for RTCP.
获得候选时,除非代理确定将使用 RTP/RTCP 复用(即代理知道其他代理也支持并愿意使用 RTP/RTCP 复用),或者代理仅支持 RTP/RTCP 复用,否则代理必须获得一个单独的 RTCP 候选。

If an agent has obtained a candidate for RTCP, and ends up using RTP/ RTCP multiplexing, the agent does not need to perform connectivity checks on the RTCP candidate. Absence of a component ID 2 as such does not imply use of RTCP/RTP multiplexing, as it could also mean that RTCP is not used.
如果代理已经获得 RTCP 的候选,并最终使用 RTP/RTCP 复用,则代理不需要对 RTCP 候选执行连接检查。 缺少组件 ID 2 并不意味着使用 RTCP/RTP 多路复用,因为这也可能意味着不使用 RTCP。

If an agent is using separate candidates for RTP and RTCP, it will end up with 2K host candidates if an agent has K IP addresses.
如果一个代理使用不同的 RTP 和 RTCP 候选,则该代理有 K 个 IP 地址时,它将将得到 2
K 个主机候选。

Note that the responding agent, when obtaining its candidates, will typically know if the other agent supports RTP/RTCP multiplexing, in which case it will not need to obtain a separate candidate for RTCP.
注:响应代理在获取其候选对象时,通常会知道其他代理是否支持 RTP/RTCP 复用,在这种情况下,它不需要为 RTCP 获取单独的候选对象。

However, absence of a component ID 2 as such does not imply use of RTCP/RTP multiplexing, as it could also mean that RTCP is not used.
然而,组件 ID 2 的缺失并不意味着使用 RTCP/RTP 多路复用,因为这也可能意味着不使用 RTCP。

The use of multiple components, other than for RTP/RTCP streams, is discouraged as it increases the complexity of ICE processing.If multiple components are needed, the component IDs SHOULD start with 1 and increase by 1 for each component.
相比于使用多个组件,更推荐使用 RTP/RTCP 流,因为前者增加 ICE 处理的复杂性。如果需要多个组件,则组件ID应从1开始,每个组件增加1。

The base for each host candidate is set to the candidate itself.
主机候选者的base是它自己.

The host candidates are gathered from all IP addresses with the following exceptions:
host candidates 可以从所有IP地址收集到,但以下情况除外:

The IPv6 default address selection specification [RFC6724] specifies that temporary addresses [RFC4941] are to be preferred over permanent addresses.
IPv6 默认地址选择规范 [RFC6724] 指定临时地址 [RFC4941] 优先于永久地址。

5.1.1.2****. Server-Reflexive and Relayed Candidates

An ICE agent SHOULD gather server-reflexive and relayed candidates.
ICE 代理应该收集Server-ReflexivRelayed的候选对象。

However, use of STUN and TURN servers may be unnecessary in certain networks and use of TURN servers may be expensive, so some deployments may elect not to use them.
但是,在某些网络中可能不需要使用 STUN 和 TURN 服务器,并且使用 TURN 服务器可能很昂贵,因此某些部署可能会选择不使用它们。

If an agent does not gather server-reflexive or relayed candidates, it is RECOMMENDED that the functionality be implemented and just disabled through configuration, so that it can be re-enabled through configuration if conditions change in the future.
如果代理不收集Server-ReflexivRelayed候选者,建议实现该功能并通过配置禁用,以便在未来条件发生变化时可以通过配置重新启用。

The agent pairs each host candidate with the STUN or TURN servers with which it is configured or has discovered by some means.
代理将用配置或者以某种方式发现的方法给每个 host candidate与STUN 或 TURN 服务器配对。

It is RECOMMENDED that a domain name be configured, the DNS procedures in [RFC5389] (using SRV records with the “stun” service) be used to discover the STUN server, and the DNS procedures in [RFC5766] (using SRV records with the “turn” service) be used to discover the TURN server.
建议配置域名,使用 [RFC5389] 中的 DNS 程序(使用带有“stun”服务的 SRV 记录)来发现 STUN 服务器,以及 [RFC5766] 中的 DNS 程序(使用带有“stun”服务的 SRV 记录) “turn”服务)用于发现 TURN 服务器。

When multiple STUN or TURN servers are available (or when they are learned through DNS records and multiple results are returned), the agent MAY gather candidates for all of them and SHOULD gather candidates for at least one of them (one STUN server and one TURN server).
当多个 STUN 或 TURN 服务器可用时(或者当它们通过 DNS 记录学习并返回多个结果时),代理可以为所有这些服务器收集候选,并且应该为其中至少一个(一个 STUN 服务器和一个 TURN 服务器)收集候选 服务器)。

It does so by pairing host candidates with STUN or TURN servers, and for each pair, the agent sends a Binding or Allocate request to the server from the host candidate.
它通过将主机候选与 STUN 或 TURN 服务器配对来实现,代理从主机候选向服务器发送绑定或分配请求给每一对。

Binding requests to a STUN server are not authenticated, and any ALTERNATE-SERVER attribute in a response is ignored.
绑定到 STUN 服务器的请求不被验证,并且响应中的任何 ALTERNATE-SERVER 属性都将被忽略。

Agents MUST support the backwards- compatibility mode for the Binding request defined in [RFC5389].
代理必须支持 [[RFC5389] 中定义的绑定请求的向后兼容模式

Allocate requests SHOULD be authenticated using a long-term credential obtained by the client through some other means.
分配请求应该使用客户端通过其他方式获得的长期凭证进行认证。

The gathering process is controlled using a timer, Ta. Every time Ta expires, the agent can generate another new STUN or TURN transaction.
收集过程由定时器 Ta 控制。每次 Ta 到期时,代理可以生成另一个新的 STUN 或 TURN 事务。

This transaction can be either a retry of a previous transaction that failed with a recoverable error (such as authentication failure) or a transaction for a new host candidate and STUN or TURN server pair.
该事务可以是由先前因可恢复错误(例如身份验证失败)而失败的事务重试的,也可以是新主机候选和 STUN 或 TURN 服务器对的事务。

The agent SHOULD NOT generate transactions more frequently than once per each ta expiration. See Section 14 for guidance on how to set Ta and the STUN retransmit timer, RTO.
代理不应该在每个 ta 到期时更频繁地生成事务。 有关如何设置 Ta 和 STUN 重传定时器 RTO 的指导,请参见 [第 14 节]。

The agent will receive a Binding or Allocate response.
代理将收到绑定或分配响应。

A successful Allocate response will provide the agent with a server-reflexive candidate (obtained from the mapped address) and a relayed candidate in the XOR-RELAYED-ADDRESS attribute.
成功的分配响应将为代理提供server-reflexive候选(从映射地址获得)和 XOR-RELAYED-ADDRESS 属性的relayed候选。

If the Allocate request is rejected because the server lacks resources to fulfill it, the agent SHOULD instead send a Binding request to obtain a server-reflexive candidate.
如果分配请求因为服务器缺乏资源来满足它而被拒绝,代理应该发送一个绑定请求来获得一个server-reflexive候选。

A Binding response will provide the agent with only a server-reflexive candidate (also obtained from the mapped address). The base of the server-reflexive candidate is the host candidate from which the Allocate or Binding request was sent.
绑定响应将仅向代理提供server-reflexive candidate(也从映射地址获得)。 server-reflexive candidate的base是发送分配或绑定请求的host candidate。

The base of a relayed candidate is that candidate itself. If a relayed candidate is identical to a host candidate (which can happen in rare cases), the relayed candidate MUST be discarded.
relayed candidate的base是该candidate本身。 如果中继候选与主机候选相同(在极少数情况下可能发生),则必须丢弃中继候选。

If an IPv6-only agent is in a network that utilizes NAT64 [RFC6146] and DNS64 [RFC6147] technologies, it may also gather IPv4 server- reflexive and/or relayed candidates from IPv4-only STUN or TURN servers.
如果仅 IPv6 代理位于使用 NAT64 [RFC6146] 和 DNS64 [RFC6147] 技术的网络中,它也可能从仅 IPv4 的 STUN 或 TURN 服务器收集 IPv4 服务器反射和/或中继候选。

IPv6-only agents SHOULD also utilize IPv6 prefix discovery [RFC7050] to discover the IPv6 prefix used by NAT64 (if any) and generate server-reflexive candidates for each IPv6-only interface, accordingly.
IPv6-only 代理还应该利用 IPv6 前缀发现者 [RFC7050] 来发现 NAT64 使用的 IPv6 前缀(如果有的话),并相应地为每个 IPv6-only 接口生成服务器自反候选。

The NAT64 server-reflexive candidates are prioritized like IPv4 server-reflexive candidates.
NAT64 服务器反射候选的优先级与 IPv4 服务器反射候选一样

5.1.1.3****. Computing Foundations 【计算基础】

The ICE agent assigns each candidate a foundation. Two candidates have the same foundation when all of the following are true:
ICE 代理为每个候选人分配一个foundation。 当以下所有条件都为真时,两名候选人具有相同的foundation

Similarly, two candidates have different foundations if their types are different, their bases have different IP addresses, the STUN or TURN servers used to obtain them have different IP addresses (the IP addresses used by the agent to contact the STUN or TURN server), or their transport protocols are different.
同样,如果两个候选人的类型不同,他们的foundation有不同的IP地址,则两个候选地址有不同的base,用于获取他们的STUN或TURN服务器具有不同的IP地址(代理用于联系STUN或TURN服务器的IP地址), 或者它们的传输协议不同。

5.1.1.4****. Keeping Candidates AliveCandidates保活】

Once server-reflexive and relayed candidates are allocated, they MUST be kept alive until ICE processing has completed, as described in Section 8.3.
一旦分配了server-reflexive和relayed候选,它们必须保持活动状态直到 ICE 处理完成。

For server-reflexive candidates learned through a Binding request, the bindings MUST be kept alive by additional Binding requests to the server.
对于通过绑定请求获悉的server-reflexive candidates,绑定必须通过向服务器发送的附加绑定请求保持活动状态。

Refreshes for allocations are done using the Refresh transaction, as described in [RFC5766].
如 [RFC5766] 中所述,分配的刷新是使用 Refresh 事务完成的。

The Refresh requests will also refresh the server-reflexive candidate. Host candidates do not time out, but the candidate addresses may change or disappear for a number of reasons.
刷新请求还将刷新server-reflexive候选。 Host候选不会超时,但候选地址可能会因多种原因而更改或消失。

An ICE agent SHOULD monitor the interfaces it uses, invalidate candidates whose base has gone away, and acquire new candidates as appropriate when new IP addresses (on new or currently used interfaces) appear.
ICE 代理应该监视它使用的接口,使base已经消失的候选者无效,并在新 IP 地址(在新的或当前使用的接口上)出现时适当地获取新的candidates。

5.1.2****. Prioritizing Candidates【优先候选者】

The prioritization process results in the assignment of a priority to each candidate.
优先排序过程为每个候选人分配优先级。

Each candidate for a data stream MUST have a unique priority that MUST be a positive integer between 1 and (231 - 1).
数据流的每个候选必须具有唯一的优先级,该优先级必须是 1 和 (231 - 1) 之间的正整数。

This priority will be used by ICE to determine the order of the connectivity checks and the relative preference for candidates.
ICE 将使用此优先级来确定连接检查的顺序和候选者的相对偏好。

Higher-priority values give more priority over lower values. An ICE agent SHOULD compute this priority using the formula in Section 5.1.2.1 and choose its parameters using the guidelines in Section 5.1.2.2.
较高优先级的值比较低的值具有更高的优先级。 ICE 代理应该使用 [Section 5.1.2.1] 中的公式计算此优先级,并使用 [Section 5.1.2.2] 中的指南选择其参数

If an agent elects to use a different formula, ICE may take longer to converge since the agents will not be coordinated in their checks.
如果代理选择使用不同的公式,则 ICE 可能需要更长的时间才能收敛,因为代理在检查中不会得到协调。

The process for prioritizing candidates is common across the initiating and the responding agent.
对候选人进行优先排序的过程在发起和响应代理之间是通用的。

5.1.2.1****. Recommended Formula【推荐公式】

The recommended formula combines a preference for the candidate type (server reflexive, peer reflexive, relayed, and host), a preference for the IP address for which the candidate was obtained, and a component ID using the following formula:
推荐的公式结合了候选类型(server reflexive, peer reflexive, relayed, 和 host)的首选项,以下公式用候选 IP 地址的首选项和组件 ID来计算:

priority = (2^24)(type preference) + (2^8)**(local preference) + (2^0)(256 - component ID) **
优先级 = (2^24)
(类型优先级) + (2^8)(本地优先级) + (2^0)(256 - 组件 ID)

The type preference MUST be an integer from 0 (lowest preference) to 126 (highest preference) inclusive, MUST be identical for all candidates of the same type, and MUST be different for candidates of different types.
类型偏好必须是一个从 0(最低优先级)到 126(最高优先级)的整数,对于相同类型的所有候选必须是相同的,对于不同类型的候选必须是不同的。

The type preference for peer-reflexive candidates MUST be higher than that of server-reflexive candidates. Setting the value to 0 means that candidates of this type will only be used as a last resort.
peer-reflexive候选的类型优先级必须高于 server-reflexive 候选。 将该值设置为 0 意味着这种类型的候选项将仅用作最后的手段。

Note that candidates gathered based on the procedures of Section 5.1.1 will never be peer-reflexive candidates; candidates of this type are learned from the connectivity checks performed by ICE.
请注意,根据 [第 5.1.1 节] 的程序收集的候选地址永远不会是peer-reflexive的候选地址; 这种类型的候选是从 ICE 执行的连接检查中获取的。

The local preference MUST be an integer from 0 (lowest preference) to 65535 (highest preference) inclusive.
本地优先级必须是从 0(最低优先级)到 65535(最高优先级)的整数。

When there is only a single IP address, this value SHOULD be set to 65535.
当只有一个 IP 地址时,这个值应该设置为 65535。

If there are multiple candidates for a particular component for a particular data stream that have the same type, the local preference MUST be unique for each one.
如果具有相同类型的特定数据流的特定组件有多个候选,则本地优先级对于每个候选必须是唯一的。

If an ICE agent is dual stack, the local preference SHOULD be set according to the current best practice described in [RFC8421].
如果 ICE 代理是双栈的,则应该根据 [RFC8421] 中描述的当前最佳实践设置本地首选项。

The component ID MUST be an integer between 1 and 256 inclusive.
组件 ID 必须是介于 1 和 256 之间的整数。

5.1.2.2****. Guidelines for Choosing Type and Local Preferences

The RECOMMENDED values for type preferences are 126 for host candidates, 110 for peer-reflexive candidates, 100 for server- reflexive candidates, and 0 for relayed candidates.
类型优先级的推荐值:host候选为 126,peer-reflexive 候选为 110,server- reflexive候选为 100,relayed候选为 0。

If an ICE agent is multihomed and has multiple IP addresses, the recommendations in [RFC8421] SHOULD be followed.
如果 ICE 代理是多宿主的并且有多个 IP 地址,则应该遵循 [RFC8421] 中的建议。

If multiple TURN servers are used, local priorities for the candidates obtained from the TURN servers are chosen in a similar fashion as for multihomed local candidates: the local preference value is used to indicate a preference among different servers, but the preference MUST be unique for each one.
如果使用多个 TURN 服务器,则从 TURN 服务器获得的候选地址的本地优先级以与多宿主本地候选地址类似的方式选择:本地优先级用于指示不同服务器之间的优先级,但 每个服务器优先级必须是唯一的。

When choosing type preferences, agents may take into account factors such as latency, packet loss, cost, network topology, security, privacy, and others.
在选择类型优先级时,代理可能会考虑诸如延迟、数据包丢失、成本、网络拓扑、安全性、隐私等因素。

5.1.3. Eliminating Redundant Candidates【消除冗余Candidates】

Next, the ICE agents (initiating and responding) eliminate redundant candidates.
接下来,ICE 代理(发起和响应)消除多余的候选者。

Two candidates can have the same transport address yet different bases, and these would not be considered redundant.
两个候选可以具有相同的传输地址但不同的基址,这些不会被认为是多余的。

Frequently, a server-reflexive candidate and a host candidate will be redundant when the agent is not behind a NAT.
通常,当代理不在 NAT 之后时,server-reflexive候选和host候选将是多余的。

A candidate is redundant if and only if its transport address and base equal those of another candidate.
当且仅当一个candidate的传输地址和基址等于另一个candidate的传输地址和基址时,它才是冗余的。

The agent SHOULD eliminate the redundant candidate with the lower priority.
代理应该消除具有较低优先级的冗余Candidates。

5.2. Lite Implementation Procedures【Lite实施过程】

Lite implementations only utilize host candidates. For each IP address, independent of an IP address family, there MUST be zero or one candidate. With the lite implementation, ICE cannot be used to dynamically choose amongst candidates.
Lite 实现仅使用host candidates。 对于每个独立于 IP 地址族的 IP 地址,必须有零个或一个候选地址。 使用 lite 实现时不能让 ICE 在候选中动态选择。

Therefore, including more than one candidate from a particular IP address family is NOT RECOMMENDED, since only a connectivity check can truly determine whether to use one address or the other.
因此,不建议使用包含来自特定 IP 地址系列的多个候选地址,因为只有连接检查才能真正确定是使用一个地址还是另一个地址。

Instead, it is RECOMMENDED that agents that have multiple public IP addresses run full ICE implementations to ensure the best usage of its addresses.
相反,建议具有多个公共 IP 地址的代理运行完整的 ICE 实现,以确保其地址的最佳使用。

Each component has an ID assigned to it, called the “component ID”. For RTP/RTCP data streams, unless RTCP is multiplexed in the same port with RTP, the RTP itself has a component ID of 1 and RTCP a component ID of 2.
每个组件都有一个分配给它的 ID,称为“组件 ID”。 对于RTP/RTCP数据流,除非RTCP与RTP复用在同一个端口,否则RTP本身的组件ID为1,RTCP的组件ID为2。

If an agent is using RTCP without multiplexing, it MUST obtain candidates for it.
如果代理正在使用没有多路复用的 RTCP,则代理必须收集它的candidates。

However, absence of a component ID 2 as such does not imply use of RTCP/RTP multiplexing, as it could also mean that RTCP is not used.
然而,组件 ID 2 的缺失并不意味着使用 RTCP/RTP 多路复用,因为这也可能意味着不使用 RTCP。

Each candidate is assigned a foundation. The foundation MUST be different for two candidates allocated from different IP addresses; otherwise, it MUST be the same. A simple integer that increments for each IP address will suffice.
每个candidate都被分配了一个foundation。 对于从不同 IP 地址分配的两个candidate,foundation必须不同; 否则,它必须是相同的candidate。简单整数足以为每个 IP 地址递增。

In addition, each candidate MUST be assigned a unique priority amongst all candidates for the same data stream. If the formula in Section 5.1.2.1 is used to calculate the priority, the type preference value SHOULD be set to 126.
此外,必须为同一数据流的所有候选对象分配唯一的优先级。 如果使用Section 5.1.2.1中的公式计算优先级,则类型优先级值应该设置为126。

If a host is IPv4 only, the local preference value SHOULD be set to 65535.
如果主机仅为 IPv4,则本地首选项值应设置为 65535。

If a host is IPv6 or dual stack, the local preference value SHOULD be set to the precedence value for IP addresses described in RFC 6724 [RFC6724].
如果主机是 IPv6 或双栈,本地优先值应该设置为 [RFC 6724] [[RFC6724]] 中描述的 IP 地址的优先值。

Next, an agent chooses a default candidate for each component of each data stream.
接下来,代理为每个数据流的每个组件选择一个默认候选。

If a host is IPv4 only, there would only be one candidate for each component of each data stream; therefore, that candidate is the default. If a host is IPv6 only, the default candidate would typically be a globally scoped IPv6 address.
如果主机只有 IPv4,则每个数据流的每个组件只有一个候选; 因此,该候选是默认的。 如果主机仅为 IPv6,则默认候选地址通常是全局范围的 IPv6 地址。

Dual- stack hosts SHOULD allow configuration whether IPv4 or IPv6 is used for the default candidate, and the configuration needs to be based on which one its administrator believes has a higher chance of success in the current network environment.
双栈主机应该允许配置默认候选是使用 IPv4 还是 IPv6,并且配置需要基于它的管理员认为在当前网络环境中成功的机会更高。

The procedures in this section are common across the initiating and responding agents.
本节中的过程在发起和响应代理之间是通用的。

5.3. Exchanging Candidate Information【交换Candidate信息】

ICE agents (initiating and responding) need the following information about candidates to be exchanged. Each ICE usage MUST define how the information is exchanged with the using protocol. This section describes the information that needs to be exchanged.
ICE 代理(发起和响应)需要以下有关要交换的候选信息。 每个 ICE 用法必须定义如何与使用的协议交换信息。 本节介绍需要交换的信息。

Candidates: One or more candidates. For each candidate:
候选对象:一个或多个候选对象。 对于每个candidate:

Address: The IP address and transport protocol port of the candidate.
地址:候选的IP地址和传输协议端口。

Transport: The transport protocol of the candidate. This MAY be omitted if the using protocol only runs over a single transport protocol.
传输:候选的传输协议。 如果 使用的协议仅在单个传输协议上运行,则可以省略此项。

Foundation: A sequence of up to 32 characters.
基础:最多 32 个字符的序列。

Component ID: The component ID of the candidate. This MAY be omitted if the using protocol does not use the concept of components.
组件ID:候选组件ID。 如果使用的协议不使用组件的概念,则可以省略此项。

Priority: The 32-bit priority of the candidate.
优先级:候选的 32 位优先级。

Type: The type of the candidate.
类型:候选的类型。

Related Address and Port: The related IP address and port of the candidate. These MAY be omitted or set to invalid values if the agent does not want to reveal them, e.g., for privacy reasons.
相关地址和端口:候选的相关IP地址和端口。 如果代理不想透露它们,例如出于隐私原因,这些可以被省略或设置为无效值。

Extensibility Parameters: The using protocol might define means for adding new per-candidate ICE parameters in the future.
可扩展性参数:使用的协议可能会定义在未来添加新的每个候选 ICE 参数的方法。

Lite or Full: Whether the agent is a lite agent or full agent.
Lite 或 Full: 代理是 Lite 代理还是Full代理。

Connectivity-Check Pacing Value: The pacing value for connectivity checks that the agent wishes to use. This MAY be omitted if the agent wishes to use a defined default value.
连接检查步调值(Pacing Value):代理希望使用的连接检查的Pacing Value。 如果代理希望使用定义的默认值,则可以省略此项。

Username Fragment and Password: Values used to perform connectivity checks. The values MUST be unguessable, with at least 128 bits of random number generator output used to generate the password, and at least 24 bits of output to generate the username fragment.
用户名片段和密码:用于执行连接检查的值。 这些值必须是不可猜测的,至少 128 位随机数生成器输出用于生成密码,至少 24 位输出用于生成用户名片段。

Extensions: New media-stream or session-level attributes (ICE options).
扩展:新的媒体流或会话级属性(ICE 选项)。

If the using protocol is vulnerable to, and able to detect, ICE mismatch (Section 5.4), a way is needed for the detecting agent to convey this information to its peer. It is a boolean flag.
如果使用的协议是脆弱的,并能够检测到 ICE 不匹配(第 5.4 节),则检测代理需要一种方法来将此信息传达给其对等方。 它是一个布尔标志。

The using protocol may (or may not) need to deal with backwards compatibility with older implementations that do not support ICE.
使用的协议可能(或可能不)需要处理与不支持 ICE 的旧实现的向后兼容性。

If a fallback mechanism to non-ICE is supported and is being used, then presumably the using protocol provides a way of conveying the default candidate (its IP address and port) in addition to the ICE parameters.
如果支持并正在使用非 ICE 的回退机制,那么除了 ICE 参数之外,使用的协议可能还提供了一种传送默认候选(其 IP 地址和端口)的方法。

Once an agent has sent its candidate information, it MUST be prepared to receive both STUN and data packets on each candidate. As discussed in Section 12.1, data packets can be sent to a candidate prior to its appearance as the default destination for data.
一旦代理发送了它的候选信息,它必须准备好接收每个候选的 STUN 和数据包。 如第 12.1 节所述,数据包可以在候选者作为数据的默认目的地出现之前发送给它。

5.4. ICE Mismatch【ICE 不匹配】

Certain middleboxes, such as ALGs, can alter signaling information in ways that break ICE (e.g., by rewriting IP addresses in SDP).
某些中间件,例如 ALG,可以通过破坏 ICE 的方式(例如,通过在 SDP 中重写 IP 地址)来更改信令信息。

This is referred to as “ICE mismatch”. If the using protocol is vulnerable to ICE mismatch, the responding agent needs to be able to detect it and inform the peer ICE agent about the ICE mismatch.
这被称为“ICE 不匹配”。 如果使用的协议容易受到 ICE 不匹配的影响,则响应代理需要能够检测到它并通知对等 ICE 代理有关 ICE 不匹配的信息。

Each using protocol needs to define whether the using protocol is vulnerable to ICE mismatch, how ICE mismatch is detected, and whether specific actions need to be taken when ICE mismatch is detected.
每个使用协议都需要定义使用协议是否容易受到 ICE 不匹配的影响,如何检测 ICE 不匹配,以及在检测到 ICE 不匹配时是否需要采取特定措施。

5、ICE Candidate Gathering and Exchange【ICE Candidate 收集和交换】相关推荐

  1. ice 服务java连接,java - ICE中的连接计数 - 堆栈内存溢出

    是的,您应该这样做. 每个通信器都创建两个线程池: 客户端线程池为传出连接提供服务,这主要涉及处理传出请求的回复,并包括通知AMI回调对象. 如果在双向模式下使用连接,则客户端线程池还将调度传入的回调 ...

  2. 详细教你如何部署ICE服务(三)---IceBox框架 Ice Registry服务注册中心的联合使用

    在详细教你如何部署ICE服务(二)---IceBox加载启动Ice服务这篇博客中,我们使用了IceBox来设计服务代码和启动Ice服务. 单单使用IceBox组件来设计和启动Ice服务,客户端必须将服 ...

  3. 怎么下载lce_飞冰ICE官方下载|阿里飞冰ice(Iceworks)下载 v2.15.0 官方版_最火软件站...

    Iceworks(飞冰 GUI),这是一个图形化界面的开发平台,它承载了ICE的物料体系和开发体验,飞冰(ICE)是一套基于React的中后台应用解决方案,在阿里巴巴内部,已经有270多个来自几乎所有 ...

  4. ONNX(Open Neural Network Exchange ):开放式神经网络交换

    ONNX(Open Neural Network Exchange ): 是一个用于表示深度学习模型的标准,可使模型在不同框架之间进行转移: 1. 是一种针对机器学习所设计的开放式的文件格式,用于存储 ...

  5. 19. Security Considerations【安全注意事项】

    原文链接:https://datatracker.ietf.org/doc/html/rfc8445#section-19 19. Security Considerations[安全注意事项] 19 ...

  6. WebRTC 之ICE浅谈

    前言 ICE全称Interactive Connectivity Establishment:交互式连通建立方式. ICE参照RFC5245建议实现,是一组基于offer/answer模式解决NAT穿 ...

  7. WebRtc以Trickle ICE形式去进行pair

    文章目录 简介 时序图 伪代码 主动方 被动方 简介 Trickle ICE(Interactive Connectivity Establishment)是WebRTC的一种流程,它允许WebRTC ...

  8. 【webrtc】websocket交换sdp实现ice链接

    前言 上一次进行了手动交换sdp成功进行了ice连接,但是正常情况下,不可能是让你手动交换,因为你能手动交换,说明你们之间已经有了传输通道,不然怎么获取对方的sdp.所以一般情况下,需要有个中间的服务 ...

  9. 配置C++和C#开发ICE环境

    2019独角兽企业重金招聘Python工程师标准>>> C++配置环境 1.设置编译工具路径和配置编译命令: #编译命令,如果有多个文件就执行多次slice2cpp.exe命令 se ...

最新文章

  1. 程序员,快通知你们老板上吴恩达的最新AI课
  2. 多目标跟踪笔记二:Efficient Algorithms for Finding the K Best Paths Through a Trellis
  3. LeNet试验(五)观察“彩票假说”现象
  4. CSS 单行溢出文本显示省略号...的方法(兼容IE FF)(转)
  5. SAP WebIDE里本地运行Fiori应用后,会自动生成一个新的Destination
  6. 在 Ali Kubernetes 系统中,我们这样实践混沌工程
  7. 小汤学编程之JavaEE学习day04——EL表达式、JSTL
  8. 良好的开端是成功的第一步———构建程序
  9. 《TCP/IP详解卷1》学习小结(一)------链接层
  10. LINUX右键新建,增加项目
  11. WinHex license添加(v19测试可用)
  12. 抖音内测语音直播交友 能够用声音打开社交的一扇门吗?
  13. python 运行报错 Process finished with exit code -1073740791 (0xC0000409)
  14. 金蝶EAS BOS工作流开发(附带JAVA脚本)
  15. 黄金分割法 c语言程序,优化程序-黄金分割法C语言程序设计
  16. 永辉站上“十字路口”:上市11年首亏,巨头转身还差点什么?
  17. 一文带你复习计网中的重点知识(一万五千字长文)
  18. 操作系统——虚拟内存技术
  19. 加载elementor时出现问题_禁止elementor插件加载谷歌字体
  20. zrender基础入门,简单的案例图形绘制

热门文章

  1. 不重视,小程序将会带来大风险!——三大风险、隐私合规,小程序主该如何面对?
  2. 自动调节式防涝井盖设计
  3. Windows10系统虚拟机的创建与系统安装
  4. 渗透测试(面试)如何获取一个网站的真实ip
  5. Vue之jwt(跨域身份验证,令牌)
  6. android 旋转屏幕全屏,重新组合活动布局以在旋转屏幕时全屏播放video
  7. 2021年全球探针卡收入大约2506.3百万美元,预计2028年达到3823.8百万美元,2022至2028期间,年复合增长率CAGR为 6.2%
  8. 如何扩展计算机c盘的控件,如何无损扩展C盘空间大小,这一招足够!
  9. 可视化Docker管理工具-DockerUI
  10. 精选(26)面试官:讲讲你对ThreadLocal的理解