Internet Engineering Task Force (IETF)                        A. Keranen
Request for Comments: 8445                                   C. Holmberg
Obsoletes: 5245                                                 Ericsson
Category: Standards Track                                   J. Rosenberg
ISSN: 2070-1721                                              jdrosen.net
                                                               July 2018
        
Internet Engineering Task Force (IETF)                        A. Keranen
Request for Comments: 8445                                   C. Holmberg
Obsoletes: 5245                                                 Ericsson
Category: Standards Track                                   J. Rosenberg
ISSN: 2070-1721                                              jdrosen.net
                                                               July 2018
        

Interactive Connectivity Establishment (ICE): A Protocol for Network Address Translator (NAT) Traversal

交互式连接建立(ICE):一种用于网络地址转换器(NAT)遍历的协议

Abstract

摘要

This document describes a protocol for Network Address Translator (NAT) traversal for UDP-based communication. This protocol is called Interactive Connectivity Establishment (ICE). ICE makes use of the Session Traversal Utilities for NAT (STUN) protocol and its extension, Traversal Using Relay NAT (TURN).

本文档描述了用于基于UDP的通信的网络地址转换器(NAT)遍历协议。该协议称为交互式连接建立(ICE)。ICE利用NAT(STUN)协议的会话遍历实用程序及其扩展,使用中继NAT(TURN)进行遍历。

This document obsoletes RFC 5245.

本文件废除了RFC 5245。

Status of This Memo

关于下段备忘

This is an Internet Standards Track document.

这是一份互联网标准跟踪文件。

This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community. It has received public review and has been approved for publication by the Internet Engineering Steering Group (IESG). Further information on Internet Standards is available in Section 2 of RFC 7841.

本文件是互联网工程任务组(IETF)的产品。它代表了IETF社区的共识。它已经接受了公众审查,并已被互联网工程指导小组(IESG)批准出版。有关互联网标准的更多信息,请参见RFC 7841第2节。

Information about the current status of this document, any errata, and how to provide feedback on it may be obtained at https://www.rfc-editor.org/info/rfc8445.

有关本文件当前状态、任何勘误表以及如何提供反馈的信息,请访问https://www.rfc-editor.org/info/rfc8445.

Copyright Notice

版权公告

Copyright (c) 2018 IETF Trust and the persons identified as the document authors. All rights reserved.

版权所有(c)2018 IETF信托基金和确定为文件作者的人员。版权所有。

This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.

本文件受BCP 78和IETF信托有关IETF文件的法律规定的约束(https://trustee.ietf.org/license-info)自本文件出版之日起生效。请仔细阅读这些文件,因为它们描述了您对本文件的权利和限制。从本文件中提取的代码组件必须包括信托法律条款第4.e节中所述的简化BSD许可证文本,并提供简化BSD许可证中所述的无担保。

This document may contain material from IETF Documents or IETF Contributions published or made publicly available before November 10, 2008. The person(s) controlling the copyright in some of this material may not have granted the IETF Trust the right to allow modifications of such material outside the IETF Standards Process. Without obtaining an adequate license from the person(s) controlling the copyright in such materials, this document may not be modified outside the IETF Standards Process, and derivative works of it may not be created outside the IETF Standards Process, except to format it for publication as an RFC or to translate it into languages other than English.

本文件可能包含2008年11月10日之前发布或公开的IETF文件或IETF贡献中的材料。控制某些材料版权的人员可能未授予IETF信托允许在IETF标准流程之外修改此类材料的权利。在未从控制此类材料版权的人员处获得充分许可的情况下,不得在IETF标准流程之外修改本文件,也不得在IETF标准流程之外创建其衍生作品,除了将其格式化以RFC形式发布或将其翻译成英语以外的其他语言。

Table of Contents

目录

   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   5
   2.  Overview of ICE . . . . . . . . . . . . . . . . . . . . . . .   6
     2.1.  Gathering Candidates  . . . . . . . . . . . . . . . . . .   8
     2.2.  Connectivity Checks . . . . . . . . . . . . . . . . . . .  10
     2.3.  Nominating Candidate Pairs and Concluding ICE . . . . . .  12
     2.4.  ICE Restart . . . . . . . . . . . . . . . . . . . . . . .  13
     2.5.  Lite Implementations  . . . . . . . . . . . . . . . . . .  13
   3.  ICE Usage . . . . . . . . . . . . . . . . . . . . . . . . . .  13
   4.  Terminology . . . . . . . . . . . . . . . . . . . . . . . . .  13
   5.  ICE Candidate Gathering and Exchange  . . . . . . . . . . . .  17
     5.1.  Full Implementation . . . . . . . . . . . . . . . . . . .  17
       5.1.1.  Gathering Candidates  . . . . . . . . . . . . . . . .  18
         5.1.1.1.  Host Candidates . . . . . . . . . . . . . . . . .  18
         5.1.1.2.  Server-Reflexive and Relayed Candidates . . . . .  20
         5.1.1.3.  Computing Foundations . . . . . . . . . . . . . .  21
         5.1.1.4.  Keeping Candidates Alive  . . . . . . . . . . . .  21
       5.1.2.  Prioritizing Candidates . . . . . . . . . . . . . . .  22
         5.1.2.1.  Recommended Formula . . . . . . . . . . . . . . .  22
         5.1.2.2.  Guidelines for Choosing Type and Local
                   Preferences . . . . . . . . . . . . . . . . . . .  23
       5.1.3.  Eliminating Redundant Candidates  . . . . . . . . . .  23
     5.2.  Lite Implementation Procedures  . . . . . . . . . . . . .  23
     5.3.  Exchanging Candidate Information  . . . . . . . . . . . .  24
     5.4.  ICE Mismatch  . . . . . . . . . . . . . . . . . . . . . .  26
   6.  ICE Candidate Processing  . . . . . . . . . . . . . . . . . .  26
     6.1.  Procedures for Full Implementation  . . . . . . . . . . .  26
       6.1.1.  Determining Role  . . . . . . . . . . . . . . . . . .  26
       6.1.2.  Forming the Checklists  . . . . . . . . . . . . . . .  28
         6.1.2.1.  Checklist State . . . . . . . . . . . . . . . . .  28
         6.1.2.2.  Forming Candidate Pairs . . . . . . . . . . . . .  28
         6.1.2.3.  Computing Pair Priority and Ordering Pairs  . . .  31
         6.1.2.4.  Pruning the Pairs . . . . . . . . . . . . . . . .  31
         6.1.2.5.  Removing Lower-Priority Pairs . . . . . . . . . .  31
         6.1.2.6.  Computing Candidate Pair States . . . . . . . . .  32
       6.1.3.  ICE State . . . . . . . . . . . . . . . . . . . . . .  36
       6.1.4.  Scheduling Checks . . . . . . . . . . . . . . . . . .  36
         6.1.4.1.  Triggered-Check Queue . . . . . . . . . . . . . .  36
         6.1.4.2.  Performing Connectivity Checks  . . . . . . . . .  36
     6.2.  Lite Implementation Procedures  . . . . . . . . . . . . .  38
   7.  Performing Connectivity Checks  . . . . . . . . . . . . . . .  38
     7.1.  STUN Extensions . . . . . . . . . . . . . . . . . . . . .  38
       7.1.1.  PRIORITY  . . . . . . . . . . . . . . . . . . . . . .  38
       7.1.2.  USE-CANDIDATE . . . . . . . . . . . . . . . . . . . .  38
       7.1.3.  ICE-CONTROLLED and ICE-CONTROLLING  . . . . . . . . .  39
     7.2.  STUN Client Procedures  . . . . . . . . . . . . . . . . .  39
       7.2.1.  Creating Permissions for Relayed Candidates . . . . .  39
        
   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   5
   2.  Overview of ICE . . . . . . . . . . . . . . . . . . . . . . .   6
     2.1.  Gathering Candidates  . . . . . . . . . . . . . . . . . .   8
     2.2.  Connectivity Checks . . . . . . . . . . . . . . . . . . .  10
     2.3.  Nominating Candidate Pairs and Concluding ICE . . . . . .  12
     2.4.  ICE Restart . . . . . . . . . . . . . . . . . . . . . . .  13
     2.5.  Lite Implementations  . . . . . . . . . . . . . . . . . .  13
   3.  ICE Usage . . . . . . . . . . . . . . . . . . . . . . . . . .  13
   4.  Terminology . . . . . . . . . . . . . . . . . . . . . . . . .  13
   5.  ICE Candidate Gathering and Exchange  . . . . . . . . . . . .  17
     5.1.  Full Implementation . . . . . . . . . . . . . . . . . . .  17
       5.1.1.  Gathering Candidates  . . . . . . . . . . . . . . . .  18
         5.1.1.1.  Host Candidates . . . . . . . . . . . . . . . . .  18
         5.1.1.2.  Server-Reflexive and Relayed Candidates . . . . .  20
         5.1.1.3.  Computing Foundations . . . . . . . . . . . . . .  21
         5.1.1.4.  Keeping Candidates Alive  . . . . . . . . . . . .  21
       5.1.2.  Prioritizing Candidates . . . . . . . . . . . . . . .  22
         5.1.2.1.  Recommended Formula . . . . . . . . . . . . . . .  22
         5.1.2.2.  Guidelines for Choosing Type and Local
                   Preferences . . . . . . . . . . . . . . . . . . .  23
       5.1.3.  Eliminating Redundant Candidates  . . . . . . . . . .  23
     5.2.  Lite Implementation Procedures  . . . . . . . . . . . . .  23
     5.3.  Exchanging Candidate Information  . . . . . . . . . . . .  24
     5.4.  ICE Mismatch  . . . . . . . . . . . . . . . . . . . . . .  26
   6.  ICE Candidate Processing  . . . . . . . . . . . . . . . . . .  26
     6.1.  Procedures for Full Implementation  . . . . . . . . . . .  26
       6.1.1.  Determining Role  . . . . . . . . . . . . . . . . . .  26
       6.1.2.  Forming the Checklists  . . . . . . . . . . . . . . .  28
         6.1.2.1.  Checklist State . . . . . . . . . . . . . . . . .  28
         6.1.2.2.  Forming Candidate Pairs . . . . . . . . . . . . .  28
         6.1.2.3.  Computing Pair Priority and Ordering Pairs  . . .  31
         6.1.2.4.  Pruning the Pairs . . . . . . . . . . . . . . . .  31
         6.1.2.5.  Removing Lower-Priority Pairs . . . . . . . . . .  31
         6.1.2.6.  Computing Candidate Pair States . . . . . . . . .  32
       6.1.3.  ICE State . . . . . . . . . . . . . . . . . . . . . .  36
       6.1.4.  Scheduling Checks . . . . . . . . . . . . . . . . . .  36
         6.1.4.1.  Triggered-Check Queue . . . . . . . . . . . . . .  36
         6.1.4.2.  Performing Connectivity Checks  . . . . . . . . .  36
     6.2.  Lite Implementation Procedures  . . . . . . . . . . . . .  38
   7.  Performing Connectivity Checks  . . . . . . . . . . . . . . .  38
     7.1.  STUN Extensions . . . . . . . . . . . . . . . . . . . . .  38
       7.1.1.  PRIORITY  . . . . . . . . . . . . . . . . . . . . . .  38
       7.1.2.  USE-CANDIDATE . . . . . . . . . . . . . . . . . . . .  38
       7.1.3.  ICE-CONTROLLED and ICE-CONTROLLING  . . . . . . . . .  39
     7.2.  STUN Client Procedures  . . . . . . . . . . . . . . . . .  39
       7.2.1.  Creating Permissions for Relayed Candidates . . . . .  39
        
       7.2.2.  Forming Credentials . . . . . . . . . . . . . . . . .  39
       7.2.3.  Diffserv Treatment  . . . . . . . . . . . . . . . . .  40
       7.2.4.  Sending the Request . . . . . . . . . . . . . . . . .  40
       7.2.5.  Processing the Response . . . . . . . . . . . . . . .  40
         7.2.5.1.  Role Conflict . . . . . . . . . . . . . . . . . .  40
         7.2.5.2.  Failure . . . . . . . . . . . . . . . . . . . . .  41
           7.2.5.2.1.  Non-Symmetric Transport Addresses . . . . . .  41
           7.2.5.2.2.  ICMP Error  . . . . . . . . . . . . . . . . .  41
           7.2.5.2.3.  Timeout . . . . . . . . . . . . . . . . . . .  41
           7.2.5.2.4.  Unrecoverable STUN Response . . . . . . . . .  41
         7.2.5.3.  Success . . . . . . . . . . . . . . . . . . . . .  42
           7.2.5.3.1.  Discovering Peer-Reflexive Candidates . . . .  42
           7.2.5.3.2.  Constructing a Valid Pair . . . . . . . . . .  43
           7.2.5.3.3.  Updating Candidate Pair States  . . . . . . .  44
           7.2.5.3.4.  Updating the Nominated Flag . . . . . . . . .  44
         7.2.5.4.  Checklist State Updates . . . . . . . . . . . . .  44
     7.3.  STUN Server Procedures  . . . . . . . . . . . . . . . . .  45
       7.3.1.  Additional Procedures for Full Implementations  . . .  45
         7.3.1.1.  Detecting and Repairing Role Conflicts  . . . . .  46
         7.3.1.2.  Computing Mapped Addresses  . . . . . . . . . . .  47
         7.3.1.3.  Learning Peer-Reflexive Candidates  . . . . . . .  47
         7.3.1.4.  Triggered Checks  . . . . . . . . . . . . . . . .  47
         7.3.1.5.  Updating the Nominated Flag . . . . . . . . . . .  49
       7.3.2.  Additional Procedures for Lite Implementations  . . .  49
   8.  Concluding ICE Processing . . . . . . . . . . . . . . . . . .  50
     8.1.  Procedures for Full Implementations . . . . . . . . . . .  50
       8.1.1.  Nominating Pairs  . . . . . . . . . . . . . . . . . .  50
       8.1.2.  Updating Checklist and ICE States . . . . . . . . . .  51
     8.2.  Procedures for Lite Implementations . . . . . . . . . . .  52
     8.3.  Freeing Candidates  . . . . . . . . . . . . . . . . . . .  53
       8.3.1.  Full Implementation Procedures  . . . . . . . . . . .  53
       8.3.2.  Lite Implementation Procedures  . . . . . . . . . . .  53
   9.  ICE Restarts  . . . . . . . . . . . . . . . . . . . . . . . .  53
   10. ICE Option  . . . . . . . . . . . . . . . . . . . . . . . . .  54
   11. Keepalives  . . . . . . . . . . . . . . . . . . . . . . . . .  54
   12. Data Handling . . . . . . . . . . . . . . . . . . . . . . . .  55
     12.1.  Sending Data . . . . . . . . . . . . . . . . . . . . . .  55
       12.1.1.  Procedures for Lite Implementations  . . . . . . . .  56
     12.2.  Receiving Data . . . . . . . . . . . . . . . . . . . . .  56
   13. Extensibility Considerations  . . . . . . . . . . . . . . . .  57
   14. Setting Ta and RTO  . . . . . . . . . . . . . . . . . . . . .  57
     14.1.  General  . . . . . . . . . . . . . . . . . . . . . . . .  57
     14.2.  Ta . . . . . . . . . . . . . . . . . . . . . . . . . . .  58
     14.3.  RTO  . . . . . . . . . . . . . . . . . . . . . . . . . .  58
   15. Examples  . . . . . . . . . . . . . . . . . . . . . . . . . .  59
     15.1.  Example with IPv4 Addresses  . . . . . . . . . . . . . .  60
     15.2.  Example with IPv6 Addresses  . . . . . . . . . . . . . .  65
        
       7.2.2.  Forming Credentials . . . . . . . . . . . . . . . . .  39
       7.2.3.  Diffserv Treatment  . . . . . . . . . . . . . . . . .  40
       7.2.4.  Sending the Request . . . . . . . . . . . . . . . . .  40
       7.2.5.  Processing the Response . . . . . . . . . . . . . . .  40
         7.2.5.1.  Role Conflict . . . . . . . . . . . . . . . . . .  40
         7.2.5.2.  Failure . . . . . . . . . . . . . . . . . . . . .  41
           7.2.5.2.1.  Non-Symmetric Transport Addresses . . . . . .  41
           7.2.5.2.2.  ICMP Error  . . . . . . . . . . . . . . . . .  41
           7.2.5.2.3.  Timeout . . . . . . . . . . . . . . . . . . .  41
           7.2.5.2.4.  Unrecoverable STUN Response . . . . . . . . .  41
         7.2.5.3.  Success . . . . . . . . . . . . . . . . . . . . .  42
           7.2.5.3.1.  Discovering Peer-Reflexive Candidates . . . .  42
           7.2.5.3.2.  Constructing a Valid Pair . . . . . . . . . .  43
           7.2.5.3.3.  Updating Candidate Pair States  . . . . . . .  44
           7.2.5.3.4.  Updating the Nominated Flag . . . . . . . . .  44
         7.2.5.4.  Checklist State Updates . . . . . . . . . . . . .  44
     7.3.  STUN Server Procedures  . . . . . . . . . . . . . . . . .  45
       7.3.1.  Additional Procedures for Full Implementations  . . .  45
         7.3.1.1.  Detecting and Repairing Role Conflicts  . . . . .  46
         7.3.1.2.  Computing Mapped Addresses  . . . . . . . . . . .  47
         7.3.1.3.  Learning Peer-Reflexive Candidates  . . . . . . .  47
         7.3.1.4.  Triggered Checks  . . . . . . . . . . . . . . . .  47
         7.3.1.5.  Updating the Nominated Flag . . . . . . . . . . .  49
       7.3.2.  Additional Procedures for Lite Implementations  . . .  49
   8.  Concluding ICE Processing . . . . . . . . . . . . . . . . . .  50
     8.1.  Procedures for Full Implementations . . . . . . . . . . .  50
       8.1.1.  Nominating Pairs  . . . . . . . . . . . . . . . . . .  50
       8.1.2.  Updating Checklist and ICE States . . . . . . . . . .  51
     8.2.  Procedures for Lite Implementations . . . . . . . . . . .  52
     8.3.  Freeing Candidates  . . . . . . . . . . . . . . . . . . .  53
       8.3.1.  Full Implementation Procedures  . . . . . . . . . . .  53
       8.3.2.  Lite Implementation Procedures  . . . . . . . . . . .  53
   9.  ICE Restarts  . . . . . . . . . . . . . . . . . . . . . . . .  53
   10. ICE Option  . . . . . . . . . . . . . . . . . . . . . . . . .  54
   11. Keepalives  . . . . . . . . . . . . . . . . . . . . . . . . .  54
   12. Data Handling . . . . . . . . . . . . . . . . . . . . . . . .  55
     12.1.  Sending Data . . . . . . . . . . . . . . . . . . . . . .  55
       12.1.1.  Procedures for Lite Implementations  . . . . . . . .  56
     12.2.  Receiving Data . . . . . . . . . . . . . . . . . . . . .  56
   13. Extensibility Considerations  . . . . . . . . . . . . . . . .  57
   14. Setting Ta and RTO  . . . . . . . . . . . . . . . . . . . . .  57
     14.1.  General  . . . . . . . . . . . . . . . . . . . . . . . .  57
     14.2.  Ta . . . . . . . . . . . . . . . . . . . . . . . . . . .  58
     14.3.  RTO  . . . . . . . . . . . . . . . . . . . . . . . . . .  58
   15. Examples  . . . . . . . . . . . . . . . . . . . . . . . . . .  59
     15.1.  Example with IPv4 Addresses  . . . . . . . . . . . . . .  60
     15.2.  Example with IPv6 Addresses  . . . . . . . . . . . . . .  65
        
   16. STUN Extensions . . . . . . . . . . . . . . . . . . . . . . .  69
     16.1.  Attributes . . . . . . . . . . . . . . . . . . . . . . .  69
     16.2.  New Error-Response Codes . . . . . . . . . . . . . . . .  70
   17. Operational Considerations  . . . . . . . . . . . . . . . . .  70
     17.1.  NAT and Firewall Types . . . . . . . . . . . . . . . . .  70
     17.2.  Bandwidth Requirements . . . . . . . . . . . . . . . . .  70
       17.2.1.  STUN and TURN Server-Capacity Planning . . . . . . .  71
       17.2.2.  Gathering and Connectivity Checks  . . . . . . . . .  71
       17.2.3.  Keepalives . . . . . . . . . . . . . . . . . . . . .  72
     17.3.  ICE and ICE-Lite . . . . . . . . . . . . . . . . . . . .  72
     17.4.  Troubleshooting and Performance Management . . . . . . .  72
     17.5.  Endpoint Configuration . . . . . . . . . . . . . . . . .  73
   18. IAB Considerations  . . . . . . . . . . . . . . . . . . . . .  73
     18.1.  Problem Definition . . . . . . . . . . . . . . . . . . .  73
     18.2.  Exit Strategy  . . . . . . . . . . . . . . . . . . . . .  74
     18.3.  Brittleness Introduced by ICE  . . . . . . . . . . . . .  74
     18.4.  Requirements for a Long-Term Solution  . . . . . . . . .  75
     18.5.  Issues with Existing NAPT Boxes  . . . . . . . . . . . .  75
   19. Security Considerations . . . . . . . . . . . . . . . . . . .  76
     19.1.  IP Address Privacy . . . . . . . . . . . . . . . . . . .  76
     19.2.  Attacks on Connectivity Checks . . . . . . . . . . . . .  77
     19.3.  Attacks on Server-Reflexive Address Gathering  . . . . .  80
     19.4.  Attacks on Relayed Candidate Gathering . . . . . . . . .  80
     19.5.  Insider Attacks  . . . . . . . . . . . . . . . . . . . .  81
       19.5.1.  STUN Amplification Attack  . . . . . . . . . . . . .  81
   20. IANA Considerations . . . . . . . . . . . . . . . . . . . . .  82
     20.1.  STUN Attributes  . . . . . . . . . . . . . . . . . . . .  82
     20.2.  STUN Error Responses . . . . . . . . . . . . . . . . . .  82
     20.3.  ICE Options  . . . . . . . . . . . . . . . . . . . . . .  82
   21. Changes from RFC 5245 . . . . . . . . . . . . . . . . . . . .  83
   22. References  . . . . . . . . . . . . . . . . . . . . . . . . .  84
     22.1.  Normative References . . . . . . . . . . . . . . . . . .  84
     22.2.  Informative References . . . . . . . . . . . . . . . . .  85
   Appendix A.  Lite and Full Implementations  . . . . . . . . . . .  89
   Appendix B.  Design Motivations . . . . . . . . . . . . . . . . .  90
     B.1.  Pacing of STUN Transactions . . . . . . . . . . . . . . .  90
     B.2.  Candidates with Multiple Bases  . . . . . . . . . . . . .  92
     B.3.  Purpose of the Related-Address and Related-Port
           Attributes  . . . . . . . . . . . . . . . . . . . . . . .  94
     B.4.  Importance of the STUN Username . . . . . . . . . . . . .  95
     B.5.  The Candidate Pair Priority Formula . . . . . . . . . . .  96
     B.6.  Why Are Keepalives Needed?  . . . . . . . . . . . . . . .  96
     B.7.  Why Prefer Peer-Reflexive Candidates? . . . . . . . . . .  97
     B.8.  Why Are Binding Indications Used for Keepalives?  . . . .  97
     B.9.  Selecting Candidate Type Preference . . . . . . . . . . .  97
   Appendix C.  Connectivity-Check Bandwidth . . . . . . . . . . . .  99
   Acknowledgements  . . . . . . . . . . . . . . . . . . . . . . . . 100
   Authors' Addresses  . . . . . . . . . . . . . . . . . . . . . . . 100
        
   16. STUN Extensions . . . . . . . . . . . . . . . . . . . . . . .  69
     16.1.  Attributes . . . . . . . . . . . . . . . . . . . . . . .  69
     16.2.  New Error-Response Codes . . . . . . . . . . . . . . . .  70
   17. Operational Considerations  . . . . . . . . . . . . . . . . .  70
     17.1.  NAT and Firewall Types . . . . . . . . . . . . . . . . .  70
     17.2.  Bandwidth Requirements . . . . . . . . . . . . . . . . .  70
       17.2.1.  STUN and TURN Server-Capacity Planning . . . . . . .  71
       17.2.2.  Gathering and Connectivity Checks  . . . . . . . . .  71
       17.2.3.  Keepalives . . . . . . . . . . . . . . . . . . . . .  72
     17.3.  ICE and ICE-Lite . . . . . . . . . . . . . . . . . . . .  72
     17.4.  Troubleshooting and Performance Management . . . . . . .  72
     17.5.  Endpoint Configuration . . . . . . . . . . . . . . . . .  73
   18. IAB Considerations  . . . . . . . . . . . . . . . . . . . . .  73
     18.1.  Problem Definition . . . . . . . . . . . . . . . . . . .  73
     18.2.  Exit Strategy  . . . . . . . . . . . . . . . . . . . . .  74
     18.3.  Brittleness Introduced by ICE  . . . . . . . . . . . . .  74
     18.4.  Requirements for a Long-Term Solution  . . . . . . . . .  75
     18.5.  Issues with Existing NAPT Boxes  . . . . . . . . . . . .  75
   19. Security Considerations . . . . . . . . . . . . . . . . . . .  76
     19.1.  IP Address Privacy . . . . . . . . . . . . . . . . . . .  76
     19.2.  Attacks on Connectivity Checks . . . . . . . . . . . . .  77
     19.3.  Attacks on Server-Reflexive Address Gathering  . . . . .  80
     19.4.  Attacks on Relayed Candidate Gathering . . . . . . . . .  80
     19.5.  Insider Attacks  . . . . . . . . . . . . . . . . . . . .  81
       19.5.1.  STUN Amplification Attack  . . . . . . . . . . . . .  81
   20. IANA Considerations . . . . . . . . . . . . . . . . . . . . .  82
     20.1.  STUN Attributes  . . . . . . . . . . . . . . . . . . . .  82
     20.2.  STUN Error Responses . . . . . . . . . . . . . . . . . .  82
     20.3.  ICE Options  . . . . . . . . . . . . . . . . . . . . . .  82
   21. Changes from RFC 5245 . . . . . . . . . . . . . . . . . . . .  83
   22. References  . . . . . . . . . . . . . . . . . . . . . . . . .  84
     22.1.  Normative References . . . . . . . . . . . . . . . . . .  84
     22.2.  Informative References . . . . . . . . . . . . . . . . .  85
   Appendix A.  Lite and Full Implementations  . . . . . . . . . . .  89
   Appendix B.  Design Motivations . . . . . . . . . . . . . . . . .  90
     B.1.  Pacing of STUN Transactions . . . . . . . . . . . . . . .  90
     B.2.  Candidates with Multiple Bases  . . . . . . . . . . . . .  92
     B.3.  Purpose of the Related-Address and Related-Port
           Attributes  . . . . . . . . . . . . . . . . . . . . . . .  94
     B.4.  Importance of the STUN Username . . . . . . . . . . . . .  95
     B.5.  The Candidate Pair Priority Formula . . . . . . . . . . .  96
     B.6.  Why Are Keepalives Needed?  . . . . . . . . . . . . . . .  96
     B.7.  Why Prefer Peer-Reflexive Candidates? . . . . . . . . . .  97
     B.8.  Why Are Binding Indications Used for Keepalives?  . . . .  97
     B.9.  Selecting Candidate Type Preference . . . . . . . . . . .  97
   Appendix C.  Connectivity-Check Bandwidth . . . . . . . . . . . .  99
   Acknowledgements  . . . . . . . . . . . . . . . . . . . . . . . . 100
   Authors' Addresses  . . . . . . . . . . . . . . . . . . . . . . . 100
        
1. Introduction
1. 介绍

Protocols establishing communication sessions between peers typically involve exchanging IP addresses and ports for the data sources and sinks. However, this poses challenges when operated through Network Address Translators (NATs) [RFC3235]. These protocols also seek to create a data flow directly between participants, so that there is no application-layer intermediary between them. This is done to reduce data latency, decrease packet loss, and reduce the operational costs of deploying the application. However, this is difficult to accomplish through NATs. A full treatment of the reasons for this is beyond the scope of this specification.

在对等方之间建立通信会话的协议通常涉及交换数据源和接收器的IP地址和端口。然而,当通过网络地址转换器(NAT)[RFC3235]进行操作时,这会带来挑战。这些协议还寻求在参与者之间直接创建数据流,以便在参与者之间没有应用层中介。这样做是为了减少数据延迟、减少数据包丢失和降低部署应用程序的操作成本。然而,这很难通过NAT实现。对此原因的全面处理超出了本规范的范围。

Numerous solutions have been defined for allowing these protocols to operate through NATs. These include Application Layer Gateways (ALGs), the Middlebox Control Protocol [RFC3303], the original Simple Traversal of UDP Through NAT (STUN) specification [RFC3489] (note that RFC 3489 has been obsoleted by RFC 5389), and Realm Specific IP [RFC3102] [RFC3103] along with session description extensions needed to make them work, such as the Session Description Protocol (SDP) attribute [RFC4566] for the Real-Time Control Protocol (RTCP) [RFC3605]. Unfortunately, these techniques all have pros and cons that make each one optimal in some network topologies, but a poor choice in others. The result is that administrators and implementers are making assumptions about the topologies of the networks in which their solutions will be deployed. This introduces complexity and brittleness into the system.

为了允许这些协议通过NAT运行,已经定义了许多解决方案。其中包括应用层网关(ALG)、中间盒控制协议[RFC3303]、原始的UDP通过NAT(STUN)规范的简单遍历[RFC3489](注意,RFC 3489已被RFC 5389淘汰)、领域特定IP[RFC3102][RFC3103]以及使其工作所需的会话描述扩展,例如,实时控制协议(RTCP)[RFC3605]的会话描述协议(SDP)属性[RFC4566]。不幸的是,这些技术都有优点和缺点,使得它们在某些网络拓扑中都是最优的,但在其他网络拓扑中却不是一个好的选择。结果是,管理员和实现人员正在对将部署其解决方案的网络拓扑进行假设。这给系统带来了复杂性和脆弱性。

This specification defines Interactive Connectivity Establishment (ICE) as a technique for NAT traversal for UDP-based data streams (though ICE has been extended to handle other transport protocols, such as TCP [RFC6544]). ICE works by exchanging a multiplicity of IP addresses and ports, which are then tested for connectivity by peer-to-peer connectivity checks. The IP addresses and ports are exchanged using ICE-usage-specific mechanisms (e.g., in an Offer/ Answer exchange), and the connectivity checks are performed using STUN [RFC5389]. ICE also makes use of Traversal Using Relay around NAT (TURN) [RFC5766], an extension to STUN. Because ICE exchanges a multiplicity of IP addresses and ports for each media stream, it also allows for address selection for multihomed and dual-stack hosts. For this reason, RFC 5245 [RFC5245] deprecated the solutions previously defined in RFC 4091 [RFC4091] and RFC 4092 [RFC4092].

本规范将交互式连接建立(ICE)定义为基于UDP的数据流的NAT遍历技术(尽管ICE已扩展到处理其他传输协议,如TCP[RFC6544])。ICE的工作原理是交换多个IP地址和端口,然后通过点对点连接检查对其进行连接测试。IP地址和端口使用特定于ICE使用的机制进行交换(例如,在提供/应答交换中),并使用STUN[RFC5389]执行连接检查。ICE还利用NAT(TURN)[RFC5766]周围的中继进行遍历,这是STUN的一个扩展。由于ICE为每个媒体流交换多个IP地址和端口,因此它还允许为多主机和双堆栈主机选择地址。因此,RFC 5245[RFC5245]不推荐先前在RFC 4091[RFC4091]和RFC 4092[RFC4092]中定义的解决方案。

Appendix B provides background information and motivations regarding the design decisions that were made when designing ICE.

附录B提供了有关ICE设计决策的背景信息和动机。

2. Overview of ICE
2. ICE概述

In a typical ICE deployment, there are two endpoints (ICE agents) that want to communicate. Note that ICE is not intended for NAT traversal for the signaling protocol, which is assumed to be provided via another mechanism. ICE assumes that the agents are able to establish a signaling connection between each other.

在典型的ICE部署中,有两个端点(ICE代理)需要通信。请注意,ICE不用于信令协议的NAT遍历,这被认为是通过另一种机制提供的。ICE假设代理能够在彼此之间建立信令连接。

Initially, the agents are ignorant of their own topologies. In particular, the agents may or may not be behind NATs (or multiple tiers of NATs). ICE allows the agents to discover enough information about their topologies to potentially find one or more paths by which they can establish a data session.

最初,代理不知道自己的拓扑结构。特别地,代理可以在NAT(或多个NAT层)后面,也可以不在NAT后面。ICE允许代理发现有关其拓扑的足够信息,以便潜在地找到一条或多条路径,通过这些路径可以建立数据会话。

Figure 1 shows a typical ICE deployment. The agents are labeled L and R. Both L and R are behind their own respective NATs, though they may not be aware of it. The type of NAT and its properties are also unknown. L and R are capable of engaging in a candidate exchange process, whose purpose is to set up a data session between L and R. Typically, this exchange will occur through a signaling server (e.g., a SIP proxy).

图1显示了典型的ICE部署。代理被标记为L和R。L和R都在各自的NAT后面,尽管他们可能不知道。NAT的类型及其属性也未知。L和R能够参与候选交换过程,其目的是在L和R之间建立数据会话。通常,该交换将通过信令服务器(例如SIP代理)进行。

In addition to the agents, a signaling server, and NATs, ICE is typically used in concert with STUN or TURN servers in the network. Each agent can have its own STUN or TURN server, or they can be the same.

除了代理、信令服务器和NAT之外,ICE通常与网络中的STUN或TURN服务器配合使用。每个代理可以有自己的眩晕或转身服务器,也可以是相同的。

                               +---------+
             +--------+        |Signaling|         +--------+
             | STUN   |        |Server   |         | STUN   |
             | Server |        +---------+         | Server |
             +--------+       /           \        +--------+
                             /             \
                            /               \
                           / <- Signaling -> \
                          /                   \
                   +--------+               +--------+
                   |  NAT   |               |  NAT   |
                   +--------+               +--------+
                      /                             \
                     /                               \
                 +-------+                       +-------+
                 | Agent |                       | Agent |
                 |   L   |                       |   R   |
                 +-------+                       +-------+
        
                               +---------+
             +--------+        |Signaling|         +--------+
             | STUN   |        |Server   |         | STUN   |
             | Server |        +---------+         | Server |
             +--------+       /           \        +--------+
                             /             \
                            /               \
                           / <- Signaling -> \
                          /                   \
                   +--------+               +--------+
                   |  NAT   |               |  NAT   |
                   +--------+               +--------+
                      /                             \
                     /                               \
                 +-------+                       +-------+
                 | Agent |                       | Agent |
                 |   L   |                       |   R   |
                 +-------+                       +-------+
        

Figure 1: ICE Deployment Scenario

图1:ICE部署场景

The basic idea behind ICE is as follows: each agent has a variety of candidate transport addresses (combination of IP address and port for a particular transport protocol, which is always UDP in this specification) it could use to communicate with the other agent. These might include:

ICE背后的基本思想如下:每个代理都有各种候选传输地址(特定传输协议的IP地址和端口的组合,在本规范中始终是UDP),可用于与其他代理通信。这些措施可能包括:

o A transport address on a directly attached network interface

o 直接连接的网络接口上的传输地址

o A translated transport address on the public side of a NAT (a "server-reflexive" address)

o NAT公共端的翻译传输地址(“服务器自反”地址)

o A transport address allocated from a TURN server (a "relayed address")

o 从TURN服务器分配的传输地址(“中继地址”)

Potentially, any of L's candidate transport addresses can be used to communicate with any of R's candidate transport addresses. In practice, however, many combinations will not work. For instance, if L and R are both behind NATs, their directly attached interface addresses are unlikely to be able to communicate directly (this is why ICE is needed, after all!). The purpose of ICE is to discover which pairs of addresses will work. The way that ICE does this is to systematically try all possible pairs (in a carefully sorted order) until it finds one or more that work.

潜在地,L的任何候选传输地址都可用于与R的任何候选传输地址通信。然而,在实践中,许多组合都不起作用。例如,如果L和R都在NAT后面,那么它们直接连接的接口地址不太可能直接通信(这就是为什么需要ICE的原因!)。ICE的目的是发现哪对地址有效。ICE这样做的方式是系统地尝试所有可能的配对(以仔细排序的顺序),直到找到一个或多个有效的配对。

2.1. Gathering Candidates
2.1. 召集候选人

In order to execute ICE, an ICE agent identifies and gathers one or more address candidates. A candidate has a transport address -- a combination of IP address and port for a particular transport protocol (with only UDP specified here). There are different types of candidates; some are derived from physical or logical network interfaces, and others are discoverable via STUN and TURN.

为了执行ICE,ICE代理识别并收集一个或多个候选地址。候选者有一个传输地址——特定传输协议的IP地址和端口的组合(此处仅指定UDP)。有不同类型的候选人;有些源于物理或逻辑网络接口,另一些则可通过STUN和TURN发现。

The first category of candidates are those with a transport address obtained directly from a local interface. Such a candidate is called a "host candidate". The local interface could be Ethernet or Wi-Fi, or it could be one that is obtained through a tunnel mechanism, such as a Virtual Private Network (VPN) or Mobile IP (MIP). In all cases, such a network interface appears to the agent as a local interface from which ports (and thus candidates) can be allocated.

第一类候选者是具有直接从本地接口获得的传输地址的候选者。这种候选人被称为“东道主候选人”。本地接口可以是以太网或Wi-Fi,也可以是通过隧道机制获得的接口,如虚拟专用网络(VPN)或移动IP(MIP)。在所有情况下,这样的网络接口在代理看来都是一个本地接口,可以从中分配端口(以及候选端口)。

Next, the agent uses STUN or TURN to obtain additional candidates. These come in two flavors: translated addresses on the public side of a NAT (server-reflexive candidates) and addresses on TURN servers (relayed candidates). When TURN servers are utilized, both types of candidates are obtained from the TURN server. If only STUN servers are utilized, only server-reflexive candidates are obtained from them. The relationship of these candidates to the host candidate is

接下来,代理使用眩晕或转身来获得其他候选。它们有两种风格:NAT公共端的翻译地址(服务器自反候选)和TURN服务器上的地址(中继候选)。当使用TURN服务器时,两种类型的候选者都从TURN服务器获得。如果仅使用STUN服务器,则仅从它们获得服务器自反候选。这些候选人与东道国候选人的关系如下:

shown in Figure 2. In this figure, both types of candidates are discovered using TURN. In the figure, the notation X:x means IP address X and UDP port x.

如图2所示。在这个图中,两种类型的候选者都是使用TURN发现的。在图中,符号X:X表示IP地址X和UDP端口X。

To Internet

上网

                          |
                          |
                          |  /------------  Relayed
                      Y:y | /               Address
                      +--------+
                      |        |
                      |  TURN  |
                      | Server |
                      |        |
                      +--------+
                          |
                          |
                          | /------------  Server
                   X1':x1'|/               Reflexive
                    +------------+         Address
                    |    NAT     |
                    +------------+
                          |
                          | /------------  Local
                      X:x |/               Address
                      +--------+
                      |        |
                      | Agent  |
                      |        |
                      +--------+
        
                          |
                          |
                          |  /------------  Relayed
                      Y:y | /               Address
                      +--------+
                      |        |
                      |  TURN  |
                      | Server |
                      |        |
                      +--------+
                          |
                          |
                          | /------------  Server
                   X1':x1'|/               Reflexive
                    +------------+         Address
                    |    NAT     |
                    +------------+
                          |
                          | /------------  Local
                      X:x |/               Address
                      +--------+
                      |        |
                      | Agent  |
                      |        |
                      +--------+
        

Figure 2: Candidate Relationships

图2:候选关系

When the agent sends a TURN Allocate request from IP address and port X:x, the NAT (assuming there is one) will create a binding X1':x1', mapping this server-reflexive candidate to the host candidate X:x. Outgoing packets sent from the host candidate will be translated by the NAT to the server-reflexive candidate. Incoming packets sent to the server-reflexive candidate will be translated by the NAT to the host candidate and forwarded to the agent. The host candidate associated with a given server-reflexive candidate is the "base".

当代理从IP地址和端口X:X发送TURN Allocate请求时,NAT(假设有一个)将创建绑定X1':X1',将此服务器自反候选映射到主机候选X:X。从主机候选发送的传出数据包将由NAT转换为服务器自反候选。发送到服务器自反候选的传入数据包将由NAT转换为主机候选并转发给代理。与给定服务器自反候选关联的主机候选是“基”。

Note: "Base" refers to the address an agent sends from for a particular candidate. Thus, as a degenerate case, host candidates also have a base, but it's the same as the host candidate.

注:“基”是指代理为特定候选人发送的地址。因此,作为一种退化情况,宿主候选者也有一个基数,但它与宿主候选者相同。

When there are multiple NATs between the agent and the TURN server, the TURN request will create a binding on each NAT, but only the outermost server-reflexive candidate (the one nearest the TURN server) will be discovered by the agent. If the agent is not behind a NAT, then the base candidate will be the same as the server-reflexive candidate, and the server-reflexive candidate is redundant and will be eliminated.

当代理和TURN服务器之间存在多个NAT时,TURN请求将在每个NAT上创建绑定,但代理只会发现最外层的服务器自反候选(距离TURN服务器最近的一个)。如果代理不在NAT后面,那么基本候选将与服务器自反候选相同,并且服务器自反候选是冗余的,将被消除。

The Allocate request then arrives at the TURN server. The TURN server allocates a port y from its local IP address Y, and generates an Allocate response, informing the agent of this relayed candidate. The TURN server also informs the agent of the server-reflexive candidate, X1':x1', by copying the source transport address of the Allocate request into the Allocate response. The TURN server acts as a packet relay, forwarding traffic between L and R. In order to send traffic to L, R sends traffic to the TURN server at Y:y, and the TURN server forwards that to X1':x1', which passes through the NAT where it is mapped to X:x and delivered to L.

然后,分配请求到达TURN服务器。TURN服务器从其本地IP地址y分配端口y,并生成分配响应,将此中继候选通知代理。TURN服务器还通过将Allocate请求的源传输地址复制到Allocate响应中来通知代理服务器自反候选者X1':X1'。转弯服务器充当数据包中继,在L和R之间转发流量。为了向L发送流量,R在Y:Y向转弯服务器发送流量,转弯服务器将该流量转发到X1':X1',该流量通过NAT,在NAT中映射到X:X并传递到L。

When only STUN servers are utilized, the agent sends a STUN Binding request [RFC5389] to its STUN server. The STUN server will inform the agent of the server-reflexive candidate X1':x1' by copying the source transport address of the Binding request into the Binding response.

当仅使用STUN服务器时,代理向其STUN服务器发送STUN绑定请求[RFC5389]。通过将绑定请求的源传输地址复制到绑定响应中,STUN服务器将通知代理服务器自反候选X1':X1'。

2.2. Connectivity Checks
2.2. 连通性检查

Once L has gathered all of its candidates, it orders them by highest-to-lowest priority and sends them to R over the signaling channel. When R receives the candidates from L, it performs the same gathering process and responds with its own list of candidates. At the end of this process, each ICE agent has a complete list of both its candidates and its peer's candidates. It pairs them up, resulting in candidate pairs. To see which pairs work, each agent schedules a series of connectivity checks. Each check is a STUN request/response transaction that the client will perform on a particular candidate pair by sending a STUN request from the local candidate to the remote candidate.

一旦L收集了所有候选对象,它就会按从高到低的优先级对它们进行排序,并通过信令通道将它们发送给R。当R从L接收到候选者时,它执行相同的收集过程,并用自己的候选者列表进行响应。在这个过程结束时,每个ICE代理都有一个完整的候选名单和其同行的候选名单。它将它们配对,从而生成候选对。要查看哪些对有效,每个代理都会安排一系列连接检查。每个检查都是一个STUN请求/响应事务,客户端将通过从本地候选者向远程候选者发送STUN请求来对特定候选者对执行该事务。

The basic principle of the connectivity checks is simple:

连接检查的基本原理很简单:

1. Sort the candidate pairs in priority order.

1. 按优先级顺序对候选对进行排序。

2. Send checks on each candidate pair in priority order.

2. 按优先级顺序发送对每个候选对的检查。

3. Acknowledge checks received from the other agent.

3. 确认从其他代理收到的支票。

With both agents performing a check on a candidate pair, the result is a 4-way handshake:

当两个代理对候选对执行检查时,结果是4路握手:

L R - - STUN request -> \ L's <- STUN response / check

L R--晕眩请求->\L的<-晕眩响应/检查

                             <- STUN request  \  R's
                  STUN response ->            /  check
        
                             <- STUN request  \  R's
                  STUN response ->            /  check
        

Figure 3: Basic Connectivity Check

图3:基本连接检查

It is important to note that STUN requests are sent to and from the exact same IP addresses and ports that will be used for data (e.g., RTP, RTCP, or other protocols). Consequently, agents demultiplex STUN and data using the contents of the packets rather than the port on which they are received.

需要注意的是,STUN请求发送至和发送自将用于数据的完全相同的IP地址和端口(例如RTP、RTCP或其他协议)。因此,代理使用数据包的内容而不是接收它们的端口来解复用STUN和数据。

Because a STUN Binding request is used for the connectivity check, the STUN Binding response will contain the agent's translated transport address on the public side of any NATs between the agent and its peer. If this transport address is different from that of other candidates the agent already learned, it represents a new candidate (peer-reflexive candidate), which then gets tested by ICE just the same as any other candidate.

因为STUN绑定请求用于连接检查,所以STUN绑定响应将在代理与其对等方之间的任何NAT的公共端包含代理的翻译传输地址。如果此传输地址与代理已学习的其他候选地址不同,则它表示一个新的候选地址(对等自反候选地址),然后该候选地址与任何其他候选地址一样由ICE进行测试。

Because the algorithm above searches all candidate pairs, if a working pair exists, the algorithm will eventually find it no matter what order the candidates are tried in. In order to produce faster (and better) results, the candidates are sorted in a specified order. The resulting list of sorted candidate pairs is called the "checklist".

因为上面的算法搜索所有候选对,如果存在一个工作对,那么无论候选对的尝试顺序如何,算法最终都会找到它。为了产生更快(更好)的结果,候选项按指定顺序排序。排序后的候选对列表称为“检查表”。

The agent works through the checklist by sending a STUN request for the next candidate pair on the list periodically. These are called "ordinary checks". When a STUN transaction succeeds, one or more candidate pairs will become so-called "valid pairs" and will be added to a candidate-pair list called the "valid list".

代理通过定期发送列表上下一个候选对的STUN请求来完成检查表。这些被称为“普通支票”。当STUN事务成功时,一个或多个候选对将成为所谓的“有效对”,并将添加到称为“有效列表”的候选对列表中。

As an optimization, as soon as R gets L's check message, R schedules a connectivity-check message to be sent to L on the same candidate pair. This is called a "triggered check", and it accelerates the process of finding valid pairs.

作为一种优化,只要R获得L的检查消息,R就会安排一条连接检查消息发送到同一候选对上的L。这称为“触发检查”,它加速了查找有效对的过程。

At the end of this handshake, both L and R know that they can send (and receive) messages end to end in both directions.

在握手结束时,L和R都知道他们可以在两个方向上端到端地发送(和接收)消息。

In general, the priority algorithm is designed so that candidates of a similar type get similar priorities so that more direct routes (that is, routes without data relays or NATs) are preferred over indirect routes (routes with data relays or NATs). Within those guidelines, however, agents have a fair amount of discretion about how to tune their algorithms.

一般来说,优先级算法的设计应确保相似类型的候选路由具有相似的优先级,从而使更多的直接路由(即没有数据中继或NAT的路由)优于间接路由(有数据中继或NAT的路由)。然而,在这些准则中,代理对于如何调整其算法有相当大的自由裁量权。

A data stream might consist of multiple components (pieces of a data stream that require their own set of candidates, e.g., RTP and RTCP).

一个数据流可能由多个组件组成(数据流的各个部分需要它们自己的候选集,例如RTP和RTCP)。

2.3. Nominating Candidate Pairs and Concluding ICE
2.3. 提名候选人对和结束ICE

ICE assigns one of the ICE agents in the role of the controlling agent, and the other in the role of the controlled agent. For each component of a data stream, the controlling agent nominates a valid pair (from the valid list) to be used for data. The exact timing of the nomination is based on local policy.

ICE将其中一个ICE代理分配给控制代理,另一个分配给控制代理。对于数据流的每个组件,控制代理指定一个用于数据的有效对(来自有效列表)。提名的确切时间取决于当地政策。

When nominating, the controlling agent lets the checks continue until at least one valid pair for each component of a data stream is found, and then it picks a valid pair and sends a STUN request on that pair, using an attribute to indicate to the controlled peer that it has been nominated. This is shown in Figure 4.

指定时,控制代理让检查继续进行,直到为数据流的每个组件找到至少一个有效对,然后它选择一个有效对,并在该对上发送一个STUN请求,使用属性向受控对等方指示它已被指定。这如图4所示。

L R - - STUN request -> \ L's <- STUN response / check

L R--晕眩请求->\L的<-晕眩响应/检查

                        <- STUN request  \  R's
             STUN response ->            /  check
        
                        <- STUN request  \  R's
             STUN response ->            /  check
        
             STUN request + attribute -> \  L's
                       <- STUN response  /  check
        
             STUN request + attribute -> \  L's
                       <- STUN response  /  check
        

Figure 4: Nomination

图4:提名

Once the controlled agent receives the STUN request with the attribute, it will check (unless the check has already been done) the same pair. If the transactions above succeed, the agents will set the nominated flag for the pairs and will cancel any future checks for that component of the data stream. Once an agent has set the nominated flag for each component of a data stream, the pairs become the selected pairs. After that, only the selected pairs will be used for sending and receiving data associated with that data stream.

一旦受控代理接收到带有属性的STUN请求,它将检查(除非已完成检查)同一对。如果上述事务成功,代理将为这些对设置指定标志,并将取消对该数据流组件的任何未来检查。一旦代理为数据流的每个组件设置了指定标志,这些对就成为所选对。之后,只有选定的对将用于发送和接收与该数据流相关联的数据。

2.4. ICE Restart
2.4. 冰重启

Once ICE is concluded, it can be restarted at any time for one or all of the data streams by either ICE agent. This is done by sending updated candidate information indicating a restart.

一旦ICE结束,任何一个ICE代理都可以随时重新启动一个或所有数据流。这是通过发送指示重新启动的更新候选信息来完成的。

2.5. Lite Implementations
2.5. Lite实现

Certain ICE agents will always be connected to the public Internet and have a public IP address at which it can receive packets from any correspondent. 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). Lite agents only use host candidates and do not generate connectivity checks or run state machines, though they need to be able to respond to connectivity checks.

某些ICE代理将始终连接到公共互联网,并具有公共IP地址,可在该地址接收来自任何通信方的数据包。为了使这些设备更容易支持ICE,ICE定义了一种称为“lite”的特殊实现类型(与正常的完整实现不同)。Lite代理只使用候选主机,不生成连接检查或运行状态机,尽管它们需要能够响应连接检查。

3. ICE Usage
3. 冰的使用

This document specifies generic use of ICE with protocols that provide means to exchange candidate information between ICE agents. The specific details (i.e., how to encode candidate information and the actual candidate exchange process) for different protocols using ICE (referred to as "using protocol") are described in separate usage documents.

本文件规定了ICE与协议的一般用途,协议提供了在ICE代理之间交换候选信息的方法。使用ICE(称为“使用协议”)的不同协议的具体细节(即,如何编码候选信息和实际候选交换过程)在单独的使用文档中描述。

One mechanism that allows agents to exchange candidate information is the utilization of Offer/Answer semantics (which are based on [RFC3264]) as part of the SIP protocol [RFC3261] [ICE-SIP-SDP].

允许代理交换候选信息的一种机制是将提供/应答语义(基于[RFC3264])作为SIP协议[RFC3261][ICE-SIP-SDP]的一部分。

[RFC7825] defines an ICE usage for the Real-Time Streaming Protocol (RTSP). Note, however, that the ICE usage is based on RFC 5245.

[RFC7825]定义了实时流协议(RTSP)的ICE用法。但是,请注意,ICE的使用基于RFC 5245。

4. Terminology
4. 术语

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.

本文件中的关键词“必须”、“不得”、“必需”、“应”、“不应”、“建议”、“不建议”、“可”和“可选”在所有大写字母出现时(如图所示)应按照BCP 14[RFC2119][RFC8174]所述进行解释。

Readers need to be familiar with the terminology defined in [RFC5389] and NAT Behavioral requirements for UDP [RFC4787].

读者需要熟悉[RFC5389]中定义的术语和UDP[RFC4787]的NAT行为要求。

This specification makes use of the following additional terminology:

本规范使用了以下附加术语:

ICE Session: An ICE session consists of all ICE-related actions starting with the candidate gathering, followed by the interactions (candidate exchange, connectivity checks, nominations, and keepalives) between the ICE agents until all the candidates are released or an ICE restart is triggered.

ICE会话:ICE会话包括所有与ICE相关的操作,从候选集合开始,然后是ICE代理之间的交互(候选交换、连接检查、提名和保留),直到所有候选被释放或触发ICE重启。

ICE Agent, Agent: An ICE agent (sometimes simply referred to as an "agent") is the protocol implementation involved in the ICE candidate exchange. There are two agents involved in a typical candidate exchange.

ICE代理,代理:ICE代理(有时简称为“代理”)是ICE候选交换中涉及的协议实现。在典型的候选人交换中有两个代理人。

Initiating Peer, Initiating Agent, Initiator: An initiating agent is an ICE agent that initiates the ICE candidate exchange process.

发起对等方、发起代理、发起方:发起代理是发起ICE候选交换过程的ICE代理。

Responding Peer, Responding Agent, Responder: A responding agent is an ICE agent that receives and responds to the candidate exchange process initiated by the initiating agent.

响应对等方、响应代理、响应者:响应代理是ICE代理,接收并响应发起代理启动的候选交换过程。

ICE Candidate Exchange, Candidate Exchange: The process where ICE agents exchange information (e.g., candidates and passwords) that is needed to perform ICE. Offer/Answer with SDP encoding [RFC3264] is one example of a protocol that can be used for exchanging the candidate information.

ICE候选者交换,候选者交换:ICE代理交换执行ICE所需的信息(例如候选者和密码)的过程。SDP编码的提供/应答[RFC3264]是可用于交换候选信息的协议的一个示例。

Peer: From the perspective of one of the ICE agents in a session, its peer is the other agent. Specifically, from the perspective of the initiating agent, the peer is the responding agent. From the perspective of the responding agent, the peer is the initiating agent.

对等体:从会话中的一个ICE代理的角度来看,它的对等体是另一个代理。具体而言,从发起代理的角度来看,对等方是响应代理。从响应代理的角度来看,对等方是发起代理。

Transport Address: The combination of an IP address and the transport protocol (such as UDP or TCP) port.

传输地址:IP地址和传输协议(如UDP或TCP)端口的组合。

Data, Data Stream, Data Session: When ICE is used to set up data sessions, the data is transported using some protocol. Media is usually transported over RTP, composed of a stream of RTP packets. Data session refers to data packets that are exchanged between the peer on the path created and tested with ICE.

数据、数据流、数据会话:当使用ICE建立数据会话时,数据通过某种协议传输。媒体通常通过RTP传输,RTP由RTP数据包流组成。数据会话是指在使用ICE创建和测试的路径上的对等方之间交换的数据包。

Candidate, Candidate Information: A transport address that is a potential point of contact for receipt of data. Candidates also have properties -- their type (server reflexive, relayed, or host), priority, foundation, and base.

候选者,候选者信息:作为接收数据的潜在联系人的传输地址。候选还具有属性——类型(服务器自反、中继或主机)、优先级、基础和基。

Component: A component is a piece of a data stream. A data stream may require multiple components, each of which has to work in order for the data stream as a whole to work. For RTP/RTCP data streams, unless RTP and RTCP are multiplexed in the same port, there are two components per data stream -- one for RTP, and one for RTCP. A component has a candidate pair, which cannot be used by other components.

组件:组件是数据流的一部分。数据流可能需要多个组件,每个组件都必须工作才能使数据流作为一个整体工作。对于RTP/RTCP数据流,除非RTP和RTCP在同一端口中多路复用,否则每个数据流有两个组件——一个用于RTP,一个用于RTCP。组件有一个候选对,其他组件无法使用该候选对。

Host Candidate: A candidate obtained by binding to a specific port from an IP address on the host. This includes IP addresses on physical interfaces and logical ones, such as ones obtained through VPNs.

候选主机:通过从主机上的IP地址绑定到特定端口而获得的候选主机。这包括物理接口和逻辑接口上的IP地址,例如通过VPN获得的IP地址。

Server-Reflexive Candidate: A candidate whose IP address and port are a binding allocated by a NAT for an ICE agent after it sends a packet through the NAT to a server, such as a STUN server.

服务器自反候选者:一种候选者,其IP地址和端口是NAT通过NAT向服务器(如STUN服务器)发送数据包后为ICE代理分配的绑定。

Peer-Reflexive Candidate: A candidate whose IP address and port are a binding allocated by a NAT for an ICE agent after it sends a packet through the NAT to its peer.

对等自反候选:其IP地址和端口是NAT为ICE代理在通过NAT向其对等方发送数据包后分配的绑定的候选。

Relayed Candidate: A candidate obtained from a relay server, such as a TURN server.

中继候选对象:从中继服务器(如回合服务器)获得的候选对象。

Base: The transport address that an ICE agent sends from for a particular candidate. For host, server-reflexive, and peer-reflexive candidates, the base is the same as the host candidate. For relayed candidates, the base is the same as the relayed candidate (i.e., the transport address used by the TURN server to send from).

Base:ICE代理为特定候选者发送的传输地址。对于主机、服务器自反和对等自反候选,基与主机候选相同。对于中继候选者,基本地址与中继候选者相同(即,TURN服务器用于发送的传输地址)。

Related Address and Port: A transport address related to a candidate, which is useful for diagnostics and other purposes. If a candidate is server or peer reflexive, the related address and port is equal to the base for that server or peer-reflexive candidate. If the candidate is relayed, the related address and port are equal to the mapped address in the Allocate response that provided the client with that relayed candidate. If the candidate is a host candidate, the related address and port is identical to the host candidate.

相关地址和端口:与候选者相关的传输地址,用于诊断和其他目的。如果候选者是服务器或对等自反候选者,则相关地址和端口等于该服务器或对等自反候选者的基。如果候选者是中继的,则相关地址和端口等于为客户端提供该中继候选者的分配响应中的映射地址。如果候选主机是候选主机,则相关地址和端口与候选主机相同。

Foundation: An arbitrary string used in the freezing algorithm to group similar candidates. It is the same for two candidates that have the same type, base IP address, protocol (UDP, TCP, etc.), and STUN or TURN server. If any of these are different, then the foundation will be different.

基础:冻结算法中用于分组相似候选对象的任意字符串。对于具有相同类型、基本IP地址、协议(UDP、TCP等)和STUN或TURN服务器的两个候选服务器,这是相同的。如果其中任何一个都不同,那么基金会将有所不同。

Local Candidate: A candidate that an ICE agent has obtained and may send to its peer.

本地候选人:ICE代理已获得并可发送给其对等方的候选人。

Remote Candidate: A candidate that an ICE agent received from its peer.

远程候选对象:ICE代理从其对等方接收到的候选对象。

Default Destination/Candidate: The default destination for a component of a data stream is the transport address that would be used by an ICE agent that is not ICE aware. A default candidate for a component is one whose transport address matches the default destination for that component.

默认目的地/候选目的地:数据流组件的默认目的地是不了解ICE的ICE代理将使用的传输地址。组件的默认候选者是其传输地址与该组件的默认目标匹配的候选者。

Candidate Pair: A pair containing a local candidate and a remote candidate.

候选对:包含本地候选和远程候选的对。

Check, Connectivity Check, STUN Check: A STUN Binding request for the purpose of verifying connectivity. A check is sent from the base of the local candidate to the remote candidate of a candidate pair.

检查、连接检查、眩晕检查:用于验证连接的眩晕绑定请求。检查从本地候选基发送到候选对的远程候选。

Checklist: An ordered set of candidate pairs that an ICE agent will use to generate checks.

检查表:ICE代理将用于生成检查的一组有序候选对。

Ordinary Check: A connectivity check generated by an ICE agent as a consequence of a timer that fires periodically, instructing it to send a check.

普通检查:由ICE代理生成的连接检查,作为定时触发的结果,指示其发送检查。

Triggered Check: A connectivity check generated as a consequence of the receipt of a connectivity check from the peer.

触发检查:从对等方收到连接检查后生成的连接检查。

Valid Pair: A candidate pair whose local candidate equals the mapped address of a successful connectivity-check response and whose remote candidate equals the destination address to which the connectivity-check request was sent.

有效对:其本地候选地址等于成功连接检查响应的映射地址且其远程候选地址等于连接检查请求发送到的目标地址的候选对。

Valid List: An ordered set of candidate pairs for a data stream that have been validated by a successful STUN transaction.

有效列表:数据流的一组有序候选对,已通过成功的STUN事务验证。

Checklist Set: The ordered list of all checklists. The order is determined by each ICE usage.

检查表集:所有检查表的有序列表。顺序由每次冰用量决定。

Full Implementation: An ICE implementation that performs the complete set of functionality defined by this specification.

完整实现:执行本规范定义的完整功能集的ICE实现。

Lite Implementation: An ICE implementation that omits certain functions, implementing only as much as is necessary for a peer that is not a lite implementation to gain the benefits of ICE. Lite implementations do not maintain any of the state machines and do not generate connectivity checks.

Lite实现:省略某些功能的ICE实现,只实现非Lite实现的对等方获得ICE好处所需的功能。Lite实现不维护任何状态机,也不生成连接检查。

Controlling Agent: The ICE agent that nominates a candidate pair. In any session, there is always one controlling agent and one controlled agent.

控制代理:指定候选对的ICE代理。在任何会话中,始终有一个控制代理和一个受控代理。

Controlled Agent: The ICE agent that waits for the controlling agent to nominate a candidate pair.

受控代理:等待控制代理指定候选对的ICE代理。

Nomination: The process of the controlling agent indicating to the controlled agent which candidate pair the ICE agents will use for sending and receiving data. The nomination process defined in this specification was referred to as "regular nomination" in RFC 5245. The nomination process that was referred to as "aggressive nomination" in RFC 5245 has been deprecated in this specification.

提名:控制代理向控制代理指示ICE代理将使用哪个候选对发送和接收数据的过程。本规范中定义的提名过程在RFC 5245中称为“定期提名”。RFC 5245中称为“积极提名”的提名过程在本规范中已被弃用。

Nominated, Nominated Flag: Once the nomination of a candidate pair has succeeded, the candidate pair has become nominated, and the value of its nominated flag is set to true.

提名,提名标志:一旦候选人对提名成功,候选人对即被提名,其提名标志的值设置为true。

Selected Pair, Selected Candidate Pair: The candidate pair used for sending and receiving data for a component of a data stream is referred to as the "selected pair". Before selected pairs have been produced for a data stream, any valid pair associated with a component of a data stream can be used for sending and receiving data for the component. Once there are nominated pairs for each component of a data stream, the nominated pairs become the selected pairs for the data stream. The candidates associated with the selected pairs are referred to as "selected candidates".

选定对,选定候选对:用于发送和接收数据流组件数据的候选对称为“选定对”。在为数据流生成所选对之前,可以使用与数据流的组件相关联的任何有效对来发送和接收组件的数据。一旦数据流的每个组件都有指定对,指定对就成为数据流的选定对。与所选对关联的候选被称为“所选候选”。

Using Protocol, ICE Usage: The protocol that uses ICE for NAT traversal. A usage specification defines the protocol-specific details on how the procedures defined here are applied to that protocol.

使用协议,ICE用法:使用ICE进行NAT遍历的协议。使用规范定义了协议特定的详细信息,说明如何将此处定义的过程应用于该协议。

Timer Ta: The timer for generating new STUN or TURN transactions.

计时器Ta:用于生成新昏迷或回合事务的计时器。

Timer RTO (Retransmission Timeout): The retransmission timer for a given STUN or TURN transaction.

计时器RTO(重传超时):给定的击晕或转身事务的重传计时器。

5. ICE Candidate Gathering and Exchange
5. ICE候选人聚会和交流

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. 全面实施
5.1.1. Gathering Candidates
5.1.1. 召集候选人

An ICE agent gathers candidates when it believes that communication is imminent. 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. Four types are defined and gathered by this specification -- host candidates, server-reflexive candidates, peer-reflexive candidates, and relayed candidates. The server-reflexive candidates are gathered using STUN or TURN, and relayed candidates are obtained through TURN. Peer-reflexive candidates are obtained in later phases of ICE, as a consequence of connectivity checks.

ICE代理在认为沟通即将到来时收集候选人。启动代理可以基于用户界面提示或显式请求启动会话来完成此操作。每个候选人都有一个交通地址。它还有一个类型和一个基。本规范定义并收集了四种类型——主机候选、服务器自反候选、对等自反候选和中继候选。使用STUN或TURN收集服务器自反候选,通过TURN获得中继候选。作为连通性检查的结果,在ICE的后期阶段获得对等自反候选。

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
5.1.1.1. 主办候选人

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. The agent obtains each candidate by binding to a UDP port on the specific IP address. A host candidate (and indeed every candidate) is always associated with a specific component for which it is a candidate.

对于ICE代理希望使用的每个数据流的每个组件,代理应在主机拥有的每个IP地址上获得一个候选,以下列出的例外情况除外。代理通过绑定到特定IP地址上的UDP端口来获得每个候选。候选主机(实际上是每个候选主机)始终与它作为候选主机的特定组件相关联。

Each component has an ID assigned to it, called the "component 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.

每个组件都有一个分配给它的ID,称为“组件ID”。对于RTP/RTCP数据流,除非RTP和RTCP在同一UDP端口中多路复用(RTP/RTCP多路复用),否则RTP本身的组件ID为1,RTCP的组件ID为2。在RTP/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. 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.

获得候选时,除非代理确定将使用RTP/RTCP多路复用(即,代理知道其他代理也支持并愿意使用RTP/RTCP多路复用),或者除非代理仅支持RTP/RTCP多路复用,否则代理必须为RTCP获取单独的候选。如果代理已获得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 2*K 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. 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.

请注意,响应代理在获取其候选者时,通常会知道其他代理是否支持RTP/RTCP多路复用,在这种情况下,它不需要为RTCP获取单独的候选者。然而,缺少组件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.

每个主机候选的基数设置为候选本身。

The host candidates are gathered from all IP addresses with the following exceptions:

从所有IP地址收集候选主机,但以下情况除外:

o Addresses from a loopback interface MUST NOT be included in the candidate addresses.

o 来自环回接口的地址不得包含在候选地址中。

o Deprecated IPv4-compatible IPv6 addresses [RFC4291] and IPv6 site-local unicast addresses [RFC3879] MUST NOT be included in the address candidates.

o 候选地址中不得包括不推荐的IPv4兼容IPv6地址[RFC4291]和IPv6站点本地单播地址[RFC3879]。

o IPv4-mapped IPv6 addresses SHOULD NOT be included in the address candidates unless the application using ICE does not support IPv4 (i.e., it is an IPv6-only application [RFC4038]).

o IPv4映射的IPv6地址不应包含在地址候选中,除非使用ICE的应用程序不支持IPv4(即,它是仅限IPv6的应用程序[RFC4038])。

o If gathering one or more host candidates that correspond to an IPv6 address that was generated using a mechanism that prevents location tracking [RFC7721], host candidates that correspond to IPv6 addresses that do allow location tracking, are configured on the same interface, and are part of the same network prefix MUST NOT be gathered. Similarly, when host candidates corresponding to

o 如果收集一个或多个与使用防止位置跟踪的机制生成的IPv6地址相对应的候选主机[RFC7721],则不得收集与允许位置跟踪的IPv6地址相对应的候选主机,这些候选主机配置在同一接口上,并且是同一网络前缀的一部分。类似地,当主机候选对象对应于

an IPv6 address generated using a mechanism that prevents location tracking are gathered, then host candidates corresponding to IPv6 link-local addresses [RFC4291] MUST NOT be gathered.

收集使用防止位置跟踪的机制生成的IPv6地址,则不得收集与IPv6链路本地地址[RFC4291]对应的主机候选。

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
5.1.1.2. 服务器自反和中继候选者

An ICE agent SHOULD gather server-reflexive and relayed candidates. 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. 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.

ICE代理应收集服务器自反和中继候选服务器。但是,在某些网络中可能不需要使用STUN和TURN服务器,并且TURN服务器的使用可能会很昂贵,因此某些部署可能会选择不使用它们。如果代理未收集服务器自反或中继候选,建议通过配置实现并禁用该功能,以便在将来条件发生变化时通过配置重新启用该功能。

The agent pairs each host candidate with the STUN or TURN servers with which it is configured or has discovered by some means. 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.

代理将每个候选主机与STUN或TURN服务器配对,STUN或TURN服务器通过某种方式配置或发现。建议配置域名,[RFC5389]中的DNS过程(使用SRV记录和“stun”服务)用于发现stun服务器,[RFC5766]中的DNS过程(使用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). 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. Binding requests to a STUN server are not authenticated, and any ALTERNATE-SERVER attribute in a response is ignored. Agents MUST support the backwards-compatibility mode for the Binding request defined in [RFC5389]. Allocate requests SHOULD be authenticated using a long-term credential obtained by the client through some other means.

当多个STUN或TURN服务器可用时(或当通过DNS记录了解这些服务器并返回多个结果时),代理可以为所有这些服务器收集候选对象,并应至少为其中一个(一个STUN服务器和一个TURN服务器)收集候选对象。它通过将候选主机与STUN或TURN服务器配对来实现这一点,对于每对候选主机,代理将从候选主机向服务器发送绑定或分配请求。对STUN服务器的绑定请求未经过身份验证,响应中的任何备用服务器属性都将被忽略。代理必须支持[RFC5389]中定义的绑定请求的向后兼容模式。分配请求应该使用客户端通过其他方式获得的长期凭证进行身份验证。

The gathering process is controlled using a timer, Ta. Every time Ta expires, the agent can generate another new STUN or TURN transaction. 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. 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或TURN服务器对的事务。代理在每个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. 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. 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. 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.

代理将收到绑定或分配响应。成功的分配响应将为代理提供服务器自反候选(从映射地址获得)和XOR-relayed-address属性中的中继候选。如果分配请求因服务器缺少资源而被拒绝,则代理应该发送绑定请求以获取服务器自反候选。绑定响应将仅为代理提供服务器自反候选(也从映射地址获得)。服务器自反候选的基础是发送分配或绑定请求的主机候选。中继候选对象的基础是该候选对象本身。如果中继候选者与主机候选者相同(在极少数情况下可能发生),则必须丢弃中继候选者。

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-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. The NAT64 server-reflexive candidates are prioritized like IPv4 server-reflexive candidates.

如果仅IPv6代理位于使用NAT64[RFC6146]和DNS64[RFC6147]技术的网络中,它还可以从仅IPv4的STUN或TURN服务器收集IPv4服务器自反和/或中继候选。仅限IPv6的代理还应利用IPv6前缀发现[RFC7050]来发现NAT64使用的IPv6前缀(如果有),并相应地为每个仅限IPv6的接口生成服务器自反候选。NAT64服务器自反候选者的优先级与IPv4服务器自反候选者相同。

5.1.1.3. Computing Foundations
5.1.1.3. 计算基础

The ICE agent assigns each candidate a foundation. Two candidates have the same foundation when all of the following are true:

冰剂给每个候选者分配一个基础。以下两个候选人的基础相同:

o They have the same type (host, relayed, server reflexive, or peer reflexive).

o 它们具有相同的类型(主机、中继、服务器反射或对等反射)。

o Their bases have the same IP address (the ports can be different).

o 它们的基址具有相同的IP地址(端口可以不同)。

o For reflexive and relayed candidates, the STUN or TURN servers used to obtain them have the same IP address (the IP address used by the agent to contact the STUN or TURN server).

o 对于自反和中继候选,用于获取它们的STUN或TURN服务器具有相同的IP地址(代理用于联系STUN或TURN服务器的IP地址)。

o They were obtained using the same transport protocol (TCP, UDP).

o 它们是使用相同的传输协议(TCP、UDP)获得的。

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.

类似地,如果两名候选人的类型不同,他们的基础具有不同的IP地址,用于获取他们的STUN或TURN服务器具有不同的IP地址(代理用于联系STUN或TURN服务器的IP地址),或者他们的传输协议不同,那么他们的基础也不同。

5.1.1.4. Keeping Candidates Alive
5.1.1.4. 让候选人活着

Once server-reflexive and relayed candidates are allocated, they MUST be kept alive until ICE processing has completed, as described in Section 8.3. For server-reflexive candidates learned through a Binding request, the bindings MUST be kept alive by additional Binding requests to the server. Refreshes for allocations are done using the Refresh transaction, as described in [RFC5766]. The Refresh requests will also refresh the server-reflexive candidate.

一旦分配了服务器自反和中继候选服务器,它们必须保持活动状态,直到ICE处理完成,如第8.3节所述。对于通过绑定请求学习的服务器自反候选项,必须通过向服务器发送额外的绑定请求来保持绑定的活动性。使用刷新事务完成分配刷新,如[RFC5766]中所述。刷新请求还将刷新服务器自反候选。

Host candidates do not time out, but the candidate addresses may change or disappear for a number of reasons. 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代理应监控其使用的接口,使基础已消失的候选项无效,并在出现新的IP地址(在新的或当前使用的接口上)时酌情获取新的候选项。

5.1.2. Prioritizing Candidates
5.1.2. 优先考虑候选人

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 (2**31 - 1). This priority will be used by ICE to determine the order of the connectivity checks and the relative preference for candidates. Higher-priority values give more priority over lower values.

优先级排序过程会将优先级分配给每个候选人。数据流的每个候选项必须具有唯一的优先级,该优先级必须是介于1和(2**31-1)之间的正整数。ICE将使用该优先级来确定连接检查的顺序和候选项的相对偏好。优先级越高,优先级越高。

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. 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代理应使用第5.1.2.1节中的公式计算该优先级,并使用第5.1.2.2节中的指南选择其参数。如果代理选择使用不同的公式,ICE可能需要更长的时间才能收敛,因为代理在其检查中不会进行协调。

The process for prioritizing candidates is common across the initiating and the responding agent.

对候选人进行优先排序的过程在发起人和响应人中很常见。

5.1.2.1. Recommended Formula
5.1.2.1. 推荐配方

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:

推荐的公式结合了候选类型(服务器自反、对等自反、中继和主机)的首选项、获得候选的IP地址的首选项以及使用以下公式的组件ID:

   priority = (2^24)*(type preference) +
              (2^8)*(local preference) +
              (2^0)*(256 - component ID)
        
   priority = (2^24)*(type preference) +
              (2^8)*(local preference) +
              (2^0)*(256 - component 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

类型首选项必须是0(最低首选项)到126(最高首选项)之间的整数,对于相同类型的所有候选项必须相同,对于相同类型的候选项必须不同

different types. 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. 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.

不同类型。对等自反候选的类型首选项必须高于服务器自反候选的类型首选项。将该值设置为0意味着此类型的候选项将仅用作最后手段。请注意,根据第5.1.1节的程序收集的候选人永远不会是同侪自反候选人;这种类型的候选者从ICE执行的连接检查中学习。

The local preference MUST be an integer from 0 (lowest preference) to 65535 (highest preference) inclusive. When there is only a single IP address, this value SHOULD be set to 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].

本地首选项必须是0(最低首选项)到65535(最高首选项)之间的整数(包括0)。当只有一个IP地址时,该值应设置为65535。如果具有相同类型的特定数据流的特定组件有多个候选者,则每个候选者的本地首选项必须是唯一的。如果ICE代理为双堆栈,则应根据[RFC8421]中描述的当前最佳实践设置本地首选项。

The component ID MUST be an integer between 1 and 256 inclusive.

组件ID必须是介于1和256(含1和256)之间的整数。

5.1.2.2. Guidelines for Choosing Type and Local Preferences
5.1.2.2. 选择类型和本地首选项的指南

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.

类型首选项的建议值为主机候选126,对等自反候选110,服务器自反候选100,中继候选0。

If an ICE agent is multihomed and has multiple IP addresses, the recommendations in [RFC8421] SHOULD be followed. 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.

如果ICE代理是多址的且具有多个IP地址,则应遵循[RFC8421]中的建议。如果使用多个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
5.1.3. 消除多余的候选人

Next, the ICE agents (initiating and responding) eliminate redundant candidates. 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. A candidate is redundant if and only if its transport address and base equal those of another candidate. The agent SHOULD eliminate the redundant candidate with the lower priority.

接下来,ICE代理(启动和响应)消除冗余候选。两个候选者可以有相同的传输地址,但有不同的基地,这些将不会被认为是多余的。通常,当代理不在NAT后面时,服务器自反候选和主机候选将是冗余的。当且仅当一个候选者的传输地址和基址等于另一个候选者的传输地址和基址时,该候选者才是冗余的。代理应消除优先级较低的冗余候选。

5.2. Lite Implementation Procedures
5.2. 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. 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. Instead, it is RECOMMENDED that agents that have multiple public IP addresses run full ICE implementations to ensure the best usage of its addresses.

Lite实现只利用候选主机。对于独立于IP地址系列的每个IP地址,必须有零个或一个候选地址。在lite实现中,ICE不能用于在候选对象之间进行动态选择。因此,不建议包含来自特定IP地址系列的多个候选地址,因为只有连接检查才能真正确定是否使用一个地址或另一个地址。相反,建议具有多个公共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. If an agent is using RTCP without multiplexing, it MUST obtain candidates for it. 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,称为“组件ID”。对于RTP/RTCP数据流,除非RTCP与RTP在同一端口多路复用,否则RTP本身的组件ID为1,RTCP的组件ID为2。如果代理正在使用RTCP而没有多路复用,则必须为其获取候选。然而,缺少组件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. 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. If a host is IPv4 only, the local preference value SHOULD be set to 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].

每个候选人被分配一个基金会。对于从不同IP地址分配的两个候选,基础必须不同;否则,它必须是相同的。一个简单的整数为每个IP地址递增就足够了。此外,必须在同一数据流的所有候选对象中为每个候选对象分配唯一的优先级。如果使用第5.1.2.1节中的公式计算优先级,则应将类型首选项值设置为126。如果主机仅为IPv4,则本地首选项值应设置为65535。如果主机是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. 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,则默认候选主机通常为全局范围的IPv6地址。无论默认候选主机使用IPv4还是IPv6,双栈主机都应允许配置,并且配置需要基于管理员认为在当前网络环境中成功几率更高的配置。

The procedures in this section are common across the initiating and responding agents.

本节中的程序在始发剂和响应剂中是通用的。

5.3. Exchanging Candidate Information
5.3. 交换候选人信息

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:

候选人:一名或多名候选人。对于每位候选人:

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.

连接检查调整值:代理希望使用的连接检查调整值。如果代理希望使用定义的默认值,则可以省略此项。

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不匹配的影响,并且能够检测到ICE不匹配(第5.4节),则需要检测代理将此信息传递给其对等方。它是一个布尔标志。

The using protocol may (or may not) need to deal with backwards compatibility with older implementations that do not support 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的回退机制,则假定使用协议除了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
5.4. 冰失配

Certain middleboxes, such as ALGs, can alter signaling information in ways that break ICE (e.g., by rewriting IP addresses in SDP). 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.

某些中间盒,如ALG,可以通过打破僵局的方式改变信令信息(例如,通过在SDP中重写IP地址)。这被称为“冰失配”。如果使用的协议易受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不匹配时是否需要采取特定措施。

6. ICE Candidate Processing
6. ICE候选处理

Once an ICE agent has gathered its candidates and exchanged candidates with its peer (Section 5), it will determine its own role. In addition, full implementations will form checklists and begin performing connectivity checks with the peer.

一旦ICE代理收集其候选人并与其同行交换候选人(第5节),它将确定自己的角色。此外,完整的实现将形成检查表,并开始与对等方执行连接检查。

6.1. Procedures for Full Implementation
6.1. 全面执行的程序
6.1.1. Determining Role
6.1.1. 决定性作用

For each session, each ICE agent (initiating and responding) takes on a role. There are two roles -- controlling and controlled. The controlling agent is responsible for the choice of the final candidate pairs used for communications. The sections below describe in detail the actual procedures followed by controlling and controlled agents.

对于每个会话,每个ICE代理(启动和响应)都扮演一个角色。有两个角色——控制和控制。控制代理负责选择用于通信的最终候选对。以下各节详细描述了控制和受控代理所遵循的实际程序。

The rules for determining the role and the impact on behavior are as follows:

确定角色及其对行为的影响的规则如下:

Both agents are full: The initiating agent that started the ICE processing MUST take the controlling role, and the other MUST take the controlled role. Both agents will form checklists, run the ICE state machines, and generate connectivity checks. The controlling agent will execute the logic in Section 8.1 to nominate pairs that will become (if the connectivity checks associated with the nominations succeed) the selected pairs, and then both agents end ICE as described in Section 8.1.2.

两个代理都已满:启动冰处理的启动代理必须承担控制角色,另一个必须承担控制角色。这两个代理将形成检查表,运行ICE状态机,并生成连接检查。控制代理将执行第8.1节中的逻辑,指定将成为(如果与指定相关联的连接检查成功)所选对的对,然后两个代理按照第8.1.2节中的描述结束ICE。

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 checklists, run the ICE state machines, and generate connectivity checks. That agent will execute the logic in Section 8.1 to nominate pairs that will become (if the connectivity checks associated with the nominations succeed) the selected pairs 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 data stream is considered to be Running, and the state of ICE overall is Running.

一个完全代理,一个lite:完全代理必须担任控制角色,lite代理必须担任控制角色。完整代理将形成检查表,运行ICE状态机,并生成连接检查。该代理将执行第8.1节中的逻辑来指定将成为(如果与指定相关联的连接检查成功)所选对的对,并使用第8.1.2节中的逻辑来结束ICE。lite实现只需监听连接检查,接收并响应连接检查,然后按照第8.2节所述结束ICE。对于lite实现,每个数据流的ICE处理状态被视为正在运行,ICE整体状态为正在运行。

Both lite: The initiating agent that started the ICE processing MUST take the controlling role, and the other MUST take the controlled role. In this case, no connectivity checks are ever sent. Rather, once the candidates are exchanged, each agent performs the processing described in Section 8 without connectivity checks. It is possible that both agents will believe they are controlled or controlling. In the latter case, the conflict is resolved through glare detection capabilities in the signaling protocol enabling the candidate exchange. The state of ICE processing for each data stream is considered to be Running, and the state of ICE overall is Running.

lite和lite:启动冰处理的引发剂必须起控制作用,另一个必须起控制作用。在这种情况下,不会发送连接检查。相反,一旦交换了候选者,每个代理将执行第8节中描述的处理,而不进行连接检查。这两个代理都可能认为自己受到控制或控制。在后一种情况下,冲突通过启用候选交换的信令协议中的眩光检测能力来解决。每个数据流的ICE处理状态视为正在运行,ICE整体状态为正在运行。

Once the roles are determined for a session, they persist throughout the lifetime of the session. The roles can be redetermined as part of an ICE restart (Section 9), but an ICE agent MUST NOT redetermine the role as part of an ICE restart unless one or more of the following criteria is fulfilled:

一旦确定了会话的角色,它们将在会话的整个生命周期中持续存在。可以将角色重新确定为ICE重启的一部分(第9节),但ICE代理不得将角色重新确定为ICE重启的一部分,除非满足以下一个或多个标准:

Full becomes lite: If the controlling agent is full, and switches to lite, the roles MUST be redetermined if the peer agent is also full.

Full变为lite:如果控制代理已满,并切换到lite,则如果对等代理也已满,则必须重新确定角色。

Role conflict: If the ICE restart causes a role conflict, the roles might be redetermined due to the role conflict procedures in Section 7.3.1.1.

角色冲突:如果ICE重启导致角色冲突,则可能会根据第7.3.1.1节中的角色冲突程序重新确定角色。

NOTE: There are certain Third Party Call Control (3PCC) [RFC3725] scenarios where an ICE restart might cause a role conflict.

注意:在某些第三方呼叫控制(3PCC)[RFC3725]场景中,ICE重启可能会导致角色冲突。

NOTE: The agents need to inform each other whether they are full or lite before the roles are determined. The mechanism for that is specific to the signaling protocol and outside the scope of the document.

注意:在确定角色之前,代理需要相互通知他们是完整的还是精简的。该机制特定于信令协议,不在本文档范围内。

An agent MUST accept if the peer initiates a redetermination of the roles even if the criteria for doing so are not fulfilled. This can happen if the peer is compliant with RFC 5245.

代理必须接受对等方发起角色重新定义的情况,即使没有满足重新定义的标准。如果对等方符合RFC 5245,则可能发生这种情况。

6.1.2. Forming the Checklists
6.1.2. 形成清单

There is one checklist for each data stream. To form a checklist, initiating and responding ICE agents form candidate pairs, compute pair priorities, order pairs by priority, prune pairs, remove lower-priority pairs, and set checklist states. If candidates are added to a checklist (e.g., due to detection of peer-reflexive candidates), the agent will re-perform these steps for the updated checklist.

每个数据流都有一个检查表。为了形成检查表,启动和响应ICE代理形成候选对,计算对优先级,按优先级排序对,修剪对,删除低优先级对,并设置检查表状态。如果将候选人添加到检查表中(例如,由于检测到同级自反候选人),则代理将针对更新的检查表重新执行这些步骤。

6.1.2.1. Checklist State
6.1.2.1. 清单状态

Each checklist has a state, which captures the state of ICE checks for the data stream associated with the checklist. The states are:

每个清单都有一个状态,它捕获与清单关联的数据流的ICE检查状态。这些国家是:

Running: The checklist is neither Completed nor Failed yet. Checklists are initially set to the Running state.

正在运行:检查表既没有完成也没有失败。检查表最初设置为运行状态。

Completed: The checklist contains a nominated pair for each component of the data stream.

已完成:检查表包含数据流每个组件的指定对。

Failed: The checklist does not have a valid pair for each component of the data stream, and all of the candidate pairs in the checklist are in either the Failed or the Succeeded state. In other words, at least one component of the checklist has candidate pairs that are all in the Failed state, which means the component has failed, which means the checklist has failed.

失败:对于数据流的每个组件,检查表没有有效的对,并且检查表中的所有候选对都处于失败或成功状态。换句话说,检查表的至少一个组件具有全部处于失败状态的候选对,这意味着该组件失败,这意味着检查表失败。

6.1.2.2. Forming Candidate Pairs
6.1.2.2. 形成候选对

The ICE agent pairs each local candidate with each remote candidate for the same component of the same data stream with the same IP address family. It is possible that some of the local candidates

ICE代理将具有相同IP地址族的相同数据流的相同组件的每个本地候选与每个远程候选配对。有可能一些当地候选人

won't get paired with remote candidates, and some of the remote candidates won't get paired with local candidates. This can happen if one agent doesn't include candidates for all of the components for a data stream. If this happens, the number of components for that data stream is effectively reduced and is considered to be equal to the minimum across both agents of the maximum component ID provided by each agent across all components for the data stream.

不会与远程候选对象配对,并且某些远程候选对象不会与本地候选对象配对。如果一个代理不包含数据流所有组件的候选项,则可能会发生这种情况。如果发生这种情况,则该数据流的组件数量将有效减少,并被视为等于两个代理之间的最小组件ID,即每个代理在数据流的所有组件中提供的最大组件ID。

In the case of RTP, this would happen when one agent provides candidates for RTCP, and the other does not. As another example, the initiating agent can multiplex RTP and RTCP on the same port [RFC5761]. However, since the initiating agent doesn't know if the peer agent can perform such multiplexing, it includes candidates for RTP and RTCP on separate ports. If the peer agent can perform such multiplexing, it would include just a single component for each candidate -- for the combined RTP/RTCP mux. ICE would end up acting as if there was just a single component for this candidate.

在RTP的情况下,当一个代理为RTCP提供候选者,而另一个不提供候选者时,就会发生这种情况。作为另一个示例,发起代理可以在同一端口[RFC5761]上多路传输RTP和RTCP。但是,由于发起代理不知道对等代理是否可以执行这种多路复用,因此它在单独的端口上包含RTP和RTCP的候选。如果对等代理可以执行这种多路复用,那么它将只为每个候选组件包括一个组件——用于组合的RTP/RTCP mux。ICE最终会表现得好像这个候选人只有一个组成部分。

With IPv6, it is common for a host to have multiple host candidates for each interface. To keep the amount of resulting candidate pairs reasonable and to avoid candidate pairs that are highly unlikely to work, IPv6 link-local addresses MUST NOT be paired with other than link-local addresses.

对于IPv6,一台主机的每个接口都有多个候选主机是很常见的。为了使生成的候选对数量保持合理,并避免极不可能工作的候选对,IPv6链路本地地址不得与链路本地地址以外的其他地址配对。

The candidate pairs whose local and remote candidates are both the default candidates for a particular component is called the "default candidate pair" for that component. This is the pair that would be used to transmit data if both agents had not been ICE aware.

本地候选和远程候选都是特定组件的默认候选的候选对称为该组件的“默认候选对”。如果两个代理都未意识到ICE,则这一对将用于传输数据。

Figure 5 shows the properties of and relationships between transport addresses, candidates, candidate pairs, and checklists.

图5显示了传输地址、候选者、候选者对和检查表之间的属性和关系。

              +--------------------------------------------+
              |                                            |
              | +---------------------+                    |
              | |+----+ +----+ +----+ |   +Type            |
              | || IP | |Port| |Tran| |   +Priority        |
              | ||Addr| |    | |    | |   +Foundation      |
              | |+----+ +----+ +----+ |   +Component ID    |
              | |      Transport      |   +Related Address |
              | |        Addr         |                    |
              | +---------------------+   +Base            |
              |             Candidate                      |
              +--------------------------------------------+
              *                                         *
              *    *************************************
              *    *
            +-------------------------------+
            |                               |
            | Local     Remote              |
            | +----+    +----+   +default?  |
            | |Cand|    |Cand|   +valid?    |
            | +----+    +----+   +nominated?|
            |                    +State     |
            |                               |
            |                               |
            |          Candidate Pair       |
            +-------------------------------+
            *                              *
            *                  ************
            *                  *
            +------------------+
            |  Candidate Pair  |
            +------------------+
            +------------------+
            |  Candidate Pair  |
            +------------------+
            +------------------+
            |  Candidate Pair  |
            +------------------+
        
              +--------------------------------------------+
              |                                            |
              | +---------------------+                    |
              | |+----+ +----+ +----+ |   +Type            |
              | || IP | |Port| |Tran| |   +Priority        |
              | ||Addr| |    | |    | |   +Foundation      |
              | |+----+ +----+ +----+ |   +Component ID    |
              | |      Transport      |   +Related Address |
              | |        Addr         |                    |
              | +---------------------+   +Base            |
              |             Candidate                      |
              +--------------------------------------------+
              *                                         *
              *    *************************************
              *    *
            +-------------------------------+
            |                               |
            | Local     Remote              |
            | +----+    +----+   +default?  |
            | |Cand|    |Cand|   +valid?    |
            | +----+    +----+   +nominated?|
            |                    +State     |
            |                               |
            |                               |
            |          Candidate Pair       |
            +-------------------------------+
            *                              *
            *                  ************
            *                  *
            +------------------+
            |  Candidate Pair  |
            +------------------+
            +------------------+
            |  Candidate Pair  |
            +------------------+
            +------------------+
            |  Candidate Pair  |
            +------------------+
        

Checklist

清单

Figure 5: Conceptual Diagram of a Checklist

图5:检查表的概念图

6.1.2.3. Computing Pair Priority and Ordering Pairs
6.1.2.3. 计算对优先级和排序对

The ICE agent computes a priority for each candidate pair. Let G be the priority for the candidate provided by the controlling agent. Let D be the priority for the candidate provided by the controlled agent. The priority for a pair is computed as follows:

ICE代理计算每个候选对的优先级。设G为控制代理提供的候选的优先级。设D为受控代理提供的候选对象的优先级。对的优先级计算如下:

      pair priority = 2^32*MIN(G,D) + 2*MAX(G,D) + (G>D?1:0)
        
      pair priority = 2^32*MIN(G,D) + 2*MAX(G,D) + (G>D?1:0)
        

The agent sorts each checklist in decreasing order of candidate pair priority. If two pairs have identical priority, the ordering amongst them is arbitrary.

代理按候选对优先级的降序对每个检查表进行排序。如果两对具有相同的优先级,则它们之间的顺序是任意的。

6.1.2.4. Pruning the Pairs
6.1.2.4. 修剪成对的头发

This sorted list of candidate pairs is used to determine a sequence of connectivity checks that will be performed. Each check involves sending a request from a local candidate to a remote candidate. Since an ICE agent cannot send requests directly from a reflexive candidate (server reflexive or peer reflexive), but only from its base, the agent next goes through the sorted list of candidate pairs. For each pair where the local candidate is reflexive, the candidate MUST be replaced by its base.

候选对的排序列表用于确定将要执行的连接检查序列。每次检查都涉及从本地候选人向远程候选人发送请求。由于ICE代理不能直接从自反候选(服务器自反或对等自反)发送请求,而只能从其基础发送请求,因此代理接下来将遍历候选对的排序列表。对于局部候选是自反的每一对,候选必须被其基替换。

The agent prunes each checklist. This is done by removing a candidate pair if it is redundant with a higher-priority candidate pair in the same checklist. Two candidate pairs are redundant if their local candidates have the same base and their remote candidates are identical. The result is a sequence of ordered candidate pairs, called the "checklist" for that data stream.

代理删减每个清单。如果候选对与同一检查表中的高优先级候选对冗余,则可通过删除该候选对来实现。如果两个候选对的本地候选具有相同的碱基,而远程候选对相同,则这两个候选对是冗余的。结果是一系列有序的候选对,称为该数据流的“检查表”。

6.1.2.5. Removing Lower-Priority Pairs
6.1.2.5. 删除低优先级对

In order to limit the attacks described in Section 19.5.1, an ICE agent MUST limit the total number of connectivity checks the agent performs across all checklists in the checklist set. This is done by limiting the total number of candidate pairs in the checklist set. The default limit of candidate pairs for the checklist set is 100, but the value MUST be configurable. The limit is enforced by, within in each checklist, discarding lower-priority candidate pairs until the total number of candidate pairs in the checklist set is smaller than the limit value. The discarding SHOULD be done evenly so that the number of candidate pairs in each checklist is reduced the same amount.

为了限制第19.5.1节中描述的攻击,ICE代理必须限制代理在检查表集中的所有检查表中执行的连接检查总数。这是通过限制清单集中候选对的总数来实现的。检查表集合的候选对的默认限制为100,但该值必须是可配置的。在每个检查表中,通过丢弃较低优先级的候选对来实施限制,直到检查表集中的候选对总数小于限制值。丢弃应均匀进行,以便每个检查表中候选对的数量减少相同的数量。

It is RECOMMENDED that a lower-limit value than the default is picked when possible, and that the value is set to the maximum number of plausible candidate pairs that might be created in an actual

建议尽可能选择一个低于默认值的下限值,并将该值设置为实际应用程序中可能创建的最大可能候选对数

deployment configuration. The requirement for configuration is meant to provide a tool for fixing this value in the field if, once deployed, it is found to be problematic.

部署配置。配置要求旨在提供一种工具,用于在部署后发现问题时在现场修复此值。

6.1.2.6. Computing Candidate Pair States
6.1.2.6. 计算候选对状态

Each candidate pair in the checklist has a foundation (the combination of the foundations of the local and remote candidates in the pair) and one of the following states:

清单中的每个候选对都有一个基础(组合中的本地和远程候选的基础)和以下状态之一:

Waiting: A check has not been sent for this pair, but the pair is not Frozen.

等待:尚未为此对发送支票,但该对未冻结。

In-Progress: A check has been sent for this pair, but the transaction is in progress.

正在进行:已为此对发送检查,但事务正在进行中。

Succeeded: A check has been sent for this pair, and it produced a successful result.

成功:已为此对发送检查,并生成成功结果。

Failed: A check has been sent for this pair, and it failed (a response to the check was never received, or a failure response was received).

失败:已为此对发送检查,但失败(从未收到对检查的响应,或收到失败响应)。

Frozen: A check for this pair has not been sent, and it cannot be sent until the pair is unfrozen and moved into the Waiting state.

冻结:尚未发送此对的支票,并且在该对解冻并移动到等待状态之前,无法发送该对支票。

Pairs move between states as shown in Figure 6.

对在状态之间移动,如图6所示。

      +-----------+
      |           |
      |           |
      |  Frozen   |
      |           |
      |           |
      +-----------+
            |
            |unfreeze
            |
            V
      +-----------+         +-----------+
      |           |         |           |
      |           | perform |           |
      |  Waiting  |-------->|In-Progress|
      |           |         |           |
      |           |         |           |
      +-----------+         +-----------+
                                  / |
                                //  |
                              //    |
                            //      |
                           /        |
                         //         |
               failure //           |success
                     //             |
                    /               |
                  //                |
                //                  |
              //                    |
             V                      V
      +-----------+         +-----------+
      |           |         |           |
      |           |         |           |
      |   Failed  |         | Succeeded |
      |           |         |           |
      |           |         |           |
      +-----------+         +-----------+
        
      +-----------+
      |           |
      |           |
      |  Frozen   |
      |           |
      |           |
      +-----------+
            |
            |unfreeze
            |
            V
      +-----------+         +-----------+
      |           |         |           |
      |           | perform |           |
      |  Waiting  |-------->|In-Progress|
      |           |         |           |
      |           |         |           |
      +-----------+         +-----------+
                                  / |
                                //  |
                              //    |
                            //      |
                           /        |
                         //         |
               failure //           |success
                     //             |
                    /               |
                  //                |
                //                  |
              //                    |
             V                      V
      +-----------+         +-----------+
      |           |         |           |
      |           |         |           |
      |   Failed  |         | Succeeded |
      |           |         |           |
      |           |         |           |
      +-----------+         +-----------+
        

Figure 6: Pair State Finite State Machine (FSM)

图6:成对状态有限状态机(FSM)

The initial states for each pair in a checklist are computed by performing the following sequence of steps:

通过执行以下步骤序列,计算清单中每对的初始状态:

1. The checklists are placed in an ordered list (the order is determined by each ICE usage), called the "checklist set".

1. 检查表放在一个有序列表中(顺序由每次ICE使用情况决定),称为“检查表集”。

2. The ICE agent initially places all candidate pairs in the Frozen state.

2. ICE代理最初将所有候选对置于冻结状态。

3. The agent sets all of the checklists in the checklist set to the Running state.

3. 代理将清单集中的所有清单设置为运行状态。

4. For each foundation, the agent sets the state of exactly one candidate pair to the Waiting state (unfreezing it). The candidate pair to unfreeze is chosen by finding the first candidate pair (ordered by the lowest component ID and then the highest priority if component IDs are equal) in the first checklist (according to the usage-defined checklist set order) that has that foundation.

4. 对于每个基础,代理将恰好一个候选对的状态设置为等待状态(解冻它)。通过在第一检查表(根据使用定义的检查表设置顺序)找到具有该基础的第一候选对(由最低组件ID排序,然后如果组件ID相等的最高优先级)来选择解冻的候选对。

NOTE: The procedures above are different from RFC 5245, where only candidate pairs in the first checklist were initially placed in the Waiting state. Now it applies to candidate pairs in the first checklist that have that foundation, even if the checklist is not the first one in the checklist set.

注:上述程序不同于RFC 5245,在RFC 5245中,只有第一个检查表中的候选对最初处于等待状态。现在,它适用于具有第一基础的第一个检查表中的候选对,即使检查表不是检查表集中的第一个。

The table below illustrates an example.

下表说明了一个示例。

Table legend:

表格图例:

Each row (m1, m2,...) represents a checklist associated with a data stream. m1 represents the first checklist in the checklist set.

每一行(m1,m2,…)表示与数据流相关联的检查表。m1表示检查表集中的第一个检查表。

Each column (f1, f2,...) represents a foundation. Every candidate pair within a given column share the same foundation.

每个列(F1,F2,…)代表一个基础。给定列中的每个候选对都具有相同的基础。

f-cp represents a candidate pair in the Frozen state.

f-cp表示处于冻结状态的候选对。

w-cp represents a candidate pair in the Waiting state.

w-cp表示处于等待状态的候选对。

1. The agent sets all of the pairs in the checklist set to the Frozen state.

1. 代理将检查表中的所有对设置为冻结状态。

         f1    f2    f3    f4    f5
       -----------------------------
   m1 | f-cp  f-cp  f-cp
      |
   m2 | f-cp  f-cp  f-cp  f-cp
      |
   m3 | f-cp                    f-cp
        
         f1    f2    f3    f4    f5
       -----------------------------
   m1 | f-cp  f-cp  f-cp
      |
   m2 | f-cp  f-cp  f-cp  f-cp
      |
   m3 | f-cp                    f-cp
        

2. For each foundation, the candidate pair with the lowest component ID is placed in the Waiting state, unless a candidate pair associated with the same foundation has already been put in the Waiting state in one of the other examined checklists in the checklist set.

2. 对于每个基础,具有最低组件ID的候选对被放置在等待状态中,除非与同一基础相关联的候选对已经在检查表集中的其他检查清单中的一个等待状态中。

         f1    f2    f3    f4    f5
       -----------------------------
   m1 | w-cp  w-cp  w-cp
      |
   m2 | f-cp  f-cp  f-cp  w-cp
      |
   m3 | f-cp                    w-cp
        
         f1    f2    f3    f4    f5
       -----------------------------
   m1 | w-cp  w-cp  w-cp
      |
   m2 | f-cp  f-cp  f-cp  w-cp
      |
   m3 | f-cp                    w-cp
        

Table 1: Pair State Example

表1:配对状态示例

In the first checklist (m1), the candidate pair for each foundation is placed in the Waiting state, as no pairs for the same foundations have yet been placed in the Waiting state.

在第一个检查表(M1)中,每个基础的候选对被放置在等待状态中,因为没有相同基础的对尚未被放置在等待状态中。

In the second checklist (m2), the candidate pair for foundation f4 is placed in the Waiting state. The candidate pair for foundations f1, f2, and f3 are kept in the Frozen state, as candidate pairs for those

在第二检查表(M2)中,基础F4的候选对被放置在等待状态中。基础f1、f2和f3的候选对保持在冻结状态,作为这些基础的候选对

foundations have already been placed in the Waiting state (within checklist m1).

基础已处于等待状态(在清单m1中)。

In the third checklist (m3), the candidate pair for foundation f5 is placed in the Waiting state. The candidate pair for foundation f1 is kept in the Frozen state, as a candidate pair for that foundation has already been placed in the Waiting state (within checklist m1).

在第三检查表(M3)中,基础F5的候选对被放置在等待状态中。基础F1的候选对保持在冻结状态,因为该基础的候选对已经被放置在等待状态(在检查表M1内)。

Once each checklist have been processed, one candidate pair for each foundation in the checklist set has been placed in the Waiting state.

一旦每个检查表被处理,检查表集中的每个基础的一个候选对被放置在等待状态中。

6.1.3. ICE State
6.1.3. 冰态

The ICE agent has a state determined by the state of the checklists. The state is Completed if all checklists are Completed, Failed if all checklists are Failed, or Running otherwise.

ICE代理的状态由检查列表的状态确定。如果所有检查表都已完成,则状态为“完成”;如果所有检查表都失败,则状态为“失败”;否则状态为“正在运行”。

6.1.4. Scheduling Checks
6.1.4. 计划检查
6.1.4.1. Triggered-Check Queue
6.1.4.1. 触发检查队列

Once the ICE agent has computed the checklists and created the checklist set, as described in Section 6.1.2, the agent will begin performing connectivity checks (ordinary and triggered). For triggered connectivity checks, the agent maintains a FIFO queue for each checklist, referred to as the "triggered-check queue", which contains candidate pairs for which checks are to be sent at the next available opportunity. The triggered-check queue is initially empty.

如第6.1.2节所述,ICE代理计算检查表并创建检查表集后,代理将开始执行连接检查(普通检查和触发检查)。对于触发连接检查,代理为每个检查表维护一个FIFO队列,称为“触发检查队列”,其中包含候选对,在下一个可用机会发送检查。触发的检查队列最初为空。

6.1.4.2. Performing Connectivity Checks
6.1.4.2. 执行连接检查

The generation of ordinary and triggered connectivity checks is governed by timer Ta. As soon as the initial states for the candidate pairs in the checklist set have been set, a check is performed for a candidate pair within the first checklist in the Running state, following the procedures in Section 7. After that, whenever Ta fires the next checklist in the Running state in the checklist set is picked, and a check is performed for a candidate within that checklist. After the last checklist in the Running state in the checklist set has been processed, the first checklist is picked again, etc.

普通和触发连接检查的生成由计时器Ta控制。一旦设置了检查表集中候选对的初始状态,则按照第7节中的程序,对处于运行状态的第一个检查表中的候选对进行检查。在此之后,每当Ta在运行状态下触发下一个检查表时,都会选中检查表集中的检查表,并对该检查表中的候选人执行检查。处理完检查表集中处于运行状态的最后一个检查表后,再次选择第一个检查表,以此类推。

Whenever Ta fires, the ICE agent will perform a check for a candidate pair within the checklist that was picked by performing the following steps:

每当Ta触发时,ICE代理将检查清单中的候选对,该清单是通过执行以下步骤挑选的:

1. If the triggered-check queue associated with the checklist contains one or more candidate pairs, the agent removes the top pair from the queue, performs a connectivity check on that pair, puts the candidate pair state to In-Progress, and aborts the subsequent steps.

1. 如果与检查表关联的触发检查队列包含一个或多个候选对,则代理将从队列中删除最上面的对,对该对执行连接检查,将候选对状态设置为“进行中”,并中止后续步骤。

2. If there is no candidate pair in the Waiting state, and if there are one or more pairs in the Frozen state, the agent checks the foundation associated with each pair in the Frozen state. For a given foundation, if there is no pair (in any checklist in the checklist set) in the Waiting or In-Progress state, the agent puts the candidate pair state to Waiting and continues with the next step.

2. 如果在等待状态中没有候选对,并且如果在冻结状态中有一对或多对,则代理检查冻结状态中与每对相关的基础。对于给定的基础,如果在等待或正在进行的状态中没有配对(在检查表集中的任何检查表中),则代理将候选对状态置于等待并继续下一步。

3. If there are one or more candidate pairs in the Waiting state, the agent picks the highest-priority candidate pair (if there are multiple pairs with the same priority, the pair with the lowest component ID is picked) in the Waiting state, performs a connectivity check on that pair, puts the candidate pair state to In-Progress, and aborts the subsequent steps.

3. 如果有一个或多个候选对处于等待状态,则代理在等待状态下选择优先级最高的候选对(如果有多个具有相同优先级的候选对,则选择具有最低组件ID的候选对),对该对执行连接检查,将候选对状态设置为进行中,并中止后续步骤。

4. If this step is reached, no check could be performed for the checklist that was picked. So, without waiting for timer Ta to expire again, select the next checklist in the Running state and return to step #1. If this happens for every single checklist in the Running state, meaning there are no remaining candidate pairs to perform connectivity checks for, abort these steps.

4. 如果达到此步骤,则无法对选中的检查表执行任何检查。因此,在不等待计时器Ta再次过期的情况下,选择运行状态下的下一个检查表并返回到步骤1。如果运行状态下的每个检查表都出现这种情况,意味着没有剩余的候选对可执行连接检查,请中止这些步骤。

Once the agent has picked a candidate pair for which a connectivity check is to be performed, the agent starts a check and sends the Binding request from the base associated with the local candidate of the pair to the remote candidate of the pair, as described in Section 7.2.4.

一旦代理选择了要对其执行连接检查的候选对,代理将开始检查,并将绑定请求从与该对的本地候选相关联的基站发送到该对的远程候选,如第7.2.4节所述。

Based on local policy, an agent MAY choose to terminate performing the connectivity checks for one or more checklists in the checklist set at any time. However, only the controlling agent is allowed to conclude ICE (Section 8).

根据本地策略,代理可以选择随时终止对检查表集中的一个或多个检查表执行连接检查。但是,仅允许控制剂得出ICE结论(第8节)。

To compute the message integrity for the check, the agent uses the remote username fragment and password learned from the candidate information obtained from its peer. The local username fragment is known directly by the agent for its own candidate.

为了计算用于检查的消息完整性,代理使用从对等方获得的候选信息中学习的远程用户名片段和密码。代理直接知道本地用户名片段的候选名称。

6.2. Lite Implementation Procedures
6.2. Lite实施程序

Lite implementations skip most of the steps in Section 6 except for verifying the peer's ICE support and determining its role in the ICE processing.

Lite实现跳过了第6节中的大部分步骤,除了验证对等方的ICE支持和确定其在ICE处理中的角色。

If the lite implementation is the controlling agent (which will only happen if the peer ICE agent is also a lite implementation), it selects a candidate pair based on the ones in the candidate exchange (for IPv4, there is only ever one pair) and then updates the peer with the new candidate information reflecting that selection, if needed (it is never needed for an IPv4-only host).

如果lite实现是控制代理(仅当对等ICE代理也是lite实现时才会发生),它会根据候选交换机中的候选对选择候选对(对于IPv4,只有一对),然后根据需要使用反映该选择的新候选信息更新对等方(只有IPv4的主机永远不需要它)。

7. Performing Connectivity Checks
7. 执行连接检查

This section describes how connectivity checks are performed.

本节介绍如何执行连接检查。

An ICE agent MUST be compliant to [RFC5389]. A full implementation acts both as a STUN client and a STUN server, while a lite implementation only acts as a STUN server (as it does not generate connectivity checks).

ICE代理必须符合[RFC5389]。一个完整的实现同时充当一个STUN客户端和一个STUN服务器,而一个lite实现只充当一个STUN服务器(因为它不生成连接检查)。

7.1. STUN Extensions
7.1. 眩晕扩展

ICE extends STUN with the attributes: PRIORITY, USE-CANDIDATE, ICE-CONTROLLED, and ICE-CONTROLLING. These attributes are formally defined in Section 16.1. This section describes the usage of the attributes.

ICE使用以下属性扩展昏迷:优先级、使用候选、ICE控制和ICE控制。这些属性在第16.1节中有正式定义。本节介绍属性的用法。

The attributes are only applicable to ICE connectivity checks.

这些属性仅适用于ICE连接检查。

7.1.1. PRIORITY
7.1.1. 优先事项

The PRIORITY attribute MUST be included in a Binding request and be set to the value computed by the algorithm in Section 5.1.2 for the local candidate, but with the candidate type preference of peer-reflexive candidates.

优先级属性必须包含在绑定请求中,并设置为第5.1.2节中针对本地候选的算法计算的值,但具有对等自反候选的候选类型偏好。

7.1.2. USE-CANDIDATE
7.1.2. 候选用户

The controlling agent MUST include the USE-CANDIDATE attribute in order to nominate a candidate pair (Section 8.1.1). The controlled agent MUST NOT include the USE-CANDIDATE attribute in a Binding request.

控制代理必须包括使用-候选属性,以便指定候选对(第8.1.1节)。受控代理不能在绑定请求中包含USE-CANDIDATE属性。

7.1.3. ICE-CONTROLLED and ICE-CONTROLLING
7.1.3. 冰控与冰控

The controlling agent MUST include the ICE-CONTROLLING attribute in a Binding request. The controlled agent MUST include the ICE-CONTROLLED attribute in a Binding request.

控制代理必须在绑定请求中包含ICE-CONTROLING属性。受控代理必须在绑定请求中包含ICE-CONTROLED属性。

The content of either attribute is used as tiebreaker values when an ICE role conflict occurs (Section 7.3.1.1).

当ICE角色冲突发生时(第7.3.1.1节),任何一个属性的内容都将用作断开联系的值。

7.2. STUN Client Procedures
7.2. STUN客户端程序
7.2.1. Creating Permissions for Relayed Candidates
7.2.1. 为中继候选对象创建权限

If the connectivity check is being sent using a relayed local candidate, the client MUST create a permission first if it has not already created one previously. It would have created one previously if it had told the TURN server to create a permission for the given relayed candidate towards the IP address of the remote candidate. To create the permission, the ICE agent follows the procedures defined in [RFC5766]. The permission MUST be created towards the IP address of the remote candidate. It is RECOMMENDED that the agent defer creation of a TURN channel until ICE completes, in which case permissions for connectivity checks are normally created using a CreatePermission request. Once established, the agent MUST keep the permission active until ICE concludes.

如果使用中继本地候选发送连接检查,则客户端必须首先创建权限(如果以前尚未创建权限)。如果它告诉TURN服务器为给定中继候选者创建一个指向远程候选者IP地址的权限,那么它以前就会创建一个。要创建权限,ICE代理将遵循[RFC5766]中定义的过程。必须针对远程候选的IP地址创建权限。建议代理将转弯通道的创建推迟到ICE完成,在这种情况下,连接检查的权限通常使用CreatePermission请求创建。一旦建立,代理必须保持权限处于活动状态,直到ICE结束。

7.2.2. Forming Credentials
7.2.2. 形成凭证

A connectivity-check Binding request MUST utilize the STUN short-term credential mechanism.

连接检查绑定请求必须利用STUN短期凭证机制。

The username for the credential is formed by concatenating the username fragment provided by the peer with the username fragment of the ICE agent sending the request, separated by a colon (":").

凭证的用户名是通过将对等方提供的用户名片段与发送请求的ICE代理的用户名片段连接起来形成的,以冒号(“:”)分隔。

The password is equal to the password provided by the peer.

密码等于对等方提供的密码。

For example, consider the case where ICE agent L is the initiating agent and ICE agent R is the responding agent. Agent L included a username fragment of LFRAG for its candidates and a password of LPASS. Agent R provided a username fragment of RFRAG and a password of RPASS. A connectivity check from L to R utilizes the username RFRAG:LFRAG and a password of RPASS. A connectivity check from R to L utilizes the username LFRAG:RFRAG and a password of LPASS. The responses utilize the same usernames and passwords as the requests (note that the USERNAME attribute is not present in the response).

例如,考虑冰剂L是引发剂和冰剂R是反应剂的情况。代理L包括一个候选的LFRAG用户名片段和一个LPASS密码。代理R提供了RFRAG的用户名片段和RPASS的密码。从L到R的连接检查使用用户名RFRAG:LFRAG和密码RPASS。从R到L的连接性检查使用用户名LFRAG:RFRAG和LPAS密码。响应使用与请求相同的用户名和密码(请注意,响应中不存在USERNAME属性)。

7.2.3. Diffserv Treatment
7.2.3. 区分服务治疗

If the agent is using Differentiated Services Code Point (DSCP) markings [RFC2475] in data packets that it will send, the agent SHOULD apply the same markings to Binding requests and responses that it will send.

如果代理在其将发送的数据包中使用区分服务代码点(DSCP)标记[RFC2475],则代理应将相同的标记应用于其将发送的绑定请求和响应。

If multiple DSCP markings are used on the data packets, the agent SHOULD choose one of them for use with the connectivity check.

如果数据包上使用了多个DSCP标记,则代理应选择其中一个用于连接检查。

7.2.4. Sending the Request
7.2.4. 发送请求

A connectivity check is generated by sending a Binding request from the base associated with a local candidate to a remote candidate. [RFC5389] describes how Binding requests are constructed and generated.

连接检查是通过将绑定请求从与本地候选关联的基站发送到远程候选来生成的。[RFC5389]描述如何构造和生成绑定请求。

Support for backwards compatibility with RFC 3489 MUST NOT be assumed when performing connectivity checks. The FINGERPRINT mechanism MUST be used for connectivity checks.

执行连接检查时,不得假设支持与RFC 3489向后兼容。指纹机制必须用于连接检查。

7.2.5. Processing the Response
7.2.5. 处理响应

This section defines additional procedures for processing Binding responses specific to ICE connectivity checks.

本节定义了处理特定于ICE连接检查的绑定响应的附加程序。

When a Binding response is received, it is correlated to the corresponding Binding request using the transaction ID [RFC5389], which then associates the response with the candidate pair for which the Binding request was sent. After that, the response is processed according to the procedures for a role conflict, a failure, or a success, according to the procedures below.

当接收到绑定响应时,它使用事务ID[RFC5389]与相应的绑定请求相关联,然后事务ID将响应与发送绑定请求的候选对相关联。之后,根据以下过程,根据角色冲突、失败或成功的过程处理响应。

7.2.5.1. Role Conflict
7.2.5.1. 角色冲突

If the Binding request generates a 487 (Role Conflict) error response (Section 7.3.1.1), and if the ICE agent included an ICE-CONTROLLED attribute in the request, the agent MUST switch to the controlling role. If the agent included an ICE-CONTROLLING attribute in the request, the agent MUST switch to the controlled role.

如果绑定请求生成487(角色冲突)错误响应(第7.3.1.1节),并且如果ICE代理在请求中包含ICE控制的属性,则代理必须切换到控制角色。如果代理在请求中包含ICE-CONTROLING属性,则代理必须切换到受控角色。

Once the agent has switched its role, the agent MUST add the candidate pair whose check generated the 487 error response to the triggered-check queue associated with the checklist to which the pair belongs, and set the candidate pair state to Waiting. When the triggered connectivity check is later performed, the ICE-CONTROLLING/ ICE-CONTROLLED attribute of the Binding request will indicate the agent's new role. The agent MUST change the tiebreaker value.

一旦代理切换了其角色,代理必须将其检查生成487错误响应的候选对添加到与该对所属的检查表关联的触发检查队列中,并将候选对状态设置为等待。稍后执行触发的连接检查时,绑定请求的ICE-CONTROLING/ICE-CONTROLED属性将指示代理的新角色。代理必须更改断开连接的值。

NOTE: A role switch requires an agent to recompute pair priorities (Section 6.1.2.3), since the priority values depend on the role.

注意:角色切换需要代理重新计算对优先级(第6.1.2.3节),因为优先级值取决于角色。

NOTE: A role switch will also impact whether the agent is responsible for nominating candidate pairs, and whether the agent is responsible for initiating the exchange of the updated candidate information with the peer once ICE is concluded.

注意:角色切换还将影响代理是否负责提名候选对,以及代理是否负责在ICE结束后启动与对等方的更新候选信息交换。

7.2.5.2. Failure
7.2.5.2. 失败

This section describes cases when the candidate pair state is set to Failed.

本节描述候选对状态设置为失败的情况。

NOTE: When the ICE agent sets the candidate pair state to Failed as a result of a connectivity-check error, the agent does not change the states of other candidate pairs with the same foundation.

注意:当ICE代理由于连接检查错误而设置候选对状态失败时,代理不改变具有相同基础的其他候选对的状态。

7.2.5.2.1. Non-Symmetric Transport Addresses
7.2.5.2.1. 非对称传输地址

The ICE agent MUST check that the source and destination transport addresses in the Binding request and response are symmetric. That is, the source IP address and port of the response MUST be equal to the destination IP address and port to which the Binding request was sent, and the destination IP address and port of the response MUST be equal to the source IP address and port from which the Binding request was sent. If the addresses are not symmetric, the agent MUST set the candidate pair state to Failed.

ICE代理必须检查绑定请求和响应中的源和目标传输地址是否对称。也就是说,响应的源IP地址和端口必须等于绑定请求发送到的目标IP地址和端口,响应的目标IP地址和端口必须等于绑定请求发送到的源IP地址和端口。如果地址不对称,代理必须将候选对状态设置为失败。

7.2.5.2.2. ICMP Error
7.2.5.2.2. ICMP错误

An ICE agent MAY support processing of ICMP errors for connectivity checks. If the agent supports processing of ICMP errors, and if a Binding request generates a hard ICMP error, the agent SHOULD set the state of the candidate pair to Failed. Implementers need to be aware that ICMP errors can be used as a method for Denial-of-Service (DoS) attacks when making a decision on how and if to process ICMP errors.

ICE代理可以支持处理ICMP错误以进行连接检查。如果代理支持处理ICMP错误,并且绑定请求生成硬ICMP错误,则代理应将候选对的状态设置为失败。实施者需要知道,在决定如何以及是否处理ICMP错误时,ICMP错误可以用作拒绝服务(DoS)攻击的方法。

7.2.5.2.3. Timeout
7.2.5.2.3. 超时

If the Binding request transaction times out, the ICE agent MUST set the candidate pair state to Failed.

如果绑定请求事务超时,ICE代理必须将候选对状态设置为Failed。

7.2.5.2.4. Unrecoverable STUN Response
7.2.5.2.4. 不可恢复性眩晕反应

If the Binding request generates a STUN error response that is unrecoverable [RFC5389], the ICE agent SHOULD set the candidate pair state to Failed.

如果绑定请求生成无法恢复的STUN错误响应[RFC5389],ICE代理应将候选对状态设置为失败。

7.2.5.3. Success
7.2.5.3. 成功

A connectivity check is considered a success if each of the following criteria is true:

如果符合以下每个条件,则连接检查视为成功:

o The Binding request generated a success response; and

o 绑定请求生成成功响应;和

o The source and destination transport addresses in the Binding request and response are symmetric.

o 绑定请求和响应中的源和目标传输地址是对称的。

If a check is considered a success, the ICE agent performs (in order) the actions described in the following sections.

如果检查被视为成功,ICE代理将(按顺序)执行以下部分中描述的操作。

7.2.5.3.1. Discovering Peer-Reflexive Candidates
7.2.5.3.1. 发现同伴自反候选者

The ICE agent MUST check the mapped address from the STUN response. If the transport address does not match any of the local candidates that the agent knows about, the mapped address represents a new candidate: a peer-reflexive candidate. Like other candidates, a peer-reflexive candidate has a type, base, priority, and foundation. They are computed as follows:

ICE代理必须检查STUN响应中的映射地址。如果传输地址与代理知道的任何本地候选地址都不匹配,则映射的地址表示一个新候选:对等自反候选。与其他候选人一样,同侪自反候选人具有类型、基础、优先权和基础。它们的计算如下:

o The type is peer reflexive.

o 这种类型是同伴反射型。

o The base is the local candidate of the candidate pair from which the Binding request was sent.

o base是发送绑定请求的候选对的本地候选。

o The priority is the value of the PRIORITY attribute in the Binding request.

o 优先级是绑定请求中优先级属性的值。

o The foundation is described in Section 5.1.1.3.

o 基金会在第5.1.1.3节中描述。

The peer-reflexive candidate is then added to the list of local candidates for the data stream. The username fragment and password are the same as for all other local candidates for that data stream.

然后将对等自反候选添加到数据流的本地候选列表中。用户名片段和密码与该数据流的所有其他本地候选用户名和密码相同。

The ICE agent does not need to pair the peer-reflexive candidate with remote candidates, as a valid pair will be created due to the procedures in Section 7.2.5.3.2. If an agent wishes to pair the peer-reflexive candidate with remote candidates other than the one in the valid pair that will be generated, the agent MAY provide updated candidate information to the peer that includes the peer-reflexive candidate. This will cause the peer-reflexive candidate to be paired with all other remote candidates.

ICE代理不需要将对等自反候选与远程候选配对,因为将根据第7.2.5.3.2节中的程序创建有效配对。如果代理希望将对等自反候选者与远程候选者配对,而不是将生成的有效配对中的远程候选者,则代理可以向包括对等自反候选者的对等方提供更新的候选者信息。这将导致对等自反候选对象与所有其他远程候选对象配对。

7.2.5.3.2. Constructing a Valid Pair
7.2.5.3.2. 构造有效对

The ICE agent constructs a candidate pair whose local candidate equals the mapped address of the response and whose remote candidate equals the destination address to which the request was sent. This is called a "valid pair".

ICE代理构造一个候选对,其本地候选等于响应的映射地址,远程候选等于请求发送到的目标地址。这称为“有效对”。

The valid pair might equal the pair that generated the connectivity check, a different pair in the checklist, or a pair currently not in the checklist.

有效对可能等于生成连接检查的对、检查表中的另一对或当前不在检查表中的对。

The agent maintains a separate list, referred to as the "valid list". There is a valid list for each checklist in the checklist set. The valid list will contain valid pairs. Initially, each valid list is empty.

代理维护一个单独的列表,称为“有效列表”。检查表集中的每个检查表都有一个有效列表。有效列表将包含有效对。最初,每个有效列表都是空的。

Each valid pair within the valid list has a flag, called the "nominated flag". When a valid pair is added to a valid list, the flag value is set to 'false'.

有效列表中的每个有效对都有一个标志,称为“指定标志”。将有效对添加到有效列表时,标志值设置为“false”。

The valid pair will be added to a valid list as follows:

有效对将添加到有效列表中,如下所示:

1. If the valid pair equals the pair that generated the check, the pair is added to the valid list associated with the checklist to which the pair belongs; or

1. 如果有效对等于生成检查的对,则将该对添加到与该对所属的检查表关联的有效列表中;或

2. If the valid pair equals another pair in a checklist, that pair is added to the valid list associated with the checklist of that pair. The pair that generated the check is not added to a valid list; or

2. 如果有效对等于清单中的另一对,则该对将添加到与该对的清单关联的有效列表中。生成检查的对未添加到有效列表中;或

3. If the valid pair is not in any checklist, the agent computes the priority for the pair based on the priority of each candidate, using the algorithm in Section 6.1.2. The priority of the local candidate depends on its type. Unless the type is peer reflexive, the priority is equal to the priority signaled for that candidate in the candidate exchange. If the type is peer reflexive, it is equal to the PRIORITY attribute the agent placed in the Binding request that just completed. The priority of the remote candidate is taken from the candidate information of the peer. If the candidate does not appear there, then the check has been a triggered check to a new remote candidate. In that case, the priority is taken as the value of the PRIORITY attribute in the Binding request that triggered the check that just completed. The pair is then added to the valid list.

3. 如果有效配对不在任何检查表中,则代理使用第6.1.2节中的算法,根据每个候选项的优先级计算配对的优先级。本地候选者的优先级取决于其类型。除非类型是对等自反,否则优先级等于候选交换中为该候选发送的优先级。如果类型是对等自反的,则它等于代理在刚刚完成的绑定请求中放置的优先级属性。远程候选的优先级取自对等方的候选信息。如果候选人没有出现在那里,则该检查是对新远程候选人的触发检查。在这种情况下,优先级被视为触发刚刚完成的检查的绑定请求中优先级属性的值。然后将该对添加到有效列表中。

NOTE: It will be very common that the valid pair will not be in any checklist. Recall that the checklist has pairs whose local candidates are never reflexive; those pairs had their local candidates converted to the base of the reflexive candidates and were then pruned if they were redundant. When the response to the Binding request arrives, the mapped address will be reflexive if there is a NAT between the two. In that case, the valid pair will have a local candidate that doesn't match any of the pairs in the checklist.

注意:有效的一对不在任何检查表中是很常见的。回想一下,检查表中有一些配对,它们的本地候选者从不自反;这些对将它们的本地候选者转换为自反候选者的基,如果它们是多余的,则被修剪。当绑定请求的响应到达时,如果两者之间存在NAT,则映射的地址将是自反的。在这种情况下,有效的一对将有一个与清单中的任何一对都不匹配的本地候选项。

7.2.5.3.3. Updating Candidate Pair States
7.2.5.3.3. 更新候选对状态

The ICE agent sets the states of both the candidate pair that generated the check and the constructed valid pair (which may be different) to Succeeded.

ICE代理将生成检查的候选对和构造的有效对(可能不同)的状态设置为成功。

The agent MUST set the states for all other Frozen candidate pairs in all checklists with the same foundation to Waiting.

代理必须在所有检查表中为所有其他冻结候选对设置状态,与等待的基础相同。

NOTE: Within a given checklist, candidate pairs with the same foundations will typically have different component ID values.

注:在给定的检查表中,具有相同基础的候选对通常具有不同的组件ID值。

7.2.5.3.4. Updating the Nominated Flag
7.2.5.3.4. 更新指定标志

If the controlling agent sends a Binding request with the USE-CANDIDATE attribute set, and if the ICE agent receives a successful response to the request, the agent sets the nominated flag of the pair to true. If the request fails (Section 7.2.5.2), the agent MUST remove the candidate pair from the valid list, set the candidate pair state to Failed, and set the checklist state to Failed.

如果控制代理发送带有USE-CANDIDATE属性集的绑定请求,并且如果ICE代理接收到对该请求的成功响应,则代理将该对的指定标志设置为true。如果请求失败(第7.2.5.2节),代理必须从有效列表中删除候选对,将候选对状态设置为失败,并将检查表状态设置为失败。

If the controlled agent receives a successful response to a Binding request sent by the agent, and that Binding request was triggered by a received Binding request with the USE-CANDIDATE attribute set (Section 7.3.1.4), the agent sets the nominated flag of the pair to true. If the triggered request fails, the agent MUST remove the candidate pair from the valid list, set the candidate pair state to Failed, and set the checklist state to Failed.

如果受控代理接收到对代理发送的绑定请求的成功响应,并且该绑定请求是由接收到的绑定请求触发的,并且设置了USE-CANDIDATE属性(第7.3.1.4节),则代理会将该对的指定标志设置为true。如果触发的请求失败,代理必须从有效列表中删除候选对,将候选对状态设置为失败,并将检查表状态设置为失败。

Once the nominated flag is set for a component of a data stream, it concludes the ICE processing for that component (Section 8).

一旦为数据流的一个组件设置了指定标志,它就结束了该组件的ICE处理(第8节)。

7.2.5.4. Checklist State Updates
7.2.5.4. 清单状态更新

Regardless of whether a connectivity check was successful or failed, the completion of the check may require updating of checklist states. For each checklist in the checklist set, if all of the candidate pairs are in either Failed or Succeeded state, and if there is not a valid pair in the valid list for each component of the data stream

无论连接检查是成功还是失败,完成检查都可能需要更新检查表状态。对于检查表集中的每个检查表,如果所有候选对都处于失败或成功状态,并且数据流的每个组件的有效列表中没有有效对

associated with the checklist, the state of the checklist is set to Failed. If there is a valid pair for each component in the valid list, the state of the checklist is set to Succeeded.

与检查表关联,检查表的状态设置为失败。如果有效列表中的每个组件都有一个有效对,则检查表的状态设置为成功。

7.3. STUN Server Procedures
7.3. STUN服务器程序

An ICE agent (lite or full) MUST be prepared to receive Binding requests on the base of each candidate it included in its most recent candidate exchange.

ICE代理(lite或full)必须准备好接收基于其最近的候选交换中包含的每个候选的绑定请求。

The agent MUST use the short-term credential mechanism (i.e., the MESSAGE-INTEGRITY attribute) to authenticate the request and perform a message integrity check. Likewise, the short-term credential mechanism MUST be used for the response. The agent MUST consider the username to be valid if it consists of two values separated by a colon, where the first value is equal to the username fragment generated by the agent in a candidate exchange for a session in progress. It is possible (and in fact very likely) that the initiating agent will receive a Binding request prior to receiving the candidates from its peer. If this happens, the agent MUST immediately generate a response (including computation of the mapped address as described in Section 7.3.1.2). The agent has sufficient information at this point to generate the response; the password from the peer is not required. Once the answer is received, it MUST proceed with the remaining steps required; namely, see Sections 7.3.1.3, 7.3.1.4, and 7.3.1.5 for full implementations. In cases where multiple STUN requests are received before the answer, this may cause several pairs to be queued up in the triggered-check queue.

代理必须使用短期凭证机制(即消息完整性属性)来验证请求并执行消息完整性检查。同样,响应必须使用短期凭证机制。代理必须考虑用户名是有效的,如果它由由冒号分隔的两个值组成,其中第一个值等于代理在候选会话中生成的用户名片段,用于正在进行的会话。有可能(事实上很有可能)发起代理会在从其对等方接收候选方之前收到绑定请求。如果发生这种情况,代理必须立即生成响应(包括第7.3.1.2节所述的映射地址的计算)。此时代理有足够的信息生成响应;不需要来自对等方的密码。收到答复后,必须继续执行所需的其余步骤;即,参见第7.3.1.3节、第7.3.1.4节和第7.3.1.5节了解完整实施。如果在应答之前收到多个STUN请求,这可能会导致多个对在触发的检查队列中排队。

An agent MUST NOT utilize the ALTERNATE-SERVER mechanism and MUST NOT support the backwards-compatibility mechanisms defined in RFC 5389 (for working with the protocol in RFC 3489). It MUST utilize the FINGERPRINT mechanism.

代理不得使用备用服务器机制,也不得支持RFC 5389中定义的向后兼容机制(用于使用RFC 3489中的协议)。它必须利用指纹机制。

If the agent is using DSCP markings [RFC2475] in its data packets, it SHOULD apply the same markings to Binding responses. The same would apply to any Layer 2 markings the endpoint might be applying to data packets.

如果代理在其数据包中使用DSCP标记[RFC2475],则应将相同的标记应用于绑定响应。这同样适用于端点可能应用于数据包的任何第2层标记。

7.3.1. Additional Procedures for Full Implementations
7.3.1. 完整实现的附加过程

This subsection defines the additional server procedures applicable to full implementations, when the full implementation accepts the Binding request.

本小节定义了当完整实现接受绑定请求时,适用于完整实现的其他服务器过程。

7.3.1.1. Detecting and Repairing Role Conflicts
7.3.1.1. 检测和修复角色冲突

In certain usages of ICE (such as 3PCC), both ICE agents may end up choosing the same role, resulting in a role conflict. The section describes a mechanism for detecting and repairing role conflicts. The usage document MUST specify whether this mechanism is needed.

在ICE的某些用法(如3PCC)中,两个ICE代理可能最终选择相同的角色,从而导致角色冲突。本节描述用于检测和修复角色冲突的机制。使用文档必须指定是否需要此机制。

An agent MUST examine the Binding request for either the ICE-CONTROLLING or ICE-CONTROLLED attribute. It MUST follow these procedures:

代理必须检查ICE-CONTROLING或ICE-CONTROLED属性的绑定请求。它必须遵循以下程序:

o If the agent is in the controlling role, and the ICE-CONTROLLING attribute is present in the request:

o 如果代理处于控制角色,并且ICE-CONTROLING属性存在于请求中:

* If the agent's tiebreaker value is larger than or equal to the contents of the ICE-CONTROLLING attribute, the agent generates a Binding error response and includes an ERROR-CODE attribute with a value of 487 (Role Conflict) but retains its role.

* 如果代理的tiebreaker值大于或等于ICE-CONTROLING属性的内容,则代理将生成绑定错误响应,并包含一个值为487(角色冲突)的错误代码属性,但保留其角色。

* If the agent's tiebreaker value is less than the contents of the ICE-CONTROLLING attribute, the agent switches to the controlled role.

* 如果代理的tiebreaker值小于ICE-CONTROLING属性的内容,则代理将切换到受控角色。

o If the agent is in the controlled role, and the ICE-CONTROLLED attribute is present in the request:

o 如果代理处于受控角色,并且ICE-CONTROLED属性存在于请求中:

* If the agent's tiebreaker value is larger than or equal to the contents of the ICE-CONTROLLED attribute, the agent switches to the controlling role.

* 如果代理的tiebreaker值大于或等于ICE-CONTROLLED属性的内容,则代理将切换到控制角色。

* If the agent's tiebreaker value is less than the contents of the ICE-CONTROLLED attribute, the agent generates a Binding error response and includes an ERROR-CODE attribute with a value of 487 (Role Conflict) but retains its role.

* 如果代理的tiebreaker值小于ICE-CONTROLLED属性的内容,则代理将生成绑定错误响应,并包含一个值为487(角色冲突)的错误代码属性,但保留其角色。

o If the agent is in the controlled role and the ICE-CONTROLLING attribute was present in the request, or if the agent was in the controlling role and the ICE-CONTROLLED attribute was present in the request, there is no conflict.

o 如果代理处于受控角色且ICE控制属性存在于请求中,或者如果代理处于控制角色且ICE控制属性存在于请求中,则不存在冲突。

A change in roles will require an agent to recompute pair priorities (Section 6.1.2.3), since those priorities are a function of role. The change in role will also impact whether the agent is responsible for selecting nominated pairs and initiating exchange with updated candidate information upon conclusion of ICE.

角色变更将要求代理重新计算配对优先级(第6.1.2.3节),因为这些优先级是角色的函数。角色的变化还将影响代理是否负责选择提名对,并在ICE结束时启动与更新的候选信息的交换。

The remaining subsections in Section 7.3.1 are followed if the agent generated a successful response to the Binding request, even if the agent changed roles.

如果代理成功响应绑定请求,则遵循第7.3.1节中的其余小节,即使代理更改了角色。

7.3.1.2. Computing Mapped Addresses
7.3.1.2. 计算映射地址

For requests received on a relayed candidate, the source transport address used for STUN processing (namely, generation of the XOR-MAPPED-ADDRESS attribute) is the transport address as seen by the TURN server. That source transport address will be present in the XOR-PEER-ADDRESS attribute of a Data Indication message, if the Binding request was delivered through a Data Indication. If the Binding request was delivered through a ChannelData message, the source transport address is the one that was bound to the channel.

对于中继候选上接收的请求,用于STUN处理(即,生成XOR-MAPPED-address属性)的源传输地址是TURN服务器看到的传输地址。如果绑定请求是通过数据指示传递的,则该源传输地址将出现在数据指示消息的XOR-PEER-address属性中。如果绑定请求是通过ChannelData消息传递的,则源传输地址是绑定到通道的地址。

7.3.1.3. Learning Peer-Reflexive Candidates
7.3.1.3. 学习同伴自反候选者

If the source transport address of the request does not match any existing remote candidates, it represents a new peer-reflexive remote candidate. This candidate is constructed as follows:

如果请求的源传输地址与任何现有远程候选不匹配,则它表示新的对等自反远程候选。该候选者的结构如下:

o The type is peer reflexive.

o 这种类型是同伴反射型。

o The priority is the value of the PRIORITY attribute in the Binding request.

o 优先级是绑定请求中优先级属性的值。

o The foundation is an arbitrary value, different from the foundations of all other remote candidates. If any subsequent candidate exchanges contain this peer-reflexive candidate, it will signal the actual foundation for the candidate.

o 基金会是一个任意的值,不同于所有其他远程候选人的基础。如果任何后续候选交换包含该对等自反候选,则它将为候选信号提供实际基础。

o The component ID is the component ID of the local candidate to which the request was sent.

o 组件ID是向其发送请求的本地候选组件的组件ID。

This candidate is added to the list of remote candidates. However, the ICE agent does not pair this candidate with any local candidates.

此候选对象将添加到远程候选对象列表中。但是,ICE代理不会将此候选人与任何本地候选人配对。

7.3.1.4. Triggered Checks
7.3.1.4. 触发检查

Next, the agent constructs a pair whose local candidate has the transport address (as seen by the agent) on which the STUN request was received and a remote candidate equal to the source transport address where the request came from (which may be the peer-reflexive remote candidate that was just learned). The local candidate will be either a host candidate (for cases where the request was not received through a relay) or a relayed candidate (for cases where it is received through a relay). The local candidate can never be a server-reflexive candidate. Since both candidates are known to the

接下来,代理构造一对,其本地候选具有接收STUN请求的传输地址(如代理所见)和等于请求来自的源传输地址的远程候选(可能是刚刚学习的对等自反远程候选)。本地候选将是主机候选(对于未通过中继接收到请求的情况)或中继候选(对于通过中继接收到请求的情况)。本地候选者永远不能是服务器自反候选者。因为两位候选人都为公众所知

agent, it can obtain their priorities and compute the candidate pair priority. This pair is then looked up in the checklist. There can be one of several outcomes:

代理,它可以获得它们的优先级并计算候选对优先级。然后在清单中查找这一对。可能有以下几种结果之一:

o When the pair is already on the checklist:

o 当配对已在检查表上时:

* If the state of that pair is Succeeded, nothing further is done.

* 如果该对的状态成功,则不会执行任何进一步的操作。

* If the state of that pair is In-Progress, the agent cancels the In-Progress transaction. Cancellation means that the agent will not retransmit the Binding requests associated with the connectivity-check transaction, will not treat the lack of response to be a failure, but will wait the duration of the transaction timeout for a response. In addition, the agent MUST enqueue the pair in the triggered checklist associated with the checklist, and set the state of the pair to Waiting, in order to trigger a new connectivity check of the pair. Creating a new connectivity check enables validating In-Progress pairs as soon as possible, without having to wait for retransmissions of the Binding requests associated with the original connectivity-check transaction.

* 如果该对的状态为“正在进行”,则代理将取消正在进行的事务。取消意味着代理不会重新传输与连接检查事务相关联的绑定请求,不会将缺少响应视为失败,但会等待事务超时的持续时间以获得响应。此外,代理必须在与检查表关联的已触发检查表中将该对排队,并将该对的状态设置为等待,以便触发该对的新连接检查。通过创建新的连接检查,可以尽快验证进行中的对,而无需等待重新传输与原始连接检查事务关联的绑定请求。

* If the state of that pair is Waiting, Frozen, or Failed, the agent MUST enqueue the pair in the triggered checklist associated with the checklist (if not already present), and set the state of the pair to Waiting, in order to trigger a new connectivity check of the pair. Note that a state change of the pair from Failed to Waiting might also trigger a state change of the associated checklist.

* 如果该对的状态为等待、冻结或失败,则代理必须将该对排入与该检查表关联的已触发检查表(如果尚未存在)中,并将该对的状态设置为等待,以便触发该对的新连接检查。请注意,从失败到等待对的状态更改也可能触发关联检查表的状态更改。

These steps are done to facilitate rapid completion of ICE when both agents are behind NAT.

当两种试剂都落后于NAT时,这些步骤有助于快速完成ICE。

o If the pair is not already on the checklist:

o 如果该对不在检查表上:

* The pair is inserted into the checklist based on its priority.

* 该对将根据其优先级插入检查表。

* Its state is set to Waiting.

* 其状态设置为等待。

* The pair is enqueued into the triggered-check queue.

* 该对被排队到触发的检查队列中。

When a triggered check is to be sent, it is constructed and processed as described in Section 7.2.4. These procedures require the agent to know the transport address, username fragment, and password for the peer. The username fragment for the remote candidate is equal to the part after the colon of the USERNAME in the Binding request that was just received. Using that username fragment, the agent can check the

当发送触发检查时,应按照第7.2.4节所述进行构造和处理。这些过程要求代理知道对等方的传输地址、用户名片段和密码。远程候选用户的用户名片段等于刚刚收到的绑定请求中用户名冒号后的部分。使用该用户名片段,代理可以检查

candidates received from its peer (there may be more than one in cases of forking) and find this username fragment. The corresponding password is then picked.

候选人从其同行处收到(在分叉的情况下可能不止一个)并找到此用户名片段。然后选择相应的密码。

7.3.1.5. Updating the Nominated Flag
7.3.1.5. 更新指定标志

If the controlled agent receives a Binding request with the USE-CANDIDATE attribute set, and if the ICE agent accepts the request, the following action is based on the state of the pair computed in Section 7.3.1.4:

如果受控代理接收到一个绑定请求并设置了USE-CANDIDATE属性,并且如果ICE代理接受该请求,则以下操作基于第7.3.1.4节中计算的对的状态:

o If the state of this pair is Succeeded, it means that the check previously sent by this pair produced a successful response and generated a valid pair (Section 7.2.5.3.2). The agent sets the nominated flag value of the valid pair to true.

o 如果该对的状态为成功,则表示该对先前发送的检查产生了成功响应并生成了有效对(第7.2.5.3.2节)。代理将有效对的指定标志值设置为true。

o If the received Binding request triggered a new check to be enqueued in the triggered-check queue (Section 7.3.1.4), once the check is sent and if it generates a successful response, and generates a valid pair, the agent sets the nominated flag of the pair to true. If the request fails (Section 7.2.5.2), the agent MUST remove the candidate pair from the valid list, set the candidate pair state to Failed, and set the checklist state to Failed.

o 如果收到的绑定请求触发了一个新的检查,并将其加入到触发的检查队列中(第7.3.1.4节),则在发送检查后,如果它生成了一个成功的响应,并生成了一个有效的对,则代理将该对的指定标志设置为true。如果请求失败(第7.2.5.2节),代理必须从有效列表中删除候选对,将候选对状态设置为失败,并将检查表状态设置为失败。

If the controlled agent does not accept the request from the controlling agent, the controlled agent MUST reject the nomination request with an appropriate error code response (e.g., 400) [RFC5389].

如果受控代理不接受来自控制代理的请求,则受控代理必须使用适当的错误代码响应(例如400)[RFC5389]拒绝提名请求。

Once the nominated flag is set for a component of a data stream, it concludes the ICE processing for that component. See Section 8.

一旦为数据流的一个组件设置了指定标志,它将结束该组件的ICE处理。见第8节。

7.3.2. Additional Procedures for Lite Implementations
7.3.2. Lite实现的附加过程

If the controlled agent receives a Binding request with the USE-CANDIDATE attribute set, and if the ICE agent accepts the request, the agent constructs a candidate pair whose local candidate has the transport address on which the request was received, and whose remote candidate is equal to the source transport address of the request that was received. This candidate pair is assigned an arbitrary priority and placed into the valid list of the associated checklist. The agent sets the nominated flag for that pair to true.

如果受控代理接收到具有USE-CANDIDATE属性集的绑定请求,并且如果ICE代理接受该请求,则代理构造一个候选对,其本地候选具有接收请求的传输地址,其远程候选地址等于接收到的请求的源传输地址。该候选对被分配一个任意优先级,并放入相关检查表的有效列表中。代理将该对的指定标志设置为true。

Once the nominated flag is set for a component of a data stream, it concludes the ICE processing for that component. See Section 8.

一旦为数据流的一个组件设置了指定标志,它将结束该组件的ICE处理。见第8节。

8. Concluding ICE Processing
8. 成品冰加工

This section describes how an ICE agent completes ICE.

本节介绍ICE代理如何完成ICE。

8.1. Procedures for Full Implementations
8.1. 全面实施的程序

Concluding ICE involves nominating pairs by the controlling agent and updating state machinery.

结论ICE包括由控制代理指定对和更新状态机制。

8.1.1. Nominating Pairs
8.1.1. 提名对

Prior to nominating, the controlling agent lets connectivity checks continue until some stopping criterion is met. After that, based on an evaluation criterion, the controlling agent picks a pair among the valid pairs in the valid list for nomination.

在指定之前,控制代理允许继续进行连接检查,直到满足某些停止条件。然后,基于评估标准,控制代理从有效列表中的有效对中选择一对进行提名。

Once the controlling agent has picked a valid pair for nomination, it repeats the connectivity check that produced this valid pair (by enqueueing the pair that generated the check into the triggered-check queue), this time with the USE-CANDIDATE attribute (Section 7.2.5.3.4). The procedures for the controlled agent are described in Section 7.3.1.5.

一旦控制代理选择了一个有效的对进行提名,它将重复生成该有效对的连接检查(通过将生成检查的对排队到触发的检查队列中),这次使用USE-CANDIDATE属性(第7.2.5.3.4节)。第7.3.1.5节描述了受控试剂的程序。

Eventually, if the nominations succeed, both the controlling and controlled agents will have a single nominated pair in the valid list for each component of the data stream. Once an ICE agent sets the state of the checklist to Completed (when there is a nominated pair for each component of the data stream), that pair becomes the selected pair for that agent and is used for sending and receiving data for that component of the data stream.

最终,如果提名成功,控制代理和受控代理在数据流的每个组件的有效列表中都将有一个单一的提名对。一旦ICE代理将检查表的状态设置为完成(当数据流的每个组件都有指定的对时),该对将成为该代理的选定对,并用于发送和接收数据流的该组件的数据。

If an agent is not able to produce selected pairs for each component of a data stream, the agent MUST take proper actions for informing the other agent, e.g., by removing the stream. The exact actions are outside the scope of this specification.

如果某个代理无法为数据流的每个组件生成选定的对,则该代理必须采取适当的措施通知另一个代理,例如,删除该流。具体操作不在本规范的范围内。

The criteria for stopping the connectivity checks and for picking a pair for nomination are outside the scope of this specification. They are a matter of local optimization. The only requirement is that the agent MUST eventually pick one and only one candidate pair and generate a check for that pair with the USE-CANDIDATE attribute set.

停止连接检查和选择一对进行提名的标准不在本规范的范围内。它们是局部优化的问题。唯一的要求是代理必须最终选择一个且仅选择一个候选对,并使用USE-candidate属性集为该对生成检查。

Once the controlling agent has successfully nominated a candidate pair (Section 7.2.5.3.4), the agent MUST NOT nominate another pair for same component of the data stream within the ICE session. Doing so requires an ICE restart.

一旦控制代理成功提名了候选对(第7.2.5.3.4节),代理不得在ICE会话中为数据流的相同组件提名另一对。这样做需要ICE重启。

A controlling agent that does not support this specification (i.e., it is implemented according to RFC 5245) might nominate more than one candidate pair. This was referred to as "aggressive nomination" in RFC 5245. If more than one candidate pair is nominated by the controlling agent, and if the controlled agent accepts multiple nominations requests, the agents MUST produce the selected pairs and use the pairs with the highest priority.

不支持此规范的控制代理(即,它是根据RFC 5245实现的)可以指定多个候选对。这在RFC 5245中被称为“积极提名”。如果控制代理指定了多个候选对,并且如果控制代理接受多个提名请求,则代理必须生成所选对并使用具有最高优先级的对。

The usage of the 'ice2' ICE option (Section 10) by endpoints supporting this specification is supposed to prevent controlling agents that are implemented according to RFC 5245 from using aggressive nomination.

支持本规范的端点使用“ice2”ICE选项(第10节)旨在防止根据RFC 5245实施的控制代理使用攻击性提名。

NOTE: In RFC 5245, usage of "aggressive nomination" allowed agents to continuously nominate pairs, before a pair was eventually selected, in order to allow sending of data on those pairs. In this specification, data can always be sent on any valid pair, without nomination. Hence, there is no longer a need for aggressive nomination.

注:在RFC 5245中,“积极提名”的使用允许代理在最终选择对之前连续提名对,以便允许发送这些对上的数据。在本规范中,数据始终可以在任何有效对上发送,无需指定。因此,不再需要激进的提名。

8.1.2. Updating Checklist and ICE States
8.1.2. 更新清单和ICE状态

For both a controlling and a controlled agent, when a candidate pair for a component of a data stream gets nominated, it might impact other pairs in the checklist associated with the data stream. It might also impact the state of the checklist:

对于控制代理和受控代理,当指定数据流组件的候选对时,它可能会影响与数据流关联的检查表中的其他对。它还可能影响检查表的状态:

o Once a candidate pair for a component of a data stream has been nominated, and the state of the checklist associated with the data stream is Running, the ICE agent MUST remove all candidate pairs for the same component from the checklist and from the triggered-check queue. If the state of a pair is In-Progress, the agent cancels the In-Progress transaction. Cancellation means that the agent will not retransmit the Binding requests associated with the connectivity-check transaction, will not treat the lack of response to be a failure, but will wait the duration of the transaction timeout for a response.

o 一旦指定了数据流组件的候选对,并且与数据流关联的检查表的状态正在运行,ICE代理必须从检查表和触发的检查队列中删除同一组件的所有候选对。如果对的状态为进行中,代理将取消进行中的事务。取消意味着代理不会重新传输与连接检查事务相关联的绑定请求,不会将缺少响应视为失败,但会等待事务超时的持续时间以获得响应。

o Once candidate pairs for each component of a data stream have been nominated, and the state of the checklist associated with the data stream is Running, the ICE agent sets the state of the checklist to Completed.

o 一旦为数据流的每个组件指定了候选对,并且与数据流相关联的检查表的状态正在运行,ICE代理将检查表的状态设置为完成。

o Once a candidate pair for a component of a data stream has been nominated, an agent MUST continue to respond to any Binding request it might still receive for the nominated pair and for any remaining candidate pairs in the checklist associated with the

o 一旦指定了数据流组件的候选对,代理必须继续响应它可能仍然收到的针对该指定对和与该组件相关联的清单中的任何剩余候选对的任何绑定请求

data stream. As defined in Section 7.3.1.4, when the state of a pair is Succeeded, an agent will no longer generate triggered checks when receiving a Binding request for the pair.

数据流。如第7.3.1.4节所定义,当对的状态成功时,代理在接收到对的绑定请求时将不再生成触发检查。

Once the state of each checklist in the checklist set is Completed, the agent sets the state of the ICE session to Completed.

检查表集中每个检查表的状态完成后,代理将ICE会话的状态设置为“完成”。

If the state of a checklist is Failed, ICE has not been able to successfully complete the process for the data stream associated with the checklist. The correct behavior depends on the state of the checklists in the checklist set. If the controlling agent wants to continue the session without the data stream associated with the Failed checklist, and if there are still one or more checklists in Running or Completed mode, the agent can let the ICE processing continue. The agent MUST take proper actions for removing the failed data stream. If the controlling agent does not want to continue the session and MUST terminate the session, the state of the ICE session is set to Failed.

如果检查表的状态失败,则ICE无法成功完成与检查表关联的数据流的处理。正确的行为取决于检查表集中检查表的状态。如果控制代理希望在没有与失败检查表关联的数据流的情况下继续会话,并且如果仍有一个或多个检查表处于运行或完成模式,则代理可以让ICE处理继续。代理必须采取适当的操作来删除失败的数据流。如果控制代理不希望继续会话,并且必须终止会话,则ICE会话的状态将设置为失败。

If the state of each checklist in the checklist set is Failed, the state of the ICE session is set to Failed. Unless the controlling agent wants to continue the session without the data streams, it MUST terminate the session.

如果检查表集中每个检查表的状态均为失败,则ICE会话的状态将设置为失败。除非控制代理希望在没有数据流的情况下继续会话,否则它必须终止会话。

8.2. Procedures for Lite Implementations
8.2. Lite实现的过程

When ICE concludes, a lite ICE agent can free host candidates that were not used by ICE, as described in Section 8.3.

当ICE结束时,lite ICE代理可以释放ICE未使用的候选主机,如第8.3节所述。

If the peer is a full agent, once the lite agent accepts a nomination request for a candidate pair, the lite agent considers the pair nominated. Once there are nominated pairs for each component of a data stream, the pairs become the selected pairs for the components of the data stream. Once the lite agent has produced selected pairs for all components of all data streams, the ICE session state is set to Completed.

如果对等方是完全代理,一旦lite代理接受候选对的提名请求,lite代理将考虑提名对。一旦为数据流的每个组件指定了对,这些对就成为数据流组件的选定对。lite代理为所有数据流的所有组件生成选定对后,ICE会话状态将设置为“完成”。

If the peer is a lite agent, the agent pairs local candidates with remote candidates that are of the same data stream and have the same component, transport protocol, and IP address family. For each component of each data stream, if there is only one candidate pair, that pair is added to the valid list. If there is more than one pair, it is RECOMMENDED that an agent follow the procedures of RFC 6724 [RFC6724] to select a pair and add it to the valid list.

如果对等方是lite代理,则代理将本地候选方与远程候选方配对,远程候选方具有相同的数据流,并且具有相同的组件、传输协议和IP地址系列。对于每个数据流的每个组件,如果只有一个候选对,则该对将添加到有效列表中。如果有多个对,建议代理按照RFC 6724[RFC6724]的程序选择一个对并将其添加到有效列表中。

If all of the components for all data streams had one pair, the state of ICE processing is Completed. Otherwise, the controlling agent MUST send an updated candidate list to reconcile different agents selecting different candidate pairs. ICE processing is complete after and only after the updated candidate exchange is complete.

如果所有数据流的所有组件都有一对,则ICE处理状态完成。否则,控制代理必须发送更新的候选列表,以协调选择不同候选对的不同代理。ICE处理在且仅在更新的候选交换完成后完成。

8.3. Freeing Candidates
8.3. 释放候选人
8.3.1. Full Implementation Procedures
8.3.1. 全面执行程序

The rules in this section describe when it is safe for an agent to cease sending or receiving checks on a candidate that did not become a selected candidate (i.e., is not associated with a selected pair) and when to free the candidate.

本节中的规则描述代理何时可以安全地停止发送或接收对未成为选定候选对象(即,未与选定对关联)的候选对象的检查,以及何时释放该候选对象。

Once a checklist has reached the Completed state, the agent SHOULD wait an additional three seconds, and then it can cease responding to checks or generating triggered checks on all local candidates other than the ones that became selected candidates. Once all ICE sessions have ceased using a given local candidate (a candidate may be used by multiple ICE sessions, e.g., in forking scenarios), the agent can free that candidate. The three-second delay handles cases when aggressive nomination is used, and the selected pairs can quickly change after ICE has completed.

一旦检查表达到完成状态,代理应再等待三秒钟,然后停止响应检查或对所有本地候选对象生成触发检查,而不是成为选定候选对象的本地候选对象。一旦所有ICE会话停止使用给定的本地候选者(一个候选者可能被多个ICE会话使用,例如在分叉场景中),代理可以释放该候选者。当使用攻击性提名时,三秒延迟处理情况,并且在ICE完成后,所选对可以快速更改。

Freeing of server-reflexive candidates is never explicit; it happens by lack of a keepalive.

释放服务器自反候选者从来都不是明确的;这是由于缺少一个保持活力。

8.3.2. Lite Implementation Procedures
8.3.2. Lite实施程序

A lite implementation can free candidates that did not become selected candidates as soon as ICE processing has reached the Completed state for all ICE sessions using those candidates.

当ICE处理达到使用这些候选对象的所有ICE会话的完成状态时,lite实现可以释放未成为选定候选对象的候选对象。

9. ICE Restarts
9. 冰重新开始

An ICE agent MAY restart ICE for existing data streams. An ICE restart causes all previous states of the data streams, excluding the roles of the agents, to be flushed. The only difference between an ICE restart and a brand new data session is that during the restart, data can continue to be sent using existing data sessions, and a new data session always requires the roles to be determined.

ICE代理可以重新启动现有数据流的ICE。ICE重启会导致刷新数据流的所有先前状态,不包括代理的角色。ICE重启和全新数据会话之间的唯一区别在于,在重启期间,可以使用现有数据会话继续发送数据,而新数据会话始终需要确定角色。

The following actions can be accomplished only by using an ICE restart (the agent MUST use ICE restarts to do so):

以下操作只能通过使用ICE重启来完成(代理必须使用ICE重启来完成):

o Change the destinations of data streams.

o 更改数据流的目标。

o Change from a lite implementation to a full implementation.

o 从lite实现更改为完整实现。

o Change from a full implementation to a lite implementation.

o 从完整实现更改为精简实现。

To restart ICE, an agent MUST change both the password and the username fragment for the data stream(s) being restarted.

要重新启动ICE,代理必须更改正在重新启动的数据流的密码和用户名片段。

When the ICE is restarted, the candidate set for the new ICE session might include some, none, or all of the candidates used in the current ICE session.

重新启动ICE时,新ICE会话的候选集可能包括当前ICE会话中使用的部分、无或所有候选集。

As described in Section 6.1.1, agents MUST NOT redetermine the roles as part as an ICE restart, unless certain criteria that require the roles to be redetermined are fulfilled.

如第6.1.1节所述,代理不得作为ICE重启的一部分重新确定角色,除非满足要求重新确定角色的某些标准。

10. ICE Option
10. ICE期权

This section defines a new ICE option, 'ice2'. When an ICE agent includes 'ice2' in a candidate exchange, the ICE option indicates that it is compliant to this specification. For example, the agent will not use the aggressive nomination procedure defined in RFC 5245. In addition, it will ensure that a peer compliant with RFC 5245 does not use aggressive nomination either, as required by Section 14 of RFC 5245 for peers that receive unknown ICE options.

本节定义了一个新的ICE选项“ice2”。当ICE代理在候选交换中包含“ice2”时,ICE选项表示它符合本规范。例如,代理人不会使用RFC 5245中定义的激进提名程序。此外,它将确保符合RFC 5245的对等方也不会按照RFC 5245第14节对接收未知ICE选项的对等方的要求使用激进提名。

An agent compliant to this specification MUST inform the peer about the compliance using the 'ice2' option.

符合本规范的代理必须使用“ice2”选项通知对等方其符合性。

NOTE: The encoding of the 'ice2' option, and the message(s) used to carry it to the peer, are protocol specific. The encoding for SDP [RFC4566] is defined in [ICE-SIP-SDP].

注:“ice2”选项的编码以及用于将其传送到对等方的消息是特定于协议的。SDP[RFC4566]的编码在[ICE-SIP-SDP]中定义。

11. Keepalives
11. 保持

All endpoints MUST send keepalives for each data session. These keepalives serve the purpose of keeping NAT bindings alive for the data session. The keepalives SHOULD be sent using a format that is supported by its peer. ICE endpoints allow for STUN-based keepalives for UDP streams, and as such, STUN keepalives MUST be used when an ICE agent is a full ICE implementation and is communicating with a peer that supports ICE (lite or full).

所有端点必须为每个数据会话发送keepalives。这些keepalives用于保持数据会话的NAT绑定处于活动状态。keepalives应使用其对等方支持的格式发送。ICE端点允许对UDP流使用基于STUN的keepalives,因此,当ICE代理是完整ICE实现并且与支持ICE(lite或full)的对等方通信时,必须使用STUN keepalives。

An agent MUST send a keepalive on each candidate pair that is used for sending data if no packet has been sent on that pair in the last Tr seconds. Agents SHOULD use a Tr value of 15 seconds. Agents MAY use a bigger value but MUST NOT use a value smaller than 15 seconds.

如果在最后的Tr秒内没有在每个候选对上发送数据包,则代理必须在用于发送数据的候选对上发送keepalive。代理应使用15秒的Tr值。代理可以使用较大的值,但不得使用小于15秒的值。

Once selected pairs have been produced for a data stream, keepalives are only sent on those pairs.

一旦为数据流生成了选定的对,keepalives将仅在这些对上发送。

An agent MUST stop sending keepalives on a data stream if the data stream is removed. If the ICE session is terminated, an agent MUST stop sending keepalives on all data streams.

如果数据流被删除,代理必须停止发送数据流上的keepalives。如果ICE会话终止,代理必须停止在所有数据流上发送keepalives。

An agent MAY use another value for Tr, e.g., based on configuration or network/NAT characteristics. For example, if an agent has a dynamic way to discover the binding lifetimes of the intervening NATs, it can use that value to determine Tr. Administrators deploying ICE in more controlled networking environments SHOULD set Tr to the longest duration possible in their environment.

代理可以使用另一个Tr值,例如,基于配置或网络/NAT特征。例如,如果代理有一种动态方法来发现介入NAT的绑定生存期,它可以使用该值来确定Tr。在更受控的网络环境中部署ICE的管理员应将Tr设置为其环境中可能的最长持续时间。

When STUN is being used for keepalives, a STUN Binding Indication is used [RFC5389]. The Indication MUST NOT utilize any authentication mechanism. It SHOULD contain the FINGERPRINT attribute to aid in demultiplexing, but it SHOULD NOT contain any other attributes. It is used solely to keep the NAT bindings alive. The Binding Indication is sent using the same local and remote candidates that are being used for data. Though Binding Indications are used for keepalives, an agent MUST be prepared to receive a connectivity check as well. If a connectivity check is received, a response is generated as discussed in [RFC5389], but there is no impact on ICE processing otherwise.

当昏迷用于keepalives时,使用昏迷绑定指示[RFC5389]。指示不得使用任何认证机制。它应该包含指纹属性以帮助解复用,但不应该包含任何其他属性。它仅用于保持NAT绑定的活动状态。绑定指示使用用于数据的相同本地和远程候选者发送。尽管绑定指示用于keepalives,但代理也必须准备好接收连接检查。如果接收到连接检查,则会生成响应,如[RFC5389]中所述,但不会对ICE处理产生影响。

Agents MUST by default use STUN keepalives. Individual ICE usages and ICE extensions MAY specify usage-/extension-specific keepalives.

默认情况下,代理必须使用stunkeepalives。单独的ICE使用和ICE扩展可能指定使用/扩展特定的keepalives。

12. Data Handling
12. 数据处理
12.1. Sending Data
12.1. 发送数据

An ICE agent MAY send data on any valid pair before selected pairs have been produced for the data stream.

在为数据流生成所选对之前,ICE代理可以发送任何有效对上的数据。

Once selected pairs have been produced for a data stream, an agent MUST send data on those pairs only.

为数据流生成选定对后,代理必须仅发送这些对上的数据。

An agent sends data from the base of the local candidate to the remote candidate. In the case of a local relayed candidate, data is forwarded through the base (located in the TURN server), using the procedures defined in [RFC5766].

代理将数据从本地候选库发送到远程候选库。对于本地中继候选者,使用[RFC5766]中定义的程序,通过基站(位于TURN服务器中)转发数据。

If the local candidate is a relayed candidate, it is RECOMMENDED that an agent creates a channel on the TURN server towards the remote candidate. This is done using the procedures for channel creation as defined in Section 11 of [RFC5766].

如果本地候选者是中继候选者,建议代理在TURN服务器上创建一个指向远程候选者的通道。这是使用[RFC5766]第11节中定义的通道创建程序完成的。

The selected pair for a component of a data stream is:

数据流组件的选定对为:

o empty if the state of the checklist for that data stream is Running, and there is no previous selected pair for that component due to an ICE restart

o 如果该数据流的检查表的状态正在运行,并且由于ICE重启,该组件没有先前选择的对,则为空

o equal to the previous selected pair for a component of a data stream if the state of the checklist for that data stream is Running, and there was a previous selected pair for that component due to an ICE restart

o 如果数据流的检查表的状态正在运行,并且由于ICE重启,该组件存在先前选择的对,则等于该数据流组件的先前选择的对

Unless an agent is able to produce a selected pair for each component associated with a data stream, the agent MUST NOT continue sending data for any component associated with that data stream.

除非代理能够为与数据流关联的每个组件生成选定的对,否则代理不得继续发送与该数据流关联的任何组件的数据。

12.1.1. Procedures for Lite Implementations
12.1.1. Lite实现的过程

A lite implementation MUST NOT send data until it has a valid list that contains a candidate pair for each component of that data stream. Once that happens, the ICE agent MAY begin sending data packets. To do that, it sends data to the remote candidate in the pair (setting the destination address and port of the packet equal to that remote candidate) and will send it from the base associated with the candidate pair used for sending data. In case of a relayed candidate, data is sent from the agent and forwarded through the base (located in the TURN server), using the procedures defined in [RFC5766].

lite实现必须在具有包含该数据流的每个组件的候选对的有效列表之后才能发送数据。一旦发生这种情况,ICE代理可以开始发送数据包。为此,它向该对中的远程候选发送数据(将数据包的目的地地址和端口设置为等于该远程候选),并将从与用于发送数据的候选对相关联的基址发送数据。对于中继候选者,使用[RFC5766]中定义的程序,从代理发送数据并通过基站(位于TURN服务器中)转发。

12.2. Receiving Data
12.2. 接收数据

Even though ICE agents are only allowed to send data using valid candidate pairs (and, once selected pairs have been produced, only on the selected pairs), ICE implementations SHOULD by default be prepared to receive data on any of the candidates provided in the most recent candidate exchange with the peer. ICE usages MAY define rules that differ from this, e.g., by defining that data will not be sent until selected pairs have been produced for a data stream.

即使ICE代理仅允许使用有效的候选对发送数据(并且,一旦生成了选定对,则仅在选定对上),ICE实现在默认情况下应准备接收在与对等方的最新候选交换中提供的任何候选上的数据。ICE使用可能会定义与此不同的规则,例如,通过定义只有为数据流生成所选对后才会发送数据。

When an agent receives an RTP packet with a new source or destination IP address for a particular RTP/RTCP data stream, it is RECOMMENDED that the agent readjust its jitter buffers.

当代理接收到具有特定RTP/RTCP数据流的新源或目标IP地址的RTP数据包时,建议代理重新调整其抖动缓冲区。

Section 8.2 of RFC 3550 [RFC3550] describes an algorithm for detecting synchronization source (SSRC) collisions and loops. These algorithms are based, in part, on seeing different source transport addresses with the same SSRC. However, when ICE is used, such changes will sometimes occur as the data streams switch between candidates. An agent will be able to determine that a data stream is from the same peer as a consequence of the STUN exchange that proceeds media data transmission. Thus, if there is a change in the source transport address, but the media data packets come from the same peer agent, this MUST NOT be treated as an SSRC collision.

RFC 3550[RFC3550]第8.2节描述了检测同步源(SSRC)冲突和循环的算法。这些算法部分基于使用相同的SSRC查看不同的源传输地址。然而,当使用ICE时,当数据流在候选数据流之间切换时,有时会发生这种变化。作为进行媒体数据传输的STUN交换的结果,代理将能够确定数据流来自同一对等方。因此,如果源传输地址发生变化,但媒体数据包来自同一对等代理,则不得将其视为SSRC冲突。

13. Extensibility Considerations
13. 扩展性考虑

This specification makes very specific choices about how both ICE agents in a session coordinate to arrive at the set of candidate pairs that are selected for data. It is anticipated that future specifications will want to alter these algorithms, whether they are simple changes like timer tweaks or larger changes like a revamp of the priority algorithm. When such a change is made, providing interoperability between the two agents in a session is critical.

该规范对会话中的两个ICE代理如何协调以到达为数据选择的候选对集做出了非常具体的选择。预计未来的规范将希望改变这些算法,无论是简单的更改(如计时器调整)还是更大的更改(如优先级算法的改进)。进行此类更改时,在会话中提供两个代理之间的互操作性是至关重要的。

First, ICE provides the ICE option concept. Each extension or change to ICE is associated with an ICE option. When an agent supports such an extension or change, it provides the ICE option to the peer agent as part of the candidate exchange.

首先,ICE提供了ICE选项概念。ICE的每个扩展或更改都与ICE选项相关联。当代理支持这样的扩展或更改时,它会将ICE选项作为候选交换的一部分提供给对等代理。

One of the complications in achieving interoperability is that ICE relies on a distributed algorithm running on both agents to converge on an agreed set of candidate pairs. If the two agents run different algorithms, it can be difficult to guarantee convergence on the same candidate pairs. The nomination procedure described in Section 8 eliminates some of the need for tight coordination by delegating the selection algorithm completely to the controlling agent, and ICE will converge perfectly even when both agents use different pair prioritization algorithms. One of the keys to such convergence is triggered checks, which ensure that the nominated pair is validated by both agents.

实现互操作性的一个复杂因素是ICE依赖于在两个代理上运行的分布式算法来收敛于一组商定的候选对。如果两个代理运行不同的算法,则很难保证在相同的候选对上收敛。第8节中描述的提名程序通过将选择算法完全委托给控制代理,消除了一些紧密协调的需要,并且即使两个代理使用不同的对优先级算法,ICE也会完美收敛。这种收敛的关键之一是触发检查,它确保指定对由两个代理验证。

ICE is also extensible to other data streams beyond RTP and for transport protocols beyond UDP. Extensions to ICE for non-RTP data streams need to specify how many components they utilize and assign component IDs to them, starting at 1 for the most important component ID. Specifications for new transport protocols MUST define how, if at all, various steps in the ICE processing differ from UDP.

ICE还可以扩展到RTP之外的其他数据流,以及UDP之外的传输协议。非RTP数据流的ICE扩展需要指定它们使用的组件数量并为其分配组件ID,最重要的组件ID从1开始。新传输协议的规范必须定义ICE处理中的各个步骤与UDP的区别(如果有的话)。

14. Setting Ta and RTO
14. 设置Ta和RTO
14.1. General
14.1. 全体的

During the ICE gathering phase (Section 5.1.1) and while ICE is performing connectivity checks (Section 7), an ICE agent triggers STUN and TURN transactions. These transactions are paced at a rate indicated by Ta, and the retransmission interval for each transaction is calculated based on the retransmission timer for the STUN transactions (RTO) [RFC5389].

在ICE收集阶段(第5.1.1节)和ICE执行连通性检查(第7节)期间,ICE代理触发眩晕和转身交易。以Ta指示的速率对这些事务进行配速,并根据STUN事务(RTO)的重传计时器计算每个事务的重传间隔[RFC5389]。

This section describes how the Ta and RTO values are computed during the ICE gathering phase and while ICE is performing connectivity checks.

本节描述了在ICE收集阶段以及ICE执行连接检查时如何计算Ta和RTO值。

NOTE: Previously, in RFC 5245, different formulas were defined for computing Ta and RTO, depending on whether or not ICE was used for a real-time data stream (e.g., RTP).

注:之前,在RFC 5245中,根据实时数据流(如RTP)是否使用ICE,定义了不同的计算Ta和RTO的公式。

The formulas below result in a behavior whereby an agent will send its first packet for every single connectivity check before performing a retransmit. This can be seen in the formulas for the RTO (which represents the retransmit interval). Those formulas scale with N, the number of checks to be performed. As a result of this, ICE maintains a nicely constant rate, but it becomes more sensitive to packet loss. The loss of the first single packet for any connectivity check is likely to cause that pair to take a long time to be validated, and instead, a lower-priority check (but one for which there was no packet loss) is much more likely to complete first. This results in ICE performing suboptimally, choosing lower-priority pairs over higher-priority pairs.

下面的公式会导致这样一种行为,即代理在执行重新传输之前,会为每一次连接检查发送其第一个数据包。这可以在RTO(代表重传间隔)的公式中看到。这些公式以N(要执行的检查的数量)进行缩放。因此,ICE保持了很好的恒定速率,但它对数据包丢失更加敏感。任何连接检查中第一个数据包的丢失都可能导致该对需要很长时间进行验证,相反,较低优先级的检查(但没有数据包丢失的检查)更有可能首先完成。这导致ICE的性能次优,选择低优先级对而不是高优先级对。

14.2. Ta
14.2. 助教

ICE agents SHOULD use a default Ta value, 50 ms, but MAY use another value based on the characteristics of the associated data.

ICE代理应使用默认Ta值50 ms,但可根据相关数据的特征使用另一个值。

If an agent wants to use a Ta value other than the default value, the agent MUST indicate the proposed value to its peer during the establishment of the ICE session. Both agents MUST use the higher value of the proposed values. If an agent does not propose a value, the default value is used for that agent when comparing which value is higher.

如果代理希望使用默认值以外的Ta值,则代理必须在ICE会话建立期间向其对等方指示建议的值。两个代理都必须使用建议值中的较高值。如果代理未提出值,则在比较哪个值较高时,将使用该代理的默认值。

Regardless of the Ta value chosen for each agent, the combination of all transactions from all agents (if a given implementation runs several concurrent agents) MUST NOT be sent more often than once

无论为每个代理选择的Ta值如何,来自所有代理的所有事务的组合(如果给定的实现运行多个并发代理)都不能发送多次

every 5 ms (as though there were one global Ta value for pacing all agents). See Appendix B.1 for the background of using a value of 5 ms with ICE.

每5ms一次(好像所有代理的起搏都有一个全局Ta值)。有关在ICE中使用5ms值的背景信息,请参见附录B.1。

NOTE: Appendix C shows examples of required bandwidth, using different Ta values.

注:附录C显示了使用不同Ta值所需带宽的示例。

14.3. RTO
14.3. RTO

During the ICE gathering phase, ICE agents SHOULD calculate the RTO value using the following formula:

在集冰阶段,冰剂应使用以下公式计算RTO值:

RTO = MAX (500ms, Ta * (Num-Of-Cands))

RTO=最大值(500毫秒,Ta*(烛光数))

Num-Of-Cands: the number of server-reflexive and relay candidates

Num Of Cands:服务器自反候选和中继候选的数量

For connectivity checks, agents SHOULD calculate the RTO value using the following formula:

对于连接性检查,代理应使用以下公式计算RTO值:

     RTO = MAX (500ms, Ta * N * (Num-Waiting + Num-In-Progress))
        
     RTO = MAX (500ms, Ta * N * (Num-Waiting + Num-In-Progress))
        

N: the total number of connectivity checks to be performed.

N:要执行的连接检查的总数。

Num-Waiting: the number of checks in the checklist set in the Waiting state.

Num Waiting:检查表中设置为等待状态的检查数。

Num-In-Progress: the number of checks in the checklist set in the In-Progress state.

Num In Progress:检查表中设置为“进行中”状态的检查数。

Note that the RTO will be different for each transaction as the number of checks in the Waiting and In-Progress states change.

请注意,随着等待状态和进行中状态中的检查数量的变化,每个事务的RTO将不同。

Agents MAY calculate the RTO value using other mechanisms than those described above. Agents MUST NOT use an RTO value smaller than 500 ms.

代理可以使用除上述机制之外的其他机制来计算RTO值。代理不得使用小于500 ms的RTO值。

15. Examples
15. 例子

This section shows two ICE examples: one using IPv4 addresses and one using IPv6 addresses.

本节显示了两个ICE示例:一个使用IPv4地址,另一个使用IPv6地址。

To facilitate understanding, transport addresses are listed using variables that have mnemonic names. The format of the name is entity-type-seqno: "entity" refers to the entity whose IP address the transport address is on and is one of "L", "R", "STUN", or "NAT". The type is either "PUB" for transport addresses that are public or "PRIV" for transport addresses that are private [RFC1918]. Finally,

为了便于理解,使用具有助记名称的变量列出传输地址。名称的格式为实体类型seqno:“实体”指传输地址所在IP地址为“L”、“R”、“STUN”或“NAT”之一的实体。对于公共的传输地址,类型为“PUB”,对于私有的传输地址,类型为“PRIV”[RFC1918]。最后

seq-no is a sequence number that is different for each transport address of the same type on a particular entity. Each variable has an IP address and port, denoted by varname.IP and varname.PORT, respectively, where varname is the name of the variable.

seq no是一个序列号,对于特定实体上相同类型的每个传输地址,序列号是不同的。每个变量都有一个IP地址和端口,分别由varname.IP和varname.port表示,其中varname是变量的名称。

In the call flow itself, STUN messages are annotated with several attributes. The "S=" attribute indicates the source transport address of the message. The "D=" attribute indicates the destination transport address of the message. The "MA=" attribute is used in STUN Binding response messages and refers to the mapped address. "USE-CAND" implies the presence of the USE-CANDIDATE attribute.

在调用流本身中,STUN消息用几个属性进行注释。“S=”属性表示消息的源传输地址。“D=”属性表示消息的目标传输地址。“MA=”属性用于STUN绑定响应消息,并引用映射的地址。“USE-CAND”表示存在USE-CANDIDATE属性。

The call flow examples omit STUN authentication operations and focus on a single data stream between two full implementations.

调用流示例省略了STUN身份验证操作,并将重点放在两个完整实现之间的单个数据流上。

15.1. Example with IPv4 Addresses
15.1. IPv4地址示例

The example below is using the topology shown in Figure 7.

下面的示例使用图7所示的拓扑。

                                  +-------+
                                  |STUN   |
                                  |Server |
                                  +-------+
                                      |
                           +---------------------+
                           |                     |
                           |      Internet       |
                           |                     |
                           +---------------------+
                             |                |
                             |                |
                      +---------+             |
                      |   NAT   |             |
                      +---------+             |
                           |                  |
                           |                  |
                        +-----+            +-----+
                        |  L  |            |  R  |
                        +-----+            +-----+
        
                                  +-------+
                                  |STUN   |
                                  |Server |
                                  +-------+
                                      |
                           +---------------------+
                           |                     |
                           |      Internet       |
                           |                     |
                           +---------------------+
                             |                |
                             |                |
                      +---------+             |
                      |   NAT   |             |
                      +---------+             |
                           |                  |
                           |                  |
                        +-----+            +-----+
                        |  L  |            |  R  |
                        +-----+            +-----+
        

Figure 7: Example Topology

图7:示例拓扑

In the example, ICE agents L and R are full ICE implementations. Both agents have a single IPv4 address, and both are configured with the same STUN server. The NAT has an endpoint-independent mapping property and an address-dependent filtering property. The IP addresses of the ICE agents, the STUN server, and the NAT are shown below:

在本例中,ICE代理L和R是完整的ICE实现。两个代理都有一个IPv4地址,并且都配置了相同的STUN服务器。NAT具有与端点无关的映射属性和与地址相关的筛选属性。ICE代理、STUN服务器和NAT的IP地址如下所示:

   ENTITY                   IP Address  Mnemonic name
   --------------------------------------------------
   ICE Agent L:             10.0.1.1    L-PRIV-1
   ICE Agent R:             192.0.2.1   R-PUB-1
   STUN Server:             192.0.2.2   STUN-PUB-1
   NAT (Public):            192.0.2.3   NAT-PUB-1
        
   ENTITY                   IP Address  Mnemonic name
   --------------------------------------------------
   ICE Agent L:             10.0.1.1    L-PRIV-1
   ICE Agent R:             192.0.2.1   R-PUB-1
   STUN Server:             192.0.2.2   STUN-PUB-1
   NAT (Public):            192.0.2.3   NAT-PUB-1
        
             L             NAT           STUN             R
             |STUN alloc.   |              |              |
             |(1) STUN Req  |              |              |
             |S=$L-PRIV-1   |              |              |
             |D=$STUN-PUB-1 |              |              |
             |------------->|              |              |
             |              |(2) STUN Req  |              |
             |              |S=$NAT-PUB-1  |              |
             |              |D=$STUN-PUB-1 |              |
             |              |------------->|              |
             |              |(3) STUN Res  |              |
             |              |S=$STUN-PUB-1 |              |
             |              |D=$NAT-PUB-1  |              |
             |              |MA=$NAT-PUB-1 |              |
             |              |<-------------|              |
             |(4) STUN Res  |              |              |
             |S=$STUN-PUB-1 |              |              |
             |D=$L-PRIV-1   |              |              |
             |MA=$NAT-PUB-1 |              |              |
             |<-------------|              |              |
             |(5) L's Candidate Information|              |
             |------------------------------------------->|
             |              |              |              | STUN
             |              |              |              | alloc.
             |              |              |(6) STUN Req  |
             |              |              |S=$R-PUB-1    |
             |              |              |D=$STUN-PUB-1 |
             |              |              |<-------------|
             |              |              |(7) STUN Res  |
             |              |              |S=$STUN-PUB-1 |
             |              |              |D=$R-PUB-1    |
             |              |              |MA=$R-PUB-1   |
             |              |              |------------->|
        
             L             NAT           STUN             R
             |STUN alloc.   |              |              |
             |(1) STUN Req  |              |              |
             |S=$L-PRIV-1   |              |              |
             |D=$STUN-PUB-1 |              |              |
             |------------->|              |              |
             |              |(2) STUN Req  |              |
             |              |S=$NAT-PUB-1  |              |
             |              |D=$STUN-PUB-1 |              |
             |              |------------->|              |
             |              |(3) STUN Res  |              |
             |              |S=$STUN-PUB-1 |              |
             |              |D=$NAT-PUB-1  |              |
             |              |MA=$NAT-PUB-1 |              |
             |              |<-------------|              |
             |(4) STUN Res  |              |              |
             |S=$STUN-PUB-1 |              |              |
             |D=$L-PRIV-1   |              |              |
             |MA=$NAT-PUB-1 |              |              |
             |<-------------|              |              |
             |(5) L's Candidate Information|              |
             |------------------------------------------->|
             |              |              |              | STUN
             |              |              |              | alloc.
             |              |              |(6) STUN Req  |
             |              |              |S=$R-PUB-1    |
             |              |              |D=$STUN-PUB-1 |
             |              |              |<-------------|
             |              |              |(7) STUN Res  |
             |              |              |S=$STUN-PUB-1 |
             |              |              |D=$R-PUB-1    |
             |              |              |MA=$R-PUB-1   |
             |              |              |------------->|
        
             |(8) R's Candidate Information|              |
             |<-------------------------------------------|
             |              |         (9) Bind Req        |Begin
             |              |         S=$R-PUB-1          |Connectivity
             |              |         D=$L-PRIV-1         |Checks
             |              |         <-------------------|
             |              |         Dropped             |
             |(10) Bind Req |              |              |
             |S=$L-PRIV-1   |              |              |
             |D=$R-PUB-1    |              |              |
             |------------->|              |              |
             |              |(11) Bind Req |              |
             |              |S=$NAT-PUB-1  |              |
             |              |D=$R-PUB-1    |              |
             |              |---------------------------->|
             |              |(12) Bind Res |              |
             |              |S=$R-PUB-1    |              |
             |              |D=$NAT-PUB-1  |              |
             |              |MA=$NAT-PUB-1 |              |
             |              |<----------------------------|
             |(13) Bind Res |              |              |
             |S=$R-PUB-1    |              |              |
             |D=$L-PRIV-1   |              |              |
             |MA=$NAT-PUB-1 |              |              |
             |<-------------|              |              |
             |Data          |              |              |
             |===========================================>|
             |              |              |              |
             |              |(14) Bind Req |              |
             |              |S=$R-PUB-1    |              |
             |              |D=$NAT-PUB-1  |              |
             |              |<----------------------------|
             |(15) Bind Req |              |              |
             |S=$R-PUB-1    |              |              |
             |D=$L-PRIV-1   |              |              |
             |<-------------|              |              |
             |(16) Bind Res |              |              |
             |S=$L-PRIV-1   |              |              |
             |D=$R-PUB-1    |              |              |
             |MA=$R-PUB-1   |              |              |
             |------------->|              |              |
             |              |(17) Bind Res |              |
             |              |S=$NAT-PUB-1  |              |
             |              |D=$R-PUB-1    |              |
             |              |MA=$R-PUB-1   |              |
             |              |---------------------------->|
             |Data          |              |              |
             |<===========================================|
        
             |(8) R's Candidate Information|              |
             |<-------------------------------------------|
             |              |         (9) Bind Req        |Begin
             |              |         S=$R-PUB-1          |Connectivity
             |              |         D=$L-PRIV-1         |Checks
             |              |         <-------------------|
             |              |         Dropped             |
             |(10) Bind Req |              |              |
             |S=$L-PRIV-1   |              |              |
             |D=$R-PUB-1    |              |              |
             |------------->|              |              |
             |              |(11) Bind Req |              |
             |              |S=$NAT-PUB-1  |              |
             |              |D=$R-PUB-1    |              |
             |              |---------------------------->|
             |              |(12) Bind Res |              |
             |              |S=$R-PUB-1    |              |
             |              |D=$NAT-PUB-1  |              |
             |              |MA=$NAT-PUB-1 |              |
             |              |<----------------------------|
             |(13) Bind Res |              |              |
             |S=$R-PUB-1    |              |              |
             |D=$L-PRIV-1   |              |              |
             |MA=$NAT-PUB-1 |              |              |
             |<-------------|              |              |
             |Data          |              |              |
             |===========================================>|
             |              |              |              |
             |              |(14) Bind Req |              |
             |              |S=$R-PUB-1    |              |
             |              |D=$NAT-PUB-1  |              |
             |              |<----------------------------|
             |(15) Bind Req |              |              |
             |S=$R-PUB-1    |              |              |
             |D=$L-PRIV-1   |              |              |
             |<-------------|              |              |
             |(16) Bind Res |              |              |
             |S=$L-PRIV-1   |              |              |
             |D=$R-PUB-1    |              |              |
             |MA=$R-PUB-1   |              |              |
             |------------->|              |              |
             |              |(17) Bind Res |              |
             |              |S=$NAT-PUB-1  |              |
             |              |D=$R-PUB-1    |              |
             |              |MA=$R-PUB-1   |              |
             |              |---------------------------->|
             |Data          |              |              |
             |<===========================================|
        
             |              |              |              |
                                .......
             |              |              |              |
             |(18) Bind Req |              |              |
             |S=$L-PRIV-1   |              |              |
             |D=$R-PUB-1    |              |              |
             |USE-CAND      |              |              |
             |------------->|              |              |
             |              |(19) Bind Req |              |
             |              |S=$NAT-PUB-1  |              |
             |              |D=$R-PUB-1    |              |
             |              |USE-CAND      |              |
             |              |---------------------------->|
             |              |(20) Bind Res |              |
             |              |S=$R-PUB-1    |              |
             |              |D=$NAT-PUB-1  |              |
             |              |MA=$NAT-PUB-1 |              |
             |              |<----------------------------|
             |(21) Bind Res |              |              |
             |S=$R-PUB-1    |              |              |
             |D=$L-PRIV-1   |              |              |
             |MA=$NAT-PUB-1 |              |              |
             |<-------------|              |              |
             |              |              |              |
        
             |              |              |              |
                                .......
             |              |              |              |
             |(18) Bind Req |              |              |
             |S=$L-PRIV-1   |              |              |
             |D=$R-PUB-1    |              |              |
             |USE-CAND      |              |              |
             |------------->|              |              |
             |              |(19) Bind Req |              |
             |              |S=$NAT-PUB-1  |              |
             |              |D=$R-PUB-1    |              |
             |              |USE-CAND      |              |
             |              |---------------------------->|
             |              |(20) Bind Res |              |
             |              |S=$R-PUB-1    |              |
             |              |D=$NAT-PUB-1  |              |
             |              |MA=$NAT-PUB-1 |              |
             |              |<----------------------------|
             |(21) Bind Res |              |              |
             |S=$R-PUB-1    |              |              |
             |D=$L-PRIV-1   |              |              |
             |MA=$NAT-PUB-1 |              |              |
             |<-------------|              |              |
             |              |              |              |
        

Figure 8: Example Flow

图8:示例流

Messages 1-4: Agent L gathers a host candidate from its local IP address, and from that it sends a STUN Binding request to the STUN server. The request creates a NAT binding. The NAT public IP address of the binding becomes agent L's server-reflexive candidate.

消息1-4:代理L从其本地IP地址收集主机候选,并从该地址向STUN服务器发送STUN绑定请求。该请求创建一个NAT绑定。绑定的NAT公共IP地址成为代理L的服务器自反候选地址。

Message 5: Agent L sends its local candidate information to agent R, using the signaling protocol associated with the ICE usage.

消息5:代理L使用与ICE使用相关联的信令协议将其本地候选信息发送给代理R。

Messages 6-7: Agent R gathers a host candidate from its local IP address, and from that it sends a STUN Binding request to the STUN server. Since agent R is not behind a NAT, R's server-reflexive candidate will be identical to the host candidate.

消息6-7:代理R从其本地IP地址收集主机候选,并由此向STUN服务器发送STUN绑定请求。因为代理R不在NAT后面,所以R的服务器自反候选者将与主机候选者相同。

Message 8: Agent R sends its local candidate information to agent L, using the signaling protocol associated with the ICE usage.

消息8:代理R使用与ICE使用相关联的信令协议将其本地候选信息发送给代理L。

Since both agents are full ICE implementations, the initiating agent (agent L) becomes the controlling agent.

因为两个代理都是完整的ICE实现,所以发起代理(代理L)成为控制代理。

Agents L and R both pair up the candidates. Both agents initially have two pairs. However, agent L will prune the pair containing its server-reflexive candidate, resulting in just one (L1). At agent L, this pair has a local candidate of $L_PRIV_1 and a remote candidate of $R_PUB_1. At agent R, there are two pairs. The highest-priority pair (R1) has a local candidate of $R_PUB_1 and a remote candidate of $L_PRIV_1, and the second pair (R2) has a local candidate of $R_PUB_1 and a remote candidate of $NAT_PUB_1. The pairs are shown below (the pair numbers are for reference purposes only):

L探员和R探员都把候选人配对。两个代理最初都有两对。然而,代理L将删减包含其服务器自反候选项的对,只产生一个(L1)。在代理L中,这一对有一个本地候选人$L_PRIV_1和一个远程候选人$R_PUB_1。在代理R,有两对。最高优先级对(R1)具有$R_PUB_1的本地候选和$L_PRIV_1的远程候选,第二对(R2)具有$R_PUB_1的本地候选和$NAT_PUB_1的远程候选。对如下所示(对编号仅供参考):

                            Pairs
   ENTITY                   Local         Remote     Pair #     Valid
   ------------------------------------------------------------------
   ICE Agent L:             L_PRIV_1      R_PUB_1       L1
        
                            Pairs
   ENTITY                   Local         Remote     Pair #     Valid
   ------------------------------------------------------------------
   ICE Agent L:             L_PRIV_1      R_PUB_1       L1
        

ICE Agent R: R_PUB_1 L_PRIV_1 R1 R_PUB_1 NAT_PUB_1 R2

ICE代理R:R_PUB_1 L_PRIV_1 R1 R_PUB_1 NAT_PUB_1 R2

Message 9: Agent R initiates a connectivity check for pair #2. As the remote candidate of the pair is the private address of agent L, the check will not be successful, as the request cannot be routed from R to L, and will be dropped by the network.

消息9:代理R启动对2的连接检查。由于该对的远程候选者是代理L的专用地址,检查将不会成功,因为请求无法从R路由到L,并且将被网络丢弃。

Messages 10-13: Agent L initiates a connectivity check for pair L1. The check succeeds, and L creates a new pair (L2). The local candidate of the new pair is $NAT_PUB_1, and the remote candidate is $R_PUB_1. The pair (L2) is added to the valid list of agent L. Agent L can now send and receive data on the pair (L2) if it wishes.

消息10-13:代理L启动对L1的连接检查。检查成功,L创建一个新对(L2)。新配对的本地候选项为$NAT_PUB_1,远程候选项为$R_PUB_1。该对(L2)被添加到代理L的有效列表中。如果代理L愿意,现在可以发送和接收该对(L2)上的数据。

                            Pairs
   ENTITY                   Local         Remote     Pair #     Valid
   ------------------------------------------------------------------
   ICE Agent L:             L_PRIV_1      R_PUB_1       L1
                            NAT_PUB_1     R_PUB_1       L2        X
        
                            Pairs
   ENTITY                   Local         Remote     Pair #     Valid
   ------------------------------------------------------------------
   ICE Agent L:             L_PRIV_1      R_PUB_1       L1
                            NAT_PUB_1     R_PUB_1       L2        X
        

ICE Agent R: R_PUB_1 L_PRIV_1 R1 R_PUB_1 NAT_PUB_1 R2

ICE代理R:R_PUB_1 L_PRIV_1 R1 R_PUB_1 NAT_PUB_1 R2

Messages 14-17: When agent R receives the Binding request from agent L (message 11), it will initiate a triggered connectivity check. The pair matches one of agent R's existing pairs (R2). The check succeeds, and the pair (R2) is added to the valid list of agent R. Agent R can now send and receive data on the pair (R2) if it wishes.

消息14-17:当代理R收到来自代理L的绑定请求(消息11)时,它将启动触发的连接检查。该对与代理R的一个现有对(R2)匹配。检查成功,该对(R2)被添加到代理R的有效列表中。如果愿意,代理R现在可以发送和接收该对(R2)上的数据。

                            Pairs
   ENTITY                   Local         Remote     Pair #     Valid
   ------------------------------------------------------------------
   ICE Agent L:             L_PRIV_1      R_PUB_1       L1
                            NAT_PUB_1     R_PUB_1       L2        X
        
                            Pairs
   ENTITY                   Local         Remote     Pair #     Valid
   ------------------------------------------------------------------
   ICE Agent L:             L_PRIV_1      R_PUB_1       L1
                            NAT_PUB_1     R_PUB_1       L2        X
        

ICE Agent R: R_PUB_1 L_PRIV_1 R1 R_PUB_1 NAT_PUB_1 R2 X

ICE代理R:R_PUB_1 L_PRIV_1 R1 R_PUB_1 NAT_PUB_1 R2 X

Messages 18-21: At some point, the controlling agent (agent L) decides to nominate a pair (L2) in the valid list. It performs a connectivity check on the pair (L2) and includes the USE-CANDIDATE attribute in the Binding request. As the check succeeds, agent L sets the nominated flag value of the pair (L2) to 'true', and agent R sets the nominated flag value of the matching pair (R2) to 'true'. As there are no more components associated with the stream, the nominated pairs become the selected pairs. Consequently, processing for this stream moves into the Completed state. The ICE process also moves into the Completed state.

消息18-21:在某个时刻,控制代理(代理L)决定在有效列表中指定一对(L2)。它对该对(L2)执行连接检查,并在绑定请求中包含USE-CANDIDATE属性。当检查成功时,代理L将配对(L2)的指定标志值设置为“真”,代理R将匹配配对(R2)的指定标志值设置为“真”。由于不再有与流关联的组件,指定的对将成为选定的对。因此,该流的处理进入完成状态。ICE过程也会进入完成状态。

15.2. Example with IPv6 Addresses
15.2. IPv6地址示例

The example below is using the topology shown in Figure 9.

下面的示例使用图9所示的拓扑。

                                +-------+
                                |STUN   |
                                |Server |
                                +-------+
                                    |
                         +---------------------+
                         |                     |
                         |      Internet       |
                         |                     |
                         +---------------------+
                            |                |
                            |                |
                            |                |
                            |                |
                            |                |
                            |                |
                            |                |
                         +-----+          +-----+
                         |  L  |          |  R  |
                         +-----+          +-----+
        
                                +-------+
                                |STUN   |
                                |Server |
                                +-------+
                                    |
                         +---------------------+
                         |                     |
                         |      Internet       |
                         |                     |
                         +---------------------+
                            |                |
                            |                |
                            |                |
                            |                |
                            |                |
                            |                |
                            |                |
                         +-----+          +-----+
                         |  L  |          |  R  |
                         +-----+          +-----+
        

Figure 9: Example Topology

图9:示例拓扑

In the example, ICE agents L and R are full ICE implementations. Both agents have a single IPv6 address, and both are configured with the same STUN server. The IP addresses of the ICE agents and the STUN server are shown below:

在本例中,ICE代理L和R是完整的ICE实现。两个代理都有一个IPv6地址,并且都配置了相同的STUN服务器。ICE代理和STUN服务器的IP地址如下所示:

   ENTITY                   IP Address  mnemonic name
   --------------------------------------------------
   ICE Agent L:             2001:db8::3   L-PUB-1
   ICE Agent R:             2001:db8::5   R-PUB-1
   STUN Server:             2001:db8::9   STUN-PUB-1
        
   ENTITY                   IP Address  mnemonic name
   --------------------------------------------------
   ICE Agent L:             2001:db8::3   L-PUB-1
   ICE Agent R:             2001:db8::5   R-PUB-1
   STUN Server:             2001:db8::9   STUN-PUB-1
        
             L                           STUN             R
             |STUN alloc.                  |              |
             |(1) STUN Req                 |              |
             |S=$L-PUB-1                   |              |
             |D=$STUN-PUB-1                |              |
             |---------------------------->|              |
             |(2) STUN Res                 |              |
             | S=$STUN-PUB-1               |              |
             | D=$L-PUB-1                  |              |
             | MA=$L-PUB-1                 |              |
             |<----------------------------|              |
             |(3) L's Candidate Information|              |
             |------------------------------------------->|
             |                             |              | STUN
             |                             |              | alloc.
             |                             |(4) STUN Req  |
             |                             |S=$R-PUB-1    |
             |                             |D=$STUN-PUB-1 |
             |                             |<-------------|
             |                             |(5) STUN Res  |
             |                             |S=$STUN-PUB-1 |
             |                             |D=$R-PUB-1    |
             |                             |MA=$R-PUB-1   |
             |                             |------------->|
             |(6) R's Candidate Information|              |
             |<-------------------------------------------|
             |(7) Bind Req                 |              |
             |S=$L-PUB-1                   |              |
             |D=$R-PUB-1                   |              |
             |------------------------------------------->|
             |(8) Bind Res                 |              |
             |S=$R-PUB-1                   |              |
             |D=$L-PUB-1                   |              |
             |MA=$L-PUB-1                  |              |
             |<-------------------------------------------|
        
             L                           STUN             R
             |STUN alloc.                  |              |
             |(1) STUN Req                 |              |
             |S=$L-PUB-1                   |              |
             |D=$STUN-PUB-1                |              |
             |---------------------------->|              |
             |(2) STUN Res                 |              |
             | S=$STUN-PUB-1               |              |
             | D=$L-PUB-1                  |              |
             | MA=$L-PUB-1                 |              |
             |<----------------------------|              |
             |(3) L's Candidate Information|              |
             |------------------------------------------->|
             |                             |              | STUN
             |                             |              | alloc.
             |                             |(4) STUN Req  |
             |                             |S=$R-PUB-1    |
             |                             |D=$STUN-PUB-1 |
             |                             |<-------------|
             |                             |(5) STUN Res  |
             |                             |S=$STUN-PUB-1 |
             |                             |D=$R-PUB-1    |
             |                             |MA=$R-PUB-1   |
             |                             |------------->|
             |(6) R's Candidate Information|              |
             |<-------------------------------------------|
             |(7) Bind Req                 |              |
             |S=$L-PUB-1                   |              |
             |D=$R-PUB-1                   |              |
             |------------------------------------------->|
             |(8) Bind Res                 |              |
             |S=$R-PUB-1                   |              |
             |D=$L-PUB-1                   |              |
             |MA=$L-PUB-1                  |              |
             |<-------------------------------------------|
        
             |Data                         |              |
             |===========================================>|
             |                             |              |
             |(9) Bind Req                 |              |
             |S=$R-PUB-1                   |              |
             |D=$L-PUB-1                   |              |
             |<-------------------------------------------|
             |(10) Bind Res                |              |
             |S=$L-PUB-1                   |              |
             |D=$R-PUB-1                   |              |
             |MA=$R-PUB-1                  |              |
             |------------------------------------------->|
             |Data                         |              |
             |<===========================================|
             |                             |              |
                                .......
             |                             |              |
             |(11) Bind Req                |              |
             |S=$L-PUB-1                   |              |
             |D=$R-PUB-1                   |              |
             |USE-CAND                     |              |
             |------------------------------------------->|
             |(12) Bind Res                |              |
             |S=$R-PUB-1                   |              |
             |D=$L-PUB-1                   |              |
             |MA=$L-PUB-1                  |              |
             |<-------------------------------------------|
             |              |              |              |
        
             |Data                         |              |
             |===========================================>|
             |                             |              |
             |(9) Bind Req                 |              |
             |S=$R-PUB-1                   |              |
             |D=$L-PUB-1                   |              |
             |<-------------------------------------------|
             |(10) Bind Res                |              |
             |S=$L-PUB-1                   |              |
             |D=$R-PUB-1                   |              |
             |MA=$R-PUB-1                  |              |
             |------------------------------------------->|
             |Data                         |              |
             |<===========================================|
             |                             |              |
                                .......
             |                             |              |
             |(11) Bind Req                |              |
             |S=$L-PUB-1                   |              |
             |D=$R-PUB-1                   |              |
             |USE-CAND                     |              |
             |------------------------------------------->|
             |(12) Bind Res                |              |
             |S=$R-PUB-1                   |              |
             |D=$L-PUB-1                   |              |
             |MA=$L-PUB-1                  |              |
             |<-------------------------------------------|
             |              |              |              |
        

Figure 10: Example Flow

图10:示例流

Messages 1-2: Agent L gathers a host candidate from its local IP address, and from that it sends a STUN Binding request to the STUN server. Since agent L is not behind a NAT, L's server-reflexive candidate will be identical to the host candidate.

消息1-2:代理L从其本地IP地址收集主机候选,并从该地址向STUN服务器发送STUN绑定请求。因为代理L不在NAT后面,所以L的服务器自反候选者将与主机候选者相同。

Message 3: Agent L sends its local candidate information to agent R, using the signaling protocol associated with the ICE usage.

消息3:代理L使用与ICE使用相关联的信令协议将其本地候选信息发送给代理R。

Messages 4-5: Agent R gathers a host candidate from its local IP address, and from that it sends a STUN Binding request to the STUN server. Since agent R is not behind a NAT, R's server-reflexive candidate will be identical to the host candidate.

消息4-5:代理R从其本地IP地址收集主机候选,并由此向STUN服务器发送STUN绑定请求。因为代理R不在NAT后面,所以R的服务器自反候选者将与主机候选者相同。

Message 6: Agent R sends its local candidate information to agent L, using the signaling protocol associated with the ICE usage.

消息6:代理R使用与ICE使用相关联的信令协议将其本地候选信息发送给代理L。

Since both agents are full ICE implementations, the initiating agent (agent L) becomes the controlling agent.

因为两个代理都是完整的ICE实现,所以发起代理(代理L)成为控制代理。

Agents L and R both pair up the candidates. Both agents initially have one pair each. At agent L, the pair (L1) has a local candidate of $L_PUB_1 and a remote candidate of $R_PUB_1. At agent R, the pair (R1) has a local candidate of $R_PUB_1 and a remote candidate of $L_PUB_1. The pairs are shown below (the pair numbers are for reference purpose only):

L探员和R探员都把候选人配对。两个代理最初各有一对。在代理L处,该对(L1)具有$L_PUB_1的本地候选和$R_PUB_1的远程候选。在代理R处,该对(R1)具有$R_PUB_1的本地候选和$L_PUB_1的远程候选。各线对如下所示(线对编号仅供参考):

                            Pairs
   ENTITY                   Local         Remote     Pair #     Valid
   ------------------------------------------------------------------
   ICE Agent L:             L_PUB_1       R_PUB_1       L1
        
                            Pairs
   ENTITY                   Local         Remote     Pair #     Valid
   ------------------------------------------------------------------
   ICE Agent L:             L_PUB_1       R_PUB_1       L1
        

ICE Agent R: R_PUB_1 L_PUB_1 R1

冰剂R:R_PUB_1 L_PUB_1 R1

Messages 7-8: Agent L initiates a connectivity check for pair L1. The check succeeds, and the pair (L1) is added to the valid list of agent L. Agent L can now send and receive data on the pair (L1) if it wishes.

消息7-8:代理L启动对L1的连接检查。检查成功,该对(L1)被添加到代理L的有效列表中。如果代理L愿意,现在可以发送和接收该对(L1)上的数据。

                            Pairs
   ENTITY                   Local         Remote     Pair #     Valid
   ------------------------------------------------------------------
   ICE Agent L:             L_PUB_1       R_PUB_1       L1         X
        
                            Pairs
   ENTITY                   Local         Remote     Pair #     Valid
   ------------------------------------------------------------------
   ICE Agent L:             L_PUB_1       R_PUB_1       L1         X
        

ICE Agent R: R_PUB_1 L_PUB_1 R1

冰剂R:R_PUB_1 L_PUB_1 R1

Messages 9-10: When agent R receives the Binding request from agent L (message 7), it will initiate a triggered connectivity check. The pair matches agent R's existing pair (R1). The check succeeds, and the pair (R1) is added to the valid list of agent R. Agent R can now send and receive data on the pair (R1) if it wishes.

消息9-10:当代理R收到来自代理L的绑定请求(消息7)时,它将启动触发的连接检查。该对与代理R的现有对(R1)匹配。检查成功,该对(R1)被添加到代理R的有效列表中。如果代理R愿意,现在可以发送和接收该对(R1)上的数据。

                            Pairs
   ENTITY                   Local         Remote     Pair #     Valid
   ------------------------------------------------------------------
   ICE Agent L:             L_PUB_1       R_PUB_1       L1         X
        
                            Pairs
   ENTITY                   Local         Remote     Pair #     Valid
   ------------------------------------------------------------------
   ICE Agent L:             L_PUB_1       R_PUB_1       L1         X
        

ICE Agent R: R_PUB_1 L_PUB_1 R1 X

冰剂R:R_PUB_1 L_PUB_1 R1 X

Messages 11-12: At some point, the controlling agent (agent L) decides to nominate a pair (L1) in the valid list. It performs a connectivity check on the pair (L1) and includes the USE-CANDIDATE attribute in the Binding request. As the check succeeds, agent L sets the nominated flag value of the pair (L1) to 'true', and agent R sets the nominated flag value of the matching pair (R1) to 'true'.

消息11-12:在某个时刻,控制代理(代理L)决定在有效列表中指定一对(L1)。它对该对(L1)执行连接检查,并在绑定请求中包含USE-CANDIDATE属性。当检查成功时,代理L将配对(L1)的指定标志值设置为“真”,代理R将匹配配对(R1)的指定标志值设置为“真”。

As there are no more components associated with the stream, the nominated pairs become the selected pairs. Consequently, processing for this stream moves into the Completed state. The ICE process also moves into the Completed state.

由于不再有与流关联的组件,指定的对将成为选定的对。因此,该流的处理进入完成状态。ICE过程也会进入完成状态。

16. STUN Extensions
16. 眩晕扩展
16.1. Attributes
16.1. 属性

This specification defines four STUN attributes: PRIORITY, USE-CANDIDATE, ICE-CONTROLLED, and ICE-CONTROLLING.

本规范定义了四个眩晕属性:优先级、候选用途、ICE控制和ICE控制。

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属性表示将与对等自反候选关联的优先级(如果通过此检查发现)。它是一个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属性表示此检查产生的候选对将用于数据传输。该属性没有内容(该属性的长度字段为零);它是一面旗帜。它的属性值为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. 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控制属性。该属性表示客户端认为它当前处于受控角色。该属性的内容是网络字节顺序的64位无符号整数,其中包含一个随机数。该数字用于解决角色冲突,当它被称为“tiebreaker值”时。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. As for the ICE-CONTROLLED attribute, the number is used for solving role conflicts. 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-CONTROLING属性。该属性表示客户端认为它当前处于控制角色。该属性的内容是网络字节顺序的64位无符号整数,其中包含一个随机数。对于ICE-CONTROLED属性,该数字用于解决角色冲突。在ICE会话中,代理必须对所有流的所有绑定请求使用相同的编号,除非它已收到487响应,在这种情况下,它必须更改编号(第7.2.5.1节)。当ICE重新启动时,代理可能会更改号码。

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

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. The remote server compared the tiebreaker values of the client and the server and determined that the client needs to switch roles.

487(角色冲突):绑定请求包含ICE-CONTROLING或ICE-CONTROLED属性,指示与服务器冲突的ICE角色。远程服务器比较了客户端和服务器的tiebreaker值,并确定客户端需要切换角色。

17. Operational Considerations
17. 业务考虑

This section discusses issues relevant to operators operating networks where ICE will be used by endpoints.

本节讨论与运营商有关的问题,运营商运营的网络将由端点使用ICE。

17.1. NAT and Firewall Types
17.1. NAT和防火墙类型

ICE was designed to work with existing NAT and firewall equipment. Consequently, it is not necessary to replace or reconfigure existing firewall and NAT equipment in order to facilitate deployment of ICE. Indeed, ICE was developed to be deployed in environments where the Voice over IP (VoIP) operator has no control over the IP network infrastructure, including firewalls and NATs.

ICE设计用于现有NAT和防火墙设备。因此,无需更换或重新配置现有防火墙和NAT设备,以便于ICE的部署。事实上,ICE被开发用于IP语音(VoIP)运营商无法控制IP网络基础设施(包括防火墙和NAT)的环境中。

That said, ICE works best in environments where the NAT devices are "behave" compliant, meeting the recommendations defined in [RFC4787] and [RFC5382]. In networks with behave-compliant NAT, ICE will work without the need for a TURN server, thus improving voice quality, decreasing call setup times, and reducing the bandwidth demands on the network operator.

也就是说,ICE在NAT设备“行为”兼容的环境中工作得最好,满足[RFC4787]和[RFC5382]中定义的建议。在具有behave compliant NAT的网络中,ICE将在不需要TURN服务器的情况下工作,从而提高语音质量,减少呼叫建立时间,并降低网络运营商的带宽需求。

17.2. Bandwidth Requirements
17.2. 带宽要求

Deployment of ICE can have several interactions with available network capacity that operators need to take into consideration.

ICE的部署可能会与运营商需要考虑的可用网络容量进行多次交互。

17.2.1. STUN and TURN Server-Capacity Planning
17.2.1. 晕眩和翻转服务器容量规划

First and foremost, ICE makes use of TURN and STUN servers, which would typically be located in data centers. The STUN servers require relatively little bandwidth. For each component of each data stream, there will be one or more STUN transactions from each client to the STUN server. In a basic voice-only IPv4 VoIP deployment, there will be four transactions per call (one for RTP and one for RTCP, for both the caller and callee). Each transaction is a single request and a single response, the former being 20 bytes long, and the latter, 28.

首先,ICE使用TURN和STUN服务器,通常位于数据中心。STUN服务器需要的带宽相对较少。对于每个数据流的每个组件,从每个客户端到STUN服务器将有一个或多个STUN事务。在基本的纯语音IPv4 VoIP部署中,每个呼叫将有四个事务(一个用于RTP,一个用于RTCP,用于呼叫者和被呼叫者)。每个事务都是一个请求和一个响应,前者长20字节,后者长28字节。

Consequently, if a system has N users, and each makes four calls in a busy hour, this would require N*1.7bps. For one million users, this is 1.7 Mbps, a very small number (relatively speaking).

因此,如果一个系统有N个用户,并且每个用户在繁忙时间内打4个电话,则需要N*1.7bps。对于一百万用户来说,这是1.7Mbps,这是一个非常小的数字(相对而言)。

TURN traffic is more substantial. The TURN server will see traffic volume equal to the STUN volume (indeed, if TURN servers are deployed, there is no need for a separate STUN server), in addition to the traffic for the actual data. The amount of calls requiring TURN for data relay is highly dependent on network topologies, and can and will vary over time. In a network with 100% behave-compliant NATs, it is exactly zero.

转弯流量更大。除了实际数据的流量外,TURN服务器将看到与STUN流量相等的流量(实际上,如果部署TURN服务器,则不需要单独的STUN服务器)。需要轮换数据中继的呼叫量高度依赖于网络拓扑,并且会随着时间的推移而变化。在具有100%行为兼容NAT的网络中,它正好为零。

The planning considerations above become more significant in multimedia scenarios (e.g., audio and video conferences) and when the numbers of participants in a session grow.

在多媒体场景(如音频和视频会议)中,以及当一次会议的参与者数量增加时,上述规划考虑变得更加重要。

17.2.2. Gathering and Connectivity Checks
17.2.2. 收集和连接检查

The process of gathering candidates and performing connectivity checks can be bandwidth intensive. ICE has been designed to pace both of these processes. The gathering and connectivity-check phases are meant to generate traffic at roughly the same bandwidth as the data traffic itself will consume once the ICE process concludes. This was done to ensure that if a network is designed to support communication traffic of a certain type (voice, video, or just text), it will have sufficient capacity to support the ICE checks for that data. Once ICE has concluded, the subsequent ICE keepalives will later cause a marginal increase in the total bandwidth utilization; however, this will typically be an extremely small increase.

收集候选对象和执行连接检查的过程可能会占用大量带宽。ICE的设计目的是加快这两个过程。收集和连接检查阶段旨在以与ICE过程结束后数据流量本身消耗的带宽大致相同的带宽生成流量。这样做是为了确保如果网络设计为支持某种类型的通信流量(语音、视频或文本),那么它将有足够的容量来支持该数据的ICE检查。一旦ICE结束,随后的ICE保留将导致总带宽利用率的边际增加;然而,这通常是一个非常小的增长。

Congestion due to the gathering and check phases has proven to be a problem in deployments that did not utilize pacing. Typically, access links became congested as the endpoints flooded the network with checks as fast as they could send them. Consequently, network operators need to ensure that their ICE implementations support the pacing feature. Though this pacing does increase call setup times, it makes ICE network friendly and easier to deploy.

由于收集和检查阶段而导致的拥塞已被证明是不使用起搏的部署中的一个问题。通常,当端点以尽可能快的速度向网络发送检查时,访问链路会变得拥挤。因此,网络运营商需要确保其ICE实施支持起搏功能。虽然这种调整确实增加了呼叫设置时间,但它使ICE网络更友好,更易于部署。

17.2.3. Keepalives
17.2.3. 保持

STUN keepalives (in the form of STUN Binding Indications) are sent in the middle of a data session. However, they are sent only in the absence of actual data traffic. In deployments with continuous media and without utilizing Voice Activity Detection (VAD), or deployments where VAD is utilized together with short interval (max 1 second) comfort noise, the keepalives are never used and there is no increase in bandwidth usage. When VAD is being used without comfort noise, keepalives will be sent during silence periods. This involves a

Stun KeaPiVIES(以Stun绑定指示的形式)在数据会话的中间发送。但是,它们仅在没有实际数据流量的情况下发送。在使用连续介质且未使用语音活动检测(VAD)的部署中,或在使用VAD时伴有短间隔(最大1秒)舒适噪音的部署中,从不使用keepalives,带宽使用率也不会增加。当VAD在没有舒适噪音的情况下使用时,将在静音期间发送keepalives。这涉及到

single packet every 15-20 seconds, far less than the packet every 20-30 ms that is sent when there is voice. Therefore, keepalives do not have any real impact on capacity planning.

每15-20秒发送一个数据包,远低于有语音时每20-30毫秒发送一个数据包。因此,keepalives对容量规划没有任何实际影响。

17.3. ICE and ICE-Lite
17.3. 冰与冰晶

Deployments utilizing a mix of ICE and ICE-lite interoperate with each other. They have been explicitly designed to do so.

混合使用ICE和ICE lite的部署可以彼此互操作。它们被明确设计为这样做。

However, ICE-lite can only be deployed in limited use cases. Those cases, and the caveats involved in doing so, are documented in Appendix A.

然而,ICE-lite只能在有限的用例中部署。附录A中记录了这些情况以及相关注意事项。

17.4. Troubleshooting and Performance Management
17.4. 故障排除和性能管理

ICE utilizes end-to-end connectivity checks and places much of the processing in the endpoints. This introduces a challenge to the network operator -- how can they troubleshoot ICE deployments? How can they know how ICE is performing?

ICE利用端到端连接检查,并将大部分处理放在端点中。这给网络运营商带来了一个挑战——他们如何对ICE部署进行故障排除?他们怎么知道冰是如何运行的?

ICE has built-in features to help deal with these problems. Signaling servers, typically deployed in data centers of the network operator, will see the contents of the candidate exchanges that convey the ICE parameters. These parameters include the type of each candidate (host, server reflexive, or relayed), along with their related addresses. Once ICE processing has completed, an updated candidate exchange takes place, signaling the selected address (and its type). This updated signaling is performed exactly for the purposes of educating network equipment (such as a diagnostic tool attached to a signaling) about the results of ICE processing.

ICE的内置功能有助于解决这些问题。信令服务器通常部署在网络运营商的数据中心,将看到传递ICE参数的候选交换机的内容。这些参数包括每个候选服务器的类型(主机、服务器自反或中继)及其相关地址。ICE处理完成后,将进行更新的候选交换,并向所选地址(及其类型)发送信号。执行此更新的信令完全是为了教育网络设备(例如,连接到信令的诊断工具)有关ICE处理的结果。

As a consequence, through the logs generated by a signaling server, a network operator can observe what types of candidates are being used for each call and what addresses were selected by ICE. This is the primary information that helps evaluate how ICE is performing.

因此,通过信令服务器生成的日志,网络运营商可以观察每个呼叫使用的候选类型以及ICE选择的地址。这是帮助评估ICE性能的主要信息。

17.5. Endpoint Configuration
17.5. 端点配置

ICE relies on several pieces of data being configured into the endpoints. This configuration data includes timers, credentials for TURN servers, and hostnames for STUN and TURN servers. ICE itself does not provide a mechanism for this configuration. Instead, it is assumed that this information is attached to whatever mechanism is used to configure all of the other parameters in the endpoint. For SIP phones, standard solutions such as the configuration framework [RFC6080] have been defined.

ICE依赖于将多个数据段配置到端点。此配置数据包括计时器、TURN服务器的凭据以及STUN和TURN服务器的主机名。ICE本身不提供这种配置的机制。相反,假定此信息附加到用于配置端点中所有其他参数的任何机制。对于SIP电话,已经定义了配置框架[RFC6080]等标准解决方案。

18. IAB Considerations
18. IAB考虑因素

The IAB has studied the problem of "Unilateral Self-Address Fixing" (UNSAF), which is the general process by which an ICE agent attempts to determine its address in another realm on the other side of a NAT through a collaborative protocol reflection mechanism [RFC3424]. ICE is an example of a protocol that performs this type of function. Interestingly, the process for ICE is not unilateral, but bilateral, and the difference has a significant impact on the issues raised by the IAB. Indeed, ICE can be considered a Bilateral Self-Address Fixing (B-SAF) protocol, rather than an UNSAF protocol. Regardless, the IAB has mandated that any protocols developed for this purpose document a specific set of considerations. This section meets those requirements.

IAB研究了“单边自地址固定”(UNSAF)问题,这是ICE代理试图通过协作协议反射机制确定其在NAT另一侧另一领域的地址的一般过程[RFC3424]。ICE是执行此类功能的协议的一个示例。有趣的是,ICE的过程不是单边的,而是双边的,这种差异对IAB提出的问题有重大影响。事实上,ICE可以被视为双边自地址固定(B-SAF)协议,而不是UNSAF协议。无论如何,IAB已规定为此目的制定的任何协议都应记录一组特定的注意事项。本节满足这些要求。

18.1. Problem Definition
18.1. 问题定义

From RFC 3424, any UNSAF proposal needs to provide:

根据RFC 3424,任何UNSAF提案都需要提供:

Precise definition of a specific, limited-scope problem that is to be solved with the UNSAF proposal. A short term fix should not be generalized to solve other problems. Such generalizations lead to the the prolonged dependence on and usage of the supposed short term fix -- meaning that it is no longer accurate to call it "short term".

精确定义一个具体的、范围有限的问题,该问题将通过UNSAF提案解决。不应将短期修复推广到解决其他问题。这种泛化导致长期依赖和使用假定的短期修复方法——这意味着称之为“短期”不再准确。

The specific problems being solved by ICE are:

ICE正在解决的具体问题有:

Providing a means for two peers to determine the set of transport addresses that can be used for communication.

为两个对等方提供确定可用于通信的传输地址集的方法。

Providing a means for an agent to determine an address that is reachable by another peer with which it wishes to communicate.

为代理提供一种方法,以确定其希望与之通信的另一对等方可访问的地址。

18.2. Exit Strategy
18.2. 退出策略

From RFC 3424, any UNSAF proposal needs to provide:

根据RFC 3424,任何UNSAF提案都需要提供:

Description of an exit strategy/transition plan. The better short term fixes are the ones that will naturally see less and less use as the appropriate technology is deployed.

退出战略/过渡计划的说明。更好的短期修复方法是,随着适当技术的部署,自然会看到越来越少的使用。

ICE itself doesn't easily get phased out. However, it is useful even in a globally connected Internet, to serve as a means for detecting whether a router failure has temporarily disrupted connectivity, for example. ICE also helps prevent certain security attacks that have nothing to do with NAT. However, what ICE does is help phase out other UNSAF mechanisms. ICE effectively picks amongst those

冰本身不容易被淘汰。然而,它甚至在全球连接的互联网中也很有用,例如,它可以作为检测路由器故障是否暂时中断了连接的手段。ICE还有助于防止某些与NAT无关的安全攻击。然而,ICE所做的是帮助逐步淘汰UNSAF的其他机制。冰在这些人中间有效地起到了作用

mechanisms, prioritizing ones that are better and deprioritizing ones that are worse. As NATs begin to dissipate as IPv6 is introduced, server-reflexive and relayed candidates (both forms of UNSAF addresses) simply never get used, because higher-priority connectivity exists to the native host candidates. Therefore, the servers get used less and less and can eventually be removed when their usage goes to zero.

机制,将更好的优先考虑,将更差的优先考虑。随着IPv6的引入,NAT开始消失,服务器自反和中继候选(两种形式的UNSAF地址)根本就不会被使用,因为本地候选主机存在更高优先级的连接。因此,服务器的使用率越来越低,当其使用率为零时,最终可以将其删除。

Indeed, ICE can assist in the transition from IPv4 to IPv6. It can be used to determine whether to use IPv6 or IPv4 when two dual-stack hosts communicate with SIP (IPv6 gets used). It can also allow a network with both 6to4 and native v6 connectivity to determine which address to use when communicating with a peer.

事实上,ICE可以帮助从IPv4过渡到IPv6。当两个双栈主机与SIP通信(使用IPv6)时,它可用于确定是使用IPv6还是IPv4。它还允许同时具有6to4和本机v6连接的网络确定在与对等方通信时使用哪个地址。

18.3. Brittleness Introduced by ICE
18.3. 冰引起的脆性

From RFC 3424, any UNSAF proposal needs to provide:

根据RFC 3424,任何UNSAF提案都需要提供:

Discussion of specific issues that may render systems more "brittle". For example, approaches that involve using data at multiple network layers create more dependencies, increase debugging challenges, and make it harder to transition.

讨论可能使系统更“脆弱”的具体问题。例如,涉及在多个网络层使用数据的方法会产生更多的依赖性,增加调试挑战,并使转换更加困难。

ICE actually removes brittleness from existing UNSAF mechanisms. In particular, classic STUN (as described in RFC 3489 [RFC3489]) has several points of brittleness. One of them is the discovery process that requires an ICE agent to try to classify the type of NAT it is behind. This process is error prone. With ICE, that discovery process is simply not used. Rather than unilaterally assessing the validity of the address, its validity is dynamically determined by measuring connectivity to a peer. The process of determining connectivity is very robust.

冰实际上消除了现有UNSAF机制的脆性。特别是,经典STUN(如RFC 3489[RFC3489]中所述)具有多个脆性点。其中之一是发现过程,需要ICE代理尝试对其背后的NAT类型进行分类。这个过程容易出错。对于ICE来说,这一发现过程根本不用。与其单方面评估地址的有效性,不如通过测量与对等方的连接来动态确定地址的有效性。确定连通性的过程非常稳健。

Another point of brittleness in classic STUN and any other unilateral mechanism is its absolute reliance on an additional server. ICE makes use of a server for allocating unilateral addresses, but it allows agents to directly connect if possible. Therefore, in some cases, the failure of a STUN server would still allow for a call to progress when ICE is used.

经典STUN和任何其他单边机制的另一个弱点是它对额外服务器的绝对依赖。ICE利用服务器分配单边地址,但如果可能,它允许代理直接连接。因此,在某些情况下,当使用ICE时,STUN服务器的故障仍然允许进行调用。

Another point of brittleness in classic STUN is that it assumes the STUN server is on the public Internet. Interestingly, with ICE, that is not necessary. There can be a multitude of STUN servers in a variety of address realms. ICE will discover the one that has provided a usable address.

经典STUN的另一个弱点是它假设STUN服务器位于公共互联网上。有趣的是,对于冰来说,这是不必要的。在各种地址域中可以有大量的STUN服务器。ICE将发现提供了可用地址的地址。

The most troubling point of brittleness in classic STUN is that it doesn't work in all network topologies. In cases where there is a shared NAT between each agent and the STUN server, traditional STUN may not work. With ICE, that restriction is removed.

经典STUN中最令人不安的脆弱之处在于它并不适用于所有网络拓扑。在每个代理和STUN服务器之间存在共享NAT的情况下,传统的STUN可能无法工作。有了冰,这一限制就消除了。

Classic STUN also introduces some security considerations. Fortunately, those security considerations are also mitigated by ICE.

Classic STUN还引入了一些安全注意事项。幸运的是,ICE也减轻了这些安全考虑。

Consequently, ICE serves to repair the brittleness introduced in classic STUN, and it does not introduce any additional brittleness into the system.

因此,ICE用于修复经典STUN中引入的脆性,并且不会向系统中引入任何额外的脆性。

The penalty of these improvements is that ICE increases session establishment times.

这些改进的缺点是ICE增加了会话建立时间。

18.4. Requirements for a Long-Term Solution
18.4. 长期解决方案的要求

From RFC 3424, any UNSAF proposal needs to provide the following:

根据RFC 3424,任何UNSAF提案都需要提供以下内容:

Identify requirements for longer term, sound technical solutions; contribute to the process of finding the right longer term solution.

确定长期、可靠的技术解决方案的要求;有助于找到正确的长期解决方案。

Our conclusions from RFC 3489 remain unchanged. However, we feel ICE actually helps because we believe it can be part of the long-term solution.

我们从RFC 3489得出的结论保持不变。然而,我们觉得冰确实有帮助,因为我们相信它可以成为长期解决方案的一部分。

18.5. Issues with Existing NAPT Boxes
18.5. 现有NAPT盒的问题

From RFC 3424, any UNSAF proposal needs to provide:

根据RFC 3424,任何UNSAF提案都需要提供:

Discussion of the impact of the noted practical issues with existing, deployed NA[P]Ts and experience reports.

与现有的、已部署的NA[P]Ts和经验报告讨论指出的实际问题的影响。

A number of NAT boxes are now being deployed into the market that try to provide "generic" ALG functionality. These generic ALGs hunt for IP addresses, in either text or binary form within a packet, and rewrite them if they match a binding. This interferes with classic STUN. However, the update to STUN [RFC5389] uses an encoding that hides these binary addresses from generic ALGs.

许多NAT盒现在正部署到市场上,试图提供“通用”ALG功能。这些通用ALG在数据包中搜索文本或二进制形式的IP地址,如果它们与绑定匹配,则重写它们。这会干扰经典的晕眩。但是,对STUN[RFC5389]的更新使用了一种对通用ALG隐藏这些二进制地址的编码。

Existing NAPT boxes have non-deterministic and typically short expiration times for UDP-based bindings. This requires implementations to send periodic keepalives to maintain those bindings. ICE uses a default of 15 s, which is a very conservative estimate. Eventually, over time, as NAT boxes become compliant to behave [RFC4787], this minimum keepalive will become deterministic

现有的NAPT框对于基于UDP的绑定具有不确定性且通常很短的过期时间。这需要实现定期发送keepalives来维护这些绑定。ICE使用默认值15秒,这是一个非常保守的估计。最终,随着时间的推移,随着NAT盒的行为变得符合[RFC4787],这个最小保持期将变得具有确定性

and well known, and the ICE timers can be adjusted. Having a way to discover and control the minimum keepalive interval would be far better still.

而且是众所周知的,而且冰上计时器是可以调整的。有办法发现并控制最小保留间隔会更好。

19. Security Considerations
19. 安全考虑
19.1. IP Address Privacy
19.1. IP地址隐私

The process of probing for candidates reveals the source addresses of the client and its peer to any on-network listening attacker, and the process of exchanging candidates reveals the addresses to any attacker that is able to see the negotiation. Some addresses, such as the server-reflexive addresses gathered through the local interface of VPN users, may be sensitive information. If these potential attacks cannot be mitigated, ICE usages can define mechanisms for controlling which addresses are revealed to the negotiation and/or probing process. Individual implementations may also have implementation-specific rules for controlling which addresses are revealed. For example, [WebRTC-IP-HANDLING] provides additional information about the privacy aspects of revealing IP addresses via ICE for WebRTC applications. ICE implementations where such issues can arise are RECOMMENDED to provide a programmatic or user interface that provides control over which network interfaces are used to generate candidates.

探测候选对象的过程向任何网络上侦听的攻击者显示客户端及其对等方的源地址,交换候选对象的过程向任何能够看到协商的攻击者显示地址。某些地址,例如通过VPN用户的本地接口收集的服务器自反地址,可能是敏感信息。如果无法缓解这些潜在的攻击,ICE使用可以定义控制向协商和/或探测过程显示哪些地址的机制。单个实现还可能具有特定于实现的规则,用于控制显示哪些地址。例如,[WebRTC IP HANDLING]提供有关通过ICE为WebRTC应用程序泄露IP地址的隐私方面的附加信息。在可能出现此类问题的ICE实施中,建议提供编程或用户界面,以控制使用哪些网络接口生成候选对象。

Based on the types of candidates provided by the peer, and the results of the connectivity tests performed against those candidates, the peer might be able to determine characteristics of the local network, e.g., if different timings are apparent to the peer. Within the limit, the peer might be able to probe the local network.

基于对等方提供的候选类型,以及针对这些候选进行的连接性测试的结果,对等方可能能够确定本地网络的特征,例如,如果不同的定时对对等方来说是明显的。在该限制范围内,对等方可能能够探测本地网络。

There are several types of attacks possible in an ICE system. The subsections consider these attacks and their countermeasures.

ICE系统中可能存在几种类型的攻击。这些部分考虑了这些攻击及其对策。

19.2. Attacks on Connectivity Checks
19.2. 对连接检查的攻击

An attacker might attempt to disrupt the STUN connectivity checks. Ultimately, all of these attacks fool an ICE agent into thinking something incorrect about the results of the connectivity checks. Depending on the type of attack, the attacker needs to have different capabilities. In some cases, the attacker needs to be on the path of the connectivity checks. In other cases, the attacker does not need to be on the path, as long as it is able to generate STUN connectivity checks. While attacks on connectivity checks are typically performed by network entities, if an attacker is able to control an endpoint, it might be able to trigger connectivity-check attacks. The possible false conclusions an attacker can try and cause are:

攻击者可能试图中断昏迷连接检查。最终,所有这些攻击都会欺骗ICE代理,使其认为连接检查的结果不正确。根据攻击类型,攻击者需要具有不同的功能。在某些情况下,攻击者需要位于连接检查的路径上。在其他情况下,攻击者不需要在路径上,只要它能够生成STUN连接检查。虽然对连接检查的攻击通常由网络实体执行,但如果攻击者能够控制端点,则可能会触发连接检查攻击。攻击者可能尝试得出的错误结论如下:

False Invalid: An attacker can fool a pair of agents into thinking a candidate pair is invalid, when it isn't. This can be used to cause an agent to prefer a different candidate (such as one injected by the attacker) or to disrupt a call by forcing all candidates to fail.

False Invalid:攻击者可以愚弄一对代理,使其认为候选对无效,而实际情况并非如此。这可用于使代理选择不同的候选对象(例如攻击者注入的候选对象),或通过强制所有候选对象失败来中断调用。

False Valid: An attacker can fool a pair of agents into thinking a candidate pair is valid, when it isn't. This can cause an agent to proceed with a session but then not be able to receive any data.

False Valid:攻击者可以欺骗一对代理,使其认为候选对是有效的,而实际情况并非如此。这可能会导致代理继续会话,但随后无法接收任何数据。

False Peer-Reflexive Candidate: An attacker can cause an agent to discover a new peer-reflexive candidate when it is not expected to. This can be used to redirect data streams to a DoS target or to the attacker, for eavesdropping or other purposes.

False Peer Reflective Candidate(错误的对等自反候选):攻击者可以使代理在不期望的情况下发现新的对等自反候选。这可用于将数据流重定向到DoS目标或攻击者,用于窃听或其他目的。

False Valid on False Candidate: An attacker has already convinced an agent that there is a candidate with an address that does not actually route to that agent (e.g., by injecting a false peer-reflexive candidate or false server-reflexive candidate). The attacker then launches an attack that forces the agents to believe that this candidate is valid.

False Valid on False候选者:攻击者已使代理确信存在一个地址不实际路由到该代理的候选者(例如,通过注入虚假对等自反候选者或虚假服务器自反候选者)。然后,攻击者发起攻击,迫使代理相信该候选对象有效。

If an attacker can cause a false peer-reflexive candidate or false valid on a false candidate, it can launch any of the attacks described in [RFC5389].

如果攻击者可以导致虚假对等自反候选或虚假候选上的虚假有效,则可以发起[RFC5389]中描述的任何攻击。

To force the false invalid result, the attacker has to wait for the connectivity check from one of the agents to be sent. When it is, the attacker needs to inject a fake response with an unrecoverable error response (such as a 400), or drop the response so that it never reaches the agent. However, since the candidate is, in fact, valid, the original request may reach the peer agent and result in a success response. The attacker needs to force this packet or its response to be dropped through a DoS attack, a Layer 2 network disruption, or another technique. If it doesn't do this, the success response will also reach the originator, alerting it to a possible attack. The ability for the attacker to generate a fake response is mitigated through the STUN short-term credential mechanism. In order for this response to be processed, the attacker needs the password. If the candidate exchange signaling is secured, the attacker will not have the password, and its response will be discarded.

要强制生成错误的无效结果,攻击者必须等待其中一个代理发送连接检查。如果是,攻击者需要使用不可恢复的错误响应(如400)注入假响应,或者删除响应,使其永远不会到达代理。然而,由于候选者实际上是有效的,原始请求可能到达对等代理并导致成功响应。攻击者需要通过DoS攻击、第2层网络中断或其他技术强制丢弃此数据包或其响应。如果它不这样做,成功响应也将到达发起人,提醒其可能受到攻击。攻击者生成虚假响应的能力通过STUN短期凭证机制得到缓解。为了处理此响应,攻击者需要密码。如果候选交换信令是安全的,则攻击者将没有密码,其响应将被丢弃。

Spoofed ICMP Hard Errors (Type 3, codes 2-4) can also be used to create false invalid results. If an ICE agent implements a response to these ICMP errors, the attacker is capable of generating an ICMP message that is delivered to the agent sending the connectivity check. The validation of the ICMP error message by the agent is its

伪造的ICMP硬错误(类型3,代码2-4)也可用于创建虚假无效结果。如果ICE代理对这些ICMP错误实施响应,则攻击者能够生成ICMP消息,并将该消息发送给发送连接检查的代理。代理对ICMP错误消息的验证是其

only defense. For Type 3 code=4, the outer IP header provides no validation, unless the connectivity check was sent with DF=0. For codes 2 or 3, which are originated by the host, the address is expected to be any of the remote agent's host, reflexive, or relay candidate IP addresses. The ICMP message includes the IP header and UDP header of the message triggering the error. These fields also need to be validated. The IP destination and UDP destination port need to match either the targeted candidate address and port or the candidate's base address. The source IP address and port can be any candidate for the same base address of the agent sending the connectivity check. Thus, any attacker having access to the exchange of the candidates will have the necessary information. Hence, the validation is a weak defense, and the sending of spoofed ICMP attacks is also possible for off-path attackers from a node in a network without source address validation.

只有防守。对于类型3代码=4,外部IP标头不提供验证,除非连接检查是在DF=0的情况下发送的。对于由主机发起的代码2或3,地址应为远程代理的任何主机、自反或中继候选IP地址。ICMP消息包括触发错误消息的IP头和UDP头。这些字段也需要验证。IP目标和UDP目标端口需要与目标候选地址和端口或候选基址匹配。源IP地址和端口可以是发送连接检查的代理的相同基址的任何候选。因此,任何访问候选交换的攻击者都将拥有必要的信息。因此,验证是一种薄弱的防御措施,在没有源地址验证的情况下,来自网络节点的非路径攻击者也可能发送伪造的ICMP攻击。

Forcing the fake valid result works in a similar way. The attacker needs to wait for the Binding request from each agent and inject a fake success response. Again, due to the STUN short-term credential mechanism, in order for the attacker to inject a valid success response, the attacker needs the password. Alternatively, the attacker can route (e.g., using a tunneling mechanism) a valid success response, which normally would be dropped or rejected by the network, to the agent.

强制假有效结果的工作方式与此类似。攻击者需要等待来自每个代理的绑定请求,并注入虚假的成功响应。同样,由于STUN短期凭证机制,为了让攻击者注入有效的成功响应,攻击者需要密码。或者,攻击者可以将有效的成功响应路由(例如,使用隧道机制)到代理,该响应通常会被网络丢弃或拒绝。

Forcing the false peer-reflexive candidate result can be done with either fake requests or responses, or with replays. We consider the fake requests and responses case first. It requires the attacker to send a Binding request to one agent with a source IP address and port for the false candidate. In addition, the attacker needs to wait for a Binding request from the other agent and generate a fake response with a XOR-MAPPED-ADDRESS attribute containing the false candidate. Like the other attacks described here, this attack is mitigated by the STUN message integrity mechanisms and secure candidate exchanges.

强制虚假对等自反候选结果可以通过虚假请求或响应或重播来完成。我们认为假冒请求和响应案例首先。它要求攻击者向一个代理发送绑定请求,其中包含假候选的源IP地址和端口。此外,攻击者需要等待来自其他代理的绑定请求,并使用包含假候选的XOR-MAPPED-ADDRESS属性生成假响应。与此处描述的其他攻击一样,此攻击通过STUN消息完整性机制和安全候选交换得到缓解。

Forcing the false peer-reflexive candidate result with packet replays is different. The attacker waits until one of the agents sends a check. It intercepts this request and replays it towards the other agent with a faked source IP address. It also needs to prevent the original request from reaching the remote agent, by either launching a DoS attack to cause the packet to be dropped or forcing it to be dropped using Layer 2 mechanisms. The replayed packet is received at the other agent, and accepted, since the integrity check passes (the integrity check cannot and does not cover the source IP address and port). It is then responded to. This response will contain a XOR-MAPPED-ADDRESS with the false candidate, and it will be sent to that false candidate. The attacker then needs to receive it and relay it towards the originator.

用数据包重播强制得到错误的对等自反候选结果是不同的。攻击者等待其中一个代理发送检查。它截取此请求并使用伪造的源IP地址将其重放到另一个代理。它还需要防止原始请求到达远程代理,方法是发起DoS攻击以导致数据包被丢弃,或者使用第2层机制强制丢弃数据包。由于完整性检查通过(完整性检查不能也不包括源IP地址和端口),因此在另一个代理接收并接受重播的数据包。然后对其进行响应。此响应将包含一个带有假候选的XOR映射地址,并将其发送给该假候选。然后,攻击者需要接收并将其转发给发起人。

The other agent will then initiate a connectivity check towards that false candidate. This validation needs to succeed. This requires the attacker to force a false valid on a false candidate. The injecting of fake requests or responses to achieve this goal is prevented using the integrity mechanisms of STUN and the candidate exchange. Thus, this attack can only be launched through replays. To do that, the attacker needs to intercept the check towards this false candidate and replay it towards the other agent. Then, it needs to intercept the response and replay that back as well.

然后,另一个代理将启动针对该错误候选的连接检查。这种验证需要成功。这要求攻击者对错误的候选对象强制执行false valid。使用STUN和候选交换的完整性机制可以防止为实现此目标而注入虚假请求或响应。因此,此攻击只能通过重播发起。要做到这一点,攻击者需要截获针对该虚假候选的检查,并向其他代理重播该检查。然后,它需要截取响应并将其回放。

This attack is very hard to launch unless the attacker is identified by the fake candidate. This is because it requires the attacker to intercept and replay packets sent by two different hosts. If both agents are on different networks (e.g., across the public Internet), this attack can be hard to coordinate, since it needs to occur against two different endpoints on different parts of the network at the same time.

除非攻击者被假候选人识别,否则很难发起此攻击。这是因为它要求攻击者拦截和重放由两个不同主机发送的数据包。如果两个代理位于不同的网络上(例如,通过公共互联网),则此攻击可能难以协调,因为它需要同时针对网络不同部分上的两个不同端点进行攻击。

If the attacker itself is identified by the fake candidate, the attack is easier to coordinate. However, if the data path is secured (e.g., using the Secure Real-time Transport Protocol (SRTP) [RFC3711]), the attacker will not be able to process the data packets, but will only be able to discard them, effectively disabling the data stream. However, this attack requires the agent to disrupt packets in order to block the connectivity check from reaching the target. In that case, if the goal is to disrupt the data stream, it's much easier to just disrupt it with the same mechanism, rather than attack ICE.

如果攻击者本身被伪造的候选者识别,则攻击更容易协调。但是,如果数据路径是安全的(例如,使用安全实时传输协议(SRTP)[RFC3711]),则攻击者将无法处理数据包,而只能丢弃数据包,从而有效地禁用数据流。但是,此攻击要求代理中断数据包,以阻止连接检查到达目标。在这种情况下,如果目标是中断数据流,那么使用相同的机制中断数据流比攻击ICE容易得多。

19.3. Attacks on Server-Reflexive Address Gathering
19.3. 对服务器自反地址收集的攻击

ICE endpoints make use of STUN Binding requests for gathering server-reflexive candidates from a STUN server. These requests are not authenticated in any way. As a consequence, there are numerous techniques an attacker can employ to provide the client with a false server-reflexive candidate:

ICE端点利用STUN绑定请求从STUN服务器收集服务器自反候选。这些请求没有以任何方式进行身份验证。因此,攻击者可以利用多种技术向客户端提供虚假的服务器自反候选服务器:

o An attacker can compromise the DNS, causing DNS queries to return a rogue STUN server address. That server can provide the client with fake server-reflexive candidates. This attack is mitigated by DNS security, though DNSSEC is not required to address it.

o 攻击者可以破坏DNS,导致DNS查询返回恶意STUN服务器地址。该服务器可以向客户端提供虚假的服务器自反候选。此攻击通过DNS安全性得到缓解,但不需要DNSSEC来解决。

o An attacker that can observe STUN messages (such as an attacker on a shared network segment, like Wi-Fi) can inject a fake response that is valid and will be accepted by the client.

o 能够观察到STUN消息的攻击者(例如,共享网段上的攻击者,如Wi-Fi)可以注入有效且会被客户端接受的虚假响应。

o An attacker can compromise a STUN server and cause it to send responses with incorrect mapped addresses.

o 攻击者可以破坏STUN服务器并使其发送具有错误映射地址的响应。

A false mapped address learned by these attacks will be used as a server-reflexive candidate in the establishment of the ICE session. For this candidate to actually be used for data, the attacker also needs to attack the connectivity checks, and in particular, force a false valid on a false candidate. This attack is very hard to launch if the false address identifies a fourth party (neither the initiator, responder, nor attacker), since it requires attacking the checks generated by each ICE agent in the session and is prevented by SRTP if it identifies the attacker itself.

通过这些攻击获得的错误映射地址将用作ICE会话建立过程中的服务器自反候选地址。要使此候选对象实际用于数据,攻击者还需要攻击连接检查,特别是对假候选对象强制执行假有效。如果假地址标识第四方(无论是发起方、响应方还是攻击者),则很难发起此攻击,因为它需要攻击会话中每个ICE代理生成的检查,如果SRTP标识了攻击者本身,则SRTP可以阻止此攻击。

If the attacker elects not to attack the connectivity checks, the worst it can do is prevent the server-reflexive candidate from being used. However, if the peer agent has at least one candidate that is reachable by the agent under attack, the STUN connectivity checks themselves will provide a peer-reflexive candidate that can be used for the exchange of data. Peer-reflexive candidates are generally preferred over server-reflexive candidates. As such, an attack solely on the STUN address gathering will normally have no impact on a session at all.

如果攻击者选择不攻击连接性检查,那么它所能做的最糟糕的事情就是阻止服务器自反候选服务器被使用。但是,如果对等代理具有至少一个可由受攻击的代理访问的候选,则STUN连接检查本身将提供可用于数据交换的对等自反候选。对等自反候选者通常优于服务器自反候选者。因此,仅针对昏迷地址收集的攻击通常不会对会话产生任何影响。

19.4. Attacks on Relayed Candidate Gathering
19.4. 对中继候选人聚会的攻击

An attacker might attempt to disrupt the gathering of relayed candidates, forcing the client to believe it has a false relayed candidate. Exchanges with the TURN server are authenticated using a long-term credential. Consequently, injection of fake responses or requests will not work. In addition, unlike Binding requests, Allocate requests are not susceptible to replay attacks with modified source IP addresses and ports, since the source IP address and port are not utilized to provide the client with its relayed candidate.

攻击者可能试图中断中继候选对象的收集,迫使客户端相信它有一个错误的中继候选对象。使用长期凭证对与TURN服务器的交换进行身份验证。因此,虚假响应或请求的注入将不起作用。此外,与绑定请求不同,分配请求不易受到修改源IP地址和端口的重播攻击,因为源IP地址和端口不用于向客户端提供其中继候选。

Even if an attacker has caused the client to believe in a false relayed candidate, the connectivity checks cause such a candidate to be used only if they succeed. Thus, an attacker needs to launch a false valid on a false candidate, per above, which is a very difficult attack to coordinate.

即使攻击者使客户端相信错误的中继候选者,连接检查也会导致只有在成功时才使用此类候选者。因此,根据上面的说明,攻击者需要对错误的候选对象启动false valid,这是一种很难协调的攻击。

19.5. Insider Attacks
19.5. 内部攻击

In addition to attacks where the attacker is a third party trying to insert fake candidate information or STUN messages, there are attacks possible with ICE when the attacker is an authenticated and valid participant in the ICE exchange.

除了攻击者是试图插入虚假候选信息或眩晕消息的第三方的攻击外,当攻击者是ICE交换中经过身份验证且有效的参与者时,ICE也可能发生攻击。

19.5.1. STUN Amplification Attack
19.5.1. 眩晕放大攻击

The STUN amplification attack is similar to a "voice hammer" attack, where the attacker causes other agents to direct voice packets to the attack target. However, instead of voice packets being directed to the target, STUN connectivity checks are directed to the target. The attacker sends a large number of candidates, say, 50. The responding agent receives the candidate information and starts its checks, which are directed at the target, and consequently, never generate a response. In the case of WebRTC, the user might not even be aware that this attack is ongoing, since it might be triggered in the background by malicious JavaScript code that the user has fetched. The answerer will start a new connectivity check every Ta ms (say, Ta=50ms). However, the retransmission timers are set to a large number due to the large number of candidates. As a consequence, packets will be sent at an interval of one every Ta milliseconds and then with increasing intervals after that. Thus, STUN will not send packets at a rate faster than data would be sent, and the STUN packets persist only briefly, until ICE fails for the session. Nonetheless, this is an amplification mechanism.

眩晕放大攻击类似于“语音锤”攻击,即攻击者使其他代理将语音包定向到攻击目标。但是,不是将语音数据包定向到目标,而是将STUN连接检查定向到目标。攻击者发送了大量的候选者,比如说50人。响应代理接收候选信息并开始其针对目标的检查,因此从不生成响应。在WebRTC的情况下,用户甚至可能不知道此攻击正在进行,因为它可能是由用户获取的恶意JavaScript代码在后台触发的。应答者将每Ta毫秒(例如,Ta=50ms)开始一次新的连接检查。然而,由于候选数量较多,重传定时器被设置为较大的数字。因此,数据包将以每Ta毫秒一次的间隔发送,然后再以增加的间隔发送。因此,STUN发送数据包的速度不会快于发送数据的速度,并且STUN数据包只会短暂持续,直到ICE在会话中失败。尽管如此,这是一种放大机制。

It is impossible to eliminate the amplification, but the volume can be reduced through a variety of heuristics. ICE agents SHOULD limit the total number of connectivity checks they perform to 100. Additionally, agents MAY limit the number of candidates they will accept.

消除放大是不可能的,但可以通过各种启发式方法减少体积。ICE代理应将其执行的连接检查总数限制为100。此外,代理人可以限制他们将接受的候选人数量。

Frequently, protocols that wish to avoid these kinds of attacks force the initiator to wait for a response prior to sending the next message. However, in the case of ICE, this is not possible. It is not possible to differentiate the following two cases:

通常,希望避免此类攻击的协议会迫使启动器在发送下一条消息之前等待响应。然而,在冰的情况下,这是不可能的。无法区分以下两种情况:

o There was no response because the initiator is being used to launch a DoS attack against an unsuspecting target that will not respond.

o 没有响应,因为发起程序正被用来对一个毫无戒心、不会响应的目标发起DoS攻击。

o There was no response because the IP address and port are not reachable by the initiator.

o 没有响应,因为启动器无法访问IP地址和端口。

In the second case, another check will be sent at the next opportunity, while in the former case, no further checks will be sent.

在第二种情况下,将在下一次机会发送另一张支票,而在前一种情况下,将不发送进一步的支票。

20. IANA Considerations
20. IANA考虑

The original ICE specification registered four STUN attributes and one new STUN error response. The STUN attributes and error response are reproduced here. In addition, this specification registers a new ICE option.

最初的ICE规范记录了四个眩晕属性和一个新的眩晕错误响应。此处再现了眩晕属性和错误响应。此外,本规范注册了一个新的ICE选项。

20.1. STUN Attributes
20.1. 眩晕属性

IANA has registered four STUN attributes:

IANA已注册了四项眩晕属性:

0x0024 PRIORITY 0x0025 USE-CANDIDATE 0x8029 ICE-CONTROLLED 0x802A ICE-CONTROLLING

0x0024优先级0x0025使用候选0x8029冰控0x802A冰控

20.2. STUN Error Responses
20.2. 眩晕错误响应

IANA has registered the following STUN error-response code:

IANA已注册以下STUN错误响应代码:

487 Role Conflict: The client asserted an ICE role (controlling or controlled) that is in conflict with the role of the server.

487角色冲突:客户端断言了与服务器角色冲突的ICE角色(控制或受控)。

20.3. ICE Options
20.3. ICE选项

IANA has registered the following ICE option in the "ICE Options" subregistry of the "Interactive Connectivity Establishment (ICE)" registry, following the procedures defined in [RFC6336].

IANA已按照[RFC6336]中定义的程序,在“交互式连接建立(ICE)”注册中心的“ICE选项”子区注册了以下ICE选项。

ICE Option name: ice2

ICE选项名称:ice2

Contact: Name: IESG Email: iesg@ietf.org

联系人:姓名:IESG电子邮件:iesg@ietf.org

Change Controller: IESG

更改控制器:IESG

Description: The ICE option indicates that the ICE agent using the ICE option is implemented according to RFC 8445.

描述:ICE选项表示使用ICE选项的ICE代理是根据RFC 8445实现的。

Reference: RFC 8445

参考:RFC 8445

21. Changes from RFC 5245
21. RFC 5245的变更

The purpose of this updated ICE specification is to:

本更新的ICE规范旨在:

o Clarify procedures in RFC 5245.

o 澄清RFC 5245中的程序。

o Make technical changes, due to discovered flaws in RFC 5245 and feedback from the community that has implemented and deployed ICE applications based on RFC 5245.

o 根据RFC 5245中发现的缺陷以及实施和部署基于RFC 5245的ICE应用程序的社区的反馈,进行技术更改。

o Make the procedures independent of the signaling protocol, by removing the SIP and SDP procedures. Procedures specific to a signaling protocol will be defined in separate usage documents. [ICE-SIP-SDP] defines ICE usage with SIP and SDP.

o 通过删除SIP和SDP过程,使过程独立于信令协议。特定于信令协议的程序将在单独的使用文件中定义。[ICE-SIP-SDP]使用SIP和SDP定义ICE的使用。

The following technical changes have been done:

已完成以下技术更改:

o Aggressive nomination removed.

o 激进的提名被取消。

o The procedures for calculating candidate pair states and scheduling connectivity checks modified.

o 计算候选对状态和安排连接检查的过程已修改。

o Procedures for calculation of Ta and RTO modified.

o 修改了Ta和RTO的计算程序。

o Active checklist and Frozen checklist definitions removed.

o 已删除活动检查表和冻结检查表定义。

o 'ice2' ICE option added.

o 添加了“ice2”ICE选项。

o IPv6 considerations modified.

o 修改了IPv6注意事项。

o Usage with no-op for keepalives, and keepalives with non-ICE peers, removed.

o 删除了无操作的keepalives用法和非ICE对等的keepalives用法。

22. References
22. 工具书类
22.1. Normative References
22.1. 规范性引用文件

[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997, <https://www.rfc-editor.org/info/rfc2119>.

[RFC2119]Bradner,S.,“RFC中用于表示需求水平的关键词”,BCP 14,RFC 2119,DOI 10.17487/RFC2119,1997年3月<https://www.rfc-editor.org/info/rfc2119>.

[RFC4941] Narten, T., Draves, R., and S. Krishnan, "Privacy Extensions for Stateless Address Autoconfiguration in IPv6", RFC 4941, DOI 10.17487/RFC4941, September 2007, <https://www.rfc-editor.org/info/rfc4941>.

[RFC4941]Narten,T.,Draves,R.,和S.Krishnan,“IPv6中无状态地址自动配置的隐私扩展”,RFC 4941,DOI 10.17487/RFC49411907年9月<https://www.rfc-editor.org/info/rfc4941>.

[RFC5389] Rosenberg, J., Mahy, R., Matthews, P., and D. Wing, "Session Traversal Utilities for NAT (STUN)", RFC 5389, DOI 10.17487/RFC5389, October 2008, <https://www.rfc-editor.org/info/rfc5389>.

[RFC5389]Rosenberg,J.,Mahy,R.,Matthews,P.,和D.Wing,“NAT(STUN)的会话遍历实用程序”,RFC 5389,DOI 10.17487/RFC5389,2008年10月<https://www.rfc-editor.org/info/rfc5389>.

[RFC5766] Mahy, R., Matthews, P., and J. Rosenberg, "Traversal Using Relays around NAT (TURN): Relay Extensions to Session Traversal Utilities for NAT (STUN)", RFC 5766, DOI 10.17487/RFC5766, April 2010, <https://www.rfc-editor.org/info/rfc5766>.

[RFC5766]Mahy,R.,Matthews,P.,和J.Rosenberg,“使用NAT周围的中继进行遍历(TURN):NAT(STUN)会话遍历实用程序的中继扩展”,RFC 5766,DOI 10.17487/RFC5766,2010年4月<https://www.rfc-editor.org/info/rfc5766>.

[RFC6336] Westerlund, M. and C. Perkins, "IANA Registry for Interactive Connectivity Establishment (ICE) Options", RFC 6336, DOI 10.17487/RFC6336, July 2011, <https://www.rfc-editor.org/info/rfc6336>.

[RFC6336]Westerlund,M.和C.Perkins,“交互式连接建立(ICE)选项的IANA注册”,RFC 6336,DOI 10.17487/RFC6336,2011年7月<https://www.rfc-editor.org/info/rfc6336>.

[RFC6724] Thaler, D., Ed., Draves, R., Matsumoto, A., and T. Chown, "Default Address Selection for Internet Protocol Version 6 (IPv6)", RFC 6724, DOI 10.17487/RFC6724, September 2012, <https://www.rfc-editor.org/info/rfc6724>.

[RFC6724]Thaler,D.,Ed.,Draves,R.,Matsumoto,A.,和T.Chown,“互联网协议版本6(IPv6)的默认地址选择”,RFC 6724,DOI 10.17487/RFC67242012年9月<https://www.rfc-editor.org/info/rfc6724>.

[RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017, <https://www.rfc-editor.org/info/rfc8174>.

[RFC8174]Leiba,B.,“RFC 2119关键词中大写与小写的歧义”,BCP 14,RFC 8174,DOI 10.17487/RFC8174,2017年5月<https://www.rfc-editor.org/info/rfc8174>.

22.2. Informative References
22.2. 资料性引用

[ICE-SIP-SDP] Petit-Huguenin, M., Nandakumar, S., and A. Keranen, "Session Description Protocol (SDP) Offer/Answer procedures for Interactive Connectivity Establishment (ICE)", Work in Progress, draft-ietf-mmusic-ice-sip-sdp-21, June 2018.

[ICE-SIP-SDP]Petit Huguenin,M.,Nandakumar,S.,和A.Keranen,“交互式连接建立(ICE)会话描述协议(SDP)提供/应答程序”,正在进行的工作,草案-ietf-mmusic-ICE-SIP-SDP-212018年6月。

[RFC1918] Rekhter, Y., Moskowitz, B., Karrenberg, D., de Groot, G., and E. Lear, "Address Allocation for Private Internets", BCP 5, RFC 1918, DOI 10.17487/RFC1918, February 1996, <https://www.rfc-editor.org/info/rfc1918>.

[RFC1918]Rekhter,Y.,Moskowitz,B.,Karrenberg,D.,de Groot,G.,和E.Lear,“私人互联网地址分配”,BCP 5,RFC 1918,DOI 10.17487/RFC1918,1996年2月<https://www.rfc-editor.org/info/rfc1918>.

[RFC2475] Blake, S., Black, D., Carlson, M., Davies, E., Wang, Z., and W. Weiss, "An Architecture for Differentiated Services", RFC 2475, DOI 10.17487/RFC2475, December 1998, <https://www.rfc-editor.org/info/rfc2475>.

[RFC2475]Blake,S.,Black,D.,Carlson,M.,Davies,E.,Wang,Z.,和W.Weiss,“差异化服务架构”,RFC 2475,DOI 10.17487/RFC2475,1998年12月<https://www.rfc-editor.org/info/rfc2475>.

[RFC3102] Borella, M., Lo, J., Grabelsky, D., and G. Montenegro, "Realm Specific IP: Framework", RFC 3102, DOI 10.17487/RFC3102, October 2001, <https://www.rfc-editor.org/info/rfc3102>.

[RFC3102]Borella,M.,Lo,J.,Grabelsky,D.,和G.黑山,“特定领域知识产权:框架”,RFC 3102,DOI 10.17487/RFC3102,2001年10月<https://www.rfc-editor.org/info/rfc3102>.

[RFC3103] Borella, M., Grabelsky, D., Lo, J., and K. Taniguchi, "Realm Specific IP: Protocol Specification", RFC 3103, DOI 10.17487/RFC3103, October 2001, <https://www.rfc-editor.org/info/rfc3103>.

[RFC3103]Borella,M.,Grabelsky,D.,Lo,J.,和K.Taniguchi,“领域特定IP:协议规范”,RFC 3103,DOI 10.17487/RFC3103,2001年10月<https://www.rfc-editor.org/info/rfc3103>.

[RFC3235] Senie, D., "Network Address Translator (NAT)-Friendly Application Design Guidelines", RFC 3235, DOI 10.17487/RFC3235, January 2002, <https://www.rfc-editor.org/info/rfc3235>.

[RFC3235]Senie,D.,“网络地址转换器(NAT)-友好的应用程序设计指南”,RFC 3235,DOI 10.17487/RFC3235,2002年1月<https://www.rfc-editor.org/info/rfc3235>.

[RFC3261] Rosenberg, J., Schulzrinne, H., Camarillo, G., Johnston, A., Peterson, J., Sparks, R., Handley, M., and E. Schooler, "SIP: Session Initiation Protocol", RFC 3261, DOI 10.17487/RFC3261, June 2002, <https://www.rfc-editor.org/info/rfc3261>.

[RFC3261]Rosenberg,J.,Schulzrinne,H.,Camarillo,G.,Johnston,A.,Peterson,J.,Sparks,R.,Handley,M.,和E.Schooler,“SIP:会话启动协议”,RFC 3261,DOI 10.17487/RFC3261,2002年6月<https://www.rfc-editor.org/info/rfc3261>.

[RFC3264] Rosenberg, J. and H. Schulzrinne, "An Offer/Answer Model with Session Description Protocol (SDP)", RFC 3264, DOI 10.17487/RFC3264, June 2002, <https://www.rfc-editor.org/info/rfc3264>.

[RFC3264]Rosenberg,J.和H.Schulzrinne,“具有会话描述协议(SDP)的提供/应答模型”,RFC 3264,DOI 10.17487/RFC3264,2002年6月<https://www.rfc-editor.org/info/rfc3264>.

[RFC3303] Srisuresh, P., Kuthan, J., Rosenberg, J., Molitor, A., and A. Rayhan, "Middlebox communication architecture and framework", RFC 3303, DOI 10.17487/RFC3303, August 2002, <https://www.rfc-editor.org/info/rfc3303>.

[RFC3303]Srisuresh,P.,Kuthan,J.,Rosenberg,J.,Molitor,A.,和A.Rayhan,“中间箱通信架构和框架”,RFC 3303,DOI 10.17487/RFC3303,2002年8月<https://www.rfc-editor.org/info/rfc3303>.

[RFC3424] Daigle, L., Ed. and IAB, "IAB Considerations for UNilateral Self-Address Fixing (UNSAF) Across Network Address Translation", RFC 3424, DOI 10.17487/RFC3424, November 2002, <https://www.rfc-editor.org/info/rfc3424>.

[RFC3424]Daigle,L.,Ed.和IAB,“网络地址转换中单边自地址固定(UNSAF)的IAB考虑”,RFC 3424DOI 10.17487/RFC3424,2002年11月<https://www.rfc-editor.org/info/rfc3424>.

[RFC3489] Rosenberg, J., Weinberger, J., Huitema, C., and R. Mahy, "STUN - Simple Traversal of User Datagram Protocol (UDP) Through Network Address Translators (NATs)", RFC 3489, DOI 10.17487/RFC3489, March 2003, <https://www.rfc-editor.org/info/rfc3489>.

[RFC3489]Rosenberg,J.,Weinberger,J.,Huitema,C.,和R.Mahy,“STUN-通过网络地址转换器(NAT)简单遍历用户数据报协议(UDP)”,RFC 3489,DOI 10.17487/RFC3489,2003年3月<https://www.rfc-editor.org/info/rfc3489>.

[RFC3550] Schulzrinne, H., Casner, S., Frederick, R., and V. Jacobson, "RTP: A Transport Protocol for Real-Time Applications", STD 64, RFC 3550, DOI 10.17487/RFC3550, July 2003, <https://www.rfc-editor.org/info/rfc3550>.

[RFC3550]Schulzrinne,H.,Casner,S.,Frederick,R.,和V.Jacobson,“RTP:实时应用的传输协议”,STD 64,RFC 3550,DOI 10.17487/RFC3550,2003年7月<https://www.rfc-editor.org/info/rfc3550>.

[RFC3605] Huitema, C., "Real Time Control Protocol (RTCP) attribute in Session Description Protocol (SDP)", RFC 3605, DOI 10.17487/RFC3605, October 2003, <https://www.rfc-editor.org/info/rfc3605>.

[RFC3605]Huitema,C.,“会话描述协议(SDP)中的实时控制协议(RTCP)属性”,RFC 3605,DOI 10.17487/RFC3605,2003年10月<https://www.rfc-editor.org/info/rfc3605>.

[RFC3711] Baugher, M., McGrew, D., Naslund, M., Carrara, E., and K. Norrman, "The Secure Real-time Transport Protocol (SRTP)", RFC 3711, DOI 10.17487/RFC3711, March 2004, <https://www.rfc-editor.org/info/rfc3711>.

[RFC3711]Baugher,M.,McGrew,D.,Naslund,M.,Carrara,E.,和K.Norrman,“安全实时传输协议(SRTP)”,RFC 3711,DOI 10.17487/RFC3711,2004年3月<https://www.rfc-editor.org/info/rfc3711>.

[RFC3725] Rosenberg, J., Peterson, J., Schulzrinne, H., and G. Camarillo, "Best Current Practices for Third Party Call Control (3pcc) in the Session Initiation Protocol (SIP)", BCP 85, RFC 3725, DOI 10.17487/RFC3725, April 2004, <https://www.rfc-editor.org/info/rfc3725>.

[RFC3725]Rosenberg,J.,Peterson,J.,Schulzrinne,H.,和G.Camarillo,“会话启动协议(SIP)中第三方呼叫控制(3pcc)的最佳当前实践”,BCP 85,RFC 3725,DOI 10.17487/RFC3725,2004年4月<https://www.rfc-editor.org/info/rfc3725>.

[RFC3879] Huitema, C. and B. Carpenter, "Deprecating Site Local Addresses", RFC 3879, DOI 10.17487/RFC3879, September 2004, <https://www.rfc-editor.org/info/rfc3879>.

[RFC3879]Huitema,C.和B.Carpenter,“不推荐现场本地地址”,RFC 3879,DOI 10.17487/RFC3879,2004年9月<https://www.rfc-editor.org/info/rfc3879>.

[RFC4038] Shin, M-K., Ed., Hong, Y-G., Hagino, J., Savola, P., and E. Castro, "Application Aspects of IPv6 Transition", RFC 4038, DOI 10.17487/RFC4038, March 2005, <https://www.rfc-editor.org/info/rfc4038>.

[RFC4038]Shin,M-K.,Ed.,Hong,Y-G.,Hagino,J.,Savola,P.,和E.Castro,“IPv6过渡的应用方面”,RFC 4038,DOI 10.17487/RFC4038,2005年3月<https://www.rfc-editor.org/info/rfc4038>.

[RFC4091] Camarillo, G. and J. Rosenberg, "The Alternative Network Address Types (ANAT) Semantics for the Session Description Protocol (SDP) Grouping Framework", RFC 4091, DOI 10.17487/RFC4091, June 2005, <https://www.rfc-editor.org/info/rfc4091>.

[RFC4091]Camarillo,G.和J.Rosenberg,“会话描述协议(SDP)分组框架的替代网络地址类型(ANAT)语义”,RFC 4091,DOI 10.17487/RFC4091,2005年6月<https://www.rfc-editor.org/info/rfc4091>.

[RFC4092] Camarillo, G. and J. Rosenberg, "Usage of the Session Description Protocol (SDP) Alternative Network Address Types (ANAT) Semantics in the Session Initiation Protocol (SIP)", RFC 4092, DOI 10.17487/RFC4092, June 2005, <https://www.rfc-editor.org/info/rfc4092>.

[RFC4092]Camarillo,G.和J.Rosenberg,“会话描述协议(SDP)替代网络地址类型(ANAT)语义在会话启动协议(SIP)中的使用”,RFC 4092,DOI 10.17487/RFC4092,2005年6月<https://www.rfc-editor.org/info/rfc4092>.

[RFC4103] Hellstrom, G. and P. Jones, "RTP Payload for Text Conversation", RFC 4103, DOI 10.17487/RFC4103, June 2005, <https://www.rfc-editor.org/info/rfc4103>.

[RFC4103]Hellstrom,G.和P.Jones,“文本对话的RTP有效载荷”,RFC 4103,DOI 10.17487/RFC4103,2005年6月<https://www.rfc-editor.org/info/rfc4103>.

[RFC4291] Hinden, R. and S. Deering, "IP Version 6 Addressing Architecture", RFC 4291, DOI 10.17487/RFC4291, February 2006, <https://www.rfc-editor.org/info/rfc4291>.

[RFC4291]Hinden,R.和S.Deering,“IP版本6寻址体系结构”,RFC 4291,DOI 10.17487/RFC42912006年2月<https://www.rfc-editor.org/info/rfc4291>.

[RFC4566] Handley, M., Jacobson, V., and C. Perkins, "SDP: Session Description Protocol", RFC 4566, DOI 10.17487/RFC4566, July 2006, <https://www.rfc-editor.org/info/rfc4566>.

[RFC4566]Handley,M.,Jacobson,V.,和C.Perkins,“SDP:会话描述协议”,RFC 4566,DOI 10.17487/RFC4566,2006年7月<https://www.rfc-editor.org/info/rfc4566>.

[RFC4787] Audet, F., Ed. and C. Jennings, "Network Address Translation (NAT) Behavioral Requirements for Unicast UDP", BCP 127, RFC 4787, DOI 10.17487/RFC4787, January 2007, <https://www.rfc-editor.org/info/rfc4787>.

[RFC4787]Audet,F.,Ed.和C.Jennings,“单播UDP的网络地址转换(NAT)行为要求”,BCP 127,RFC 4787,DOI 10.17487/RFC4787,2007年1月<https://www.rfc-editor.org/info/rfc4787>.

[RFC5245] Rosenberg, J., "Interactive Connectivity Establishment (ICE): A Protocol for Network Address Translator (NAT) Traversal for Offer/Answer Protocols", RFC 5245, DOI 10.17487/RFC5245, April 2010, <https://www.rfc-editor.org/info/rfc5245>.

[RFC5245]Rosenberg,J.,“交互式连接建立(ICE):提供/应答协议的网络地址转换器(NAT)遍历协议”,RFC 5245,DOI 10.17487/RFC5245,2010年4月<https://www.rfc-editor.org/info/rfc5245>.

[RFC5382] Guha, S., Ed., Biswas, K., Ford, B., Sivakumar, S., and P. Srisuresh, "NAT Behavioral Requirements for TCP", BCP 142, RFC 5382, DOI 10.17487/RFC5382, October 2008, <https://www.rfc-editor.org/info/rfc5382>.

[RFC5382]Guha,S.,Ed.,Biswas,K.,Ford,B.,Sivakumar,S.,和P.Srisuresh,“TCP的NAT行为要求”,BCP 142,RFC 5382,DOI 10.17487/RFC5382,2008年10月<https://www.rfc-editor.org/info/rfc5382>.

[RFC5761] Perkins, C. and M. Westerlund, "Multiplexing RTP Data and Control Packets on a Single Port", RFC 5761, DOI 10.17487/RFC5761, April 2010, <https://www.rfc-editor.org/info/rfc5761>.

[RFC5761]Perkins,C.和M.Westerlund,“在单个端口上多路复用RTP数据和控制数据包”,RFC 5761,DOI 10.17487/RFC5761,2010年4月<https://www.rfc-editor.org/info/rfc5761>.

[RFC6080] Petrie, D. and S. Channabasappa, Ed., "A Framework for Session Initiation Protocol User Agent Profile Delivery", RFC 6080, DOI 10.17487/RFC6080, March 2011, <https://www.rfc-editor.org/info/rfc6080>.

[RFC6080]Petrie,D.和S.Channabasappa,编辑,“会话启动协议用户代理配置文件交付框架”,RFC 6080DOI 10.17487/RFC6080,2011年3月<https://www.rfc-editor.org/info/rfc6080>.

[RFC6146] Bagnulo, M., Matthews, P., and I. van Beijnum, "Stateful NAT64: Network Address and Protocol Translation from IPv6 Clients to IPv4 Servers", RFC 6146, DOI 10.17487/RFC6146, April 2011, <https://www.rfc-editor.org/info/rfc6146>.

[RFC6146]Bagnulo,M.,Matthews,P.,和I.van Beijnum,“有状态NAT64:从IPv6客户端到IPv4服务器的网络地址和协议转换”,RFC 6146,DOI 10.17487/RFC6146,2011年4月<https://www.rfc-editor.org/info/rfc6146>.

[RFC6147] Bagnulo, M., Sullivan, A., Matthews, P., and I. van Beijnum, "DNS64: DNS Extensions for Network Address Translation from IPv6 Clients to IPv4 Servers", RFC 6147, DOI 10.17487/RFC6147, April 2011, <https://www.rfc-editor.org/info/rfc6147>.

[RFC6147]Bagnulo,M.,Sullivan,A.,Matthews,P.,和I.van Beijnum,“DNS64:用于从IPv6客户端到IPv4服务器的网络地址转换的DNS扩展”,RFC 6147,DOI 10.17487/RFC6147,2011年4月<https://www.rfc-editor.org/info/rfc6147>.

[RFC6298] Paxson, V., Allman, M., Chu, J., and M. Sargent, "Computing TCP's Retransmission Timer", RFC 6298, DOI 10.17487/RFC6298, June 2011, <https://www.rfc-editor.org/info/rfc6298>.

[RFC6298]Paxson,V.,Allman,M.,Chu,J.,和M.Sargent,“计算TCP的重传计时器”,RFC 6298,DOI 10.17487/RFC62982011年6月<https://www.rfc-editor.org/info/rfc6298>.

[RFC6544] Rosenberg, J., Keranen, A., Lowekamp, B., and A. Roach, "TCP Candidates with Interactive Connectivity Establishment (ICE)", RFC 6544, DOI 10.17487/RFC6544, March 2012, <https://www.rfc-editor.org/info/rfc6544>.

[RFC6544]Rosenberg,J.,Keranen,A.,Lowekamp,B.,和A.Roach,“具有交互式连接建立(ICE)的TCP候选者”,RFC 6544,DOI 10.17487/RFC65442012年3月<https://www.rfc-editor.org/info/rfc6544>.

[RFC6928] Chu, J., Dukkipati, N., Cheng, Y., and M. Mathis, "Increasing TCP's Initial Window", RFC 6928, DOI 10.17487/RFC6928, April 2013, <https://www.rfc-editor.org/info/rfc6928>.

[RFC6928]Chu,J.,Dukkipati,N.,Cheng,Y.,和M.Mathis,“增加TCP的初始窗口”,RFC 6928,DOI 10.17487/RFC6928,2013年4月<https://www.rfc-editor.org/info/rfc6928>.

[RFC7050] Savolainen, T., Korhonen, J., and D. Wing, "Discovery of the IPv6 Prefix Used for IPv6 Address Synthesis", RFC 7050, DOI 10.17487/RFC7050, November 2013, <https://www.rfc-editor.org/info/rfc7050>.

[RFC7050]Savolainen,T.,Korhonen,J.,和D.Wing,“用于IPv6地址合成的IPv6前缀的发现”,RFC 7050,DOI 10.17487/RFC7050,2013年11月<https://www.rfc-editor.org/info/rfc7050>.

[RFC7721] Cooper, A., Gont, F., and D. Thaler, "Security and Privacy Considerations for IPv6 Address Generation Mechanisms", RFC 7721, DOI 10.17487/RFC7721, March 2016, <https://www.rfc-editor.org/info/rfc7721>.

[RFC7721]Cooper,A.,Gont,F.,和D.Thaler,“IPv6地址生成机制的安全和隐私考虑”,RFC 7721,DOI 10.17487/RFC7721,2016年3月<https://www.rfc-editor.org/info/rfc7721>.

[RFC7825] Goldberg, J., Westerlund, M., and T. Zeng, "A Network Address Translator (NAT) Traversal Mechanism for Media Controlled by the Real-Time Streaming Protocol (RTSP)", RFC 7825, DOI 10.17487/RFC7825, December 2016, <https://www.rfc-editor.org/info/rfc7825>.

[RFC7825]Goldberg,J.,Westerlund,M.,和T.Zeng,“由实时流协议(RTSP)控制的媒体的网络地址转换器(NAT)遍历机制”,RFC 7825,DOI 10.17487/RFC7825,2016年12月<https://www.rfc-editor.org/info/rfc7825>.

[RFC8421] Martinsen, P., Reddy, T., and P. Patil, "Interactive Connectivity Establishment (ICE) Multihomed and IPv4/IPv6 Dual-Stack Guidelines", RFC 8421, DOI 10.17487/RFC8421, July 2018, <https://www.rfc-editor.org/info/rfc8421>.

[RFC8421]Martinsen,P.,Reddy,T.,和P.Patil,“交互式连接建立(ICE)多址和IPv4/IPv6双栈指南”,RFC 8421,DOI 10.17487/RFC8421,2018年7月<https://www.rfc-editor.org/info/rfc8421>.

[WebRTC-IP-HANDLING] Uberti, J. and G. Shieh, "WebRTC IP Address Handling Requirements", Work in Progress, draft-ietf-rtcweb-ip-handling-09, June 2018.

[WebRTC IP处理]Uberti,J.和G.Shieh,“WebRTC IP地址处理要求”,正在进行的工作,草稿-ietf-rtcweb-IP-HANDLING-092018年6月。

Appendix A. Lite and Full Implementations
附录A.Lite和完整实现

ICE allows for two types of implementations. A full implementation supports the controlling and controlled roles in a session and can also perform address gathering. In contrast, a lite implementation is a minimalist implementation that does little but respond to STUN checks, and it only supports the controlled role in a session.

ICE允许两种类型的实现。完整的实现支持会话中的控制角色和受控角色,还可以执行地址收集。相比之下,lite实现是一种极简实现,它只响应Stunt检查,只支持会话中的受控角色。

Because ICE requires both endpoints to support it in order to bring benefits to either endpoint, incremental deployment of ICE in a network is more complicated. Many sessions involve an endpoint that is, by itself, not behind a NAT and not one that would worry about NAT traversal. A very common case is to have one endpoint that requires NAT traversal (such as a VoIP hard phone or soft phone) make a call to one of these devices. Even if the phone supports a full ICE implementation, ICE won't be used at all if the other device doesn't support it. The lite implementation allows for a low-cost entry point for these devices. Once they support the lite implementation, full implementations can connect to them and get the full benefits of ICE.

因为ICE需要两个端点都支持它,以便为任一端点带来好处,所以在网络中增量部署ICE更加复杂。许多会话都涉及一个端点,该端点本身不在NAT后面,也不担心NAT遍历。一种非常常见的情况是,有一个需要NAT遍历的端点(如VoIP硬电话或软电话)呼叫其中一个设备。即使手机支持完整的ICE实现,如果其他设备不支持ICE,也不会使用ICE。lite实现为这些设备提供了一个低成本的入口点。一旦它们支持lite实现,完整的实现就可以连接到它们并获得ICE的全部好处。

Consequently, a lite implementation is only appropriate for devices that will *always* be connected to the public Internet and have a public IP address at which it can receive packets from any correspondent. ICE will not function when a lite implementation is placed behind a NAT.

因此,lite实现仅适用于将*始终*连接到公共互联网并具有公共IP地址的设备,在该地址上,lite可以从任何通信方接收数据包。当lite实现置于NAT之后时,ICE将不起作用。

ICE allows a lite implementation to have a single IPv4 host candidate and several IPv6 addresses. In that case, candidate pairs are selected by the controlling agent using a static algorithm, such as the one in RFC 6724, which is recommended by this specification. However, static mechanisms for address selection are always prone to error, since they can never reflect the actual topology or provide actual guarantees on connectivity. They are always heuristics. Consequently, if an ICE agent is implementing ICE just to select between its IPv4 and IPv6 addresses, and none of its IP addresses are behind NAT, usage of full ICE is still RECOMMENDED in order to provide the most robust form of address selection possible.

ICE允许lite实现具有单个IPv4候选主机和多个IPv6地址。在这种情况下,控制代理使用静态算法选择候选对,如本规范推荐的RFC 6724中的算法。然而,地址选择的静态机制总是容易出错,因为它们无法反映实际的拓扑结构或提供实际的连接性保证。它们总是启发式的。因此,如果ICE代理实现ICE只是为了在其IPv4和IPv6地址之间进行选择,并且其IP地址中没有一个位于NAT之后,则仍然建议使用完整ICE,以便提供最可靠的地址选择形式。

It is important to note that the lite implementation was added to this specification to provide a stepping stone to full implementation. Even for devices that are always connected to the public Internet with just a single IPv4 address, a full implementation is preferable if achievable. Full implementations also obtain the security benefits of ICE unrelated to NAT traversal. Finally, it is often the case that a device that finds itself with a public address today will be placed in a network tomorrow where it will be behind a NAT. It is difficult to definitively know, over the

重要的是要注意,lite实现被添加到本规范中,以提供完整实现的垫脚石。即使对于总是只使用一个IPv4地址连接到公共Internet的设备,如果可以实现完整的实现,也更可取。完整的实现还可以获得与NAT遍历无关的ICE的安全优势。最后,通常情况下,一个设备发现自己今天有一个公共广播,明天将被放置在网络中,它将在NAT后面。从长远来看,很难确切地知道

lifetime of a device or product, if it will always be used on the public Internet. Full implementation provides assurance that communications will always work.

设备或产品的生命周期,如果它将始终在公共互联网上使用。全面实施确保通信始终有效。

Appendix B. Design Motivations
附录B.设计动机

ICE contains a number of normative behaviors that may themselves be simple but derive from complicated or non-obvious thinking or use cases that merit further discussion. Since these design motivations are not necessary to understand for purposes of implementation, they are discussed here. This appendix is non-normative.

ICE包含许多规范性行为,这些行为本身可能很简单,但源自复杂或不明显的思考或用例,值得进一步讨论。由于这些设计动机对于实现来说不是必须理解的,所以在这里讨论它们。本附录为非规范性附录。

B.1. Pacing of STUN Transactions
B.1. STUN事务的速度

STUN transactions used to gather candidates and to verify connectivity are paced out at an approximate rate of one new transaction every Ta milliseconds. Each transaction, in turn, has a retransmission timer RTO that is a function of Ta as well. Why are these transactions paced, and why are these formulas used?

用于收集候选对象和验证连接性的STUN事务以大约每Ta毫秒一个新事务的速率进行排定。反过来,每个事务都有一个重传计时器RTO,它也是Ta的一个函数。为什么这些交易有节奏,为什么使用这些公式?

Sending of these STUN requests will often have the effect of creating bindings on NAT devices between the client and the STUN servers. Experience has shown that many NAT devices have upper limits on the rate at which they will create new bindings. Discussions in the IETF ICE WG during the work on this specification concluded that once every 5 ms is well supported. This is why Ta has a lower bound of 5 ms. Furthermore, transmission of these packets on the network makes use of bandwidth and needs to be rate limited by the ICE agent. Deployments based on earlier draft versions of [RFC5245] tended to overload rate-constrained access links and perform poorly overall, in addition to negatively impacting the network. As a consequence, the pacing ensures that the NAT device does not get overloaded and that traffic is kept at a reasonable rate.

发送这些STUN请求通常会在客户端和STUN服务器之间的NAT设备上创建绑定。经验表明,许多NAT设备创建新绑定的速率都有上限。IETF ICE工作组在本规范工作期间进行的讨论得出结论,每5毫秒一次得到很好的支持。这就是Ta的下限为5ms的原因。此外,这些数据包在网络上的传输利用了带宽,需要由ICE代理进行速率限制。基于[RFC5245]早期草案版本的部署除了对网络产生负面影响外,往往会使速率受限的访问链路过载,总体性能较差。因此,起搏可确保NAT设备不会过载,并且通信量保持在合理的速率。

The definition of a "reasonable" rate is that STUN MUST NOT use more bandwidth than the RTP itself will use, once data starts flowing. The formula for Ta is designed so that, if a STUN packet were sent every Ta seconds, it would consume the same amount of bandwidth as RTP packets, summed across all data streams. Of course, STUN has retransmits, and the desire is to pace those as well. For this reason, RTO is set such that the first retransmit on the first transaction happens just as the first STUN request on the last transaction occurs. Pictorially:

“合理”速率的定义是,一旦数据开始流动,STUN不得使用超过RTP本身使用的带宽。Ta的公式设计为,如果每Ta秒发送一个STUN数据包,它将消耗与RTP数据包相同的带宽量,在所有数据流中求和。当然,STUN也有重传,我们的愿望是加快这些重传的速度。因此,RTO的设置使得第一个事务上的第一次重新传输与最后一个事务上的第一次STUN请求一样发生。形象地:

First Packets Retransmits

第一包重传

                    |                        |
                    |                        |
             -------+------           -------+------
            /               \        /               \
           /                 \      /                 \
        
                    |                        |
                    |                        |
             -------+------           -------+------
            /               \        /               \
           /                 \      /                 \
        
           +--+    +--+    +--+    +--+    +--+    +--+
           |A1|    |B1|    |C1|    |A2|    |B2|    |C2|
           +--+    +--+    +--+    +--+    +--+    +--+
        
           +--+    +--+    +--+    +--+    +--+    +--+
           |A1|    |B1|    |C1|    |A2|    |B2|    |C2|
           +--+    +--+    +--+    +--+    +--+    +--+
        
        ---+-------+-------+-------+-------+-------+------------ Time
           0       Ta      2Ta     3Ta     4Ta     5Ta
        
        ---+-------+-------+-------+-------+-------+------------ Time
           0       Ta      2Ta     3Ta     4Ta     5Ta
        

In this picture, there are three transactions that will be sent (for example, in the case of candidate gathering, there are three host candidate/STUN server pairs). These are transactions A, B, and C. The retransmit timer is set so that the first retransmission on the first transaction (packet A2) is sent at time 3Ta.

在该图中,将发送三个事务(例如,在候选收集的情况下,有三个主机候选/STUN服务器对)。这些是事务A、B和C。重传定时器被设置为在时间3Ta发送第一事务(分组A2)上的第一次重传。

Subsequent retransmits after the first will occur even less frequently than Ta milliseconds apart, since STUN uses an exponential backoff on its retransmissions.

由于STUN在其重传过程中使用指数退避,因此在第一次重传之后发生的后续重传的频率甚至低于Ta毫秒。

This mechanism of a global minimum pacing interval of 5 ms is not generally applicable to transport protocols, but it is applicable to ICE based on the following reasoning.

这种全局最小起搏间隔为5ms的机制通常不适用于传输协议,但基于以下推理,它适用于ICE。

o Start with the following rules that would be generally applicable to transport protocols:

o 从通常适用于传输协议的以下规则开始:

1. Let MaxBytes be the maximum number of bytes allowed to be outstanding in the network at startup, which SHOULD be 14600, as defined in Section 2 of [RFC6928].

1. MaxBytes是启动时允许在网络中未完成的最大字节数,应为14600,如[RFC6928]第2节所定义。

2. Let HTO be the transaction timeout, which SHOULD be 2*RTT if RTT is known or 500 ms otherwise. This is based on the RTO for STUN messages from [RFC5389] and the TCP initial RTO, which is 1 sec in [RFC6298].

2. 设HTO为事务超时,如果已知RTT,则为2*RTT,否则为500毫秒。这是基于来自[RFC5389]的STUN消息的RTO和TCP初始RTO(在[RFC6298]中为1秒)。

3. Let MinPacing be the minimum pacing interval between transactions, which is 5 ms (see above).

3. minpacking是事务之间的最小调整间隔,即5ms(见上文)。

o Observe that agents typically do not know the RTT for ICE transactions (connectivity checks in particular), meaning that HTO will almost always be 500 ms.

o 注意,代理通常不知道ICE事务的RTT(特别是连接检查),这意味着HTO几乎总是500毫秒。

o Observe that a MinPacing of 5 ms and HTO of 500 ms gives at most 100 packets/HTO, which for a typical ICE check of less than 120 bytes means a maximum of 12000 outstanding bytes in the network, which is less than the maximum expressed by rule 1.

o 请注意,5ms的Minpacking和500ms的HTO最多提供100个数据包/HTO,对于小于120字节的典型ICE检查,这意味着网络中最多有12000个未完成字节,这小于规则1中表示的最大值。

o Thus, for ICE, the rule set reduces to just the MinPacing rule, which is equivalent to having a global Ta value.

o 因此,对于ICE,规则集简化为MinPacking规则,这相当于具有全局Ta值。

B.2. Candidates with Multiple Bases
B.2. 多基候选人

Section 5.1.3 talks about eliminating candidates that have the same transport address and base. However, candidates with the same transport addresses but different bases are not redundant. When can an ICE agent have two candidates that have the same IP address and port but different bases? Consider the topology of Figure 11:

第5.1.3节讨论了删除具有相同运输地址和基地的候选人。但是,具有相同传输地址但不同基的候选者不是冗余的。ICE代理何时可以有两个具有相同IP地址和端口但基础不同的候选?考虑图11的拓扑结构:

          +----------+
          | STUN Srvr|
          +----------+
               |
               |
             -----
           //     \\
          |         |
         |  B:net10  |
          |         |
           \\     //
             -----
               |
               |
          +----------+
          |   NAT    |
          +----------+
               |
               |
             -----
           //     \\
          |    A    |
         |192.168/16 |
          |         |
           \\     //
             -----
               |
               |
               |192.168.1.100      -----
          +----------+           //     \\             +----------+
          |          |          |         |            |          |
          | Initiator|---------|  C:net10  |-----------| Responder|
          |          |10.0.1.100|         | 10.0.1.101 |          |
          +----------+           \\     //             +----------+
                                   -----
        
          +----------+
          | STUN Srvr|
          +----------+
               |
               |
             -----
           //     \\
          |         |
         |  B:net10  |
          |         |
           \\     //
             -----
               |
               |
          +----------+
          |   NAT    |
          +----------+
               |
               |
             -----
           //     \\
          |    A    |
         |192.168/16 |
          |         |
           \\     //
             -----
               |
               |
               |192.168.1.100      -----
          +----------+           //     \\             +----------+
          |          |          |         |            |          |
          | Initiator|---------|  C:net10  |-----------| Responder|
          |          |10.0.1.100|         | 10.0.1.101 |          |
          +----------+           \\     //             +----------+
                                   -----
        

Figure 11: Identical Candidates with Different Bases

图11:具有不同基础的相同候选人

In this case, the initiating agent is multihomed. It has one IP address, 10.0.1.100, on network C, which is a net 10 private network. The responding agent is on this same network. The initiating agent is also connected to network A, which is 192.168/16, and has an IP address of 192.168.1.100. There is a NAT on this network, natting into network B, which is another net 10 private network, but it is not connected to network C. There is a STUN server on network B.

在这种情况下,引发剂是多宿主的。它在网络C上有一个IP地址10.0.1.100,这是一个Net10专用网络。响应代理位于同一网络上。发起代理还连接到网络A,网络A为192.168/16,IP地址为192.168.1.100。在这个网络上有一个NAT,NAT进入网络B,这是另一个Net10专用网络,但它没有连接到网络C。网络B上有一个STUN服务器。

The initiating agent obtains a host candidate on its IP address on network C (10.0.1.100:2498) and a host candidate on its IP address on network A (192.168.1.100:3344). It performs a STUN query to its configured STUN server from 192.168.1.100:3344. This query passes through the NAT, which happens to assign the binding 10.0.1.100:2498. The STUN server reflects this in the STUN Binding response. Now, the initiating agent has obtained a server-reflexive candidate with a transport address that is identical to a host candidate (10.0.1.100:2498). However, the server-reflexive candidate has a base of 192.168.1.100:3344, and the host candidate has a base of 10.0.1.100:2498.

发起代理在其网络C上的IP地址(10.0.1.100:2498)上获得主机候选,在其网络a上的IP地址(192.168.1.100:3344)上获得主机候选。它从192.168.1.100:3344对其配置的STUN服务器执行STUN查询。该查询通过NAT,NAT碰巧分配了绑定10.0.1.100:2498。STUN服务器在STUN绑定响应中反映了这一点。现在,发起代理已获得一个传输地址与主机候选地址相同的服务器自反候选(10.0.1.100:2498)。但是,服务器自反候选者的基数为192.168.1.100:3344,主机候选者的基数为10.0.1.100:2498。

B.3. Purpose of the Related-Address and Related-Port Attributes
B.3. 相关地址和相关端口属性的用途

The candidate attribute contains two values that are not used at all by ICE itself -- related address and related port. Why are they present?

候选属性包含两个ICE本身根本不使用的值——相关地址和相关端口。他们为什么在场?

There are two motivations for its inclusion. The first is diagnostic. It is very useful to know the relationship between the different types of candidates. By including it, an ICE agent can know which relayed candidate is associated with which reflexive candidate, which in turn is associated with a specific host candidate. When checks for one candidate succeed but not for others, this provides useful diagnostics on what is going on in the network.

将其包括在内有两个动机。第一个是诊断性的。了解不同类型候选人之间的关系非常有用。通过包含它,ICE代理可以知道哪个中继候选与哪个自反候选相关联,而自反候选又与特定的主机候选相关联。当检查一个候选对象成功但其他候选对象未成功时,这将为网络中发生的情况提供有用的诊断。

The second reason has to do with off-path Quality-of-Service (QoS) mechanisms. When ICE is used in environments such as PacketCable 2.0, proxies will, in addition to performing normal SIP operations, inspect the SDP in SIP messages and extract the IP address and port for data traffic. They can then interact, through policy servers, with access routers in the network, to establish guaranteed QoS for the data flows. This QoS is provided by classifying the RTP traffic based on 5-tuple and then providing it a guaranteed rate, or marking its DSCP appropriately. When a residential NAT is present, and a relayed candidate gets selected for data, this relayed candidate will be a transport address on an actual TURN server. That address says nothing about the actual transport address in the access router that would be used to classify packets for QoS treatment. Rather, the

第二个原因与非路径服务质量(QoS)机制有关。当ICE在PacketCable 2.0等环境中使用时,代理除了执行正常的SIP操作外,还将检查SIP消息中的SDP,并提取数据通信的IP地址和端口。然后,它们可以通过策略服务器与网络中的访问路由器交互,为数据流建立有保证的QoS。通过基于5元组对RTP流量进行分类,然后为其提供保证速率,或者适当标记其DSCP,可以提供这种QoS。当存在住宅NAT,并且为数据选择了中继候选时,该中继候选将是实际TURN服务器上的传输地址。该地址没有说明访问路由器中的实际传输地址,该地址将用于对数据包进行分类以进行QoS处理。而是

server-reflexive candidate towards the TURN server is needed. By carrying the translation in the SDP, the proxy can use that transport address to request QoS from the access router.

需要转向服务器的服务器自反候选者。通过在SDP中携带转换,代理可以使用该传输地址从接入路由器请求QoS。

B.4. Importance of the STUN Username
B.4. 眩晕用户名的重要性

ICE requires the usage of message integrity with STUN using its short-term credential functionality. The actual short-term credential is formed by exchanging username fragments in the candidate exchange. The need for this mechanism goes beyond just security; it is actually required for correct operation of ICE in the first place.

ICE需要使用STUN的短期凭证功能来使用消息完整性。实际的短期凭证是通过在候选交换中交换用户名片段形成的。对这一机制的需要不仅仅是安全;实际上,首先需要正确操作ICE。

Consider ICE agents L, R, and Z. L and R are within private enterprise 1, which is using 10.0.0.0/8. Z is within private enterprise 2, which is also using 10.0.0.0/8. As it turns out, R and Z both have IP address 10.0.1.1. L sends candidates to Z. Z responds to L with its host candidates. In this case, those candidates are 10.0.1.1:8866 and 10.0.1.1:8877. As it turns out, R is in a session at that same time and is also using 10.0.1.1:8866 and 10.0.1.1:8877 as host candidates. This means that R is prepared to accept STUN messages on those ports, just as Z is. L will send a STUN request to 10.0.1.1:8866 and another to 10.0.1.1:8877. However, these do not go to Z as expected. Instead, they go to R! If R just replied to them, L would believe it has connectivity to Z, when in fact it has connectivity to a completely different user, R. To fix this, STUN short-term credential mechanisms are used. The username fragments are sufficiently random; thus it is highly unlikely that R would be using the same values as Z. Consequently, R would reject the STUN request since the credentials were invalid. In essence, the STUN username fragments provide a form of transient host identifiers, bound to a particular session established as part of the candidate exchange.

考虑冰剂L、R和Z L和R在私营企业1中,使用100.0.0/8。Z在private enterprise 2中,它也使用10.0.0.0/8。事实证明,R和Z的IP地址都是10.0.1.1。L向Z发送候选对象。Z用其宿主候选对象回复L。在本例中,这些候选者是10.0.1.1:8866和10.0.1.1:8877。事实证明,R同时在一个会话中,并且使用10.0.1.1:8866和10.0.1.1:8877作为主机候选。这意味着R准备接受这些端口上的STUN消息,就像Z一样。我将向10.0.1.1:8866发送眩晕请求,并向10.0.1.1:8877发送另一个眩晕请求。但是,这些并不像预期的那样到达Z。相反,他们去了R!如果R只是回复他们,我会认为它与Z有连接,而实际上它与一个完全不同的用户R有连接。为了解决这个问题,使用了STUN短期凭证机制。用户名片段足够随机;因此,R不太可能使用与Z相同的值。因此,R将拒绝STUN请求,因为凭据无效。实际上,STUN用户名片段提供了一种形式的临时主机标识符,绑定到作为候选交换的一部分建立的特定会话。

An unfortunate consequence of the non-uniqueness of IP addresses is that, in the above example, R might not even be an ICE agent. It could be any host, and the port to which the STUN packet is directed could be any ephemeral port on that host. If there is an application listening on this socket for packets, and it is not prepared to handle malformed packets for whatever protocol is in use, the operation of that application could be affected. Fortunately, since the ports exchanged are ephemeral and usually drawn from the dynamic or registered range, the odds are good that the port is not used to run a server on host R, but rather is the agent side of some protocol. This decreases the probability of hitting an allocated port, due to the transient nature of port usage in this range. However, the possibility of a problem does exist, and network deployers need to be prepared for it. Note that this is not a

IP地址非唯一性的一个不幸结果是,在上面的示例中,R甚至可能不是ICE代理。它可以是任何主机,STUN数据包指向的端口可以是该主机上的任何临时端口。如果有一个应用程序在此套接字上侦听数据包,并且它不准备为正在使用的任何协议处理格式错误的数据包,则该应用程序的操作可能会受到影响。幸运的是,由于交换的端口是短暂的,并且通常来自动态范围或注册范围,因此该端口不用于在主机R上运行服务器,而是用于某些协议的代理端的可能性很大。这降低了命中分配端口的概率,因为在此范围内端口使用的瞬态特性。然而,确实存在问题的可能性,网络部署人员需要对此做好准备。请注意,这不是一个问题

problem specific to ICE; stray packets can arrive at a port at any time for any type of protocol, especially ones on the public Internet. As such, this requirement is just restating a general design guideline for Internet applications -- be prepared for unknown packets on any port.

冰特有的问题;对于任何类型的协议,特别是公共互联网上的协议,杂散数据包可以随时到达端口。因此,这一要求只是重申了互联网应用程序的一般设计准则——为任何端口上的未知数据包做好准备。

B.5. The Candidate Pair Priority Formula
B.5. 候选对优先级公式

The priority for a candidate pair has an odd form. It is:

候选对的优先级为奇数形式。它是:

      pair priority = 2^32*MIN(G,D) + 2*MAX(G,D) + (G>D?1:0)
        
      pair priority = 2^32*MIN(G,D) + 2*MAX(G,D) + (G>D?1:0)
        

Why is this? When the candidate pairs are sorted based on this value, the resulting sorting has the MAX/MIN property. This means that the pairs are first sorted based on decreasing value of the minimum of the two priorities. For pairs that have the same value of the minimum priority, the maximum priority is used to sort amongst them. If the max and the min priorities are the same, the controlling agent's priority is used as the tiebreaker in the last part of the expression. The factor of 2*32 is used since the priority of a single candidate is always less than 2*32, resulting in the pair priority being a "concatenation" of the two component priorities. This creates the MAX/MIN sorting. MAX/MIN ensures that, for a particular ICE agent, a lower-priority candidate is never used until all higher-priority candidates have been tried.

为什么会这样?基于此值对候选对进行排序时,生成的排序具有MAX/MIN属性。这意味着首先根据两个优先级中最小值的递减值对这些对进行排序。对于具有相同最小优先级值的对,使用最大优先级在它们之间进行排序。如果“最大优先级”和“最小优先级”相同,则在表达式的最后一部分中,控制代理的优先级将用作断开连接的优先级。由于单个候选的优先级始终小于2×32,因此使用2×32的因子,导致成对优先级是两个组件优先级的“串联”。这将创建最大/最小排序。“最大/最小”可确保,对于特定ICE代理,在所有高优先级候选者都被试用之前,不会使用低优先级候选者。

B.6. Why Are Keepalives Needed?
B.6. 为什么需要Keepalives?

Once data begins flowing on a candidate pair, it is still necessary to keep the bindings alive at intermediate NATs for the duration of the session. Normally, the data stream packets themselves (e.g., RTP) meet this objective. However, several cases merit further discussion. Firstly, in some RTP usages, such as SIP, the data streams can be "put on hold". This is accomplished by using the SDP "sendonly" or "inactive" attributes, as defined in RFC 3264 [RFC3264]. RFC 3264 directs implementations to cease transmission of data in these cases. However, doing so may cause NAT bindings to time out, and data won't be able to come off hold.

一旦数据开始在候选对上流动,在会话期间仍有必要在中间NAT上保持绑定的活动状态。通常,数据流分组本身(例如,RTP)满足这一目标。然而,有几个案例值得进一步讨论。首先,在一些RTP使用中,例如SIP,数据流可以被“搁置”。这是通过使用SDP“sendonly”或“inactive”属性实现的,如RFC 3264[RFC3264]中所定义。RFC 3264指示实现在这些情况下停止数据传输。但是,这样做可能会导致NAT绑定超时,并且数据将无法停止。

Secondly, some RTP payload formats, such as the payload format for text conversation [RFC4103], may send packets so infrequently that the interval exceeds the NAT binding timeouts.

其次,一些RTP有效负载格式,例如文本会话的有效负载格式[RFC4103],可能很少发送数据包,以至于间隔超过NAT绑定超时。

Thirdly, if silence suppression is in use, long periods of silence may cause data transmission to cease sufficiently long for NAT bindings to time out.

第三,如果使用静默抑制,长时间的静默可能会导致数据传输停止足够长的时间,使NAT绑定超时。

For these reasons, the data packets themselves cannot be relied upon. ICE defines a simple periodic keepalive utilizing STUN Binding Indications. This makes its bandwidth requirements highly predictable and thus amenable to QoS reservations.

由于这些原因,不能依赖数据包本身。ICE利用眩晕绑定指示定义了一个简单的周期性保持期。这使得其带宽需求具有高度可预测性,因此可接受QoS保留。

B.7. Why Prefer Peer-Reflexive Candidates?
B.7. 为什么更喜欢同辈自反候选人?

Section 5.1.2 describes procedures for computing the priority of a candidate based on its type and local preferences. That section requires that the type preference for peer-reflexive candidates always be higher than server reflexive. Why is that? The reason has to do with the security considerations in Section 19. It is much easier for an attacker to cause an ICE agent to use a false server-reflexive candidate rather than a false peer-reflexive candidate. Consequently, attacks against address gathering with Binding requests are thwarted by ICE by preferring the peer-reflexive candidates.

第5.1.2节描述了根据候选人类型和本地偏好计算其优先级的程序。该部分要求对等自反候选的类型首选项始终高于服务器自反。为什么呢?原因与第19节中的安全考虑有关。攻击者更容易使ICE代理使用错误的服务器自反候选,而不是错误的对等自反候选。因此,ICE通过选择对等自反候选来阻止针对绑定请求的地址收集的攻击。

B.8. Why Are Binding Indications Used for Keepalives?
B.8. 为什么将绑定指示用于Keepalives?

Data keepalives are described in Section 11. These keepalives make use of STUN when both endpoints are ICE capable. However, rather than using a Binding request transaction (which generates a response), the keepalives use an Indication. Why is that?

第11节描述了数据保留。当两个端点都支持ICE时,这些KeepAlive将使用STUN。但是,keepalives不使用绑定请求事务(生成响应),而是使用指示。为什么呢?

The primary reason has to do with network QoS mechanisms. Once data begins flowing, network elements will assume that the data stream has a fairly regular structure, making use of periodic packets at fixed intervals, with the possibility of jitter. If an ICE agent is sending data packets, and then receives a Binding request, it would need to generate a response packet along with its data packets. This will increase the actual bandwidth requirements for the 5-tuple carrying the data packets and introduce jitter in the delivery of those packets. Analysis has shown that this is a concern in certain Layer 2 access networks that use fairly tight packet schedulers for data.

主要原因与网络QoS机制有关。一旦数据开始流动,网络元件将假定数据流具有相当规则的结构,以固定的间隔使用周期性数据包,并有可能出现抖动。如果ICE代理正在发送数据包,然后接收到绑定请求,则需要生成一个响应包及其数据包。这将增加承载数据包的5元组的实际带宽需求,并在这些数据包的交付中引入抖动。分析表明,在某些第2层接入网络中,这是一个问题,这些网络使用相当紧凑的数据包调度器。

Additionally, using a Binding Indication allows integrity to be disabled, which may result in better performance. This is useful for large-scale endpoints, such as Public Switched Telephone Network (PSTN) gateways and Session Border Controllers (SBCs).

此外,使用绑定指示允许禁用完整性,这可能会导致更好的性能。这对于大型端点非常有用,例如公共交换电话网络(PSTN)网关和会话边界控制器(SBC)。

B.9. Selecting Candidate Type Preference
B.9. 选择候选类型首选项

One criterion for selecting type and local preference values is the use of a data intermediary, such as a TURN server, a tunnel service such as a VPN server, or NAT. With a data intermediary, if data is sent to that candidate, it will first transit the data intermediary before being received. One type of candidate that involves a data

选择类型和本地首选项值的一个标准是使用数据中介(如TURN服务器)、隧道服务(如VPN服务器)或NAT。对于数据中介,如果数据被发送到该候选者,它将在接收之前首先传输数据中介。一种类型的候选者,涉及数据

intermediary is the relayed candidate. Another type is the host candidate, which is obtained from a VPN interface. When data is transited through a data intermediary, it can have a positive or negative effect on the latency between transmission and reception. It may or may not increase the packet losses, because of the additional router hops that may be taken. It may increase the cost of providing service, since data will be routed in and right back out of a data intermediary run by a provider. If these concerns are important, the type preference for relayed candidates needs to be carefully chosen.

中间人是中继候选人。另一种类型是从VPN接口获得的主机候选。当数据通过数据中介传输时,它会对传输和接收之间的延迟产生积极或消极的影响。由于可能采取的额外路由器跳数,它可能会或可能不会增加分组丢失。这可能会增加提供服务的成本,因为数据将被路由到由提供商运行的数据中介中或直接从中返回。如果这些问题很重要,则需要仔细选择中继候选人的类型偏好。

Another criterion for selecting preferences is the IP address family. ICE works with both IPv4 and IPv6. It provides a transition mechanism that allows dual-stack hosts to prefer connectivity over IPv6 but to fall back to IPv4 in case the v6 networks are disconnected. Implementation SHOULD follow the guidelines from [RFC8421] to avoid excessive delays in the connectivity-check phase if broken paths exist.

选择首选项的另一个标准是IP地址族。ICE同时适用于IPv4和IPv6。它提供了一种转换机制,允许双栈主机优先选择连接而不是IPv6,但在v6网络断开连接的情况下,可以退回到IPv4。实施应遵循[RFC8421]中的指南,以避免在存在断开路径的情况下在连接检查阶段出现过度延迟。

Another criterion for selecting preferences is topological awareness. This is beneficial for candidates that make use of intermediaries. In those cases, if an ICE agent has preconfigured or dynamically discovered knowledge of the topological proximity of the intermediaries to itself, it can use that to assign higher local preferences to candidates obtained from closer intermediaries.

选择偏好的另一个标准是拓扑感知。这对利用中间人的候选人有利。在这些情况下,如果ICE代理预先配置或动态发现了中介体与其自身拓扑接近性的知识,则可以使用该知识将更高的局部偏好分配给从更接近的中介体获得的候选对象。

Another criterion for selecting preferences might be security or privacy. If a user is a telecommuter, and therefore connected to a corporate network and a local home network, the user may prefer their voice traffic to be routed over the VPN or similar tunnel in order to keep it on the corporate network when communicating within the enterprise but may use the local network when communicating with users outside of the enterprise. In such a case, a VPN address would have a higher local preference than any other address.

选择首选项的另一个标准可能是安全性或隐私。如果用户是远程工作者,因此连接到公司网络和本地家庭网络,用户可能更喜欢通过VPN或类似隧道路由他们的语音通信,以便在企业内部通信时将其保持在企业网络上,但在与企业外部的用户通信时可以使用本地网络。在这种情况下,VPN地址将比任何其他地址具有更高的本地首选项。

Appendix C. Connectivity-Check Bandwidth
附录C.连接检查带宽

The tables below show, for IPv4 and IPv6, the bandwidth required for performing connectivity checks, using different Ta values (given in ms) and different ufrag sizes (given in bytes).

下表显示了对于IPv4和IPv6,使用不同的Ta值(以毫秒为单位)和不同的ufrag大小(以字节为单位)执行连接检查所需的带宽。

The results were provided by Jusin Uberti (Google) on 11 April 2016.

结果由Jusin Uberti(谷歌)于2016年4月11日提供。

                     IP version: IPv4
                     Packet len (bytes): 108 + ufrag
                          |
                       ms |     4     8    12    16
                     -----|------------------------
                      500 | 1.86k 1.98k 2.11k 2.24k
                      200 | 4.64k 4.96k 5.28k  5.6k
                      100 | 9.28k 9.92k 10.6k 11.2k
                       50 | 18.6k 19.8k 21.1k 22.4k
                       20 | 46.4k 49.6k 52.8k 56.0k
                       10 | 92.8k 99.2k  105k  112k
                        5 |  185k  198k  211k  224k
                        2 |  464k  496k  528k  560k
                        1 |  928k  992k 1.06M 1.12M
        
                     IP version: IPv4
                     Packet len (bytes): 108 + ufrag
                          |
                       ms |     4     8    12    16
                     -----|------------------------
                      500 | 1.86k 1.98k 2.11k 2.24k
                      200 | 4.64k 4.96k 5.28k  5.6k
                      100 | 9.28k 9.92k 10.6k 11.2k
                       50 | 18.6k 19.8k 21.1k 22.4k
                       20 | 46.4k 49.6k 52.8k 56.0k
                       10 | 92.8k 99.2k  105k  112k
                        5 |  185k  198k  211k  224k
                        2 |  464k  496k  528k  560k
                        1 |  928k  992k 1.06M 1.12M
        
                     IP version: IPv6
                     Packet len (bytes): 128 + ufrag
                          |
                       ms |     4     8    12    16
                     -----|------------------------
                      500 | 2.18k  2.3k 2.43k 2.56k
                      200 | 5.44k 5.76k 6.08k  6.4k
                      100 | 10.9k 11.5k 12.2k 12.8k
                       50 | 21.8k 23.0k 24.3k 25.6k
                       20 | 54.4k 57.6k 60.8k 64.0k
                       10 |  108k  115k  121k  128k
                        5 |  217k  230k  243k  256k
                        2 |  544k  576k  608k  640k
                        1 | 1.09M 1.15M 1.22M 1.28M
        
                     IP version: IPv6
                     Packet len (bytes): 128 + ufrag
                          |
                       ms |     4     8    12    16
                     -----|------------------------
                      500 | 2.18k  2.3k 2.43k 2.56k
                      200 | 5.44k 5.76k 6.08k  6.4k
                      100 | 10.9k 11.5k 12.2k 12.8k
                       50 | 21.8k 23.0k 24.3k 25.6k
                       20 | 54.4k 57.6k 60.8k 64.0k
                       10 |  108k  115k  121k  128k
                        5 |  217k  230k  243k  256k
                        2 |  544k  576k  608k  640k
                        1 | 1.09M 1.15M 1.22M 1.28M
        

Figure 12: Connectivity-Check Bandwidth

图12:连接检查带宽

Acknowledgements

致谢

Most of the text in this document comes from the original ICE specification, RFC 5245. The authors would like to thank everyone who has contributed to that document. For additional contributions to this revision of the specification, we would like to thank Emil Ivov, Paul Kyzivat, Pal-Erik Martinsen, Simon Perrault, Eric Rescorla, Thomas Stach, Peter Thatcher, Martin Thomson, Justin Uberti, Suhas Nandakumar, Taylor Brandstetter, Peter Saint-Andre, Harald Alvestrand, and Roman Shpount. Ben Campbell did the AD review. Stephen Farrell did the sec-dir review. Stewart Bryant did the gen-art review. Qin We did the ops-dir review. Magnus Westerlund did the tsv-art review.

本文档中的大部分文本来自原始ICE规范RFC 5245。作者要感谢为该文件作出贡献的每一个人。对于本规范修订版的其他贡献,我们要感谢埃米尔·伊沃夫、保罗·基齐瓦特、帕尔·埃里克·马丁森、西蒙·佩罗特、埃里克·雷斯科拉、托马斯·斯塔赫、彼得·撒切尔、马丁·汤姆森、贾斯汀·尤贝蒂、苏哈斯·南达库马尔、泰勒·布兰德斯特特、彼得·圣安德烈、哈拉尔·阿尔维斯特兰和罗曼·肖邦。本·坎贝尔做了广告评论。斯蒂芬·法雷尔(Stephen Farrell)进行了证券交易委员会主任审查。斯图尔特·布莱恩特做了《当代艺术评论》。秦:我们做了ops dir审查。Magnus Westerlund做了tsv艺术评论。

Authors' Addresses

作者地址

Ari Keranen Ericsson Hirsalantie 11 02420 Jorvas Finland

Ari Keranen Ericsson Hirsalantie 11 02420 Jorvas Finland

   Email: ari.keranen@ericsson.com
        
   Email: ari.keranen@ericsson.com
        

Christer Holmberg Ericsson Hirsalantie 11 02420 Jorvas Finland

Christer Holmberg Ericsson Hirsalantie 11 02420 Jorvas Finland

   Email: christer.holmberg@ericsson.com
        
   Email: christer.holmberg@ericsson.com
        

Jonathan Rosenberg jdrosen.net Monmouth, NJ United States of America

Jonathan Rosenberg jdrosen.net美国新泽西州蒙茅斯

   Email: jdrosen@jdrosen.net
   URI:   http://www.jdrosen.net
        
   Email: jdrosen@jdrosen.net
   URI:   http://www.jdrosen.net