MMUSIC                                                      J. Rosenberg
Internet-Draft                                                     Cisco Systems
Expires: July 20,
Intended status: Standards Track                           March 5, 2007                                  January 16,
Expires: September 6, 2007

Interactive Connectivity Establishment (ICE): A Methodology for Network
     Address Translator (NAT) Traversal for Offer/Answer Protocols
                        draft-ietf-mmusic-ice-13
                        draft-ietf-mmusic-ice-14

Status of this Memo

   By submitting this Internet-Draft, each author represents that any
   applicable patent or other IPR claims of which he or she is aware
   have been or will be disclosed, and any of which he or she becomes
   aware will be disclosed, in accordance with Section 6 of BCP 79.

   Internet-Drafts are working documents of the Internet Engineering
   Task Force (IETF), its areas, and its working groups.  Note that
   other groups may also distribute working documents as Internet-
   Drafts.

   Internet-Drafts are draft documents valid for a maximum of six months
   and may be updated, replaced, or obsoleted by other documents at any
   time.  It is inappropriate to use Internet-Drafts as reference
   material or to cite them other than as "work in progress."

   The list of current Internet-Drafts can be accessed at
   http://www.ietf.org/ietf/1id-abstracts.txt.

   The list of Internet-Draft Shadow Directories can be accessed at
   http://www.ietf.org/shadow.html.

   This Internet-Draft will expire on July 20, September 6, 2007.

Copyright Notice

   Copyright (C) The Internet Society IETF Trust (2007).

Abstract

   This document describes a protocol for Network Address Translator
   (NAT) traversal for multimedia session signaling protocols based on
   the offer/answer model, such as sessions established with the Session Initiation Protocol
   (SIP). offer/
   answer model.  This protocol is called Interactive Connectivity
   Establishment (ICE).  ICE makes use of the Session Traversal
   Utilities for NAT (STUN) protocol, applying its binding discovery and
   relay usages, in addition to defining a new usage for checking
   connectivity between peers.  ICE can be used by any protocol
   utilizing the offer/answer model, such as the Session Initiation
   Protocol (SIP).

Table of Contents

   1.  Introduction . . . . . . . . . . . . . . . . . . . . . . . . .  5  6
   2.  Overview of ICE  . . . . . . . . . . . . . . . . . . . . . . .  5  7
     2.1.  Gathering Candidate Addresses  . . . . . . . . . . . . . .  7  9
     2.2.  Connectivity Checks  . . . . . . . . . . . . . . . . . . .  9 11
     2.3.  Sorting Candidates . . . . . . . . . . . . . . . . . . . . 10 12
     2.4.  Frozen Candidates  . . . . . . . . . . . . . . . . . . . . 11 13
     2.5.  Security for Checks  . . . . . . . . . . . . . . . . . . . 11 14
     2.6.  Concluding ICE . . . . . . . . . . . . . . . . . . . . . . 12 14
     2.7.  Lite Implementations . . . . . . . . . . . . . . . . . . . 13 16
   3.  Terminology  . . . . . . . . . . . . . . . . . . . . . . . . . 13 16
   4.  Sending the Initial Offer  . . . . . . . . . . . . . . . . . . 16 19
     4.1.  Full Implementation Requirements . . . . . . . . . . . . . 16 19
       4.1.1.  Gathering Candidates . . . . . . . . . . . . . . . . . 16
       4.1.2.  Prioritizing 19
         4.1.1.1.  Host Candidates  . . . . . . . . . . . . . . . 18
       4.1.3.  Choosing In-Use . . 20
         4.1.1.2.  Server Reflexive and Relayed Candidates  . . . . . 20
         4.1.1.3.  Eliminating Redundant Candidates . . . . . . . . . 20
     4.2.  Lite Implementation 21
         4.1.1.4.  Computing Foundations  . . . . . . . . . . . . . . 21
         4.1.1.5.  Keeping Candidates Alive . . . . . 20
     4.3.  Encoding the SDP . . . . . . . . 22
       4.1.2.  Prioritizing Candidates  . . . . . . . . . . . . . 21
   5.  Receiving the Initial Offer . . 22
         4.1.2.1.  Recommended Formula  . . . . . . . . . . . . . . . 22
     5.1.  Verifying ICE Support
         4.1.2.2.  Guidelines for Choosing Type and Local
                   Preferences  . . . . . . . . . . . . . . . . . . 23
     5.2.  Determining Role . 23
       4.1.3.  Choosing Default Candidates  . . . . . . . . . . . . . 24
     4.2.  Lite Implementation  . . . . . . . 23
     5.3.  Gathering Candidates . . . . . . . . . . . . 25
     4.3.  Encoding the SDP . . . . . . . 24
     5.4.  Prioritizing Candidates . . . . . . . . . . . . . . 25
   5.  Receiving the Initial Offer  . . . 24
     5.5.  Choosing In Use Candidates . . . . . . . . . . . . . . 27
     5.1.  Verifying ICE Support  . . 24
     5.6.  Encoding the SDP . . . . . . . . . . . . . . . . 27
     5.2.  Determining Role . . . . . 24
     5.7.  Forming the Check Lists . . . . . . . . . . . . . . . . 27
     5.3.  Gathering Candidates . 24
     5.8.  Performing Periodic Checks . . . . . . . . . . . . . . . . 27
   6.  Receipt of the Initial Answer . . 28
     5.4.  Prioritizing Candidates  . . . . . . . . . . . . . . 28
     6.1.  Verifying ICE Support . . . 28
     5.5.  Choosing Default Candidates  . . . . . . . . . . . . . . . 28
     6.2.  Determining Role
     5.6.  Encoding the SDP . . . . . . . . . . . . . . . . . . . . . 28
     6.3.
     5.7.  Forming the Check List . Lists  . . . . . . . . . . . . . . . . . 28
     6.4.  Performing Periodic Checks
       5.7.1.  Forming Candidate Pairs  . . . . . . . . . . . . . . . 29
       5.7.2.  Computing Pair Priority and Ordering Pairs . 28
   7.  Connectivity Checks . . . . . 31
       5.7.3.  Pruning the Pairs  . . . . . . . . . . . . . . . . 28
     7.1.  Client Procedures . . 31
       5.7.4.  Computing States . . . . . . . . . . . . . . . . . . 29
       7.1.1.  Sending the Request . 31
     5.8.  Performing Periodic Checks . . . . . . . . . . . . . . . . 29
       7.1.2.  Processing 34
   6.  Receipt of the Response  . Initial Answer  . . . . . . . . . . . . . . 30
     7.2.  Server Procedures . . 35
     6.1.  Verifying ICE Support  . . . . . . . . . . . . . . . . . . 31
       7.2.1.  Additional Procedures for Full Implementations 36
     6.2.  Determining Role . . . . . 32
       7.2.2.  Additional Procedures for Lite Implementations . . . . 34
   8.  Concluding ICE . . . . . . . . . . . . 36
     6.3.  Forming the Check List . . . . . . . . . . . . . 34
   9.  Subsequent Offer/Answer Exchanges . . . . . 36
     6.4.  Performing Periodic Checks . . . . . . . . . 35
     9.1.  Generating the Offer . . . . . . . 36
   7.  Performing Connectivity Checks . . . . . . . . . . . . 35
       9.1.1.  Additional Procedures for Full Implementations . . . . 36
       9.1.2.  Additional
     7.1.  Client Procedures for Lite Implementations  . . . . 37
     9.2.  Receiving the Offer and Generating an Answer . . . . . . . 37
       9.2.1.  Additional Procedures for Full Implementations . . . . 38
     9.3.  Updating the Check and Valid Lists . . . . . 37
       7.1.1.  Sending the Request  . . . . . . . 38
       9.3.1.  Additional Procedures for Full Implementations . . . . 38
   10. Keepalives . . . . . . 37
         7.1.1.1.  PRIORITY and USE-CANDIDATE . . . . . . . . . . . . 37
         7.1.1.2.  Forming Credentials  . . . . . . . . 40
   11. Media Handling . . . . . . . 37
         7.1.1.3.  DiffServ Treatment . . . . . . . . . . . . . . . . 38
       7.1.2.  Processing the Response  . 41
     11.1. Sending Media . . . . . . . . . . . . . . 38
         7.1.2.1.  Failure Cases  . . . . . . . . 41
       11.1.1. Procedures for Full Implementations . . . . . . . . . 41
       11.1.2. Procedures for Lite Implementations . 38
         7.1.2.2.  Success Cases  . . . . . . . . 42
     11.2. Receiving Media . . . . . . . . . . 38
           7.1.2.2.1.  Discovering Peer Reflexive Candidates  . . . . 38
           7.1.2.2.2.  Updating Pair States . . . . . . . 42
   12. Usage with SIP . . . . . . 39
           7.1.2.2.3.  Constructing a Valid Pair  . . . . . . . . . . 40
           7.1.2.2.4.  Updating the Nominated Flag  . . . . . . . . 42
     12.1. Latency Guidelines . 40
     7.2.  Server Procedures  . . . . . . . . . . . . . . . . . . . 42
     12.2. SIP Option Tags and Media Feature Tags . 41
       7.2.1.  Additional Procedures for Full Implementations . . . . 41
         7.2.1.1.  Computing Mapped Address . . . . . 44
     12.3. Interactions with Forking . . . . . . . . 41
         7.2.1.2.  Learning Peer Reflexive Candidates . . . . . . . . 44
     12.4. Interactions with Preconditions 42
         7.2.1.3.  Triggered Checks . . . . . . . . . . . . . 45
     12.5. Interactions with Third Party Call Control . . . . 42
         7.2.1.4.  Updating the Nominated Flag  . . . . 45
   13. Grammar . . . . . . . 43
       7.2.2.  Additional Procedures for Lite Implementations . . . . 43
   8.  Concluding ICE Processing  . . . . . . . . . . . . . . . . 45
   14. Extensibility Considerations . . 43
     8.1.  Nominating Pairs . . . . . . . . . . . . . . . 48
   15. Example . . . . . . 44
       8.1.1.  Regular Nomination . . . . . . . . . . . . . . . . . . 44
       8.1.2.  Aggressive Nomination  . . . 49
   16. Security Considerations . . . . . . . . . . . . . 45
     8.2.  Updating States  . . . . . . 54
     16.1. Attacks on Connectivity Checks . . . . . . . . . . . . . . 54
     16.2. Attacks on Address Gathering . 45
   9.  Subsequent Offer/Answer Exchanges  . . . . . . . . . . . . . . 57
     16.3. Attacks on 46
     9.1.  Generating the Offer/Answer Exchanges Offer . . . . . . . . . . 57
     16.4. Insider Attacks . . . . . . . . . 46
       9.1.1.  Procedures for All Implementations . . . . . . . . . . 46
         9.1.1.1.  ICE Restarts . . 57
       16.4.1. The Voice Hammer Attack . . . . . . . . . . . . . . . 58
       16.4.2. STUN Amplification Attack . . 46
         9.1.1.2.  Removing a Media Stream  . . . . . . . . . . . . 58
     16.5. Interactions with Application Layer Gateways and SIP . 47
         9.1.1.3.  Adding a Media Stream  . . 59
   17. Definition of Connectivity Check Usage . . . . . . . . . . . . 59
     17.1. Applicability 47
       9.1.2.  Procedures for Full Implementations  . . . . . . . . . 47
         9.1.2.1.  Existing Media Streams with ICE Running  . . . . . 48
         9.1.2.2.  Existing Media Streams with ICE Completed  . . . . 48
       9.1.3.  Procedures for Lite Implementations  . . . . . . . . . 49
     9.2.  Receiving the Offer and Generating an Answer . 60
     17.2. Client Discovery of Server . . . . . . 49
       9.2.1.  Procedures for All Implementations . . . . . . . . . . 60
     17.3. Server Determination of Usage 49
         9.2.1.1.  Detecting ICE Restart  . . . . . . . . . . . . . . 60
     17.4. 49
         9.2.1.2.  New Requests or Indications Media Stream . . . . . . . . . . . . . . . . 60
     17.5. New Attributes . 50
         9.2.1.3.  Removed Media Stream . . . . . . . . . . . . . . . 50
       9.2.2.  Procedures for Full Implementations  . . . . . . 60
     17.6. New Error Response Codes . . . 50
         9.2.2.1.  Existing Media Streams with ICE Running and no
                   remote-candidates  . . . . . . . . . . . . . . 61
     17.7. Client Procedures . . 50
         9.2.2.2.  Existing Media Streams with ICE Completed and
                   no remote-candidates . . . . . . . . . . . . . . . 50
         9.2.2.3.  Existing Media Streams and remote-candidates . . . 61
     17.8. Server 50
       9.2.3.  Procedures for Lite Implementations  . . . . . . . . . 51
     9.3.  Updating the Check and Valid Lists . . . . . . . . . . . . 61
     17.9. Security Considerations 52
       9.3.1.  Procedures for Connectivity Check Full Implementations  . . . . . . 61
   18. IANA Considerations . . . 52
         9.3.1.1.  ICE Restarts . . . . . . . . . . . . . . . . . . 61
     18.1. SDP Attributes . 52
         9.3.1.2.  New Media Stream . . . . . . . . . . . . . . . . . 52
         9.3.1.3.  Removed Media Stream . . . . 61
       18.1.1. candidate Attribute . . . . . . . . . . . 52
         9.3.1.4.  ICE Continuing for Existing Media Stream . . . . . 52
       9.3.2.  Procedures for Lite Implementations  . 61
       18.1.2. remote-candidates Attribute . . . . . . . . 53
   10. Keepalives . . . . . 62
       18.1.3. ice-lite Attribute . . . . . . . . . . . . . . . . . . 62
       18.1.4. ice-mismatch Attribute . . . 53
   11. Media Handling . . . . . . . . . . . . . 63
       18.1.5. ice-pwd Attribute . . . . . . . . . . . 54
     11.1. Sending Media  . . . . . . . 63
       18.1.6. ice-ufrag Attribute . . . . . . . . . . . . . . . 54
       11.1.1. Procedures for Full Implementations  . . 63
       18.1.7. ice-options Attribute . . . . . . . 54
       11.1.2. Procedures for Lite Implementations  . . . . . . . . . 64
     18.2. STUN Attributes 55
       11.1.3. Procedures for All Implementations . . . . . . . . . . 55
     11.2. Receiving Media  . . . . . . . . . . . 64
   19. IAB Considerations . . . . . . . . . . 56
   12. Usage with SIP . . . . . . . . . . . . 65
     19.1. Problem Definition . . . . . . . . . . . . 56
     12.1. Latency Guidelines . . . . . . . . 65
     19.2. Exit Strategy . . . . . . . . . . . . 56
       12.1.1. Offer in INVITE  . . . . . . . . . . 65
     19.3. Brittleness Introduced by ICE . . . . . . . . . 56
       12.1.2. Offer in Response  . . . . . 66
     19.4. Requirements for a Long Term Solution . . . . . . . . . . 67
     19.5. Issues . . . 58
     12.2. SIP Option Tags and Media Feature Tags . . . . . . . . . . 58
     12.3. Interactions with Existing NAPT Boxes Forking  . . . . . . . . . . . . . 67
   20. Acknowledgements . . . 58
     12.4. Interactions with Preconditions  . . . . . . . . . . . . . 59
     12.5. Interactions with Third Party Call Control . . . . . . . 68
   21. References . 59
   13. Usage with ANAT  . . . . . . . . . . . . . . . . . . . . . . . 59
   14. Extensibility Considerations . . 68
     21.1. Normative References . . . . . . . . . . . . . . . 60
   15. Grammar  . . . . 68
     21.2. Informative References . . . . . . . . . . . . . . . . . . 69
   Appendix A.  Lite and Full Implementations . . . . . 61
     15.1. "candidate" Attribute  . . . . . . . 71
   Appendix B.  Design Motivations . . . . . . . . . . . 61
     15.2. "remote-candidates" Attribute  . . . . . . 71
     B.1.  Pacing of STUN Transactions . . . . . . . . 64
     15.3. "ice-lite" and "ice-mismatch" Attributes . . . . . . . 72
     B.2.  Candidates with Multiple Bases . . 64
     15.4. "ice-ufrag" and "ice-pwd" Attributes . . . . . . . . . . . 64
     15.5. "ice-options> Attribute  . 72
     B.3.  Purpose of the Translation . . . . . . . . . . . . . . . . 74
     B.4.  Importance of the STUN Username 65
   16. Example  . . . . . . . . . . . . . 74
     B.5.  The Candidate Pair Sequence Number Formula . . . . . . . . 75
     B.6.  The Frozen State . . . . . . 65
   17. Security Considerations  . . . . . . . . . . . . . . . 76
     B.7.  The remote-candidates attribute . . . . 72
     17.1. Attacks on Connectivity Checks . . . . . . . . . 76
     B.8.  Why are Keepalives Needed? . . . . . 72
     17.2. Attacks on Address Gathering . . . . . . . . . . . . 77
     B.9.  Why Prefer Peer Reflexive Candidates? . . . 74
     17.3. Attacks on the Offer/Answer Exchanges  . . . . . . . 78
     B.10. Why Send an Updated Offer? . . . 75
     17.4. Insider Attacks  . . . . . . . . . . . . . 78
     B.11. Why are Binding Indications Used for Keepalives? . . . . . 78
   Author's Address . . . 75
       17.4.1. The Voice Hammer Attack  . . . . . . . . . . . . . . . 75
       17.4.2. STUN Amplification Attack  . . . . . . . 80
   Intellectual Property and Copyright Statements . . . . . . . 76
     17.5. Interactions with Application Layer Gateways and SIP . . . 81

1.  Introduction

   RFC 3264 [4] defines a two-phase exchange 76
   18. Definition of Session Description
   Protocol (SDP) Connectivity Check Usage . . . . . . . . . . . . 77
     18.1. Applicability  . . . . . . . . . . . . . . . . . . . . . . 77
     18.2. Client Discovery of Server . . . . . . . . . . . . . . . . 78
     18.3. Server Determination of Usage  . . . . . . . . . . . . . . 78
     18.4. New Requests or Indications  . . . . . . . . . . . . . . . 78
     18.5. New Attributes . . . . . . . . . . . . . . . . . . . . . . 78
     18.6. New Error Response Codes . . . . . . . . . . . . . . . . . 78
     18.7. Client Procedures  . . . . . . . . . . . . . . . . . . . . 78
     18.8. Server Procedures  . . . . . . . . . . . . . . . . . . . . 78
     18.9. Security Considerations for Connectivity Check . . . . . . 79
   19. IANA Considerations  . . . . . . . . . . . . . . . . . . . . . 79
     19.1. SDP Attributes . . . . . . . . . . . . . . . . . . . . . . 79
       19.1.1. candidate Attribute  . . . . . . . . . . . . . . . . . 79
       19.1.2. remote-candidates Attribute  . . . . . . . . . . . . . 79
       19.1.3. ice-lite Attribute . . . . . . . . . . . . . . . . . . 80
       19.1.4. ice-mismatch Attribute . . . . . . . . . . . . . . . . 80
       19.1.5. ice-pwd Attribute  . . . . . . . . . . . . . . . . . . 81
       19.1.6. ice-ufrag Attribute  . . . . . . . . . . . . . . . . . 81
       19.1.7. ice-options Attribute  . . . . . . . . . . . . . . . . 82
     19.2. STUN Attributes  . . . . . . . . . . . . . . . . . . . . . 82
   20. IAB Considerations . . . . . . . . . . . . . . . . . . . . . . 82
     20.1. Problem Definition . . . . . . . . . . . . . . . . . . . . 83
     20.2. Exit Strategy  . . . . . . . . . . . . . . . . . . . . . . 83
     20.3. Brittleness Introduced by ICE  . . . . . . . . . . . . . . 84
     20.4. Requirements for a Long Term Solution  . . . . . . . . . . 84
     20.5. Issues with Existing NAPT Boxes  . . . . . . . . . . . . . 85
   21. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 85
   22. References . . . . . . . . . . . . . . . . . . . . . . . . . . 86
     22.1. Normative References . . . . . . . . . . . . . . . . . . . 86
     22.2. Informative References . . . . . . . . . . . . . . . . . . 87
   Appendix A.  Lite and Full Implementations . . . . . . . . . . . . 88
   Appendix B.  Design Motivations  . . . . . . . . . . . . . . . . . 89
     B.1.  Pacing of STUN Transactions  . . . . . . . . . . . . . . . 90
     B.2.  Candidates with Multiple Bases . . . . . . . . . . . . . . 90
     B.3.  Purpose of the <rel-addr> and <rel-port> Attributes  . . . 92
     B.4.  Importance of the STUN Username  . . . . . . . . . . . . . 92
     B.5.  The Candidate Pair Sequence Number Formula . . . . . . . . 93
     B.6.  The remote-candidates attribute  . . . . . . . . . . . . . 94
     B.7.  Why are Keepalives Needed? . . . . . . . . . . . . . . . . 95
     B.8.  Why Prefer Peer Reflexive Candidates?  . . . . . . . . . . 96
     B.9.  Why Send an Updated Offer? . . . . . . . . . . . . . . . . 96
     B.10. Why are Binding Indications Used for Keepalives? . . . . . 96
   Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 97
   Intellectual Property and Copyright Statements . . . . . . . . . . 98

1.  Introduction

   RFC 3264 [4] defines a two-phase exchange of Session Description
   Protocol (SDP) messages [10] for the purposes purposes of establishment of
   multimedia sessions.  This offer/answer mechanism is used by
   protocols such as the Session Initiation Protocol (SIP) [3].

   Protocols using offer/answer are difficult to operate through Network
   Address Translators (NAT).  Because their purpose is to establish a
   flow of media packets, they tend to carry the IP of media sources and
   sinks within their messages, which is known to be problematic through
   NAT [16].  The protocols also seek to create a media flow directly
   between participants, so that there is no application layer
   intermediary between them.  This is done to reduce media latency,
   decrease packet loss, and reduce the operational costs of deploying
   the application.  However, this is difficult to accomplish through
   NAT.  A full treatment of the reasons for this is beyond the scope of
   this specification.

   Numerous solutions have been proposed for allowing these protocols to
   operate through NAT.  These include Application Layer Gateways
   (ALGs), the Middlebox Control Protocol [17], Simple Traversal
   Underneath NAT (STUN) [15] and its revision, retitled Session
   Traversal Utilities for NAT [12], the STUN Relay Usage [13], and
   Realm Specific IP [19] [20] along with session description extensions
   needed to make them work, such as the Session Description Protocol
   (SDP) [10] attribute for the Real Time Control Protocol (RTCP) [2].
   Unfortunately, these techniques all have pros and cons which make
   each one optimal in some network topologies, but a poor choice in
   others.  The result is that administrators and implementors are
   making assumptions about the topologies of the networks in which
   their solutions will be deployed.  This introduces complexity and
   brittleness into the system.  What is needed is a single solution
   which is flexible enough to work well in all situations.

   This specification defines Interactive Connectivity Establishment
   (ICE) as a technique for NAT traversal for media streams established
   by the offer/answer model.  ICE is an extension to the offer/answer
   model, and works by including a multiplicity of IP addresses and
   ports in SDP offers and answers, which are then tested for
   connectivity by peer-to-peer STUN exchanges.  The IP addresses and
   ports included in the SDP are gathered using the STUN binding
   acquisition techniques in [12] and relay allocation procedures in
   [13].

2.  Overview of ICE

   In a typical ICE deployment, we have two endpoints (known as AGENTS
   in RFC 3264 terminology) which want to communicate.  They are able to
   communicate indirectly via some signaling protocol (such as SIP), by
   which they can perform an offer/answer exchange of SDP [4] messages.
   Note that ICE is not intended for NAT traversal for SIP, which is
   assumed to be provided via another mechanism [35].  At the beginning
   of the ICE process, the agents are ignorant of their own topologies.
   In particular, they might or might not be behind a NAT (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 communicate.

   Figure 1 shows a typical environment for ICE deployment.  The two
   endpoints are labelled L and R (for left and right, which helps
   visualize call flows).  Both L and R are behind their own respective
   NATs though they may not be aware of establishment it.  The type of
   multimedia sessions.  This NAT and its
   properties are also unknown.  Agents L and R are capable of engaging
   in an offer/answer mechanism is used exchange by
   protocols such as the Session Initiation Protocol (SIP) [3].

   Protocols using offer/answer are difficult to operate through Network
   Address Translators (NAT).  Because their which they can exchange SDP messages,
   whose purpose is to establish set up a
   flow of media packets, they tend session between L and R.
   Typically, this exchange will occur through a SIP server.

   In addition to carry IP addresses within their
   messages, which the agents, a SIP server and NATs, ICE is known to typically
   used in concert with STUN servers in the network.  Each agent can
   have its own STUN server, or they can be problematic through the same.

                              +-------+
                              | SIP   |
           +-------+          | Srvr  |          +-------+
           | STUN  |          |       |          | STUN  |
           | Srvr  |          +-------+          | Srvr  |
           |       |         /         \         |       |
           +-------+        /           \        +-------+
                           /             \
                          /               \
                         /                 \
                        /                   \
                       /  <-  Signalling ->  \
                      /                       \
                     /                         \
               +--------+                   +--------+
               |  NAT [15].   |                   |  NAT   |
               +--------+                   +--------+
                 /                                \
                /                                  \
               /                                    \
           +-------+                             +-------+
           | Agent |                             | Agent |
           |   L   |                             |   R   |
           |       |                             |       |
           +-------+                             +-------+

                     Figure 1: ICE Deployment Scenario

   The
   protocols also seek basic idea behind ICE is as follows: each agent has a variety of
   candidate TRANSPORT ADDRESSES (combination of IP address and port) it
   could use to create communicate with the other agent.  These might include:

   o  A transport address on a media flow directly between
   participants, so that there is no application layer intermediary
   between them.  This is done to reduce media latency, decrease packet
   loss, and reduce attached network interface or
      interfaces

   o  A translated transport address on the operational costs public side of deploying the application.
   However, this is difficult to accomplish through NAT.  A full
   treatment a NAT (a
      "server reflexive" address)

   o  The transport address of a media relay the reasons for this agent is beyond the scope using.

   Potentially, any of this
   specification.

   Numerous solutions have been proposed for allowing these protocols L's candidate transport addresses can be used to
   operate through NAT.  These include Application Layer Gateways
   (ALGs), the Middlebox Control Protocol [16], Simple Traversal
   Underneath NAT (STUN) [14] and its revision, retitled Session
   Traversal Utilities for NAT [11], the STUN Relay Usage [12], and
   Realm Specific IP [18] [19] along
   communicate with session description extensions
   needed to make them work, such as the Session Description Protocol
   (SDP) [10] attribute for the Real Time Control Protocol (RTCP) [2].
   Unfortunately, these techniques all have pros and cons which make
   each one optimal in some network topologies, but a poor choice in
   others.  The result is that administrators any of R's candidate transport addresses.  In
   practice, however, many combinations will not work.  For instance, if
   L and implementors R are
   making assumptions about the topologies of the networks in which both behind NATs, their solutions will directly attached interface
   addresses are unlikely to be deployed.  This introduces complexity and
   brittleness into the system.  What able to communicate directly (this is needed
   why ICE is a single solution
   which needed, after all!).  The purpose of ICE is flexible enough to work well in all situations.

   This specification provides discover
   which pairs of addresses will work.  The way that solution for media streams
   established by signaling protocols based on the offer-answer model.
   It ICE does this is called Interactive Connectivity Establishment, to
   systematically try all possible pairs (in a carefully sorted order)
   until it finds one or ICE.  ICE
   makes use more that works.

2.1.  Gathering Candidate Addresses

   In order to execute ICE, an agent has to identify all of STUN and its relay extension, commonly called TURN, but
   uses them in address
   candidates.  A CANDIDATE is a specific methodology which avoids many transport address - a combination of the pitfalls IP
   address and port for a particular transport protocol.  This document
   defines three types of using any candidates, some derived from physical or
   logical network interfaces, others discoverable via STUN.  Naturally,
   one alone.

2.  Overview of ICE

   In viable candidate is a typical ICE deployment, we have two endpoints (known transport address obtained directly from a
   local interface.  Such a candidate is called a HOST CANDIDATE.  The
   local interface could be ethernet or WiFi, or it could be one that is
   obtained through a tunnel mechanism, such as agents
   in RFC 3264 terminology) which want to communicate.  They are able to
   communicate indirectly via some signaling system a Virtual Private
   Network (VPN) or Mobile IP (MIP).  In all cases, such a network
   interface appears to the agent as SIP, by a local interface from which they ports
   (and thus a candidate) can perform be allocated.

   If an offer/answer exchange of SDP [4] messages.
   Note that ICE is not intended for NAT traversal for SIP, which agent is
   assumed to be provided via some other mechanism [32].  At multihomed, it obtains a candidate from each
   interface.  Depending on the
   beginning location of the ICE process, PEER (the other agent in
   the agents are ignorant of their own
   topologies.  In particular, they might or might not be behind a NAT
   (or multiple tiers of NATs).  ICE allows session) on the agents to discover
   enough information about their topologies IP network relative to find a path or paths the agent, the agent may
   be reachable by
   which they can communicate.

   Figure Figure 1 shows a typical environment for ICE deployment.  The
   two endpoints are labelled L and R (for left and right, which helps
   visualize call flows).  Both L and R are behind NATs -- though as
   mentioned before, they don't know that.  The type of NAT and its
   properties are also unknown.  Agents L and R are capable the peer through one or more of engaging
   in those interfaces.
   Consider, for example, an offer/answer exchange by agent which they can exchange SDP messages,
   whose purpose is has a local interface to set up a media session between L
   private net 10 network (I1), and R.
   Typically, this exchange a second connected to the public
   Internet (I2).  A candidate from I1 will be directly reachable when
   communicating with a peer on the same private net 10 network, while a
   candidate from I2 will be directly reachable when communicating with
   a peer on the public Internet.  Rather than trying to guess which
   interface will occur through a SIP server.

   In addition work prior to sending an offer, the agents, a SIP server and NATs, ICE is typically
   used in concert with STUN servers offering agent
   includes both candidates in its offer.

   Next, the network.  Each agent can
   have its own uses STUN server, or they can be to obtain additional candidates.  These
   come in two flavors: translated addresses on the same.

                              +-------+
                              | SIP   |
           +-------+ public side of a NAT
   (SERVER REFLEXIVE CANDIDATES) and addresses of media relays (RELAYED
   CANDIDATES).  The relationship of these candidates to the host
   candidate is shown in Figure 2.  Both types of candidates are
   discovered using STUN.

                 To Internet

                     | Srvr
                     |          +-------+
                     | STUN  /------------  Relayed
                 Y:y | /               Address
                 +--------+
                 |        |
                 |  STUN  |
                 | Srvr  |          +-------+ Server | Srvr
                 |        |
                 +--------+
                     |         /         \
                     |
                     |
           +-------+        /           \        +-------+
                           /             \
                          /               \
                         /                 \
                        /                   \
                       /  <-  Signalling ->  \
                      /                       \
                     /                         \
               +--------+                   +--------+ /------------  Server
              X1':x1'|/               Reflexive
               +------------+         Address
               |    NAT     |
               +------------+
                     |  NAT
                     | /------------  Local
                 X:x |/               Address
                 +--------+                   +--------+
                 /                                \
                /                                  \
               /                                    \
           +-------+                             +-------+
                 | Agent        |
                 | Agent  |
                 |   L   |                             |   R   |
           |       |        |       |
           +-------+                             +-------+
                 +--------+

                     Figure 1

   The basic idea behind ICE is as follows: 2: Candidate Relationships

   To find a server reflexive candidate, the agent sends a STUN Binding
   Request, using the Binding Discovery Usage [12] from each host
   candidate, to its STUN server.  It is assumed that the address of the
   STUN server is manually configured or learned in some unspecified
   way.  It is RECOMMENDED that when an agent has a variety choice of STUN
   servers (when, for example, they are learned through DNS records and
   multiple results are returned), an agent uses a single STUN server
   (based on its IP address) for all candidates for a particular
   session.  This improves the performance of
   candidate transport addresses it could use to communicate with ICE.

   When the
   other agent.  These might include:

   o  It's directly attached network interface (or interfaces in agent sends the
      case of a multihomed machine

   o  A translated Binding Request from IP address on and port
   X:x, the public side of a NAT (a "server
      reflexive" address)

   o  The address of (assuming there is one) will allocate a media relay binding X1':x1',
   mapping this server reflexive candidate to the agent is using.

   Potentially, any of L's host candidate transport addresses can X:x.
   Outgoing packets sent from the host candidate will be used translated by
   the NAT to
   communicate with any of R's the server reflexive candidate.  Incoming packets sent to
   the server relexive candidate transport addresses.  In
   practice, however, many combinations will not work.  For instance, if
   L be translated by the NAT to the
   host candidate and R forwarded to the agent.  We call the host
   candidate associated with a given server reflexive candidate the
   BASE.

      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 both behind multiple NATs then their directly interface addresses
   are unlikely to between the agent and the STUN server,
   the STUN request will create a binding on each NAT, but only the
   outermost server reflexive candidate will be able to communicate directly (this discovered by the agent.
   If the agent is why ICE not behind a NAT, then the base candidate will be the
   same as the server reflexive candidate and the server reflexive
   candidate is
   needed, after all!). redundant and will be eliminated.

   The purpose final type of ICE candidate is to discover which pairs
   of addresses will work. a RELAYED CANDIDATE.  The way that ICE does this is STUN Relay
   Usage [13] allows a STUN server to
   systematically try all possible pairs (in act as a carefully sorted order)
   until it finds one or more that works.

2.1.  Gathering Candidate Addresses media relay, forwarding
   traffic between L and R. In order to execute ICE, an agent has send traffic to identify L, R sends
   traffic to the media relay at Y:y, and the relay forwards that to
   X1':x1', which passes through the NAT where it is mapped to X:x and
   delivered to L.

2.2.  Connectivity Checks

   Once L has gathered all of its address
   candidates.  Naturally, one viable candidate is one obtained directly
   from a local interface the client has towards candidates, it orders them in highest
   to lowest priority and sends them to R over the network.  Such a
   candidate is called a HOST CANDIDATE. signalling channel.
   The local interface could be
   one on a local layer 2 network technology, such as ethernet or WiFi,
   or candidates are carried in attributes in the SDP offer.  When R
   receives the offer, it could be one that is obtained through a tunnel mechanism, such
   as performs the same gathering process and
   responds with its own list of candidates.  At the end of this
   process, each agent has a Virtual Private Network (VPN) or Mobile IP (MIP).  In all cases,
   these appear to complete list of both its candidates and
   its peer's candidates.  It pairs them up, resulting in CANDIDATE
   PAIRS.  To see which pairs work, the agent as schedules a local interface from which ports (and
   thus a candidate) can be allocated.

   If an agent series of
   CHECKS.  Each check is multihomed, it can obtain a candidate from each
   interface.  Depending on the location of STUN transaction that the peer client will
   perform on a particular candidate pair by sending a STUN request from
   the IP network
   relative local candidate to the agent, remote candidate.

   The basic principle of the agent may be reachable by connectivity checks is simple:

   1.  Sort the peer through
   one of those interfaces, or through another.  Consider, for example,
   an agent which has candidate pairs in priority order.

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

   3.  Acknowledge checks received from the other agent.

   With both agents performing a local interface to check on a private net 10 network, and
   also candidate pair, the result
   is a 4-way handshake:

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

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

                    Figure 3: Basic Connectivity Check

   It is important to note that the public Internet.  A candidate STUN requests are sent to and from
   the net10 interface exact same IP addresses and ports that will be directly reachable when communicating with a peer used for media
   (e.g., RTP and RTCP).  Consequently, agents demultiplex STUN and RTP/
   RTCP using contents of the packets, rather than the port on which
   they are received.  Fortunately, this demultiplexing is easy to do,
   especially for RTP and RTCP.

   Because STUN is used for the same
   private net 10 network, while a candidate from connectivity check, the public interface STUN response
   will be directly reachable when communicating with a peer contain the agent's translated transport address on the public Internet.  Rather than trying to guess which interface will
   work prior to sending an offer,
   side any NATs between the offering agent includes both
   candidates in and its offer.

   Once peer.  If this transport
   address is different from other candidates the agent has obtained host candidates, already learned,
   it uses STUN represents a new candidate, called a PEER REFLEXIVE CANDIDATE,
   which then gets tested by ICE just the same as any other candidate.

   As an optimization, as soon as R gets L's check message R immediately
   sends a check message to obtain
   additional candidates.  These come in two flavors: translated
   addresses L on the public side same candidate pair.  This
   accelerates the process of finding a NAT (SERVER REFLEXIVE CANDIDATES) valid candidate, and addresses of media relays (RELAYED CANDIDATES).  The relationship is called a
   TRIGGERED CHECK.

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

2.3.  Sorting Candidates

   Because the host algorithm above searches all candidate is shown in Figure 2.  Both
   types of pairs, if a
   working pair exists it will eventually find it no matter what order
   the candidates are discovered using STUN.

                 To Internet

                     |
                     |
                     |  /------------  Relayed
                     | /               Candidate
                 +--------+
                 |        |
                 |  STUN  |
                 | Server |
                 |        |
                 +--------+
                     |
                     |
                     | /------------  Server
                     |/               Reflexive
               +------------+         Candidate
               |    NAT     |
               +------------+
                     |
                     | /------------  Host
                     |/               Candidate
                 +--------+
                 |        |
                 | Agent  |
                 |        |
                 +--------+

   Figure 2

   To find tried in.  In order to produce faster (and better)
   results, the candidates are sorted in a server reflexive candidate, specified order.  The
   resulting list of sorted candidate pairs is called the CHECK LIST.
   The algorithm is described in Section 4.1.2 but follows two general
   principles:

   o  Each agent sends gives its candidates a STUN Binding
   Request, using numeric priority which is sent
      along with the Binding Discovery Usage [11] from each host
   candidate, candidate to its STUN server.  (It is assumed the peer

   o  The local and remote priorities are combined so that each agent
      has the address of same ordering for the STUN server candidate pairs.

   The second property is configured, or learned important for getting ICE to work when there
   are NATs in some way.)  When front of L and R. Frequently, NATs will not allow packets
   in from a host until the agent sends the Binding Request, behind the NAT (assuming there is one) has sent a packet
   towards that host.  Consequently, ICE checks in each direction will
   allocate
   not succeed until both sides have sent a check through their
   respective NATs.

   The agent works through this check list by sending a STUN request for
   the next candidate pair on the list every 20ms.  These are called
   PERIODIC CHECKS.

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

2.4.  Frozen Candidates

   The previous description only addresses the case where the agents
   wish to establish a binding, mapping this server reflexive candidate media session with one COMPONENT (a piece of a
   media stream requiring a single transport address; a media stream may
   require multiple components, each of which has to work for the
   host candidate.  Outgoing packets sent from the host candidate will media
   stream as a whole to be translated by work).  Typically, (e.g., with RTP and RTCP)
   the NAT agents actually need to the server reflexive candidate.  Incoming
   packets sent establish connectivity for more than one
   flow.

   The network properties are likely to the server relexive candidate will be translated by very similar for each
   component (especially because RTP and RTCP are sent and received from
   the NAT same IP address).  It is usually possible to the host candidate and forwarded leverage information
   from one media component in order to determine the agent.  We call
   the host candidate associated best candidates
   for another.  ICE does this with a given server reflexive mechanism called "frozen
   candidates."

   Each candidate
   the BASE.

Note

   "Base" refers to the address you'd send from for a particular
   candidate.  Thus, as is associated with a degenerate case host property called its FOUNDATION.
   Two candidates also have a
   base, but it's the same as the host candidate.

   When there foundation when they are multiple NATs between "similar" - of
   the agent same type and obtained from the same interfaces and STUN server,
   the STUN request will create servers.
   Otherwise, their foundation is different.  A candidate pair has a binding on each NAT, but
   foundation too, which is just the concatenation of the foundations of
   its two candidates.  Initially, only the
   outermost server reflexive candidate will be discovered by the agent.
   If pairs with unique
   foundations are tested.  The other candidate pairs are marked
   "frozen".  When the agent is not behind connectivity checks for a NAT, then candidate pair succeed,
   the base candidate will be pairs with the same foundation are unfrozen.  This
   avoids repeated checking of components which are superficially more
   attractive but in fact are likely to fail.

   While we've described "frozen" here as a separate mechanism for
   expository purposes, in fact it is an integral part of ICE and the server reflexive candidate
   the ICE prioritization algorithm automatically ensures that the right
   candidates are unfrozen and checked in the server reflexive
   candidate right order.

2.5.  Security for Checks

   Because ICE is used to discover which addresses can be ignored.

   The final type of candidate used to send
   media between two agents, it is important to ensure that the process
   cannot be hijacked to send media to the wrong location.  Each STUN
   connectivity check is covered by a RELAYED candidate. message authentication code (MAC)
   computed using a key exchanged in the signalling channel.  This MAC
   provides message integrity and data origin authentication, thus
   stopping an attacker from forging or modifying connectivity check
   messages.  The STUN Relay
   Usage [12] allows MAC also aids in disambiguating ICE exchanges from
   forked calls when ICE is used with SIP [3].

2.6.  Concluding ICE

   ICE checks are performed in a STUN server specific sequence, so that high
   priority candidate pairs are checked first, followed by lower
   priority ones.  One way to act conclude ICE is to declare victory as soon
   as a check for each component of each media relay, forwarding
   traffic between L stream completes
   successfully.  Indeed, this is a reasonable algorithm, and R. In order to send traffic to L, R sends
   traffic to the media relay which forwards details
   for it are provided below.  However, it is possible that packet
   losses will cause a higher priority check to L and vice versa.
   The same thing happens in the other direction.

   Traffic from L take longer to R has its addresses rewritten twice: first by complete.
   In that case, allowing ICE to run a little longer might produce
   better results.  More fundamentally, however, the
   NAT and second prioritization
   defined by this specification may not yield "optimal" results.  As an
   example, if the STUN aim is to select low latency media paths, usage of a
   relay server.  Thus, the address that R
   knows about and the one is a hint that latencies may be higher, but it wants to send to is the one on the
   STUN relay server.  This address is the final kind of candidate,
   which we call nothing more
   than a RELAYED CANDIDATE.

2.2.  Connectivity Checks

   Once L has gathered all of its candidates, hint.  An actual RTT measurement could be made, and it orders them highest to
   lowest might
   demonstrate that a pair with lower priority and sends them to R over is actually better than
   one with higher priority.

   Consequently, ICE assigns one of the signalling channel.  The
   candidates are carried in attributes agents in the SDP offer.  When R
   receives the offer, it performs the same gathering process and
   responds with its own list role of candidates.  At the end of this
   process, each agent has a complete list of both its candidates and
   its peer's candidates
   CONTROLLING AGENT, and is ready to perform connectivity checks by
   pairing up the candidates to see which pair works.

   The basic principle other of the connectivity checks is simple:

   1.  Sort the CONTROLLED AGENT.  The
   controlled agent gets to nominate which candidate pairs will get used
   for media amongst the ones that are valid.  It can do this in priority order.

   2.  Send one of
   two ways - using REGULAR NOMINATION or AGGRESSIVE NOMINATION.

   With regular nomination, the controlling agent lets the checks on each
   continue until at least one valid candidate pair in priority order.

   3.  Acknowledge checks received from the other agent.

   A complete connectivity check for each media
   stream is found.  Then, it picks amongst those that are valid, and
   sends a single second STUN request on its NOMINATED candidate pair, but this
   time with a flag set to tell the peer that this pair has been
   nominated for use.  A This is a simple
   4-message handshake: shown in Figure 4.

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

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

   Figure 3

   As an optimization, as soon as R gets

   STUN request + flag         \  L's
             <- STUN response  /  check message he
   immediately sends his own check message to L on the same candidate
   pair.  This accelerates

                       Figure 4: Regular Nomination

   Once the process of finding a valid candidate, and
   is called a triggered check.

   At STUN transaction with the end of this handshake, flag completes, both L and R know sides cancel
   any future checks for that they can media stream.  ICE will now send
   (and receive) messages end-to-end in both directions.

2.3.  Sorting Candidates

   Because the algorithm above searches all candidate pairs, if a
   working media
   using this pair.  The pair exists it will eventually find it no matter what order an ICE agent is using for media is called
   the candidates are tried in. SELECTED PAIR.

   In order to produce faster (and better)
   results, aggressive nomination, the controlling agent puts the flag in
   every STUN request it sends.  This way, once the first check
   succeeds, ICE processing is complete for that media stream and the candidates are sorted in
   controlling agent doesn't have to send a specified order. second STUN request.  The
   algorithm
   selected pair will be the highest priority valid pair.  Aggressive
   nomination is described in Section 4.1.2 faster than regular nomination, but follows two general
   principles:

   o  Each agent gives its candidates a numeric priority which less
   flexibility.  Aggressive nomination is sent
      along with the candidate to shown in Figure 5.

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

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

                      Figure 5: Aggressive Nomination

   Once all of the peer

   o  The local and remote priorities media streams are combined so that each agent
      has completed, the same ordering controlling endpoint
   sends an updated offer if the candidates in the m and c lines for the candidate pairs.

   The second property
   media stream (called the DEFAULT CANDIDATES) don't match ICE's
   SELECTED CANDIDATES.

   Once ICE is important concluded, it can be restarted at any time for getting ICE to work when there
   are NATs in front one or all
   of A and B. Frequently, NATs will not allow packets
   in from a host until the agent behind the NAT has sent media streams by either agent.  This is done by sending an
   updated offer indicating a packet
   towards that host.  Consequently, restart.

2.7.  Lite Implementations

   In order for ICE checks to be used in each direction will
   not succeed until both sides have sent a check through their
   respective NATs.

   In general the priority algorithm is designed so that candidates of
   similar type get similar priorities and so that more direct routes
   are preferred over indirect ones.  Within those guidelines, however, call, both agents need to support
   it.  However, certain agents will always be connected to the public
   Internet and have a fair amount 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 discretion about how implementation called LITE
   (in contrast to tune their
   algorithms.

2.4.  Frozen Candidates

   The previous description only addresses the case where the agents
   wish to establish a single normal FULL implementation).  A lite
   implementation doesn't gather candidates; it includes only host
   candidates for any media component--i.e., stream.  When a single flow lite implementation connects
   with a single host-port quartet.  However, in many cases (in particular
   RTP full implementation, the full agent takes the role of the
   controlling agent, and RTCP) the lite agent takes on the controlled role.
   In addition, lite agents actually do not need to establish generate connectivity for
   more than one flow.

   The naive way to attack this problem would be to simply do
   independent ICE exchanges for each media component.  This is
   obviously inefficient because the network properties are likely to be
   very similar for each component (especially because RTP and RTCP are
   typically checks,
   run the state machines, or compute candidate pairs.  Additional
   guidance on adjacent ports).  Thus, it should be possible to
   leverage information from one media component when a lite implementation is appropriate, see the
   discussion in order Appendix A.  For an informational summary of ICE
   processing as seen by a lite agent, see [36].

   It is important to determine note that the best candidates for another.  ICE does lite implementation was added to
   this with specification to provide a mechanism
   called "frozen candidates."

   The basic principle behind frozen candidates is stepping stone to full
   implementation.  Even for devices that initially only are always connected to the candidates for
   public Internet, a single media component are tested. full implementation is preferable if achievable.

3.  Terminology

   The other
   media components key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
   "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
   document are marked "frozen".  When to be interpreted as described in RFC 2119 [1].

   Readers should be familiar with the connectivity checks terminology defined in the offer/
   answer model [4], STUN [12] and NAT Behavioral requirements for UDP
   [29]

   This specification makes use of the first component succeed, following additional terminology:

   Agent:  As defined in RFC 3264, an agent is the corresponding candidates for protocol
      implementation involved in the
   other components offer/answer exchange.  There are unfrozen and checked immediately.  This avoids
   repeated checking
      two agents involved in an offer/answer exchange.

   Peer:  From the perspective of components which are superficially more
   attractive but one of the agents in fact are likely to fail.

   While we've described "frozen" here as a separate mechanism for
   expository purposes, in fact it session, its
      peer is an integral part the other agent.  Specifically, from the perspective of ICE and
      the offerer, the ICE prioritization algorithm automatically ensures that peer is the right
   candidates are unfrozen answerer.  From the perspective of
      the answerer, the peer is the offerer.

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

   Candidate:  A transport address that is to be tested by ICE
      procedures in the right order.

2.5.  Security order to determine its suitability for Checks

   Because ICE usage for
      receipt of media.  Candidates also have properties - their type
      (server reflexive, relayed or host), priority, foundation, and
      base.

   Component:  A component is used to discover which addresses can be used to send a piece of a media between two agents, it is important stream requiring a
      single transport address; a media stream may require multiple
      components, each of which has to ensure that work for the process
   cannot be hijacked to send media stream as a
      whole to the wrong location.  Each STUN
   connectivity check is covered work.  For media streams based on RTP, there are two
      components per media stream - one for RTP, and one for RTCP.

   Host Candidate:  A candidate obtained by binding to a message authentication code (MAC)
   computed using a key exchanged in specific port
      from an interface on the signalling channel. host.  This MAC
   provides message integrity includes both physical
      interfaces and data origin authentication, thus
   stopping an attacker from forging or modifying connectivity check
   messages.  The MAC also aids in disambiguating ICE exchanges logical ones, such as ones obtained through Virtual
      Private Networks (VPNs) and Realm Specific IP (RSIP) [19] (which
      lives at the operating system level).

   Server Reflexive Candidate:  A candidate obtained by sending a STUN
      request from
   forked calls.

2.6.  Concluding ICE

   ICE checks are performed in a specific sequence, so that high
   priority pairs are checked first, followed by lower priority ones.
   One way to conclude ICE is host candidate to declare victory as soon as a check for
   each component of each media stream completes successfully.  Indeed,
   this STUN server, distinct from the
      peer.  The STUN server's address is configured or learned by the
      client prior to an offer/answer exchange.

   Peer Reflexive Candidate:  A candidate obtained by sending a reasonable algorithm, and details for it are provided
   below.  However, it is possible that packet losses will cause STUN
      request from a
   higher priority check to take longer host candidate to complete, and allowing ICE the STUN server running on a
      peer's candidate.

   Relayed Candidate:  A candidate obtained by sending a STUN Allocate
      request from a host candidate to
   run a little longer might produce better results.  More
   fundamentally, however, STUN server.  The relayed
      candidate is resident on the prioritization defined by this
   specification may not yield "optimal" results.  As an example, if STUN server, and the
   aim STUN server
      relays packets back towards the agent.

   Base:  The base of a server reflexive candidate is the host candidate
      from which it was derived.  A host candidate is also said to select low latency media paths, usage have
      a base, equal to that candidate itself.  Similarly, the base of a relay
      relayed candidate is a hint that latencies may candidate itself.

   Foundation:  An arbitrary string that is the same for two candidates
      that have the same type, base IP address, and STUN server.  If any
      of these are different then the foundation will be higher, but different.  Two
      candidate pairs with the same foundation pairs are likely to have
      similar network characteristics.  Foundations are used in the
      frozen algorithm.

   Local Candidate:  A candidate that an agent has obtained and included
      in an offer or answer it is nothing more than sent.

   Remote Candidate:  A candidate that an agent received in an offer or
      answer from its peer.

   Default Destination/Candidate:  The default destination for a hint.  An
   actual RTT measurement could
      component of a media stream is the transport address that would be made, and it might demonstrate
      used by an agent that a
   pair with lower priority is actually better than one with higher
   priority.

   Consequently, not ICE assigns one of aware.  For the agents RTP component,
      the default IP address is in the role c line of the
   controlling agent, SDP, and the other of port
      in the controlled agent.  The
   controlling agent runs a selection algorithm, through which m line.  For the RTCP component it can
   decide is in the rtcp attribute
      when to conclude ICE checks, present, and which pairs get selected.
   The one that is selected is called when not present, the IP address in the c line
      and 1 plus the port in the favored m line.  A default candidate pair.  When
   a controlling agent selects a pair for a particular
      component of a
   media stream, it generates a check is one whose transport address matches the default
      destination for that pair component.

   Candidate Pair:  A pairing containing a local candidate and includes a flag
   in remote
      candidate.

   Check, Connectivity Check, STUN Check:  A STUN Binding Request
      transaction for the purposes of verifying connectivity.  A check indicating that
      is sent from the pair has been selected.  If local candidate to the
   controlled agent has already performed in remote candidate of a check in the reverse
   direction
      candidate pair.

   Check List:  An ordered set of candidate pairs that succeeded, the controlled an agent considers ICE
   processing will use
      to be concluded for generate checks.

   Periodic Check:  A connectivity check generated by an agent as a
      consequence of a timer that component.  Once there is fires periodically, instructing it to
      send a
   selected pair for each component check.

   Triggered Check:  A connectivity check generated as a consequence of
      the receipt of a media stream, connectivity check from the ICE checks peer.

   Valid List:  An ordered set of candidate pairs for that a media stream are considered to be completed.  At
      that have been validated by a successful STUN transaction.

   Full:  An ICE implementation that performs the complete set of
      functionality defined by this point,
   further checks stop specification.

   Lite:  An ICE implementation that omits certain functions,
      implementing only as much as is necessary for a peer
      implementation that media stream - ICE is considered full to be
   done.  Consequently, media gain the benefits of ICE.  Lite
      implementations can flow in each direction for that
   stream, only act as shown in Figure 4.  Once all of the media streams are
   completed, controlled agent in a session,
      and do not gather candidates.

   Controlling Agent:  The STUN agent which is responsible for selecting
      the controlling endpoint sends final choice of candidate pairs and signaling them through
      STUN and an updated offer offer, if needed.  In any session, one agent
      is always controlling.  The other is the
   currently in-use candidates don't match the ones it selected.

   L                        R
   -                        -
   STUN request + flag ->      \  L's
             <- controlled agent.

   Controlled Agent:  A STUN response  /  check

   -> RTP Data
                  <- RTP Data

   Figure 4
   Once ICE is concluded, it can be restarted at any time agent which waits for one or all
   of the controlling agent
      to select the final choice of candidate pairs.

   Regular Nomination:  The process of picking a valid candidate pair
      for media streams traffic by each agent.  This is done validating the pair with one STUN request,
      and then picking it by sending an
   updated offer a second STUN request with a flag
      indicating its nomination.

   Aggressive Nomination:  The process of picking a restart.

2.7.  Lite Implementations

   In order valid candidate pair
      for ICE to be used in media traffic by including a call, both agents need to support
   it.  However, certain agents, such as those flag in gateways to every STUN request, such
      that the PSTN,
   media servers, conferencing servers, and voicemail servers, are known first one to not be behind produce a NAT or firewall.  To make it easier valid candidate pair is used for these
   devices to support ICE, ICE defines
      media.

   Nominated:  If a special type of implementation
   called "lite" (in contrast to the normal "full" implementation).  A
   lite implementation doesn't gather candidates; it includes only valid candidate pair has its
   host nominated flag set, it
      means that it may be selected by ICE for sending and receiving
      media.

   Selected Pair, Selected Candidate:  The candidate pair selected by
      ICE for any sending and receiving media stream.  When a lite implementation
   connects with a full implementation, the full agent takes is called the role selected pair,
      and each of its candidates is called the controlling agent, and selected candidate.

4.  Sending the lite Initial Offer

   In order to send the initial offer in an offer/answer exchange, an
   agent takes on must (1) gather candidates, (2) prioritize them, (3) choose
   default candidates, and then (4) formulate and send the controlled
   role.  In addition, SDP.  The
   first of these four steps differ for full and lite agents implementations.

4.1.  Full Implementation Requirements

4.1.1.  Gathering Candidates

   An agent gathers candidates when it believes that communications is
   imminent.  An offerer can do not need to generate connectivity
   checks, run the state machines, this based on a user interface cue, or compute candidate pairs.  For
   based on an
   informational summary of ICE processing as seen by explicit request to initiate a lite agent, see
   [33].

3.  Terminology

   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
   "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", session.  Every candidate
   is a transport address.  It also has a type and "OPTIONAL" in this
   document a base.  Three types
   are to be interpreted as described in RFC 2119 [1].

   This defined and gathered by this specification makes use - host candidates,
   server reflexive candidates, and relayed candidates.  The server
   reflexive and relayed candidates are gathered using STUN's Binding
   Discovery and Relay Usages.  The base of a candidate is the following terminology:

   Agent: As defined in RFC 3264, candidate
   that an agent must send from when using that candidate.

4.1.1.1.  Host Candidates

   The first step is the protocol
      implementation involved in the offer/answer exchange.  There to gather host candidates.  Host candidates are
      two agents involved in
   obtained by binding to ports (typically ephemeral) on an offer/answer exchange.

   Peer: From interface
   (physical or virtual, including VPN interfaces) on the perspective of one of host.  The
   process for gathering host candidates depends on the agents in a session, its
      peer is transport
   protocol.  Procedures are specified here for UDP.

   For each UDP media stream the other agent.  Specifically, from agent wishes to use, the perspective agent SHOULD
   obtain a candidate for each component of the offerer, the peer is the answerer.  From media stream on each
   interface that the perspective of host has.  It obtains each candidate by binding to
   a UDP port on the answerer, specific interface.  A host candidate (and indeed
   every candidate) is always associated with a specific component for
   which it is a candidate.  Each component has an ID assigned to it,
   called the peer is component ID.  For RTP-based media streams, the offerer.

   Transport Address: The combination RTP itself
   has a component ID of 1, and RTCP a component ID of 2.  If an IP address agent
   is using RTCP it MUST obtain a candidate for it.  If an agent is
   using both RTP and port.

   Candidate: A transport address that RTCP, it would end up with 2*K host candidates if
   an agent has K interfaces.

   The base for each host candidate is set to be tested by ICE procedures
      in order the candidate itself.

4.1.1.2.  Server Reflexive and Relayed Candidates

   Agents SHOULD obtain relayed candidates and MUST obtain server
   reflexive candidates.  The requirement to determine its suitability for usage obtain relayed candidates
   is at SHOULD strength to allow for receipt provider variation.  Use of
      media.

   Component: A component relays
   is a single transport address that expensive, and when ICE is used to
      support a media stream.  For media streams based on RTP, there being used, relays will only be
   required when both endpoints are
      two components per media stream - one for RTP, behind NATs that perform address and one for RTCP.

   Host Candidate: A candidate obtained by binding to a specific
   port
      from an interface on the host.  This includes both physical
      interfaces dependent mapping.  Consequently, some deployments might
   consider this use case to be marginal, and logical ones, such as ones obtained through Virtual
      Private Networks (VPNs) elect not to use relays.
   If they are not used, it is RECOMMENDED that it be implemented and Realm Specific IP (RSIP) [18] (which
      lives at
   just disabled through configuration, so that it can re-enabled
   through configuration if conditions change in the operating system level).

   Server Reflexive Candidate: A candidate obtained by sending a STUN
      request from a future.

   The agent next pairs each host candidate to a STUN server, distinct from with the
      peer, whose address STUN server with
   which it is configured or learned by the client prior
      to an offer/answer exchange.

   Peer Reflexive Candidate: A candidate obtained has discovered by sending some means.  This
   specification only considers usage of a single STUN
      request from a host candidate to server.  At that
   very instance, and then every Ta milliseconds thereafter, the STUN server running on a
      peer's candidate.

   Relayed Candidate: A candidate obtained by sending agent
   chooses another such pair (the order is inconsequential), and sends a
   STUN Allocate request from a host candidate to a STUN server.  The relayed
      candidate is resident on the STUN server, and the STUN server
      relays packets back towards the agent.

   Translation: The translation of a relayed candidate is the transport
      address from that host candidate.  If the relay will forward a packet to, when one agent is
      received at the relayed candidate.  For
   using both relayed candidates learned
      through the and server reflexive candidates, this request MUST
   be a STUN Allocate request, request using the translation of relay usage [13].  If the relayed
      candidate agent
   is the server reflexive candidate returned by the
      Allocate response.

   Base: The base of a using only server reflexive candidate is candidates, the host candidate
      from which it was derived.  A host candidate is also said to have request MUST be a base, equal to that candidate itself.  Similarly, STUN
   Binding request using the base binding discovery usage [12].

   The value of Ta SHOULD be configurable, and SHOULD have a
      relayed candidate is that candidate itself.

   Foundation: Each candidate has a foundation, which is an identifier
      that is distinct default of
   20ms (see Appendix B.1 for two candidates a discussion on the selection of this
   value).  Note that have different types,
      different interface IP addresses for their base, this pacing applies only to starting STUN
   transactions with source and different IP destination transport addresses (i.e.,
   the host candidate and STUN server respectively) for their which a STUN servers.  Two candidates have
   transaction has not previously been sent.  Consequently,
   retransmissions of a STUN request are governed entirely by the same
      foundation when they
   retransmission rules defined in [12].  Similarly, retries of a
   request due to recoverable errors (such as an authentication
   challenge) happen immediately and are not paced by timer Ta.  Because
   of this pacing, it will take a certain amount of time to obtain all
   of the same type, their bases have the
      same IP address, and, for server reflexive or and relayed candidates,
      they come from the same STUN server.  Foundations are used to
      correlate candidates, so that when one candidate is found to candidates.  Implementations
   should be
      valid, candidates sharing aware of the same foundation can be tested next,
      as they are likely time required to also be valid.

   Local Candidate: A candidate that an agent has obtained do this, and included
      in an offer or answer it sent.

   Remote Candidate: A candidate that an agent received in an offer or
      answer from its peer.

   In-Use Candidate: A candidate is in-use when it appears in if the m/c-
      line
   application requires a time budget, limit the number of an active media stream.

   Candidate Pair: candidates
   which are gathered.

   The agent will receive a STUN Binding or Allocate response.  A pairing containing
   successful Allocate Response will provide the agent with a local server
   reflexive candidate (obtained from the mapped address) and a remote
      candidate.

   Check: A relayed
   candidate pair where in the local candidate RELAY-ADDRESS attribute.  If the Allocate request is a transport
      address from which an
   rejected because the server lacks resources to fulfill it, the agent can
   SHOULD instead send a STUN connectivity check.

   Check List: An ordered set of STUN checks that an agent is Binding Request to
      generate towards obtain a peer.

   Periodic Check: server reflexive
   candidate.  A connectivity check generated by an Binding Response will provide the agent as a
      consequence of a timer that fires periodically, instructing it to
      send a check.

   Triggered Check: A connectivity check generated as with only a consequence of
   server reflexive candidate (also obtained from the receipt mapped address).
   The base of a connectivity check the server reflexive candidate is the host candidate from
   which the peer.

   Valid List: An ordered set Allocate or Binding request was sent.  The base of candidate pairs for a media stream
   relayed candidate is that
      have been validated by candidate itself.  If a successful STUN transaction.

   Full: An ICE implementation that performs relayed candidate
   is identical to a host candidate (which can happen in rare cases),
   the complete set relayed candidate MUST be discarded.  Proper operation of
      functionality defined by this specification.

   Lite: An ICE implementation that omits certain functions,
      implementing only as much as is necessary for a peer
      implementation that
   depends on each base being unique.

4.1.1.3.  Eliminating Redundant Candidates

   Next, the agent eliminates redundant candidates.  A candidate is full to gain
   redundant if its transport address equals another candidate, and its
   base equals the benefits base of ICE.  Lite
      implementations that other candidate.  Note that two
   candidates can only act as have the controlled agent in a session, same transport address yet have different
   bases, and do these would not gather candidates.

   Controlling Agent: The STUN be considered redundant.

4.1.1.4.  Computing Foundations

   Finally, the agent which assigns each candidate a foundation.  The
   foundation is responsible for selecting an identifier, scoped within a session.  Two candidates
   MUST have the final choice same foundation ID when all of candidate pairs the following are true:

   o  they are of the same type (host, relayed, server reflexive, peer
      reflexive or relayed)

   o  their bases have the same IP address (the ports can be different)
   o  for reflexive and signaling relayed candidates, the STUN servers used to
      obtain them through have the same IP address.

   Similarly, two candidates MUST have different foundations if their
   types are different, their bases have different IP addresses, or the
   STUN servers used to obtain them have different IP addresses.

4.1.1.5.  Keeping Candidates Alive

   Once server reflexive and an updated offer, if needed.  In any session, one agent
      is always controlling. relayed candidates are allocated, they MUST
   be kept alive until ICE processing has completed.  For server
   reflexive candidates learned through the Binding Discovery usage,
   this MUST be another Binding Request from the Binding Discovery
   usage.  For relayed candidates learned through the Relay Usage, this
   MUST be a new Allocate request.  The other is Allocate request will also
   refresh the controlled agent.

   Controlled Agent: A STUN agent which waits for server reflexive candidate.

4.1.2.  Prioritizing Candidates

   The prioritization process results in the controlling agent assignment of a priority to
   each candidate.  Each candidate for a media stream MUST have a unique
   priority that MUST be a positive integer between 1 and (2**32 - 1).
   This priority will be used by ICE to select determine the final choice order of candidate pairs.

4.  Sending the Initial Offer

   In order to send
   connectivity checks and the initial offer relative preference for candidates.

   An agent SHOULD compute this priority using the formula in an offer/answer exchange,
   Section 4.1.2.1 and choose its parameters using the guidelines in
   Section 4.1.2.2.  If an agent must gather candidates, priorize them, choose ones for
   inclusion elects to use a different formula, ICE
   will take longer to converge since both agents will not be
   coordinated in their checks.

4.1.2.1.  Recommended Formula

   When using the m/c-line, and then formulate and send formula, an agent computes the SDP.  The
   first of these three steps differ priority by determining
   a preference for full each type of candidate (server reflexive, peer
   reflexive, relayed and lite implementations.

4.1.  Full Implementation Requirements

4.1.1.  Gathering Candidates

   An agent gathers candidates host), and, when it believes that communications the agent is
   imminent.  An offerer can do this based on multihomed,
   choosing a user interface cue, or
   based on an explicit request preference for its interfaces.  These two preferences are
   then combined to initiate compute the priority for a session.  Every candidate candidate.  That priority
   is a transport address.  It also has a computed using the following formula:

   priority = (2^24)*(type preference) +
              (2^8)*(local preference) +
              (2^0)*(256 - component ID)

   The type preference MUST be an integer from 0 to 126 inclusive, and a base.  Three
   represents the preference for the type of the candidate (where the
   types are defined and gathered by this specification - host candidates, local, server reflexive, peer reflexive candidates, and relayed candidates.  The base of relayed).  A
   126 is the highest preference, and a
   candidate 0 is the candidate that an agent must send from when using lowest.  Setting the
   value to a 0 means that candidate. candidates of this type will only be used as
   a last resort.  The first step is to gather host candidates.  Host type preference MUST be identical for all
   candidates are
   obtained by binding to ports (typically ephemeral) on an interface
   (physical or virtual, including VPN interfaces) on of the host. same type and MUST be different for candidates of
   different types.  The
   process type preference for gathering host peer reflexive candidates depends
   MUST be higher than that of server reflexive candidates.  Note that
   candidates gathered based on the transport
   protocol.  Procedures procedures of Section 4.1.1 will
   never be peer reflexive candidates; candidates of these type are specified here for UDP.

   For each UDP media stream
   learned from the agent wishes STUN connectivity checks performed by ICE.

   The local preference MUST be an integer from 0 to use, the agent SHOULD
   obtain 65535 inclusive.
   It represents a candidate preference for each component of the media stream on each particular interface that from which
   the host has.  It obtains each candidate by binding to was obtained, in cases where an agent is multihomed.
   65535 represents the highest preference, and a UDP port on zero, the specific interface.  A host candidate (and indeed
   every candidate) lowest.
   When there is always associated with only a specific single interface, this value SHOULD be set to
   65535.  More generally, if there are multiple candidates for a
   particular component for
   which it is a candidate.  Each particular media stream which have the
   same type, the local preference MUST be unique for each one.  In this
   specification, this only happens for multi-homed hosts.

   The component has an ID assigned to it,
   called the component ID.  For RTP-based media streams, is the RTP itself
   has a component ID for the candidate, and MUST be
   between 1 and 256 inclusive.

4.1.2.2.  Guidelines for Choosing Type and Local Preferences

   One criteria for selection of 1, the type and RTCP a component ID local preference values is
   the use of 2.  If an agent
   is using RTCP it MUST obtain intermediary, such as a candidate for it.  If media relay.  With an agent is
   using both RTP and RTCP, it would end up with 2*K host candidates
   intermediary, if
   an agent has K interfaces.

   The base for each host candidate media is set sent to that candidate, it will first
   transit the candidate itself.

   Agents SHOULD obtain relayed candidates and MUST obtain server
   reflexive candidates.  The requirement to obtain relayed intermediary before being received.  Relayed candidates
   is at SHOULD strength to allow for provider variation.  If they
   are
   not used, it is RECOMMENDED one type of candidate that it be implemented and just disabled involves an intermediary.  Another are
   host candidates obtained from a VPN interface.  When media is
   transited through configuration, so that an intermediary, it can re-enabled through
   configuration if conditions change in increase the future.

   The agent next pairs each host candidate with latency
   between transmission and reception.  It can increase the STUN server with
   which it is configured or has discovered by some means.  This
   specification only considers usage packet
   losses, because of a single STUN server.  Every Ta
   seconds, the agent chooses another such pair (the order is
   inconsequential), additional router hops that may be taken.  It
   may increase the cost of providing service, since media will be
   routed in and sends right back out of a STUN request to media relay run by the server from that
   host candidate. provider.
   If these concerns are important, the agent is using both type preference for relayed and
   candidates SHOULD be lower than host candidates.  The RECOMMENDED
   values are 126 for host candidates, 100 for server reflexive
   candidates, this request MUST be a STUN Allocate request
   from the relay usage [12].  If the agent is using only server 110 for peer reflexive candidates, and 0 for relayed
   candidates.  Furthermore, if an agent is multi-homed and has multiple
   interfaces, the request MUST be local preference for host candidates from a STUN Binding request
   using the binding discovery usage [11].

   The value of Ta SHOULD be configurable, and VPN
   interface SHOULD have a default priority of
   20ms.  Note that this pacing applies only to starting STUN
   transactions 0.

   Another criteria for selection of preferences is IP address family.
   ICE works with source both IPv4 and destination transport addresses (i.e., IPv6.  It therefore provides a
   transition mechanism that allows dual-stack hosts to prefer
   connectivity over IPv6, but to fall back to IPv4 in case the host candidate and STUN server respectively) v6
   networks are disconnected (due, for which a STUN
   transaction has not previously been sent.  Consequently,
   retransmissions of example, to a STUN request are governed entirely by the
   retransmission rules defined failure in [11].  Similarly, retries of a
   request due to recoverable errors (such as an authentication
   challenge) happen immediately 6to4
   relay) [24].  It can also help with hosts that have both a native
   IPv6 address and are not paced a 6to4 address.  In such a case, higher local
   preferences could be assigned to the v6 interface, followed by timer Ta.  Because
   of this pacing, it will take the
   6to4 interfaces, followed by the v4 interfaces.  This allows a certain amount of time site
   to obtain all
   of the server reflexive and relayed candidates.  Implementations
   should be aware of the time required begin using native v6 addresses immediately, yet still
   fallback to 6to4 addresses when communicating with agents in other
   sites that do this, and if the
   application requires not yet have native v6 connectivity.

   Another criteria for selecting preferences is security.  If a time budget, limit the amount of candidates
   which are gathered.

   An Allocate Response will provide the agent with user is
   a server reflexive
   candidate (obtained from the mapped address) telecommuter, and therefore connected to their corporate network
   and a relayed candidate local home network, they may prefer their voice traffic to be
   routed over the VPN in order to keep it on the RELAY-ADDRESS attribute.  A Binding Response will provide corporate network when
   communicating within the
   agent with only a server reflexive candidate (also obtained from enterprise, but use the
   mapped address).  The base local network when
   communicating with users outside of the server reflexive candidate is the
   host candidate from which the Allocate or Binding request was sent.
   The base of enterprise.  In such a relayed candidate case,
   a VPN interface would have a higher local preference than any other
   interface.

   Another criteria for selecting preferences is topological awareness.
   This is most useful for candidates that candidate itself.  A server
   reflexive candidate obtained from make use of relays.  In those
   cases, if an Allocate response is the called
   the "translation" agent has preconfigured or dynamically discovered
   knowledge of the relayed candidate obtained from topological proximity of the same
   response.  The agent will need relays to remember the translation for the
   relayed candidate, since itself, it is placed into the SDP.  If a relayed
   candidate is identical to a host candidate (which
   can happen in rare
   cases), the relayed candidate MUST be discarded.  Proper operation of
   ICE depends on each base being unique.

   Next, the agent eliminates redundant candidates. use that to assign higher local preferences to candidates
   obtained from closer relays.

4.1.3.  Choosing Default Candidates

   A candidate is
   redundant said to be default if its transport address equals another candidate, and its
   base equals the base of that other candidate.  Note that two
   candidates can have the same transport address yet have different
   bases, and these it would not be considered redundant.

   Finally, the agent assigns each candidate a foundation.  The
   foundation is an identifier, scoped within a session.  Two candidates
   MUST have the same foundation ID when they are target of media
   from a non-ICE peer; that target being called the same type
   (host, relayed, server reflexive, peer reflexive or relayed), their
   bases have the same IP address (the ports can be different), and, for
   reflexive and relayed candidates, the STUN servers used to obtain
   them have DEFAULT
   DESTINATION.  If the same IP address.  Similarly, two default candidates MUST have
   different foundations if their types are different, their bases have
   different IP addresses, or not selected by the STUN servers used to obtain them have
   different IP addresses.

4.1.2.  Prioritizing Candidates

   The prioritization process results ICE
   algorithm when communicating with an ICE-aware peer, an updated
   offer/answer will be required after ICE processing completes in the assignment of a priority order
   to
   each candidate.  Each candidate "correct" the SDP so that the default destination for a media stream MUST have a unique
   priority.  An agent SHOULD compute
   matches the priority candidates selected by determining a
   preference for each type of candidate (server reflexive, peer
   reflexive, relayed and host), and, when ICE.  If ICE happens to select the agent
   default candidates, no updated offer/answer is multihomed,
   choosing required.

   An agent MUST choose a preference for its interfaces.  These two preferences are
   then combined to compute the priority set of candidates, one for a candidate.  That priority
   SHOULD be computed using the following formula:

   priority = (2^24)*(type preference) +
              (2^8)*(local preference) +
              (2^0)*(256 - each component ID)

   The type preference MUST be an integer from 0 to 126 inclusive, and
   represents the preference for the type of the candidate (where the
   types are local, server reflexive, peer reflexive and relayed).
   each in-use media stream, to be default.  A
   126 media stream is the highest preference, and in-use if
   it does not have a 0 port of zero (which is the lowest.  Setting the
   value used in RFC 3264 to reject
   a 0 means that candidates of this type will only be used media stream).  Consequently, a media stream is in-use even if it
   is marked as a=inactive [10] or has a last resort.  The type preference MUST be identical for all
   candidates bandwidth value of the same type and MUST be different for zero.

   It is RECOMMENDED that default candidates be chosen based on the
   likelihood of
   different types.  The type preference for peer reflexive those candidates
   MUST be higher than to work with the peer that is being
   contacted.  It is RECOMMENDED that of the default candidates are the
   relayed candidates (if relayed candidates are available), server
   reflexive candidates.  Note that candidates gathered based on the procedures of Section 4.1.1 will
   never be peer (if server reflexive candidates; candidates of these type are
   learned from available),
   and finally host candidates.

4.2.  Lite Implementation

   For each media stream, the STUN connectivity checks performed by ICE.  The agent allocates a single candidate for
   each component ID is of the component ID media stream from one of its interfaces.  If an
   agent has multiple interfaces, it MUST choose one for each component
   of a particular media stream.  With the candidate, and MUST be
   between 1 and 256 inclusive.  The local preference MUST lite implementation, ICE
   cannot be used to dynamically choose amongst candidates.  Each
   component has an integer
   from 0 ID assigned to 65535 inclusive.  It represents a preference for it, called the
   particular interface from which component ID.  For
   RTP-based media streams the candidate was obtained, in cases
   where RTP itself has a component ID of 1, and
   RTCP a component ID of 2.  If an agent is multihomed. 65535 represents the highest
   preference, and using RTCP it MUST obtain a zero, the lowest.  When there
   candidate for it.

   Each candidate is only assigned a single
   interface, this value SHOULD foundation.  The foundation MUST be set to 65535.  Generally speaking, if
   there are multiple candidates for a particular component
   different for a
   particular media stream which have the same type, the local
   preference two candidates from different interfaces, and MUST be unique
   the same otherwise.  A simple integer that increments for each one.
   interface will suffice.  In this specification, this
   only happens for multi-homed hosts.

   These rules guarantee that there is addition, each candidate MUST be assigned
   a unique priority amongst all candidates for each
   candidate. the same media stream.
   This priority will SHOULD be used by ICE equal to determine the order
   of the connectivity checks and the relative preference for
   candidates.  Consequently, what follows are some guidelines for
   selection of these values.

   One criteria for selection of the type and local preference values is 2^24*(126) + 2^8*(65535) + 256 minus
   the use of an intermediary.  That is, if media component ID, which is sent to that
   candidate, will 2130706432 minus the media first transit an intermediate server before
   being received?  Relayed candidates are clearly one type of
   candidates that involve component ID.

   If an intermediary.  Another are host agent has included two candidates
   obtained from for a VPN interface.  When media is transited through an
   intermediary, it can increase the latency between transmission and
   reception.  It can increase the packet losses, because of component, the
   additional router hops that may v4
   candidate SHOULD be taken.  It may increase selected as the cost
   of providing service, since media will be routed in and right back
   out default.  Since a lite
   implementation has a single candidate for a component, each of an intermediary run by the provider.  If these concerns are
   important, the type preference for relayed
   candidates can is considered to be set
   lower than default.

4.3.  Encoding the type preference for reflexive and host candidates.
   Indeed, it is RECOMMENDED that in this case, host candidates have a
   type preference of 126, server reflexive candidates have a type
   preference SDP

   The process of 100, peer reflexive have a type prefence encoding the SDP is identical between full and lite
   implementations.

   The agent will include an m-line for each media stream it wishes to
   use.  The ordering of 110, media streams in the SDP is relevant for ICE.
   ICE will perform its connectivity checks for the first m-line first,
   and
   relayed candidates have a type preference of zero.  Furthermore, consequently media will be able to flow for that stream first.
   Agents SHOULD place their most important media stream, if
   an agent there is multi-homed and has multiple interfaces,
   one, first in the local
   preference for host candidates from SDP.

   There will be a VPN interface SHOULD have candidate attribute for each candidate for a
   priority of 0.

   Another criteria
   particular media stream.  Section 15 provides detailed rules for selection of preferences is
   constructing this attribute.  The attribute carries the IP address family.
   ICE works with both IPv4 address,
   port and IPv6.  It therefore provides a
   transition mechanism that allows dual-stack hosts transport protocol for the candidate, in addition to prefer
   connectivity over IPv6, but its
   properties that need to fall back be signaled to IPv4 in case the v6
   networks are disconnected (due, peer for example, ICE to a failure in a 6to4
   relay) [23].  It can work: the
   priority, foundation, and component ID.  The candidate attribute also help with hosts
   carries information about the candidate that have both a native
   IPv6 address is useful for
   diagnostics and other functions: its type and related transport
   addresses.

   STUN connectivity checks between agents make use of a 6to4 address.  In such short term
   credential that is exchanged in the offer/answer process.  The
   username part of this credential is formed by concatenating a case, lower local
   preferences could be assigned
   username fragment from each agent, separated by a colon.  Each agent
   also provides a password, used to compute the v6 interface, followed by the
   6to4 interfaces, followed by message integrity for
   requests it receives.  The username fragment and password are
   exchanged in the v4 interfaces.  This allows a site ice-ufrag and ice-pwd attributes, respectively.  In
   addition to obtain providing security, the username provides disambiguation
   and begin using native v6 addresses immediately, yet still
   fallback correlation of checks to 6to4 addresses when communicating with agents in other
   sites that do not yet have native v6 connectivity.

   Another criteria media streams.  See Appendix B.4 for selecting preferences is security.
   motivation.

   If an agent is a user lite implementation, it MUST include an "a=ice-lite"
   session level attribute in its SDP.  If an agent is a telecommuter, and therefore connected full
   implementation, it MUST NOT include this attribute.

   The default candidates are added to their corporate network the SDP as the default
   destination for media.  For streams based on RTP, this is done by
   placing the IP address and a local home network, they may prefer their voice traffic to be
   routed over port of the VPN in order to keep RTP candidate into the c and m
   lines, respectively.  If the agent is utilizing RTCP, it on MUST encode
   the corporate network when
   communicating within RTCP candidate using the enterprise, but use a=rtcp attribute as defined in RFC 3605
   [2].  If RTCP is not in use, the local network agent MUST signal that using b=RS:0
   and b=RR:0 as defined in RFC 3556 [5].

   The transport addresses that will be the default destination for
   media when communicating with users outside non-ICE peers MUST also be present as
   candidates in one or more a=candidate lines.

   ICE provides for extensibility by allowing an offer or answer to
   contain a series of tokens which identify the enterprise.  In such a case,
   a VPN interface would have a higher local preference than any other
   interface.

   Another criteria ICE extensions used by
   that agent.  If an agent supports an ICE extension, it MUST include
   the token defined for selecting preferences is topological awareness.
   This that extension in the ice-options attribute.

   The following is most useful for candidates an example SDP message that make use of relays.  In those
   cases, if includes ICE attributes
   (lines folded for readability):

       v=0
       o=jdoe 2890844526 2890842807 IN IP4 10.0.1.1
       s=
       c=IN IP4 192.0.2.3
       t=0 0
       a=ice-pwd:asd88fgpdd777uzjYhagZg
       a=ice-ufrag:8hhY
       m=audio 45664 RTP/AVP 0
       a=rtpmap:0 PCMU/8000
       a=candidate:1 1 UDP 2130706178 10.0.1.1 8998 typ local
       a=candidate:2 1 UDP 1694498562 192.0.2.3 45664 typ srflx raddr
   10.0.1.1 rport 8998
   Once an agent has preconfigured sent its offer or dynamically discovered
   knowledge of the topological proximity of the relays to itself, it
   can use sent its answer, that agent MUST
   be prepared to assign higher local preferences receive both STUN and media packets on each candidate.
   As discussed in Section 11.1, media packets can be sent to candidates
   obtained from closer relays.

4.1.3.  Choosing In-Use Candidates

   A a
   candidate is said prior to be "in-use" if it appears in its appearance as the m/c-line of default destination for
   media in an offer or answer.

5.  Receiving the Initial Offer

   When communicating with an ICE peer, being in-
   use implies that, should these candidates be selected by agent receives an initial offer, it will check if the offeror
   supports ICE, determine its own role, gather candidates, prioritize
   them, choose default candidates, encode and send an answer, and for
   full implementations, form the check lists and begin connectivity
   checks.

5.1.  Verifying ICE
   algorithm, a re-INVITE Support

   The answerer will not be required after ICE processing
   completes.  When communicating proceed with a peer that is not ICE-aware, the
   in-use candidates will be used exclusively for the exchange of media,
   as ICE procedures defined in normal offer/answer procedures.

   An agent MUST choose a set of candidates, one for each component of this
   specification if the following are all true:

   o  For each active media stream, to be in-use.  A the default destination for at least one
      component of the media stream is active if
   it does not contain the a=inactive SDP appears in a candidate attribute.

   It is RECOMMENDED that in-use candidates be chosen based on
      For example, in the
   likelihood case of those candidates to work with RTP, the peer that is being
   contacted.  Unfortunately, it is difficult to ascertain which
   candidates that might be.  As an example, consider IP address and port in the c
      and m line, respectively, appears in a user within an
   enterprise.  To reach non-ICE capable agents within candidate attribute, or the enterprise,
   host candidates have to be used, since
      value in the enterprise policies may
   prevent communication between elements using rtcp attribute appears in a relay on the public
   network.  However, when communicating to peers outside of candidate attribute.

   o  The offer omitted an a=ice-lite attribute or the
   enterprise, relayed candidates from answerer is a publically accessible STUN
   server
      full implementation.

   If any of these conditions are needed.

   Indeed, not met, the agent MUST process the
   SDP based on normal RFC 3264 procedures, without using any of the difficulty ICE
   mechanisms described in picking just one transport address that
   will work is the whole problem that motivated remainder of this specification with the
   following exceptions:

   1.  The agent MUST follow the development rules of this
   specification in Section 10, which describe
       keepalive procedures for all agents.

   2.  If the first place.  As such, it agent is RECOMMENDED not proceeding with ICE because there were
       a=candidate attributes, but none that
   agents select relayed candidates to be in-use.

4.2.  Lite Implementation

   For each media stream, matched the agent allocates a single candidate for
   each component default
       destination of the media stream from one of its interfaces.  If an stream, the agent is multi-homed, it MUST choose one of its interfaces for a
   particular media stream; ICE cannot be used to dynamically choose
   one.  Each component has include an ID assigned to it, called the component
   ID. a=ice-
       mismatch attribute in its answer.

5.2.  Determining Role

   For RTP-based media streams, the RTP itself has each session, each agent takes on a component ID
   of 1, role.  There are two roles -
   controlling, and RTCP a component ID of 2.  If an controlled.  The controlling agent is using RTCP it
   MUST obtain a candidate responsible
   for it.

   Each nominating the candidate is assigned a foundation.  The foundation MUST pairs that can be
   different used by ICE for two candidates from different interfaces (which can
   occur if each
   media streams are on different interfaces), stream, and MUST be the
   same otherwise.  A simple integer that increments for each interface
   will suffice.  In addition, each generating the updated offer based on ICE's
   selection, when needed.  The controlled agent is told which candidate MUST be assigned a unique
   priority amongst all candidates
   pairs to use for the same each media stream.  This
   priority SHOULD be equal to 2^24*(126) + 2^8*(65535) + 256 minus stream, and does not generate an updated
   offer to signal this information.

   If one of the
   component ID, which agents is 2130706432 minus a lite implementation, it MUST assume the component ID.  Each of
   these candidates is also considered to be "in-use", since they
   controlled role, and its peer (which will be included in full; if it was lite,
   ICE would have aborted) MUST assume the controlling role.  If the
   agent and its peer are both full implementations, the agent which
   generated the m/c-line of an offer or answer.

4.3.  Encoding which started the SDP ICE processing takes on the
   controlling role, and the other takes the controlled role.

   Based on this definition, once roles are determined for a session,
   they persist unless ICE is restarted.  A ICE restart (Section 9.1
   causes a new selection of roles.

5.3.  Gathering Candidates

   The process of encoding for gathering candidates at the SDP answerer is identical between full and lite
   implementations.

   The agent includes a single a=candidate media level attribute in to
   the
   SDP for each candidate process for that media stream.  The a=candidate
   attribute contains the IP address, port offerer as described in Section 4.1.1 for full
   implementations and transport protocol Section 4.2 for lite implementations.  It is
   RECOMMENDED that candidate.  A Fully Qualified Domain Name (FQDN) for a host MAY
   be used in place this process begin immediately on receipt of a unicast address.  In that case, the
   offer, prior to alerting the user.  Such gathering MAY begin when receiving an offer or answer containing an FQDN in an a=candidate attribute,
   agent starts.

5.4.  Prioritizing Candidates

   The process for prioritizing candidates at the FQDN answerer is looked up in identical
   to the DNS using an A or AAAA record, process followed by the offerer, as described in Section 4.1.2
   for full implementations and the
   resulting IP address is used Section 4.2 for the remainder of ICE processing. lite implementations.

5.5.  Choosing Default Candidates

   The candidate attribute also includes the component ID for that
   candidate.  For media streams based on RTP, candidates process for the actual
   RTP media MUST have a component ID of 1, and selecting default candidates for RTCP MUST
   have a component ID of 2.  Other types of media streams which require
   multiple components MUST develop specifications which define at the
   mapping of components answerer is
   identical to component IDs, and these component IDs MUST
   be between 1 and 256.

   The candidate attribute also includes the priority process followed by the offerer, as described in
   Section 4.1.3 for full implementations and Section 4.2 for lite
   implementations.

5.6.  Encoding the
   foundation. SDP

   The agent SHOULD include a type process for each candidate encoding the SDP at the answerer is identical to the
   process followed by
   populating the candidate-types production with offerer, as described in Section 4.3.

5.7.  Forming the appropriate value
   - "host" for host candidates, "srflx" for server reflexive
   candidates, "prflx" for peer reflexive candidates (though these never
   appear Check Lists

   Forming check lists is done only by full implementations.  Lite
   implementations MUST skip the steps defined in an initial this section.

   There is one check list per in-use media stream resulting from the
   offer/answer exchange), and "relay" exchange.  To form the check list for relayed
   candidates.  The related address MUST NOT be included if a type was
   not included.  If media stream,
   the agent forms candidate pairs, computes a type was included, candidate pair priority,
   orders the pairs by priority, prunes them, and sets their states.
   These steps are described in this section.

5.7.1.  Forming Candidate Pairs

   First, the related address SHOULD be
   present agent takes each of its candidates for server reflexive, peer reflexive and relayed candidates.
   If a candidate is server or peer reflexive, the related address is
   equal to media stream
   (called LOCAL CANDIDATES) and pairs them with the base candidates it
   received from its peer (called REMOTE CANDIDATES) for that server or peer reflexive candidate.  If media
   stream.  In order to prevent the attacks described in Section 17.4.2,
   agents MAY limit the number of candidates they'll accept in an offer
   or answer.  A local candidate is relayed, paired with a remote candidate if
   and only if the related two candidates have the same component ID and have
   the same IP address version.  It is equal to the
   translation possible that some of the relayed address.  If the candidiate is local
   candidates don't get paired with a host remote candidate, there is no related address and the rel-addr production
   MUST be omitted.

   STUN connectivity checks between agents make use some of a short term
   credential that is exchanged in the offer/answer process.  The
   username part of this credential is formed by concatenating a
   username fragment from each agent, separated by a colon.  Each
   remote candidates don't get paired with local candidates.  This can
   happen if one agent
   also provides a password, used to compute the message integrity didn't include candidates for
   requests it receives.  As such, an SDP MUST contain the ice-ufrag and
   ice-pwd attributes, containing all of the username fragment and password
   respectively.  These can be either session or
   components for a media level attributes, stream.  If this happens, the number of
   components for that media stream is effectively reduced, and thus common
   considered to be equal to the minimum across both agents of the
   maximum component ID provided by each agent across all candidates components for all
   the media streams, or all stream.

   In the case of RTP, this would happen when one agent provided
   candidates for a particular media stream, respectively.  However, if
   two media streams have identical ice-ufrag's, they MUST have
   identical ice-pwd's.  The ice-ufrag RTCP, and ice-pwd attributes MUST be
   chosen randomly at the beginning of a session.  The ice-ufrag
   attribute MUST contain at least 24 bits of randomness, and other did not.  As another example, the ice-
   pwd attribute MUST contain at least 128 bits of randomness.  This
   means that
   offerer can multiplex RTP and RTCP on the ice-ufrag attribute will be at least 4 characters
   long, same port and signals it
   can do that in the ice-pwd at least 22 characters long, SDP through some new attribute.  However, since
   the grammar
   for these attributes allows offerer doesn't know if the answerer can perform such
   multiplexing, the offerer includes candidates for 6 bits of randomness per character.
   The attributes MAY be longer than 4 RTP and 22 characters respectively,
   of course. RTCP on
   separate ports, so that the offer has two components per media
   stream.  If an agent is a lite implementation, the answerer can perform such multiplexing, it MUST would
   include an "a=ice-lite"
   session level attribute in its SDP.  If an agent is just a full
   implementation, it MUST NOT include 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 attribute. candidate.

   The m/c-line candidate pairs whose local and remote candidates were both the
   default candidates for a particular component is populated with called,
   unsurprisingly, the candidates default candidate pair for that are in-use.  For
   streams based on RTP, this component.  This
   is done by placing the RTP pair that would be used to transmit media if both agents had
   not been ICE aware.

   In order to aid understanding, Figure 8 shows the relationships
   between several key concepts - transport addresses, candidates,
   candidate into pairs, and check lists, in addition to indicating the m main
   properties of candidates and c lines respectively.  If candidate pairs.

       +------------------------------------------+
       |                                          |
       | +---------------------+                  |
       | |+----+ +----+ +----+ |   +Type          |
       | || IP | |Port| |Tran| |   +Priority      |
       | ||Addr| |    | |    | |   +Foundation    |
       | |+----+ +----+ +----+ |   +ComponentiD   |
       | |      Transport      |   +RelatedAddr   |
       | |        Addr         |                  |
       | +---------------------+   +Base          |
       |             Candidate                    |
       +------------------------------------------+
       *                                         *
       *    *************************************
       *    *
     +-------------------------------+
    .|                               |
     | Local     Remote              |
     | +----+    +----+   +default?  |
     | |Cand|    |Cand|   +valid?    |
     | +----+    +----+   +nominated?|
     |                    +State     |
     |                               |
     |                               |
     |          Candidate Pair       |
     +-------------------------------+
     *                              *
     *                  ************
     *                  *
     +------------------+
     |  Candidate Pair  |
     +------------------+
     +------------------+
     |  Candidate Pair  |
     +------------------+
     +------------------+
     |  Candidate Pair  |
     +------------------+

            Check
            List

               Figure 8: Conceptual Diagram of a Check List

5.7.2.  Computing Pair Priority and Ordering Pairs

   Once the agent pairs are formed, a candidate pair priority is utilizing RTCP, it
   MUST encode computed.
   Let O be the priority for the RTCP candidate into provided by the m/c-line using offerer.  Let
   A be the a=rtcp
   attribute as defined in RFC 3605 [2].  If RTCP is not in use, priority for the
   agent MUST signal that using b=RS:0 candidate provided by the answerer.  The
   priority for a pair is computed as:

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

   Where O-P>A-P?1:0 is an expression whose value is 1 if O-P is greater
   than A-P, and b=RR:0 as defined in RFC 3556
   [5].

   There MUST be 0 otherwise.  This formula ensures a unique priority
   for each pair in most cases.  Once the priority is assigned, the
   agent sorts the candidate attribute for each component pairs in decreasing order of priority.  If
   two pairs have identical priority, the media
   stream in ordering amongst them is
   arbitrary.

5.7.3.  Pruning the m/c-line.

   Once an offer or answer are sent, an agent MUST be prepared Pairs

   This sorted list of candidate pairs is used to
   receive both STUN and media packets on each candidate.  As discussed
   in Section 11.1, media packets can determine a sequence
   of connectivity checks that will be sent to performed.  Each check involves
   sending a request from a local candidate prior to
   its appearence in the m/c-line.

5.  Receiving the Initial Offer

   When a remote candidate.
   Since an agent receives an initial offer, it will check if the offeror
   supports ICE, determine its role, gather candidates, prioritize them,
   choose one for in-use, encode and cannot send an answer, and for full
   implementations, form the check lists and begin connectivity checks.

5.1.  Verifying ICE Support

   The answerer will proceed with the ICE procedures defined in this
   specification if requests directly from a reflexive
   candidate, but only from its base, the following are true:

   o  There is at least one a=candidate attribute for each media stream
      in agent next goes through the offer it just received.

   o
   sorted list of candidate pairs.  For each media stream, at least one of pair where the candidates local
   candidate is a match
      for its respective in-use component in server reflexive, the m/c-line.

   If both of these conditions are not met, server reflexive candidate MUST be
   replaced by its base.  Once this has been done, the agent MUST process prune
   the list.  This is done by removing a pair if its local and remote
   candidates are identical to the
   SDP based local and remote candidates of a pair
   higher up on normal RFC 3264 procedures, without using any the priority list.  The result is a sequence of ordered
   candidate pairs, called the ICE
   mechanisms described check list for that media stream.

   In addition, in order to limit the remainder of this specification with two
   exceptions.  First, attacks described in all cases, the
   Section 17.4.2, an agent MUST follow SHOULD limit the rules total number of
   Section 10, which describe keepalive procedures for
   connectivity checks they perform across all agents.
   Secondly, if check lists to 100, by
   discarding the agent is not proceeding with ICE because lower priority candidate pairs until there were
   a=candidate attributes, but none that matched are less
   than 100.

5.7.4.  Computing States

   Each candidate pair in the check list has a foundation and a state.
   The foundation is the m/c-line combination of the
   media stream, foundations of the agent MUST include an a=ice-mismatch attribute in
   its answer.  This mismatch occurs local and
   remote candidates in cases where intermediary
   elements modify the m/c-line, but don't modify candidate attributes.
   By including pair.  The state is assigned once the check
   list for each media stream has been computed.  There are five
   potential values that the state can have:

   Waiting:  A check has not been performed for this attribute in pair, and can be
      performed as soon as it is the response, diagnostic information highest priority Waiting pair on
      the ICE failure is provided to check list.

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

   Succeeded:  A check for this pair was already done and produced a
      successful result.

   Failed:  A check for this pair was already done and failed, either
      never producing any intermediate
   signaling entities.

   In addition, if the offer contains the "a=ice-lite" attribute, response or producing an unrecoverable failure
      response.

   Frozen:  A check for this pair hasn't been performed, and
   the answerer is also lite, the agent MUST process the SDP based on
   normal RFC 3264 procedures, as if it didn't support ICE, with the
   exception of Section 10, which describes keepalive procedures.

5.2.  Determining Role

   For each session, each agent takes on a role.  There are two roles -
   controlling, can't
      yet be performed until some other check succeeds, allowing this
      pair to unfreeze and controlled.  The controlling agent is responsible
   for selecting move into the Waiting state.

   As ICE runs, the candidate pairs to be used will move between states as shown in Figure 9.

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

                         Figure 9: Pair State FSM

   The initial states for each media stream,
   and for generating pair in the updated offer based on that selection, when
   needed. check list are computed by
   performing the following sequence of steps:

   1.  The controlled agent is told which candidate pairs to use
   for each media stream, and does not generate an updated offer sets all of the pairs in each check list to
   signal this information the Frozen
       state.

   2.  It takes the first pair in SIP.

   If one of the agents check list for the first media
       stream (a media stream is a lite implementation, it MUST assume the
   controlled role, and its peer (which will be full) MUST assume first media stream when it is
       described by the
   controlling role.  If first m-line in the agent SDP offer and answer), and
       sets its peer are both full
   implementations, state to Waiting.

   3.  It finds all of the agent which generated other pairs in that check list with the offer which started same
       component ID, but different foundations, and sets all of their
       states to Waiting as well.

   One of the ICE processing takes on check lists will have some number of pairs in the controlling role, Waiting
   state, and the other takes check lists will have all of their pairs in the controlled role.

   Based on this definition, once roles are determined for a session,
   they persist unless ICE is restarted, as discussed below.
   Frozen state.  A restart
   causes a new selection of roles.

5.3.  Gathering Candidates

   The process for gathering candidates check list with at the answerer least one pair that is identical to not Frozen
   is called an active check list.

   The check list itself is associated with a state, which captures the process
   state of ICE checks for the offerer as described that media stream.  There are two states:

   Running:  In this state, ICE checks are still in Section 4.1.1 progress for full
   implementations and Section 4.2 this
      media stream.

   Completed:  In this state, ICE checks have completed for lite implementations.  It this media
      stream.

   When a check list is
   RECOMMENDED that this process begin immediately on receipt of first constructed as the
   offer, prior to user acceptance consequence of a session.  Such gathering MAY
   even be done pre-emptively when an agent starts.

5.4.  Prioritizing Candidates

   The process for prioritizing candidates at
   offer/answer exchange, it is placed in the answerer Running state.

   ICE processing across all media streams also has a state associated
   with it.  This state is identical equal to the process followed by the offerer, as described Running while checks are in Section 4.1.2
   for full implementations and Section 4.2 for lite implementations.

5.5.  Choosing In Use Candidates
   progress.  The process for selecting in-use candidates at the answerer state is
   identical to the process followed Completed when all checks have been
   completed.  Rules for transitioning between states are described
   below.

5.8.  Performing Periodic Checks

   Checks are generated only by full implementations.  Lite
   implementations MUST skip the offerer, as steps described in
   Section 4.1.3 for full implementations this section.

   An agent performs periodic checks and Section 4.2 triggered checks.  Periodic
   checks occur periodically for lite
   implementations.

5.6.  Encoding each media stream, and involve choosing
   the SDP

   The process for encoding highest priority pair in the SDP at Waiting state from each check list,
   and sending a check on it.  Triggered checks are performed on receipt
   of a connectivity check from the answerer is identical to peer (see Section 7.2.1.3).  This
   section describes how periodic checks are performed.

   Once the
   process followed by agent has computed the offerer, check lists as described in
   Section 4.3.

5.7.  Forming 5.7, it sets a timer for each active check list.  The timer
   fires every Ta/N seconds, where N is the Check Lists

   Forming number of active check lists
   (initially, there is done only by full implementations.  Lite
   implementations MUST skip the steps defined in this section.

   There is one active check list per in-use media stream resulting from list).  Implementations
   MAY set the
   offer/answer exchange.  A media stream is in-use as long as its port
   is non-zero (which is used in RFC 3264 timer to reject a media stream).
   Consequently, a media stream is in-use even if it fire less frequently than this.  Ta is marked as
   a=inactive or has a bandwidth the same
   value used to pace the gathering of zero.  Each candidates, as described in
   Section 4.1.1.  Dividing by N allows this aggregate check throughput
   to be split between all active check lists.  The first timer for each
   active check list is fires immediately, so that the agent performs a
   sequence of STUN
   connectivity checks that are performed check the moment the offer/answer exchange has been
   done, followed by the agent.
   To form next periodic check Ta seconds later.

   When the timer fires, the agent MUST:

   o  Find the highest priority pair in that check list for a media stream, that is in the agent forms candidate
   pairs, computes
      Waiting state.

   o  If there is such a pair:

      *  Send a STUN check from the local candidate of that pair priority, orders to the pairs by
   priority, prunes them, and sets their states.  These steps
         remote candidate of that pair.  The procedures for forming the
         STUN request for this purpose are described in this section.

   First, Section 7.1.1.

   o  If there is no such pair:

      *  Find the highest priority pair in that check list that is in
         the Frozen state.

      *  If there is such a pair:

         +  Unfreeze the pair.

         +  Perform a check for that pair, causing its state to
            transition to In-Progress.

      *  If there is no such pair:

         +  Set the agent takes each state of its candidates the check list to Completed.

         +  Terminate the timer for a media stream
   (called local candidates) that check list.

   To compute the message integrity for the check, the agent uses the
   remote username fragment and pairs them with password learned from the candidates it
   received SDP from its peer (called remote candidates) for that media
   stream.  A
   peer.  The local candidate username fragment is paired with a remote candidate if and
   only if known directly by the two candidates have agent for
   its own candidate.

6.  Receipt of the same component ID and have Initial Answer

   This section describes the
   same IP address version.  It is possible procedures that some of an agent follows when it
   receives the local
   candidates don't get paired with a remote candidate, answer from the peer.  It verifies that its peer
   supports ICE, determines its role, and some of for full implementations,
   forms the
   remote candidates don't get paired check list and begins performing periodic checks.

6.1.  Verifying ICE Support

   The offerer will proceed with local candidates.  This can
   happen the ICE procedures defined in this
   specification if there is at least one agent didn't include candidates for the all of the
   components a=candidate attribute for a each
   media stream.  In stream in the case of RTP, for example, answer it just received.  If this
   would happen when one condition is
   not met, the agent provided candidates for RTCP, and MUST process the
   other did not.  If SDP based on normal RFC 3264
   procedures, without using any of the ICE mechanisms described in the
   remainder of this happens, specification, with the number exception of components Section 10,
   which describes keepalive procedures.

   In some cases, the answer may omit a=candidate attributes for that the
   media stream is effectively reduced, streams, and considered to be equal to
   the minimum across both agents of the maximum component ID provided
   by each agent across all components instead include an a=ice-mismatch attribute for
   one or more of the media stream.

   Once streams in the pairs are formed, a candidate pair priority is computed.
   Let O-P be SDP.  This signals to the priority for
   offerer that the candidate provided by answerer supports ICE, but that ICE processing was
   not used for the offerer.
   Let A-P be session because an intermediary modified the priority default
   destination for media components without modifying the corresponding
   candidate provided by the answerer.
   The priority attributes.  See Section 17 for a pair is computed as:

      pair priority = 2^32*MIN(O-P,A-P) + 2*MAX(O-P,A-P) + (O-P>A-P?1:0)

   Where O-P>A-P?1:0 is an expression whose value is 1 if O-P is greater
   than A-P, and 0 otherwise. discussion of cases where
   this can happen.  This formula ensures specification provides no guidance on how an
   agent should proceed in such a unique priority failure case.

6.2.  Determining Role

   The offerer follows the same procedures described for each pair the answerer in most cases.  One
   Section 5.2.

6.3.  Forming the priority Check List

   Formation of check lists is assigned, performed only by full implementations.
   The offerer follows the agent
   sorts same procedures described for the candidate pairs answerer in decreasing order of priority.  If two
   pairs have identical priority,
   Section 5.7.

6.4.  Performing Periodic Checks

   Periodic checks are performed only by full implementations.  The
   offerer follows the ordering amongst them is
   arbitrary. same procedures described for the answerer in
   Section 5.8.

7.  Performing Connectivity Checks

   This sorted list of candidate pairs is used section describes how connectivity checks are performed.  All
   ICE implementations are required to determine be compliant to [12], as opposed
   to the older [15].  However, whereas a sequence
   of connectivity full implementation will both
   generate checks that (acting as a STUN client) and receive them (acting as
   a STUN server), a lite implementation will be performed.  Each only ever receive checks,
   and thus will only act as a STUN server.

7.1.  Client Procedures

   These procedures define how an agent sends a connectivity check,
   whether it is a periodic or a triggered check.  These procedures are
   only applicable to full implementations.

7.1.1.  Sending the Request

   The check involves is generated by sending a request Binding Request from a local candidate
   candidate, to a remote candidate.
   Since an agent cannot send requests directly from a reflexive
   candidate, but only from its base, [12] describes how Binding Requests
   are constructed and generated.  This section defines additional
   procedures involving the PRIORITY and USE-CANDIDATE attributes,
   defined for the connectivity check usage, and details how credentials
   for message integrity and diffserv markings are computed.

7.1.1.1.  PRIORITY and USE-CANDIDATE

   An agent next goes through MUST include the
   sorted list of candidate pairs.  For each pair where PRIORITY attribute in its Binding Request.
   The attribute MUST be set equal to the local
   candidate is server reflexive, priority that would be
   assigned, based on the server algorithm in Section 4.1.2, to a peer
   reflexive candidate MUST candidate, should one be
   replaced by its base.  Once this has been done, the agent MUST remove
   redundant pairs.  A pair is redundant if its local and remote learned as a consequence of this
   check (see Section 7.1.2.2.1 for how peer reflexive candidates are identical
   learned).  This priority value will be computed identically to how
   the priority for the local and remote candidates candidate of a the pair
   higher up on was computed, except
   that the priority list.  The result type preference is called set to the check list value for peer derived
   candidate types.

   The controlling agent MAY include the USE-CANDIDATE attribute in the
   Binding Request.  The controlled agent MUST NOT include it in its
   Binding Request.  This attribute signals that media stream, the controlling agent
   wishes to cease checks for this component, and each use the candidate pair
   resulting from the check for this component.  Section 8.1 provides
   guidance on it is called determining when to include it.

7.1.1.2.  Forming Credentials

   A Binding Request serving as a
   check.

   Each connectivity check is also said to have MUST utilize a foundation, which is merely the
   combination of the foundations of STUN
   short term credential.  The agent MUST include the local USERNAME and remote candidates
   MESSAGE-INTEGRITY attributes.  An agent MUST NOT wait to be
   challenged for short term credentials.  Rather, it MUST provide them
   in each Binding Request.

   Rather than being learned from a Shared Secret request, the check.

   Each check short
   term credential is exchanged in the check list offer/answer procedures.  In
   particular, the username is associated formed by concatenating the username
   fragment provided by the peer with a state.  This state
   is assigned once the check list for each media stream has been
   computed.  There are five potential values that username fragment of the state can have:

   Waiting: This check has not been performed, and can be performed as
      soon as it agent
   sending the request, separated by a colon (":").  The password is
   equal to the highest priority Waiting check on password provided by the check
      list.

   In-Progress: A request has been sent for this check, but peer.  For example, consider
   the
      transaction case where agent L is in progress.

   Succeeded: This check was already done the offerer, and produced agent R is the answerer.
   Agent L included a successful
      result.

   Failed: This check was already done username fragment of LFRAG for its candidates, and failed, either never
      producing any response or producing an unrecoverable failure
      response.

   Frozen: This check hasn't been performed,
   a password of LPASS.  Agent R provided a username fragment of RFRAG
   and it can't yet be
      performed until some other a password of RPASS.  A connectivity check succeeds, allowing it from L to move
      into R (and its
   response of course) utilize the Waiting state.

   First, username RFRAG:LFRAG and a password
   of RPASS.  A connectivity check from R to L (and its response)
   utilize the agent sets all username LFRAG:RFRAG and a password of LPASS.

7.1.1.3.  DiffServ Treatment

   If the checks agent is using Diffserv Codepoint markings [27] in each check list its media
   packets, it SHOULD apply those same markings to its connectivity
   checks.

7.1.2.  Processing the
   Frozen state.  Then, Response

   When a Binding Response is received, it takes is correlated to its Binding
   Request using the first check transaction ID, as defined in [12], which then ties
   it to the check list candidate pair for which the first media stream (a media stream is Binding Request was sent.

7.1.2.1.  Failure Cases

   If the first media stream when
   it STUN transaction generates an ICMP error, or generates a STUN
   error response that is described by the first m-line unrecoverable (as defined in the SDP offer and answer), and [12], or times
   out, the agent sets its the state to Waiting.  It then finds all of the other checks in
   that pair to Failed.

   The agent MUST check list with that the same component ID, but different
   foundations, source IP address and sets all of their states to Waiting as well.  Once
   this is done, one port of the check lists will have some number of checks
   in
   response equals the Waiting state, destination IP address and port that the other check lists will have all of
   their checks in the Frozen state.  A check list with at least one
   check Binding
   Request was sent to, and that is not Frozen is called an active check list.

   The check list itself is associated with a state, which captures the
   state destination IP address and port of ICE checks for that media stream.  There are two states:

   Running: In this state, ICE checks are still in progress for this
      media stream.

   Completed: In this state,
   the controlling agent has signaled response match the source IP address and port that a
      candidate pair has been selected for each component.
      Consequently, no further ICE checks are performed.

   When a check list is first constructed as the consequence of an
   offer/answer exchange, it is placed in Binding
   Request was sent from.  In other words, the Running state.

   ICE processing across all media streams also has a state associated
   with it.  This state is equal to Running while checks are source and destination
   transport addresses in
   progress.  The state is Completed when all checks have been
   completed.  Rules for transitioning between states the request and responses are described
   below.

5.8.  Performing Periodic Checks

   Checks the symmetric.
   If they are generated only by full implementations.  Lite
   implementations MUST skip not symmetric, the steps described in this section.

   An agent performs two types sets the state of checks.  The first type are periodic
   checks.  These checks occur periodically for each media stream, and
   involve choosing the highest priority check in pair to
   Failed.

7.1.2.2.  Success Cases

   If the Waiting state from
   each check list, STUN transaction generated a response between 200 and performing it.  The other type 299, and
   the source IP address and port of check is
   called a triggered check.  This is a check the response equals the destination
   IP address and port that is performed on
   receipt the Binding Request was sent to, and the
   destination IP address and port of a connectivity the response match the source IP
   address and port that the Binding Request was sent from, the check
   was a success.

7.1.2.2.1.  Discovering Peer Reflexive Candidates

   The agent checks the mapped address from the peer.  This section
   describes how periodic checks are performed.

   Once STUN response.  If the
   transport address does not match any of the local candidates that the
   agent has computed knows about, the check lists as described in
   Section 5.7, mapped address represents a new candidate - a
   peer reflexive candidate.  Like other candidates, it sets has a timer for each active check list.  The timer
   fires every Ta/N seconds, where N type,
   base, priority and foundation.  They are computed as follows:

   o  Its type is equal to peer reflexive.

   o  Its base is set equal to the number local candidate of active check lists
   (initially, there is only one active the candidate pair
      from which the STUN check list).  Implementations
   MAY was sent.

   o  Its priority is set the timer equal to fire less frequently than this.  Ta is the same value used to pace the gathering of candidates, the PRIORITY attribute
      in the Binding Request.

   o  Its foundation is selected as described in Section 4.1.1.  The first timer for each active check

   This peer reflexive candidate is then added to the list fires
   immediately, so of local
   candidates for the media stream.  Its username fragment and password
   are the same as all other local candidates for that media stream.
   However, the agent performs peer reflexive candidate is not paired with other remote
   candidates.  This is not necessary; a connectivity check valid pair will be generated
   from it momentarily based on the
   moment procedures in Section 7.1.2.2.3.  If
   an agent wishes to pair the offer/answer exchange has been done, followed by peer reflexive candidate with other
   remote candidates besides the next
   periodic check Ta seconds later.

   When one in the timer fires, valid pair that will be
   generated, the agent MUST find the highest priority check
   in that check list that is in MAY generate an updated offer which includes the Waiting state.
   peer reflexive candidate.  This will cause it to be paired with all
   other remote candidates.

7.1.2.2.2.  Updating Pair States

   The agent then
   sends a STUN check from sets the local candidate state of the pair that generated the check to
   succeeded.  The agent sees if the success for this pair can cause
   other pairs to be unfrozen.  There are three cases:

   o  If the pair had a component ID of 1, the agent MUST change the
      states for all other Frozen pairs for the same media stream and
      same foundation, but different component IDs, to Waiting.

   o  If the pair had a component ID equal to the
   remote candidate number of that check.  The procedures components
      for forming the STUN
   request for media stream (where this purpose are described in Section 7.1.1.  If none of is the checks in that check list are actual number of
      components being used, in cases where the Waiting state, but there are
   checks number of components
      signaled in the Frozen state, the highest priority check in SDP differs from offerer to answerer), the Frozen
   state is moved into agent
      MUST change the Waiting state, and that check is performed.
   When a check is performed, its state is set to In-Progress.  If there
   are no checks in either the Waiting or for all other Frozen state, then the timer pairs for that check list is stopped.

   Performing the connectivity first
      component of different media streams (and thus in different check requires
      lists) but the agent same foundation, to know Waiting.

   o  If the
   username fragment for pair has any other component ID, no other pairs can be
      unfrozen.

7.1.2.2.3.  Constructing a Valid Pair

   Next, the agent constructs a candidate pair whose local and remote candidates, and the
   password for candidate
   equals the remote candidate.  For periodic checks, mapped address of the remote
   username fragment response, and password are learned directly from the SDP
   received from whose remote candidate
   equals the peer, and destination address to which the local username fragment request was sent.  This
   is known called a valid pair, since it has been validated by a STUN
   connectivity check.  The valid pair may equal the agent.

6.  Receipt of pair that generated
   the Initial Answer

   This section describes check, may equal a different pair in the procedures that an agent follows when it
   receives check list, or may be a
   pair not currently on any check list.  If the answer from pair equals the peer.  It verifies pair
   that its peer
   supports ICE, determines its role, and for full implementations,
   forms generated the check or is on a check list and begins performing periodic checks.

6.1.  Verifying ICE Support

   The answerer will proceed with currently, it is also
   added to the ICE procedures defined in this
   specification if there VALID LIST, which is at least one a=candidate attribute maintained by the agent for each
   media stream in the answer it just received.  If this condition stream.  This list is
   not met, the agent MUST process empty at the SDP based on normal RFC 3264
   procedures, without using any start of the ICE mechanisms described processing, and
   fills as checks are performed, resulting in valid candidate pairs.

   It will be very common that the
   remainder of this specification, with the exception of Section 10,
   which describes keepalive procedures.

   In some cases, pair will not be on any check list.
   Recall that the answer may omit a=candidate attributes for check list has pairs whose local candidates are never
   server reflexive; those pairs had their local candidates converted to
   the
   media streams, and instead include an a=ice-mismatch attribute for
   one or more base of the media streams in server reflexive candidates, and then pruned if they
   were redundant.  When the SDP.  This signals response to the
   offerer that the answerer supports ICE, but that ICE processing was
   not used for the session because an intermediary modified the m/c-
   lines without modifying STUN check arrives, the candidate attributes.  See Section 16 for
   a discussion of cases where this can happen.  This specification
   provides no guidance on how an agent should proceed in such
   mapped address will be reflexive if there is a failure
   case.

6.2.  Determining Role

   The offerer follows NAT between the same procedures described for two.
   In that case, the answerer valid pair will have a local candidate that doesn't
   match any of the pairs in
   Section 5.2.

6.3.  Forming the Check List

   Formation of check lists list.

   If the pair is performed only by full implementations.
   The offerer follows not on any check list, the same procedures described agent computes the priority
   for the answerer in
   Section 5.7.

6.4.  Performing Periodic Checks

   Periodic checks are performed only by full implementations.  The
   offerer follows pair based on the same procedures described for priority of each candidate, using the answerer
   algorithm in Section 5.8.

7.  Connectivity Checks

   This section describes how connectivity checks are performed.  All
   ICE implementations are required to be compliant to [11], as opposed
   to 5.7.  The priority of the older [14].  However, whereas a full implementation will both
   generate checks (acting as a STUN client) and receive them (acting as
   a STUN server), a lite implementation will only ever receive checks,
   and thus will only act as a STUN server.

7.1.  Client Procedures

   These procedures define how an agent sends a connectivity check,
   whether local candidate
   depends on its type.  If it is a periodic or a triggered check.  These procedures are
   only applicable not peer reflexive, it is equal to full implementations.

7.1.1.  Sending the Request

   The agent acting as the client generates a connectivity check either
   periodically, or triggered.  In either case,
   priority signaled for that candidate in the check SDP.  If it is generated
   by sending a Binding Request from a local candidate, peer
   reflexive, it is equal to a remote
   candidate.  The agent must know the username fragment for both
   candidates and PRIORITY attribute the password for agent placed in
   the remote candidate.

   A Binding Request serving as a connectivity check MUST utilize a STUN
   short term credential.  Rather than being learned from a Shared
   Secret request, which just completed.  The priority of the short term credential remote
   candidate is exchanged in taken from the offer/
   answer procedures.  In particular, SDP of the username is formed by
   concatenating peer.  If the username fragment provided by candidate does
   not appear there, then the peer with check must have been a triggered check to
   a new remote candidate.  In that case, the
   username fragment priority is taken as the
   value of the agent sending PRIORITY attribute in the request, separated by a
   colon (":"). Binding Request which
   triggered the check that just completed.  The password pair is equal then added to
   the password provided by the
   peer.  For example, consider VALID LIST.

7.1.2.2.4.  Updating the case where agent A is Nominated Flag

   If the offerer,
   and agent B is the answerer.  Agent A included a username fragment of
   AFRAG for its candidates, and a password of APASS.  Agent B provided was a username fragment of BFRAG controlling agent, and it had included a password of BPASS.  A connectivity
   check from A to B (and its response of course) utilize USE-
   CANDIDATE attribute in the username
   BFRAG:AFRAG and a password of BPASS.  A connectivity check Binding Request, the valid pair generated
   from B to
   A (and that check has its response) utilize nominated flag set to true.  This flag
   indicates that this candidate should be used for media if it is the
   highest priority one amongst those whose nominated flag is set.  This
   may conclude ICE processing for this media stream or all media
   streams; see Section 8.

   If the username AFRAG:BFRAG and a password
   of APASS.

   An agent MUST include is the PRIORITY attribute controlled agent, the response may result in the
   valid pair having its Binding Request.
   The attribute nominated flag set.  See Section 7.2.1.4 for
   the procedure.

7.2.  Server Procedures

   An agent MUST be set equal prepared to the priority that would be
   assigned, based receive a Binding Request on the algorithm in Section 4.1.2, to a peer
   reflexive base of
   each candidate learned from this check.  Such it included in its most recent offer or answer.
   Receipt of a peer reflexive
   candidate has Binding Request on a stream ID, component ID and local preference base is an indication that are
   equal to the host candidate from which the
   connectivity check is being sent, but a
   type preference equal usage applies to the value associated with peer reflexive
   candidates. request.

   The Binding Request sent by an agent MUST include use a short term credential to authenticate the USERNAME
   request and
   MESSAGE-INTEGRITY attributes.  That is, an perform a message integrity check.  The agent MUST NOT wait accept
   a credential if the username consists of two values separated by a
   colon, where the first value is equal to be
   challenged for short term credentials.  Rather, it MUST provide them
   in the Binding Request right away.

   The controlling agent MAY include username fragment
   generated by the USE-CANDIDATE attribute agent in an offer or answer for a session in-
   progress, and the
   Binding Request.  The controlled agent MUST NOT include it MESSAGE-INTEGRITY is the output of a hash of the
   password and the STUN packet's contents.  It is possible (and in its
   Binding Request.  This attribute signals fact
   very likely) that the controlling agent
   wishes an offeror will receive a Binding Request prior to cease checks for this component, and use
   receiving the candidate pair
   resulting answer from its peer.  However, the check for request can be
   processed without receiving this component.  Section 8 provides
   guidance on determining when to include it. answer, and a response generated.
   By doing this, ICE processing completes faster.

   If the agent is using Diffserv Codepoint markings [26] [27] in its media
   packets, it SHOULD apply those same markings to its connectivity
   checks.

7.1.2.  Processing the Response

   If the STUN transaction generates an unrecoverable failure response
   or times out, the agent sets the state of the check responses to Failed.  The
   remainder of this section applies
   Binding Requests.

7.2.1.  Additional Procedures for Full Implementations

   This subsection defines the additional server procedures applicable
   to processing of full implementations when generating a successful
   responses (any response from 200 to 299).

   The agent MUST check that a
   Binding Request.

7.2.1.1.  Computing Mapped Address

   For requests being received on a relayed candidate, the source IP
   transport address and port used for STUN processing (namely, generation of the
   response equals
   XOR-MAPPED-ADDRESS attribute) is the destination IP transport address and port that as seen by the
   relay.  That source transport address will be present in the REMOTE-
   ADDRESS attribute of a STUN Data Indication message, if the Binding
   Request was sent to, and delivered through a Data Indication (a STUN relay
   delivers packets encapsulated in a Data Indication when no active
   destination is set).  If the Binding Request was not encapsulated in
   a Data Indication, that source address is equal to the current active
   destination for the STUN relay session.

7.2.1.2.  Learning Peer Reflexive Candidates

   If the source transport address of the request does not match any
   existing remote candidates, it represents a new peer reflexive remote
   candidate.  The full-mode agent gives the candidate a priority equal
   to the PRIORITY attribute from the destination IP address and port request.  The type of the response match the source IP address and port that
   candidate is equal to peer reflexive.  Its foundation is set to an
   arbitrary value, different from the Binding
   Request was sent from. foundation for all other remote
   candidates.  If these do not match, the processing
   described any subsequent offer/answer exchanges contain this
   peer reflexive candidate in the remainder of this section MUST NOT be performed.  In
   addition, an agent sets SDP, it will signal the state of actual
   foundation for the check candidate.  This candidate is then added to Failed.

   If the check succeeds, processing continues.  The
   list of remote candidates.  However, the agent creates a does not pair this
   candidate with any local candidates.

7.2.1.3.  Triggered Checks

   Next, the agent constructs a pair whose local candidate equals is equal to
   the mapped transport address of on which the
   response, STUN request was received, and whose a
   remote candidate equals equal to the destination source transport address
   to which where the
   request was sent.  This is called a validated pair,
   since it has been validated by a STUN connectivity check.  It is very
   important to note that this validated pair will often not came from (which may be
   identical peer-reflexive remote candidate that
   was just learned).  Since both candidates are known to the check itself; in many cases, agent, it
   can obtain their priorities and compute the local candidate
   (learned through the mapped address pair priority.
   This pair is then looked up in the response) will check list.  There can be
   different than one of
   several outcomes:

   o  If the local candidate pair is already on the check list:

      *  If the state of that pair is Waiting or Frozen, its state is
         changed to In-Progress and a check for that pair is performed
         immediately.  This is called a triggered check.

      *  If the request was sent from.

   Next, state of that pair is In-Progress, the agent computes SHOULD
         generate an immediate retransmit of the priority Binding Request for the pair based on
         check in progress.  This is to facilitate rapid completion of
         ICE when both agents are behind NAT.

      *  If the
   priority state of each candidate, using that pair is Failed or Succeeded, no triggered
         check is sent.

   o  If the algorithm in Section 5.7. pair is not already on the check list:

      *  The
   priority of pair is inserted into the local candidate depends check list based on its type. priority

      *  Its state is set to In-Progress

      *  A triggered check for that pair is performed immediately.

   If it a triggered check is not
   peer reflexive, to be generated, it is equal constructed and
   processed as described in Section 7.1.1.  These procedures require
   the agent to know the priority signaled transport address, username fragment and
   password for that
   candidate in the SDP.  If it is peer reflexive, it peer.  The username fragment for the remote
   candidate is equal to the
   PRIORITY attribute part after the agent placed colon of the USERNAME in the
   Binding Request which that was just
   completed.  The priority of received.  Using that username
   fragment, the remote candidate is taken from agent can check the SDP messages received from its peer
   (there may be more than one in cases of the peer. forking), and find this
   username fragment.  The corresponding password is then selected.  If the candidate does
   agent has not appear there, yet received the username in an SDP (a likely case for
   the offerer in the initial offer/answer exchange), it MUST wait for
   the SDP to be received (since it won't have its peer's ICE password
   without it), and then proceed with the
   check must have been a triggered check to a new remote candidate.  In
   that case, check.

7.2.1.4.  Updating the priority is taken as Nominated Flag

   If the value of Binding Request received by the PRIORITY agent had the USE-CANDIDATE
   attribute set, and the agent is in the Binding Request which triggered controlled role, the check that just
   completed.

   Once agent
   looks at the priority state of the candidate pair has been computed, computed in Section 7.2.1.3:

   o  If the state of this pair is added to the valid list for succeeded, it means that media stream.  If the agent was a
   controlling agent, and the check had included a USE-CANDIDATE
   attribute, the candidate
      generated by this pair is marked as "favored".  If produced a successful response.  This would
      have caused the agent
   was to construct a controlled agent, and the check valid pair when that success
      response was a triggered check, and the
   request which caused received (see Section 7.1.2.2.3).  The agent now sets
      the triggered check included nominated flag in the USE-CANDIDATE
   attribute, valid pair to true.  This may end ICE
      processing for this media stream; see Section 8.

   o  If the candidate state of this pair is marked as "favored".

   Next, the agent updates In-Progress, if its ICE states.  The agent checks check produces a
      successful result, the mapped
   address from resulting valid pair has its nominated flag
      set when the STUN response. response arrives.  This may end ICE processing for
      this media stream when it arrives; see Section 8.

7.2.2.  Additional Procedures for Lite Implementations

   If the transport address does not
   match any of the local candidates check that the agent knows about, the
   mapped address represents a new peer reflexive candidate.  Its type
   is equal to peer reflexive.  Its base was just received contained a USE-CANDIDATE
   attribute, the agent constructs a candidate pair whose local
   candidate is set equal to the candidate
   from transport address on which the STUN check request was sent.  Its username fragment
   received, and
   password are identical whose remote candidate is equal to the candidate from which source transport
   address of the check request that was
   sent.  It received.  This candidate pair is
   assigned the priority value that was an arbitrary priority, and placed in the
   PRIORITY attribute into a list of valid
   candidates pair for that component of that media stream, called the request.  Its foundation is selected as
   described in Section 4.1.1.
   valid list.  The peer reflexive candidate is then
   added agent sets the nominated flag for that pair to true.
   ICE processing is considered complete for a media stream if the valid
   list of local candidates known contains a candidate pair for each component.

8.  Concluding ICE Processing

   The processing rules in this section apply only to full
   implementations.  Concluding ICE involves nominating pairs by the
   controlling agent (though it and updating of state machinery

8.1.  Nominating Pairs

   The controlling agent nominates pairs to be selected by ICE by using
   one of two techniques: regular nomination or aggressive nomination.
   If its peer has a lite implementation, an agent MUST use a regular
   nomination algorithm.  If its peer is using ICE options (present in
   an ice-options attribute from the peer) that the agent does not paired with other remote candidates at this time).

   Next,
   understand, the agent changes MUST use a regular nomination algorithm.  If
   its peer is a full implementation and isn't using any ICE options or
   is using ICE options understood by the agent, the state for this check to Succeeded.  The agent sees if MAY use
   either the aggressive or the regular nomination algorithm.  However,
   the regular algorithm is RECOMMENDED since it provides greater
   stability.

8.1.1.  Regular Nomination

   With regular nomination, the success agent lets some number of this check can cause other checks to be
   unfrozen.  If
   complete, each of which omit the check had USE-CANDIDATE attribute.  Once one
   or more checks complete successfully for a component ID of one, a media
   stream, valid pairs are generated and added to the valid list.  The
   agent MUST
   change lets the states for all other Frozen checks for the same media
   stream continue until some stopping criteria is met,
   and same foundation, but different component IDs, to Waiting.
   If then picks amongst the component ID valid pairs based on an evaluation
   criteria.  The criteria for stopping the check was equal to the number of
   components checks and for evaluating
   the media stream (where this valid pairs is the actual number of
   components being used, in cases where the number entirely a matter of components
   signaled in the SDP differs from offerer to answerer), local optimization.

   When the controlling agent MUST
   change selects the state for all other Frozen checks for valid pair, it repeats the first component
   of different media streams (and thus in different
   check lists) but that produced this valid pair, this time with the same foundation, USE-CANDIDATE
   attribute.  This check will succeed (since the previous did), causing
   the nominated flag of that and only that pair to Waiting.

7.2.  Server Procedures

   An agent MUST be prepared to receive set.
   Consequently, there will be only a Binding Request on the base of
   each candidate it included single nominated pair in its most recent offer or answer.
   Receipt the valid
   list, and when the state of a Binding Request on a transport address that the agent
   had included in a candidate attribute is an indication check list moves to completed, that
   exact pair is selected by ICE for sending and receiving media.

   Regular nomination provides the
   connectivity check usage applies to most flexibility, since the request.

   The agent MUST use a short term credential to authenticate has
   control over the
   request stopping and perform a message integrity check. selection criteria for checks.  The
   only requirement is that the agent MUST accept
   a credential if the username consists of two values separated by eventually pick one and only
   one candidate pair and generate a
   colon, where check for that pair with the first value is equal USE-
   CANDIDATE attribute present.  Regular nomination also improves ICE's
   resilience to the username fragment
   generated by the agent variations in an offer or answer for a session in-
   progress, and the password implementation (see Section 14.  Regular
   nomination is equal also more stable, allowing both agents to the password converge on a
   single pair for that username
   fragment.  It media without any transient selections, which can
   happen with the aggressive algorithm.  The drawback of regular
   nomination is possible (and in fact very likely) that it is guaranteed to increase latencies because it
   requires an offeror
   will receive a Binding Request prior additional check to receiving the answer from its
   peer.  However, the request can be processed without receiving this
   answer, and a response generated.

   If done.

8.1.2.  Aggressive Nomination

   With aggressive nomination, the controlling agent is using Diffserv Codepoint markings [26] includes the USE-
   CANDIDATE attribute in its media
   packets, every check it SHOULD apply those same markings to its responses to
   Binding Requests.

7.2.1.  Additional Procedures for Full Implementations

   This subsection defines sends.  Once the additional server procedures applicable
   to full implementations.

   For requests being received on first check
   for a relayed candidate, component succeeds, it will be added to the source
   transport address used for STUN valid list, have
   its nominated flag set, and then cause ICE processing (namely, generation to cease for
   this check list.  However, because the agent included the USE-
   CANDIDATE attribute in all of its checks, another check may yet
   complete, causing another valid pair to have its nominated flag set.
   ICE always selects the
   XOR-MAPPED-ADDRESS attribute) is highest priority nominated candidate pair from
   the transport address valid list as seen by the
   relay.  That source transport address will be present one used for media.  Consequently, the selected
   pair may actually change briefly as ICE checks complete, resulting in
   a set of transient selections until it stabilizes.

8.2.  Updating States

   For both controlling and controlled agents, the REMOTE-
   ADDRESS attribute state of a STUN Data Indication message, if ICE
   processing depends on the Binding
   Request was delivered through a Data Indication.  If presence of nominated candidate pairs in
   the Binding
   Request was not encapsulated valid list:

   o  If there are no nominated pairs in the valid list for a Data Indication, that source
   address media
      stream, ICE processing continues.

   o  If there is equal to at least one nominated pair in the current active destination valid list:

      *  The agent MUST remove all Waiting and Frozen pairs in the check
         list for the STUN relay
   session.

   If same component as the STUN request resulted in nominated pairs for that
         media stream

      *  If an error response, no further
   processing In-Progress pair in the check list is performed.

   Assuming for the same
         component as a success response, if nominated pair, the source transport address of agent SHOULD cease
         retransmissions for its check if its pair priority is lower
         than the
   request does not match any existing remote candidates, it represents
   a new peer reflexive remote candidate. lowest priority nominated pair for that component

   o  Once there is at least one nominated pair in the valid list for
      every component of at least one media stream:

      *  The full-mode agent gives MUST change the
   candidate a priority equal state of processing for its check
         list for that media stream to the PRIORITY attribute from the
   request. Completed.

      *  The type of the candidate is equal agent MUST continue to peer reflexive.  Its
   foundation is set respond to an arbitrary value, different from the
   foundation any checks it may still
         receive for all other remote candidates.  Note that any subsequent
   offer/answer exchanges will contain this new peer reflexive candidate
   in the SDP, media stream, and will signal MUST perform triggered
         checks if required by the actual foundation processing of Section 7.2.

      *  The agent MAY begin transmitting media for the candidate.
   This candidate this media stream as
         described in Section 11.1
   o  Once there is then added to at least one nominated pair in the valid list for
      each component of remote candidates.
   However, the each media stream:

      *  The agent does not pair this candidate with any local
   candidates.

   Next, sets the state of ICE processing overall to
         Completed.

      *  If an agent constructs a tentative check in is controlling, it examines the reverse
   direction, called a triggered check.  The triggered check has a local highest priority
         nominated candidate equal to the pair for each component of each media
         stream.  If any of those candidate on which pairs differ from the STUN request was
   received, and a remote
         default candidate equal to the source transport
   address where pairs in the request came from (which may be a new peer-
   reflexive remote candidate).  Since both candidates are known to most recent offer/answer
         exchange, the
   agent, it can obtain their priorities and compute controlling agent MUST generate an updated offer
         as described in Section 9.  If the candidate pair
   priority.  This tentative check controlling agent is then looked up using
         an aggressive nomination algorithm, this may result in the check list.
   There can be one of several outcomes:

   o  If there is already a check on
         updated offers as the check list with this same local
      and remote candidates, and pairs selected for media change.  An
         agent MAY delay sending the state of that check is Waiting or
      Frozen, its state offer for a brief interval (one
         second is changed RECOMMENDED) in order to In-Progress and allow the tentative
      check is performed.

   o  If there is already selected pairs to
         stabilize.

9.  Subsequent Offer/Answer Exchanges

   Either agent MAY generate a check on the check list with this same local
      and remote candidates, and its state was In-Progress, subsequent offer at any time allowed by
   RFC 3264 [4].  The rules in Section 8 will cause the controlling
   agent
      SHOULD abandon the new tentative check and instead generate to send an
      immediate retransmit of updated offer at the Binding Request for conclusion of ICE processing
   when ICE has selected different candidate pairs from the check in
      progress. default
   pairs.  This is to facilitate rapid completion section defines rules for construction of subsequent
   offers and answers.

9.1.  Generating the Offer

9.1.1.  Procedures for All Implementations

9.1.1.1.  ICE when both
      agents are behind NAT.

   o  If there is already a check on Restarts

   An agent MAY restart ICE processing for an existing media stream.  An
   ICE restart, as the check list with this same local name implies, will cause all previous state of
   ICE processing to be flushed and remote candidates, checks to start anew.  The only
   difference between an ICE restart and its state was Succeeded, the a brand new
      tentative check media session is abandoned.  If the Binding Request just
      received contained the USE-CANDIDATE attribute, it means that
   that, during the
      pair resulting from that previous check is favored by restart, media can continue to be sent to the peer
      controlling agent.  The
   previously validated pair.

   An agent MUST take the candidate pair in the
      valid list that was learned from that previous successful check,
      and mark it as favored. restart ICE for a media stream if:

   o  If there  The offer is already a check on being generated for the check list with this same local
      and remote candidates, and its state was Failed, purposes of changing the
      target of the media stream.  In other words, if an agent wants to
      generated an updated offer which, had ICE not been in use, would
      result in a new tentative
      check is abandoned. value for the destination of a media component.

   o  If there  An agent is no matching check on changing its implementation level.  This typically
      only happens in third party call control use cases, where the check list,
      entity performing the new tentative
      check signaling is inserted into not the check list based on its priority, entity receiving the
      media, and
      its state is set to In-Progress.

   If it has changed the tentative check is target of media mid-session to be performed, it is constructed and
   processed as described in Section 7.1.1.
      another entity that has a different ICE implementation.

   These procedures require rules imply that setting the agent to know IP address in the username fragment and password c line to
   0.0.0.0 will cause an ICE restart.  Consequently, ICE implementations
   MUST NOT utilize this mechanism for call hold, and instead MUST use
   a=inactive and a=sendonly as described in [4]

   To restart ICE, an agent MUST change both the peer.
   They are readily determined from the SDP ice-pwd and from the check that was
   just received.  The username fragment ice-
   ufrag for the remote candidate media stream in an offer.  Note that it is
   equal permissible
   to the bottom half (the part after the colon) of the USERNAME use a session-level attribute in one offer, but to provide the Binding Request that was
   same ice-pwd or ice-ufrag as a media-level attribute in a subsequent
   offer.  This is not a change in password, just received.  Using that username
   fragment, the agent can check the SDP messages received from its peer
   (there may be more than one a change in cases of forking), its
   representation, and find this
   username fragment.  The corresponding password is then selected.  If
   agent has does not yet received this SDP (a likely case for cause an ICE restart.

   An agent sets the offerer rest of the fields in the initial offer/answer exchange), it MUST wait SDP for this media stream
   as it would in an initial offer of this media stream (see
   Section 4.3).  Consequently, the SDP to be
   received, and then proceed with set of candidates MAY include some,
   none, or all of the triggered check.

7.2.2.  Additional Procedures previous candidates for Lite Implementations

   If the check that was just received contained stream and MAY
   include a USE-CANDIDATE
   attribute, the totally new set of candidates gathered as described in
   Section 4.1.1.

9.1.1.2.  Removing a Media Stream

   If an agent constructs removes a candidate pair whose local
   candidate is equal media stream by setting its port to the transport address on which the request was
   received, zero, it
   MUST NOT include any candidate attributes for that media stream and whose remote candidate is equal
   SHOULD NOT include any other ICE-related attributes defined in
   Section 15 for that media stream.

9.1.1.3.  Adding a Media Stream

   If an agent wishes to add a new media stream, it sets the source transport
   address of fields in
   the request that SDP for this media stream as if this was received.  This candidate pair is
   assigned an arbitrary priority, and placed into a list of valid
   candidates initial offer for
   that component of that media stream called (see Section 4.3).  This will cause ICE processing
   to begin for this media stream.

9.1.2.  Procedures for Full Implementations

   This section describes additional procedures for full
   implementations, covering existing media streams.

   The username fragments, password, and implementation level MUST
   remain the valid
   list.  In addition, it is marked same as favored, since the peer used previously.  If an agent has
   indicated that it is needs to be used. change one
   of these it MUST restart ICE processing is considered
   complete for a that media stream if stream.

   Additional behavior depends on the valid list contains a candidate
   pair for each component.

8.  Concluding state ICE

   The processing rules in this section apply only to full
   implementations.

   Concluding for that
   media stream.

9.1.2.1.  Existing Media Streams with ICE involves selection of pairs by the controlling agent,
   updating of state machinery, and possibly the generation of Running

   If an agent generates an updated offer by the controlling agent.

   The controlling agent can use any algorithm it likes including media stream that
   was previously established, and for deciding
   when to select a candidate pair, called which ICE checks are in the favored pair, as
   Running state, the one
   that will be used agent follows the procedures defined here.

   An agent MUST include candidate attributes for media.  However, all local candidates
   it MUST eventually include a
   USE-CANDIDATE attribute in at least one successful check had signaled previously for each
   component of each that media stream.  The most apparent way to utilize the USE-CANDIDATE attribute is to
   run through a series of checks, each properties of
   that candidate as signaled in SDP - the priority, foundation, type
   and related transport address SHOULD remain the same.  The IP
   address, port and transport protocol, which omit fundamentally identify
   that candidate, MUST remain the flag.  Once
   one or more checks complete successfully for same (if they change, it would be a
   new candidate).  The component of a media
   stream, ID MUST remain the same.  The agent evaluates
   MAY include additional candidates it did not offer previously, but
   which it has gathered since the choices based on some criteria, and
   picks a candidate pair. last offer/answer exchange, including
   peer reflexive candidates.

   The criteria agent MAY change the default destination for evaluation is media.  As with
   initial offers, there MUST be a matter set of
   implementation and it allows for localized optimizations.  The check
   that yielded this pair is then repeated, candidate attributes in the
   offer matching this time default destination.

9.1.2.2.  Existing Media Streams with ICE Completed

   If an agent generates an updated offer including media stream that
   was previously established, and for which ICE checks are in the USE-
   CANDIDATE flag.  This approach provides
   Completed state, the most flexibility in terms agent follows the procedures defined here.

   The default destination for media (i.e., the values of algorithms, the IP
   addresses and also improves ICE's resilience to variations ports in
   implementation (see Section 14.  This approach is called
   "introspective selection".  The drawback of introspective selection
   is that it is guaranteed to increase latencies because it requires an
   additional check to the m and c line used for that media stream)
   MUST be done.

   An alternative is called "proactive selection".  In this approach, the controlling agent includes local candidate from the USE-CANDIDATE attribute highest priority nominated pair
   in every
   check it sends.  Once the first check valid list for each component.  This "fixes" the default
   destination for media to equal the destination ICE has selected for
   media.

   The agent MUST include a candidate attributes for candidates matching
   the default destination for each component succeeds, it is
   used by ICE. of the media stream, and
   MUST NOT include any other candidates.

   In this mode, addition, if the agent will end up using is controlling, it MUST include the candidate
   pair which
   a=remote-candidates attribute for each media stream whose check list
   is in the Completed state.  The attribute contains the remote
   candidates from the highest priority based on ICE's prioritization
   algorithm, instead nominated pair in the valid list
   for each component of some other local optimization. that media stream.  It is possible
   with proactive selection that multiple needed to avoid a
   race condition whereby the controlling agent chooses its pairs, but
   the updated offer beats the connectivity checks might succeed with to the
   flag set; controlled
   agent, which doesn't even know these pairs are valid, let alone
   selected.  See Appendix B.6 for elaboration on this is why race condition.

9.1.3.  Procedures for Lite Implementations

   This section describes procedures for lite implementations for
   existing streams for which ICE still applies is running.

   A lite implementation MUST include its prioritization algorithm one and only candidate for
   each component of each media stream in an a=candidate attribute in
   any subsequent offer.  This candidate is formed identically to pick amongst those pairs that have been favored. the
   procedures for initial offers, as described in Section 4.2.

   The username fragments, password, and implementation level MUST
   remain the same as used previously.  If an agent is controlling needs to change one
   of these it MUST restart ICE for that media stream.

9.2.  Receiving the Offer and its peer has Generating an Answer

9.2.1.  Procedures for All Implementations

   When receiving a lite implementation, subsequent offer within an existing session, an
   agent MUST use an introspective selection algorithm.  Of course, re-apply the verification procedures in Section 5.1
   without regard to the results of verification from any previous
   offer/answer exchanges.  Indeed, it
   MAY select a favored pair based on ICE's prioritization.  The key
   requirement is possible that the agent must complete a successful check before
   redoing previous
   offer/answer exchange resulted in ICE not being used, but it with is used
   as a consequence of a subsequent exchange.

9.2.1.1.  Detecting ICE Restart

   If the USE-CANDIDATE attribute.

   For both controlling and controlled agents, once offer contained a candidate pair change in the Valid list is marked as favored, an agent MUST NOT generate any
   further periodic checks for that component of a=ice-ufrag or a=ice-pwd
   attributes compared to the previous SDP from the peer, it indicates
   that media stream, and
   SHOULD cease any retransmissions in progress for checks ICE is restarting for that
   component of that this media stream.  Once there  If all media streams
   are restarting, than ICE is at least one candidate
   pair restarting overall.

   If ICE is restarting for each component of a media stream that is favored, a full-
   mode stream:

   o  The agent MUST change the state of processing for its check list to
   Completed.  Once all of the check lists for the media streams enter a=ice-ufrag and a=ice-pwd attributes in
      the Completed state, answer.

   o  The agent MAY change its implementation level in the controlling answer.

   An agent takes sets the rest of the highest priority
   favored candidate pair fields in the SDP for each component of each this media stream.  If
   any of those candidate pairs differ from stream
   as it would in an initial answer to this media stream (see
   Section 4.3).  Consequently, the in-use set of candidates in
   m/c-lines MAY include some,
   none, or all of the most recent offer/answer exchange, the controlling
   agent MUST generate an updated offer previous candidates for that stream and MAY
   include a totally new set of candidates gathered as described in
   Section 9.

9.  Subsequent Offer/Answer Exchanges

   An agent MAY generate a subsequent 4.1.1.

9.2.1.2.  New Media Stream

   If the offer at any time.  However, contains a new media stream, the
   rules agent sets the fields
   in the answer as if it had received an initial offer containing that
   media stream (see Section 8 4.3).  This will cause the controlling agent ICE processing to send
   begin for this media stream.

9.2.1.3.  Removed Media Stream

   If an
   updated offer at contains a media stream whose port is zero, the conclusion of ICE processing when ICE has
   selected different agent
   MUST NOT include any candidate pairs from the in-use pairs.  This
   section defines rules attributes for construction of subsequent offers that media stream in
   its answer and
   answers.

9.1.  Generating SHOULD NOT include any other ICE-related attributes
   defined in Section 15 for that media stream.

9.2.2.  Procedures for Full Implementations

   The username fragments, password, and implementation level MUST
   remain the Offer

   An same as used previously.  If an agent MAY needs to change the ice-pwd and/or ice-ufrag one
   of these it MUST restart ICE for a that media stream by generating an
   offer; ICE cannot be restarted in an offer.  Doing so is a signal to restart answer.

   Additional behaviors depend on the state of ICE processing for that
   media stream.  When an agent restarts stream.

9.2.2.1.  Existing Media Streams with ICE Running and no remote-
          candidates

   If ICE is running for a media stream, it MUST
   NOT include and the a=remote-candidates offer for that media
   stream lacked the remote-candidates attribute, since the state rules for
   construction of the
   media stream would not be Completed at this point.  Note that it is
   permissible to use a session-level attribute in one offer, but answer are identical to
   provide those for the same password offerer as a media-level attribute
   described in a subsequent
   offer.  This Section 9.1.2.1.

9.2.2.2.  Existing Media Streams with ICE Completed and no remote-
          candidates

   If ICE is not a change in password, just Completed for a change in its
   representation.

   An agent MUST restart ICE processing if media stream, and the offer is being generated for that media
   stream lacked the purposes of changing remote-candidates attribute, the target rules for
   construction of the media stream.  In
   other words, if an agent wants answer are identical to generated an updated offer which,
   had ICE not been in use, would result in a new value those for the
   transport address offerer as
   described in Section 9.1.2.2, except that the answerer MUST NOT
   include the m/c-line, a=remote-candidates attribute in the answer.

9.2.2.3.  Existing Media Streams and remote-candidates

   A controlled agent MUST restart will receive an offer with the a=remote-candidates
   attribute for a media stream when its peer has concluded ICE
   processing for that media stream.  This implies that setting the IP address attribute is present in the c
   line
   offer to 0.0.0.0 deal with a race condition between the receipt of the offer,
   and the receipt of the Binding Response which tells the answerer the
   candidate which will cause be selected by ICE.  See Appendix B.6 for an ICE restart.  Consequently, ICE
   implementations SHOULD NOT utilize
   explanation of this mechanism for call hold, and
   instead use a=inactive as described in [4]

   If race condition.  Consequently, processing of an
   offer with this attribute depends on the winner of the race.

   The agent removes forms a candidate pair for each component of the media
   stream by setting its port by:

   o  Setting the remote candidate equal to zero, it
   MUST NOT include any the offerers default
      destination for that component (e.g., the contents of the m and
      c-lines for RTP, and the a=rtcp attribute for RTCP)

   o  Setting the local candidate attributes equal to the transport address for
      that media stream.

   An agent MUST NOT signal a change same component in its implementation level (full
   or lite) by adding or removing the a=ice-lite a=remote-candidates attribute from an
   updated offer, unless ICE processing is being restarted for all media
   streams in the
      offer.  Of course,

   The agent then sees if each of these candidate pairs are present in normal cases
   the implementation
   level valid list.  If a particular pair is not dynamic and there would be no need to signal a change.
   However, in applications like third party call control, which involve the valid list, the
   check has "lost" the race.  Call such a mid-session change in remote correspondent, this can happen and it
   is permitted by ICE with pair a restart.

   Note that an "losing pair".

   The agent can add a new media stream at any time, even if
   ICE has long finished for finds all the existing media streams.  Based on pairs in the
   rules described here, checks will begin for this new stream as if it
   was check list whose remote
   candidates equal the remote candidate in an initial offer.

9.1.1.  Additional Procedures for Full Implementations

   This section describes additional procedures for full
   implementations.

   When an the losing pair:

   o  If none of the pairs are In-Progress, and at least one is Failed,
      it is most likely that a network failure, such as a network
      partition or serious packet loss, has occurred.  The agent generates SHOULD
      generate an updated offer, the set of candidate
   attributes to include answer for each this media stream depend on as if the state of remote-
      candidates attribute had not been present, and then restart ICE processing
      for that media this stream.

   o  If at least one of the processing pairs are In-Progress, the agent SHOULD
      wait for that
   media stream is those checks to complete, and as each completes, redo the
      processing in this section until there are no losing pairs.

   Once there are no losing pairs, the Completed state, a full-mode agent can generate the answer.
   It MUST
   include a candidate attribute set the default destination for media to the candidates in
   the remote-candidates attribute from the offer (each of which will
   now be the local candidate of each pair
   that has been chosen for use by ICE for that media stream.  A pair is
   chosen if it is the highest priority favored a candidate pair in the valid list
   for a component of that media stream.  An agent SHOULD NOT list).
   It MUST include
   any other a candidate attributes for that media stream.  If ICE
   processing attribute in the answer for a media stream is each
   candidate in the Running state, remote-candidates attribute in the agent MUST
   include all current candidates (including peer reflexive candidates
   learned through ICE processing) offer.

9.2.3.  Procedures for that media stream.  It MAY
   include candidates it did not offer previously, but which it has
   gathered since Lite Implementations

   A lite implementation constructs its answer in the last offer/answer exchange.  If same way it does a media stream is
   new or ICE checks are restarting
   subsequent offer as described in Section 9.1.3

9.3.  Updating the Check and Valid Lists

9.3.1.  Procedures for that stream, an Full Implementations

9.3.1.1.  ICE Restarts

   The agent includes MUST remember the set of candidates it wishes to utilize.  This MAY include some,
   none, or all highest priority nominated pairs in the
   Valid list for each component of the media stream, called the
   previous candidates for that stream in selected pairs, prior to the case
   of a restart, and MAY include a totally new set of candidates
   gathered restart.  The agent will
   continue to send media using these pairs, as described in
   Section 4.1.1.

   If a candidate was sent in a previous offer/answer exchange, it
   SHOULD have 11.1.  Once these destinations are noted, the same priority.  For a peer reflexive candidate, agent MUST
   flush the
   priority SHOULD be valid and check lists, and then recompute the same check list
   and its states as determined by the processing described in Section 7.1.2.  The foundation SHOULD be 5.7.

9.3.1.2.  New Media Stream

   If the same.  The username
   fragments and passwords for offer/answer exchange added a new media stream SHOULD remain stream, the same agent MUST
   create a new check list for it (and an empty Valid list to start of
   course), as described in Section 5.7.

9.3.1.3.  Removed Media Stream

   If the previous offer offer/answer exchange removed a media stream, or answer.

   Population of an answer
   rejected an offered media stream, an agent MUST flush the m/c-lines also depends on Valid list
   for that media stream.  It MUST terminate any STUN transactions in
   progress for that media stream.  An agent MUST remove the state of check list
   for that media stream and cancel any pending periodic checks for it.

9.3.1.4.  ICE
   processing. Continuing for Existing Media Stream

   The valid list is not affected by an updated offer/answer exchange
   unless ICE is restarting.

   If ICE processing for a media stream an agent is in the Completed
   state, the m/c-line MUST use the local candidate from the highest
   priority favored pair in the valid list Running state for each component of that media stream.  If ICE processing stream, the check
   list is in updated (the check list is irrelevant if the state is
   completed).  To do that, the Running state, a full-mode agent SHOULD populate recomputes the m/c-line for that media stream based on check list using
   the
   considerations procedures described in Section 4.1.3.

   In addition, if 5.7.  If a pair on the agent new check
   list was also on the previous check list, and its state was Waiting,
   In-Progress, Succeeded or Failed, its state is controlling, it MUST include copied over.
   Otherwise, its state is set to Frozen.

   If none of the
   a=remote-candidates attribute for each media stream check lists are active (meaning that is in the
   Completed state.  The attribute contains pairs in each
   check list are Frozen), the remote candidates from full-mode agent sets the highest priority favored first pair in
   the valid check list for each
   component of that media stream.

9.1.2.  Additional Procedures for Lite Implementations

   A passive-only agent includes its one and only candidate for each
   component of each the first media stream in an a=candidate attribute in any
   subsequent offer.  This candidate is formed identically to Waiting, and then sets
   the
   procedures for initial offers, as described state of all other pairs in Section 4.2.

9.2.  Receiving that check list for the Offer same
   component ID and Generating an Answer

   When receiving a subsequent offer within an existing session, an
   agent MUST re-apply with the verification procedures in Section 5.1
   without regard same foundation to Waiting as well.

   Next, the agent goes through each check list, starting with the results
   highest priority pair.  If a pair has a state of verification from any previous
   offer/answer exchanges.  Indeed, Succeeded, and it is possible that
   has a previous
   offer/answer exchange resulted component ID of 1, then all Frozen pairs in ICE the same check list
   with the same foundation whose component IDs are not being used, but it is used
   as 1, have their
   state set to Waiting.  If, for a consequence particular check list, there are
   pairs for each component of a subsequent exchange.

   If the offer contained a change that media stream in the a=ice-ufrag or a=ice-pwd
   attributes compared to Succeeded state,
   the previous SDP from agent moves the peer, it is a signal
   that ICE is restarting state of all Frozen pairs for this media stream.  If the first component
   of all other media streams
   are restarting, than ICE is restarting overall. (and thus in different check lists) with
   the same foundation to Waiting.

9.3.2.  Procedures for ICE
   restarts are discussed below.  Unless Lite Implementations

   If ICE is restarting for that a media stream, an agent MUST NOT change the a=ice-ufrag or a=ice-pwd
   attributes in an answer relative to the last SDP it provided.  Such a
   change can only take place in an offer.  If ICE is restarting, the
   a=ice-ufrag and a=ice-pwd attributes MUST be changed.

   An agent MUST NOT change its implementation level from its previous
   SDP unless, based on the offer, ICE procedures are being restarted start a new
   Valid list for all media streams in the offer.  In that case, it MAY change its
   level.

   An agent MUST NOT include the a=remote-candidates attribute in an
   answer.

   When the answerer generates its answer, it must decide what
   candidates to include in the answer, how to populate media stream.  It MUST remember the m/c-line,
   and how to adjust pairs in the states of ICE processing.  The rules
   previous Valid list for
   inclusion each component of candidate attributes in an answer are identical to the
   rules followed by media stream, called
   the offerer previous selected pairs, and continue to send media there as
   described in Section 9.1 for both
   full and lite implementations.  For lite implementations, those rules
   also apply 11.1.

10.  Keepalives

   All endpoints MUST send keepalives for setting each media session.  These
   keepalives serve the m/c-line.  However, additional
   considerations apply to full implementations.

9.2.1.  Additional Procedures purpose of keeping NAT bindings alive for Full Implementations

   The computation the
   media session.  These keepalives MUST be sent regardless of whether
   the m/c-line additionally depends on media stream is currently inactive, sendonly, recvonly or
   sendrecv, and regardless of the presence or absence value of the a=remote-candidates attribute in a media stream.
   If present, it means that the offerer (acting as the controlling
   agent) believed that bandwidth
   attribute.  These keepalives MUST be sent even if ICE processing has completed for that media
   stream.  In this case, the remote-candidates attribute contains the
   candidates that the answerer is supposed to use.  It is possible that not being
   utilized for the agent doesn't even know of these candidates yet; they will session at all.  The keepalive SHOULD be
   discovered shortly through sent using
   a response to format which 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 in-progress check.  The
   full-mode agent MUST populate the m/c-line is communicating with a peer that supports
   ICE.  An agent can determine that its peer supports ICE by the candidates from
   the a=remote-candidates attribute.
   presence of a=candidate attributes for each media session.  If the offer did
   peer does not contain the a=remote-candidates attribute, the
   agent follows the same procedures for populating support ICE, the m/c-line as
   described choice of a packet format for the offerer
   keepalives is a matter of local implementation.  A format which
   allows packets to easily be sent in Section 9.1.

9.3.  Updating the Check absence of actual media
   content is RECOMMENDED.  Examples of formats which readily meet this
   goal are RTP No-Op [31] and Valid Lists RTP comfort noise [25].  If the peer
   doesn't support any formats that are particularly well suited for
   keepalives, an agent SHOULD send RTP packets with an incorrect
   version number, or some other form of error which would cause them to
   be discarded by the peer.

   If there has been no packet sent on the candidate pair ICE is restarting using
   for a media stream, component for Tr seconds (where packets include those
   defined for the component (RTP or RTCP) and previous keepalives), an
   agent MUST start generate a new
   Valid list for keepalive on that media stream.  However, it retains the old Valid
   list for the purposes pair.  Tr SHOULD be
   configurable and SHOULD have a default of sending media until ICE processing
   completes, at which point 15 seconds.  Alternatively,
   if an agent has a dynamic way to discover the old Valid list is discarded and binding lifetimes of
   the new
   one is utilized intervening NATs, it can use that value to determine media and keepalive targets.

9.3.1.  Additional Procedures Tr.

   If STUN is being used for Full Implementations keepalives, a STUN Binding Indication is
   used [12].  The procedures Binding Indication SHOULD NOT contain integrity
   checks as the messages are simply discarded on receipt regardless of
   contents.  The Indication SHOULD NOT contain the PRIORITY or USE-
   CANDIDATE attributes defined in this section are applicable only to full
   implementations.

   Once document.  The Binding
   Indication is sent using the subsequent offer/answer exchange has completed, each same local and remote candidates that
   are being used for media.  An agent
   needs receiving a Binding Indication
   MUST discard it silently.  Though Binding Indications are used for
   keepalives, an agent MUST be prepared to determine the impact, if any, on the Check and Valid lists.
   Unless receive Binding Requests as
   well.  If a Binding Request is received, a response is generated as
   discussed in [12], but there is an ICE restart, an offer/answer exchange has no impact on the state of ICE processing for each media stream; that is
   determined entirely by the checks themselves.

   When ICE restarts, an
   otherwise.

   An agent MUST flush the check list for the
   affected media streams, and then recompute begin the check list and its
   states as described in Section 5.7.

   The remainder of this section describes keepalive processing when once ICE is not
   restarting.

   If the offer/answer exchange added a new media stream, the agent MUST
   create a new check list has selected
   candidates for it (and an empty Valid list usage with media, or media begins to start of
   course), as described in Section 5.7.

   If flow, whichever
   happens first.  Keepalives end once the offer/answer exchange removed a media stream, session terminates or an answer
   rejected an offered media stream, an agent MUST flush the Valid list
   media stream is removed.

11.  Media Handling

11.1.  Sending Media

   Procedures for that sending media stream.  It MUST terminate any STUN transactions in
   progress differ for that full and lite
   implementations.

11.1.1.  Procedures for Full Implementations

   Agents always send media stream. using a candidate pair, called the selected
   candidate pair.  An agent MUST remove the check list
   for that will send media stream to the remote candidate in
   the selected pair (setting the destination address and cancel any pending periodic checks for it.

   If a media stream existed previously, port of the
   packet equal to that remote candidate), and remains after will send it from the offer/
   answer exchange,
   local candidate of the agent MUST NOT modify selected pair.  When the Valid list for that
   media stream.  However, if an agent local candidate is in the Running state for that
   server or peer reflexive, media stream, the check list is updated.  To do that, originated from the agent
   recomputes base.  Media
   sent from a relayed candidate is sent from the check lists base through that
   relay, using the procedures described defined in
   Section 5.7.  If [13].

   The selected pair for a check on the new check lists was also on the
   previous check lists, and its state was Waiting, In-Progress,
   Succeeded or Failed, its state is copied over.  If component of a check on media stream is:

   o  empty if the new
   check lists does not have a state (because it's a new check on an
   existing check list, or a check on a new check list, or of the check was
   on an old check list but its state was not copied over) its state for that media stream is
   set to Frozen.

   If none of the check lists are active (meaning
      Running, and there is no previous selected pair for that component
      due to an ICE restart

   o  equal to the checks in
   each check list are Frozen), the full-mode agent sets previous selected pair for a component of a media
      stream if the first check
   in state of the check list for the first that media stream to Waiting, is
      Running, and then
   sets there was a previous selected pair for that component
      due to an ICE restart

   o  equal to the highest priority nominated pair for that component in
      the valid list if the state of all other checks in that the check list for is Completed

   If the same selected pair for at least one component ID and with the same foundation to Waiting as well.

   Next, the of a media stream is
   empty, an agent goes through each check list, starting with the
   highest priority check. MUST NOT send media for any component of that media
   stream.  If the selected pair for each component of a check media stream
   has a state value, an agent MAY send media for all components of Succeeded, and it
   has that media
   stream.

   Note that the selected pair for a component ID of 1, then all Frozen checks in the same check
   list with a media stream may not
   equal the default pair for that same foundation whose component IDs are from the most recent
   offer/answer exchange.  When this happens, the selected pair is used
   for media, not one, have
   their state set the default pair.  When ICE first completes, if the
   selected pairs aren't a match for the default pairs, the controlling
   agent sends an updated offer/answer exchange to Waiting.  If, remedy this
   disparity.  However, until that updated offer arrives, there will not
   be a match.  Furthermore, in very unusual cases, the default
   candidates in the updated offer/answer will not be a match.

11.1.2.  Procedures for Lite Implementations

   A lite implementation MUST NOT send media until it has a particular check list, there
   are checks Valid list
   that contains a candidate pair for each component of that media stream in the Succeeded
   state,
   stream.  Once that happens, the agent moves the state of all Frozen checks for the first
   component of all other MAY begin sending media streams (and thus in different check
   lists) with the same foundation to Waiting.

10.  Keepalives

   All endpoints MUST send keepalives for each
   packets.  To do that, it sends media session.  These
   keepalives serve to the purpose of keeping NAT bindings active for remote candidate in the
   media session.  These keepalives MUST be sent regardless of whether
   pair (setting the media stream is currently inactive, sendonly, recvonly or
   sendrecv, destination address and regardless port of the presence or value of packet equal to
   that remote candidate), and will send it from the bandwidth
   attribute.  These keepalives MUST be sent even if ICE is not being
   utilized local candidate.

11.1.3.  Procedures for the session at all.  The keepalive SHOULD be sent using
   a format which is supported by its peer. All Implementations

   ICE endpoints allow for
   STUN-based keepalives for UDP streams, and as such, STUN keepalives
   MUST be used when an agent is communicating has interactions with a peer that supports
   ICE. jitter buffer adaptation mechanisms.  An agent
   RTP stream can determine that its peer supports ICE by begin using one candidate, and switch to another one,
   though this happens rarely with ICE.  The newer candidate may result
   in RTP packets taking a different path through the
   presence network - one with
   different delay characteristics.  As discussed below, agents are
   encouraged to re-adjust jitter buffers when there are changes in
   source or destination address of a=candidate attributes for each media session.  If packets.  Furthermore, many
   audio codecs use the
   peer does not support ICE, marker bit to signal the choice beginning of a packet format
   talkspurt, for
   keepalives the purposes of jitter buffer adaptation.  For such
   codecs, it is a matter RECOMMENDED that the sender set the marker bit [22]
   when an agent switches transmission of local implementation.  A format which
   allows packets media from one candidate pair
   to easily another.

11.2.  Receiving Media

   ICE implementations MUST be sent prepared to receive media on each
   component on any candidates provided for that component in the absence of actual media
   content is RECOMMENDED.  Examples most
   recent offer/answer exchange (in the case of formats which readily meet RTP, this
   goal are would include
   both RTP No-Op [28] and RTP comfort noise [24].  If the peer
   doesn't support any formats that are particularly well suited RTCP if candidates were provided for
   keepalives, both).

   It is RECOMMENDED that, when an agent SHOULD send RTP packets with receives an incorrect
   version number, or some other form of error which would cause them to
   be discarded by the peer.

   If there has been no RTP packet sent on with a candidate pair being used for
   media
   new source or destination IP address for Tr seconds (where packets include media and previous
   keepalives), an agent MUST generate a keepalive on particular media stream,
   that pair.  Tr
   SHOULD be configurable and SHOULD have a default of 15 seconds.

   If STUN is being used for keepalives, a STUN Binding Indication is
   used [11].  The Binding Indication SHOULD NOT contain integrity
   checks; since the messages agent re-adjust its jitter buffers.

   RFC 3550 [22] describes an algorithm in Section 8.2 for detecting
   SSRC collisions and loops.  These algorithms are simply discarded based, in part, on receipt regardless
   of contents.  The Indication SHOULD NOT contain
   seeing different source transport addresses with the PRIORITY or USE-
   CANDIDATE attributes defined here.  The Binding Indication same SSRC.
   However, when ICE is sent
   using used, such changes will sometimes occur as the same local and remote candidates that are being used for
   media.
   media streams switch between candidates.  An agent receipt a Binding Indication MUST discard it
   silently.  Though Binding Indications are used for keepalives, an
   agent MUST will be prepared able to receive Binding Requests as well.  If
   determine that a
   Binding Request media stream is received, from the same peer as a response consequence
   of the STUN exchange that proceeds media transmission.  Thus, if
   there is generated as discussed a change in
   [11], source transport address, but there is no impact on ICE processing otherwise.

   An agent MUST begin the keepalive processing once ICE has selected
   candidates for usage with media, or media begins packets
   come from the same peer agent, this SHOULD NOT be treated as an SSRC
   collision.

12.  Usage with SIP

12.1.  Latency Guidelines

   ICE requires a series of STUN-based connectivity checks to take place
   between endpoints.  These checks start from the answerer on
   generation of its answer, and start from the offerer when it receives
   the answer.  These checks can take time to complete, and as such, the
   selection of messages to use with offers and answers can effect
   perceived user latency.  Two latency figures are of particular
   interest.  These are the post-pickup delay and the post-dial delay.
   The post-pickup delay refers to flow, whichever
   happens first.  Keepalives end once the session terminates or time between when a user "answers
   the
   media stream is removed.

11.  Media Handling

11.1.  Sending Media

   Procedures for sending media differ for full phone" and lite
   implementations.

11.1.1.  Procedures for Full Implementations

   Agents always send media using a candidate pair.  An agent will send
   media when any speech they utter can be delivered to the remote candidate in
   caller.  The post-dial delay refers to the pair (setting time between when a user
   enters the destination address for the user, and port ringback begins as a
   consequence of having successfully started ringing the packet equal to that remote candidate), and
   will send it from phone of the local candidate.  When
   called party.

   Two cases can be considered - one where the local candidate is
   server or peer reflexive, media offer is originated from present in the base.  Media
   sent from a relayed candidate
   initial INVITE, and one where it is sent through that relay, using
   procedures defined in [12].

   If the state of a media stream is Running, there response.

12.1.1.  Offer in INVITE

   To reduce post-dial delays, it is no old Valid list
   for RECOMMENDED that media stream (which would be due the caller begin
   gathering candidates prior to actually sending its initial INVITE.

   This can be started upon user interface cues that a call is pending,
   such as activity on a keypad or the phone going offhook.

   If an ICE restart), an
   agent MUST NOT send media.

   When offer is received in an agent sends media, it MUST send it using INVITE request, the highest priority
   selected pair for each component in either answerer SHOULD
   begin to gather its candidates on receipt of the old Valid list for offer and then
   generate an answer in a
   media stream (if provisional response once it exists), else the new Valid list for has completed
   that media
   stream.  In several cases, this will not be the same candidate pairs
   present in the m/c-line.  When process.  ICE first completes, if the selected
   pairs aren't requires that a match for provisional response with an SDP
   be transmitted reliably.  This can be done through the m/c-line, existing PRACK
   mechanism [9], or through an updated offer/answer
   exchange will take place optimization that is specific to remedy ICE.
   With this disparity.  However, until optimization, provisional responses containing an SDP
   answer that update offer arrives, there will not begins ICE processing for one or more media streams can
   be a match.  Furthermore,
   in very unusual cases, sent reliably without RFC 3264.  To do this, the m/c-lines in agent retransmits
   the updated offer/answer will
   not be a match.

   ICE has interactions with jitter buffer adaptation mechanisms.  An
   RTP stream can begin using one candidate, and switch to another one,
   though this happens rarely provisional response with ICE.  The newer candidate may result th exponential backoff timers described
   in RTP packets taking RFC 3262.  Retransmits MUST cease on receipt of a different path through the network - STUN Binding
   Request for one with
   different delay characteristics.  As discussed below, agents are
   encouraged to re-adjust jitter buffers when there are changes of the media streams signaled in
   source or destination address.  Furthermore, many audio codecs use that SDP (because
   receipt of a binding request indicates the marker bit offerer has received the
   answer) or on transmission of a 2xx response.  If no Binding Request
   is received prior to signal the beginning of a talkspurt, for last retransmit, the
   purposes of jitter buffer adaptation.  For such codecs, it is
   RECOMMENDED agent does not consider
   the session terminated.  Despite the fact that the sender change provisional
   response will be delivered reliably, the marker bit rules for when an agent
   switches transmission of media from one candidate pair to another.

11.1.2.  Procedures for Lite Implementations

   A lite implementation MUST NOT can
   send media until it has a Valid list
   that contains a candidate pair for each component of that media
   stream.  Once that happens, the agent MAY begin sending media
   packets.  To an updated offer or answer do that, it sends media to the remote candidate not change from those specified in
   RFC 3262.  Specifically, if the
   pair (setting INVITE contained an offer, the destination address and port same
   answer appears in all of the packet equal to
   that remote candidate), 1xx and will send it from in the local candidate.

   In cases where there 2xx response to the
   INVITE.  Only after that 2xx has been sent can an ICE restart, there will be an old
   and a new Valid list.  The old Valid list MUST updated offer/
   answer exchange occur.  This optimization SHOULD NOT be used by the agent
   for sending media until if both
   agents support PRACK.  Note that the new one optimization is complete, at which point the
   new one MUST be used, and the old one discarded.

11.2.  Receiving Media

   ICE implementations MUST be prepared very specific to receive media on any
   candidates provided in the most recent offer/answer exchange.

   It
   provisional response carrying answers that start ICE processing; it
   is RECOMMENDED that, when an agent receives an RTP packet with not a
   new source or destination IP address general technique for a particular media stream,
   that the 1xx reliability.

   Alternatively, an agent re-adjust its jitter buffers.

   RFC 3550 [21] describes MAY delay sending an algorithm answer until the 200 OK,
   however this results in Section 8.2 for detecting
   SSRC collisions a poor user experience 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 NOT
   RECOMMENDED.

   Once the answer has been sent, the
   media streams switch between candidates.  An agent will be able to
   determine that SHOULD begin its
   connectivity checks.  Once candidate pairs for each component of a
   media stream is from enter the same peer as a consequence
   of valid list, the STUN exchange that proceeds answerer can begin sending
   media transmission.  Thus, if
   there is a change in source transport address, but the on that media packets
   come from the same peer agent, stream.

   However, prior to this SHOULD NOT point, any media that needs to be treated sent towards
   the caller (such as an SSRC
   collision.

12.  Usage with SIP

12.1.  Latency Guidelines

   ICE requires a series early media [26] MUST NOT be transmitted.
   For this reason, implementations SHOULD delay alerting the called
   party until candidates for each component of STUN-based connectivity checks to take place
   between endpoints.  These checks start from each media stream have
   entered the answerer on
   generation valid list.  In the case of its answer, and start from a PSTN gateway, this would
   mean that the offerer when it receives setup message into the PSTN is delayed until this
   point.  Doing this increases the answer.  These checks can take time to complete, and as such, post-dial delay, but has the
   selection of messages to use with offers and answers can effect
   perceived user latency.  Two latency figures are
   of particular
   interest.  These eliminating 'ghost rings'.  Ghost rings are cases where the post-pickup delay called
   party hears the phone ring, picks up, but hears nothing and cannot be
   heard.  This technique works without requiring support for, or usage
   of, preconditions [6], since its a localized decision.  It also has
   the post-dial delay.

   The benefit of guaranteeing that not a single packet of media will
   get clipped, so that post-pickup delay refers is zero.  If an agent chooses
   to the time between when delay local alerting in this way, it SHOULD generate a user "answers 180
   response once alerting begins.

12.1.2.  Offer in Response

   In addition to uses where the phone" offer is in an INVITE, and when any speech they utter can be delivered to the
   caller.  The post-dial delay refers to answer
   is in the time between when a user
   enters provisional and/or 200 OK response, ICE works with cases
   where the destination address for offer appears in the user, and ringback begins as response.  In such cases, which are
   common in third party call control [18], ICE agents SHOULD generate
   their offers in a
   consequence of having succesfully started ringing reliable provisional response (which MUST utilize
   RFC 3262), and not alert the phone user on receipt of the
   called party.

   To reduce post-dial delays, it is RECOMMENDED that the caller begin
   gathering candidates prior to actually sending its initial INVITE.
   This can be started upon user interface cues  The
   answer will arrive in a PRACK.  This allows for ICE processing to
   take place prior to alerting, so that a call there is pending,
   such as activity on a keypad or no post-pickup delay,
   at the phone going offhook.

   If an offer is received in an INVITE request, expense of increased call setup delays.  Once ICE completes,
   the callee SHOULD
   immediately gather its candidates can alert the user and then generate an answer in a
   provisional response.  ICE requires that 200 OK when they
   answer.  The 200 OK would contain no SDP, since the offer/answer
   exchange has completed.

   Alternatively, agents MAY place the offer in a provisional response with
   an SDP be transmitted reliably.  This can be done through 2xx instead (in which
   case the
   existing PRACK mechanism [9], or through an optimization that is
   specific to ICE.  With this optimization, provisional responses
   containing an SDP answer that begins comes in the ACK).  When this happens, the callee
   will alert the user on receipt of the INVITE, and the ICE processing for one or more
   media streams can be sent reliably without RFC 3264.  To do this, exchanges
   will take place only after the
   agent retransmits user answers.  This has the provisional response effect of
   reducing call setup delay, but can cause substantial post-pickup
   delays and media clipping.

12.2.  SIP Option Tags and Media Feature Tags

   [14] specifies a SIP option tag and media feature tag for usage with th exponential
   backoff timers described
   ICE.  ICE implementations using SIP SHOULD support this
   specification, which uses a feature tag in RFC 3262.  Retransmits MUST cease on
   receipt registrations to
   facilitate interoperability through intermediaries.

12.3.  Interactions with Forking

   ICE interacts very well with forking.  Indeed, ICE fixes some of the
   problems associated with forking.  Without ICE, when a STUN Binding Request for one of call forks and
   the caller receives multiple incoming media streams
   signaled in that SDP or on transmission of a 2xx response.  If no
   Binding Request streams, it cannot
   determine which media stream corresponds to which callee.

   With ICE, this problem is received resolved.  The connectivity checks which
   occur prior to transmission of media carry username fragments, which
   in turn are correlated to a specific callee.  Subsequent media
   packets which arrive on the last retransmit, the agent
   does not consider the session terminated.  Despite the fact that same candidate pair as the
   provisional response connectivity
   check will be delivered reliably, associated with that same callee.  Thus, the rules for when
   an agent caller can send
   perform this correlation as long as it has received an updated offer or answer do not change from those
   specified answer.

12.4.  Interactions with Preconditions

   Quality of Service (QoS) preconditions, which are defined in RFC 3262.  Specifically, if 3312
   [6] and RFC 4032 [7], apply only to the INVITE contained an
   offer, transport addresses listed as
   the same answer appears default targets for media in all of an offer/answer.  If ICE changes the 1xx and
   transport address where media is received, this change is reflected
   in the 2xx
   response to the INVITE.  Only after that 2xx has been sent can an updated offer/answer exchange occur.  This optimization SHOULD NOT be
   used if both agents support PRACK.  Note offer which changes the default destination for media
   to match ICE's selection.  As such, it appears like any other re-
   INVITE would, and is fully treated in RFC 3312 and 4032, which apply
   without regard to the fact that the optimization destination for media is
   very specific changing
   due to provisional response carrying answers that start ICE
   processing; it is not a general technique for 1xx reliability.

   Alternatively, negotiations occurring "in the background".

   Indeed, an agent MAY delay sending an answer SHOULD NOT indicate that Qos preconditions have been
   met until the 200 OK,
   however this results in a poor user experience checks have completed and is NOT
   RECOMMENDED.

   Once the answer has been sent, selected the agent SHOULD begin its
   connectivity checks.  Once candidate pairs
   to be used for each component media.

   ICE also has (purposeful) interactions with connectivity
   preconditions [30].  Those interactions are described there.  Note
   that the procedures described in Section 12.1 describe their own type
   of a
   media stream enter "preconditions", albeit with less functionality than those
   provided by the valid list, explicit preconditions in [30].

12.5.  Interactions with Third Party Call Control

   ICE works with Flows I, III and IV as described in [18].  Flow I
   works without the callee can begin sending media
   on that media stream.

   However, prior to this point, any media that needs controller supporting or being aware of ICE.  Flow
   IV will work as long as the controller passes along the ICE
   attributes without alteration.  Flow II is fundamentally incompatible
   with ICE; each agent will believe itself to be sent towards the caller (such answerer and thus
   never generate a re-INVITE.

   The flows for continued operation, as SIP early media [25] cannot be transmitted.  For
   this reason, described in Section 7 of RFC
   3725, require additional behavior of ICE implementations SHOULD delay alerting the called party
   until candidates to support.
   In particular, if an agent receives a mid-dialog re-INVITE that
   contains no offer, it MUST restart ICE for each component of each media stream have entered
   the valid list.  In and go
   through the case process of a PSTN gateway, this would mean gathering new candidates.  Furthermore, that
   the setup message into the PSTN is delayed until this point.  Doing
   this increases the post-dial delay, but has the effect
   list of eliminating
   'ghost rings'.  Ghost rings are cases where the called party hears candidates SHOULD include the phone ring, picks up, but hears nothing and cannot be heard.
   This technique works without requiring support for, or usage of,
   preconditions [6], since its ones currently being used for
   media.

13.  Usage with ANAT

   RFC 4091 [11] defines a localized decision.  It also has the
   benefit of guaranteeing mechanism for indicating that not an agent can
   support both IPv4 and IPv6 for a single packet of media will get
   clipped, stream, and it does so that post-pickup delay by
   including two m-lines, one for v4, and one for v6.  This is zero.  If similar
   to ICE, which allows for an agent chooses to
   delay local alerting in this way, it SHOULD generate a 180 response
   once alerting begins.

   In addition to uses where indicate multiple transport
   addresses using the offer candidate attribute.

   However, ICE is in not a replacement for ANAT.  When an INVITE, agent has a v4
   and the answer v6 interface and requires just a static choice of address - use
   v6 if both support v6, else v4 - ANAT alone is used.  If an agent
   wishes the choice of v4 or v6 to be dynamic and depend on actual
   verification of connectivity, an agent would use ANAT in the provisional and/or 200 OK, ICE works with cases where the
   offer appears in the response.  In such cases, which are common in
   third party call control, ICE agents SHOULD generate their offers in
   a reliable provisional response (which concert with
   ICE.  To do that, The agent MUST utilize include two media stream alternates,
   one for v4 and one for v6, as defined in RFC 3262). 4091.  In
   that case, addition, the answer will arrive in
   agent MUST include a PRACK.  This allows v4 candidate as a session attribute for ICE
   processing to take place prior to alerting.  Once ICE completes, the
   agent can alert the user v4
   stream alternate, and then generate a 200 OK. v6 candidate as a session attribute of the v6
   stream alternate.  ICE will then perform its checks for each stream
   alternate.  The 200 OK
   would contain no SDP, since agent MUST order the offer/answer exchange has completed.
   Agents MAY place ICE selected pairs for each
   stream alternate based on their mid preference, and choose the offer in
   highest one.  This means that if ICE doesn't select any pair for a 2xx instead (in which case
   stream alternate (because, for example, no checks succeeded), the answer
   comes in
   agent will choose the ACK). next highest preference pair which was
   selected.  This flow is simpler but results in a poorer user
   experience.

   As discussed in Section 16, offer/answer exchanges SHOULD allows v6 to be secured
   against eavesdropping and man-in-the-middle attacks.  To do that, the
   usage of SIPS [3] is RECOMMENDED when used in concert with ICE.

12.2.  SIP Option Tags and Media Feature Tags

   [13] specifies if a SIP option tag v6 path can be verified,
   but to fallback to v4 if it cannot be verified.

   This extends naturally to multiple candidates for each alternate.  An
   agent MAY include multiple v4 candidates for the v4 stream alternate
   and media feature tag multiple v6 candidates for usage with
   ICE.  ICE implementations using SIP SHOULD support this
   specification, which uses a feature tag in registrations to
   facilitate interoperability through gateways.

12.3.  Interactions with Forking

   ICE interacts very well with forking.  Indeed, ICE fixes some the v6 stream alternate.  All of the
   problems associated with forking.  Without ICE, when
   candidates for a call forks v4 stream alternate MUST be v4, and all of the caller receives multiple incoming media streams, it cannot
   determine which media
   candidates for a v6 stream corresponds to which callee.

   With ICE, this problem is resolved.  The connectivity checks which
   occur prior to transmission of media carry username fragments, which
   in turn are correlated alternate MUST be v6.  This will cause ICE
   to choose a specific callee.  Subsequent media
   packets which arrive on the same 5-tuple v6 pair as long as one of the connectivity check pairs works, else it will be associated
   fall back to v4.

   Of course, an agent can use ICE with v4 and v6 candidates without
   ANAT.  In that same callee.  Thus, the caller can
   perform this correlation as long as mode, it has received an answer.

12.4.  Interactions would have just a single media stream, with Preconditions

   Quality of Service (QoS) preconditions, which are defined in RFC 3312
   [6] a
   default destination that is either v4 or v6.  The candidates can
   include both v4 and RFC 4032 [7], apply only v6 candidates.  This brings an agent the
   flexibility of choosing a v4 candidate even if a v6 candidate
   validates, perhaps due to differing path characteristics measured
   dynamically by the transport addresses listed agent.  That kind of flexibility is not possible
   when ANAT is used.

14.  Extensibility Considerations

   This specification makes very specific choices about how both agents
   in a session coordinate to arrive at the m/c lines in an offer/answer.  If ICE set of candidate pairs that
   are selected for media.  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 transport
   address where media is received, this priority
   algorithm.  When such a change is reflected in made, providing interoperability
   between the m/c
   lines of two agents in a new offer/answer.  As such, it appears like any other re-
   INVITE would, and session is fully treated in RFC 3312 and 4032, which apply
   without regard to the fact that critical.

   First, ICE provides the m/c lines are changing due a=ice-options SDP attribute.  Each extension
   or change to ICE
   negotiations ocurring "in the background".

   Indeed, is associated with a token.  When an agent SHOULD NOT indicate that Qos preconditions have been
   met until the ICE checks have completed and selected
   supporting such an extension or change generates an offer or an
   answer, it MUST include the candidate
   pairs to be used token for media.

   ICE also has (purposeful) interactions with connectivity
   preconditions [27].  Those interactions are described there.  Note that the procedures described extension in Section 12.1 describe their own type
   of "preconditions", albeit with less functionality than those
   provided by this
   attribute.  This allows each side to know what the explicit preconditions in [27].

12.5.  Interactions with Third Party Call Control

   ICE works with Flows I, III and IV as described in [17].  Flow I
   works without other side is
   doing.  This attribute MUST NOT be present if the controller supporting agent doesn't
   support any ICE extensions or changes.

   At this time, no IANA registry or being aware registration procedures are defined
   for these option tags.  At time of ICE.  Flow
   IV writing, it is unclear whether ICE
   changes and extensions will work as long as the controller passes along be sufficiently common to warrrant a
   registry.

   One of the ICE
   attributes without alteration.  Flow II complications in achieving interoperability is fundamentally incompatible
   with ICE; each agent will believe itself 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 answerer and thus
   never generate a re-INVITE. same
   candidate pairs.  The flows for continued operation, as regular nomination procedure described in
   Section 7 of RFC
   3725, require additional behavior 8 eliminates some of ICE implementations the tight coordination by delegating the
   selection algorithm completely to support.
   In particular, if an the controlling agent.
   Consequently, when a controlling agent receives is communicating with a mid-dialog re-INVITE peer
   that
   contains no offer, supports options it doesn't know about, the agent MUST restart run a
   regular nomination algorithm.  When regular nomination is used, ICE
   will converge perfectly even when both agents use different pair
   prioritization algorithms.  One of the keys to such convergence are
   triggered checks, which ensure that the nominated pair is validated
   by both agents.  Consequently, any future ICE enhancements MUST
   preserve triggered checks.

   ICE is also extensible to other media streams beyond RTP, and for
   transport protocols beyond UDP.  Extensions to ICE for each non-RTP media stream
   streams need to specify how many components they utilize, and go
   through the process of gathering assign
   component IDS to them, starting at 1 for the most important component
   ID.  Specifications for new candidates.  Furthermore, that
   list of candidates SHOULD include transport protocols must define how, if
   at all, various steps in the ones currently in-use.

13. ICE processing differ from UDP.

15.  Grammar

   This specification defines seven new SDP attributes - the
   "candidate", "remote-candidates", "ice-lite", "ice-ufrag", "ice-mismatch", "ice-
   ufrag", "ice-pwd"
   "ice-options" and "ice-mismatch" "ice-options" attributes.

15.1.  "candidate" Attribute

   The candidate attribute is a media-level attribute only.  It contains
   a transport address for a candidate that can be used for connectivity
   checks.

   The syntax of this attribute is defined using Augmented BNF as
   defined in RFC 4234 [8]:

   candidate-attribute   = "candidate" ":" foundation SP component-id SP
                           transport SP
                           priority SP
                           connection-address SP     ;from RFC 4566
                           port         ;port defined using Augmented BNF as
   defined in RFC 4234 [8]:

   candidate-attribute   = "candidate" ":" foundation SP component-id SP
                           transport SP
                           priority SP
                           connection-address SP     ;from RFC 4566
                           port         ;port from RFC 4566
                           SP cand-type
                           [SP rel-addr]
                           [SP rel-port]
                           *(SP extension-att-name SP
                                extension-att-value)

   foundation            = 1*ice-char
   component-id          = 1*DIGIT
   transport             = "UDP" / transport-extension
   transport-extension   = token              ; from RFC 3261
   priority              = 1*DIGIT
   cand-type             = "typ" SP candidate-types
   candidate-types       = "host" / "srflx" / "prflx" / "relay" / token
   rel-addr              = "raddr" SP connection-address
   rel-port              = "rport" SP port
   extension-att-name    = byte-string    ;from RFC 4566
   extension-att-value   = byte-string
   ice-char              = ALPHA / DIGIT / "+" / "/"

   This grammar encodes the primary information about a candidate: its
   IP address, port and transport protocol, and its properties: the
   foundation, component ID, priority, type, and related transport
   address:

   <connect-address>:  is taken from RFC 4566 [10].  It is the IP
      address of the candidate, allowing for IPv4 addresses, IPv6
      addresses and FQDNs.  An IP address SHOULD be used, but an FQDN
      MAY be used in place of an IP address.  In that case, when
      receiving an offer or answer containing an FQDN in an a=candidate
      attribute, the FQDN is looked up in the DNS using an A or AAAA
      record, and the resulting IP address is used for the remainder of
      ICE processing.

   <port>:  is also taken from RFC 4566
                           [SP cand-type]
                           [SP rel-addr]
                           [SP rel-port]
                           *(SP extension-att-name SP
                                extension-att-value)

   foundation            = 1*ice-char
   component-id          = 1*DIGIT
   transport             = "UDP" / transport-extension
   transport-extension   = token              ; from RFC 3261
   priority              = 1*DIGIT
   cand-type             = "typ" SP candidate-types
   candidate-types       = "host" / "srflx" / "prflx" / "relay" / token
   rel-addr              = "raddr" SP connection-address
   rel-port              = "rport" SP [10].  It is the port
   extension-att-name    = byte-string    ;from RFC 4566
   extension-att-value   = byte-string
   ice-char              = ALPHA / DIGIT / "+" / "/"

   The foundation of the
      candidate.

   <transport>:  indicates the transport protocol for the candidate.
      This specification only defines UDP.  However, extensibility is
      provided to allow for future transport protocols to be used with
      ICE, such as TCP or the Datagram Congestion Control Protocol
      (DCCP) [32].

   <foundation>:  is composed of one or more ice-char. <ice-char>.  It is an
      identifier that is equivalent for two candidates that are of the
      same type, share the same base, and come from the same STUN
      server.  The component-id foundation is used to optimize ICE performance in the
      Frozen algorithm.

   <component-id>:  is a positive integer, integer between 1 and 256 which
      identifies the specific component of the media stream for which the transport address
      this is a candidate.  It MUST start at 1 and MUST increment by 1
      for each component of a particular candidate.
   The connect-address production is taken from RFC 4566 [10], allowing  For media streams
      based on RTP, candidates for IPv4 addresses, IPv6 addresses and FQDNs.  The port production is
   also taken from RFC 4566 [10].  The token production is taken from
   RFC 3261 [3].  The transport production indicates the transport
   protocol actual RTP media MUST have a
      component ID of 1, and candidates for RTCP MUST have a component
      ID of 2.  Other types of media streams which require multiple
      components MUST develop specifications which define the candidate.  This specification only defines UDP.
   However, extensibility is provided mapping of
      components to allow component IDs.  See Section 14 for future transport
   protocols additional
      discussion on extending ICE to be used with ICE, such as TCP or the Datagram Congestion
   Control Protocol (DCCP) [29].

   The cand-type production new media streams.

   <priority>:  is a positive integer between 1 and (2**32 - 1).

   <cand-type>:  encodes the type of candidate.  This specification
      defines the values "host", "srflx", "prflx" and "relay" for host,
      server reflexive, peer reflexive and relayed candidates,
      respectively.  The set of candidate types is extensible for the
      future.  Inclusion of

   <rel-addr> and <rel-port>:  convey transport addresses related to the
      candidate, useful for diagnostics and other purposes. <rel-addr>
      and <rel-port> MUST be present for server reflexive, peer
      reflexive and relayed candidates.  If a candidate type is optional.  The rel-addr server or
      peer reflexive, <rel-addr> and rel-port productions convey information <rel-port> is equal to the related transport
   addresses.  Rules base for inclusion of these values
      that server or peer reflexive candidate.  If the candidate is described
      relayed, <rel-addr> and <rel-port> is equal to the mapped address
      in
   Section 4.3. the Allocate Response that provided the client with that
      relayed candidate (see Appendix B.3 for a discussion of its
      purpose).  If the candidate is a host candidate <rel-addr> and
      <rel-port> MUST be omitted.

   The a=candidate candidate attribute can itself be extended.  The grammar allows
   for new name/value pairs to be added at the end of the attribute.  An
   implementation MUST ignore any name/value pairs it doesn't
   understand.

15.2.  "remote-candidates" Attribute

   The syntax of the "remote-candidates" attribute is defined using
   Augmented BNF as defined in RFC 4234 [8].  The remote-candidates
   attribute is a media level attribute only.

   remote-candidate-att = "remote-candidates" ":" remote-candidate
                           0*(SP remote-candidate)
   remote-candidate = component-ID SP connection-address SP port

   The attribute contains a connection-address and port for each
   component.  The ordering of components is irrelevant.  However, a
   value MUST be present for each component of a media stream.  This
   attribute MUST be included in an offer by a controlling agent for a
   media stream that is Completed, and MUST NOT be included in any other
   case.

15.3.  "ice-lite" and "ice-mismatch" Attributes

   The syntax of the "ice-lite" and "ice-mismatch", "ice-mismatch" attributes, both of
   which are flags, is:

   ice-lite               = "ice-lite"
   ice-mismatch           = "ice-mismatch"

   "ice-lite" is a session level attribute only, and indicates that an
   agent is a lite implementation. "ice-mismatch" is a media level
   attribute only. only, and when present in an answer, indicates that the
   offer arrived with a default destination for a media component that
   didn't have a corresponding candidate attribute.

15.4.  "ice-ufrag" and "ice-pwd" Attributes

   The syntax of "ice-ufrag" and "ice-pwd" attributes convey the "ice-pwd" username fragment
   and "ice-
   ufrag" attributes are defined as: password used by ICE for message integrity.  Their syntax is:

   ice-pwd-att           = "ice-pwd" ":" password
   ice-ufrag-att         = "ice-ufrag" ":" ufrag
   password              = 22*ice-char
   ufrag                 = 4*ice-char

   The "ice-pwd" and "ice-ufrag" attributes can appear at either the
   session-level or media-level.  When present in both, the value in the
   media-level takes precedence.  Thus, the value at the session level
   is effectively a default that applies to all media streams, unless
   overriden by a media-level value.

   The "ice-options" attribute is a session level attribute.  It
   contains a series of tokens which identify the options supported by
   the agent.  Its grammar is:

   ice-options           = "ice-options" ":" ice-option-tag
                             0*(SP ice-option-tag)
   ice-option-tag        = 1*ice-char

14.  Extensibility Considerations

   This specification makes very specific choices about how both agents
   in a session coordinate to arrive  Whether present at the set of candidate pairs that
   are selected for media.  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.

   Firstly, ICE provides the a=ice-options SDP attribute.  Each
   extension or change to ICE is associated with a token.  When an agent
   supporting such an extension or change generates an offer or an
   answer, it
   media level, there MUST include the token be an ice-pwd and ice-ufrag attribute for that extension in this
   attribute.  This allows
   each side to know what the other side is
   doing.  This attribute media stream.  If two media streams have identical ice-ufrag's,
   they MUST NOT be present if the agent doesn't
   support any ICE extensions or changes.

   At this time, no IANA registry or registration procedures are defined
   for these option tags.  At time of writing, it is unclear whether ICE
   changes have identical ice-pwd's.

   The ice-ufrag and extensions will ice-pwd attributes MUST be sufficiently common to warrrant chosen randomly at the
   beginning of a
   registry.

   One session.  The ice-ufrag attribute MUST contain at
   least 24 bits of randomness, and the complications in achieving interoperability is that ICE
   relies on a distributed algorithm running on both agents to converge
   on an agreed set ice-pwd attribute MUST contain
   at least 128 bits of candidate pairs.  If randomness.  This means that the two agents run different
   algorithms, it can ice-ufrag
   attribute will be difficult to guarantee convergence on at least 4 characters long, and the same
   candidate pairs. ice-pwd at
   least 22 characters long, since the grammar for these attributes
   allows for 6 bits of randomness per character.  The introspective selection procedure described in
   Section 8 eliminates some attributes MAY be
   longer than 4 and 22 characters respectively, of course.

15.5.  "ice-options> Attribute

   The "ice-options" attribute is a session level attribute.  It
   contains a series of tokens which identify the tight coordination options supported by delegating the
   selection algorithm completely to
   the controlling agent.
   Consequently, when a controlling agent  Its grammar is:

   ice-options           = "ice-options" ":" ice-option-tag
                             0*(SP ice-option-tag)
   ice-option-tag        = 1*ice-char

16.  Example

   The example is communicating with a peer
   that supports options it doesn't know about, based on the agent MUST run an
   introspective selection algorithm.  When introspective selection is
   used, ICE will converge perfectly even when both agents use different
   pair prioritization algorithms.  One simplified topology of the keys to such convergence
   are triggered checks, which ensure that the favored pair is validated
   by both agents.  Consequently, any future ICE enhancements MUST
   preserve triggered checks. Figure 15.

                             +-----+
                             |     |
                             |STUN |
                             | Srvr|
                             +-----+
                                |
                     +---------------------+
                     |                     |
                     |      Internet       |
                     |                     |
                     |                     |
                     +---------------------+
                       |                |
                       |                |
                +---------+             |
                |  NAT    |             |
                +---------+             |
                     |                  |
                     |                  |
                     |                  |
                  +-----+            +-----+
                  |     |            |     |
                  |  L  |            |  R  |
                  |     |            |     |
                  +-----+            +-----+

                        Figure 15: Example Topology

   Two agents, L and R, are using ICE.  Both are full-mode ICE
   implementations.  Both agents have a single IPv4 interface.  For
   agent L, it is 10.0.1.1, 10.0.1.1 in private address space [28], and for agent
   R, 192.0.2.1. 192.0.2.1 on the public Internet.  Both are configured with a single the
   same STUN server each (indeed, (shown in this example for simplicity, although in
   practice the agents do not need to use the same one for
   each), STUN server), which
   is listening for STUN requests at an IP address of 192.0.2.2 and port
   3478.  This STUN server supports only the Binding Discovery usage;
   relays are not used in this example.  Agent L is behind a NAT, and
   agent R is on the public Internet.  The NAT has an endpoint
   independent mapping property and an address dependent filtering
   property.  The public side of the NAT has an IP address of 192.0.2.3.

   To facilitate understanding, transport addresses are listed using
   variables that have mnemonic names.  The format of the name is
   entity-type-seqno, where entity refers to the entity whose interface
   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, and "PRIV" for transport addresses that are private.
   Finally, 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.

   The STUN server has advertised transport address STUN-PUB-1 (which is
   192.0.2.2:3478) for the binding discovery usage.

   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.

   The call flow examples omit STUN authentication operations and RTCP,
   and focus on RTP for a single media stream between two full
   implementations.

           L             NAT           STUN             R
           |RTP 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) Offer     |              |              |
           |------------------------------------------->|
           |              |              |              |RTP 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) answer    |              |              |
           |<-------------------------------------------|
           |              |(9) Bind Req  |              |
           |              |S=$R-PUB-1    |              |
           |              |D=L-PRIV-1    |              |
           |              |<----------------------------|
           |              |Dropped       |              |
           |(10) Bind Req |              |              |
           |S=$L-PRIV-1   |              |              |
           |D=$R-PUB-1    |              |              |
           |USE-CAND      |              |              |
           |------------->|              |              |
           |              |(11) Bind Req |              |
           |              |S=$NAT-PUB-1  |              |
           |              |D=$R-PUB-1    |              |
           |              |USE-CAND      |              |
           |              |---------------------------->|
           |              |(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 |              |              |
           |<-------------|              |              |
           |RTP flows     |              |              |
           |              |(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   |              |
           |              |---------------------------->|
           |              |              |              |RTP flows

                          Figure 11 16: Example Flow

   First, agent L obtains a host candidate from its local interface (not
   shown), and from that, sends a STUN Binding Request to the STUN
   server to get a server reflexive candidate (messages 1-4).  Recall
   that the NAT has the address and port independent mapping property.
   Here, it creates a binding of NAT-PUB-1 for this UDP request, and
   this becomes the server reflexive candidate for RTP.

   Agent L sets a type preference of 126 for the host candidate and 100
   for the server reflexive.  The local preference is 65535.  Based on
   this, the priority of the host candidate is 2130706178 and for the
   server reflexive candidate is 1694498562.  The host candidate is
   assigned a foundation of 1, and the server reflexive, a foundation of
   2.  It chooses its server reflexive candidate as the in-use default
   candidate, and encodes it into the m/c-line. m and c lines.  The resulting
   offer (message 5) looks like (lines folded for clarity):

    v=0
    o=jdoe 2890844526 2890842807 IN IP4 $L-PRIV-1.IP
    s=
    c=IN IP4 $NAT-PUB-1.IP
    t=0 0
    a=ice-pwd:asd88fgpdd777uzjYhagZg
    a=ice-ufrag:8hhY
    m=audio $NAT-PUB-1.PORT RTP/AVP 0
    a=rtpmap:0 PCMU/8000
    a=candidate:1 1 UDP 2130706178 $L-PRIV-1.IP $L-PRIV-1.PORT typ local
    a=candidate:2 1 UDP 1694498562 $NAT-PUB-1.IP $NAT-PUB-1.PORT typ srflx raddr
$L-PRIV-1.IP rport $L-PRIV-1.PORT

   The offer, with the variables replaced with their values, will look
   like (lines folded for clarity):

       v=0
       o=jdoe 2890844526 2890842807 IN IP4 10.0.1.1
       s=
       c=IN IP4 192.0.2.3
       t=0 0
       a=ice-pwd:asd88fgpdd777uzjYhagZg
       a=ice-ufrag:8hhY
       m=audio 45664 RTP/AVP 0
       a=rtpmap:0 PCMU/8000
       a=candidate:1 1 UDP 2130706178 10.0.1.1 8998 typ local
       a=candidate:2 1 UDP 1694498562 192.0.2.3 45664 typ srflx raddr
   10.0.1.1 rport 8998

   This offer is received at agent R. Agent R will obtain a host
   candidate, and from it, obtain a server reflexive candidate (messages
   6-7).  Since R is not behind a NAT, this candidate is identical to
   its host candidate, and they share the same base.  It therefore
   discards this redundant candidate and ends up with a single host
   candidate.  With identical type and local preferences as L, the
   priority for this candidate is 2130706178.  It chooses a foundation
   of 1 for its single candidate.  Its resulting answer looks like:

      v=0
      o=bob 2808844564 2808844564 IN IP4 $R-PUB-1.IP
      s=
      c=IN IP4 $R-PUB-1.IP
      t=0 0
      a=ice-pwd:YH75Fviy6338Vbrhrlp8Yh
      a=ice-ufrag:9uB6
      m=audio $R-PUB-1.PORT RTP/AVP 0
      a=rtpmap:0 PCMU/8000
      a=candidate:1 1 UDP 2130706178 $R-PUB-1.IP $R-PUB-1.PORT typ local

   With the variables filled in:

       v=0
       o=bob 2808844564 2808844564 IN IP4 192.0.2.1
       s=
       c=IN IP4 192.0.2.1
       t=0 0
       a=ice-pwd:YH75Fviy6338Vbrhrlp8Yh
       a=ice-ufrag:9uB6
       m=audio 3478 RTP/AVP 0
       a=rtpmap:0 PCMU/8000
       a=candidate:1 1 UDP 2130706178 192.0.2.1 3478 typ local
   Since neither side indicated that they are passive-only, lite, the agent which sent
   the offer that began ICE processing (agent L) becomes the controlling
   agent.

   Agents L and R both pair up the candidates.  They both initially have
   two.
   two pairs.  However, agent L will prune the pair containing its
   server reflexive candidate, resulting in just one.  At agent L, this
   pair
   (the check) has a local candidate of $L_PRIV_1 and remote candidate of
   $R_PUB_1, and has a candidate pair priority of 4.57566E+18 (note that
   an implementation would represent this as a 64 bit integer so as not
   to lose precision).  At agent R, there are two checks. pairs.  The highest
   priority has a local candidate of $R_PUB_1 and remote candidate of
   $L_PRIV_1 and has a priority of 4.57566E+18, and the second has a
   local candidate of $R_PUB_1 and remote candidate of $NAT_PUB_1 and
   priority 3.63891E+18.

   Agent R begins its connectivity check (message 9) for the first pair
   (between the two host candidates).  Since R is the passive controlled agent
   for this session, the check omits the USE-CANDIDATE attribute.  The
   host candidate from agent L is private and behind a different NAT, and thus
   this check is discarded. won't be successful, because the packet cannot be routed
   from R to L.

   When agent L gets the answer, it performs its one and only
   connectivity check (messages 10-13).  It implements the default
   algorithm for candidate selection, aggressive
   nomination algorithm, and thus includes a USE-CANDIDATE attribute in
   this check.  Since the check succeeds, agent L creates a new pair,
   whose local candidate is from the mapped address in the binding
   response (NAT-PUB-1 from message 13) and whose remote candidate is
   the destination of the request (R-PUB-1 from message 10).  This is
   added to the valid list.  In addition, it is marked as selected since
   the Binding Request contained the USE-CANDIDATE attribute.  Since
   there is a selected candidate in the Valid list for the one component
   of this media stream, ICE processing for this stream moves into the
   Completed state.  Agent L can now send media if it so chooses.

   Upon receipt of the check STUN Binding Request from agent L (message 11),
   agent R will generate its triggered check.  This check happens to
   match the next one on its check list - from its host candidate to
   agent L's server reflexive candidate.  This check (messages 14-17)
   will succeed.  Consequently, agent R constructs a new candidate pair
   using the mapped address from the response as the local candidate
   (R-PUB-1) and the destination of the request (NAT-PUB-1) as the
   remote candidate.  This pair is added to the Valid list for that
   media stream.  Since the check was generated in the reverse direction
   of a check that contained the USE-CANDIDATE attribute, the candidate
   pair is marked as selected.  Consequently, processing for this stream
   moves into the Completed state, and agent R can also send media.

16.

17.  Security Considerations

   There are several types of attacks possible in an ICE system.  This
   section considers these attacks and their countermeasures.

16.1.

17.1.  Attacks on Connectivity Checks

   An attacker might attempt to disrupt the STUN connectivity checks.
   Ultimately, all of these attacks fool an agent into thinking
   something incorrect about the results of the connectivity checks.
   The possible false conclusions an attacker can try and cause are:

   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 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
      media.

   False Peer-Reflexive Candidate:  An attacker can cause an agent to
      discover a new peer reflexive candidate, when it shouldn't have.
      This can be used to redirect media streams to a DoS target or to
      the attacker, for eavesdropping or other purposes.

   False Valid on False Candidate:  An attacker has already convinced an
      agent that there is a candidate with an address that doesn't
      actually route to that agent (for example, by injecting a false
      peer reflexive candidate or false server reflexive candidate).  It
      must then launch an attack that forces the agents to believe that
      this candidate is valid.

   Of the various techniques for creating faked STUN messages described
   in [11], [12], many are not applicable for the connectivity checks.
   Compromises of STUN servers are not much of a concern, since the STUN
   servers are embedded in endpoints and distributed throughout the
   network.  Thus, compromising the peer's embedded STUN server is
   equivalent to comprimising the endpoint, and if that happens, far
   more problematic attacks are possible than those against ICE.
   Similarly, DNS attacks are usually irrelevant since STUN servers are
   not typically discovered via DNS, they are normally signaled via IP
   addresses embedded in SDP.  If the SDP does contain an FQDN for a
   host, then connectivity checks would be susceptible to the DNS
   vulnerabilities described in [12]; however it is far more common to
   use IP addresses.  Injection of fake responses and relaying modified
   requests all can be handled in ICE with the countermeasures discussed
   below.

   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 600.  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, layer 2
   network disruption, or other technique.  If it doesn't do this, the
   success response will also reach the originator, alerting it to a
   possible attack.  Fortunately, this attack is mitigated completely
   through the STUN message integrity mechanism.  The attacker needs to
   inject a fake response, and in order for this response to be
   processed, the attacker needs the password.  If the offer/answer
   signaling is secured, the attacker will not have the password.

   Forcing the fake valid result works in a similar way.  The agent
   needs to wait for the Binding Request from each agent, and inject a
   fake success response.  The attacker won't need to worry about
   disrupting the actual response since, if the candidate is not valid,
   it presumably wouldn't be received anyway.  However, like the fake
   invalid attack, this attack is mitigated completely through the STUN
   message integrity and offer/answer security techniques.

   Forcing the false peer reflexive candidate result can be done either
   with 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 must 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 offer/answer
   exchanges.

   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 must also prevent the
   original request from reaching the remote agent, either by 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 will be sent to that
   false candidate.  The attacker must then intercept receive it and relay it
   towards the originator.

   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.  Injecting
   of fake requests or responses to achieve this goal is prevented using
   the integrity mechanisms of STUN and the offer/answer exchange.
   Thus, this attack can only be launched through replays.  To do that,
   the attacker must intercept the check towards this false candidate,
   and replay it towards the other agent.  Then, it must intercept the
   response and replay that back as well.

   This attack is very hard to launch unless the attacker themself 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 (for example, 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 themself is identified by the fake candidate the
   attack is easier to coordinate.  However, if SRTP is used [22], [23], the
   attacker will not be able to play the media packets, they will only
   be able to discard them, effectively disabling the media stream for
   the call.  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 media stream, its much
   easier to just disrupt it with the same mechanism, rather than attack
   ICE.

16.2.

17.2.  Attacks on Address Gathering

   ICE endpoints make use of STUN for gathering candidates rom from a STUN
   server in the network.  This is corresponds to the Binding Discovery
   usage of STUN described in [11]. [12].  As a consequence, the attacks
   against STUN itself that are described in that specification can
   still be used against the binding discovery usage when utilized with
   ICE.

   However, the additional mechanisms provided by ICE actually
   counteract such attacks, making binding discovery with STUN more
   secure when combined with ICE than without ICE.

   Consider an attacker which is able to provide an agent with a faked
   mapped address in a STUN Binding Request that is used for address
   gathering.  This is the primary attack primitive described in [11]. [12].
   This address will be used as a server reflexive candidate in the ICE
   exchange.  For this candidate to actually be used for media, the
   attacker must also 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 third party, fourth party (neither the
   offerer, answerer, or attacker), since it requires attacking the
   checks generated by each agent in the session, and is prevented by
   SRTP if it identifies the attacker themself.

   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 media.  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.

16.3.

17.3.  Attacks on the Offer/Answer Exchanges

   An attacker that can modify or disrupt the offer/answer exchanges
   themselves can readily launch a variety of attacks with ICE.  They
   could direct media to a target of a DoS attack, they could insert
   themselves into the media stream, and so on.  These are similar to
   the general security considerations for offer/answer exchanges, and
   the security considerations in RFC 3264 [4] apply.  These require
   techniques for message integrity and encryption for offers and
   answers, which are satisfied by the SIPS mechanism [3] when SIP is
   used.  As such, the usage of SIPS with ICE is RECOMMENDED.

16.4.

17.4.  Insider Attacks

   In addition to attacks where the attacker is a third party trying to
   insert fake offers, answers or stun messages, there are several
   attacks possible with ICE when the attacker is an authenticated and
   valid participant in the ICE exchange.

16.4.1.

17.4.1.  The Voice Hammer Attack

   The voice hammer attack is an amplification attack.  In this attack,
   the attacker initiates sessions to other agents, and maliciously
   includes the IP address and port of a DoS target as the destination
   for media traffic signaled in the m/c-line of their SDP.  This causes substantial
   amplification; a single offer/answer exchange can create a continuing
   flood of media packets, possibly at high rates (consider video
   sources).  This attack is not specific to ICE, but ICE can help
   provide remediation.

   Specifically, if ICE is used, the agent receiving the malicious SDP
   will first peform perform connectivity checks to the target of media before
   sending it media there.  If this target is a third party host, the
   checks will not succeed, and media is never sent.

   Unfortunately, ICE doesn't help if its not used, in which case an
   attacker could simply send the offer without the ICE parameters.
   However, in environments where the set of clients are known, and
   limited to ones that support ICE, the server can reject any offers or
   answers that don't indicate ICE support.

16.4.2.

17.4.2.  STUN Amplification Attack

   The STUN amplification attack is similar to the voice hammer.
   However, instead of voice packets being directed to the target, STUN
   connectivity checks are directed to the target.  This attack is
   accomplished by having the offerer send  The attacker sends
   an offer with a large number of candidates, say 50.  The answerer
   receives the offer, and starts its checks, which are directed at the
   target, and consequently, never generate a response.  The answerer
   will start a new connectivity check every 20ms, and each check is a
   STUN transaction consisting of 7 transmissions of a message 65 bytes
   in length (plus 28 bytes for the IP/UDP header) that runs for 7.9
   seconds, for a total of 58 bytes/second per transaction on average.
   In the worst case, there can be 395 transactions in progress at once
   (7.9 seconds divided by 20ms), for a total of 182 kbps, just for STUN
   requests.

   It is impossible to eliminate the amplification, but the volume can
   be reduced through a variety of heuristics.  Agents SHOULD limit the
   total number of connectivity checks they perform to 100.
   Additionally, agents MAY limit the number of candidates they'll
   accept in an offer or answer.

16.5.

17.5.  Interactions with Application Layer Gateways and SIP

   Application Layer Gateways (ALGs) are functions present in a NAT
   device which inspect the contents of packets and modify them, in
   order to facilitate NAT traversal for application protocols.  Session
   Border Controllers (SBC) are close cousins of ALGs, but are less
   transparent since they actually exist as application layer SIP
   intermediaries.  ICE has interactions with SBCs and ALGs.

   If an ALG is SIP aware but not ICE aware, ICE will work through it as
   long as the ALG correctly modifies the m/c-lines of SDP.  In this case, correctly
   means that the ALG does not modify m/c-lines with the m and c lines or the rtcp
   attribute if they contain external addresses.  If the m/c-line contains they contain
   internal addresses, but
   ones for which a public binding exists, the ALG replaces modification depends on the state of the ALG.
   If the ALG already has a binding established that maps an external
   port to an internal IP address and port in m and c lines or rtcp
   attribute , the m/c-line with the public binding. ALG uses that binding instead of creating a new one.
   Unfortunately, many ALG are known to work poorly in these corner
   cases.  ICE does not try to work around broken ALGs, as this is
   outside the scope of its functionality.  ICE can help diagnose these
   conditions, which often show up as a mismatch between the set of
   candidates and the m/c-line. the m and c lines and rtcp attributes.  The a=ice-mismatch parameter ice-
   mismatch attribute is used for this purpose.

   ICE works best through ALGs when the signaling is run over TLS.  This
   prevents the ALG from manipulating the SDP messages and interfering
   with ICE operation.  Implementations which are expected to be
   deployed behind ALGs SHOULD provide for TLS transport of the SDP.

   If an SBC is SIP aware but not ICE aware, the result depends on the
   behavior of the SBC.  If it is acting as a proper Back-to-Back User
   Agent (B2BUA), the SBC will remove any SDP attributes it doesn't
   understand, including the ICE attributes.  Consequently, the call
   will appear to both endpoints as if the other side doesn't support
   ICE.  This will result in ICE being disabled, and media flowing
   through the SBC, if they the SBC has requested it.  If, however, the SBC
   passes the ICE attributes without modification, yet modifies the m/c-
   lines,
   default destination for media (contained in the m and c lines and
   rtcp attribute), this will be detected as an ICE mismatch, and ICE
   processing is aborted for the call.  It is outside of the scope of
   ICE for it to act as a tool for "working around" SBCs.  If one is
   present, ICE will not be used and the SBC techniques take precedence.

17.

18.  Definition of Connectivity Check Usage

   STUN [11] [12] requires that new usages provide a specific set of
   information as part of their formal definition.  This section meets
   the requirements spelled out there.

17.1.

18.1.  Applicability

   This STUN usage provides a connectivity check between two peers
   participating in an offer/answer exchange.  This check serves to
   validate a pair of candidates for usage of exchange of media.
   Connectivity checks also allow agents to discover reflexive
   candidates towards their peers, called peer reflexive candidates.
   Finally, connectivity checks serve this usage allows a Binding Indication to be used to keep
   NAT bindings alive.

   It is fundamental to this STUN usage that the addresses and ports
   used for media are the same ones used for the Binding Requests and
   responses.  Consequently, it will be necessary to demultiplex STUN
   traffic from whatever the media traffic is. applications on that same port (e.g., RTP or RTCP).
   This demultiplexing is done using the techniques described in [11].

17.2. [12].

18.2.  Client Discovery of Server

   The client does not follow the DNS-based procedures defined in [11]. [12].
   Rather, the remote candidate of the check to be performed is used as
   the transport address of the STUN server.  Note that the STUN server
   is a logical entity, and is not a physically distinct server in this
   usage.

17.3.

18.3.  Server Determination of Usage

   The server is aware of this usage because it signaled this port
   through the offer/answer exchange.  Any transport
   addresses in its candidates on which it expects to receive STUN
   packets.  Consequently, any STUN packets received on this
   port the base of a
   candidate offered in SDP will be for the connectivity check usage.

17.4.

18.4.  New Requests or Indications

   This usage does not define any new message types.

17.5.

18.5.  New Attributes

   This usage defines two new attributes, PRIORITY and USE-CANDIDATE.

   The PRIORITY attribute indicates the priority that is to be
   associated with a peer reflexive candidate, should one be discovered
   by this check.  It is a 32 bit unsigned integer, and has an attribute
   type
   value of 0x0024.

   The USE-CANDIDATE attribute indicates that the candidate pair
   resulting from this check should be used for transmission of media.
   The attribute has no content (the Length field of the attribute is
   zero); it serves as a flag.  It has an attribute type value of 0x0025.

17.6.

18.6.  New Error Response Codes

   This usage does not define any new error response codes.

17.7.

18.7.  Client Procedures

   Client procedures are defined in Section 7.1.

17.8.

18.8.  Server Procedures

   Server procedures are defined in Section 7.2.

17.9.

18.9.  Security Considerations for Connectivity Check

   Security considerations for the connectivity check are discussed in
   Section 16.

18. 17.

19.  IANA Considerations

   This specification registers new SDP attributes and new STUN
   attributes.

18.1.

19.1.  SDP Attributes

   This specification defines seven new SDP attributes per the
   procedures of Section 8.2.4 of [10].  The required information for
   the registrations are included here.

18.1.1.

19.1.1.  candidate Attribute

   Contact Name:  Jonathan Rosenberg, jdrosen@jdrosen.net.

   Attribute Name:  candidate

   Long Form:  candidate

   Type of Attribute:  media level

   Charset Considerations:  The attribute is not subject to the charset
      attribute.

   Purpose:  This attribute is used with Interactive Connectivity
      Establishment (ICE), and provides one of many possible candidate
      addresses for communication.  These addresses are validated with
      an end-to-end connectivity check using Simple Traversal Underneath
      NAT (STUN).

   Appropriate Values:  See Section 13 15 of RFC XXXX [Note to RFC-ed:
      please replace XXXX with the RFC number of this specification].

18.1.2.

19.1.2.  remote-candidates Attribute

   Contact Name:  Jonathan Rosenberg, jdrosen@jdrosen.net.

   Attribute Name:  remote-candidates
   Long Form:  remote-candidates

   Type of Attribute:  media level

   Charset Considerations:  The attribute is not subject to the charset
      attribute.

   Purpose:  This attribute is used with Interactive Connectivity
      Establishment (ICE), and provides the identity of the remote
      candidates that the offerer wishes the answerer to use in its
      answer.

   Appropriate Values:  See Section 13 15 of RFC XXXX [Note to RFC-ed:
      please replace XXXX with the RFC number of this specification].

18.1.3.

19.1.3.  ice-lite Attribute

   Contact Name:  Jonathan Rosenberg, jdrosen@jdrosen.net.

   Attribute Name:  ice-lite

   Long Form:  ice-lite

   Type of Attribute:  session level

   Charset Considerations:  The attribute is not subject to the charset
      attribute.

   Purpose:  This attribute is used with Interactive Connectivity
      Establishment (ICE), and indicates that an agent has the minimum
      functionality required to support ICE inter-operation with a peer
      that has a full implementation.

   Appropriate Values:  See Section 13 15 of RFC XXXX [Note to RFC-ed:
      please replace XXXX with the RFC number of this specification].

18.1.4.

19.1.4.  ice-mismatch Attribute

   Contact Name:  Jonathan Rosenberg, jdrosen@jdrosen.net.

   Attribute Name:  ice-mismatch

   Long Form:  ice-mismatch

   Type of Attribute:  session level
   Charset Considerations:  The attribute is not subject to the charset
      attribute.

   Purpose:  This attribute is used with Interactive Connectivity
      Establishment (ICE), and indicates that an agent is ICE capable,
      but did not proceed with ICE due to a mismatch of candidates with
      the values default destination for media signaled in the m/c-line. SDP.

   Appropriate Values:  See Section 13 15 of RFC XXXX [Note to RFC-ed:
      please replace XXXX with the RFC number of this specification].

18.1.5.

19.1.5.  ice-pwd Attribute

   Contact Name:  Jonathan Rosenberg, jdrosen@jdrosen.net.

   Attribute Name:  ice-pwd

   Long Form:  ice-pwd

   Type of Attribute:  session or media level

   Charset Considerations:  The attribute is not subject to the charset
      attribute.

   Purpose:  This attribute is used with Interactive Connectivity
      Establishment (ICE), and provides the password used to protect
      STUN connectivity checks.

   Appropriate Values:  See Section 13 15 of RFC XXXX [Note to RFC-ed:
      please replace XXXX with the RFC number of this specification].

18.1.6.

19.1.6.  ice-ufrag Attribute

   Contact Name:  Jonathan Rosenberg, jdrosen@jdrosen.net.

   Attribute Name:  ice-ufrag

   Long Form:  ice-ufrag

   Type of Attribute:  session or media level

   Charset Considerations:  The attribute is not subject to the charset
      attribute.

   Purpose:  This attribute is used with Interactive Connectivity
      Establishment (ICE), and provides the fragments used to construct
      the username in STUN connectivity checks.

   Appropriate Values:  See Section 13 15 of RFC XXXX [Note to RFC-ed:
      please replace XXXX with the RFC number of this specification].

18.1.7.

19.1.7.  ice-options Attribute

   Contact Name:  Jonathan Rosenberg, jdrosen@jdrosen.net.

   Attribute Name:  ice-options

   Long Form:  ice-options

   Type of Attribute:  session level

   Charset Considerations:  The attribute is not subject to the charset
      attribute.

   Purpose:  This attribute is used with Interactive Connectivity
      Establishment (ICE), and indicates the ICE options or extensions
      used by the agent.

   Appropriate Values:  See Section 13 15 of RFC XXXX [Note to RFC-ed:
      please replace XXXX with the RFC number of this specification].

18.2.

19.2.  STUN Attributes

   This section registers two new STUN attributes per the procedures in
   [11].
   [12].

      0x0024 PRIORITY
      0x0025 USE-CANDIDATE

19.

20.  IAB Considerations

   The IAB has studied the problem of "Unilateral Self Address Fixing",
   which is the general process by which a agent attempts to determine
   its address in another realm on the other side of a NAT through a
   collaborative protocol reflection mechanism [20]. [21].  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 signficant impact on the issues raised by IAB.
   Indeed, ICE can be considered a B-SAF (Bilateral Self-Address Fixing)
   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.

19.1.

20.1.  Problem Definition

   From RFC 3424 any UNSAF proposal must provide:

      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; this is why "short term fixes
      usually aren't".

   The specific problems being solved by ICE are:

      Provide a means for two peers to determine the set of transport
      addresses which can be used for communication.

      Provide a means for resolving many of the limitations of other
      UNSAF mechanisms by wrapping them in an additional layer of
      processing (the ICE methodology).

      Provide a means for a agent to determine an address that is
      reachable by another peer with which it wishes to communicate.

19.2.

20.2.  Exit Strategy

   From RFC 3424, any UNSAF proposal must provide:

      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 which have
   nothing to do with NAT.  However, what ICE does is help phase out
   other UNSAF mechanisms.  ICE effectively selects amongst those
   mechanisms, prioritizing ones that are better, and deprioritizing
   ones that are worse.  Local IPv6 addresses can be preferred.  As NATs
   begin to dissipate as IPv6 is introduced, server reflexive and
   relayed candidates (both forms of UNSAF mechanisms) 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 remove when their usage goes to zero.

   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.

19.3.

20.3.  Brittleness Introduced by ICE

   From RFC3424, any UNSAF proposal must provide:

      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, traditional STUN (as described in RFC 3489 [14]) [15]) has
   several points of brittleness.  One of them is the discovery process
   which requires a agent to try and 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.

   Another point of brittleness in traditional 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 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.

   Another point of brittleness in traditional STUN is that it assumes
   that 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.

   The most troubling point of brittleness in traditional 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.

   Traditional STUN also introduces some security considerations.
   Fortunately, those security considerations are also mitigated by ICE.

   Consequently, ICE serves to repair the brittleness introduced in
   other UNSAF mechanisms, and does not introduce any additional
   brittleness into the system.

19.4.

20.4.  Requirements for a Long Term Solution

   From RFC 3424, any UNSAF proposal must provide:

      Identify requirements for longer term, sound technical solutions
      -- contribute to the process of finding the right longer term
      solution.

   Our conclusions from STUN remain unchanged.  However, we feel ICE
   actually helps because we believe it can be part of the long term
   solution.

19.5.

20.5.  Issues with Existing NAPT Boxes

   From RFC 3424, any UNSAF proposal must provide:

      Discussion of the impact of the noted practical issues with
      existing, deployed NA[P]Ts and experience reports.

   A number of NAT boxes are now being deployed into the market which
   try and provide "generic" ALG functionality.  These generic ALGs hunt
   for IP addresses, either in text or binary form within a packet, and
   rewrite them if they match a binding.  This interferes with
   traditional STUN.  However, the update to STUN [11] [12] uses an encoding
   which hides these binary addresses from generic ALGs.  Since [11] is
   required for all ICE implementations, this NAPT problem does not
   impact ICE.

   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 15s, which is a very conservative
   estimate.  Eventually, over time, as NAT boxes become compliant to
   behave [31], [34], this minimum keepalive will become deterministic 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.

20.

21.  Acknowledgements

   The authors would like to thank Dan Wing, Eric Rescorla, Flemming
   Andreasen, Rohan Mahy, Dean Willis, Eric Cooper, Dan Wing, Jason Fischl,
   Douglas Otis, Tim Moore, Jean-Francois Mule, and Francois Audet for
   their comments and input.  A special thanks goes to Bill May, who
   suggested several of the concepts in this specification, Philip
   Matthews, who suggested many of the key performance optimizations in
   this specification, Eric Rescorla, who drafted the text in the
   introduction, and Magnus Westerlund, for doing several detailed
   reviews on the various revisions of this specification.

21.

22.  References

21.1.

22.1.  Normative References

   [1]   Bradner, S., "Key words for use in RFCs to Indicate Requirement
         Levels", BCP 14, RFC 2119, March 1997.

   [2]   Huitema, C., "Real Time Control Protocol (RTCP) attribute in
         Session Description Protocol (SDP)", RFC 3605, October 2003.

   [3]   Rosenberg, J., Schulzrinne, H., Camarillo, G., Johnston, A.,
         Peterson, J., Sparks, R., Handley, M., and E. Schooler, "SIP:
         Session Initiation Protocol", RFC 3261, June 2002.

   [4]   Rosenberg, J. and H. Schulzrinne, "An Offer/Answer Model with
         Session Description Protocol (SDP)", RFC 3264, June 2002.

   [5]   Casner, S., "Session Description Protocol (SDP) Bandwidth
         Modifiers for RTP Control Protocol (RTCP) Bandwidth", RFC 3556,
         July 2003.

   [6]   Camarillo, G., Marshall, W., and J. Rosenberg, "Integration of
         Resource Management and Session Initiation Protocol (SIP)",
         RFC 3312, October 2002.

   [7]   Camarillo, G. and P. Kyzivat, "Update to the Session Initiation
         Protocol (SIP) Preconditions Framework", RFC 4032, March 2005.

   [8]   Crocker, D. and P. Overell, "Augmented BNF for Syntax
         Specifications: ABNF", RFC 4234, October 2005.

   [9]   Rosenberg, J. and H. Schulzrinne, "Reliability of Provisional
         Responses in Session Initiation Protocol (SIP)", RFC 3262,
         June 2002.

   [10]  Handley, M., Jacobson, V., and C. Perkins, "SDP: Session
         Description Protocol", RFC 4566, July 2006.

   [11]  Camarillo, G. and J. Rosenberg, "The Alternative Network
         Address Types (ANAT) Semantics for the Session Description
         Protocol (SDP) Grouping Framework", RFC 4091, June 2005.

   [12]  Rosenberg, J., "Simple Traversal Underneath Network Address
         Translators (NAT) (STUN)", draft-ietf-behave-rfc3489bis-05
         (work in progress), October 2006.

   [12]

   [13]  Rosenberg, J., "Obtaining Relay Addresses from Simple Traversal
         Underneath NAT (STUN)", draft-ietf-behave-turn-02 (work in
         progress), October 2006.

   [13]

   [14]  Rosenberg, J., "Indicating Support for Interactive Connectivity
         Establishment (ICE) in the  Session Initiation Protocol (SIP)",
         draft-ietf-sip-ice-option-tag-00 (work in progress),
         January 2007.

21.2.

22.2.  Informative References

   [14]

   [15]  Rosenberg, J., Weinberger, J., Huitema, C., and R. Mahy, "STUN
         - Simple Traversal of User Datagram Protocol (UDP) Through
         Network Address Translators (NATs)", RFC 3489, March 2003.

   [15]

   [16]  Senie, D., "Network Address Translator (NAT)-Friendly
         Application Design Guidelines", RFC 3235, January 2002.

   [16]

   [17]  Srisuresh, P., Kuthan, J., Rosenberg, J., Molitor, A., and A.
         Rayhan, "Middlebox communication architecture and framework",
         RFC 3303, August 2002.

   [17]

   [18]  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,
         April 2004.

   [18]

   [19]  Borella, M., Lo, J., Grabelsky, D., and G. Montenegro, "Realm
         Specific IP: Framework", RFC 3102, October 2001.

   [19]

   [20]  Borella, M., Grabelsky, D., Lo, J., and K. Taniguchi, "Realm
         Specific IP: Protocol Specification", RFC 3103, October 2001.

   [20]

   [21]  Daigle, L. and IAB, "IAB Considerations for UNilateral Self-
         Address Fixing (UNSAF) Across Network Address Translation",
         RFC 3424, November 2002.

   [21]

   [22]  Schulzrinne, H., Casner, S., Frederick, R., and V. Jacobson,
         "RTP: A Transport Protocol for Real-Time Applications",
         RFC 3550, July 2003.

   [22]

   [23]  Baugher, M., McGrew, D., Naslund, M., Carrara, E., and K.
         Norrman, "The Secure Real-time Transport Protocol (SRTP)",
         RFC 3711, March 2004.

   [23]

   [24]  Carpenter, B. and K. Moore, "Connection of IPv6 Domains via
         IPv4 Clouds", RFC 3056, February 2001.

   [24]

   [25]  Zopf, R., "Real-time Transport Protocol (RTP) Payload for
         Comfort Noise (CN)", RFC 3389, September 2002.

   [25]

   [26]  Camarillo, G. and H. Schulzrinne, "Early Media and Ringing Tone
         Generation in the Session Initiation Protocol (SIP)", RFC 3960,
         December 2004.

   [26]

   [27]  Blake, S., Black, D., Carlson, M., Davies, E., Wang, Z., and W.
         Weiss, "An Architecture for Differentiated Services", RFC 2475,
         December 1998.

   [27]

   [28]  Rekhter, Y., Moskowitz, R., Karrenberg, D., Groot, G., and E.
         Lear, "Address Allocation for Private Internets", BCP 5,
         RFC 1918, February 1996.

   [29]  Audet, F. and C. Jennings, "Network Address Translation (NAT)
         Behavioral Requirements for Unicast UDP", BCP 127, RFC 4787,
         January 2007.

   [30]  Andreasen, F., "Connectivity Preconditions for Session
         Description Protocol Media Streams",
         draft-ietf-mmusic-connectivity-precon-02 (work in progress),
         June 2006.

   [28]

   [31]  Andreasen, F., "A No-Op Payload Format for RTP",
         draft-ietf-avt-rtp-no-op-00 (work in progress), May 2005.

   [29]

   [32]  Kohler, E., Handley, M., and S. Floyd, "Datagram Congestion
         Control Protocol (DCCP)", RFC 4340, March 2006.

   [30]

   [33]  Hellstrom, G. and P. Jones, "RTP Payload for Text
         Conversation", RFC 4103, June 2005.

   [31]

   [34]  Audet, F. and C. Jennings, "NAT Behavioral Requirements for
         Unicast UDP", draft-ietf-behave-nat-udp-08 (work in progress),
         October 2006.

   [32]

   [35]  Jennings, C. and R. Mahy, "Managing Client Initiated
         Connections in the Session Initiation Protocol  (SIP)",
         draft-ietf-sip-outbound-07 (work in progress), January 2007.

   [33]

   [36]  Rescorla, E., "Overview of the Lite Implementation of
         Interactive Connectivity Establishment (ICE)",
         draft-ietf-mmusic-ice-lite-00.txt (work in progress),
         January 2007.

Appendix A.  Lite and Full Implementations

   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.

   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 which
   is, by itself, not behind a NAT and not one that would worry about
   NAT traversal.  Examples include gateways to the PSTN, media servers,
   conference bridges, and application servers. 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 through 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.

   Consequently, a lite implementation is only appropriate for devices
   that will always *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.

   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, a full implementation is preferable if achievable.
   A full implementation will reduce call setup times.  Full
   implementations also obtain the security benefits of ICE unrelated to
   NAT traversal; in particular, the voice hammer attack described in
   Section 16 17 is prevented only for full implementations, not lite.
   Finally, it is often the case that a device which 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
   lifetime of a device or product, that it will always be used on the
   public Internet.  Full implementation provides assurance that
   communications will always work.

Appendix B.  Design Motivations

   ICE contains a number of normative behaviors which may themselves be
   simple, but derive from complicated or non-obvious thinking or use
   cases which merit further discussion.  Since these design motivations
   are not neccesary to understand for purposes of implementation, they
   are discussed here in an appendix to the specification.  This section
   is non-normative.

B.1.  Pacing of STUN Transactions

   STUN transactions used to gather candidates and to verify
   connectivity are paced out at an approximate rate of one new
   transaction every Ta seconds, milliseconds, where Ta has a default of 20ms.
   Why are these transactions paced, and why was 20ms chosen as default?

   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.  Furthermore,
   transmission of these packets on the network makes use of bandwidth
   and needs to be rate limited by the agent.  As a consequence, the
   pacing ensures that the NAT devices does not get overloaded and that
   traffic is kept at a reasonable rate.

B.2.  Candidates with Multiple Bases

   Section 4.1.1 talks about merging together candidates that are
   identical but have different bases.  When can an agent have two
   candidates that have the same IP address and port, but different
   bases?  Consider the topology of Figure 17: 22:

          +----------+
          | STUN Srvr|
          +----------+
               |
               |
             -----
           //     \\
          |         |
         |  B:net10  |
          |         |
           \\     //
             -----
               |
               |
          +----------+
          |   NAT    |
          +----------+
               |
               |
             -----
           //     \\
          |    A    |
         |192.168/16 |
          |         |
           \\     //
             -----
               |
               |
               |192.168.1.1        -----
          +----------+           //     \\           +----------+
          |          |          |         |          |          |
          | Offerer  |---------|  C:net10  |---------| Answerer |
          |          |10.0.1.1  |         | 10.0.1.2 |          |
          +----------+           \\     //           +----------+
                                   -----

           Figure 17 22: Identical Candidates with Different Bases

   In this case, the offerer is multi-homed.  It has one interface,
   10.0.1.1, on network C, which is a net 10 private network.  The
   Answerer is on this same network.  The offerer is also connected to
   network A, which is 192.168/16.  The offerer has an interface of
   192.168.1.1 on this network.  There is a NAT on this network, natting
   into network B, which is another net10 net 10 private network, but not
   connected to network C. There is a STUN server on network B.

   The offerer obtains a host candidate on its interface on network C
   (10.0.1.1:2498) and a host candidate on its interface on network A
   (192.168.1.1:3344).  It performs a STUN query to its configured STUN
   server from 192.168.1.1:3344.  This query passes through the NAT,
   which happens to assign the binding 10.0.1.1:2498.  The STUN server
   reflects this in the STUN Binding Response.  Now, the offerer has
   obtained a server reflexive candidate with a transport address that
   is identical to a host candidate (10.0.1.1:2498).  However, the
   server reflexive candidate has a base of 192.168.1.1:3344, and the
   host candidate has a base of 10.0.1.1:2498.

B.3.  Purpose of the Translation

   When a candidate is relayed, the SDP offer or answer contain both the
   relayed candidate <rel-addr> and its translation.  However, the translation is
   never <rel-port> Attributes

   The candidate attribute contains two values that are not used at all
   by ICE itself. itself - <rel-addr> and <rel-port>.  Why is it present in the message? present?

   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 the translation, it, an 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 and not the others, this provides
   useful diagnostics on what is going on in the network.

   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 media traffic.  They can then interact, through policy servers,
   with access routers in the network, to establish guaranteed QoS for
   the media flows.  This QoS is provided by classifying the RTP traffic
   based on 5-tuple, and then providing it a guaranteed rate, or marking
   its Diffserv codepoints appropriately.  When a residential NAT is
   present, and a relayed candidate gets selected for media, this
   relayed candidate will be a transport address on an actual STUN
   relay.  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 translation of server reflexive candidate towards that relayed address relay
   is needed.  By carrying the translation in the SDP, the proxy can use
   that transport address to request QoS from the access router.

B.4.  Importance of the STUN Username

   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 SDP offer/answer
   exchange.  The need for this mechanism goes beyond just security; it
   is actual required for correct operation of ICE in the first place.

   Consider agents A, B, L, R, and C. A Z. L and B R are within private enterprise 1,
   which is using 10.0.0.0/8.  C  Z is within private enterprise 2, which
   is also using 10.0.0.0/8.  As it turns out, B R and C Z both have IP
   address 10.0.1.1.  A  L sends an offer to C. C, Z. Z, in its answer, provides
   A
   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, B 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 B R is prepared to accept STUN
   messages on those ports, just as C Z is.  A  L will send a STUN request to
   10.0.1.1:8866 and and another to 10.0.1.1:8877.  However, these do
   not go to C Z as expected.  Instead, they go to B! R!  If B R just replied
   to them, A L would believe it has connectivity to C, Z, when in fact it
   has connectivity to a completely different user, B. R. To fix this, the
   STUN short term credential mechanisms are used.  The username
   fragments are sufficiently random that it is highly unlikely that B R
   would be using the same values as A. Z. Consequently, B 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 offer/answer session.

   An unfortunate consequence of the non-uniqueness of IP addresses is
   that, in the above example, B 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 in SDP 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 B, R, but rather is the agent side of some
   protocol.  This decreases the probability of hitting a port in-use, 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 should be prepared for it.  Note that this is not a 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 Sequence Number Formula

   The sequence number for a candidate pair has an odd form.  It is:

      pair priority = 2^32*MIN(O-P,A-P) + 2*MAX(O-P,A-P) + (O-P>A-P?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
   maximum of the two sequence numbers.  For pairs that have the same
   value of the maximum sequence number, the minimum sequence number is
   used to sort amongst them.  If the max and the min sequence numbers
   are the same, the offerers priority is used as the tie breaker 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 desired sorting property.

B.6.  The Frozen State

   The Frozen state is used for two purposes.  Firstly, it allows ICE to
   first perform checks for the first component of a media stream.  Once
   a successful check has completed for the first component, the other
   components of the same type and local preference will get performed.
   Secondly, when there are multiple media streams, it allows ICE to
   first check candidates for a single media stream, and once a set of
   candidates has been found, candidates of that same type for other
   media streams can be checked first.  This effectively 'caches' the
   results of a check for one media stream, and applies them to another.
   For example, if only the relayed candidates for audio (which were the
   last resort candidates) succeed, ICE will check the relayed
   candidates for video first.

B.7.  The remote-candidates attribute

   The a=remote-candidates attribute exists to eliminate a race
   condition between the updated offer and the response to the STUN
   Binding Request that moved a candidate into the Valid list.  This
   race condition is shown in Figure 18. 23.  On receipt of message 4, agent
   A
   L adds a candidate pair to the valid list.  If there was only a
   single media stream with a single component, agent A L could now send
   an updated offer.  However, the check from agent B R has not yet
   generated a response, and agent B R receives the updated offer (message
   7) before getting the response (message 10).  Thus, it does not yet
   know that this particular pair is valid.  To eliminate this
   condition, the actual candidates at B R that were selected by the
   offerer (the remote candidates) are included in the offer itself.
   Note, however, that agent B R will not send media until it has received
   this STUN response.

          Agent A L               Network               Agent B R
             |(1) Offer            |                     |
             |------------------------------------------>|
             |(2) Answer           |                     |
             |<------------------------------------------|
             |(3) STUN Req.        |                     |
             |------------------------------------------>|
             |(4) STUN Res.        |                     |
             |<------------------------------------------|
             |(5) STUN Req.        |                     |
             |<------------------------------------------|
             |(6) STUN Res.        |                     |
             |-------------------->|                     |
             |                     |Lost                 |
             |(7) Offer            |                     |
             |------------------------------------------>|
             |(8) Answer           |                     |
             |<------------------------------------------|
             |(9) STUN Req.        |                     |
             |<------------------------------------------|
             |(10) STUN Res.       |                     |
             |------------------------------------------>|

                      Figure 18

B.8. 23: Race Condition Flow

B.7.  Why are Keepalives Needed?

   Once media 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 media stream packets themselves (e.g.,
   RTP) meet this objective.  However, several cases merit further
   discussion.  Firstly, in some RTP usages, such as SIP, the media
   streams can be "put on hold".  This is accomplished by using the SDP
   "sendonly" or "inactive" attributes, as defined in RFC 3264 [4].  RFC
   3264 directs implementations to cease transmission of media in these
   cases.  However, doing so may cause NAT bindings to timeout, and
   media won't be able to come off hold.

   Secondly, some RTP payload formats, such as the payload format for
   text conversation [30], [33], may send packets so infrequently that the
   interval exceeds the NAT binding timeouts.

   Thirdly, if silence suppression is in use, long periods of silence
   may cause media transmission to cease sufficiently long for NAT
   bindings to time out.

   For these reasons, the media packets themselves cannot be relied
   upon.  ICE defines a simple periodic keepalive that operates
   independently of media transmission.  This makes its bandwidth
   requirements highly predictable, and thus amenable to QoS
   reservations.

B.9.

B.8.  Why Prefer Peer Reflexive Candidates?

   Section 4.1.2 describes procedures for computing the priority of
   candidate based on its type and local preferences.  That section
   requires that the type preference for peer reflexive candidates
   always be lower than server reflexive.  Why is that?  The reason has
   to do with the security considerations in Section 16. 17.  It is much
   easier for an attacker to cause an agent to use a false server
   reflexive candidate than it is for an attacker to cause an agent to
   use a false peer reflexive candidate.  Consequently, attacks against
   the STUN binding discovery usage are thwarted by ICE by preferring
   the peer reflexive candidates.

B.10.

B.9.  Why Send an Updated Offer?

   Section 11.1 describes rules for sending media.  Both agents can send
   media once ICE checks complete, without waiting for an updated offer.
   Indeed, the only purpose of the updated offer is to "correct" the
   m/c-line SDP
   so that it the default destination for media matches where media is
   being sent, sent based on ICE
   procedures. procedures (which will be the highest
   priority nominated candidate pair).

   This begs the question - why is the updated offer/answer exchange
   needed at all?  Indeed, in a pure offer/answer environment, it would
   not be.  The offerer and answerer will agree on the candidates to use
   through ICE, and then can begin using them.  As far as the agents
   themselves are concerned, the updated offer/answer provides no new
   information.  However, in practice, numerous components along the
   signaling path look at the SDP information.  These include entities
   performing off-path QoS reservations, NAT traversal components such
   as ALGs and Session Border Controllers (SBCs) and diagnostic tools
   that passively monitor the network.  For these tools to continue to
   function without change, the core property of SDP - that the m/c-
   lines represent
   existing, pre-ICE definitions of the addresses used for media - the m
   and c lines and the rtcp attribute - must be retained.  For this
   reason, an updated offer must be sent.

B.11.

B.10.  Why are Binding Indications Used for Keepalives?

   Media keepalives are described in Section 10.  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?
   The primary reason has to do with network QoS mechanisms.  Once media
   begins flowing, network elements will assume that the media stream
   has a fairly regular structure, making use of periodic packets at
   fixed intervals, with the possibility of jitter.  If an agent is
   sending media packets, and then receives a Binding Request, it would
   need to generate a response packet along with its media packets.
   This will increase the actual bandwidth requirements for the 5-tuple
   carrying the media 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
   media.

   Additionally, using a Binding Indication allows integrity to be
   disabled, allowing for better performance.  This is useful for large
   scale endpoints, such as PSTN gateways. gateways and SBCs.

Author's Address

   Jonathan Rosenberg
   Cisco Systems
   600 Lanidex Plaza
   Parsippany,
   Edison, NJ  07054
   US

   Phone: +1 973 952-5000
   Email: jdrosen@cisco.com
   URI:   http://www.jdrosen.net

Full Copyright Statement

   Copyright (C) The IETF Trust (2007).

   This document is subject to the rights, licenses and restrictions
   contained in BCP 78, and except as set forth therein, the authors
   retain all their rights.

   This document and the information contained herein are provided on an
   "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS
   OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY, THE IETF TRUST AND
   THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS
   OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF
   THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
   WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

Intellectual Property Statement

   The IETF takes no position regarding the validity or scope of any
   Intellectual Property Rights or other rights that might be claimed to
   pertain to the implementation or use of the technology described in
   this document or the extent to which any license under such rights
   might or might not be available; nor does it represent that it has
   made any independent effort to identify any such rights.  Information
   on the procedures with respect to rights in RFC documents can be
   found in BCP 78 and BCP 79.

   Copies of IPR disclosures made to the IETF Secretariat and any
   assurances of licenses to be made available, or the result of an
   attempt made to obtain a general license or permission for the use of
   such proprietary rights by implementers or users of this
   specification can be obtained from the IETF on-line IPR repository at
   http://www.ietf.org/ipr.

   The IETF invites any interested party to bring to its attention any
   copyrights, patents or patent applications, or other proprietary
   rights that may cover technology that may be required to implement
   this standard.  Please address the information to the IETF at
   ietf-ipr@ietf.org.

Disclaimer of Validity

   This document and the information contained herein are provided on an
   "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS
   OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET
   ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED,
   INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE
   INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
   WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

Copyright Statement

   Copyright (C) The Internet Society (2007).  This document is subject
   to the rights, licenses and restrictions contained in BCP 78, and
   except as set forth therein, the authors retain all their rights.

Acknowledgment

   Funding for the RFC Editor function is currently provided by the
   Internet Society. IETF
   Administrative Support Activity (IASA).