| draft-ietf-mmusic-ice-13.txt | | draft-ietf-mmusic-ice-14.txt | |
| | | | |
| MMUSIC J. Rosenberg | | MMUSIC J. Rosenberg | |
|
| Internet-Draft Cisco Systems | | Internet-Draft Cisco | |
| Expires: July 20, 2007 January 16, 2007 | | Intended status: Standards Track March 5, 2007 | |
| | | Expires: September 6, 2007 | |
| | | | |
| Interactive Connectivity Establishment (ICE): A Methodology for Network | | Interactive Connectivity Establishment (ICE): A Methodology for Network | |
| Address Translator (NAT) Traversal for Offer/Answer Protocols | | Address Translator (NAT) Traversal for Offer/Answer Protocols | |
|
| draft-ietf-mmusic-ice-13 | | draft-ietf-mmusic-ice-14 | |
| | | | |
| Status of this Memo | | Status of this Memo | |
| | | | |
| By submitting this Internet-Draft, each author represents that any | | By submitting this Internet-Draft, each author represents that any | |
| applicable patent or other IPR claims of which he or she is aware | | 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 | | 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. | | aware will be disclosed, in accordance with Section 6 of BCP 79. | |
| | | | |
| Internet-Drafts are working documents of the Internet Engineering | | Internet-Drafts are working documents of the Internet Engineering | |
| Task Force (IETF), its areas, and its working groups. Note that | | Task Force (IETF), its areas, and its working groups. Note that | |
| | | | |
| skipping to change at page 1, line 34 | | skipping to change at page 1, line 35 | |
| and may be updated, replaced, or obsoleted by other documents at any | | and may be updated, replaced, or obsoleted by other documents at any | |
| time. It is inappropriate to use Internet-Drafts as reference | | time. It is inappropriate to use Internet-Drafts as reference | |
| material or to cite them other than as "work in progress." | | material or to cite them other than as "work in progress." | |
| | | | |
| The list of current Internet-Drafts can be accessed at | | The list of current Internet-Drafts can be accessed at | |
| http://www.ietf.org/ietf/1id-abstracts.txt. | | http://www.ietf.org/ietf/1id-abstracts.txt. | |
| | | | |
| The list of Internet-Draft Shadow Directories can be accessed at | | The list of Internet-Draft Shadow Directories can be accessed at | |
| http://www.ietf.org/shadow.html. | | http://www.ietf.org/shadow.html. | |
| | | | |
|
| This Internet-Draft will expire on July 20, 2007. | | This Internet-Draft will expire on September 6, 2007. | |
| | | | |
| Copyright Notice | | Copyright Notice | |
| | | | |
|
| Copyright (C) The Internet Society (2007). | | Copyright (C) The IETF Trust (2007). | |
| | | | |
| Abstract | | Abstract | |
| | | | |
| This document describes a protocol for Network Address Translator | | This document describes a protocol for Network Address Translator | |
|
| (NAT) traversal for multimedia session signaling protocols based on | | (NAT) traversal for multimedia sessions established with the offer/ | |
| the offer/answer model, such as the Session Initiation Protocol | | answer model. This protocol is called Interactive Connectivity | |
| (SIP). This protocol is called Interactive Connectivity | | | |
| Establishment (ICE). ICE makes use of the Session Traversal | | Establishment (ICE). ICE makes use of the Session Traversal | |
| Utilities for NAT (STUN) protocol, applying its binding discovery and | | Utilities for NAT (STUN) protocol, applying its binding discovery and | |
| relay usages, in addition to defining a new usage for checking | | relay usages, in addition to defining a new usage for checking | |
|
| connectivity between peers. | | 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 | | Table of Contents | |
| | | | |
|
| 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 5 | | 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 6 | |
| 2. Overview of ICE . . . . . . . . . . . . . . . . . . . . . . . 5 | | 2. Overview of ICE . . . . . . . . . . . . . . . . . . . . . . . 7 | |
| 2.1. Gathering Candidate Addresses . . . . . . . . . . . . . . 7 | | 2.1. Gathering Candidate Addresses . . . . . . . . . . . . . . 9 | |
| 2.2. Connectivity Checks . . . . . . . . . . . . . . . . . . . 9 | | 2.2. Connectivity Checks . . . . . . . . . . . . . . . . . . . 11 | |
| 2.3. Sorting Candidates . . . . . . . . . . . . . . . . . . . . 10 | | 2.3. Sorting Candidates . . . . . . . . . . . . . . . . . . . . 12 | |
| 2.4. Frozen Candidates . . . . . . . . . . . . . . . . . . . . 11 | | 2.4. Frozen Candidates . . . . . . . . . . . . . . . . . . . . 13 | |
| 2.5. Security for Checks . . . . . . . . . . . . . . . . . . . 11 | | 2.5. Security for Checks . . . . . . . . . . . . . . . . . . . 14 | |
| 2.6. Concluding ICE . . . . . . . . . . . . . . . . . . . . . . 12 | | 2.6. Concluding ICE . . . . . . . . . . . . . . . . . . . . . . 14 | |
| 2.7. Lite Implementations . . . . . . . . . . . . . . . . . . . 13 | | 2.7. Lite Implementations . . . . . . . . . . . . . . . . . . . 16 | |
| 3. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 13 | | 3. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 16 | |
| 4. Sending the Initial Offer . . . . . . . . . . . . . . . . . . 16 | | 4. Sending the Initial Offer . . . . . . . . . . . . . . . . . . 19 | |
| 4.1. Full Implementation Requirements . . . . . . . . . . . . . 16 | | 4.1. Full Implementation Requirements . . . . . . . . . . . . . 19 | |
| 4.1.1. Gathering Candidates . . . . . . . . . . . . . . . . . 16 | | 4.1.1. Gathering Candidates . . . . . . . . . . . . . . . . . 19 | |
| 4.1.2. Prioritizing Candidates . . . . . . . . . . . . . . . 18 | | 4.1.1.1. Host Candidates . . . . . . . . . . . . . . . . . 20 | |
| 4.1.3. Choosing In-Use Candidates . . . . . . . . . . . . . . 20 | | 4.1.1.2. Server Reflexive and Relayed Candidates . . . . . 20 | |
| 4.2. Lite Implementation . . . . . . . . . . . . . . . . . . . 20 | | 4.1.1.3. Eliminating Redundant Candidates . . . . . . . . . 21 | |
| 4.3. Encoding the SDP . . . . . . . . . . . . . . . . . . . . . 21 | | 4.1.1.4. Computing Foundations . . . . . . . . . . . . . . 21 | |
| 5. Receiving the Initial Offer . . . . . . . . . . . . . . . . . 22 | | 4.1.1.5. Keeping Candidates Alive . . . . . . . . . . . . . 22 | |
| 5.1. Verifying ICE Support . . . . . . . . . . . . . . . . . . 23 | | 4.1.2. Prioritizing Candidates . . . . . . . . . . . . . . . 22 | |
| 5.2. Determining Role . . . . . . . . . . . . . . . . . . . . . 23 | | 4.1.2.1. Recommended Formula . . . . . . . . . . . . . . . 22 | |
| 5.3. Gathering Candidates . . . . . . . . . . . . . . . . . . . 24 | | 4.1.2.2. Guidelines for Choosing Type and Local | |
| 5.4. Prioritizing Candidates . . . . . . . . . . . . . . . . . 24 | | Preferences . . . . . . . . . . . . . . . . . . . 23 | |
| 5.5. Choosing In Use Candidates . . . . . . . . . . . . . . . . 24 | | 4.1.3. Choosing Default Candidates . . . . . . . . . . . . . 24 | |
| 5.6. Encoding the SDP . . . . . . . . . . . . . . . . . . . . . 24 | | 4.2. Lite Implementation . . . . . . . . . . . . . . . . . . . 25 | |
| 5.7. Forming the Check Lists . . . . . . . . . . . . . . . . . 24 | | 4.3. Encoding the SDP . . . . . . . . . . . . . . . . . . . . . 25 | |
| 5.8. Performing Periodic Checks . . . . . . . . . . . . . . . . 27 | | 5. Receiving the Initial Offer . . . . . . . . . . . . . . . . . 27 | |
| 6. Receipt of the Initial Answer . . . . . . . . . . . . . . . . 28 | | 5.1. Verifying ICE Support . . . . . . . . . . . . . . . . . . 27 | |
| 6.1. Verifying ICE Support . . . . . . . . . . . . . . . . . . 28 | | 5.2. Determining Role . . . . . . . . . . . . . . . . . . . . . 27 | |
| 6.2. Determining Role . . . . . . . . . . . . . . . . . . . . . 28 | | 5.3. Gathering Candidates . . . . . . . . . . . . . . . . . . . 28 | |
| 6.3. Forming the Check List . . . . . . . . . . . . . . . . . . 28 | | 5.4. Prioritizing Candidates . . . . . . . . . . . . . . . . . 28 | |
| 6.4. Performing Periodic Checks . . . . . . . . . . . . . . . . 28 | | 5.5. Choosing Default Candidates . . . . . . . . . . . . . . . 28 | |
| 7. Connectivity Checks . . . . . . . . . . . . . . . . . . . . . 28 | | 5.6. Encoding the SDP . . . . . . . . . . . . . . . . . . . . . 28 | |
| 7.1. Client Procedures . . . . . . . . . . . . . . . . . . . . 29 | | 5.7. Forming the Check Lists . . . . . . . . . . . . . . . . . 28 | |
| 7.1.1. Sending the Request . . . . . . . . . . . . . . . . . 29 | | 5.7.1. Forming Candidate Pairs . . . . . . . . . . . . . . . 29 | |
| 7.1.2. Processing the Response . . . . . . . . . . . . . . . 30 | | 5.7.2. Computing Pair Priority and Ordering Pairs . . . . . . 31 | |
| 7.2. Server Procedures . . . . . . . . . . . . . . . . . . . . 31 | | 5.7.3. Pruning the Pairs . . . . . . . . . . . . . . . . . . 31 | |
| 7.2.1. Additional Procedures for Full Implementations . . . . 32 | | 5.7.4. Computing States . . . . . . . . . . . . . . . . . . . 31 | |
| 7.2.2. Additional Procedures for Lite Implementations . . . . 34 | | 5.8. Performing Periodic Checks . . . . . . . . . . . . . . . . 34 | |
| 8. Concluding ICE . . . . . . . . . . . . . . . . . . . . . . . . 34 | | 6. Receipt of the Initial Answer . . . . . . . . . . . . . . . . 35 | |
| 9. Subsequent Offer/Answer Exchanges . . . . . . . . . . . . . . 35 | | 6.1. Verifying ICE Support . . . . . . . . . . . . . . . . . . 36 | |
| 9.1. Generating the Offer . . . . . . . . . . . . . . . . . . . 35 | | 6.2. Determining Role . . . . . . . . . . . . . . . . . . . . . 36 | |
| 9.1.1. Additional Procedures for Full Implementations . . . . 36 | | 6.3. Forming the Check List . . . . . . . . . . . . . . . . . . 36 | |
| 9.1.2. Additional Procedures for Lite Implementations . . . . 37 | | 6.4. Performing Periodic Checks . . . . . . . . . . . . . . . . 36 | |
| 9.2. Receiving the Offer and Generating an Answer . . . . . . . 37 | | 7. Performing Connectivity Checks . . . . . . . . . . . . . . . . 36 | |
| 9.2.1. Additional Procedures for Full Implementations . . . . 38 | | 7.1. Client Procedures . . . . . . . . . . . . . . . . . . . . 37 | |
| 9.3. Updating the Check and Valid Lists . . . . . . . . . . . . 38 | | 7.1.1. Sending the Request . . . . . . . . . . . . . . . . . 37 | |
| 9.3.1. Additional Procedures for Full Implementations . . . . 38 | | 7.1.1.1. PRIORITY and USE-CANDIDATE . . . . . . . . . . . . 37 | |
| 10. Keepalives . . . . . . . . . . . . . . . . . . . . . . . . . . 40 | | 7.1.1.2. Forming Credentials . . . . . . . . . . . . . . . 37 | |
| 11. Media Handling . . . . . . . . . . . . . . . . . . . . . . . . 41 | | 7.1.1.3. DiffServ Treatment . . . . . . . . . . . . . . . . 38 | |
| 11.1. Sending Media . . . . . . . . . . . . . . . . . . . . . . 41 | | 7.1.2. Processing the Response . . . . . . . . . . . . . . . 38 | |
| 11.1.1. Procedures for Full Implementations . . . . . . . . . 41 | | 7.1.2.1. Failure Cases . . . . . . . . . . . . . . . . . . 38 | |
| 11.1.2. Procedures for Lite Implementations . . . . . . . . . 42 | | 7.1.2.2. Success Cases . . . . . . . . . . . . . . . . . . 38 | |
| 11.2. Receiving Media . . . . . . . . . . . . . . . . . . . . . 42 | | 7.1.2.2.1. Discovering Peer Reflexive Candidates . . . . 38 | |
| 12. Usage with SIP . . . . . . . . . . . . . . . . . . . . . . . . 42 | | 7.1.2.2.2. Updating Pair States . . . . . . . . . . . . . 39 | |
| 12.1. Latency Guidelines . . . . . . . . . . . . . . . . . . . . 42 | | 7.1.2.2.3. Constructing a Valid Pair . . . . . . . . . . 40 | |
| 12.2. SIP Option Tags and Media Feature Tags . . . . . . . . . . 44 | | 7.1.2.2.4. Updating the Nominated Flag . . . . . . . . . 40 | |
| 12.3. Interactions with Forking . . . . . . . . . . . . . . . . 44 | | 7.2. Server Procedures . . . . . . . . . . . . . . . . . . . . 41 | |
| 12.4. Interactions with Preconditions . . . . . . . . . . . . . 45 | | 7.2.1. Additional Procedures for Full Implementations . . . . 41 | |
| 12.5. Interactions with Third Party Call Control . . . . . . . . 45 | | 7.2.1.1. Computing Mapped Address . . . . . . . . . . . . . 41 | |
| 13. Grammar . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 | | 7.2.1.2. Learning Peer Reflexive Candidates . . . . . . . . 42 | |
| 14. Extensibility Considerations . . . . . . . . . . . . . . . . . 48 | | 7.2.1.3. Triggered Checks . . . . . . . . . . . . . . . . . 42 | |
| 15. Example . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 | | 7.2.1.4. Updating the Nominated Flag . . . . . . . . . . . 43 | |
| 16. Security Considerations . . . . . . . . . . . . . . . . . . . 54 | | 7.2.2. Additional Procedures for Lite Implementations . . . . 43 | |
| 16.1. Attacks on Connectivity Checks . . . . . . . . . . . . . . 54 | | 8. Concluding ICE Processing . . . . . . . . . . . . . . . . . . 43 | |
| 16.2. Attacks on Address Gathering . . . . . . . . . . . . . . . 57 | | 8.1. Nominating Pairs . . . . . . . . . . . . . . . . . . . . . 44 | |
| 16.3. Attacks on the Offer/Answer Exchanges . . . . . . . . . . 57 | | 8.1.1. Regular Nomination . . . . . . . . . . . . . . . . . . 44 | |
| 16.4. Insider Attacks . . . . . . . . . . . . . . . . . . . . . 57 | | 8.1.2. Aggressive Nomination . . . . . . . . . . . . . . . . 45 | |
| 16.4.1. The Voice Hammer Attack . . . . . . . . . . . . . . . 58 | | 8.2. Updating States . . . . . . . . . . . . . . . . . . . . . 45 | |
| 16.4.2. STUN Amplification Attack . . . . . . . . . . . . . . 58 | | 9. Subsequent Offer/Answer Exchanges . . . . . . . . . . . . . . 46 | |
| 16.5. Interactions with Application Layer Gateways and SIP . . . 59 | | 9.1. Generating the Offer . . . . . . . . . . . . . . . . . . . 46 | |
| 17. Definition of Connectivity Check Usage . . . . . . . . . . . . 59 | | 9.1.1. Procedures for All Implementations . . . . . . . . . . 46 | |
| 17.1. Applicability . . . . . . . . . . . . . . . . . . . . . . 60 | | 9.1.1.1. ICE Restarts . . . . . . . . . . . . . . . . . . . 46 | |
| 17.2. Client Discovery of Server . . . . . . . . . . . . . . . . 60 | | 9.1.1.2. Removing a Media Stream . . . . . . . . . . . . . 47 | |
| 17.3. Server Determination of Usage . . . . . . . . . . . . . . 60 | | 9.1.1.3. Adding a Media Stream . . . . . . . . . . . . . . 47 | |
| 17.4. New Requests or Indications . . . . . . . . . . . . . . . 60 | | 9.1.2. Procedures for Full Implementations . . . . . . . . . 47 | |
| 17.5. New Attributes . . . . . . . . . . . . . . . . . . . . . . 60 | | 9.1.2.1. Existing Media Streams with ICE Running . . . . . 48 | |
| 17.6. New Error Response Codes . . . . . . . . . . . . . . . . . 61 | | 9.1.2.2. Existing Media Streams with ICE Completed . . . . 48 | |
| 17.7. Client Procedures . . . . . . . . . . . . . . . . . . . . 61 | | 9.1.3. Procedures for Lite Implementations . . . . . . . . . 49 | |
| 17.8. Server Procedures . . . . . . . . . . . . . . . . . . . . 61 | | 9.2. Receiving the Offer and Generating an Answer . . . . . . . 49 | |
| 17.9. Security Considerations for Connectivity Check . . . . . . 61 | | 9.2.1. Procedures for All Implementations . . . . . . . . . . 49 | |
| 18. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 61 | | 9.2.1.1. Detecting ICE Restart . . . . . . . . . . . . . . 49 | |
| 18.1. SDP Attributes . . . . . . . . . . . . . . . . . . . . . . 61 | | 9.2.1.2. New Media Stream . . . . . . . . . . . . . . . . . 50 | |
| 18.1.1. candidate Attribute . . . . . . . . . . . . . . . . . 61 | | 9.2.1.3. Removed Media Stream . . . . . . . . . . . . . . . 50 | |
| 18.1.2. remote-candidates Attribute . . . . . . . . . . . . . 62 | | 9.2.2. Procedures for Full Implementations . . . . . . . . . 50 | |
| 18.1.3. ice-lite Attribute . . . . . . . . . . . . . . . . . . 62 | | 9.2.2.1. Existing Media Streams with ICE Running and no | |
| 18.1.4. ice-mismatch Attribute . . . . . . . . . . . . . . . . 63 | | remote-candidates . . . . . . . . . . . . . . . . 50 | |
| 18.1.5. ice-pwd Attribute . . . . . . . . . . . . . . . . . . 63 | | 9.2.2.2. Existing Media Streams with ICE Completed and | |
| 18.1.6. ice-ufrag Attribute . . . . . . . . . . . . . . . . . 63 | | no remote-candidates . . . . . . . . . . . . . . . 50 | |
| 18.1.7. ice-options Attribute . . . . . . . . . . . . . . . . 64 | | 9.2.2.3. Existing Media Streams and remote-candidates . . . 50 | |
| 18.2. STUN Attributes . . . . . . . . . . . . . . . . . . . . . 64 | | 9.2.3. Procedures for Lite Implementations . . . . . . . . . 51 | |
| 19. IAB Considerations . . . . . . . . . . . . . . . . . . . . . . 65 | | 9.3. Updating the Check and Valid Lists . . . . . . . . . . . . 52 | |
| 19.1. Problem Definition . . . . . . . . . . . . . . . . . . . . 65 | | 9.3.1. Procedures for Full Implementations . . . . . . . . . 52 | |
| 19.2. Exit Strategy . . . . . . . . . . . . . . . . . . . . . . 65 | | 9.3.1.1. ICE Restarts . . . . . . . . . . . . . . . . . . . 52 | |
| 19.3. Brittleness Introduced by ICE . . . . . . . . . . . . . . 66 | | 9.3.1.2. New Media Stream . . . . . . . . . . . . . . . . . 52 | |
| 19.4. Requirements for a Long Term Solution . . . . . . . . . . 67 | | 9.3.1.3. Removed Media Stream . . . . . . . . . . . . . . . 52 | |
| 19.5. Issues with Existing NAPT Boxes . . . . . . . . . . . . . 67 | | 9.3.1.4. ICE Continuing for Existing Media Stream . . . . . 52 | |
| 20. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 68 | | 9.3.2. Procedures for Lite Implementations . . . . . . . . . 53 | |
| 21. References . . . . . . . . . . . . . . . . . . . . . . . . . . 68 | | 10. Keepalives . . . . . . . . . . . . . . . . . . . . . . . . . . 53 | |
| 21.1. Normative References . . . . . . . . . . . . . . . . . . . 68 | | 11. Media Handling . . . . . . . . . . . . . . . . . . . . . . . . 54 | |
| 21.2. Informative References . . . . . . . . . . . . . . . . . . 69 | | 11.1. Sending Media . . . . . . . . . . . . . . . . . . . . . . 54 | |
| Appendix A. Lite and Full Implementations . . . . . . . . . . . . 71 | | 11.1.1. Procedures for Full Implementations . . . . . . . . . 54 | |
| Appendix B. Design Motivations . . . . . . . . . . . . . . . . . 71 | | 11.1.2. Procedures for Lite Implementations . . . . . . . . . 55 | |
| B.1. Pacing of STUN Transactions . . . . . . . . . . . . . . . 72 | | 11.1.3. Procedures for All Implementations . . . . . . . . . . 55 | |
| B.2. Candidates with Multiple Bases . . . . . . . . . . . . . . 72 | | 11.2. Receiving Media . . . . . . . . . . . . . . . . . . . . . 56 | |
| B.3. Purpose of the Translation . . . . . . . . . . . . . . . . 74 | | 12. Usage with SIP . . . . . . . . . . . . . . . . . . . . . . . . 56 | |
| B.4. Importance of the STUN Username . . . . . . . . . . . . . 74 | | 12.1. Latency Guidelines . . . . . . . . . . . . . . . . . . . . 56 | |
| B.5. The Candidate Pair Sequence Number Formula . . . . . . . . 75 | | 12.1.1. Offer in INVITE . . . . . . . . . . . . . . . . . . . 56 | |
| B.6. The Frozen State . . . . . . . . . . . . . . . . . . . . . 76 | | 12.1.2. Offer in Response . . . . . . . . . . . . . . . . . . 58 | |
| B.7. The remote-candidates attribute . . . . . . . . . . . . . 76 | | 12.2. SIP Option Tags and Media Feature Tags . . . . . . . . . . 58 | |
| B.8. Why are Keepalives Needed? . . . . . . . . . . . . . . . . 77 | | 12.3. Interactions with Forking . . . . . . . . . . . . . . . . 58 | |
| B.9. Why Prefer Peer Reflexive Candidates? . . . . . . . . . . 78 | | 12.4. Interactions with Preconditions . . . . . . . . . . . . . 59 | |
| B.10. Why Send an Updated Offer? . . . . . . . . . . . . . . . . 78 | | 12.5. Interactions with Third Party Call Control . . . . . . . . 59 | |
| B.11. Why are Binding Indications Used for Keepalives? . . . . . 78 | | 13. Usage with ANAT . . . . . . . . . . . . . . . . . . . . . . . 59 | |
| Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 80 | | 14. Extensibility Considerations . . . . . . . . . . . . . . . . . 60 | |
| Intellectual Property and Copyright Statements . . . . . . . . . . 81 | | 15. Grammar . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 | |
| | | 15.1. "candidate" Attribute . . . . . . . . . . . . . . . . . . 61 | |
| | | 15.2. "remote-candidates" Attribute . . . . . . . . . . . . . . 64 | |
| | | 15.3. "ice-lite" and "ice-mismatch" Attributes . . . . . . . . . 64 | |
| | | 15.4. "ice-ufrag" and "ice-pwd" Attributes . . . . . . . . . . . 64 | |
| | | 15.5. "ice-options> Attribute . . . . . . . . . . . . . . . . . 65 | |
| | | 16. Example . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 | |
| | | 17. Security Considerations . . . . . . . . . . . . . . . . . . . 72 | |
| | | 17.1. Attacks on Connectivity Checks . . . . . . . . . . . . . . 72 | |
| | | 17.2. Attacks on Address Gathering . . . . . . . . . . . . . . . 74 | |
| | | 17.3. Attacks on the Offer/Answer Exchanges . . . . . . . . . . 75 | |
| | | 17.4. Insider Attacks . . . . . . . . . . . . . . . . . . . . . 75 | |
| | | 17.4.1. The Voice Hammer Attack . . . . . . . . . . . . . . . 75 | |
| | | 17.4.2. STUN Amplification Attack . . . . . . . . . . . . . . 76 | |
| | | 17.5. Interactions with Application Layer Gateways and SIP . . . 76 | |
| | | 18. Definition of 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 | | 1. Introduction | |
| | | | |
| RFC 3264 [4] defines a two-phase exchange of Session Description | | RFC 3264 [4] defines a two-phase exchange of Session Description | |
| Protocol (SDP) messages [10] for the purposes of establishment of | | Protocol (SDP) messages [10] for the purposes of establishment of | |
| multimedia sessions. This offer/answer mechanism is used by | | multimedia sessions. This offer/answer mechanism is used by | |
| protocols such as the Session Initiation Protocol (SIP) [3]. | | protocols such as the Session Initiation Protocol (SIP) [3]. | |
| | | | |
| Protocols using offer/answer are difficult to operate through Network | | Protocols using offer/answer are difficult to operate through Network | |
| Address Translators (NAT). Because their purpose is to establish a | | Address Translators (NAT). Because their purpose is to establish a | |
|
| flow of media packets, they tend to carry IP addresses within their | | flow of media packets, they tend to carry the IP of media sources and | |
| messages, which is known to be problematic through NAT [15]. The | | sinks within their messages, which is known to be problematic through | |
| protocols also seek to create a media flow directly between | | NAT [16]. The protocols also seek to create a media flow directly | |
| participants, so that there is no application layer intermediary | | between participants, so that there is no application layer | |
| between them. This is done to reduce media latency, decrease packet | | intermediary between them. This is done to reduce media latency, | |
| loss, and reduce the operational costs of deploying the application. | | decrease packet loss, and reduce the operational costs of deploying | |
| However, this is difficult to accomplish through NAT. A full | | the application. However, this is difficult to accomplish through | |
| treatment of the reasons for this is beyond the scope of this | | NAT. A full treatment of the reasons for this is beyond the scope of | |
| specification. | | this specification. | |
| | | | |
| Numerous solutions have been proposed for allowing these protocols to | | Numerous solutions have been proposed for allowing these protocols to | |
| operate through NAT. These include Application Layer Gateways | | operate through NAT. These include Application Layer Gateways | |
|
| (ALGs), the Middlebox Control Protocol [16], Simple Traversal | | (ALGs), the Middlebox Control Protocol [17], Simple Traversal | |
| Underneath NAT (STUN) [14] and its revision, retitled Session | | Underneath NAT (STUN) [15] and its revision, retitled Session | |
| Traversal Utilities for NAT [11], the STUN Relay Usage [12], and | | Traversal Utilities for NAT [12], the STUN Relay Usage [13], and | |
| Realm Specific IP [18] [19] along with session description extensions | | Realm Specific IP [19] [20] along with session description extensions | |
| needed to make them work, such as the Session Description Protocol | | needed to make them work, such as the Session Description Protocol | |
| (SDP) [10] attribute for the Real Time Control Protocol (RTCP) [2]. | | (SDP) [10] attribute for the Real Time Control Protocol (RTCP) [2]. | |
| Unfortunately, these techniques all have pros and cons which make | | Unfortunately, these techniques all have pros and cons which make | |
| each one optimal in some network topologies, but a poor choice in | | each one optimal in some network topologies, but a poor choice in | |
| others. The result is that administrators and implementors are | | others. The result is that administrators and implementors are | |
| making assumptions about the topologies of the networks in which | | making assumptions about the topologies of the networks in which | |
| their solutions will be deployed. This introduces complexity and | | their solutions will be deployed. This introduces complexity and | |
| brittleness into the system. What is needed is a single solution | | brittleness into the system. What is needed is a single solution | |
| which is flexible enough to work well in all situations. | | which is flexible enough to work well in all situations. | |
| | | | |
|
| This specification provides that solution for media streams | | This specification defines Interactive Connectivity Establishment | |
| established by signaling protocols based on the offer-answer model. | | (ICE) as a technique for NAT traversal for media streams established | |
| It is called Interactive Connectivity Establishment, or ICE. ICE | | by the offer/answer model. ICE is an extension to the offer/answer | |
| makes use of STUN and its relay extension, commonly called TURN, but | | model, and works by including a multiplicity of IP addresses and | |
| uses them in a specific methodology which avoids many of the pitfalls | | ports in SDP offers and answers, which are then tested for | |
| of using any one alone. | | 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 | | 2. Overview of ICE | |
| | | | |
|
| In a typical ICE deployment, we have two endpoints (known as agents | | In a typical ICE deployment, we have two endpoints (known as AGENTS | |
| in RFC 3264 terminology) which want to communicate. They are able to | | in RFC 3264 terminology) which want to communicate. They are able to | |
|
| communicate indirectly via some signaling system such as SIP, by | | communicate indirectly via some signaling protocol (such as SIP), by | |
| which they can perform an offer/answer exchange of SDP [4] messages. | | 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 | | Note that ICE is not intended for NAT traversal for SIP, which is | |
|
| assumed to be provided via some other mechanism [32]. At the | | assumed to be provided via another mechanism [35]. At the beginning | |
| beginning of the ICE process, the agents are ignorant of their own | | of the ICE process, the agents are ignorant of their own topologies. | |
| topologies. In particular, they might or might not be behind a NAT | | In particular, they might or might not be behind a NAT (or multiple | |
| (or multiple tiers of NATs). ICE allows the agents to discover | | tiers of NATs). ICE allows the agents to discover enough information | |
| enough information about their topologies to find a path or paths by | | about their topologies to potentially find one or more paths by which | |
| which they can communicate. | | they can communicate. | |
| | | | |
|
| Figure Figure 1 shows a typical environment for ICE deployment. The | | Figure 1 shows a typical environment for ICE deployment. The two | |
| two endpoints are labelled L and R (for left and right, which helps | | endpoints are labelled L and R (for left and right, which helps | |
| visualize call flows). Both L and R are behind NATs -- though as | | visualize call flows). Both L and R are behind their own respective | |
| mentioned before, they don't know that. The type of NAT and its | | NATs though they may not be aware of it. The type of NAT and its | |
| properties are also unknown. Agents L and R are capable of engaging | | properties are also unknown. Agents L and R are capable of engaging | |
| in an offer/answer exchange by which they can exchange SDP messages, | | in an offer/answer exchange by which they can exchange SDP messages, | |
| whose purpose is to set up a media session between L and R. | | whose purpose is to set up a media session between L and R. | |
| Typically, this exchange will occur through a SIP server. | | Typically, this exchange will occur through a SIP server. | |
| | | | |
| In addition to the agents, a SIP server and NATs, ICE is typically | | In addition to the agents, a SIP server and NATs, ICE is typically | |
| used in concert with STUN servers in the network. Each agent can | | used in concert with STUN servers in the network. Each agent can | |
| have its own STUN server, or they can be the same. | | have its own STUN server, or they can be the same. | |
| | | | |
| +-------+ | | +-------+ | |
| | | | |
| skipping to change at page 7, line 6 | | skipping to change at page 8, line 31 | |
| +--------+ +--------+ | | +--------+ +--------+ | |
| / \ | | / \ | |
| / \ | | / \ | |
| / \ | | / \ | |
| +-------+ +-------+ | | +-------+ +-------+ | |
| | Agent | | Agent | | | | Agent | | Agent | | |
| | L | | R | | | | L | | R | | |
| | | | | | | | | | | | |
| +-------+ +-------+ | | +-------+ +-------+ | |
| | | | |
|
| Figure 1 | | Figure 1: ICE Deployment Scenario | |
| | | | |
| The basic idea behind ICE is as follows: each agent has a variety of | | The basic idea behind ICE is as follows: each agent has a variety of | |
|
| candidate transport addresses it could use to communicate with the | | candidate TRANSPORT ADDRESSES (combination of IP address and port) it | |
| other agent. These might include: | | could use to communicate with the other agent. These might include: | |
| | | | |
|
| o It's directly attached network interface (or interfaces in the | | o A transport address on a directly attached network interface or | |
| case of a multihomed machine | | interfaces | |
| | | | |
|
| o A translated address on the public side of a NAT (a "server | | o A translated transport address on the public side of a NAT (a | |
| reflexive" address) | | "server reflexive" address) | |
| | | | |
|
| o The address of a media relay the agent is using. | | o The transport address of a media relay the agent is using. | |
| | | | |
| Potentially, any of L's candidate transport addresses can be used to | | Potentially, any of L's candidate transport addresses can be used to | |
| communicate with any of R's candidate transport addresses. In | | communicate with any of R's candidate transport addresses. In | |
| practice, however, many combinations will not work. For instance, if | | practice, however, many combinations will not work. For instance, if | |
|
| L and R are both behind NATs then their directly interface addresses | | L and R are both behind NATs, their directly attached interface | |
| are unlikely to be able to communicate directly (this is why ICE is | | addresses are unlikely to be able to communicate directly (this is | |
| needed, after all!). The purpose of ICE is to discover which pairs | | why ICE is needed, after all!). The purpose of ICE is to discover | |
| of addresses will work. The way that ICE does this is to | | which pairs of addresses will work. The way that ICE does this is to | |
| systematically try all possible pairs (in a carefully sorted order) | | systematically try all possible pairs (in a carefully sorted order) | |
| until it finds one or more that works. | | until it finds one or more that works. | |
| | | | |
| 2.1. Gathering Candidate Addresses | | 2.1. Gathering Candidate Addresses | |
| | | | |
| In order to execute ICE, an agent has to identify all of its address | | In order to execute ICE, an agent has to identify all of its address | |
|
| candidates. Naturally, one viable candidate is one obtained directly | | candidates. A CANDIDATE is a transport address - a combination of IP | |
| from a local interface the client has towards the network. Such a | | address and port for a particular transport protocol. This document | |
| candidate is called a HOST CANDIDATE. The local interface could be | | defines three types of candidates, some derived from physical or | |
| one on a local layer 2 network technology, such as ethernet or WiFi, | | logical network interfaces, others discoverable via STUN. Naturally, | |
| or it could be one that is obtained through a tunnel mechanism, such | | one viable candidate is a transport address obtained directly from a | |
| as a Virtual Private Network (VPN) or Mobile IP (MIP). In all cases, | | local interface. Such a candidate is called a HOST CANDIDATE. The | |
| these appear to the agent as a local interface from which ports (and | | local interface could be ethernet or WiFi, or it could be one that is | |
| thus a candidate) can be allocated. | | obtained through a tunnel mechanism, such as a Virtual Private | |
| | | Network (VPN) or Mobile IP (MIP). In all cases, such a network | |
| | | interface appears to the agent as a local interface from which ports | |
| | | (and thus a candidate) can be allocated. | |
| | | | |
|
| If an agent is multihomed, it can obtain a candidate from each | | If an agent is multihomed, it obtains a candidate from each | |
| interface. Depending on the location of the peer on the IP network | | interface. Depending on the location of the PEER (the other agent in | |
| relative to the agent, the agent may be reachable by the peer through | | the session) on the IP network relative to the agent, the agent may | |
| one of those interfaces, or through another. Consider, for example, | | be reachable by the peer through one or more of those interfaces. | |
| an agent which has a local interface to a private net 10 network, and | | Consider, for example, an agent which has a local interface to a | |
| also to the public Internet. A candidate from the net10 interface | | private net 10 network (I1), and a second connected to the public | |
| will be directly reachable when communicating with a peer on the same | | Internet (I2). A candidate from I1 will be directly reachable when | |
| private net 10 network, while a candidate from the public interface | | communicating with a peer on the same private net 10 network, while a | |
| will be directly reachable when communicating with a peer on the | | candidate from I2 will be directly reachable when communicating with | |
| public Internet. Rather than trying to guess which interface will | | a peer on the public Internet. Rather than trying to guess which | |
| work prior to sending an offer, the offering agent includes both | | interface will work prior to sending an offer, the offering agent | |
| candidates in its offer. | | includes both candidates in its offer. | |
| | | | |
|
| Once the agent has obtained host candidates, it uses STUN to obtain | | Next, the agent uses STUN to obtain additional candidates. These | |
| additional candidates. These come in two flavors: translated | | come in two flavors: translated addresses on the public side of a NAT | |
| addresses on the public side of a NAT (SERVER REFLEXIVE CANDIDATES) | | (SERVER REFLEXIVE CANDIDATES) and addresses of media relays (RELAYED | |
| and addresses of media relays (RELAYED CANDIDATES). The relationship | | CANDIDATES). The relationship of these candidates to the host | |
| of these candidates to the host candidate is shown in Figure 2. Both | | candidate is shown in Figure 2. Both types of candidates are | |
| types of candidates are discovered using STUN. | | discovered using STUN. | |
| | | | |
| To Internet | | To Internet | |
| | | | |
| | | | | | |
| | | | | | |
| | /------------ Relayed | | | /------------ Relayed | |
|
| | / Candidate | | Y:y | / Address | |
| +--------+ | | +--------+ | |
| | | | | | | | |
| | STUN | | | | STUN | | |
| | Server | | | | Server | | |
| | | | | | | | |
| +--------+ | | +--------+ | |
| | | | | | |
| | | | | | |
| | /------------ Server | | | /------------ Server | |
|
| |/ Reflexive | | X1':x1'|/ Reflexive | |
| +------------+ Candidate | | +------------+ Address | |
| | NAT | | | | NAT | | |
| +------------+ | | +------------+ | |
| | | | | | |
|
| | /------------ Host | | | /------------ Local | |
| |/ Candidate | | X:x |/ Address | |
| +--------+ | | +--------+ | |
| | | | | | | | |
| | Agent | | | | Agent | | |
| | | | | | | | |
| +--------+ | | +--------+ | |
| | | | |
|
| Figure 2 | | Figure 2: Candidate Relationships | |
| | | | |
| To find a server reflexive candidate, the agent sends a STUN Binding | | To find a server reflexive candidate, the agent sends a STUN Binding | |
|
| Request, using the Binding Discovery Usage [11] from each host | | Request, using the Binding Discovery Usage [12] from each host | |
| candidate, to its STUN server. (It is assumed that the address of | | candidate, to its STUN server. It is assumed that the address of the | |
| the STUN server is configured, or learned in some way.) When the | | STUN server is manually configured or learned in some unspecified | |
| agent sends the Binding Request, the NAT (assuming there is one) will | | way. It is RECOMMENDED that when an agent has a choice of STUN | |
| allocate a binding, mapping this server reflexive candidate to the | | servers (when, for example, they are learned through DNS records and | |
| host candidate. Outgoing packets sent from the host candidate will | | multiple results are returned), an agent uses a single STUN server | |
| be translated by the NAT to the server reflexive candidate. Incoming | | (based on its IP address) for all candidates for a particular | |
| packets sent to the server relexive candidate will be translated by | | session. This improves the performance of ICE. | |
| the NAT to the host candidate and forwarded to the agent. We call | | | |
| the host candidate associated with a given server reflexive candidate | | | |
| the BASE. | | | |
| | | | |
|
| Note | | When the agent sends the Binding Request from IP address and port | |
| | | X:x, the NAT (assuming there is one) will allocate a binding X1':x1', | |
| | | mapping this server reflexive candidate to the host candidate X:x. | |
| | | Outgoing packets sent from the host candidate will be translated by | |
| | | the NAT to the server reflexive candidate. Incoming packets sent to | |
| | | the server relexive candidate will be translated by the NAT to the | |
| | | host candidate and forwarded to the agent. We call the host | |
| | | candidate associated with a given server reflexive candidate the | |
| | | BASE. | |
| | | | |
|
| "Base" refers to the address you'd send from for a particular | | NOTE: "Base" refers to the address an agent sends from for a | |
| candidate. Thus, as a degenerate case host candidates also have a | | particular candidate. Thus, as a degenerate case host candidates | |
| base, but it's the same as the host candidate. | | also have a base, but it's the same as the host candidate. | |
| | | | |
| When there are multiple NATs between the agent and the STUN server, | | When there are multiple NATs between the agent and the STUN server, | |
| the STUN request will create a binding on each NAT, but only the | | the STUN request will create a binding on each NAT, but only the | |
| outermost server reflexive candidate will be discovered by the agent. | | outermost server reflexive candidate will be discovered by the agent. | |
| If the agent is not behind a NAT, then the base candidate will be the | | If the agent is not behind a NAT, then the base candidate will be the | |
| same as the server reflexive candidate and the server reflexive | | same as the server reflexive candidate and the server reflexive | |
|
| candidate can be ignored. | | candidate is redundant and will be eliminated. | |
| | | | |
|
| The final type of candidate is a RELAYED candidate. The STUN Relay | | The final type of candidate is a RELAYED CANDIDATE. The STUN Relay | |
| Usage [12] allows a STUN server to act as a media relay, forwarding | | Usage [13] allows a STUN server to act as a media relay, forwarding | |
| traffic between L and R. In order to send traffic to L, R sends | | traffic between L and R. In order to send traffic to L, R sends | |
|
| traffic to the media relay which forwards it to L and vice versa. | | traffic to the media relay at Y:y, and the relay forwards that to | |
| The same thing happens in the other direction. | | X1':x1', which passes through the NAT where it is mapped to X:x and | |
| | | delivered to L. | |
| Traffic from L to R has its addresses rewritten twice: first by the | | | |
| NAT and second by the STUN relay server. Thus, the address that R | | | |
| knows about and the one that it wants to send to is the one on the | | | |
| STUN relay server. This address is the final kind of candidate, | | | |
| which we call a RELAYED CANDIDATE. | | | |
| | | | |
| 2.2. Connectivity Checks | | 2.2. Connectivity Checks | |
| | | | |
|
| Once L has gathered all of its candidates, it orders them highest to | | Once L has gathered all of its candidates, it orders them in highest | |
| lowest priority and sends them to R over the signalling channel. The | | to lowest priority and sends them to R over the signalling channel. | |
| candidates are carried in attributes in the SDP offer. When R | | The candidates are carried in attributes in the SDP offer. When R | |
| receives the offer, it performs the same gathering process and | | receives the offer, it performs the same gathering process and | |
| responds with its own list of candidates. At the end of this | | responds with its own list of candidates. At the end of this | |
| process, each agent has a complete list of both its candidates and | | process, each agent has a complete list of both its candidates and | |
|
| its peer's candidates and is ready to perform connectivity checks by | | its peer's candidates. It pairs them up, resulting in CANDIDATE | |
| pairing up the candidates to see which pair works. | | PAIRS. To see which pairs work, the agent schedules a series of | |
| | | CHECKS. Each check is a STUN transaction that the client will | |
| | | perform on a particular candidate pair by sending a STUN request from | |
| | | the local candidate to the remote candidate. | |
| | | | |
| The basic principle of the connectivity checks is simple: | | The basic principle of the connectivity checks is simple: | |
| | | | |
| 1. Sort the candidate pairs in priority order. | | 1. Sort the candidate pairs in priority order. | |
| | | | |
| 2. Send checks on each candidate pair in priority order. | | 2. Send checks on each candidate pair in priority order. | |
| | | | |
| 3. Acknowledge checks received from the other agent. | | 3. Acknowledge checks received from the other agent. | |
| | | | |
|
| A complete connectivity check for a single candidate pair is a simple | | With both agents performing a check on a candidate pair, the result | |
| 4-message handshake: | | is a 4-way handshake: | |
| | | | |
| L R | | L R | |
| - - | | - - | |
| STUN request -> \ L's | | STUN request -> \ L's | |
| <- STUN response / check | | <- STUN response / check | |
| | | | |
| <- STUN request \ R's | | <- STUN request \ R's | |
| STUN response -> / check | | STUN response -> / check | |
| | | | |
|
| Figure 3 | | Figure 3: Basic Connectivity Check | |
| | | | |
|
| As an optimization, as soon as R gets L's check message he | | It is important to note that the STUN requests are sent to and from | |
| immediately sends his own check message to L on the same candidate | | the exact same IP addresses and ports that will be used for media | |
| pair. This accelerates the process of finding a valid candidate, and | | (e.g., RTP and RTCP). Consequently, agents demultiplex STUN and RTP/ | |
| is called a triggered check. | | 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 connectivity check, the STUN response | |
| | | will contain the agent's translated transport address on the public | |
| | | side any NATs between the agent and its peer. If this transport | |
| | | address is different from other candidates the agent already learned, | |
| | | it 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 L on the same candidate pair. This | |
| | | accelerates the process of finding a valid candidate, and is called a | |
| | | TRIGGERED CHECK. | |
| | | | |
| At the end of this handshake, both L and R know that they can send | | At the end of this handshake, both L and R know that they can send | |
| (and receive) messages end-to-end in both directions. | | (and receive) messages end-to-end in both directions. | |
| | | | |
| 2.3. Sorting Candidates | | 2.3. Sorting Candidates | |
| | | | |
| Because the algorithm above searches all candidate pairs, if a | | Because the algorithm above searches all candidate pairs, if a | |
| working pair exists it will eventually find it no matter what order | | working pair exists it will eventually find it no matter what order | |
| the candidates are tried in. In order to produce faster (and better) | | the candidates are tried in. In order to produce faster (and better) | |
| results, the candidates are sorted in a specified order. The | | results, the candidates are sorted in a specified order. The | |
|
| algorithm is described in Section 4.1.2 but follows two general | | 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: | | principles: | |
| | | | |
| o Each agent gives its candidates a numeric priority which is sent | | o Each agent gives its candidates a numeric priority which is sent | |
| along with the candidate to the peer | | along with the candidate to the peer | |
| | | | |
| o The local and remote priorities are combined so that each agent | | o The local and remote priorities are combined so that each agent | |
| has the same ordering for the candidate pairs. | | has the same ordering for the candidate pairs. | |
| | | | |
| The second property is important for getting ICE to work when there | | The second property is important for getting ICE to work when there | |
|
| are NATs in front of A and B. Frequently, NATs will not allow packets | | are NATs in front of L and R. Frequently, NATs will not allow packets | |
| in from a host until the agent behind the NAT has sent a packet | | in from a host until the agent behind the NAT has sent a packet | |
| towards that host. Consequently, ICE checks in each direction will | | towards that host. Consequently, ICE checks in each direction will | |
| not succeed until both sides have sent a check through their | | not succeed until both sides have sent a check through their | |
| respective NATs. | | 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 | | In general the priority algorithm is designed so that candidates of | |
| similar type get similar priorities and so that more direct routes | | similar type get similar priorities and so that more direct routes | |
|
| are preferred over indirect ones. Within those guidelines, however, | | (that is, through fewer media relays and through fewer NATs) are | |
| agents have a fair amount of discretion about how to tune their | | preferred over indirect ones (ones with more media relays and more | |
| algorithms. | | NATs). Within those guidelines, however, agents have a fair amount | |
| | | of discretion about how to tune their algorithms. | |
| | | | |
| 2.4. Frozen Candidates | | 2.4. Frozen Candidates | |
| | | | |
| The previous description only addresses the case where the agents | | The previous description only addresses the case where the agents | |
|
| wish to establish a single media component--i.e., a single flow with | | wish to establish a media session with one COMPONENT (a piece of a | |
| a single host-port quartet. However, in many cases (in particular | | media stream requiring a single transport address; a media stream may | |
| RTP and RTCP) the agents actually need to establish connectivity for | | require multiple components, each of which has to work for the media | |
| more than one flow. | | stream as a whole to be work). Typically, (e.g., with RTP and RTCP) | |
| | | the agents actually need to establish connectivity for more than one | |
| | | flow. | |
| | | | |
|
| The naive way to attack this problem would be to simply do | | The network properties are likely to be very similar for each | |
| independent ICE exchanges for each media component. This is | | component (especially because RTP and RTCP are sent and received from | |
| obviously inefficient because the network properties are likely to be | | the same IP address). It is usually possible to leverage information | |
| very similar for each component (especially because RTP and RTCP are | | from one media component in order to determine the best candidates | |
| typically run on adjacent ports). Thus, it should be possible to | | for another. ICE does this with a mechanism called "frozen | |
| leverage information from one media component in order to determine | | candidates." | |
| the best candidates for another. ICE does this with a mechanism | | | |
| called "frozen candidates." | | | |
| | | | |
|
| The basic principle behind frozen candidates is that initially only | | Each candidate is associated with a property called its FOUNDATION. | |
| the candidates for a single media component are tested. The other | | Two candidates have the same foundation when they are "similar" - of | |
| media components are marked "frozen". When the connectivity checks | | the same type and obtained from the same interfaces and STUN servers. | |
| for the first component succeed, the corresponding candidates for the | | Otherwise, their foundation is different. A candidate pair has a | |
| other components are unfrozen and checked immediately. This avoids | | foundation too, which is just the concatenation of the foundations of | |
| repeated checking of components which are superficially more | | its two candidates. Initially, only the candidate pairs with unique | |
| | | foundations are tested. The other candidate pairs are marked | |
| | | "frozen". When the connectivity checks for a candidate pair succeed, | |
| | | the candidate 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. | | attractive but in fact are likely to fail. | |
| | | | |
| While we've described "frozen" here as a separate mechanism for | | While we've described "frozen" here as a separate mechanism for | |
| expository purposes, in fact it is an integral part of ICE and the | | expository purposes, in fact it is an integral part of ICE and the | |
| the ICE prioritization algorithm automatically ensures that the right | | the ICE prioritization algorithm automatically ensures that the right | |
| candidates are unfrozen and checked in the right order. | | candidates are unfrozen and checked in the right order. | |
| | | | |
| 2.5. Security for Checks | | 2.5. Security for Checks | |
| | | | |
| Because ICE is used to discover which addresses can be used to send | | Because ICE is used to discover which addresses can be used to send | |
| media between two agents, it is important to ensure that the process | | media between two agents, it is important to ensure that the process | |
| cannot be hijacked to send media to the wrong location. Each STUN | | cannot be hijacked to send media to the wrong location. Each STUN | |
| connectivity check is covered by a message authentication code (MAC) | | connectivity check is covered by a message authentication code (MAC) | |
| computed using a key exchanged in the signalling channel. This MAC | | computed using a key exchanged in the signalling channel. This MAC | |
| provides message integrity and data origin authentication, thus | | provides message integrity and data origin authentication, thus | |
| stopping an attacker from forging or modifying connectivity check | | stopping an attacker from forging or modifying connectivity check | |
| messages. The MAC also aids in disambiguating ICE exchanges from | | messages. The MAC also aids in disambiguating ICE exchanges from | |
|
| forked calls. | | forked calls when ICE is used with SIP [3]. | |
| | | | |
| 2.6. Concluding ICE | | 2.6. Concluding ICE | |
| | | | |
| ICE checks are performed in a specific sequence, so that high | | ICE checks are performed in a specific sequence, so that high | |
|
| priority pairs are checked first, followed by lower priority ones. | | priority candidate pairs are checked first, followed by lower | |
| One way to conclude ICE is to declare victory as soon as a check for | | priority ones. One way to conclude ICE is to declare victory as soon | |
| each component of each media stream completes successfully. Indeed, | | as a check for each component of each media stream completes | |
| this is a reasonable algorithm, and details for it are provided | | successfully. Indeed, this is a reasonable algorithm, and details | |
| below. However, it is possible that packet losses will cause a | | for it are provided below. However, it is possible that packet | |
| higher priority check to take longer to complete, and allowing ICE to | | losses will cause a higher priority check to take longer to complete. | |
| run a little longer might produce better results. More | | In that case, allowing ICE to run a little longer might produce | |
| fundamentally, however, the prioritization defined by this | | better results. More fundamentally, however, the prioritization | |
| specification may not yield "optimal" results. As an example, if the | | defined by this specification may not yield "optimal" results. As an | |
| aim is to select low latency media paths, usage of a relay is a hint | | example, if the aim is to select low latency media paths, usage of a | |
| that latencies may be higher, but it is nothing more than a hint. An | | relay is a hint that latencies may be higher, but it is nothing more | |
| actual RTT measurement could be made, and it might demonstrate that a | | than a hint. An actual RTT measurement could be made, and it might | |
| pair with lower priority is actually better than one with higher | | demonstrate that a pair with lower priority is actually better than | |
| priority. | | one with higher priority. | |
| | | | |
| Consequently, ICE assigns one of the agents in the role of the | | Consequently, ICE assigns one of the agents in the role of the | |
|
| controlling agent, and the other of the controlled agent. The | | CONTROLLING AGENT, and the other of the CONTROLLED AGENT. The | |
| controlling agent runs a selection algorithm, through which it can | | controlled agent gets to nominate which candidate pairs will get used | |
| decide when to conclude ICE checks, and which pairs get selected. | | for media amongst the ones that are valid. It can do this in one of | |
| The one that is selected is called the favored candidate pair. When | | two ways - using REGULAR NOMINATION or AGGRESSIVE NOMINATION. | |
| a controlling agent selects a pair for a particular component of a | | | |
| media stream, it generates a check for that pair and includes a flag | | With regular nomination, the controlling agent lets the checks | |
| in the check indicating that the pair has been selected. If the | | continue until at least one valid candidate pair for each media | |
| controlled agent has already performed in a check in the reverse | | stream is found. Then, it picks amongst those that are valid, and | |
| direction that succeeded, the controlled agent considers ICE | | sends a second STUN request on its NOMINATED candidate pair, but this | |
| processing to be concluded for that component. Once there is a | | time with a flag set to tell the peer that this pair has been | |
| selected pair for each component of a media stream, the ICE checks | | nominated for use. A This is shown in Figure 4. | |
| for that media stream are considered to be completed. At this point, | | | |
| further checks stop for that media stream - ICE is considered to be | | | |
| done. Consequently, media can flow in each direction for that | | | |
| stream, as shown in Figure 4. Once all of the media streams are | | | |
| completed, the controlling endpoint sends an updated offer if the | | | |
| currently in-use candidates don't match the ones it selected. | | | |
| | | | |
| L R | | L R | |
| - - | | - - | |
|
| STUN request + flag -> \ L's | | STUN request \ L's | |
| <- STUN response / check | | <- STUN response / check | |
| | | | |
|
| -> RTP Data | | <- STUN request \ R's | |
| <- RTP Data | | STUN response -> / check | |
| | | | |
| | | STUN request + flag \ L's | |
| | | <- STUN response / check | |
| | | | |
| | | Figure 4: Regular Nomination | |
| | | | |
| | | Once the STUN transaction with the flag completes, both sides cancel | |
| | | any future checks for that media stream. ICE will now send media | |
| | | using this pair. The pair an ICE agent is using for media is called | |
| | | the SELECTED PAIR. | |
| | | | |
| | | In aggressive nomination, the controlling agent puts the flag in | |
| | | every STUN request it sends. This way, once the first check | |
| | | succeeds, ICE processing is complete for that media stream and the | |
| | | controlling agent doesn't have to send a second STUN request. The | |
| | | selected pair will be the highest priority valid pair. Aggressive | |
| | | nomination is faster than regular nomination, but gives less | |
| | | flexibility. Aggressive nomination is shown in Figure 5. | |
| | | | |
| | | L R | |
| | | - - | |
| | | STUN request + flag \ L's | |
| | | <- STUN response / check | |
| | | | |
| | | <- STUN request \ R's | |
| | | STUN response -> / check | |
| | | | |
| | | Figure 5: Aggressive Nomination | |
| | | | |
| | | Once all of the media streams are completed, the controlling endpoint | |
| | | sends an updated offer if the candidates in the m and c lines for the | |
| | | media stream (called the DEFAULT CANDIDATES) don't match ICE's | |
| | | SELECTED CANDIDATES. | |
| | | | |
|
| Figure 4 | | | |
| Once ICE is concluded, it can be restarted at any time for one or all | | Once ICE is concluded, it can be restarted at any time for one or all | |
|
| of the media streams by each agent. This is done by sending an | | of the media streams by either agent. This is done by sending an | |
| updated offer indicating a restart. | | updated offer indicating a restart. | |
| | | | |
| 2.7. Lite Implementations | | 2.7. Lite Implementations | |
| | | | |
| In order for ICE to be used in a call, both agents need to support | | In order for ICE to be used in a call, both agents need to support | |
|
| it. However, certain agents, such as those in gateways to the PSTN, | | it. However, certain agents will always be connected to the public | |
| media servers, conferencing servers, and voicemail servers, are known | | Internet and have a public IP address at which it can receive packets | |
| to not be behind a NAT or firewall. To make it easier for these | | from any correspondent. To make it easier for these devices to | |
| devices to support ICE, ICE defines a special type of implementation | | support ICE, ICE defines a special type of implementation called LITE | |
| called "lite" (in contrast to the normal "full" implementation). A | | (in contrast to the normal FULL implementation). A lite | |
| lite implementation doesn't gather candidates; it includes only its | | implementation doesn't gather candidates; it includes only host | |
| host candidate for any media stream. When a lite implementation | | candidates for any media stream. When a lite implementation connects | |
| connects with a full implementation, the full agent takes the role of | | with a full implementation, the full agent takes the role of the | |
| the controlling agent, and the lite agent takes on the controlled | | controlling agent, and the lite agent takes on the controlled role. | |
| role. In addition, lite agents do not need to generate connectivity | | In addition, lite agents do not need to generate connectivity checks, | |
| checks, run the state machines, or compute candidate pairs. For an | | run the state machines, or compute candidate pairs. Additional | |
| informational summary of ICE processing as seen by a lite agent, see | | guidance on when a lite implementation is appropriate, see the | |
| [33]. | | discussion in Appendix A. For an informational summary of ICE | |
| | | processing as seen by a lite agent, see [36]. | |
| | | | |
| | | 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. | |
| | | | |
| 3. Terminology | | 3. Terminology | |
| | | | |
| The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", | | The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", | |
| "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this | | "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this | |
| document are to be interpreted as described in RFC 2119 [1]. | | document are to be interpreted as described in RFC 2119 [1]. | |
| | | | |
|
| This specification makes use of the following terminology: | | Readers should be familiar with the terminology defined in the offer/ | |
| | | answer model [4], STUN [12] and NAT Behavioral requirements for UDP | |
| | | [29] | |
| | | | |
| | | This specification makes use of the following additional terminology: | |
| | | | |
| Agent: As defined in RFC 3264, an agent is the protocol | | Agent: As defined in RFC 3264, an agent is the protocol | |
| implementation involved in the offer/answer exchange. There are | | implementation involved in the offer/answer exchange. There are | |
| two agents involved in an offer/answer exchange. | | two agents involved in an offer/answer exchange. | |
| | | | |
| Peer: From the perspective of one of the agents in a session, its | | Peer: From the perspective of one of the agents in a session, its | |
| peer is the other agent. Specifically, from the perspective of | | peer is the other agent. Specifically, from the perspective of | |
| the offerer, the peer is the answerer. From the perspective of | | the offerer, the peer is the answerer. From the perspective of | |
| the answerer, the peer is the offerer. | | the answerer, the peer is the offerer. | |
| | | | |
|
| Transport Address: The combination of an IP address and port. | | Transport Address: The combination of an IP address and transport | |
| | | protocol (such as UDP or TCP) port. | |
| | | | |
|
| Candidate: A transport address that is to be tested by ICE procedures | | Candidate: A transport address that is to be tested by ICE | |
| in order to determine its suitability for usage for receipt of | | procedures in order to determine its suitability for usage for | |
| media. | | receipt of media. Candidates also have properties - their type | |
| | | (server reflexive, relayed or host), priority, foundation, and | |
| | | base. | |
| | | | |
|
| Component: A component is a single transport address that is used to | | Component: A component is a piece of a media stream requiring a | |
| support a media stream. For media streams based on RTP, there are | | single transport address; a media stream may require multiple | |
| two components per media stream - one for RTP, and one for RTCP. | | components, each of which has to work for the media stream as a | |
| | | whole to 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 specific port | | Host Candidate: A candidate obtained by binding to a specific port | |
| from an interface on the host. This includes both physical | | from an interface on the host. This includes both physical | |
| interfaces and logical ones, such as ones obtained through Virtual | | interfaces and logical ones, such as ones obtained through Virtual | |
|
| Private Networks (VPNs) and Realm Specific IP (RSIP) [18] (which | | Private Networks (VPNs) and Realm Specific IP (RSIP) [19] (which | |
| lives at the operating system level). | | lives at the operating system level). | |
| | | | |
| Server Reflexive Candidate: A candidate obtained by sending a STUN | | Server Reflexive Candidate: A candidate obtained by sending a STUN | |
| request from a host candidate to a STUN server, distinct from the | | request from a host candidate to a STUN server, distinct from the | |
|
| peer, whose address is configured or learned by the client prior | | peer. The STUN server's address is configured or learned by the | |
| to an offer/answer exchange. | | client prior to an offer/answer exchange. | |
| | | | |
| Peer Reflexive Candidate: A candidate obtained by sending a STUN | | Peer Reflexive Candidate: A candidate obtained by sending a STUN | |
| request from a host candidate to the STUN server running on a | | request from a host candidate to the STUN server running on a | |
| peer's candidate. | | peer's candidate. | |
| | | | |
| Relayed Candidate: A candidate obtained by sending a STUN Allocate | | Relayed Candidate: A candidate obtained by sending a STUN Allocate | |
| request from a host candidate to a STUN server. The relayed | | request from a host candidate to a STUN server. The relayed | |
| candidate is resident on the STUN server, and the STUN server | | candidate is resident on the STUN server, and the STUN server | |
| relays packets back towards the agent. | | relays packets back towards the agent. | |
| | | | |
|
| Translation: The translation of a relayed candidate is the transport | | | |
| address that the relay will forward a packet to, when one is | | | |
| received at the relayed candidate. For relayed candidates learned | | | |
| through the STUN Allocate request, the translation of the relayed | | | |
| candidate is the server reflexive candidate returned by the | | | |
| Allocate response. | | | |
| | | | |
| Base: The base of a server reflexive candidate is the host candidate | | Base: The base of a server reflexive candidate is the host candidate | |
| from which it was derived. A host candidate is also said to have | | from which it was derived. A host candidate is also said to have | |
| a base, equal to that candidate itself. Similarly, the base of a | | a base, equal to that candidate itself. Similarly, the base of a | |
| relayed candidate is that candidate itself. | | relayed candidate is that candidate itself. | |
| | | | |
|
| Foundation: Each candidate has a foundation, which is an identifier | | Foundation: An arbitrary string that is the same for two candidates | |
| that is distinct for two candidates that have different types, | | that have the same type, base IP address, and STUN server. If any | |
| different interface IP addresses for their base, and different IP | | of these are different then the foundation will be different. Two | |
| addresses for their STUN servers. Two candidates have the same | | candidate pairs with the same foundation pairs are likely to have | |
| foundation when they are of the same type, their bases have the | | similar network characteristics. Foundations are used in the | |
| same IP address, and, for server reflexive or relayed candidates, | | frozen algorithm. | |
| they come from the same STUN server. Foundations are used to | | | |
| correlate candidates, so that when one candidate is found to be | | | |
| valid, candidates sharing the same foundation can be tested next, | | | |
| as they are likely to also be valid. | | | |
| | | | |
| Local Candidate: A candidate that an agent has obtained and included | | Local Candidate: A candidate that an agent has obtained and included | |
| in an offer or answer it sent. | | in an offer or answer it sent. | |
| | | | |
| Remote Candidate: A candidate that an agent received in an offer or | | Remote Candidate: A candidate that an agent received in an offer or | |
| answer from its peer. | | answer from its peer. | |
| | | | |
|
| In-Use Candidate: A candidate is in-use when it appears in the m/c- | | Default Destination/Candidate: The default destination for a | |
| line of an active media stream. | | component of a media stream is the transport address that would be | |
| | | used by an agent that is not ICE aware. For the RTP component, | |
| | | the default IP address is in the c line of the SDP, and the port | |
| | | in the m line. For the RTCP component it is in the rtcp attribute | |
| | | when present, and when not present, the IP address in the c line | |
| | | and 1 plus the port in the m line. A default candidate for a | |
| | | component is one whose transport address matches the default | |
| | | destination for that component. | |
| | | | |
| Candidate Pair: A pairing containing a local candidate and a remote | | Candidate Pair: A pairing containing a local candidate and a remote | |
| candidate. | | candidate. | |
| | | | |
|
| Check: A candidate pair where the local candidate is a transport | | Check, Connectivity Check, STUN Check: A STUN Binding Request | |
| address from which an agent can send a STUN connectivity check. | | transaction for the purposes of verifying connectivity. A check | |
| | | is sent from the local candidate to the remote candidate of a | |
| | | candidate pair. | |
| | | | |
|
| Check List: An ordered set of STUN checks that an agent is to | | Check List: An ordered set of candidate pairs that an agent will use | |
| generate towards a peer. | | to generate checks. | |
| | | | |
| Periodic Check: A connectivity check generated by an agent as a | | Periodic Check: A connectivity check generated by an agent as a | |
| consequence of a timer that fires periodically, instructing it to | | consequence of a timer that fires periodically, instructing it to | |
| send a check. | | send a check. | |
| | | | |
| Triggered Check: A connectivity check generated as a consequence of | | Triggered Check: A connectivity check generated as a consequence of | |
| the receipt of a connectivity check from the peer. | | the receipt of a connectivity check from the peer. | |
| | | | |
|
| Valid List: An ordered set of candidate pairs for a media stream that | | Valid List: An ordered set of candidate pairs for a media stream | |
| have been validated by a successful STUN transaction. | | that have been validated by a successful STUN transaction. | |
| | | | |
| Full: An ICE implementation that performs the complete set of | | Full: An ICE implementation that performs the complete set of | |
| functionality defined by this specification. | | functionality defined by this specification. | |
| | | | |
| Lite: An ICE implementation that omits certain functions, | | Lite: An ICE implementation that omits certain functions, | |
| implementing only as much as is necessary for a peer | | implementing only as much as is necessary for a peer | |
| implementation that is full to gain the benefits of ICE. Lite | | implementation that is full to gain the benefits of ICE. Lite | |
| implementations can only act as the controlled agent in a session, | | implementations can only act as the controlled agent in a session, | |
| and do not gather candidates. | | and do not gather candidates. | |
| | | | |
| Controlling Agent: The STUN agent which is responsible for selecting | | Controlling Agent: The STUN agent which is responsible for selecting | |
| the final choice of candidate pairs and signaling them through | | the final choice of candidate pairs and signaling them through | |
| STUN and an updated offer, if needed. In any session, one agent | | STUN and an updated offer, if needed. In any session, one agent | |
| is always controlling. The other is the controlled agent. | | is always controlling. The other is the controlled agent. | |
| | | | |
| Controlled Agent: A STUN agent which waits for the controlling agent | | Controlled Agent: A STUN agent which waits for the controlling agent | |
| to select the final choice of candidate pairs. | | to select the final choice of candidate pairs. | |
| | | | |
|
| | | Regular Nomination: The process of picking a valid candidate pair | |
| | | for media traffic by validating the pair with one STUN request, | |
| | | and then picking it by sending a second STUN request with a flag | |
| | | indicating its nomination. | |
| | | | |
| | | Aggressive Nomination: The process of picking a valid candidate pair | |
| | | for media traffic by including a flag in every STUN request, such | |
| | | that the first one to produce a valid candidate pair is used for | |
| | | media. | |
| | | | |
| | | Nominated: If a valid candidate pair has its 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 sending and receiving media is called the selected pair, | |
| | | and each of its candidates is called the selected candidate. | |
| | | | |
| 4. Sending the Initial Offer | | 4. Sending the Initial Offer | |
| | | | |
| In order to send the initial offer in an offer/answer exchange, an | | In order to send the initial offer in an offer/answer exchange, an | |
|
| agent must gather candidates, priorize them, choose ones for | | agent must (1) gather candidates, (2) prioritize them, (3) choose | |
| inclusion in the m/c-line, and then formulate and send the SDP. The | | default candidates, and then (4) formulate and send the SDP. The | |
| first of these three steps differ for full and lite implementations. | | first of these four steps differ for full and lite implementations. | |
| | | | |
| 4.1. Full Implementation Requirements | | 4.1. Full Implementation Requirements | |
| | | | |
| 4.1.1. Gathering Candidates | | 4.1.1. Gathering Candidates | |
| | | | |
| An agent gathers candidates when it believes that communications is | | An agent gathers candidates when it believes that communications is | |
| imminent. An offerer can do this based on a user interface cue, or | | imminent. An offerer can do this based on a user interface cue, or | |
| based on an explicit request to initiate a session. Every candidate | | based on an explicit request to initiate a session. Every candidate | |
| is a transport address. It also has a type and a base. Three types | | is a transport address. It also has a type and a base. Three types | |
| are defined and gathered by this specification - host candidates, | | are defined and gathered by this specification - host candidates, | |
|
| server reflexive candidates, and relayed candidates. The base of a | | server reflexive candidates, and relayed candidates. The server | |
| candidate is the candidate that an agent must send from when using | | reflexive and relayed candidates are gathered using STUN's Binding | |
| that candidate. | | Discovery and Relay Usages. The base of a candidate is the candidate | |
| | | that an agent must send from when using that candidate. | |
| | | | |
| | | 4.1.1.1. Host Candidates | |
| | | | |
| The first step is to gather host candidates. Host candidates are | | The first step is to gather host candidates. Host candidates are | |
| obtained by binding to ports (typically ephemeral) on an interface | | obtained by binding to ports (typically ephemeral) on an interface | |
| (physical or virtual, including VPN interfaces) on the host. The | | (physical or virtual, including VPN interfaces) on the host. The | |
| process for gathering host candidates depends on the transport | | process for gathering host candidates depends on the transport | |
| protocol. Procedures are specified here for UDP. | | protocol. Procedures are specified here for UDP. | |
| | | | |
| For each UDP media stream the agent wishes to use, the agent SHOULD | | For each UDP media stream the agent wishes to use, the agent SHOULD | |
| obtain a candidate for each component of the media stream on each | | obtain a candidate for each component of the media stream on each | |
| interface that the host has. It obtains each candidate by binding to | | interface that the host has. It obtains each candidate by binding to | |
| | | | |
| skipping to change at page 16, line 45 | | skipping to change at page 20, line 27 | |
| every candidate) is always associated with a specific component for | | every candidate) is always associated with a specific component for | |
| which it is a candidate. Each component has an ID assigned to it, | | which it is a candidate. Each component has an ID assigned to it, | |
| called the component ID. For RTP-based media streams, the RTP itself | | called the component ID. For RTP-based media streams, the RTP itself | |
| has a component ID of 1, and RTCP a component ID of 2. If an agent | | has a component ID of 1, and RTCP a component ID of 2. If an agent | |
| is using RTCP it MUST obtain a candidate for it. If an agent is | | is using RTCP it MUST obtain a candidate for it. If an agent is | |
| using both RTP and RTCP, it would end up with 2*K host candidates if | | using both RTP and RTCP, it would end up with 2*K host candidates if | |
| an agent has K interfaces. | | an agent has K interfaces. | |
| | | | |
| The base for each host candidate is set to the candidate itself. | | The base for each host candidate is set to the candidate itself. | |
| | | | |
|
| | | 4.1.1.2. Server Reflexive and Relayed Candidates | |
| | | | |
| Agents SHOULD obtain relayed candidates and MUST obtain server | | Agents SHOULD obtain relayed candidates and MUST obtain server | |
| reflexive candidates. The requirement to obtain relayed candidates | | reflexive candidates. The requirement to obtain relayed candidates | |
|
| is at SHOULD strength to allow for provider variation. If they are | | is at SHOULD strength to allow for provider variation. Use of relays | |
| not used, it is RECOMMENDED that it be implemented and just disabled | | is expensive, and when ICE is being used, relays will only be | |
| through configuration, so that it can re-enabled through | | required when both endpoints are behind NATs that perform address and | |
| configuration if conditions change in the future. | | port dependent mapping. Consequently, some deployments might | |
| | | consider this use case to be marginal, and elect not to use relays. | |
| | | If they are not used, it is RECOMMENDED that it be implemented and | |
| | | just disabled through configuration, so that it can re-enabled | |
| | | through configuration if conditions change in the future. | |
| | | | |
| The agent next pairs each host candidate with the STUN server with | | The agent next pairs each host candidate with the STUN server with | |
| which it is configured or has discovered by some means. This | | which it is configured or has discovered by some means. This | |
|
| specification only considers usage of a single STUN server. Every Ta | | specification only considers usage of a single STUN server. At that | |
| seconds, the agent chooses another such pair (the order is | | very instance, and then every Ta milliseconds thereafter, the agent | |
| inconsequential), and sends a STUN request to the server from that | | chooses another such pair (the order is inconsequential), and sends a | |
| host candidate. If the agent is using both relayed and server | | STUN request to the server from that host candidate. If the agent is | |
| reflexive candidates, this request MUST be a STUN Allocate request | | using both relayed and server reflexive candidates, this request MUST | |
| from the relay usage [12]. If the agent is using only server | | be a STUN Allocate request using the relay usage [13]. If the agent | |
| reflexive candidates, the request MUST be a STUN Binding request | | is using only server reflexive candidates, the request MUST be a STUN | |
| using the binding discovery usage [11]. | | Binding request using the binding discovery usage [12]. | |
| | | | |
| The value of Ta SHOULD be configurable, and SHOULD have a default of | | The value of Ta SHOULD be configurable, and SHOULD have a default of | |
|
| 20ms. Note that this pacing applies only to starting STUN | | 20ms (see Appendix B.1 for a discussion on the selection of this | |
| | | value). Note that this pacing applies only to starting STUN | |
| transactions with source and destination transport addresses (i.e., | | transactions with source and destination transport addresses (i.e., | |
| the host candidate and STUN server respectively) for which a STUN | | the host candidate and STUN server respectively) for which a STUN | |
| transaction has not previously been sent. Consequently, | | transaction has not previously been sent. Consequently, | |
| retransmissions of a STUN request are governed entirely by the | | retransmissions of a STUN request are governed entirely by the | |
|
| retransmission rules defined in [11]. Similarly, retries of a | | retransmission rules defined in [12]. Similarly, retries of a | |
| request due to recoverable errors (such as an authentication | | request due to recoverable errors (such as an authentication | |
| challenge) happen immediately and are not paced by timer Ta. Because | | 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 this pacing, it will take a certain amount of time to obtain all | |
| of the server reflexive and relayed candidates. Implementations | | of the server reflexive and relayed candidates. Implementations | |
| should be aware of the time required to do this, and if the | | should be aware of the time required to do this, and if the | |
|
| application requires a time budget, limit the amount of candidates | | application requires a time budget, limit the number of candidates | |
| which are gathered. | | which are gathered. | |
| | | | |
|
| An Allocate Response will provide the agent with a server reflexive | | The agent will receive a STUN Binding or Allocate response. A | |
| candidate (obtained from the mapped address) and a relayed candidate | | successful Allocate Response will provide the agent with a server | |
| in the RELAY-ADDRESS attribute. A Binding Response will provide the | | reflexive candidate (obtained from the mapped address) and a relayed | |
| agent with only a server reflexive candidate (also obtained from the | | candidate in the RELAY-ADDRESS attribute. If the Allocate request is | |
| mapped address). The base of the server reflexive candidate is the | | rejected because the server lacks resources to fulfill it, the agent | |
| host candidate from which the Allocate or Binding request was sent. | | SHOULD instead send a Binding Request to obtain a server reflexive | |
| The base of a relayed candidate is that candidate itself. A server | | candidate. A Binding Response will provide the agent with only a | |
| reflexive candidate obtained from an Allocate response is the called | | server reflexive candidate (also obtained from the mapped address). | |
| the "translation" of the relayed candidate obtained from the same | | The base of the server reflexive candidate is the host candidate from | |
| response. The agent will need to remember the translation for the | | which the Allocate or Binding request was sent. The base of a | |
| relayed candidate, since it is placed into the SDP. If a relayed | | relayed candidate is that candidate itself. If a relayed candidate | |
| candidate is identical to a host candidate (which can happen in rare | | is identical to a host candidate (which can happen in rare cases), | |
| cases), the relayed candidate MUST be discarded. Proper operation of | | the relayed candidate MUST be discarded. Proper operation of ICE | |
| ICE depends on each base being unique. | | depends on each base being unique. | |
| | | | |
| | | 4.1.1.3. Eliminating Redundant Candidates | |
| | | | |
| Next, the agent eliminates redundant candidates. A candidate is | | Next, the agent eliminates redundant candidates. A candidate is | |
| redundant if its transport address equals another candidate, and its | | redundant if its transport address equals another candidate, and its | |
| base equals the base of that other candidate. Note that two | | base equals the base of that other candidate. Note that two | |
| candidates can have the same transport address yet have different | | candidates can have the same transport address yet have different | |
| bases, and these would not be considered redundant. | | bases, and these would not be considered redundant. | |
| | | | |
|
| | | 4.1.1.4. Computing Foundations | |
| | | | |
| Finally, the agent assigns each candidate a foundation. The | | Finally, the agent assigns each candidate a foundation. The | |
| foundation is an identifier, scoped within a session. Two candidates | | foundation is an identifier, scoped within a session. Two candidates | |
|
| MUST have the same foundation ID when they are of the same type | | MUST have the same foundation ID when all of the following are true: | |
| (host, relayed, server reflexive, peer reflexive or relayed), their | | | |
| bases have the same IP address (the ports can be different), and, for | | o they are of the same type (host, relayed, server reflexive, peer | |
| reflexive and relayed candidates, the STUN servers used to obtain | | reflexive or relayed) | |
| them have the same IP address. Similarly, two candidates MUST have | | | |
| different foundations if their types are different, their bases have | | o their bases have the same IP address (the ports can be different) | |
| different IP addresses, or the STUN servers used to obtain them have | | o for reflexive and relayed candidates, the STUN servers used to | |
| different IP addresses. | | obtain them 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 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 Allocate request will also | |
| | | refresh the server reflexive candidate. | |
| | | | |
| 4.1.2. Prioritizing Candidates | | 4.1.2. Prioritizing Candidates | |
| | | | |
| The prioritization process results in the assignment of a priority to | | The prioritization process results in the assignment of a priority to | |
| each candidate. Each candidate for a media stream MUST have a unique | | each candidate. Each candidate for a media stream MUST have a unique | |
|
| priority. An agent SHOULD compute the priority by determining a | | priority that MUST be a positive integer between 1 and (2**32 - 1). | |
| preference for each type of candidate (server reflexive, peer | | This priority will be used by ICE to determine the order of the | |
| | | connectivity checks and the relative preference for candidates. | |
| | | | |
| | | An agent SHOULD compute this priority using the formula in | |
| | | Section 4.1.2.1 and choose its parameters using the guidelines in | |
| | | Section 4.1.2.2. If an agent 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 formula, an agent computes the priority by determining | |
| | | a preference for each type of candidate (server reflexive, peer | |
| reflexive, relayed and host), and, when the agent is multihomed, | | reflexive, relayed and host), and, when the agent is multihomed, | |
| choosing a preference for its interfaces. These two preferences are | | choosing a preference for its interfaces. These two preferences are | |
| then combined to compute the priority for a candidate. That priority | | then combined to compute the priority for a candidate. That priority | |
|
| SHOULD be computed using the following formula: | | is computed using the following formula: | |
| | | | |
| priority = (2^24)*(type preference) + | | priority = (2^24)*(type preference) + | |
| (2^8)*(local preference) + | | (2^8)*(local preference) + | |
| (2^0)*(256 - component ID) | | (2^0)*(256 - component ID) | |
| | | | |
| The type preference MUST be an integer from 0 to 126 inclusive, and | | The type preference MUST be an integer from 0 to 126 inclusive, and | |
| represents the preference for the type of the candidate (where the | | represents the preference for the type of the candidate (where the | |
| types are local, server reflexive, peer reflexive and relayed). A | | types are local, server reflexive, peer reflexive and relayed). A | |
| 126 is the highest preference, and a 0 is the lowest. Setting the | | 126 is the highest preference, and a 0 is the lowest. Setting the | |
| value to a 0 means that candidates of this type will only be used as | | value to a 0 means that candidates of this type will only be used as | |
| a last resort. The type preference MUST be identical for all | | a last resort. The type preference MUST be identical for all | |
| candidates of the same type and MUST be different for candidates of | | candidates of the same type and MUST be different for candidates of | |
| different types. The type preference for peer reflexive candidates | | different types. The type preference for peer reflexive candidates | |
| MUST be higher than that of server reflexive candidates. Note that | | MUST be higher than that of server reflexive candidates. Note that | |
| candidates gathered based on the procedures of Section 4.1.1 will | | candidates gathered based on the procedures of Section 4.1.1 will | |
| never be peer reflexive candidates; candidates of these type are | | never be peer reflexive candidates; candidates of these type are | |
|
| learned from the STUN connectivity checks performed by ICE. The | | learned from the STUN connectivity checks performed by ICE. | |
| component ID is the component ID for the candidate, and MUST be | | | |
| between 1 and 256 inclusive. The local preference MUST be an integer | | | |
| from 0 to 65535 inclusive. It represents a preference for the | | | |
| particular interface from which the candidate was obtained, in cases | | | |
| where an agent is multihomed. 65535 represents the highest | | | |
| preference, and a zero, the lowest. When there is only a single | | | |
| interface, this value SHOULD be set to 65535. Generally speaking, if | | | |
| there are multiple candidates for a particular component for a | | | |
| 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. | | | |
| | | | |
|
| These rules guarantee that there is a unique priority for each | | The local preference MUST be an integer from 0 to 65535 inclusive. | |
| candidate. This priority will be used by ICE to determine the order | | It represents a preference for the particular interface from which | |
| of the connectivity checks and the relative preference for | | the candidate was obtained, in cases where an agent is multihomed. | |
| candidates. Consequently, what follows are some guidelines for | | 65535 represents the highest preference, and a zero, the lowest. | |
| selection of these values. | | When there is only a single interface, this value SHOULD be set to | |
| | | 65535. More generally, if there are multiple candidates for a | |
| | | particular component for a 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 ID is the 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 the type and local preference values is | | One criteria for selection of the type and local preference values is | |
|
| the use of an intermediary. That is, if media is sent to that | | the use of an intermediary, such as a media relay. With an | |
| candidate, will the media first transit an intermediate server before | | intermediary, if media is sent to that candidate, it will first | |
| being received? Relayed candidates are clearly one type of | | transit the intermediary before being received. Relayed candidates | |
| candidates that involve an intermediary. Another are host candidates | | are one type of candidate that involves an intermediary. Another are | |
| obtained from a VPN interface. When media is transited through an | | host candidates obtained from a VPN interface. When media is | |
| intermediary, it can increase the latency between transmission and | | transited through an intermediary, it can increase the latency | |
| reception. It can increase the packet losses, because of the | | between transmission and reception. It can increase the packet | |
| additional router hops that may be taken. It may increase the cost | | losses, because of the additional router hops that may be taken. It | |
| of providing service, since media will be routed in and right back | | may increase the cost of providing service, since media will be | |
| out of an intermediary run by the provider. If these concerns are | | routed in and right back out of a media relay run by the provider. | |
| important, the type preference for relayed candidates can be set | | If these concerns are important, the type preference for relayed | |
| lower than the type preference for reflexive and host candidates. | | candidates SHOULD be lower than host candidates. The RECOMMENDED | |
| Indeed, it is RECOMMENDED that in this case, host candidates have a | | values are 126 for host candidates, 100 for server reflexive | |
| type preference of 126, server reflexive candidates have a type | | candidates, 110 for peer reflexive candidates, and 0 for relayed | |
| preference of 100, peer reflexive have a type prefence of 110, and | | candidates. Furthermore, if an agent is multi-homed and has multiple | |
| relayed candidates have a type preference of zero. Furthermore, if | | interfaces, the local preference for host candidates from a VPN | |
| an agent is multi-homed and has multiple interfaces, the local | | interface SHOULD have a priority of 0. | |
| preference for host candidates from a VPN interface SHOULD have a | | | |
| priority of 0. | | | |
| | | | |
| Another criteria for selection of preferences is IP address family. | | Another criteria for selection of preferences is IP address family. | |
| ICE works with both IPv4 and IPv6. It therefore provides a | | ICE works with both IPv4 and IPv6. It therefore provides a | |
| transition mechanism that allows dual-stack hosts to prefer | | transition mechanism that allows dual-stack hosts to prefer | |
| connectivity over IPv6, but to fall back to IPv4 in case the v6 | | connectivity over IPv6, but to fall back to IPv4 in case the v6 | |
| networks are disconnected (due, for example, to a failure in a 6to4 | | networks are disconnected (due, for example, to a failure in a 6to4 | |
|
| relay) [23]. It can also help with hosts that have both a native | | relay) [24]. It can also help with hosts that have both a native | |
| IPv6 address and a 6to4 address. In such a case, lower local | | IPv6 address and a 6to4 address. In such a case, higher local | |
| preferences could be assigned to the v6 interface, followed by the | | preferences could be assigned to the v6 interface, followed by the | |
| 6to4 interfaces, followed by the v4 interfaces. This allows a site | | 6to4 interfaces, followed by the v4 interfaces. This allows a site | |
| to obtain and begin using native v6 addresses immediately, yet still | | to obtain and begin using native v6 addresses immediately, yet still | |
| fallback to 6to4 addresses when communicating with agents in other | | fallback to 6to4 addresses when communicating with agents in other | |
| sites that do not yet have native v6 connectivity. | | sites that do not yet have native v6 connectivity. | |
| | | | |
| Another criteria for selecting preferences is security. If a user is | | Another criteria for selecting preferences is security. If a user is | |
| a telecommuter, and therefore connected to their corporate network | | a telecommuter, and therefore connected to their corporate network | |
| and a local home network, they may prefer their voice traffic to be | | and a local home network, they may prefer their voice traffic to be | |
| routed over the VPN in order to keep it on the corporate network when | | routed over the VPN in order to keep it on the corporate network when | |
| | | | |
| skipping to change at page 20, line 14 | | skipping to change at page 24, line 30 | |
| a VPN interface would have a higher local preference than any other | | a VPN interface would have a higher local preference than any other | |
| interface. | | interface. | |
| | | | |
| Another criteria for selecting preferences is topological awareness. | | Another criteria for selecting preferences is topological awareness. | |
| This is most useful for candidates that make use of relays. In those | | This is most useful for candidates that make use of relays. In those | |
| cases, if an agent has preconfigured or dynamically discovered | | cases, if an agent has preconfigured or dynamically discovered | |
| knowledge of the topological proximity of the relays to itself, it | | knowledge of the topological proximity of the relays to itself, it | |
| can use that to assign higher local preferences to candidates | | can use that to assign higher local preferences to candidates | |
| obtained from closer relays. | | obtained from closer relays. | |
| | | | |
|
| 4.1.3. Choosing In-Use Candidates | | 4.1.3. Choosing Default Candidates | |
| | | | |
|
| A candidate is said to be "in-use" if it appears in the m/c-line of | | A candidate is said to be default if it would be the target of media | |
| an offer or answer. When communicating with an ICE peer, being in- | | from a non-ICE peer; that target being called the DEFAULT | |
| use implies that, should these candidates be selected by the ICE | | DESTINATION. If the default candidates are not selected by the ICE | |
| algorithm, a re-INVITE will not be required after ICE processing | | algorithm when communicating with an ICE-aware peer, an updated | |
| completes. When communicating with a peer that is not ICE-aware, the | | offer/answer will be required after ICE processing completes in order | |
| in-use candidates will be used exclusively for the exchange of media, | | to "correct" the SDP so that the default destination for media | |
| as defined in normal offer/answer procedures. | | matches the candidates selected by ICE. If ICE happens to select the | |
| | | default candidates, no updated offer/answer is required. | |
| | | | |
| An agent MUST choose a set of candidates, one for each component of | | An agent MUST choose a set of candidates, one for each component of | |
|
| each active media stream, to be in-use. A media stream is active if | | each in-use media stream, to be default. A media stream is in-use if | |
| it does not contain the a=inactive SDP attribute. | | it does not have a port of zero (which is used in RFC 3264 to reject | |
| | | a media stream). Consequently, a media stream is in-use even if it | |
| | | is marked as a=inactive [10] or has a bandwidth value of zero. | |
| | | | |
|
| It is RECOMMENDED that in-use candidates be chosen based on the | | It is RECOMMENDED that default candidates be chosen based on the | |
| likelihood of those candidates to work with the peer that is being | | likelihood of those candidates to work with the peer that is being | |
|
| contacted. Unfortunately, it is difficult to ascertain which | | contacted. It is RECOMMENDED that the default candidates are the | |
| candidates that might be. As an example, consider a user within an | | relayed candidates (if relayed candidates are available), server | |
| enterprise. To reach non-ICE capable agents within the enterprise, | | reflexive candidates (if server reflexive candidates are available), | |
| host candidates have to be used, since the enterprise policies may | | and finally host candidates. | |
| prevent communication between elements using a relay on the public | | | |
| network. However, when communicating to peers outside of the | | | |
| enterprise, relayed candidates from a publically accessible STUN | | | |
| server are needed. | | | |
| | | | |
| Indeed, the difficulty in picking just one transport address that | | | |
| will work is the whole problem that motivated the development of this | | | |
| specification in the first place. As such, it is RECOMMENDED that | | | |
| agents select relayed candidates to be in-use. | | | |
| | | | |
| 4.2. Lite Implementation | | 4.2. Lite Implementation | |
| | | | |
| For each media stream, the agent allocates a single candidate for | | For each media stream, the agent allocates a single candidate for | |
| each component of the media stream from one of its interfaces. If an | | each component of the media stream from one of its interfaces. If an | |
|
| agent is multi-homed, it MUST choose one of its interfaces for a | | agent has multiple interfaces, it MUST choose one for each component | |
| particular media stream; ICE cannot be used to dynamically choose | | of a particular media stream. With the lite implementation, ICE | |
| one. Each component has an ID assigned to it, called the component | | cannot be used to dynamically choose amongst candidates. Each | |
| ID. For RTP-based media streams, the RTP itself has a component ID | | component has an ID assigned to it, called the component ID. For | |
| of 1, and RTCP a component ID of 2. If an agent is using RTCP it | | RTP-based media streams the RTP itself has a component ID of 1, and | |
| MUST obtain a candidate for it. | | RTCP a component ID of 2. If an agent is using RTCP it MUST obtain a | |
| | | candidate for it. | |
| | | | |
| Each candidate is assigned a foundation. The foundation MUST be | | Each candidate is assigned a foundation. The foundation MUST be | |
|
| different for two candidates from different interfaces (which can | | different for two candidates from different interfaces, and MUST be | |
| occur if media streams are on different interfaces), and MUST be the | | the same otherwise. A simple integer that increments for each | |
| same otherwise. A simple integer that increments for each interface | | interface will suffice. In addition, each candidate MUST be assigned | |
| will suffice. In addition, each candidate MUST be assigned a unique | | a unique priority amongst all candidates for the same media stream. | |
| priority amongst all candidates for the same media stream. This | | This priority SHOULD be equal to 2^24*(126) + 2^8*(65535) + 256 minus | |
| priority SHOULD be equal to 2^24*(126) + 2^8*(65535) + 256 minus the | | the component ID, which is 2130706432 minus the component ID. | |
| component ID, which is 2130706432 minus the component ID. Each of | | | |
| these candidates is also considered to be "in-use", since they will | | If an agent has included two candidates for a component, the v4 | |
| be included in the m/c-line of an offer or answer. | | candidate SHOULD be selected as the default. Since a lite | |
| | | implementation has a single candidate for a component, each of these | |
| | | candidates is considered to be default. | |
| | | | |
| 4.3. Encoding the SDP | | 4.3. Encoding the SDP | |
| | | | |
| The process of encoding the SDP is identical between full and lite | | The process of encoding the SDP is identical between full and lite | |
| implementations. | | implementations. | |
| | | | |
|
| The agent includes a single a=candidate media level attribute in the | | The agent will include an m-line for each media stream it wishes to | |
| SDP for each candidate for that media stream. The a=candidate | | use. The ordering of media streams in the SDP is relevant for ICE. | |
| attribute contains the IP address, port and transport protocol for | | ICE will perform its connectivity checks for the first m-line first, | |
| that candidate. A Fully Qualified Domain Name (FQDN) for a host MAY | | and consequently media will be able to flow for that stream first. | |
| be used in place of a unicast address. In that case, when receiving | | Agents SHOULD place their most important media stream, if there is | |
| an offer or answer containing an FQDN in an a=candidate attribute, | | one, first in the SDP. | |
| 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. | | | |
| The candidate attribute also includes the component ID for that | | | |
| candidate. For media streams based on RTP, candidates for the 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 | | | |
| mapping of components to component IDs, and these component IDs MUST | | | |
| be between 1 and 256. | | | |
| | | | |
|
| The candidate attribute also includes the priority and the | | There will be a candidate attribute for each candidate for a | |
| foundation. The agent SHOULD include a type for each candidate by | | particular media stream. Section 15 provides detailed rules for | |
| populating the candidate-types production with the appropriate value | | constructing this attribute. The attribute carries the IP address, | |
| - "host" for host candidates, "srflx" for server reflexive | | port and transport protocol for the candidate, in addition to its | |
| candidates, "prflx" for peer reflexive candidates (though these never | | properties that need to be signaled to the peer for ICE to work: the | |
| appear in an initial offer/answer exchange), and "relay" for relayed | | priority, foundation, and component ID. The candidate attribute also | |
| candidates. The related address MUST NOT be included if a type was | | carries information about the candidate that is useful for | |
| not included. If a type was included, the related address SHOULD be | | diagnostics and other functions: its type and related transport | |
| present for server reflexive, peer reflexive and relayed candidates. | | addresses. | |
| If a candidate is server or peer reflexive, the related address is | | | |
| equal to the base for that server or peer reflexive candidate. If | | | |
| the candidate is relayed, the related address is equal to the | | | |
| translation of the relayed address. If the candidiate is a host | | | |
| candidate, there is no related address and the rel-addr production | | | |
| MUST be omitted. | | | |
| | | | |
| STUN connectivity checks between agents make use of a short term | | STUN connectivity checks between agents make use of a short term | |
| credential that is exchanged in the offer/answer process. The | | credential that is exchanged in the offer/answer process. The | |
| username part of this credential is formed by concatenating a | | username part of this credential is formed by concatenating a | |
| username fragment from each agent, separated by a colon. Each agent | | username fragment from each agent, separated by a colon. Each agent | |
| also provides a password, used to compute the message integrity for | | also provides a password, used to compute the message integrity for | |
|
| requests it receives. As such, an SDP MUST contain the ice-ufrag and | | requests it receives. The username fragment and password are | |
| ice-pwd attributes, containing the username fragment and password | | exchanged in the ice-ufrag and ice-pwd attributes, respectively. In | |
| respectively. These can be either session or media level attributes, | | addition to providing security, the username provides disambiguation | |
| and thus common across all candidates for all media streams, or all | | and correlation of checks to media streams. See Appendix B.4 for | |
| candidates for a particular media stream, respectively. However, if | | motivation. | |
| two media streams have identical ice-ufrag's, they MUST have | | | |
| identical ice-pwd's. The ice-ufrag 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 the ice- | | | |
| pwd attribute MUST contain at least 128 bits of randomness. This | | | |
| means that the ice-ufrag attribute will be at least 4 characters | | | |
| long, and the ice-pwd at least 22 characters long, since the grammar | | | |
| for these attributes allows for 6 bits of randomness per character. | | | |
| The attributes MAY be longer than 4 and 22 characters respectively, | | | |
| of course. | | | |
| | | | |
| If an agent is a lite implementation, it MUST include an "a=ice-lite" | | If an agent is a lite implementation, it MUST include an "a=ice-lite" | |
| session level attribute in its SDP. If an agent is a full | | session level attribute in its SDP. If an agent is a full | |
| implementation, it MUST NOT include this attribute. | | implementation, it MUST NOT include this attribute. | |
| | | | |
|
| The m/c-line is populated with the candidates that are in-use. For | | The default candidates are added to the SDP as the default | |
| streams based on RTP, this is done by placing the RTP candidate into | | destination for media. For streams based on RTP, this is done by | |
| the m and c lines respectively. If the agent is utilizing RTCP, it | | placing the IP address and port of the RTP candidate into the c and m | |
| MUST encode the RTCP candidate into the m/c-line using the a=rtcp | | lines, respectively. If the agent is utilizing RTCP, it MUST encode | |
| attribute as defined in RFC 3605 [2]. If RTCP is not in use, the | | the RTCP candidate using the a=rtcp attribute as defined in RFC 3605 | |
| agent MUST signal that using b=RS:0 and b=RR:0 as defined in RFC 3556 | | [2]. If RTCP is not in use, the agent MUST signal that using b=RS:0 | |
| [5]. | | and b=RR:0 as defined in RFC 3556 [5]. | |
| | | | |
|
| There MUST be a candidate attribute for each component of the media | | The transport addresses that will be the default destination for | |
| stream in the m/c-line. | | media when communicating with non-ICE peers MUST also be present as | |
| | | candidates in one or more a=candidate lines. | |
| | | | |
|
| Once an offer or answer are sent, an agent MUST be prepared to | | ICE provides for extensibility by allowing an offer or answer to | |
| receive both STUN and media packets on each candidate. As discussed | | contain a series of tokens which identify the ICE extensions used by | |
| in Section 11.1, media packets can be sent to a candidate prior to | | that agent. If an agent supports an ICE extension, it MUST include | |
| its appearence in the m/c-line. | | the token defined for that extension in the ice-options attribute. | |
| | | | |
| | | The following is an example SDP message that 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 sent its offer or sent its answer, that agent MUST | |
| | | be prepared to receive both STUN and media packets on each candidate. | |
| | | As discussed in Section 11.1, media packets can be sent to a | |
| | | candidate prior to its appearance as the default destination for | |
| | | media in an offer or answer. | |
| | | | |
| 5. Receiving the Initial Offer | | 5. Receiving the Initial Offer | |
| | | | |
| When an agent receives an initial offer, it will check if the offeror | | When an agent receives an initial offer, it will check if the offeror | |
|
| supports ICE, determine its role, gather candidates, prioritize them, | | supports ICE, determine its own role, gather candidates, prioritize | |
| choose one for in-use, encode and send an answer, and for full | | them, choose default candidates, encode and send an answer, and for | |
| implementations, form the check lists and begin connectivity checks. | | full implementations, form the check lists and begin connectivity | |
| | | checks. | |
| | | | |
| 5.1. Verifying ICE Support | | 5.1. Verifying ICE Support | |
| | | | |
| The answerer will proceed with the ICE procedures defined in this | | The answerer will proceed with the ICE procedures defined in this | |
|
| specification if the following are true: | | specification if the following are all true: | |
| | | | |
|
| o There is at least one a=candidate attribute for each media stream | | o For each media stream, the default destination for at least one | |
| in the offer it just received. | | component of the media stream appears in a candidate attribute. | |
| | | For example, in the case of RTP, the IP address and port in the c | |
| | | and m line, respectively, appears in a candidate attribute, or the | |
| | | value in the rtcp attribute appears in a candidate attribute. | |
| | | | |
|
| o For each media stream, at least one of the candidates is a match | | o The offer omitted an a=ice-lite attribute or the answerer is a | |
| for its respective in-use component in the m/c-line. | | full implementation. | |
| | | | |
|
| If both of these conditions are not met, the agent MUST process the | | If any of these conditions are not met, the agent MUST process the | |
| SDP based on normal RFC 3264 procedures, without using any of the ICE | | SDP based on normal RFC 3264 procedures, without using any of the ICE | |
|
| mechanisms described in the remainder of this specification with two | | mechanisms described in the remainder of this specification with the | |
| exceptions. First, in all cases, the agent MUST follow the rules of | | following exceptions: | |
| Section 10, which describe keepalive procedures for all agents. | | | |
| Secondly, if the agent is not proceeding with ICE because there were | | | |
| a=candidate attributes, but none that matched the m/c-line of the | | | |
| media stream, the agent MUST include an a=ice-mismatch attribute in | | | |
| its answer. This mismatch occurs in cases where intermediary | | | |
| elements modify the m/c-line, but don't modify candidate attributes. | | | |
| By including this attribute in the response, diagnostic information | | | |
| on the ICE failure is provided to the offeror and any intermediate | | | |
| signaling entities. | | | |
| | | | |
|
| In addition, if the offer contains the "a=ice-lite" attribute, and | | 1. The agent MUST follow the rules of Section 10, which describe | |
| the answerer is also lite, the agent MUST process the SDP based on | | keepalive procedures for all agents. | |
| normal RFC 3264 procedures, as if it didn't support ICE, with the | | | |
| exception of Section 10, which describes keepalive procedures. | | 2. If the agent is not proceeding with ICE because there were | |
| | | a=candidate attributes, but none that matched the default | |
| | | destination of the media stream, the agent MUST include an a=ice- | |
| | | mismatch attribute in its answer. | |
| | | | |
| 5.2. Determining Role | | 5.2. Determining Role | |
| | | | |
| For each session, each agent takes on a role. There are two roles - | | For each session, each agent takes on a role. There are two roles - | |
| controlling, and controlled. The controlling agent is responsible | | controlling, and controlled. The controlling agent is responsible | |
|
| for selecting the candidate pairs to be used for each media stream, | | for nominating the candidate pairs that can be used by ICE for each | |
| and for generating the updated offer based on that selection, when | | media stream, and for generating the updated offer based on ICE's | |
| needed. The controlled agent is told which candidate pairs to use | | selection, when needed. The controlled agent is told which candidate | |
| for each media stream, and does not generate an updated offer to | | pairs to use for each media stream, and does not generate an updated | |
| signal this information in SIP. | | offer to signal this information. | |
| | | | |
| If one of the agents is a lite implementation, it MUST assume the | | If one of the agents is a lite implementation, it MUST assume the | |
|
| controlled role, and its peer (which will be full) MUST assume the | | controlled role, and its peer (which will be full; if it was lite, | |
| controlling role. If the agent and its peer are both full | | ICE would have aborted) MUST assume the controlling role. If the | |
| implementations, the agent which generated the offer which started | | agent and its peer are both full implementations, the agent which | |
| the ICE processing takes on the controlling role, and the other takes | | generated the offer which started the ICE processing takes on the | |
| the controlled role. | | controlling role, and the other takes the controlled role. | |
| | | | |
| Based on this definition, once roles are determined for a session, | | Based on this definition, once roles are determined for a session, | |
|
| they persist unless ICE is restarted, as discussed below. A restart | | they persist unless ICE is restarted. A ICE restart (Section 9.1 | |
| causes a new selection of roles. | | causes a new selection of roles. | |
| | | | |
| 5.3. Gathering Candidates | | 5.3. Gathering Candidates | |
| | | | |
| The process for gathering candidates at the answerer is identical to | | The process for gathering candidates at the answerer is identical to | |
| the process for the offerer as described in Section 4.1.1 for full | | the process for the offerer as described in Section 4.1.1 for full | |
| implementations and Section 4.2 for lite implementations. It is | | implementations and Section 4.2 for lite implementations. It is | |
| RECOMMENDED that this process begin immediately on receipt of the | | RECOMMENDED that this process begin immediately on receipt of the | |
|
| offer, prior to user acceptance of a session. Such gathering MAY | | offer, prior to alerting the user. Such gathering MAY begin when an | |
| even be done pre-emptively when an agent starts. | | agent starts. | |
| | | | |
| 5.4. Prioritizing Candidates | | 5.4. Prioritizing Candidates | |
| | | | |
| The process for prioritizing candidates at the answerer is identical | | The process for prioritizing candidates at the answerer is identical | |
| to the process followed by the offerer, as described in Section 4.1.2 | | to the process followed by the offerer, as described in Section 4.1.2 | |
| for full implementations and Section 4.2 for lite implementations. | | for full implementations and Section 4.2 for lite implementations. | |
| | | | |
|
| 5.5. Choosing In Use Candidates | | 5.5. Choosing Default Candidates | |
| | | | |
|
| The process for selecting in-use candidates at the answerer is | | The process for selecting default candidates at the answerer is | |
| identical to the process followed by the offerer, as described in | | identical to the process followed by the offerer, as described in | |
| Section 4.1.3 for full implementations and Section 4.2 for lite | | Section 4.1.3 for full implementations and Section 4.2 for lite | |
| implementations. | | implementations. | |
| | | | |
| 5.6. Encoding the SDP | | 5.6. Encoding the SDP | |
| | | | |
| The process for encoding the SDP at the answerer is identical to the | | The process for encoding the SDP at the answerer is identical to the | |
| process followed by the offerer, as described in Section 4.3. | | process followed by the offerer, as described in Section 4.3. | |
| | | | |
| 5.7. Forming the Check Lists | | 5.7. Forming the Check Lists | |
| | | | |
| Forming check lists is done only by full implementations. Lite | | Forming check lists is done only by full implementations. Lite | |
| implementations MUST skip the steps defined in this section. | | implementations MUST skip the steps defined in this section. | |
| | | | |
| There is one check list per in-use media stream resulting from the | | There is one check list per in-use media stream resulting from the | |
|
| offer/answer exchange. A media stream is in-use as long as its port | | offer/answer exchange. To form the check list for a media stream, | |
| is non-zero (which is used in RFC 3264 to reject a media stream). | | the agent forms candidate pairs, computes a candidate pair priority, | |
| Consequently, a media stream is in-use even if it is marked as | | orders the pairs by priority, prunes them, and sets their states. | |
| a=inactive or has a bandwidth value of zero. Each check list is a | | These steps are described in this section. | |
| sequence of STUN connectivity checks that are performed by the agent. | | | |
| To form the check list for a media stream, the agent forms candidate | | 5.7.1. Forming Candidate Pairs | |
| pairs, computes a candidate pair priority, orders the pairs by | | | |
| priority, prunes them, and sets their states. These steps are | | | |
| described in this section. | | | |
| | | | |
| First, the agent takes each of its candidates for a media stream | | First, the agent takes each of its candidates for a media stream | |
|
| (called local candidates) and pairs them with the candidates it | | (called LOCAL CANDIDATES) and pairs them with the candidates it | |
| received from its peer (called remote candidates) for that media | | received from its peer (called REMOTE CANDIDATES) for that media | |
| stream. A local candidate is paired with a remote candidate if and | | stream. In order to prevent the attacks described in Section 17.4.2, | |
| only if the two candidates have the same component ID and have the | | agents MAY limit the number of candidates they'll accept in an offer | |
| same IP address version. It is possible that some of the local | | or answer. A local candidate is paired with a remote candidate if | |
| | | and only if the two candidates have the same component ID and have | |
| | | the same IP address version. It is possible that some of the local | |
| candidates don't get paired with a remote candidate, and some of the | | candidates don't get paired with a remote candidate, and some of the | |
| remote candidates don't get paired with local candidates. This can | | remote candidates don't get paired with local candidates. This can | |
| happen if one agent didn't include candidates for the all of the | | happen if one agent didn't include candidates for the all of the | |
|
| components for a media stream. In the case of RTP, for example, this | | components for a media stream. If this happens, the number of | |
| would happen when one agent provided candidates for RTCP, and the | | components for that media stream is effectively reduced, and | |
| other did not. If this happens, the number of components for that | | considered to be equal to the minimum across both agents of the | |
| media stream is effectively reduced, and considered to be equal to | | maximum component ID provided by each agent across all components for | |
| the minimum across both agents of the maximum component ID provided | | the media stream. | |
| by each agent across all components for the media stream. | | | |
| | | In the case of RTP, this would happen when one agent provided | |
| | | candidates for RTCP, and the other did not. As another example, the | |
| | | offerer can multiplex RTP and RTCP on the same port and signals it | |
| | | can do that in the SDP through some new attribute. However, since | |
| | | the offerer doesn't know if the answerer can perform such | |
| | | multiplexing, the offerer includes candidates for RTP and RTCP on | |
| | | separate ports, so that the offer has two components per media | |
| | | stream. If the answerer can perform such multiplexing, it would | |
| | | include just a single component for each candidate - for the combined | |
| | | RTP/RTCP mux. ICE would end up acting as if there was just a single | |
| | | component for this candidate. | |
| | | | |
| | | The candidate pairs whose local and remote candidates were both the | |
| | | default candidates for a particular component is called, | |
| | | unsurprisingly, the default candidate pair for that component. This | |
| | | is the 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 pairs, and check lists, in addition to indicating the main | |
| | | properties of candidates and 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 pairs are formed, a candidate pair priority is computed. | | Once the pairs are formed, a candidate pair priority is computed. | |
|
| Let O-P be the priority for the candidate provided by the offerer. | | Let O be the priority for the candidate provided by the offerer. Let | |
| Let A-P be the priority for the candidate provided by the answerer. | | A be the priority for the candidate provided by the answerer. The | |
| The priority for a pair is computed as: | | priority 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) | | 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 | | 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. This formula ensures a unique priority | | than A-P, and 0 otherwise. This formula ensures a unique priority | |
|
| for each pair in most cases. One the priority is assigned, the agent | | for each pair in most cases. Once the priority is assigned, the | |
| sorts the candidate pairs in decreasing order of priority. If two | | agent sorts the candidate pairs in decreasing order of priority. If | |
| pairs have identical priority, the ordering amongst them is | | two pairs have identical priority, the ordering amongst them is | |
| arbitrary. | | arbitrary. | |
| | | | |
|
| | | 5.7.3. Pruning the Pairs | |
| | | | |
| This sorted list of candidate pairs is used to determine a sequence | | This sorted list of candidate pairs is used to determine a sequence | |
| of connectivity checks that will be performed. Each check involves | | of connectivity checks that will be performed. Each check involves | |
| sending a request from a local candidate to a remote candidate. | | sending a request from a local candidate to a remote candidate. | |
| Since an agent cannot send requests directly from a reflexive | | Since an agent cannot send requests directly from a reflexive | |
| candidate, but only from its base, the agent next goes through the | | candidate, but only from its base, the agent next goes through the | |
| sorted list of candidate pairs. For each pair where the local | | sorted list of candidate pairs. For each pair where the local | |
| candidate is server reflexive, the server reflexive candidate MUST be | | candidate is server reflexive, the server reflexive candidate MUST be | |
|
| replaced by its base. Once this has been done, the agent MUST remove | | replaced by its base. Once this has been done, the agent MUST prune | |
| redundant pairs. A pair is redundant if its local and remote | | the list. This is done by removing a pair if its local and remote | |
| candidates are identical to the local and remote candidates of a pair | | candidates are identical to the local and remote candidates of a pair | |
|
| higher up on the priority list. The result is called the check list | | higher up on the priority list. The result is a sequence of ordered | |
| for that media stream, and each candidate pair on it is called a | | candidate pairs, called the check list for that media stream. | |
| check. | | | |
| | | | |
|
| Each check is also said to have a foundation, which is merely the | | In addition, in order to limit the attacks described in | |
| combination of the foundations of the local and remote candidates in | | Section 17.4.2, an agent SHOULD limit the total number of | |
| the check. | | connectivity checks they perform across all check lists to 100, by | |
| | | discarding the lower priority candidate pairs until there are less | |
| | | than 100. | |
| | | | |
|
| Each check in the check list is associated with a state. This state | | 5.7.4. Computing States | |
| is assigned once the check list for each media stream has been | | | |
| computed. There are five potential values that the state can have: | | | |
| | | | |
|
| Waiting: This check has not been performed, and can be performed as | | Each candidate pair in the check list has a foundation and a state. | |
| soon as it is the highest priority Waiting check on the check | | The foundation is the combination of the foundations of the local and | |
| list. | | remote candidates in the 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: | |
| | | | |
|
| In-Progress: A request has been sent for this check, but the | | Waiting: A check has not been performed for this pair, and can be | |
| | | performed as soon as it is the highest priority Waiting pair on | |
| | | the check list. | |
| | | | |
| | | In-Progress: A check has been sent for this pair, but the | |
| transaction is in progress. | | transaction is in progress. | |
| | | | |
|
| Succeeded: This check was already done and produced a successful | | Succeeded: A check for this pair was already done and produced a | |
| result. | | successful result. | |
| | | | |
|
| Failed: This check was already done and failed, either never | | Failed: A check for this pair was already done and failed, either | |
| producing any response or producing an unrecoverable failure | | never producing any response or producing an unrecoverable failure | |
| response. | | response. | |
| | | | |
|
| Frozen: This check hasn't been performed, and it can't yet be | | Frozen: A check for this pair hasn't been performed, and it can't | |
| performed until some other check succeeds, allowing it to move | | yet be performed until some other check succeeds, allowing this | |
| into the Waiting state. | | pair to unfreeze and move into the Waiting state. | |
| | | | |
|
| First, the agent sets all of the checks in each check list to the | | As ICE runs, the pairs will move between states as shown in Figure 9. | |
| Frozen state. Then, it takes the first check in the check list for | | | |
| the first media stream (a media stream is the first media stream when | | +-----------+ | |
| it is described by the first m-line in the SDP offer and answer), and | | | | | |
| sets its state to Waiting. It then finds all of the other checks in | | | | | |
| that check list with the same component ID, but different | | | Frozen | | |
| foundations, and sets all of their states to Waiting as well. Once | | | | | |
| this is done, one of the check lists will have some number of checks | | | | | |
| in the Waiting state, and the other check lists will have all of | | +-----------+ | |
| their checks in the Frozen state. A check list with at least one | | | | |
| check that is not Frozen is called an active check list. | | |unfreeze | |
| | | | | |
| | | V | |
| | | +-----------+ +-----------+ | |
| | | | | | | | |
| | | | | perform | | | |
| | | | Waiting |-------->|In-Progress| | |
| | | | | | | | |
| | | | | | | | |
| | | +-----------+ +-----------+ | |
| | | / | | |
| | | // | | |
| | | // | | |
| | | // | | |
| | | / | | |
| | | // | | |
| | | failure // |success | |
| | | // | | |
| | | / | | |
| | | // | | |
| | | // | | |
| | | // | | |
| | | V V | |
| | | +-----------+ +-----------+ | |
| | | | | | | | |
| | | | | | | | |
| | | | Failed | | Succeeded | | |
| | | | | | | | |
| | | | | | | | |
| | | +-----------+ +-----------+ | |
| | | | |
| | | Figure 9: Pair State FSM | |
| | | | |
| | | The initial states for each pair in the check list are computed by | |
| | | performing the following sequence of steps: | |
| | | | |
| | | 1. The agent sets all of the pairs in each check list to the Frozen | |
| | | state. | |
| | | | |
| | | 2. It takes the first pair in the check list for the first media | |
| | | stream (a media stream is the first media stream when it is | |
| | | described by the first m-line in the SDP offer and answer), and | |
| | | sets its state to Waiting. | |
| | | | |
| | | 3. It finds all of the other pairs in that check list with the same | |
| | | component ID, but different foundations, and sets all of their | |
| | | states to Waiting as well. | |
| | | | |
| | | One of the check lists will have some number of pairs in the Waiting | |
| | | state, and the other check lists will have all of their pairs in the | |
| | | Frozen state. A check list with at least one pair that is not Frozen | |
| | | is called an active check list. | |
| | | | |
| The check list itself is associated with a state, which captures the | | The check list itself is associated with a state, which captures the | |
| state of ICE checks for that media stream. There are two states: | | state of ICE checks for that media stream. There are two states: | |
| | | | |
| Running: In this state, ICE checks are still in progress for this | | Running: In this state, ICE checks are still in progress for this | |
| media stream. | | media stream. | |
| | | | |
|
| Completed: In this state, the controlling agent has signaled that a | | Completed: In this state, ICE checks have completed for this media | |
| candidate pair has been selected for each component. | | stream. | |
| Consequently, no further ICE checks are performed. | | | |
| | | | |
| When a check list is first constructed as the consequence of an | | When a check list is first constructed as the consequence of an | |
| offer/answer exchange, it is placed in the Running state. | | offer/answer exchange, it is placed in the Running state. | |
| | | | |
| ICE processing across all media streams also has a state associated | | ICE processing across all media streams also has a state associated | |
| with it. This state is equal to Running while checks are in | | with it. This state is equal to Running while checks are in | |
| progress. The state is Completed when all checks have been | | progress. The state is Completed when all checks have been | |
| completed. Rules for transitioning between states are described | | completed. Rules for transitioning between states are described | |
| below. | | below. | |
| | | | |
| 5.8. Performing Periodic Checks | | 5.8. Performing Periodic Checks | |
| | | | |
| Checks are generated only by full implementations. Lite | | Checks are generated only by full implementations. Lite | |
| implementations MUST skip the steps described in this section. | | implementations MUST skip the steps described in this section. | |
| | | | |
|
| An agent performs two types of checks. The first type are periodic | | An agent performs periodic checks and triggered checks. Periodic | |
| checks. These checks occur periodically for each media stream, and | | checks occur periodically for each media stream, and involve choosing | |
| involve choosing the highest priority check in the Waiting state from | | the highest priority pair in the Waiting state from each check list, | |
| each check list, and performing it. The other type of check is | | and sending a check on it. Triggered checks are performed on receipt | |
| called a triggered check. This is a check that is performed on | | of a connectivity check from the peer (see Section 7.2.1.3). This | |
| receipt of a connectivity check from the peer. This section | | section describes how periodic checks are performed. | |
| describes how periodic checks are performed. | | | |
| | | | |
| Once the agent has computed the check lists as described in | | Once the agent has computed the check lists as described in | |
| Section 5.7, it sets a timer for each active check list. The timer | | Section 5.7, it sets a timer for each active check list. The timer | |
| fires every Ta/N seconds, where N is the number of active check lists | | fires every Ta/N seconds, where N is the number of active check lists | |
| (initially, there is only one active check list). Implementations | | (initially, there is only one active check list). Implementations | |
| MAY set the timer to fire less frequently than this. Ta is the same | | MAY set the timer to fire less frequently than this. Ta is the same | |
| value used to pace the gathering of candidates, as described in | | value used to pace the gathering of candidates, as described in | |
|
| Section 4.1.1. The first timer for each active check list fires | | Section 4.1.1. Dividing by N allows this aggregate check throughput | |
| immediately, so that the agent performs a connectivity check the | | to be split between all active check lists. The first timer for each | |
| moment the offer/answer exchange has been done, followed by the next | | active check list fires immediately, so that the agent performs a | |
| periodic check Ta seconds later. | | connectivity check the moment the offer/answer exchange has been | |
| | | done, followed by the next periodic check Ta seconds later. | |
| | | | |
|
| When the timer fires, the agent MUST find the highest priority check | | When the timer fires, the agent MUST: | |
| in that check list that is in the Waiting state. The agent then | | | |
| sends a STUN check from the local candidate of that check to the | | | |
| remote candidate of that check. The procedures for forming the STUN | | | |
| request for this purpose are described in Section 7.1.1. If none of | | | |
| the checks in that check list are in the Waiting state, but there are | | | |
| checks in the Frozen state, the highest priority check in the Frozen | | | |
| state is moved into 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 Frozen state, then the timer | | | |
| for that check list is stopped. | | | |
| | | | |
|
| Performing the connectivity check requires the agent to know the | | o Find the highest priority pair in that check list that is in the | |
| username fragment for the local and remote candidates, and the | | Waiting state. | |
| password for the remote candidate. For periodic checks, the remote | | | |
| username fragment and password are learned directly from the SDP | | o If there is such a pair: | |
| received from the peer, and the local username fragment is known by | | | |
| the agent. | | * Send a STUN check from the local candidate of that pair to the | |
| | | remote candidate of that pair. The procedures for forming the | |
| | | STUN request for this purpose are described in 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 state of the check list to Completed. | |
| | | | |
| | | + Terminate the timer for that check list. | |
| | | | |
| | | To compute the message integrity for the check, the agent uses the | |
| | | remote username fragment and password learned from the SDP from its | |
| | | peer. The local username fragment is known directly by the agent for | |
| | | its own candidate. | |
| | | | |
| 6. Receipt of the Initial Answer | | 6. Receipt of the Initial Answer | |
| | | | |
| This section describes the procedures that an agent follows when it | | This section describes the procedures that an agent follows when it | |
| receives the answer from the peer. It verifies that its peer | | receives the answer from the peer. It verifies that its peer | |
| supports ICE, determines its role, and for full implementations, | | supports ICE, determines its role, and for full implementations, | |
| forms the check list and begins performing periodic checks. | | forms the check list and begins performing periodic checks. | |
| | | | |
| 6.1. Verifying ICE Support | | 6.1. Verifying ICE Support | |
| | | | |
|
| The answerer will proceed with the ICE procedures defined in this | | The offerer will proceed with the ICE procedures defined in this | |
| specification if there is at least one a=candidate attribute for each | | specification if there is at least one a=candidate attribute for each | |
| media stream in the answer it just received. If this condition is | | media stream in the answer it just received. If this condition is | |
| not met, the agent MUST process the SDP based on normal RFC 3264 | | not met, the agent MUST process the SDP based on normal RFC 3264 | |
| procedures, without using any of the ICE mechanisms described in the | | procedures, without using any of the ICE mechanisms described in the | |
| remainder of this specification, with the exception of Section 10, | | remainder of this specification, with the exception of Section 10, | |
| which describes keepalive procedures. | | which describes keepalive procedures. | |
| | | | |
| In some cases, the answer may omit a=candidate attributes for the | | In some cases, the answer may omit a=candidate attributes for the | |
| media streams, and instead include an a=ice-mismatch attribute for | | media streams, and instead include an a=ice-mismatch attribute for | |
| one or more of the media streams in the SDP. This signals to the | | one or more of the media streams in the SDP. This signals to the | |
| offerer that the answerer supports ICE, but that ICE processing was | | offerer that the answerer supports ICE, but that ICE processing was | |
|
| not used for the session because an intermediary modified the m/c- | | not used for the session because an intermediary modified the default | |
| lines without modifying the candidate attributes. See Section 16 for | | destination for media components without modifying the corresponding | |
| a discussion of cases where this can happen. This specification | | candidate attributes. See Section 17 for a discussion of cases where | |
| provides no guidance on how an agent should proceed in such a failure | | this can happen. This specification provides no guidance on how an | |
| case. | | agent should proceed in such a failure case. | |
| | | | |
| 6.2. Determining Role | | 6.2. Determining Role | |
| | | | |
| The offerer follows the same procedures described for the answerer in | | The offerer follows the same procedures described for the answerer in | |
| Section 5.2. | | Section 5.2. | |
| | | | |
| 6.3. Forming the Check List | | 6.3. Forming the Check List | |
| | | | |
| Formation of check lists is performed only by full implementations. | | Formation of check lists is performed only by full implementations. | |
| The offerer follows the same procedures described for the answerer in | | The offerer follows the same procedures described for the answerer in | |
| Section 5.7. | | Section 5.7. | |
| | | | |
| 6.4. Performing Periodic Checks | | 6.4. Performing Periodic Checks | |
| | | | |
| Periodic checks are performed only by full implementations. The | | Periodic checks are performed only by full implementations. The | |
| offerer follows the same procedures described for the answerer in | | offerer follows the same procedures described for the answerer in | |
| Section 5.8. | | Section 5.8. | |
| | | | |
|
| 7. Connectivity Checks | | 7. Performing Connectivity Checks | |
| | | | |
| This section describes how connectivity checks are performed. All | | This section describes how connectivity checks are performed. All | |
|
| ICE implementations are required to be compliant to [11], as opposed | | ICE implementations are required to be compliant to [12], as opposed | |
| to the older [14]. However, whereas a full implementation will both | | to the older [15]. However, whereas a full implementation will both | |
| generate checks (acting as a STUN client) and receive them (acting as | | generate checks (acting as a STUN client) and receive them (acting as | |
| a STUN server), a lite implementation will only ever receive checks, | | a STUN server), a lite implementation will only ever receive checks, | |
| and thus will only act as a STUN server. | | and thus will only act as a STUN server. | |
| | | | |
| 7.1. Client Procedures | | 7.1. Client Procedures | |
| | | | |
| These procedures define how an agent sends a connectivity check, | | These procedures define how an agent sends a connectivity check, | |
| whether it is a periodic or a triggered check. These procedures are | | whether it is a periodic or a triggered check. These procedures are | |
| only applicable to full implementations. | | only applicable to full implementations. | |
| | | | |
| 7.1.1. Sending the Request | | 7.1.1. Sending the Request | |
| | | | |
|
| The agent acting as the client generates a connectivity check either | | The check is generated by sending a Binding Request from a local | |
| periodically, or triggered. In either case, the check is generated | | candidate, to a remote candidate. [12] describes how Binding Requests | |
| by sending a Binding Request from a local candidate, to a remote | | are constructed and generated. This section defines additional | |
| candidate. The agent must know the username fragment for both | | procedures involving the PRIORITY and USE-CANDIDATE attributes, | |
| candidates and the password for the remote candidate. | | defined for the connectivity check usage, and details how credentials | |
| | | for message integrity and diffserv markings are computed. | |
| | | | |
|
| A Binding Request serving as a connectivity check MUST utilize a STUN | | 7.1.1.1. PRIORITY and USE-CANDIDATE | |
| short term credential. Rather than being learned from a Shared | | | |
| Secret request, the short term credential is exchanged in the offer/ | | | |
| answer procedures. In particular, the username is formed by | | | |
| concatenating the username fragment provided by the peer with the | | | |
| username fragment of the agent sending the request, separated by a | | | |
| colon (":"). The password is equal to the password provided by the | | | |
| peer. For example, consider the case where agent A is 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 | | | |
| a username fragment of BFRAG and a password of BPASS. A connectivity | | | |
| check from A to B (and its response of course) utilize the username | | | |
| BFRAG:AFRAG and a password of BPASS. A connectivity check from B to | | | |
| A (and its response) utilize the username AFRAG:BFRAG and a password | | | |
| of APASS. | | | |
| | | | |
| An agent MUST include the PRIORITY attribute in its Binding Request. | | An agent MUST include the PRIORITY attribute in its Binding Request. | |
| The attribute MUST be set equal to the priority that would be | | The attribute MUST be set equal to the priority that would be | |
| assigned, based on the algorithm in Section 4.1.2, to a peer | | assigned, based on the algorithm in Section 4.1.2, to a peer | |
|
| reflexive candidate learned from this check. Such a peer reflexive | | reflexive candidate, should one be learned as a consequence of this | |
| candidate has a stream ID, component ID and local preference that are | | check (see Section 7.1.2.2.1 for how peer reflexive candidates are | |
| equal to the host candidate from which the check is being sent, but a | | learned). This priority value will be computed identically to how | |
| type preference equal to the value associated with peer reflexive | | the priority for the local candidate of the pair was computed, except | |
| candidates. | | that the type preference is set to the value for peer derived | |
| | | candidate types. | |
| The Binding Request sent by an agent MUST include the USERNAME and | | | |
| MESSAGE-INTEGRITY attributes. That is, an agent MUST NOT wait to be | | | |
| challenged for short term credentials. Rather, it MUST provide them | | | |
| in the Binding Request right away. | | | |
| | | | |
| The controlling agent MAY include the USE-CANDIDATE attribute in the | | The controlling agent MAY include the USE-CANDIDATE attribute in the | |
| Binding Request. The controlled agent MUST NOT include it in its | | Binding Request. The controlled agent MUST NOT include it in its | |
| Binding Request. This attribute signals that the controlling agent | | Binding Request. This attribute signals that the controlling agent | |
| wishes to cease checks for this component, and use the candidate pair | | wishes to cease checks for this component, and use the candidate pair | |
|
| resulting from the check for this component. Section 8 provides | | resulting from the check for this component. Section 8.1 provides | |
| guidance on determining when to include it. | | guidance on determining when to include it. | |
| | | | |
|
| If the agent is using Diffserv Codepoint markings [26] in its media | | 7.1.1.2. Forming Credentials | |
| | | | |
| | | A Binding Request serving as a connectivity check MUST utilize a STUN | |
| | | short term credential. The agent MUST include the USERNAME and | |
| | | 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 short | |
| | | term credential is exchanged in the offer/answer procedures. In | |
| | | particular, the username is formed by concatenating the username | |
| | | fragment provided by the peer with the username fragment of the agent | |
| | | sending the request, separated by a colon (":"). The password is | |
| | | equal to the password provided by the peer. For example, consider | |
| | | the case where agent L is the offerer, and agent R is the answerer. | |
| | | Agent L included a username fragment of LFRAG for its candidates, and | |
| | | a password of LPASS. Agent R provided a username fragment of RFRAG | |
| | | and a password of RPASS. A connectivity check from L to R (and its | |
| | | response of course) utilize the username RFRAG:LFRAG and a password | |
| | | of RPASS. A connectivity check from R to L (and its response) | |
| | | utilize the username LFRAG:RFRAG and a password of LPASS. | |
| | | | |
| | | 7.1.1.3. DiffServ Treatment | |
| | | | |
| | | If the agent is using Diffserv Codepoint markings [27] in its media | |
| packets, it SHOULD apply those same markings to its connectivity | | packets, it SHOULD apply those same markings to its connectivity | |
| checks. | | checks. | |
| | | | |
| 7.1.2. Processing the Response | | 7.1.2. Processing the Response | |
| | | | |
|
| If the STUN transaction generates an unrecoverable failure response | | When a Binding Response is received, it is correlated to its Binding | |
| or times out, the agent sets the state of the check to Failed. The | | Request using the transaction ID, as defined in [12], which then ties | |
| remainder of this section applies to processing of successful | | it to the candidate pair for which the Binding Request was sent. | |
| responses (any response from 200 to 299). | | | |
| | | 7.1.2.1. Failure Cases | |
| | | | |
| | | If the STUN transaction generates an ICMP error, or generates a STUN | |
| | | error response that is unrecoverable (as defined in [12], or times | |
| | | out, the agent sets the state of the pair to Failed. | |
| | | | |
| The agent MUST check that the source IP address and port of the | | The agent MUST check that the source IP address and port of the | |
| response equals the destination IP address and port that the Binding | | response equals the destination IP address and port that the Binding | |
| Request was sent to, and that the destination IP address and port of | | Request was sent to, and that the destination IP address and port of | |
| the response match the source IP address and port that the Binding | | the response match the source IP address and port that the Binding | |
|
| Request was sent from. If these do not match, the processing | | Request was sent from. In other words, the source and destination | |
| described in the remainder of this section MUST NOT be performed. In | | transport addresses in the request and responses are the symmetric. | |
| addition, an agent sets the state of the check to Failed. | | If they are not symmetric, the agent sets the state of the pair to | |
| | | Failed. | |
| | | | |
|
| If the check succeeds, processing continues. The agent creates a | | 7.1.2.2. Success Cases | |
| candidate pair whose local candidate equals the mapped address of the | | | |
| response, and whose remote candidate equals the destination address | | | |
| to which the request was sent. This is called a 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 be | | | |
| identical to the check itself; in many cases, the local candidate | | | |
| (learned through the mapped address in the response) will be | | | |
| different than the local candidate the request was sent from. | | | |
| | | | |
|
| Next, the agent computes the priority for the pair based on the | | If the STUN transaction generated a response between 200 and 299, and | |
| priority of each candidate, using the algorithm in Section 5.7. The | | the source IP address and port of the response equals the destination | |
| priority of the local candidate depends on its type. If it is not | | IP address and port that the Binding Request was sent to, and the | |
| peer reflexive, it is equal to the priority signaled for that | | destination IP address and port of the response match the source IP | |
| candidate in the SDP. If it is peer reflexive, it is equal to the | | address and port that the Binding Request was sent from, the check | |
| PRIORITY attribute the agent placed in the Binding Request which just | | was a success. | |
| completed. The priority of the remote candidate is taken from the | | | |
| SDP of the peer. If the candidate does not appear there, then the | | | |
| check must have been a triggered check to a new remote candidate. In | | | |
| that case, the priority is taken as the value of the PRIORITY | | | |
| attribute in the Binding Request which triggered the check that just | | | |
| completed. | | | |
| | | | |
|
| Once the priority of the candidate pair has been computed, the pair | | 7.1.2.2.1. Discovering Peer Reflexive Candidates | |
| is added to the valid list for that media stream. If the agent was a | | | |
| controlling agent, and the check had included a USE-CANDIDATE | | | |
| attribute, the candidate pair is marked as "favored". If the agent | | | |
| was a controlled agent, and the check was a triggered check, and the | | | |
| request which caused the triggered check included the USE-CANDIDATE | | | |
| attribute, the candidate pair is marked as "favored". | | | |
| | | | |
|
| Next, the agent updates its ICE states. The agent checks the mapped | | The agent checks the mapped address from the STUN response. If the | |
| address from the STUN response. If the transport address does not | | transport address does not match any of the local candidates that the | |
| match any of the local candidates that the agent knows about, the | | agent knows about, the mapped address represents a new candidate - a | |
| mapped address represents a new peer reflexive candidate. Its type | | peer reflexive candidate. Like other candidates, it has a type, | |
| is equal to peer reflexive. Its base is set equal to the candidate | | base, priority and foundation. They are computed as follows: | |
| from which the STUN check was sent. Its username fragment and | | | |
| password are identical to the candidate from which the check was | | | |
| sent. It is assigned the priority value that was placed in the | | | |
| PRIORITY attribute of the request. Its foundation is selected as | | | |
| described in Section 4.1.1. The peer reflexive candidate is then | | | |
| added to the list of local candidates known by the agent (though it | | | |
| is not paired with other remote candidates at this time). | | | |
| | | | |
|
| Next, the agent changes the state for this check to Succeeded. The | | o Its type is equal to peer reflexive. | |
| agent sees if the success of this check can cause other checks to be | | | |
| unfrozen. If the check had a component ID of one, the agent MUST | | o Its base is set equal to the local candidate of the candidate pair | |
| change the states for all other Frozen checks for the same media | | from which the STUN check was sent. | |
| stream and same foundation, but different component IDs, to Waiting. | | | |
| If the component ID for the check was equal to the number of | | o Its priority is set equal to the value of the PRIORITY attribute | |
| components for the media stream (where this is the actual number of | | in the Binding Request. | |
| | | | |
| | | o Its foundation is selected as described in Section 4.1.1. | |
| | | | |
| | | This peer reflexive candidate is then added to the list 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 peer reflexive candidate is not paired with other remote | |
| | | candidates. This is not necessary; a valid pair will be generated | |
| | | from it momentarily based on the procedures in Section 7.1.2.2.3. If | |
| | | an agent wishes to pair the peer reflexive candidate with other | |
| | | remote candidates besides the one in the valid pair that will be | |
| | | generated, the agent MAY generate an updated offer which includes the | |
| | | 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 sets the 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 number of components | |
| | | for the media stream (where this is the actual number of | |
| components being used, in cases where the number of components | | components being used, in cases where the number of components | |
|
| signaled in the SDP differs from offerer to answerer), the agent MUST | | signaled in the SDP differs from offerer to answerer), the agent | |
| change the state for all other Frozen checks for the first component | | MUST change the state for all other Frozen pairs for the first | |
| of different media streams (and thus in different check lists) but | | component of different media streams (and thus in different check | |
| the same foundation, to Waiting. | | lists) but the same foundation, to Waiting. | |
| | | | |
| | | o If the 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 candidate | |
| | | equals the mapped address of the response, and whose remote candidate | |
| | | equals the destination address to which the request was sent. This | |
| | | is called a valid pair, since it has been validated by a STUN | |
| | | connectivity check. The valid pair may equal the pair that generated | |
| | | the check, may equal a different pair in the check list, or may be a | |
| | | pair not currently on any check list. If the pair equals the pair | |
| | | that generated the check or is on a check list currently, it is also | |
| | | added to the VALID LIST, which is maintained by the agent for each | |
| | | media stream. This list is empty at the start of ICE processing, and | |
| | | fills as checks are performed, resulting in valid candidate pairs. | |
| | | | |
| | | It will be very common that the pair will not be on any check list. | |
| | | Recall that the check list has pairs whose local candidates are never | |
| | | server reflexive; those pairs had their local candidates converted to | |
| | | the base of the server reflexive candidates, and then pruned if they | |
| | | were redundant. When the response to the STUN check arrives, the | |
| | | mapped address will be reflexive if there is a NAT between the two. | |
| | | In that case, the valid pair will have a local candidate that doesn't | |
| | | match any of the pairs in the check list. | |
| | | | |
| | | If the pair is not on any check list, the agent computes the priority | |
| | | for the pair based on the priority of each candidate, using the | |
| | | algorithm in Section 5.7. The priority of the local candidate | |
| | | depends on its type. If it is not peer reflexive, it is equal to the | |
| | | priority signaled for that candidate in the SDP. If it is peer | |
| | | reflexive, it is equal to the PRIORITY attribute the agent placed in | |
| | | the Binding Request which just completed. The priority of the remote | |
| | | candidate is taken from the SDP of the peer. If the candidate does | |
| | | not appear there, then the check must have been a triggered check to | |
| | | a new remote candidate. In that case, the priority is taken as the | |
| | | value of the PRIORITY attribute in the Binding Request which | |
| | | triggered the check that just completed. The pair is then added to | |
| | | the VALID LIST. | |
| | | | |
| | | 7.1.2.2.4. Updating the Nominated Flag | |
| | | | |
| | | If the agent was a controlling agent, and it had included a USE- | |
| | | CANDIDATE attribute in the Binding Request, the valid pair generated | |
| | | from that check has its 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 agent is the controlled agent, the response may result in the | |
| | | valid pair having its nominated flag set. See Section 7.2.1.4 for | |
| | | the procedure. | |
| | | | |
| 7.2. Server Procedures | | 7.2. Server Procedures | |
| | | | |
| An agent MUST be prepared to receive a Binding Request on the base of | | An agent MUST be prepared to receive a Binding Request on the base of | |
| each candidate it included in its most recent offer or answer. | | each candidate it included in its most recent offer or answer. | |
|
| Receipt of a Binding Request on a transport address that the agent | | Receipt of a Binding Request on a base is an indication that the | |
| had included in a candidate attribute is an indication that the | | | |
| connectivity check usage applies to the request. | | connectivity check usage applies to the request. | |
| | | | |
| The agent MUST use a short term credential to authenticate the | | The agent MUST use a short term credential to authenticate the | |
| request and perform a message integrity check. The agent MUST accept | | request and perform a message integrity check. The agent MUST accept | |
| a credential if the username consists of two values separated by a | | a credential if the username consists of two values separated by a | |
| colon, where the first value is equal to the username fragment | | colon, where the first value is equal to the username fragment | |
| generated by the agent in an offer or answer for a session in- | | generated by the agent in an offer or answer for a session in- | |
|
| progress, and the password is equal to the password for that username | | progress, and the MESSAGE-INTEGRITY is the output of a hash of the | |
| fragment. It is possible (and in fact very likely) that an offeror | | password and the STUN packet's contents. It is possible (and in fact | |
| will receive a Binding Request prior to receiving the answer from its | | very likely) that an offeror will receive a Binding Request prior to | |
| peer. However, the request can be processed without receiving this | | receiving the answer from its peer. However, the request can be | |
| answer, and a response generated. | | processed without receiving this answer, and a response generated. | |
| | | By doing this, ICE processing completes faster. | |
| | | | |
|
| If the agent is using Diffserv Codepoint markings [26] in its media | | If the agent is using Diffserv Codepoint markings [27] in its media | |
| packets, it SHOULD apply those same markings to its responses to | | packets, it SHOULD apply those same markings to its responses to | |
| Binding Requests. | | Binding Requests. | |
| | | | |
| 7.2.1. Additional Procedures for Full Implementations | | 7.2.1. Additional Procedures for Full Implementations | |
| | | | |
| This subsection defines the additional server procedures applicable | | This subsection defines the additional server procedures applicable | |
|
| to full implementations. | | to full implementations when generating a successful response to a | |
| | | Binding Request. | |
| | | | |
| | | 7.2.1.1. Computing Mapped Address | |
| | | | |
| For requests being received on a relayed candidate, the source | | For requests being received on a relayed candidate, the source | |
| transport address used for STUN processing (namely, generation of the | | transport address used for STUN processing (namely, generation of the | |
| XOR-MAPPED-ADDRESS attribute) is the transport address as seen by the | | XOR-MAPPED-ADDRESS attribute) is the transport address as seen by the | |
| relay. That source transport address will be present in the REMOTE- | | relay. That source transport address will be present in the REMOTE- | |
| ADDRESS attribute of a STUN Data Indication message, if the Binding | | ADDRESS attribute of a STUN Data Indication message, if the Binding | |
|
| Request was delivered through a Data Indication. If the Binding | | Request was delivered through a Data Indication (a STUN relay | |
| Request was not encapsulated in a Data Indication, that source | | delivers packets encapsulated in a Data Indication when no active | |
| address is equal to the current active destination for the STUN relay | | destination is set). If the Binding Request was not encapsulated in | |
| session. | | a Data Indication, that source address is equal to the current active | |
| | | destination for the STUN relay session. | |
| | | | |
|
| If the STUN request resulted in an error response, no further | | 7.2.1.2. Learning Peer Reflexive Candidates | |
| processing is performed. | | | |
| | | | |
|
| Assuming a success response, if the source transport address of the | | If the source transport address of the request does not match any | |
| request does not match any existing remote candidates, it represents | | existing remote candidates, it represents a new peer reflexive remote | |
| a new peer reflexive remote candidate. The full-mode agent gives the | | candidate. The full-mode agent gives the candidate a priority equal | |
| candidate a priority equal to the PRIORITY attribute from the | | to the PRIORITY attribute from the request. The type of the | |
| request. The type of the candidate is equal to peer reflexive. Its | | candidate is equal to peer reflexive. Its foundation is set to an | |
| foundation is set to an arbitrary value, different from the | | arbitrary value, different from the foundation for all other remote | |
| foundation for all other remote candidates. Note that any subsequent | | candidates. If any subsequent offer/answer exchanges contain this | |
| offer/answer exchanges will contain this new peer reflexive candidate | | peer reflexive candidate in the SDP, it will signal the actual | |
| in the SDP, and will signal the actual foundation for the candidate. | | foundation for the candidate. This candidate is then added to the | |
| This candidate is then added to the list of remote candidates. | | list of remote candidates. However, the agent does not pair this | |
| However, the agent does not pair this candidate with any local | | candidate with any local candidates. | |
| candidates. | | | |
| | | | |
|
| Next, the agent constructs a tentative check in the reverse | | 7.2.1.3. Triggered Checks | |
| direction, called a triggered check. The triggered check has a local | | | |
| candidate equal to the candidate on which the STUN request was | | | |
| received, and a remote candidate equal to the source transport | | | |
| address where the request came from (which may be a new peer- | | | |
| reflexive remote candidate). Since both candidates are known to the | | | |
| agent, it can obtain their priorities and compute the candidate pair | | | |
| priority. This tentative check is then looked up in the check list. | | | |
| There can be one of several outcomes: | | | |
| | | | |
|
| o If there is already a check on the check list with this same local | | Next, the agent constructs a pair whose local candidate is equal to | |
| and remote candidates, and the state of that check is Waiting or | | the transport address on which the STUN request was received, and a | |
| Frozen, its state is changed to In-Progress and the tentative | | remote candidate equal to the source transport address where the | |
| check is performed. | | request came from (which may be peer-reflexive remote candidate that | |
| | | was just learned). Since both candidates are known to the agent, it | |
| | | can obtain their priorities and compute the candidate pair priority. | |
| | | This pair is then looked up in the check list. There can be one of | |
| | | several outcomes: | |
| | | | |
|
| o If there is already a check on the check list with this same local | | o If the pair is already on the check list: | |
| and remote candidates, and its state was In-Progress, the agent | | | |
| SHOULD abandon the new tentative check and instead generate an | | | |
| immediate retransmit of the Binding Request for the check in | | | |
| progress. This is to facilitate rapid completion of ICE when both | | | |
| agents are behind NAT. | | | |
| | | | |
|
| o If there is already a check on the check list with this same local | | * If the state of that pair is Waiting or Frozen, its state is | |
| and remote candidates, and its state was Succeeded, the new | | changed to In-Progress and a check for that pair is performed | |
| tentative check is abandoned. If the Binding Request just | | immediately. This is called a triggered check. | |
| received contained the USE-CANDIDATE attribute, it means that the | | | |
| pair resulting from that previous check is favored by the peer | | | |
| controlling agent. The agent MUST take the candidate pair in the | | | |
| valid list that was learned from that previous successful check, | | | |
| and mark it as favored. | | | |
| | | | |
|
| o If there is already a check on the check list with this same local | | * If the state of that pair is In-Progress, the agent SHOULD | |
| and remote candidates, and its state was Failed, the new tentative | | generate an immediate retransmit of the Binding Request for the | |
| check is abandoned. | | check in progress. This is to facilitate rapid completion of | |
| | | ICE when both agents are behind NAT. | |
| | | | |
|
| o If there is no matching check on the check list, the new tentative | | * If the state of that pair is Failed or Succeeded, no triggered | |
| check is inserted into the check list based on its priority, and | | check is sent. | |
| its state is set to In-Progress. | | | |
| | | | |
|
| If the tentative check is to be performed, it is constructed and | | o If the pair is not already on the check list: | |
| | | | |
| | | * The pair is inserted into the check list based on its priority | |
| | | | |
| | | * Its state is set to In-Progress | |
| | | | |
| | | * A triggered check for that pair is performed immediately. | |
| | | | |
| | | If a triggered check is to be generated, it is constructed and | |
| processed as described in Section 7.1.1. These procedures require | | processed as described in Section 7.1.1. These procedures require | |
|
| the agent to know the username fragment and password for the peer. | | the agent to know the transport address, username fragment and | |
| They are readily determined from the SDP and from the check that was | | password for the peer. The username fragment for the remote | |
| just received. The username fragment for the remote candidate is | | candidate is equal to the part after the colon of the USERNAME in the | |
| equal to the bottom half (the part after the colon) of the USERNAME | | Binding Request that was just received. Using that username | |
| in the Binding Request that was just received. Using that username | | | |
| fragment, the agent can check the SDP messages received from its peer | | fragment, the agent can check the SDP messages received from its peer | |
| (there may be more than one in cases of forking), and find this | | (there may be more than one in cases of forking), and find this | |
| username fragment. The corresponding password is then selected. If | | username fragment. The corresponding password is then selected. If | |
|
| agent has not yet received this SDP (a likely case for the offerer in | | agent has not yet received the username in an SDP (a likely case for | |
| the initial offer/answer exchange), it MUST wait for the SDP to be | | the offerer in the initial offer/answer exchange), it MUST wait for | |
| received, and then proceed with the triggered check. | | the SDP to be received (since it won't have its peer's ICE password | |
| | | without it), and then proceed with the triggered check. | |
| | | | |
| | | 7.2.1.4. Updating the Nominated Flag | |
| | | | |
| | | If the Binding Request received by the agent had the USE-CANDIDATE | |
| | | attribute set, and the agent is in the controlled role, the agent | |
| | | looks at the state of the pair computed in Section 7.2.1.3: | |
| | | | |
| | | o If the state of this pair is succeeded, it means that the check | |
| | | generated by this pair produced a successful response. This would | |
| | | have caused the agent to construct a valid pair when that success | |
| | | response was received (see Section 7.1.2.2.3). The agent now sets | |
| | | the nominated flag in the valid pair to true. This may end ICE | |
| | | processing for this media stream; see Section 8. | |
| | | | |
| | | o If the state of this pair is In-Progress, if its check produces a | |
| | | successful result, the resulting valid pair has its nominated flag | |
| | | set when the 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 | | 7.2.2. Additional Procedures for Lite Implementations | |
| | | | |
| If the check that was just received contained a USE-CANDIDATE | | If the check that was just received contained a USE-CANDIDATE | |
| attribute, the agent constructs a candidate pair whose local | | attribute, the agent constructs a candidate pair whose local | |
| candidate is equal to the transport address on which the request was | | candidate is equal to the transport address on which the request was | |
| received, and whose remote candidate is equal to the source transport | | received, and whose remote candidate is equal to the source transport | |
| address of the request that was received. This candidate pair is | | address of the request that was received. This candidate pair is | |
| assigned an arbitrary priority, and placed into a list of valid | | assigned an arbitrary priority, and placed into a list of valid | |
|
| candidates for that component of that media stream called the valid | | candidates pair for that component of that media stream, called the | |
| list. In addition, it is marked as favored, since the peer agent has | | valid list. The agent sets the nominated flag for that pair to true. | |
| indicated that it is to be used. ICE processing is considered | | ICE processing is considered complete for a media stream if the valid | |
| complete for a media stream if the valid list contains a candidate | | list contains a candidate pair for each component. | |
| pair for each component. | | | |
| | | | |
|
| 8. Concluding ICE | | 8. Concluding ICE Processing | |
| | | | |
| The processing rules in this section apply only to full | | The processing rules in this section apply only to full | |
|
| implementations. | | implementations. Concluding ICE involves nominating pairs by the | |
| | | controlling agent and updating of state machinery | |
| | | | |
|
| Concluding ICE involves selection of pairs by the controlling agent, | | 8.1. Nominating Pairs | |
| updating of state machinery, and possibly the generation of an | | | |
| updated offer by the controlling agent. | | | |
| | | | |
|
| The controlling agent can use any algorithm it likes for deciding | | The controlling agent nominates pairs to be selected by ICE by using | |
| when to select a candidate pair, called the favored pair, as the one | | one of two techniques: regular nomination or aggressive nomination. | |
| that will be used for media. However, it MUST eventually include a | | If its peer has a lite implementation, an agent MUST use a regular | |
| USE-CANDIDATE attribute in at least one successful check for each | | nomination algorithm. If its peer is using ICE options (present in | |
| component of each media stream. | | an ice-options attribute from the peer) that the agent does not | |
| | | understand, the agent 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 agent MAY use | |
| | | either the aggressive or the regular nomination algorithm. However, | |
| | | the regular algorithm is RECOMMENDED since it provides greater | |
| | | stability. | |
| | | | |
|
| The most apparent way to utilize the USE-CANDIDATE attribute is to | | 8.1.1. Regular Nomination | |
| run through a series of checks, each of which omit the flag. Once | | | |
| one or more checks complete successfully for a component of a media | | | |
| stream, the agent evaluates the choices based on some criteria, and | | | |
| picks a candidate pair. The criteria for evaluation is a matter of | | | |
| implementation and it allows for localized optimizations. The check | | | |
| that yielded this pair is then repeated, this time with the USE- | | | |
| CANDIDATE flag. This approach provides the most flexibility in terms | | | |
| of algorithms, and also improves ICE's resilience to variations 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 be done. | | | |
| | | | |
|
| An alternative is called "proactive selection". In this approach, | | With regular nomination, the agent lets some number of checks | |
| the controlling agent includes the USE-CANDIDATE attribute in every | | complete, each of which omit the USE-CANDIDATE attribute. Once one | |
| check it sends. Once the first check for a component succeeds, it is | | or more checks complete successfully for a component of a media | |
| used by ICE. In this mode, the agent will end up using the candidate | | stream, valid pairs are generated and added to the valid list. The | |
| pair which is highest priority based on ICE's prioritization | | agent lets the checks continue until some stopping criteria is met, | |
| algorithm, instead of some other local optimization. It is possible | | and then picks amongst the valid pairs based on an evaluation | |
| with proactive selection that multiple checks might succeed with the | | criteria. The criteria for stopping the checks and for evaluating | |
| flag set; this is why ICE still applies its prioritization algorithm | | the valid pairs is entirely a matter of local optimization. | |
| to pick amongst those pairs that have been favored. | | | |
| | | | |
|
| If an agent is controlling and its peer has a lite implementation, an | | When the controlling agent selects the valid pair, it repeats the | |
| agent MUST use an introspective selection algorithm. Of course, it | | check that produced this valid pair, this time with the USE-CANDIDATE | |
| MAY select a favored pair based on ICE's prioritization. The key | | attribute. This check will succeed (since the previous did), causing | |
| requirement is that the agent must complete a successful check before | | the nominated flag of that and only that pair to be set. | |
| redoing it with the USE-CANDIDATE attribute. | | Consequently, there will be only a single nominated pair in the valid | |
| | | list, and when the state of the check list moves to completed, that | |
| | | exact pair is selected by ICE for sending and receiving media. | |
| | | | |
|
| For both controlling and controlled agents, once a candidate pair in | | Regular nomination provides the most flexibility, since the agent has | |
| the Valid list is marked as favored, an agent MUST NOT generate any | | control over the stopping and selection criteria for checks. The | |
| further periodic checks for that component of that media stream, and | | only requirement is that the agent MUST eventually pick one and only | |
| SHOULD cease any retransmissions in progress for checks for that | | one candidate pair and generate a check for that pair with the USE- | |
| component of that media stream. Once there is at least one candidate | | CANDIDATE attribute present. Regular nomination also improves ICE's | |
| pair for each component of a media stream that is favored, a full- | | resilience to variations in implementation (see Section 14. Regular | |
| mode agent MUST change the state of processing for its check list to | | nomination is also more stable, allowing both agents to converge on a | |
| Completed. Once all of the check lists for the media streams enter | | single pair for media without any transient selections, which can | |
| the Completed state, the controlling agent takes the highest priority | | happen with the aggressive algorithm. The drawback of regular | |
| favored candidate pair for each component of each media stream. If | | nomination is that it is guaranteed to increase latencies because it | |
| any of those candidate pairs differ from the in-use candidates in | | requires an additional check to be done. | |
| m/c-lines of the most recent offer/answer exchange, the controlling | | | |
| agent MUST generate an updated offer as described in Section 9. | | 8.1.2. Aggressive Nomination | |
| | | | |
| | | With aggressive nomination, the controlling agent includes the USE- | |
| | | CANDIDATE attribute in every check it sends. Once the first check | |
| | | for a component succeeds, it will be added to the valid list, have | |
| | | its nominated flag set, and then cause ICE processing 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 highest priority nominated candidate pair from | |
| | | the valid list as the 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 state of ICE | |
| | | processing depends on the presence of nominated candidate pairs in | |
| | | the valid list: | |
| | | | |
| | | o If there are no nominated pairs in the valid list for a media | |
| | | stream, ICE processing continues. | |
| | | | |
| | | o If there is at least one nominated pair in the valid list: | |
| | | | |
| | | * The agent MUST remove all Waiting and Frozen pairs in the check | |
| | | list for the same component as the nominated pairs for that | |
| | | media stream | |
| | | | |
| | | * If an In-Progress pair in the check list is for the same | |
| | | component as a nominated pair, the agent SHOULD cease | |
| | | retransmissions for its check if its pair priority is lower | |
| | | than the 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 agent MUST change the state of processing for its check | |
| | | list for that media stream to Completed. | |
| | | | |
| | | * The agent MUST continue to respond to any checks it may still | |
| | | receive for that media stream, and MUST perform triggered | |
| | | checks if required by the processing of Section 7.2. | |
| | | | |
| | | * The agent MAY begin transmitting media for this media stream as | |
| | | described in Section 11.1 | |
| | | o Once there is at least one nominated pair in the valid list for | |
| | | each component of each media stream: | |
| | | | |
| | | * The agent sets the state of ICE processing overall to | |
| | | Completed. | |
| | | | |
| | | * If an agent is controlling, it examines the highest priority | |
| | | nominated candidate pair for each component of each media | |
| | | stream. If any of those candidate pairs differ from the | |
| | | default candidate pairs in the most recent offer/answer | |
| | | exchange, the controlling agent MUST generate an updated offer | |
| | | as described in Section 9. If the controlling agent is using | |
| | | an aggressive nomination algorithm, this may result in several | |
| | | updated offers as the pairs selected for media change. An | |
| | | agent MAY delay sending the offer for a brief interval (one | |
| | | second is RECOMMENDED) in order to allow the selected pairs to | |
| | | stabilize. | |
| | | | |
| 9. Subsequent Offer/Answer Exchanges | | 9. Subsequent Offer/Answer Exchanges | |
| | | | |
|
| An agent MAY generate a subsequent offer at any time. However, the | | Either agent MAY generate a subsequent offer at any time allowed by | |
| rules in Section 8 will cause the controlling agent to send an | | RFC 3264 [4]. The rules in Section 8 will cause the controlling | |
| updated offer at the conclusion of ICE processing when ICE has | | agent to send an updated offer at the conclusion of ICE processing | |
| selected different candidate pairs from the in-use pairs. This | | when ICE has selected different candidate pairs from the default | |
| section defines rules for construction of subsequent offers and | | pairs. This section defines rules for construction of subsequent | |
| answers. | | offers and answers. | |
| | | | |
| 9.1. Generating the Offer | | 9.1. Generating the Offer | |
| | | | |
|
| An agent MAY change the ice-pwd and/or ice-ufrag for a media stream | | 9.1.1. Procedures for All Implementations | |
| in an offer. Doing so is a signal to restart ICE processing for that | | | |
| media stream. When an agent restarts ICE for a media stream, it MUST | | 9.1.1.1. ICE Restarts | |
| NOT include the a=remote-candidates attribute, since the state of the | | | |
| media stream would not be Completed at this point. Note that it is | | An agent MAY restart ICE processing for an existing media stream. An | |
| permissible to use a session-level attribute in one offer, but to | | ICE restart, as the name implies, will cause all previous state of | |
| provide the same password as a media-level attribute in a subsequent | | ICE processing to be flushed and checks to start anew. The only | |
| | | difference between an ICE restart and a brand new media session is | |
| | | that, during the restart, media can continue to be sent to the | |
| | | previously validated pair. | |
| | | | |
| | | An agent MUST restart ICE for a media stream if: | |
| | | | |
| | | o The offer is being generated for the 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 value for the destination of a media component. | |
| | | | |
| | | o An agent is changing its implementation level. This typically | |
| | | only happens in third party call control use cases, where the | |
| | | entity performing the signaling is not the entity receiving the | |
| | | media, and it has changed the target of media mid-session to | |
| | | another entity that has a different ICE implementation. | |
| | | | |
| | | These rules imply that setting the IP address in the 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 ice-pwd and the ice- | |
| | | ufrag for the media stream in an offer. Note that it is permissible | |
| | | to use a session-level attribute in one offer, but to provide the | |
| | | same ice-pwd or ice-ufrag as a media-level attribute in a subsequent | |
| offer. This is not a change in password, just a change in its | | offer. This is not a change in password, just a change in its | |
|
| representation. | | representation, and does not cause an ICE restart. | |
| | | | |
|
| An agent MUST restart ICE processing if the offer is being generated | | An agent sets the rest of the fields in the SDP for this media stream | |
| for the purposes of changing the target of the media stream. In | | as it would in an initial offer of this media stream (see | |
| other words, if an agent wants to generated an updated offer which, | | Section 4.3). Consequently, the set of candidates MAY include some, | |
| had ICE not been in use, would result in a new value for the | | none, or all of the previous candidates for that stream and MAY | |
| transport address in the m/c-line, the agent MUST restart ICE for | | include a totally new set of candidates gathered as described in | |
| that media stream. This implies that setting the IP address in the c | | Section 4.1.1. | |
| line to 0.0.0.0 will cause an ICE restart. Consequently, ICE | | | |
| implementations SHOULD NOT utilize this mechanism for call hold, and | | 9.1.1.2. Removing a Media Stream | |
| instead use a=inactive as described in [4] | | | |
| | | | |
| If an agent removes a media stream by setting its port to zero, it | | If an agent removes a media stream by setting its port to zero, it | |
|
| MUST NOT include any candidate attributes for that media stream. | | MUST NOT include any candidate attributes for that media stream and | |
| | | SHOULD NOT include any other ICE-related attributes defined in | |
| | | Section 15 for that media stream. | |
| | | | |
|
| An agent MUST NOT signal a change in its implementation level (full | | 9.1.1.3. Adding a Media Stream | |
| or lite) by adding or removing the a=ice-lite attribute from an | | | |
| updated offer, unless ICE processing is being restarted for all media | | | |
| streams in the offer. Of course, in normal cases the implementation | | | |
| level is not dynamic and there would be no need to signal a change. | | | |
| However, in applications like third party call control, which involve | | | |
| a mid-session change in remote correspondent, this can happen and it | | | |
| is permitted by ICE with a restart. | | | |
| | | | |
|
| Note that an agent can add a new media stream at any time, even if | | If an agent wishes to add a new media stream, it sets the fields in | |
| ICE has long finished for the existing media streams. Based on the | | the SDP for this media stream as if this was an initial offer for | |
| rules described here, checks will begin for this new stream as if it | | that media stream (see Section 4.3). This will cause ICE processing | |
| was in an initial offer. | | to begin for this media stream. | |
| | | | |
|
| 9.1.1. Additional Procedures for Full Implementations | | 9.1.2. Procedures for Full Implementations | |
| | | | |
| This section describes additional procedures for full | | This section describes additional procedures for full | |
|
| implementations. | | implementations, covering existing media streams. | |
| | | | |
|
| When an agent generates an updated offer, the set of candidate | | The username fragments, password, and implementation level MUST | |
| attributes to include for each media stream depend on the state of | | remain the same as used previously. If an agent needs to change one | |
| ICE processing for that media stream. If the processing for that | | of these it MUST restart ICE for that media stream. | |
| media stream is in the Completed state, a full-mode agent MUST | | | |
| include a candidate attribute for 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 pair in the valid list | | | |
| for a component of that media stream. An agent SHOULD NOT include | | | |
| any other candidate attributes for that media stream. If ICE | | | |
| processing for a media stream is in the Running state, the agent MUST | | | |
| include all current candidates (including peer reflexive candidates | | | |
| learned through ICE processing) for that media stream. It MAY | | | |
| include candidates it did not offer previously, but which it has | | | |
| gathered since the last offer/answer exchange. If a media stream is | | | |
| new or ICE checks are restarting for that stream, an agent includes | | | |
| the set of candidates it wishes to utilize. This MAY include some, | | | |
| none, or all of the previous candidates for that stream in the case | | | |
| of a restart, and MAY include a totally new set of candidates | | | |
| gathered as described in Section 4.1.1. | | | |
| | | | |
|
| If a candidate was sent in a previous offer/answer exchange, it | | Additional behavior depends on the state ICE processing for that | |
| SHOULD have the same priority. For a peer reflexive candidate, the | | media stream. | |
| priority SHOULD be the same as determined by the processing in | | | |
| Section 7.1.2. The foundation SHOULD be the same. The username | | | |
| fragments and passwords for a media stream SHOULD remain the same as | | | |
| the previous offer or answer. | | | |
| | | | |
|
| Population of the m/c-lines also depends on the state of ICE | | 9.1.2.1. Existing Media Streams with ICE Running | |
| processing. If ICE processing for a media stream is in the Completed | | | |
| state, the m/c-line MUST use the local candidate from the highest | | If an agent generates an updated offer including media stream that | |
| priority favored pair in the valid list for each component of that | | was previously established, and for which ICE checks are in the | |
| media stream. If ICE processing is in the Running state, a full-mode | | Running state, the agent follows the procedures defined here. | |
| agent SHOULD populate the m/c-line for that media stream based on the | | | |
| considerations in Section 4.1.3. | | An agent MUST include candidate attributes for all local candidates | |
| | | it had signaled previously for that media stream. The 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 fundamentally identify | |
| | | that candidate, MUST remain the same (if they change, it would be a | |
| | | new candidate). The component ID MUST remain the same. The agent | |
| | | MAY include additional candidates it did not offer previously, but | |
| | | which it has gathered since the last offer/answer exchange, including | |
| | | peer reflexive candidates. | |
| | | | |
| | | The agent MAY change the default destination for media. As with | |
| | | initial offers, there MUST be a set of candidate attributes in the | |
| | | offer matching this 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 | |
| | | Completed state, the agent follows the procedures defined here. | |
| | | | |
| | | The default destination for media (i.e., the values of the IP | |
| | | addresses and ports in the m and c line used for that media stream) | |
| | | MUST be the local candidate from the highest priority nominated pair | |
| | | in the 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 of the media stream, and | |
| | | MUST NOT include any other candidates. | |
| | | | |
| In addition, if the agent is controlling, it MUST include the | | In addition, if the agent is controlling, it MUST include the | |
|
| a=remote-candidates attribute for each media stream that is in the | | a=remote-candidates attribute for each media stream whose check list | |
| Completed state. The attribute contains the remote candidates from | | is in the Completed state. The attribute contains the remote | |
| the highest priority favored pair in the valid list for each | | candidates from the highest priority nominated pair in the valid list | |
| component of that media stream. | | for each component of that media stream. It is needed to avoid a | |
| | | race condition whereby the controlling agent chooses its pairs, but | |
| | | the updated offer beats the connectivity checks to the controlled | |
| | | agent, which doesn't even know these pairs are valid, let alone | |
| | | selected. See Appendix B.6 for elaboration on this race condition. | |
| | | | |
|
| 9.1.2. Additional Procedures for Lite Implementations | | 9.1.3. Procedures for Lite Implementations | |
| | | | |
|
| A passive-only agent includes its one and only candidate for each | | This section describes procedures for lite implementations for | |
| component of each media stream in an a=candidate attribute in any | | existing streams for which ICE is running. | |
| subsequent offer. This candidate is formed identically to the | | | |
| | | A lite implementation MUST include its 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 the | |
| procedures for initial offers, as described in Section 4.2. | | 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 needs to change one | |
| | | of these it MUST restart ICE for that media stream. | |
| | | | |
| 9.2. Receiving the Offer and Generating an Answer | | 9.2. Receiving the Offer and Generating an Answer | |
| | | | |
|
| | | 9.2.1. Procedures for All Implementations | |
| | | | |
| When receiving a subsequent offer within an existing session, an | | When receiving a subsequent offer within an existing session, an | |
| agent MUST re-apply the verification procedures in Section 5.1 | | agent MUST re-apply the verification procedures in Section 5.1 | |
| without regard to the results of verification from any previous | | without regard to the results of verification from any previous | |
| offer/answer exchanges. Indeed, it is possible that a previous | | offer/answer exchanges. Indeed, it is possible that a previous | |
| offer/answer exchange resulted in ICE not being used, but it is used | | offer/answer exchange resulted in ICE not being used, but it is used | |
| as a consequence of a subsequent exchange. | | as a consequence of a subsequent exchange. | |
| | | | |
|
| | | 9.2.1.1. Detecting ICE Restart | |
| | | | |
| If the offer contained a change in the a=ice-ufrag or a=ice-pwd | | If the offer contained a change in the a=ice-ufrag or a=ice-pwd | |
|
| attributes compared to the previous SDP from the peer, it is a signal | | attributes compared to the previous SDP from the peer, it indicates | |
| that ICE is restarting for this media stream. If all media streams | | that ICE is restarting for this media stream. If all media streams | |
|
| are restarting, than ICE is restarting overall. Procedures for ICE | | are restarting, than ICE is restarting overall. | |
| restarts are discussed below. Unless ICE is restarting for that | | | |
| 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 | | If ICE is restarting for a media stream: | |
| SDP unless, based on the offer, ICE procedures are being restarted | | | |
| 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 | | o The agent MUST change the a=ice-ufrag and a=ice-pwd attributes in | |
| answer. | | the answer. | |
| | | | |
|
| When the answerer generates its answer, it must decide what | | o The agent MAY change its implementation level in the answer. | |
| candidates to include in the answer, how to populate the m/c-line, | | | |
| and how to adjust the states of ICE processing. The rules for | | | |
| inclusion of candidate attributes in an answer are identical to the | | | |
| rules followed by the offerer as described in Section 9.1 for both | | | |
| full and lite implementations. For lite implementations, those rules | | | |
| also apply for setting the m/c-line. However, additional | | | |
| considerations apply to full implementations. | | | |
| | | | |
|
| 9.2.1. Additional Procedures for Full Implementations | | An agent sets the rest of the fields in the SDP for this media stream | |
| | | as it would in an initial answer to this media stream (see | |
| | | Section 4.3). Consequently, the set of candidates MAY include some, | |
| | | none, or all of the previous candidates for that stream and MAY | |
| | | include a totally new set of candidates gathered as described in | |
| | | Section 4.1.1. | |
| | | | |
|
| The computation of the m/c-line additionally depends on the presence | | 9.2.1.2. New Media Stream | |
| or absence of the a=remote-candidates attribute in a media stream. | | | |
| If present, it means that the offerer (acting as the controlling | | | |
| agent) believed that 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 | | | |
| the agent doesn't even know of these candidates yet; they will be | | | |
| discovered shortly through a response to an in-progress check. The | | | |
| full-mode agent MUST populate the m/c-line with the candidates from | | | |
| the a=remote-candidates attribute. | | | |
| | | | |
|
| If the offer did not contain the a=remote-candidates attribute, the | | If the offer contains a new media stream, the agent sets the fields | |
| agent follows the same procedures for populating the m/c-line as | | in the answer as if it had received an initial offer containing that | |
| described for the offerer in Section 9.1. | | media stream (see Section 4.3). This will cause ICE processing to | |
| | | begin for this media stream. | |
| | | | |
|
| 9.3. Updating the Check and Valid Lists | | 9.2.1.3. Removed Media Stream | |
| | | | |
|
| If ICE is restarting for a media stream, the agent MUST start a new | | If an offer contains a media stream whose port is zero, the agent | |
| Valid list for that media stream. However, it retains the old Valid | | MUST NOT include any candidate attributes for that media stream in | |
| list for the purposes of sending media until ICE processing | | its answer and SHOULD NOT include any other ICE-related attributes | |
| completes, at which point the old Valid list is discarded and the new | | defined in Section 15 for that media stream. | |
| one is utilized to determine media and keepalive targets. | | | |
| | | | |
|
| 9.3.1. Additional Procedures for Full Implementations | | 9.2.2. Procedures for Full Implementations | |
| | | | |
|
| The procedures in this section are applicable only to full | | The username fragments, password, and implementation level MUST | |
| implementations. | | remain the same as used previously. If an agent needs to change one | |
| | | of these it MUST restart ICE for that media stream by generating an | |
| | | offer; ICE cannot be restarted in an answer. | |
| | | | |
|
| Once the subsequent offer/answer exchange has completed, each agent | | Additional behaviors depend on the state of ICE processing for that | |
| needs to determine the impact, if any, on the Check and Valid lists. | | media stream. | |
| Unless 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 agent MUST flush the check list for the | | 9.2.2.1. Existing Media Streams with ICE Running and no remote- | |
| affected media streams, and then recompute the check list and its | | candidates | |
| states as described in Section 5.7. | | | |
| | | | |
|
| The remainder of this section describes processing when ICE is not | | If ICE is running for a media stream, and the offer for that media | |
| restarting. | | stream lacked the remote-candidates attribute, the rules for | |
| | | construction of the answer are identical to those for the offerer as | |
| | | described in Section 9.1.2.1. | |
| | | | |
| | | 9.2.2.2. Existing Media Streams with ICE Completed and no remote- | |
| | | candidates | |
| | | | |
| | | If ICE is Completed for a media stream, and the offer for that media | |
| | | stream lacked the remote-candidates attribute, the rules for | |
| | | construction of the answer are identical to those for the offerer as | |
| | | described in Section 9.1.2.2, except that the answerer MUST NOT | |
| | | include the a=remote-candidates attribute in the answer. | |
| | | | |
| | | 9.2.2.3. Existing Media Streams and remote-candidates | |
| | | | |
| | | A controlled agent 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 attribute is present in the | |
| | | offer to 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 be selected by ICE. See Appendix B.6 for an | |
| | | explanation of this race condition. Consequently, processing of an | |
| | | offer with this attribute depends on the winner of the race. | |
| | | | |
| | | The agent forms a candidate pair for each component of the media | |
| | | stream by: | |
| | | | |
| | | o Setting the remote candidate equal to 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 equal to the transport address for | |
| | | that same component in the a=remote-candidates attribute in the | |
| | | offer. | |
| | | | |
| | | The agent then sees if each of these candidate pairs are present in | |
| | | the valid list. If a particular pair is not in the valid list, the | |
| | | check has "lost" the race. Call such a pair a "losing pair". | |
| | | | |
| | | The agent finds all the pairs in the check list whose remote | |
| | | candidates equal the remote candidate in 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 SHOULD | |
| | | generate an answer for this media stream as if the remote- | |
| | | candidates attribute had not been present, and then restart ICE | |
| | | for this stream. | |
| | | | |
| | | o If at least one of the pairs are In-Progress, the agent SHOULD | |
| | | wait for 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 agent can generate the answer. | |
| | | It MUST 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 a candidate pair in the valid list). | |
| | | It MUST include a candidate attribute in the answer for each | |
| | | candidate in the remote-candidates attribute in the offer. | |
| | | | |
| | | 9.2.3. Procedures for Lite Implementations | |
| | | | |
| | | A lite implementation constructs its answer in the same way it does a | |
| | | subsequent offer as described in Section 9.1.3 | |
| | | | |
| | | 9.3. Updating the Check and Valid Lists | |
| | | | |
| | | 9.3.1. Procedures for Full Implementations | |
| | | | |
| | | 9.3.1.1. ICE Restarts | |
| | | | |
| | | The agent MUST remember the highest priority nominated pairs in the | |
| | | Valid list for each component of the media stream, called the | |
| | | previous selected pairs, prior to the restart. The agent will | |
| | | continue to send media using these pairs, as described in | |
| | | Section 11.1. Once these destinations are noted, the agent MUST | |
| | | flush the valid and check lists, and then recompute the check list | |
| | | and its states as described in Section 5.7. | |
| | | | |
| | | 9.3.1.2. New Media Stream | |
| | | | |
| If the offer/answer exchange added a new media stream, the agent MUST | | If the offer/answer exchange added a new media stream, the agent MUST | |
| create a new check list for it (and an empty Valid list to start of | | create a new check list for it (and an empty Valid list to start of | |
| course), as described in Section 5.7. | | course), as described in Section 5.7. | |
| | | | |
|
| | | 9.3.1.3. Removed Media Stream | |
| | | | |
| If the offer/answer exchange removed a media stream, or an answer | | If the offer/answer exchange removed a media stream, or an answer | |
| rejected an offered media stream, an agent MUST flush the Valid list | | rejected an offered media stream, an agent MUST flush the Valid list | |
| for that media stream. It MUST terminate any STUN transactions in | | for that media stream. It MUST terminate any STUN transactions in | |
| progress for that media stream. An agent MUST remove the check list | | progress for that media stream. An agent MUST remove the check list | |
| for that media stream and cancel any pending periodic checks for it. | | for that media stream and cancel any pending periodic checks for it. | |
| | | | |
|
| If a media stream existed previously, and remains after the offer/ | | 9.3.1.4. ICE Continuing for Existing Media Stream | |
| answer exchange, the agent MUST NOT modify the Valid list for that | | | |
| media stream. However, if an agent is in the Running state for that | | | |
| media stream, the check list is updated. To do that, the agent | | | |
| recomputes the check lists using the procedures described in | | | |
| Section 5.7. If 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 a check on 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 the check was | | | |
| on an old check list but its state was not copied over) its state is | | | |
| set to Frozen. | | | |
| | | | |
|
| If none of the check lists are active (meaning that the checks in | | The valid list is not affected by an updated offer/answer exchange | |
| each check list are Frozen), the full-mode agent sets the first check | | unless ICE is restarting. | |
| in the check list for the first media stream to Waiting, and then | | | |
| sets the state of all other checks in that check list for the same | | If an agent is in the Running state for that media stream, the check | |
| | | list is updated (the check list is irrelevant if the state is | |
| | | completed). To do that, the agent recomputes the check list using | |
| | | the procedures described in Section 5.7. If a pair on the new check | |
| | | list was also on the previous check list, and its state was Waiting, | |
| | | In-Progress, Succeeded or Failed, its state is copied over. | |
| | | Otherwise, its state is set to Frozen. | |
| | | | |
| | | If none of the check lists are active (meaning that the pairs in each | |
| | | check list are Frozen), the full-mode agent sets the first pair in | |
| | | the check list for the first media stream to Waiting, and then sets | |
| | | the state of all other pairs in that check list for the same | |
| component ID and with the same foundation to Waiting as well. | | component ID and with the same foundation to Waiting as well. | |
| | | | |
| Next, the agent goes through each check list, starting with the | | Next, the agent goes through each check list, starting with the | |
|
| highest priority check. If a check has a state of Succeeded, and it | | highest priority pair. If a pair has a state of Succeeded, and it | |
| has a component ID of 1, then all Frozen checks in the same check | | has a component ID of 1, then all Frozen pairs in the same check list | |
| list with the same foundation whose component IDs are not one, have | | with the same foundation whose component IDs are not 1, have their | |
| their state set to Waiting. If, for a particular check list, there | | state set to Waiting. If, for a particular check list, there are | |
| are checks for each component of that media stream in the Succeeded | | pairs for each component of that media stream in the Succeeded state, | |
| state, the agent moves the state of all Frozen checks for the first | | the agent moves the state of all Frozen pairs for the first component | |
| component of all other media streams (and thus in different check | | of all other media streams (and thus in different check lists) with | |
| lists) with the same foundation to Waiting. | | the same foundation to Waiting. | |
| | | | |
| | | 9.3.2. Procedures for Lite Implementations | |
| | | | |
| | | If ICE is restarting for a media stream, the agent MUST start a new | |
| | | Valid list for that media stream. It MUST remember the pairs in the | |
| | | previous Valid list for each component of the media stream, called | |
| | | the previous selected pairs, and continue to send media there as | |
| | | described in Section 11.1. | |
| | | | |
| 10. Keepalives | | 10. Keepalives | |
| | | | |
| All endpoints MUST send keepalives for each media session. These | | All endpoints MUST send keepalives for each media session. These | |
|
| keepalives serve the purpose of keeping NAT bindings active for the | | keepalives serve the purpose of keeping NAT bindings alive for the | |
| media session. These keepalives MUST be sent regardless of whether | | media session. These keepalives MUST be sent regardless of whether | |
| the media stream is currently inactive, sendonly, recvonly or | | the media stream is currently inactive, sendonly, recvonly or | |
| sendrecv, and regardless of the presence or value of the bandwidth | | sendrecv, and regardless of the presence or value of the bandwidth | |
| attribute. These keepalives MUST be sent even if ICE is not being | | attribute. These keepalives MUST be sent even if ICE is not being | |
| utilized for the session at all. The keepalive SHOULD be sent using | | utilized for the session at all. The keepalive SHOULD be sent using | |
| a format which is supported by its peer. ICE endpoints allow for | | a format which is supported by its peer. ICE endpoints allow for | |
| STUN-based keepalives for UDP streams, and as such, STUN keepalives | | STUN-based keepalives for UDP streams, and as such, STUN keepalives | |
| MUST be used when an agent is communicating with a peer that supports | | MUST be used when an agent is communicating with a peer that supports | |
| ICE. An agent can determine that its peer supports ICE by the | | ICE. An agent can determine that its peer supports ICE by the | |
| presence of a=candidate attributes for each media session. If the | | presence of a=candidate attributes for each media session. If the | |
| peer does not support ICE, the choice of a packet format for | | peer does not support ICE, the choice of a packet format for | |
| keepalives is a matter of local implementation. A format which | | keepalives is a matter of local implementation. A format which | |
| allows packets to easily be sent in the absence of actual media | | allows packets to easily be sent in the absence of actual media | |
| content is RECOMMENDED. Examples of formats which readily meet this | | content is RECOMMENDED. Examples of formats which readily meet this | |
|
| goal are RTP No-Op [28] and RTP comfort noise [24]. If the peer | | goal are RTP No-Op [31] and RTP comfort noise [25]. If the peer | |
| doesn't support any formats that are particularly well suited for | | doesn't support any formats that are particularly well suited for | |
| keepalives, an agent SHOULD send RTP packets with an incorrect | | keepalives, an agent SHOULD send RTP packets with an incorrect | |
| version number, or some other form of error which would cause them to | | version number, or some other form of error which would cause them to | |
| be discarded by the peer. | | be discarded by the peer. | |
| | | | |
|
| If there has been no packet sent on a candidate pair being used for | | If there has been no packet sent on the candidate pair ICE is using | |
| media for Tr seconds (where packets include media and previous | | for a media component for Tr seconds (where packets include those | |
| keepalives), an agent MUST generate a keepalive on that pair. Tr | | defined for the component (RTP or RTCP) and previous keepalives), an | |
| SHOULD be configurable and SHOULD have a default of 15 seconds. | | agent MUST generate a keepalive on that pair. Tr SHOULD be | |
| | | configurable and SHOULD have a default of 15 seconds. Alternatively, | |
| | | if an agent has a dynamic way to discover the binding lifetimes of | |
| | | the intervening NATs, it can use that value to determine Tr. | |
| | | | |
| If STUN is being used for keepalives, a STUN Binding Indication is | | If STUN is being used for keepalives, a STUN Binding Indication is | |
|
| used [11]. The Binding Indication SHOULD NOT contain integrity | | used [12]. The Binding Indication SHOULD NOT contain integrity | |
| checks; since the messages are simply discarded on receipt regardless | | checks as the messages are simply discarded on receipt regardless of | |
| of contents. The Indication SHOULD NOT contain the PRIORITY or USE- | | contents. The Indication SHOULD NOT contain the PRIORITY or USE- | |
| CANDIDATE attributes defined here. The Binding Indication is sent | | CANDIDATE attributes defined in this document. The Binding | |
| using the same local and remote candidates that are being used for | | Indication is sent using the same local and remote candidates that | |
| media. An agent receipt a Binding Indication MUST discard it | | are being used for media. An agent receiving a Binding Indication | |
| silently. Though Binding Indications are used for keepalives, an | | MUST discard it silently. Though Binding Indications are used for | |
| agent MUST be prepared to receive Binding Requests as well. If a | | keepalives, an agent MUST be prepared to receive Binding Requests as | |
| Binding Request is received, a response is generated as discussed in | | well. If a Binding Request is received, a response is generated as | |
| [11], but there is no impact on ICE processing otherwise. | | discussed in [12], but there is no impact on ICE processing | |
| | | otherwise. | |
| | | | |
| An agent MUST begin the keepalive processing once ICE has selected | | An agent MUST begin the keepalive processing once ICE has selected | |
| candidates for usage with media, or media begins to flow, whichever | | candidates for usage with media, or media begins to flow, whichever | |
| happens first. Keepalives end once the session terminates or the | | happens first. Keepalives end once the session terminates or the | |
| media stream is removed. | | media stream is removed. | |
| | | | |
| 11. Media Handling | | 11. Media Handling | |
| | | | |
| 11.1. Sending Media | | 11.1. Sending Media | |
| | | | |
| Procedures for sending media differ for full and lite | | Procedures for sending media differ for full and lite | |
| implementations. | | implementations. | |
| | | | |
| 11.1.1. Procedures for Full Implementations | | 11.1.1. Procedures for Full Implementations | |
| | | | |
|
| Agents always send media using a candidate pair. An agent will send | | Agents always send media using a candidate pair, called the selected | |
| media to the remote candidate in the pair (setting the destination | | candidate pair. An agent will send media to the remote candidate in | |
| address and port of the packet equal to that remote candidate), and | | the selected pair (setting the destination address and port of the | |
| will send it from the local candidate. When the local candidate is | | packet equal to that remote candidate), and will send it from the | |
| | | local candidate of the selected pair. When the local candidate is | |
| server or peer reflexive, media is originated from the base. Media | | server or peer reflexive, media is originated from the base. Media | |
|
| sent from a relayed candidate is sent through that relay, using | | sent from a relayed candidate is sent from the base through that | |
| procedures defined in [12]. | | relay, using procedures defined in [13]. | |
| | | | |
|
| If the state of a media stream is Running, there is no old Valid list | | The selected pair for a component of a media stream is: | |
| for that media stream (which would be due to an ICE restart), an | | | |
| agent MUST NOT send media. | | | |
| | | | |
|
| When an agent sends media, it MUST send it using the highest priority | | o empty if the state of the check list for that media stream is | |
| selected pair for each component in either the old Valid list for a | | Running, and there is no previous selected pair for that component | |
| media stream (if it exists), else the new Valid list for that media | | due to an ICE restart | |
| stream. In several cases, this will not be the same candidate pairs | | | |
| present in the m/c-line. When ICE first completes, if the selected | | | |
| pairs aren't a match for the m/c-line, an updated offer/answer | | | |
| exchange will take place to remedy this disparity. However, until | | | |
| that update offer arrives, there will not be a match. Furthermore, | | | |
| in very unusual cases, the m/c-lines in the updated offer/answer will | | | |
| not be a match. | | | |
| | | | |
|
| ICE has interactions with jitter buffer adaptation mechanisms. An | | o equal to the previous selected pair for a component of a media | |
| RTP stream can begin using one candidate, and switch to another one, | | stream if the state of the check list for that media stream is | |
| though this happens rarely with ICE. The newer candidate may result | | Running, and there was a previous selected pair for that component | |
| in RTP packets taking a different path through the network - one with | | due to an ICE restart | |
| different delay characteristics. As discussed below, agents are | | | |
| encouraged to re-adjust jitter buffers when there are changes in | | o equal to the highest priority nominated pair for that component in | |
| source or destination address. Furthermore, many audio codecs use | | the valid list if the state of the check list is Completed | |
| the marker bit to signal the beginning of a talkspurt, for the | | | |
| purposes of jitter buffer adaptation. For such codecs, it is | | If the selected pair for at least one component of a media stream is | |
| RECOMMENDED that the sender change the marker bit when an agent | | empty, an agent MUST NOT send media for any component of that media | |
| switches transmission of media from one candidate pair to another. | | stream. If the selected pair for each component of a media stream | |
| | | has a value, an agent MAY send media for all components of that media | |
| | | stream. | |
| | | | |
| | | Note that the selected pair for a component of a media stream may not | |
| | | equal the default pair for that same component from the most recent | |
| | | offer/answer exchange. When this happens, the selected pair is used | |
| | | for media, not 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 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 | | 11.1.2. Procedures for Lite Implementations | |
| | | | |
| A lite implementation MUST NOT send media until it has a Valid list | | A lite implementation MUST NOT send media until it has a Valid list | |
| that contains a candidate pair for each component of that media | | that contains a candidate pair for each component of that media | |
| stream. Once that happens, the agent MAY begin sending media | | stream. Once that happens, the agent MAY begin sending media | |
| packets. To do that, it sends media to the remote candidate in the | | packets. To do that, it sends media to the remote candidate in the | |
| pair (setting the destination address and port of the packet equal to | | pair (setting the destination address and port of the packet equal to | |
| that remote candidate), and will send it from the local candidate. | | that remote candidate), and will send it from the local candidate. | |
| | | | |
|
| In cases where there has been an ICE restart, there will be an old | | 11.1.3. Procedures for All Implementations | |
| and a new Valid list. The old Valid list MUST be used by the agent | | | |
| for sending media until the new one is complete, at which point the | | ICE has interactions with jitter buffer adaptation mechanisms. An | |
| new one MUST be used, and the old one discarded. | | RTP stream can 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 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 media packets. Furthermore, many | |
| | | audio codecs use the marker bit to signal the beginning of a | |
| | | talkspurt, for the purposes of jitter buffer adaptation. For such | |
| | | codecs, it is RECOMMENDED that the sender set the marker bit [22] | |
| | | when an agent switches transmission of media from one candidate pair | |
| | | to another. | |
| | | | |
| 11.2. Receiving Media | | 11.2. Receiving Media | |
| | | | |
|
| ICE implementations MUST be prepared to receive media on any | | ICE implementations MUST be prepared to receive media on each | |
| candidates provided in the most recent offer/answer exchange. | | component on any candidates provided for that component in the most | |
| | | recent offer/answer exchange (in the case of RTP, this would include | |
| | | both RTP and RTCP if candidates were provided for both). | |
| | | | |
| It is RECOMMENDED that, when an agent receives an RTP packet with a | | It is RECOMMENDED that, when an agent receives an RTP packet with a | |
| new source or destination IP address for a particular media stream, | | new source or destination IP address for a particular media stream, | |
| that the agent re-adjust its jitter buffers. | | that the agent re-adjust its jitter buffers. | |
| | | | |
|
| RFC 3550 [21] describes an algorithm in Section 8.2 for detecting | | RFC 3550 [22] describes an algorithm in Section 8.2 for detecting | |
| SSRC collisions and loops. These algorithms are based, in part, on | | SSRC collisions and loops. These algorithms are based, in part, on | |
| seeing different source transport addresses with the same SSRC. | | seeing different source transport addresses with the same SSRC. | |
| However, when ICE is used, such changes will sometimes occur as the | | However, when ICE is used, such changes will sometimes occur as the | |
| media streams switch between candidates. An agent will be able to | | media streams switch between candidates. An agent will be able to | |
| determine that a media stream is from the same peer as a consequence | | determine that a media stream is from the same peer as a consequence | |
| of the STUN exchange that proceeds media transmission. Thus, if | | of the STUN exchange that proceeds media transmission. Thus, if | |
| there is a change in source transport address, but the media packets | | there is a change in source transport address, but the media packets | |
| come from the same peer agent, this SHOULD NOT be treated as an SSRC | | come from the same peer agent, this SHOULD NOT be treated as an SSRC | |
| collision. | | collision. | |
| | | | |
| | | | |
| skipping to change at page 43, line 4 | | skipping to change at page 56, line 38 | |
| | | | |
| 12.1. Latency Guidelines | | 12.1. Latency Guidelines | |
| | | | |
| ICE requires a series of STUN-based connectivity checks to take place | | ICE requires a series of STUN-based connectivity checks to take place | |
| between endpoints. These checks start from the answerer on | | between endpoints. These checks start from the answerer on | |
| generation of its answer, and start from the offerer when it receives | | 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 | | the answer. These checks can take time to complete, and as such, the | |
| selection of messages to use with offers and answers can effect | | selection of messages to use with offers and answers can effect | |
| perceived user latency. Two latency figures are of particular | | perceived user latency. Two latency figures are of particular | |
| interest. These are the post-pickup delay and the post-dial delay. | | interest. These are the post-pickup delay and the post-dial delay. | |
|
| | | | |
| The post-pickup delay refers to the time between when a user "answers | | The post-pickup delay refers to the time between when a user "answers | |
| the phone" and when any speech they utter can be delivered to the | | the phone" and when any speech they utter can be delivered to the | |
| caller. The post-dial delay refers to the time between when a user | | caller. The post-dial delay refers to the time between when a user | |
| enters the destination address for the user, and ringback begins as a | | enters the destination address for the user, and ringback begins as a | |
|
| consequence of having succesfully started ringing the phone of the | | consequence of having successfully started ringing the phone of the | |
| called party. | | called party. | |
| | | | |
|
| | | Two cases can be considered - one where the offer is present in the | |
| | | initial INVITE, and one where it is in a response. | |
| | | | |
| | | 12.1.1. Offer in INVITE | |
| | | | |
| To reduce post-dial delays, it is RECOMMENDED that the caller begin | | To reduce post-dial delays, it is RECOMMENDED that the caller begin | |
| gathering candidates prior to actually sending its initial INVITE. | | gathering candidates prior to actually sending its initial INVITE. | |
|
| | | | |
| This can be started upon user interface cues that a call is pending, | | This can be started upon user interface cues that a call is pending, | |
| such as activity on a keypad or the phone going offhook. | | such as activity on a keypad or the phone going offhook. | |
| | | | |
|
| If an offer is received in an INVITE request, the callee SHOULD | | If an offer is received in an INVITE request, the answerer SHOULD | |
| immediately gather its candidates and then generate an answer in a | | begin to gather its candidates on receipt of the offer and then | |
| provisional response. ICE requires that a provisional response with | | generate an answer in a provisional response once it has completed | |
| an SDP be transmitted reliably. This can be done through the | | that process. ICE requires that a provisional response with an SDP | |
| existing PRACK mechanism [9], or through an optimization that is | | be transmitted reliably. This can be done through the existing PRACK | |
| specific to ICE. With this optimization, provisional responses | | mechanism [9], or through an optimization that is specific to ICE. | |
| containing an SDP answer that begins ICE processing for one or more | | With this optimization, provisional responses containing an SDP | |
| media streams can be sent reliably without RFC 3264. To do this, the | | answer that begins ICE processing for one or more media streams can | |
| agent retransmits the provisional response with th exponential | | be sent reliably without RFC 3264. To do this, the agent retransmits | |
| backoff timers described in RFC 3262. Retransmits MUST cease on | | the provisional response with th exponential backoff timers described | |
| receipt of a STUN Binding Request for one of the media streams | | in RFC 3262. Retransmits MUST cease on receipt of a STUN Binding | |
| signaled in that SDP or on transmission of a 2xx response. If no | | Request for one of the media streams signaled in that SDP (because | |
| Binding Request is received prior to the last retransmit, the agent | | receipt of a binding request indicates the offerer has received the | |
| does not consider the session terminated. Despite the fact that the | | answer) or on transmission of a 2xx response. If no Binding Request | |
| provisional response will be delivered reliably, the rules for when | | is received prior to the last retransmit, the agent does not consider | |
| an agent can send an updated offer or answer do not change from those | | the session terminated. Despite the fact that the provisional | |
| specified in RFC 3262. Specifically, if the INVITE contained an | | response will be delivered reliably, the rules for when an agent can | |
| offer, the same answer appears in all of the 1xx and in the 2xx | | send an updated offer or answer do not change from those specified in | |
| response to the INVITE. Only after that 2xx has been sent can an | | RFC 3262. Specifically, if the INVITE contained an offer, the same | |
| updated offer/answer exchange occur. This optimization SHOULD NOT be | | answer appears in all of the 1xx and in the 2xx response to the | |
| used if both agents support PRACK. Note that the optimization is | | INVITE. Only after that 2xx has been sent can an updated offer/ | |
| very specific to provisional response carrying answers that start ICE | | answer exchange occur. This optimization SHOULD NOT be used if both | |
| processing; it is not a general technique for 1xx reliability. | | agents support PRACK. Note that the optimization is very specific to | |
| | | provisional response carrying answers that start ICE processing; it | |
| | | is not a general technique for 1xx reliability. | |
| | | | |
| Alternatively, an agent MAY delay sending an answer until the 200 OK, | | Alternatively, an agent MAY delay sending an answer until the 200 OK, | |
| however this results in a poor user experience and is NOT | | however this results in a poor user experience and is NOT | |
| RECOMMENDED. | | RECOMMENDED. | |
| | | | |
| Once the answer has been sent, the agent SHOULD begin its | | Once the answer has been sent, the agent SHOULD begin its | |
| connectivity checks. Once candidate pairs for each component of a | | connectivity checks. Once candidate pairs for each component of a | |
|
| media stream enter the valid list, the callee can begin sending media | | media stream enter the valid list, the answerer can begin sending | |
| on that media stream. | | media on that media stream. | |
| | | | |
| However, prior to this point, any media that needs to be sent towards | | However, prior to this point, any media that needs to be sent towards | |
|
| the caller (such as SIP early media [25] cannot be transmitted. For | | the caller (such as SIP early media [26] MUST NOT be transmitted. | |
| this reason, implementations SHOULD delay alerting the called party | | For this reason, implementations SHOULD delay alerting the called | |
| until candidates for each component of each media stream have entered | | party until candidates for each component of each media stream have | |
| the valid list. In the case of a PSTN gateway, this would mean that | | entered the valid list. In the case of a PSTN gateway, this would | |
| the setup message into the PSTN is delayed until this point. Doing | | mean that the setup message into the PSTN is delayed until this | |
| this increases the post-dial delay, but has the effect of eliminating | | point. Doing this increases the post-dial delay, but has the effect | |
| 'ghost rings'. Ghost rings are cases where the called party hears | | of eliminating 'ghost rings'. Ghost rings are cases where the called | |
| the phone ring, picks up, but hears nothing and cannot be heard. | | party hears the phone ring, picks up, but hears nothing and cannot be | |
| This technique works without requiring support for, or usage of, | | heard. This technique works without requiring support for, or usage | |
| preconditions [6], since its a localized decision. It also has the | | of, preconditions [6], since its a localized decision. It also has | |
| benefit of guaranteeing that not a single packet of media will get | | the benefit of guaranteeing that not a single packet of media will | |
| clipped, so that post-pickup delay is zero. If an agent chooses to | | get clipped, so that post-pickup delay is zero. If an agent chooses | |
| delay local alerting in this way, it SHOULD generate a 180 response | | to delay local alerting in this way, it SHOULD generate a 180 | |
| once alerting begins. | | response once alerting begins. | |
| | | | |
| | | 12.1.2. Offer in Response | |
| | | | |
| In addition to uses where the offer is in an INVITE, and the answer | | In addition to uses where the offer is in an INVITE, and the answer | |
|
| is in the provisional and/or 200 OK, ICE works with cases where the | | is in the provisional and/or 200 OK response, ICE works with cases | |
| offer appears in the response. In such cases, which are common in | | where the offer appears in the response. In such cases, which are | |
| third party call control, ICE agents SHOULD generate their offers in | | common in third party call control [18], ICE agents SHOULD generate | |
| a reliable provisional response (which MUST utilize RFC 3262). In | | their offers in a reliable provisional response (which MUST utilize | |
| that case, the answer will arrive in a PRACK. This allows for ICE | | RFC 3262), and not alert the user on receipt of the INVITE. The | |
| processing to take place prior to alerting. Once ICE completes, the | | answer will arrive in a PRACK. This allows for ICE processing to | |
| agent can alert the user and then generate a 200 OK. The 200 OK | | take place prior to alerting, so that there is no post-pickup delay, | |
| would contain no SDP, since the offer/answer exchange has completed. | | at the expense of increased call setup delays. Once ICE completes, | |
| Agents MAY place the offer in a 2xx instead (in which case the answer | | the callee can alert the user and then generate a 200 OK when they | |
| comes in the ACK). This flow is simpler but results in a poorer user | | answer. The 200 OK would contain no SDP, since the offer/answer | |
| experience. | | exchange has completed. | |
| | | | |
|
| As discussed in Section 16, offer/answer exchanges SHOULD be secured | | Alternatively, agents MAY place the offer in a 2xx instead (in which | |
| against eavesdropping and man-in-the-middle attacks. To do that, the | | case the answer comes in the ACK). When this happens, the callee | |
| usage of SIPS [3] is RECOMMENDED when used in concert with ICE. | | will alert the user on receipt of the INVITE, and the ICE exchanges | |
| | | will take place only after the user answers. This has the 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 | | 12.2. SIP Option Tags and Media Feature Tags | |
| | | | |
|
| [13] specifies a SIP option tag and media feature tag for usage with | | [14] specifies a SIP option tag and media feature tag for usage with | |
| ICE. ICE implementations using SIP SHOULD support this | | ICE. ICE implementations using SIP SHOULD support this | |
| specification, which uses a feature tag in registrations to | | specification, which uses a feature tag in registrations to | |
|
| facilitate interoperability through gateways. | | facilitate interoperability through intermediaries. | |
| | | | |
| 12.3. Interactions with Forking | | 12.3. Interactions with Forking | |
| | | | |
| ICE interacts very well with forking. Indeed, ICE fixes some of the | | ICE interacts very well with forking. Indeed, ICE fixes some of the | |
| problems associated with forking. Without ICE, when a call forks and | | problems associated with forking. Without ICE, when a call forks and | |
| the caller receives multiple incoming media streams, it cannot | | the caller receives multiple incoming media streams, it cannot | |
| determine which media stream corresponds to which callee. | | determine which media stream corresponds to which callee. | |
| | | | |
| With ICE, this problem is resolved. The connectivity checks which | | With ICE, this problem is resolved. The connectivity checks which | |
| occur prior to transmission of media carry username fragments, which | | occur prior to transmission of media carry username fragments, which | |
| in turn are correlated to a specific callee. Subsequent media | | in turn are correlated to a specific callee. Subsequent media | |
|
| packets which arrive on the same 5-tuple as the connectivity check | | packets which arrive on the same candidate pair as the connectivity | |
| will be associated with that same callee. Thus, the caller can | | check will be associated with that same callee. Thus, the caller can | |
| perform this correlation as long as it has received an answer. | | perform this correlation as long as it has received an answer. | |
| | | | |
| 12.4. Interactions with Preconditions | | 12.4. Interactions with Preconditions | |
| | | | |
| Quality of Service (QoS) preconditions, which are defined in RFC 3312 | | Quality of Service (QoS) preconditions, which are defined in RFC 3312 | |
|
| [6] and RFC 4032 [7], apply only to the transport addresses listed in | | [6] and RFC 4032 [7], apply only to the transport addresses listed as | |
| the m/c lines in an offer/answer. If ICE changes the transport | | the default targets for media in an offer/answer. If ICE changes the | |
| address where media is received, this change is reflected in the m/c | | transport address where media is received, this change is reflected | |
| lines of a new offer/answer. As such, it appears like any other re- | | in an updated 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 | | INVITE would, and is fully treated in RFC 3312 and 4032, which apply | |
|
| without regard to the fact that the m/c lines are changing due to ICE | | without regard to the fact that the destination for media is changing | |
| negotiations ocurring "in the background". | | due to ICE negotiations occurring "in the background". | |
| | | | |
| Indeed, an agent SHOULD NOT indicate that Qos preconditions have been | | Indeed, an agent SHOULD NOT indicate that Qos preconditions have been | |
|
| met until the ICE checks have completed and selected the candidate | | met until the checks have completed and selected the candidate pairs | |
| pairs to be used for media. | | to be used for media. | |
| | | | |
| ICE also has (purposeful) interactions with connectivity | | ICE also has (purposeful) interactions with connectivity | |
|
| preconditions [27]. Those interactions are described there. Note | | preconditions [30]. Those interactions are described there. Note | |
| that the procedures described in Section 12.1 describe their own type | | that the procedures described in Section 12.1 describe their own type | |
| of "preconditions", albeit with less functionality than those | | of "preconditions", albeit with less functionality than those | |
|
| provided by the explicit preconditions in [27]. | | provided by the explicit preconditions in [30]. | |
| | | | |
| 12.5. Interactions with Third Party Call Control | | 12.5. Interactions with Third Party Call Control | |
| | | | |
|
| ICE works with Flows I, III and IV as described in [17]. Flow I | | ICE works with Flows I, III and IV as described in [18]. Flow I | |
| works without the controller supporting or being aware of ICE. Flow | | works without the controller supporting or being aware of ICE. Flow | |
| IV will work as long as the controller passes along the ICE | | IV will work as long as the controller passes along the ICE | |
| attributes without alteration. Flow II is fundamentally incompatible | | attributes without alteration. Flow II is fundamentally incompatible | |
| with ICE; each agent will believe itself to be the answerer and thus | | with ICE; each agent will believe itself to be the answerer and thus | |
| never generate a re-INVITE. | | never generate a re-INVITE. | |
| | | | |
| The flows for continued operation, as described in Section 7 of RFC | | The flows for continued operation, as described in Section 7 of RFC | |
| 3725, require additional behavior of ICE implementations to support. | | 3725, require additional behavior of ICE implementations to support. | |
| In particular, if an agent receives a mid-dialog re-INVITE that | | In particular, if an agent receives a mid-dialog re-INVITE that | |
| contains no offer, it MUST restart ICE for each media stream and go | | contains no offer, it MUST restart ICE for each media stream and go | |
| through the process of gathering new candidates. Furthermore, that | | through the process of gathering new candidates. Furthermore, that | |
|
| list of candidates SHOULD include the ones currently in-use. | | list of candidates SHOULD include the ones currently being used for | |
| | | media. | |
| | | | |
|
| 13. Grammar | | 13. Usage with ANAT | |
| | | | |
| | | RFC 4091 [11] defines a mechanism for indicating that an agent can | |
| | | support both IPv4 and IPv6 for a media stream, and it does so by | |
| | | including two m-lines, one for v4, and one for v6. This is similar | |
| | | to ICE, which allows for an agent to indicate multiple transport | |
| | | addresses using the candidate attribute. | |
| | | | |
| | | However, ICE is not a replacement for ANAT. When an agent has a v4 | |
| | | and 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 concert with | |
| | | ICE. To do that, The agent MUST include two media stream alternates, | |
| | | one for v4 and one for v6, as defined in RFC 4091. In addition, the | |
| | | agent MUST include a v4 candidate as a session attribute for the v4 | |
| | | stream alternate, and a v6 candidate as a session attribute of the v6 | |
| | | stream alternate. ICE will then perform its checks for each stream | |
| | | alternate. The agent MUST order the ICE selected pairs for each | |
| | | stream alternate based on their mid preference, and choose the | |
| | | highest one. This means that if ICE doesn't select any pair for a | |
| | | stream alternate (because, for example, no checks succeeded), the | |
| | | agent will choose the next highest preference pair which was | |
| | | selected. This allows v6 to be used if a 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 multiple v6 candidates for the v6 stream alternate. All of the | |
| | | candidates for a v4 stream alternate MUST be v4, and all of the | |
| | | candidates for a v6 stream alternate MUST be v6. This will cause ICE | |
| | | to choose a v6 pair as long as one of the pairs works, else it will | |
| | | fall back to v4. | |
| | | | |
| | | Of course, an agent can use ICE with v4 and v6 candidates without | |
| | | ANAT. In that mode, it would have just a single media stream, with a | |
| | | default destination that is either v4 or v6. The candidates can | |
| | | include both v4 and 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 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 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. | |
| | | | |
| | | First, 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 MUST include the token for that extension in this | |
| | | attribute. This allows each side to know what the other side is | |
| | | doing. This attribute 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 and extensions will be sufficiently common to warrrant a | |
| | | registry. | |
| | | | |
| | | One of the complications in achieving interoperability is that ICE | |
| | | relies on a distributed algorithm running on both agents to converge | |
| | | on an agreed set of candidate pairs. If the two agents run different | |
| | | algorithms, it can be difficult to guarantee convergence on the same | |
| | | candidate pairs. The regular nomination procedure described in | |
| | | Section 8 eliminates some of the tight coordination by delegating the | |
| | | selection algorithm completely to the controlling agent. | |
| | | Consequently, when a controlling agent is communicating with a peer | |
| | | that supports options it doesn't know about, the agent MUST 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 non-RTP media | |
| | | streams need to specify how many components they utilize, and assign | |
| | | component IDS to them, starting at 1 for the most important component | |
| | | ID. Specifications for new transport protocols must define how, if | |
| | | at all, various steps in the ICE processing differ from UDP. | |
| | | | |
| | | 15. Grammar | |
| | | | |
| This specification defines seven new SDP attributes - the | | This specification defines seven new SDP attributes - the | |
|
| "candidate", "remote-candidates", "ice-lite", "ice-ufrag", "ice-pwd" | | "candidate", "remote-candidates", "ice-lite", "ice-mismatch", "ice- | |
| "ice-options" and "ice-mismatch" attributes. | | ufrag", "ice-pwd" and "ice-options" attributes. | |
| | | | |
| | | 15.1. "candidate" Attribute | |
| | | | |
| The candidate attribute is a media-level attribute only. It contains | | The candidate attribute is a media-level attribute only. It contains | |
| a transport address for a candidate that can be used for connectivity | | a transport address for a candidate that can be used for connectivity | |
| checks. | | checks. | |
| | | | |
| The syntax of this attribute is defined using Augmented BNF as | | The syntax of this attribute is defined using Augmented BNF as | |
| defined in RFC 4234 [8]: | | defined in RFC 4234 [8]: | |
| | | | |
| candidate-attribute = "candidate" ":" foundation SP component-id SP | | candidate-attribute = "candidate" ":" foundation SP component-id SP | |
| transport SP | | transport SP | |
| priority SP | | priority SP | |
| connection-address SP ;from RFC 4566 | | connection-address SP ;from RFC 4566 | |
| port ;port from RFC 4566 | | port ;port from RFC 4566 | |
|
| [SP cand-type] | | SP cand-type | |
| [SP rel-addr] | | [SP rel-addr] | |
| [SP rel-port] | | [SP rel-port] | |
| *(SP extension-att-name SP | | *(SP extension-att-name SP | |
| extension-att-value) | | extension-att-value) | |
| | | | |
| foundation = 1*ice-char | | foundation = 1*ice-char | |
| component-id = 1*DIGIT | | component-id = 1*DIGIT | |
| transport = "UDP" / transport-extension | | transport = "UDP" / transport-extension | |
| transport-extension = token ; from RFC 3261 | | transport-extension = token ; from RFC 3261 | |
| priority = 1*DIGIT | | priority = 1*DIGIT | |
| cand-type = "typ" SP candidate-types | | cand-type = "typ" SP candidate-types | |
| candidate-types = "host" / "srflx" / "prflx" / "relay" / token | | candidate-types = "host" / "srflx" / "prflx" / "relay" / token | |
| rel-addr = "raddr" SP connection-address | | rel-addr = "raddr" SP connection-address | |
| rel-port = "rport" SP port | | rel-port = "rport" SP port | |
| extension-att-name = byte-string ;from RFC 4566 | | extension-att-name = byte-string ;from RFC 4566 | |
| extension-att-value = byte-string | | extension-att-value = byte-string | |
| ice-char = ALPHA / DIGIT / "+" / "/" | | ice-char = ALPHA / DIGIT / "+" / "/" | |
| | | | |
|
| The foundation is composed of one or more ice-char. The component-id | | This grammar encodes the primary information about a candidate: its | |
| is a positive integer, which identifies the specific component for | | IP address, port and transport protocol, and its properties: the | |
| which the transport address is a candidate. It MUST start at 1 and | | foundation, component ID, priority, type, and related transport | |
| MUST increment by 1 for each component of a particular candidate. | | address: | |
| The connect-address production is taken from RFC 4566 [10], allowing | | | |
| 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 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) [29]. | | | |
| | | | |
|
| The cand-type production encodes the type of candidate. This | | <connect-address>: is taken from RFC 4566 [10]. It is the IP | |
| specification defines the values "host", "srflx", "prflx" and "relay" | | address of the candidate, allowing for IPv4 addresses, IPv6 | |
| for host, server reflexive, peer reflexive and relayed candidates, | | 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 [10]. It is the port 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>. 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 foundation is used to optimize ICE performance in the | |
| | | Frozen algorithm. | |
| | | | |
| | | <component-id>: is a positive integer between 1 and 256 which | |
| | | identifies the specific component of the media stream for which | |
| | | this is a candidate. It MUST start at 1 and MUST increment by 1 | |
| | | for each component of a particular candidate. For media streams | |
| | | based on RTP, candidates for the 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 mapping of | |
| | | components to component IDs. See Section 14 for additional | |
| | | discussion on extending ICE to 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 | | respectively. The set of candidate types is extensible for the | |
|
| future. Inclusion of the candidate type is optional. The rel-addr | | future. | |
| and rel-port productions convey information the related transport | | | |
| addresses. Rules for inclusion of these values is described in | | | |
| Section 4.3. | | | |
| | | | |
|
| The a=candidate attribute can itself be extended. The grammar allows | | <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 is server or | |
| | | peer reflexive, <rel-addr> and <rel-port> is equal to the base for | |
| | | that server or peer reflexive candidate. If the candidate is | |
| | | relayed, <rel-addr> and <rel-port> is equal to the mapped address | |
| | | in 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 candidate attribute can itself be extended. The grammar allows | |
| for new name/value pairs to be added at the end of the attribute. An | | 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 | | implementation MUST ignore any name/value pairs it doesn't | |
| understand. | | understand. | |
| | | | |
|
| | | 15.2. "remote-candidates" Attribute | |
| | | | |
| The syntax of the "remote-candidates" attribute is defined using | | The syntax of the "remote-candidates" attribute is defined using | |
| Augmented BNF as defined in RFC 4234 [8]. The remote-candidates | | Augmented BNF as defined in RFC 4234 [8]. The remote-candidates | |
| attribute is a media level attribute only. | | attribute is a media level attribute only. | |
| | | | |
| remote-candidate-att = "remote-candidates" ":" remote-candidate | | remote-candidate-att = "remote-candidates" ":" remote-candidate | |
| 0*(SP remote-candidate) | | 0*(SP remote-candidate) | |
| remote-candidate = component-ID SP connection-address SP port | | remote-candidate = component-ID SP connection-address SP port | |
| | | | |
| The attribute contains a connection-address and port for each | | The attribute contains a connection-address and port for each | |
| component. The ordering of components is irrelevant. However, a | | component. The ordering of components is irrelevant. However, a | |
|
| value MUST be present for each component of a media stream. | | 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. | |
| | | | |
|
| The syntax of the "ice-lite" and "ice-mismatch", both of which are | | 15.3. "ice-lite" and "ice-mismatch" Attributes | |
| flags, is: | | | |
| | | The syntax of the "ice-lite" and "ice-mismatch" attributes, both of | |
| | | which are flags, is: | |
| | | | |
| ice-lite = "ice-lite" | | ice-lite = "ice-lite" | |
| ice-mismatch = "ice-mismatch" | | ice-mismatch = "ice-mismatch" | |
| | | | |
|
| "ice-lite" is a session level attribute only, and "ice-mismatch" is a | | "ice-lite" is a session level attribute only, and indicates that an | |
| media level attribute only. The syntax of the "ice-pwd" and "ice- | | agent is a lite implementation. "ice-mismatch" is a media level | |
| ufrag" attributes are defined as: | | attribute 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 "ice-ufrag" and "ice-pwd" attributes convey the username fragment | |
| | | and password used by ICE for message integrity. Their syntax is: | |
| | | | |
| ice-pwd-att = "ice-pwd" ":" password | | ice-pwd-att = "ice-pwd" ":" password | |
| ice-ufrag-att = "ice-ufrag" ":" ufrag | | ice-ufrag-att = "ice-ufrag" ":" ufrag | |
| password = 22*ice-char | | password = 22*ice-char | |
| ufrag = 4*ice-char | | ufrag = 4*ice-char | |
| | | | |
| The "ice-pwd" and "ice-ufrag" attributes can appear at either the | | 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 | | session-level or media-level. When present in both, the value in the | |
| media-level takes precedence. Thus, the value at the session level | | media-level takes precedence. Thus, the value at the session level | |
| is effectively a default that applies to all media streams, unless | | is effectively a default that applies to all media streams, unless | |
|
| overriden by a media-level value. | | overriden by a media-level value. Whether present at the session or | |
| | | media level, there MUST be an ice-pwd and ice-ufrag attribute for | |
| | | each media stream. If two media streams have identical ice-ufrag's, | |
| | | they MUST have identical ice-pwd's. | |
| | | | |
| | | The ice-ufrag 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 the ice-pwd attribute MUST contain | |
| | | at least 128 bits of randomness. This means that the ice-ufrag | |
| | | attribute will be at least 4 characters long, and the ice-pwd at | |
| | | least 22 characters long, since the grammar for these attributes | |
| | | allows for 6 bits of randomness per character. The 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 | | The "ice-options" attribute is a session level attribute. It | |
| contains a series of tokens which identify the options supported by | | contains a series of tokens which identify the options supported by | |
| the agent. Its grammar is: | | the agent. Its grammar is: | |
| | | | |
| ice-options = "ice-options" ":" ice-option-tag | | ice-options = "ice-options" ":" ice-option-tag | |
| 0*(SP ice-option-tag) | | 0*(SP ice-option-tag) | |
| ice-option-tag = 1*ice-char | | ice-option-tag = 1*ice-char | |
| | | | |
|
| 14. Extensibility Considerations | | 16. Example | |
| | | | |
| This specification makes very specific choices about how both agents | | | |
| in a session coordinate to arrive 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 MUST include the token for that extension in this | | | |
| attribute. This allows each side to know what the other side is | | | |
| doing. This attribute 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 | | The example is based on the simplified topology of Figure 15. | |
| for these option tags. At time of writing, it is unclear whether ICE | | | |
| changes and extensions will be sufficiently common to warrrant a | | | |
| registry. | | | |
| | | | |
|
| One of the complications in achieving interoperability is that ICE | | +-----+ | |
| relies on a distributed algorithm running on both agents to converge | | | | | |
| on an agreed set of candidate pairs. If the two agents run different | | |STUN | | |
| algorithms, it can be difficult to guarantee convergence on the same | | | Srvr| | |
| candidate pairs. The introspective selection procedure described in | | +-----+ | |
| Section 8 eliminates some of the tight coordination by delegating the | | | | |
| selection algorithm completely to the controlling agent. | | +---------------------+ | |
| Consequently, when a controlling agent is communicating with a peer | | | | | |
| that supports options it doesn't know about, the agent MUST run an | | | Internet | | |
| introspective selection algorithm. When introspective selection 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 favored pair is validated | | | | | |
| by both agents. Consequently, any future ICE enhancements MUST | | | | | |
| preserve triggered checks. | | +---------+ | | |
| | | | NAT | | | |
| | | +---------+ | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | +-----+ +-----+ | |
| | | | | | | | |
| | | | L | | R | | |
| | | | | | | | |
| | | +-----+ +-----+ | |
| | | | |
|
| 15. Example | | Figure 15: Example Topology | |
| | | | |
| Two agents, L and R, are using ICE. Both are full-mode ICE | | Two agents, L and R, are using ICE. Both are full-mode ICE | |
| implementations. Both agents have a single IPv4 interface. For | | implementations. Both agents have a single IPv4 interface. For | |
|
| agent L, it is 10.0.1.1, and for agent R, 192.0.2.1. Both are | | agent L, it is 10.0.1.1 in private address space [28], and for agent | |
| configured with a single STUN server each (indeed, the same one for | | R, 192.0.2.1 on the public Internet. Both are configured with the | |
| each), which is listening for STUN requests at an IP address of | | same STUN server (shown in this example for simplicity, although in | |
| 192.0.2.2 and port 3478. This STUN server supports only the Binding | | practice the agents do not need to use the same STUN server), which | |
| Discovery usage; relays are not used in this example. Agent L is | | is listening for STUN requests at an IP address of 192.0.2.2 and port | |
| behind a NAT, and agent R is on the public Internet. The NAT has an | | 3478. This STUN server supports only the Binding Discovery usage; | |
| endpoint independent mapping property and an address dependent | | relays are not used in this example. Agent L is behind a NAT, and | |
| filtering property. The public side of the NAT has an IP address of | | agent R is on the public Internet. The NAT has an endpoint | |
| 192.0.2.3. | | 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 | | To facilitate understanding, transport addresses are listed using | |
| variables that have mnemonic names. The format of the name is | | variables that have mnemonic names. The format of the name is | |
| entity-type-seqno, where entity refers to the entity whose interface | | entity-type-seqno, where entity refers to the entity whose interface | |
| the transport address is on, and is one of "L", "R", "STUN", or | | the transport address is on, and is one of "L", "R", "STUN", or | |
| "NAT". The type is either "PUB" for transport addresses that are | | "NAT". The type is either "PUB" for transport addresses that are | |
| public, and "PRIV" for transport addresses that are private. | | public, and "PRIV" for transport addresses that are private. | |
| Finally, seq-no is a sequence number that is different for each | | Finally, seq-no is a sequence number that is different for each | |
| transport address of the same type on a particular entity. Each | | transport address of the same type on a particular entity. Each | |
| variable has an IP address and port, denoted by varname.IP and | | variable has an IP address and port, denoted by varname.IP and | |
| | | | |
| skipping to change at page 51, line 29 | | skipping to change at page 69, line 8 | |
| |D=$R-PUB-1 | | | | | |D=$R-PUB-1 | | | | |
| |MA=$R-PUB-1 | | | | | |MA=$R-PUB-1 | | | | |
| |------------->| | | | | |------------->| | | | |
| | |(17) Bind Res | | | | | |(17) Bind Res | | | |
| | |S=$NAT-PUB-1 | | | | | |S=$NAT-PUB-1 | | | |
| | |D=$R-PUB-1 | | | | | |D=$R-PUB-1 | | | |
| | |MA=$R-PUB-1 | | | | | |MA=$R-PUB-1 | | | |
| | |---------------------------->| | | | |---------------------------->| | |
| | | | |RTP flows | | | | | |RTP flows | |
| | | | |
|
| Figure 11 | | Figure 16: Example Flow | |
| | | | |
| First, agent L obtains a host candidate from its local interface (not | | First, agent L obtains a host candidate from its local interface (not | |
| shown), and from that, sends a STUN Binding Request to the STUN | | shown), and from that, sends a STUN Binding Request to the STUN | |
| server to get a server reflexive candidate (messages 1-4). Recall | | server to get a server reflexive candidate (messages 1-4). Recall | |
| that the NAT has the address and port independent mapping property. | | 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 | | Here, it creates a binding of NAT-PUB-1 for this UDP request, and | |
| this becomes the server reflexive candidate for RTP. | | this becomes the server reflexive candidate for RTP. | |
| | | | |
| Agent L sets a type preference of 126 for the host candidate and 100 | | 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 | | for the server reflexive. The local preference is 65535. Based on | |
| this, the priority of the host candidate is 2130706178 and for the | | this, the priority of the host candidate is 2130706178 and for the | |
| server reflexive candidate is 1694498562. The host candidate is | | server reflexive candidate is 1694498562. The host candidate is | |
| assigned a foundation of 1, and the server reflexive, a foundation of | | assigned a foundation of 1, and the server reflexive, a foundation of | |
|
| 2. It chooses its server reflexive candidate as the in-use | | 2. It chooses its server reflexive candidate as the default | |
| candidate, and encodes it into the m/c-line. The resulting offer | | candidate, and encodes it into the m and c lines. The resulting | |
| (message 5) looks like (lines folded for clarity): | | offer (message 5) looks like (lines folded for clarity): | |
| | | | |
| v=0 | | v=0 | |
| o=jdoe 2890844526 2890842807 IN IP4 $L-PRIV-1.IP | | o=jdoe 2890844526 2890842807 IN IP4 $L-PRIV-1.IP | |
| s= | | s= | |
| c=IN IP4 $NAT-PUB-1.IP | | c=IN IP4 $NAT-PUB-1.IP | |
| t=0 0 | | t=0 0 | |
| a=ice-pwd:asd88fgpdd777uzjYhagZg | | a=ice-pwd:asd88fgpdd777uzjYhagZg | |
| a=ice-ufrag:8hhY | | a=ice-ufrag:8hhY | |
| m=audio $NAT-PUB-1.PORT RTP/AVP 0 | | m=audio $NAT-PUB-1.PORT RTP/AVP 0 | |
| a=rtpmap:0 PCMU/8000 | | a=rtpmap:0 PCMU/8000 | |
| | | | |
| skipping to change at page 52, line 38 | | skipping to change at page 70, line 22 | |
| m=audio 45664 RTP/AVP 0 | | m=audio 45664 RTP/AVP 0 | |
| a=rtpmap:0 PCMU/8000 | | a=rtpmap:0 PCMU/8000 | |
| a=candidate:1 1 UDP 2130706178 10.0.1.1 8998 typ local | | 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 | | a=candidate:2 1 UDP 1694498562 192.0.2.3 45664 typ srflx raddr | |
| 10.0.1.1 rport 8998 | | 10.0.1.1 rport 8998 | |
| | | | |
| This offer is received at agent R. Agent R will obtain a host | | This offer is received at agent R. Agent R will obtain a host | |
| candidate, and from it, obtain a server reflexive candidate (messages | | candidate, and from it, obtain a server reflexive candidate (messages | |
| 6-7). Since R is not behind a NAT, this candidate is identical to | | 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 | | its host candidate, and they share the same base. It therefore | |
|
| discards this candidate and ends up with a single host candidate. | | discards this redundant candidate and ends up with a single host | |
| With identical type and local preferences as L, the priority for this | | candidate. With identical type and local preferences as L, the | |
| candidate is 2130706178. It chooses a foundation of 1 for its single | | priority for this candidate is 2130706178. It chooses a foundation | |
| candidate. Its resulting answer looks like: | | of 1 for its single candidate. Its resulting answer looks like: | |
| | | | |
| v=0 | | v=0 | |
| o=bob 2808844564 2808844564 IN IP4 $R-PUB-1.IP | | o=bob 2808844564 2808844564 IN IP4 $R-PUB-1.IP | |
| s= | | s= | |
| c=IN IP4 $R-PUB-1.IP | | c=IN IP4 $R-PUB-1.IP | |
| t=0 0 | | t=0 0 | |
| a=ice-pwd:YH75Fviy6338Vbrhrlp8Yh | | a=ice-pwd:YH75Fviy6338Vbrhrlp8Yh | |
| a=ice-ufrag:9uB6 | | a=ice-ufrag:9uB6 | |
| m=audio $R-PUB-1.PORT RTP/AVP 0 | | m=audio $R-PUB-1.PORT RTP/AVP 0 | |
| a=rtpmap:0 PCMU/8000 | | a=rtpmap:0 PCMU/8000 | |
| | | | |
| skipping to change at page 53, line 19 | | skipping to change at page 71, line 4 | |
| v=0 | | v=0 | |
| o=bob 2808844564 2808844564 IN IP4 192.0.2.1 | | o=bob 2808844564 2808844564 IN IP4 192.0.2.1 | |
| s= | | s= | |
| c=IN IP4 192.0.2.1 | | c=IN IP4 192.0.2.1 | |
| t=0 0 | | t=0 0 | |
| a=ice-pwd:YH75Fviy6338Vbrhrlp8Yh | | a=ice-pwd:YH75Fviy6338Vbrhrlp8Yh | |
| a=ice-ufrag:9uB6 | | a=ice-ufrag:9uB6 | |
| m=audio 3478 RTP/AVP 0 | | m=audio 3478 RTP/AVP 0 | |
| a=rtpmap:0 PCMU/8000 | | a=rtpmap:0 PCMU/8000 | |
| a=candidate:1 1 UDP 2130706178 192.0.2.1 3478 typ local | | a=candidate:1 1 UDP 2130706178 192.0.2.1 3478 typ local | |
|
| | | Since neither side indicated that they are lite, the agent which sent | |
| Since neither side indicated that they are passive-only, the agent | | the offer that began ICE processing (agent L) becomes the controlling | |
| which sent the offer that began ICE processing (agent L) becomes the | | agent. | |
| controlling agent. | | | |
| | | | |
| Agents L and R both pair up the candidates. They both initially have | | Agents L and R both pair up the candidates. They both initially have | |
|
| two. However, agent L will prune the pair containing its server | | two pairs. However, agent L will prune the pair containing its | |
| reflexive candidate, resulting in just one. At agent L, this pair | | server reflexive candidate, resulting in just one. At agent L, this | |
| (the check) has a local candidate of $L_PRIV_1 and remote candidate | | pair has a local candidate of $L_PRIV_1 and remote candidate of | |
| of $R_PUB_1, and has a candidate pair priority of 4.57566E+18 (note | | $R_PUB_1, and has a candidate pair priority of 4.57566E+18 (note that | |
| that an implementation would represent this as a 64 bit integer so as | | an implementation would represent this as a 64 bit integer so as not | |
| not to lose precision). At agent R, there are two checks. The | | to lose precision). At agent R, there are two pairs. The highest | |
| highest priority has a local candidate of $R_PUB_1 and remote | | priority has a local candidate of $R_PUB_1 and remote candidate of | |
| candidate of $L_PRIV_1 and has a priority of 4.57566E+18, and the | | $L_PRIV_1 and has a priority of 4.57566E+18, and the second has a | |
| second has a local candidate of $R_PUB_1 and remote candidate of | | local candidate of $R_PUB_1 and remote candidate of $NAT_PUB_1 and | |
| $NAT_PUB_1 and priority 3.63891E+18. | | priority 3.63891E+18. | |
| | | | |
| Agent R begins its connectivity check (message 9) for the first pair | | Agent R begins its connectivity check (message 9) for the first pair | |
|
| (between the two host candidates). Since R is the passive agent for | | (between the two host candidates). Since R is the controlled agent | |
| this session, the check omits the USE-CANDIDATE attribute. The host | | for this session, the check omits the USE-CANDIDATE attribute. The | |
| candidate from agent L is private and behind a different NAT, and | | host candidate from agent L is private and behind a NAT, and thus | |
| thus this check is discarded. | | this check 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 | | When agent L gets the answer, it performs its one and only | |
|
| connectivity check (messages 10-13). It implements the default | | connectivity check (messages 10-13). It implements the aggressive | |
| algorithm for candidate selection, and thus includes a USE-CANDIDATE | | nomination algorithm, and thus includes a USE-CANDIDATE attribute in | |
| attribute in this check. Since the check succeeds, agent L creates a | | this check. Since the check succeeds, agent L creates a new pair, | |
| new pair, whose local candidate is from the mapped address in the | | whose local candidate is from the mapped address in the binding | |
| binding response (NAT-PUB-1 from message 13) and whose remote | | response (NAT-PUB-1 from message 13) and whose remote candidate is | |
| candidate is the destination of the request (R-PUB-1 from message | | the destination of the request (R-PUB-1 from message 10). This is | |
| 10). This is added to the valid list. In addition, it is marked as | | added to the valid list. In addition, it is marked as selected since | |
| selected since the Binding Request contained the USE-CANDIDATE | | the Binding Request contained the USE-CANDIDATE attribute. Since | |
| attribute. Since there is a selected candidate in the Valid list for | | there is a selected candidate in the Valid list for the one component | |
| the one component of this media stream, ICE processing for this | | of this media stream, ICE processing for this stream moves into the | |
| stream moves into the Completed state. Agent L can now send media if | | Completed state. Agent L can now send media if it so chooses. | |
| it so chooses. | | | |
| | | | |
|
| Upon receipt of the check from agent L (message 11), agent R will | | Upon receipt of the STUN Binding Request from agent L (message 11), | |
| generate its triggered check. This check happens to match the next | | agent R will generate its triggered check. This check happens to | |
| one on its check list - from its host candidate to agent L's server | | match the next one on its check list - from its host candidate to | |
| reflexive candidate. This check (messages 14-17) will succeed. | | agent L's server reflexive candidate. This check (messages 14-17) | |
| Consequently, agent R constructs a new candidate pair using the | | will succeed. Consequently, agent R constructs a new candidate pair | |
| mapped address from the response as the local candidate (R-PUB-1) and | | using the mapped address from the response as the local candidate | |
| the destination of the request (NAT-PUB-1) as the remote candidate. | | (R-PUB-1) and the destination of the request (NAT-PUB-1) as the | |
| This pair is added to the Valid list for that media stream. Since | | remote candidate. This pair is added to the Valid list for that | |
| the check was generated in the reverse direction of a check that | | media stream. Since the check was generated in the reverse direction | |
| contained the USE-CANDIDATE attribute, the candidate pair is marked | | of a check that contained the USE-CANDIDATE attribute, the candidate | |
| as selected. Consequently, processing for this stream moves into the | | pair is marked as selected. Consequently, processing for this stream | |
| Completed state, and agent R can also send media. | | moves into the Completed state, and agent R can also send media. | |
| | | | |
|
| 16. Security Considerations | | 17. Security Considerations | |
| | | | |
| There are several types of attacks possible in an ICE system. This | | There are several types of attacks possible in an ICE system. This | |
| section considers these attacks and their countermeasures. | | section considers these attacks and their countermeasures. | |
| | | | |
|
| 16.1. Attacks on Connectivity Checks | | 17.1. Attacks on Connectivity Checks | |
| | | | |
| An attacker might attempt to disrupt the STUN connectivity checks. | | An attacker might attempt to disrupt the STUN connectivity checks. | |
| Ultimately, all of these attacks fool an agent into thinking | | Ultimately, all of these attacks fool an agent into thinking | |
| something incorrect about the results of the connectivity checks. | | something incorrect about the results of the connectivity checks. | |
| The possible false conclusions an attacker can try and cause are: | | The possible false conclusions an attacker can try and cause are: | |
| | | | |
| False Invalid: An attacker can fool a pair of agents into thinking a | | 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 | | candidate pair is invalid, when it isn't. This can be used to | |
| cause an agent to prefer a different candidate (such as one | | cause an agent to prefer a different candidate (such as one | |
| injected by the attacker), or to disrupt a call by forcing all | | injected by the attacker), or to disrupt a call by forcing all | |
| | | | |
| skipping to change at page 55, line 13 | | skipping to change at page 72, line 41 | |
| the attacker, for eavesdropping or other purposes. | | the attacker, for eavesdropping or other purposes. | |
| | | | |
| False Valid on False Candidate: An attacker has already convinced an | | False Valid on False Candidate: An attacker has already convinced an | |
| agent that there is a candidate with an address that doesn't | | agent that there is a candidate with an address that doesn't | |
| actually route to that agent (for example, by injecting a false | | actually route to that agent (for example, by injecting a false | |
| peer reflexive candidate or false server reflexive candidate). It | | peer reflexive candidate or false server reflexive candidate). It | |
| must then launch an attack that forces the agents to believe that | | must then launch an attack that forces the agents to believe that | |
| this candidate is valid. | | this candidate is valid. | |
| | | | |
| Of the various techniques for creating faked STUN messages described | | Of the various techniques for creating faked STUN messages described | |
|
| in [11], many are not applicable for the connectivity checks. | | in [12], many are not applicable for the connectivity checks. | |
| Compromises of STUN servers are not much of a concern, since the STUN | | Compromises of STUN servers are not much of a concern, since the STUN | |
| servers are embedded in endpoints and distributed throughout the | | servers are embedded in endpoints and distributed throughout the | |
|
| network. Thus, compromising the STUN server is equivalent to | | network. Thus, compromising the peer's embedded STUN server is | |
| comprimising the endpoint, and if that happens, far more problematic | | equivalent to comprimising the endpoint, and if that happens, far | |
| attacks are possible than those against ICE. Similarly, DNS attacks | | more problematic attacks are possible than those against ICE. | |
| are usually irrelevant since STUN servers are not typically | | Similarly, DNS attacks are usually irrelevant since STUN servers are | |
| discovered via DNS, they are signaled via IP addresses embedded in | | not typically discovered via DNS, they are normally signaled via IP | |
| SDP. Injection of fake responses and relaying modified requests all | | addresses embedded in SDP. If the SDP does contain an FQDN for a | |
| can be handled in ICE with the countermeasures discussed below. | | 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 | | 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, | | connectivity check from one of the agents to be sent. When it is, | |
| the attacker needs to inject a fake response with an unrecoverable | | the attacker needs to inject a fake response with an unrecoverable | |
| error response, such as a 600. However, since the candidate is, in | | error response, such as a 600. However, since the candidate is, in | |
| fact, valid, the original request may reach the peer agent, and | | fact, valid, the original request may reach the peer agent, and | |
| result in a success response. The attacker needs to force this | | result in a success response. The attacker needs to force this | |
| packet or its response to be dropped, through a DoS attack, layer 2 | | 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 | | network disruption, or other technique. If it doesn't do this, the | |
| success response will also reach the originator, alerting it to a | | success response will also reach the originator, alerting it to a | |
| | | | |
| skipping to change at page 56, line 20 | | skipping to change at page 74, line 4 | |
| is different. The attacker waits until one of the agents sends a | | is different. The attacker waits until one of the agents sends a | |
| check. It intercepts this request, and replays it towards the other | | check. It intercepts this request, and replays it towards the other | |
| agent with a faked source IP address. It must also prevent the | | agent with a faked source IP address. It must also prevent the | |
| original request from reaching the remote agent, either by launching | | 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 | | 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 | | dropped using layer 2 mechanisms. The replayed packet is received at | |
| the other agent, and accepted, since the integrity check passes (the | | the other agent, and accepted, since the integrity check passes (the | |
| integrity check cannot and does not cover the source IP address and | | integrity check cannot and does not cover the source IP address and | |
| port). It is then responded to. This response will contain a XOR- | | port). It is then responded to. This response will contain a XOR- | |
| MAPPED-ADDRESS with the false candidate, and will be sent to that | | MAPPED-ADDRESS with the false candidate, and will be sent to that | |
|
| false candidate. The attacker must then intercept it and relay it | | false candidate. The attacker must then receive it and relay it | |
| towards the originator. | | towards the originator. | |
| | | | |
| The other agent will then initiate a connectivity check towards that | | The other agent will then initiate a connectivity check towards that | |
| false candidate. This validation needs to succeed. This requires | | false candidate. This validation needs to succeed. This requires | |
| the attacker to force a false valid on a false candidate. Injecting | | the attacker to force a false valid on a false candidate. Injecting | |
| of fake requests or responses to achieve this goal is prevented using | | of fake requests or responses to achieve this goal is prevented using | |
| the integrity mechanisms of STUN and the offer/answer exchange. | | the integrity mechanisms of STUN and the offer/answer exchange. | |
| Thus, this attack can only be launched through replays. To do that, | | Thus, this attack can only be launched through replays. To do that, | |
| the attacker must intercept the check towards this false candidate, | | the attacker must intercept the check towards this false candidate, | |
| and replay it towards the other agent. Then, it must intercept the | | and replay it towards the other agent. Then, it must intercept the | |
| response and replay that back as well. | | response and replay that back as well. | |
| | | | |
|
| This attack is very hard to launch unless the attacker themself is | | This attack is very hard to launch unless the attacker is identified | |
| identified by the fake candidate. This is because it requires the | | by the fake candidate. This is because it requires the attacker to | |
| attacker to intercept and replay packets sent by two different hosts. | | intercept and replay packets sent by two different hosts. If both | |
| If both agents are on different networks (for example, across the | | agents are on different networks (for example, across the public | |
| public Internet), this attack can be hard to coordinate, since it | | Internet), this attack can be hard to coordinate, since it needs to | |
| needs to occur against two different endpoints on different parts of | | occur against two different endpoints on different parts of the | |
| the network at the same time. | | network at the same time. | |
| | | | |
| If the attacker themself is identified by the fake candidate the | | If the attacker themself is identified by the fake candidate the | |
|
| attack is easier to coordinate. However, if SRTP is used [22], the | | attack is easier to coordinate. However, if SRTP is used [23], the | |
| attacker will not be able to play the media packets, they will only | | attacker will not be able to play the media packets, they will only | |
| be able to discard them, effectively disabling the media stream for | | be able to discard them, effectively disabling the media stream for | |
| the call. However, this attack requires the agent to disrupt packets | | the call. However, this attack requires the agent to disrupt packets | |
| in order to block the connectivity check from reaching the target. | | 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 | | 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 | | easier to just disrupt it with the same mechanism, rather than attack | |
| ICE. | | ICE. | |
| | | | |
|
| 16.2. Attacks on Address Gathering | | 17.2. Attacks on Address Gathering | |
| | | | |
|
| ICE endpoints make use of STUN for gathering candidates rom a STUN | | ICE endpoints make use of STUN for gathering candidates from a STUN | |
| server in the network. This is corresponds to the Binding Discovery | | server in the network. This is corresponds to the Binding Discovery | |
|
| usage of STUN described in [11]. As a consequence, the attacks | | usage of STUN described in [12]. As a consequence, the attacks | |
| against STUN itself that are described in that specification can | | against STUN itself that are described in that specification can | |
| still be used against the binding discovery usage when utilized with | | still be used against the binding discovery usage when utilized with | |
| ICE. | | ICE. | |
| | | | |
| However, the additional mechanisms provided by ICE actually | | However, the additional mechanisms provided by ICE actually | |
| counteract such attacks, making binding discovery with STUN more | | counteract such attacks, making binding discovery with STUN more | |
| secure when combined with ICE than without ICE. | | secure when combined with ICE than without ICE. | |
| | | | |
| Consider an attacker which is able to provide an agent with a faked | | 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 | | mapped address in a STUN Binding Request that is used for address | |
|
| gathering. This is the primary attack primitive described in [11]. | | gathering. This is the primary attack primitive described in [12]. | |
| This address will be used as a server reflexive candidate in the ICE | | This address will be used as a server reflexive candidate in the ICE | |
| exchange. For this candidate to actually be used for media, the | | exchange. For this candidate to actually be used for media, the | |
| attacker must also attack the connectivity checks, and in particular, | | attacker must also attack the connectivity checks, and in particular, | |
| force a false valid on a false candidate. This attack is very hard | | force a false valid on a false candidate. This attack is very hard | |
|
| to launch if the false address identifies a third party, and is | | to launch if the false address identifies a fourth party (neither the | |
| prevented by SRTP if it identifies the attacker themself. | | 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 | | If the attacker elects not to attack the connectivity checks, the | |
| worst it can do is prevent the server reflexive candidate from being | | 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 | | used. However, if the peer agent has at least one candidate that is | |
| reachable by the agent under attack, the STUN connectivity checks | | reachable by the agent under attack, the STUN connectivity checks | |
| themselves will provide a peer reflexive candidate that can be used | | themselves will provide a peer reflexive candidate that can be used | |
| for the exchange of media. Peer reflexive candidates are generally | | for the exchange of media. Peer reflexive candidates are generally | |
| preferred over server reflexive candidates. As such, an attack | | preferred over server reflexive candidates. As such, an attack | |
| solely on the STUN address gathering will normally have no impact on | | solely on the STUN address gathering will normally have no impact on | |
| a session at all. | | a session at all. | |
| | | | |
|
| 16.3. Attacks on the Offer/Answer Exchanges | | 17.3. Attacks on the Offer/Answer Exchanges | |
| | | | |
| An attacker that can modify or disrupt 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 | | themselves can readily launch a variety of attacks with ICE. They | |
| could direct media to a target of a DoS attack, they could insert | | 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 | | themselves into the media stream, and so on. These are similar to | |
| the general security considerations for offer/answer exchanges, and | | the general security considerations for offer/answer exchanges, and | |
| the security considerations in RFC 3264 [4] apply. These require | | the security considerations in RFC 3264 [4] apply. These require | |
| techniques for message integrity and encryption for offers and | | techniques for message integrity and encryption for offers and | |
| answers, which are satisfied by the SIPS mechanism [3] when SIP is | | answers, which are satisfied by the SIPS mechanism [3] when SIP is | |
| used. As such, the usage of SIPS with ICE is RECOMMENDED. | | used. As such, the usage of SIPS with ICE is RECOMMENDED. | |
| | | | |
|
| 16.4. Insider Attacks | | 17.4. Insider Attacks | |
| | | | |
| In addition to attacks where the attacker is a third party trying to | | In addition to attacks where the attacker is a third party trying to | |
| insert fake offers, answers or stun messages, there are several | | insert fake offers, answers or stun messages, there are several | |
| attacks possible with ICE when the attacker is an authenticated and | | attacks possible with ICE when the attacker is an authenticated and | |
| valid participant in the ICE exchange. | | valid participant in the ICE exchange. | |
| | | | |
|
| 16.4.1. The Voice Hammer Attack | | 17.4.1. The Voice Hammer Attack | |
| | | | |
| The voice hammer attack is an amplification attack. In this attack, | | The voice hammer attack is an amplification attack. In this attack, | |
|
| the attacker initiates sessions to other agents, and includes the IP | | the attacker initiates sessions to other agents, and maliciously | |
| address and port of a DoS target in the m/c-line of their SDP. This | | includes the IP address and port of a DoS target as the destination | |
| causes substantial amplification; a single offer/answer exchange can | | for media traffic signaled in the SDP. This causes substantial | |
| create a continuing flood of media packets, possibly at high rates | | amplification; a single offer/answer exchange can create a continuing | |
| (consider video sources). This attack is not specific to ICE, but | | flood of media packets, possibly at high rates (consider video | |
| ICE can help provide remediation. | | 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 | | Specifically, if ICE is used, the agent receiving the malicious SDP | |
|
| will first peform connectivity checks to the target of media before | | will first perform connectivity checks to the target of media before | |
| sending it there. If this target is a third party host, the checks | | sending media there. If this target is a third party host, the | |
| will not succeed, and media is never sent. | | checks will not succeed, and media is never sent. | |
| | | | |
| Unfortunately, ICE doesn't help if its not used, in which case an | | Unfortunately, ICE doesn't help if its not used, in which case an | |
| attacker could simply send the offer without the ICE parameters. | | attacker could simply send the offer without the ICE parameters. | |
| However, in environments where the set of clients are known, and | | However, in environments where the set of clients are known, and | |
| limited to ones that support ICE, the server can reject any offers or | | limited to ones that support ICE, the server can reject any offers or | |
| answers that don't indicate ICE support. | | answers that don't indicate ICE support. | |
| | | | |
|
| 16.4.2. STUN Amplification Attack | | 17.4.2. STUN Amplification Attack | |
| | | | |
| The STUN amplification attack is similar to the voice hammer. | | The STUN amplification attack is similar to the voice hammer. | |
| However, instead of voice packets being directed to the target, STUN | | However, instead of voice packets being directed to the target, STUN | |
|
| connectivity checks are directed to the target. This attack is | | connectivity checks are directed to the target. The attacker sends | |
| accomplished by having the offerer send an offer with a large number | | an offer with a large number of candidates, say 50. The answerer | |
| of candidates, say 50. The answerer receives the offer, and starts | | receives the offer, and starts its checks, which are directed at the | |
| its checks, which are directed at the target, and consequently, never | | target, and consequently, never generate a response. The answerer | |
| generate a response. The answerer will start a new connectivity | | will start a new connectivity check every 20ms, and each check is a | |
| check every 20ms, and each check is a STUN transaction consisting of | | STUN transaction consisting of 7 transmissions of a message 65 bytes | |
| 7 transmissions of a message 65 bytes in length (plus 28 bytes for | | in length (plus 28 bytes for the IP/UDP header) that runs for 7.9 | |
| the IP/UDP header) that runs for 7.9 seconds, for a total of 58 | | seconds, for a total of 58 bytes/second per transaction on average. | |
| bytes/second per transaction on average. In the worst case, there | | In the worst case, there can be 395 transactions in progress at once | |
| can be 395 transactions in progress at once (7.9 seconds divided by | | (7.9 seconds divided by 20ms), for a total of 182 kbps, just for STUN | |
| 20ms), for a total of 182 kbps, just for STUN requests. | | requests. | |
| | | | |
| It is impossible to eliminate the amplification, but the volume can | | It is impossible to eliminate the amplification, but the volume can | |
| be reduced through a variety of heuristics. Agents SHOULD limit the | | be reduced through a variety of heuristics. Agents SHOULD limit the | |
| total number of connectivity checks they perform to 100. | | total number of connectivity checks they perform to 100. | |
| Additionally, agents MAY limit the number of candidates they'll | | Additionally, agents MAY limit the number of candidates they'll | |
| accept in an offer or answer. | | accept in an offer or answer. | |
| | | | |
|
| 16.5. Interactions with Application Layer Gateways and SIP | | 17.5. Interactions with Application Layer Gateways and SIP | |
| | | | |
| Application Layer Gateways (ALGs) are functions present in a NAT | | Application Layer Gateways (ALGs) are functions present in a NAT | |
| device which inspect the contents of packets and modify them, in | | device which inspect the contents of packets and modify them, in | |
| order to facilitate NAT traversal for application protocols. Session | | order to facilitate NAT traversal for application protocols. Session | |
| Border Controllers (SBC) are close cousins of ALGs, but are less | | Border Controllers (SBC) are close cousins of ALGs, but are less | |
| transparent since they actually exist as application layer SIP | | transparent since they actually exist as application layer SIP | |
| intermediaries. ICE has interactions with SBCs and ALGs. | | intermediaries. ICE has interactions with SBCs and ALGs. | |
| | | | |
| If an ALG is SIP aware but not ICE aware, ICE will work through it as | | 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 | | long as the ALG correctly modifies the SDP. In this case, correctly | |
| case, correctly means that the ALG does not modify m/c-lines with | | means that the ALG does not modify the m and c lines or the rtcp | |
| external addresses. If the m/c-line contains internal addresses, but | | attribute if they contain external addresses. If they contain | |
| ones for which a public binding exists, the ALG replaces the internal | | internal addresses, the modification depends on the state of the ALG. | |
| address in the m/c-line with the public binding. Unfortunately, many | | If the ALG already has a binding established that maps an external | |
| ALG are known to work poorly in these corner cases. ICE does not try | | port to an internal IP address and port in m and c lines or rtcp | |
| to work around broken ALGs, as this is outside the scope of its | | attribute , the ALG uses that binding instead of creating a new one. | |
| functionality. ICE can help diagnose these conditions, which often | | Unfortunately, many ALG are known to work poorly in these corner | |
| show up as a mismatch between the set of candidates and the m/c-line. | | cases. ICE does not try to work around broken ALGs, as this is | |
| The a=ice-mismatch parameter is used for this purpose. | | 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 and c lines and rtcp attributes. The ice- | |
| | | mismatch attribute is used for this purpose. | |
| | | | |
| ICE works best through ALGs when the signaling is run over TLS. This | | ICE works best through ALGs when the signaling is run over TLS. This | |
| prevents the ALG from manipulating the SDP messages and interfering | | prevents the ALG from manipulating the SDP messages and interfering | |
| with ICE operation. Implementations which are expected to be | | with ICE operation. Implementations which are expected to be | |
| deployed behind ALGs SHOULD provide for TLS transport of the SDP. | | 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 | | 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 | | 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 | | Agent (B2BUA), the SBC will remove any SDP attributes it doesn't | |
| understand, including the ICE attributes. Consequently, the call | | understand, including the ICE attributes. Consequently, the call | |
| will appear to both endpoints as if the other side doesn't support | | will appear to both endpoints as if the other side doesn't support | |
| ICE. This will result in ICE being disabled, and media flowing | | ICE. This will result in ICE being disabled, and media flowing | |
|
| through the SBC, if they SBC has requested it. If, however, the SBC | | through the SBC, if the SBC has requested it. If, however, the SBC | |
| passes the ICE attributes without modification, yet modifies the m/c- | | passes the ICE attributes without modification, yet modifies the | |
| lines, this will be detected as an ICE mismatch, and ICE processing | | default destination for media (contained in the m and c lines and | |
| is aborted for the call. It is outside of the scope of ICE for it to | | rtcp attribute), this will be detected as an ICE mismatch, and ICE | |
| act as a tool for "working around" SBCs. If one is present, ICE will | | processing is aborted for the call. It is outside of the scope of | |
| not be used and the SBC techniques take precedence. | | 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. Definition of Connectivity Check Usage | | 18. Definition of Connectivity Check Usage | |
| | | | |
|
| STUN [11] requires that new usages provide a specific set of | | STUN [12] requires that new usages provide a specific set of | |
| information as part of their formal definition. This section meets | | information as part of their formal definition. This section meets | |
| the requirements spelled out there. | | the requirements spelled out there. | |
| | | | |
|
| 17.1. Applicability | | 18.1. Applicability | |
| | | | |
| This STUN usage provides a connectivity check between two peers | | This STUN usage provides a connectivity check between two peers | |
| participating in an offer/answer exchange. This check serves to | | participating in an offer/answer exchange. This check serves to | |
| validate a pair of candidates for usage of exchange of media. | | validate a pair of candidates for usage of exchange of media. | |
| Connectivity checks also allow agents to discover reflexive | | Connectivity checks also allow agents to discover reflexive | |
| candidates towards their peers, called peer reflexive candidates. | | candidates towards their peers, called peer reflexive candidates. | |
|
| Finally, connectivity checks serve to keep NAT bindings alive. | | Finally, 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 | | 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 | | used for media are the same ones used for the Binding Requests and | |
| responses. Consequently, it will be necessary to demultiplex STUN | | responses. Consequently, it will be necessary to demultiplex STUN | |
|
| traffic from whatever the media traffic is. This demultiplexing is | | traffic from applications on that same port (e.g., RTP or RTCP). | |
| done using the techniques described in [11]. | | This demultiplexing is done using the techniques described in [12]. | |
| | | | |
|
| 17.2. Client Discovery of Server | | 18.2. Client Discovery of Server | |
| | | | |
|
| The client does not follow the DNS-based procedures defined in [11]. | | The client does not follow the DNS-based procedures defined in [12]. | |
| Rather, the remote candidate of the check to be performed is used as | | 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 | | 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 | | is a logical entity, and is not a physically distinct server in this | |
| usage. | | usage. | |
| | | | |
|
| 17.3. Server Determination of Usage | | 18.3. Server Determination of Usage | |
| | | | |
|
| The server is aware of this usage because it signaled this port | | The server is aware of this usage because it signaled transport | |
| through the offer/answer exchange. Any STUN packets received on this | | addresses in its candidates on which it expects to receive STUN | |
| port will be for the connectivity check usage. | | packets. Consequently, any STUN packets received on the base of a | |
| | | candidate offered in SDP will be for the connectivity check usage. | |
| | | | |
|
| 17.4. New Requests or Indications | | 18.4. New Requests or Indications | |
| | | | |
| This usage does not define any new message types. | | This usage does not define any new message types. | |
| | | | |
|
| 17.5. New Attributes | | 18.5. New Attributes | |
| | | | |
| This usage defines two new attributes, PRIORITY and USE-CANDIDATE. | | This usage defines two new attributes, PRIORITY and USE-CANDIDATE. | |
| | | | |
| The PRIORITY attribute indicates the priority that is to be | | The PRIORITY attribute indicates the priority that is to be | |
| associated with a peer reflexive candidate, should one be discovered | | associated with a peer reflexive candidate, should one be discovered | |
| by this check. It is a 32 bit unsigned integer, and has an attribute | | by this check. It is a 32 bit unsigned integer, and has an attribute | |
|
| type of 0x0024. | | value of 0x0024. | |
| | | | |
| The USE-CANDIDATE attribute indicates that the candidate pair | | The USE-CANDIDATE attribute indicates that the candidate pair | |
| resulting from this check should be used for transmission of media. | | resulting from this check should be used for transmission of media. | |
| The attribute has no content (the Length field of the attribute is | | The attribute has no content (the Length field of the attribute is | |
|
| zero); it serves as a flag. It has an attribute type of 0x0025. | | zero); it serves as a flag. It has an attribute value of 0x0025. | |
| | | | |
|
| 17.6. New Error Response Codes | | 18.6. New Error Response Codes | |
| | | | |
| This usage does not define any new error response codes. | | This usage does not define any new error response codes. | |
| | | | |
|
| 17.7. Client Procedures | | 18.7. Client Procedures | |
| | | | |
| Client procedures are defined in Section 7.1. | | Client procedures are defined in Section 7.1. | |
| | | | |
|
| 17.8. Server Procedures | | 18.8. Server Procedures | |
| | | | |
| Server procedures are defined in Section 7.2. | | Server procedures are defined in Section 7.2. | |
| | | | |
|
| 17.9. Security Considerations for Connectivity Check | | 18.9. Security Considerations for Connectivity Check | |
| | | | |
| Security considerations for the connectivity check are discussed in | | Security considerations for the connectivity check are discussed in | |
|
| Section 16. | | Section 17. | |
| | | | |
|
| 18. IANA Considerations | | 19. IANA Considerations | |
| | | | |
| This specification registers new SDP attributes and new STUN | | This specification registers new SDP attributes and new STUN | |
| attributes. | | attributes. | |
| | | | |
|
| 18.1. SDP Attributes | | 19.1. SDP Attributes | |
| | | | |
| This specification defines seven new SDP attributes per the | | This specification defines seven new SDP attributes per the | |
| procedures of Section 8.2.4 of [10]. The required information for | | procedures of Section 8.2.4 of [10]. The required information for | |
| the registrations are included here. | | the registrations are included here. | |
| | | | |
|
| 18.1.1. candidate Attribute | | 19.1.1. candidate Attribute | |
| | | | |
| Contact Name: Jonathan Rosenberg, jdrosen@jdrosen.net. | | Contact Name: Jonathan Rosenberg, jdrosen@jdrosen.net. | |
| | | | |
| Attribute Name: candidate | | Attribute Name: candidate | |
| | | | |
| Long Form: candidate | | Long Form: candidate | |
| | | | |
| Type of Attribute: media level | | Type of Attribute: media level | |
| | | | |
| Charset Considerations: The attribute is not subject to the charset | | Charset Considerations: The attribute is not subject to the charset | |
| attribute. | | attribute. | |
| | | | |
| Purpose: This attribute is used with Interactive Connectivity | | Purpose: This attribute is used with Interactive Connectivity | |
| Establishment (ICE), and provides one of many possible candidate | | Establishment (ICE), and provides one of many possible candidate | |
| addresses for communication. These addresses are validated with | | addresses for communication. These addresses are validated with | |
| an end-to-end connectivity check using Simple Traversal Underneath | | an end-to-end connectivity check using Simple Traversal Underneath | |
| NAT (STUN). | | NAT (STUN). | |
| | | | |
|
| Appropriate Values: See Section 13 of RFC XXXX [Note to RFC-ed: | | Appropriate Values: See Section 15 of RFC XXXX [Note to RFC-ed: | |
| please replace XXXX with the RFC number of this specification]. | | please replace XXXX with the RFC number of this specification]. | |
| | | | |
|
| 18.1.2. remote-candidates Attribute | | 19.1.2. remote-candidates Attribute | |
| | | | |
| Contact Name: Jonathan Rosenberg, jdrosen@jdrosen.net. | | Contact Name: Jonathan Rosenberg, jdrosen@jdrosen.net. | |
| | | | |
| Attribute Name: remote-candidates | | Attribute Name: remote-candidates | |
|
| | | | |
| Long Form: remote-candidates | | Long Form: remote-candidates | |
| | | | |
| Type of Attribute: media level | | Type of Attribute: media level | |
| | | | |
| Charset Considerations: The attribute is not subject to the charset | | Charset Considerations: The attribute is not subject to the charset | |
| attribute. | | attribute. | |
| | | | |
| Purpose: This attribute is used with Interactive Connectivity | | Purpose: This attribute is used with Interactive Connectivity | |
| Establishment (ICE), and provides the identity of the remote | | Establishment (ICE), and provides the identity of the remote | |
| candidates that the offerer wishes the answerer to use in its | | candidates that the offerer wishes the answerer to use in its | |
| | | | |
| skipping to change at page 62, line 26 | | skipping to change at page 80, line 16 | |
| Type of Attribute: media level | | Type of Attribute: media level | |
| | | | |
| Charset Considerations: The attribute is not subject to the charset | | Charset Considerations: The attribute is not subject to the charset | |
| attribute. | | attribute. | |
| | | | |
| Purpose: This attribute is used with Interactive Connectivity | | Purpose: This attribute is used with Interactive Connectivity | |
| Establishment (ICE), and provides the identity of the remote | | Establishment (ICE), and provides the identity of the remote | |
| candidates that the offerer wishes the answerer to use in its | | candidates that the offerer wishes the answerer to use in its | |
| answer. | | answer. | |
| | | | |
|
| Appropriate Values: See Section 13 of RFC XXXX [Note to RFC-ed: | | Appropriate Values: See Section 15 of RFC XXXX [Note to RFC-ed: | |
| please replace XXXX with the RFC number of this specification]. | | please replace XXXX with the RFC number of this specification]. | |
| | | | |
|
| 18.1.3. ice-lite Attribute | | 19.1.3. ice-lite Attribute | |
| | | | |
| Contact Name: Jonathan Rosenberg, jdrosen@jdrosen.net. | | Contact Name: Jonathan Rosenberg, jdrosen@jdrosen.net. | |
| | | | |
| Attribute Name: ice-lite | | Attribute Name: ice-lite | |
| | | | |
| Long Form: ice-lite | | Long Form: ice-lite | |
| | | | |
| Type of Attribute: session level | | Type of Attribute: session level | |
| | | | |
| Charset Considerations: The attribute is not subject to the charset | | Charset Considerations: The attribute is not subject to the charset | |
| attribute. | | attribute. | |
| | | | |
| Purpose: This attribute is used with Interactive Connectivity | | Purpose: This attribute is used with Interactive Connectivity | |
| Establishment (ICE), and indicates that an agent has the minimum | | Establishment (ICE), and indicates that an agent has the minimum | |
| functionality required to support ICE inter-operation with a peer | | functionality required to support ICE inter-operation with a peer | |
| that has a full implementation. | | that has a full implementation. | |
| | | | |
|
| Appropriate Values: See Section 13 of RFC XXXX [Note to RFC-ed: | | Appropriate Values: See Section 15 of RFC XXXX [Note to RFC-ed: | |
| please replace XXXX with the RFC number of this specification]. | | please replace XXXX with the RFC number of this specification]. | |
| | | | |
|
| 18.1.4. ice-mismatch Attribute | | 19.1.4. ice-mismatch Attribute | |
| | | | |
| Contact Name: Jonathan Rosenberg, jdrosen@jdrosen.net. | | Contact Name: Jonathan Rosenberg, jdrosen@jdrosen.net. | |
| | | | |
| Attribute Name: ice-mismatch | | Attribute Name: ice-mismatch | |
| | | | |
| Long Form: ice-mismatch | | Long Form: ice-mismatch | |
| | | | |
| Type of Attribute: session level | | Type of Attribute: session level | |
|
| | | | |
| Charset Considerations: The attribute is not subject to the charset | | Charset Considerations: The attribute is not subject to the charset | |
| attribute. | | attribute. | |
| | | | |
| Purpose: This attribute is used with Interactive Connectivity | | Purpose: This attribute is used with Interactive Connectivity | |
| Establishment (ICE), and indicates that an agent is ICE capable, | | Establishment (ICE), and indicates that an agent is ICE capable, | |
| but did not proceed with ICE due to a mismatch of candidates with | | but did not proceed with ICE due to a mismatch of candidates with | |
|
| the values in the m/c-line. | | the default destination for media signaled in the SDP. | |
| | | | |
|
| Appropriate Values: See Section 13 of RFC XXXX [Note to RFC-ed: | | Appropriate Values: See Section 15 of RFC XXXX [Note to RFC-ed: | |
| please replace XXXX with the RFC number of this specification]. | | please replace XXXX with the RFC number of this specification]. | |
| | | | |
|
| 18.1.5. ice-pwd Attribute | | 19.1.5. ice-pwd Attribute | |
| | | | |
| Contact Name: Jonathan Rosenberg, jdrosen@jdrosen.net. | | Contact Name: Jonathan Rosenberg, jdrosen@jdrosen.net. | |
| | | | |
| Attribute Name: ice-pwd | | Attribute Name: ice-pwd | |
| | | | |
| Long Form: ice-pwd | | Long Form: ice-pwd | |
| | | | |
| Type of Attribute: session or media level | | Type of Attribute: session or media level | |
| | | | |
| Charset Considerations: The attribute is not subject to the charset | | Charset Considerations: The attribute is not subject to the charset | |
| attribute. | | attribute. | |
| | | | |
| Purpose: This attribute is used with Interactive Connectivity | | Purpose: This attribute is used with Interactive Connectivity | |
| Establishment (ICE), and provides the password used to protect | | Establishment (ICE), and provides the password used to protect | |
| STUN connectivity checks. | | STUN connectivity checks. | |
| | | | |
|
| Appropriate Values: See Section 13 of RFC XXXX [Note to RFC-ed: | | Appropriate Values: See Section 15 of RFC XXXX [Note to RFC-ed: | |
| please replace XXXX with the RFC number of this specification]. | | please replace XXXX with the RFC number of this specification]. | |
| | | | |
|
| 18.1.6. ice-ufrag Attribute | | 19.1.6. ice-ufrag Attribute | |
| | | | |
| Contact Name: Jonathan Rosenberg, jdrosen@jdrosen.net. | | Contact Name: Jonathan Rosenberg, jdrosen@jdrosen.net. | |
| | | | |
| Attribute Name: ice-ufrag | | Attribute Name: ice-ufrag | |
| | | | |
| Long Form: ice-ufrag | | Long Form: ice-ufrag | |
| | | | |
| Type of Attribute: session or media level | | Type of Attribute: session or media level | |
| | | | |
| Charset Considerations: The attribute is not subject to the charset | | Charset Considerations: The attribute is not subject to the charset | |
| attribute. | | attribute. | |
| | | | |
| Purpose: This attribute is used with Interactive Connectivity | | Purpose: This attribute is used with Interactive Connectivity | |
| Establishment (ICE), and provides the fragments used to construct | | Establishment (ICE), and provides the fragments used to construct | |
| the username in STUN connectivity checks. | | the username in STUN connectivity checks. | |
| | | | |
|
| Appropriate Values: See Section 13 of RFC XXXX [Note to RFC-ed: | | Appropriate Values: See Section 15 of RFC XXXX [Note to RFC-ed: | |
| please replace XXXX with the RFC number of this specification]. | | please replace XXXX with the RFC number of this specification]. | |
| | | | |
|
| 18.1.7. ice-options Attribute | | 19.1.7. ice-options Attribute | |
| | | | |
| Contact Name: Jonathan Rosenberg, jdrosen@jdrosen.net. | | Contact Name: Jonathan Rosenberg, jdrosen@jdrosen.net. | |
| | | | |
| Attribute Name: ice-options | | Attribute Name: ice-options | |
| | | | |
| Long Form: ice-options | | Long Form: ice-options | |
| | | | |
| Type of Attribute: session level | | Type of Attribute: session level | |
| | | | |
| Charset Considerations: The attribute is not subject to the charset | | Charset Considerations: The attribute is not subject to the charset | |
| attribute. | | attribute. | |
| | | | |
| Purpose: This attribute is used with Interactive Connectivity | | Purpose: This attribute is used with Interactive Connectivity | |
| Establishment (ICE), and indicates the ICE options or extensions | | Establishment (ICE), and indicates the ICE options or extensions | |
| used by the agent. | | used by the agent. | |
| | | | |
|
| Appropriate Values: See Section 13 of RFC XXXX [Note to RFC-ed: | | Appropriate Values: See Section 15 of RFC XXXX [Note to RFC-ed: | |
| please replace XXXX with the RFC number of this specification]. | | please replace XXXX with the RFC number of this specification]. | |
| | | | |
|
| 18.2. STUN Attributes | | 19.2. STUN Attributes | |
| | | | |
| This section registers two new STUN attributes per the procedures in | | This section registers two new STUN attributes per the procedures in | |
|
| [11]. | | [12]. | |
| | | | |
| 0x0024 PRIORITY | | 0x0024 PRIORITY | |
| 0x0025 USE-CANDIDATE | | 0x0025 USE-CANDIDATE | |
| | | | |
|
| 19. IAB Considerations | | 20. IAB Considerations | |
| | | | |
| The IAB has studied the problem of "Unilateral Self Address Fixing", | | The IAB has studied the problem of "Unilateral Self Address Fixing", | |
| which is the general process by which a agent attempts to determine | | 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 | | its address in another realm on the other side of a NAT through a | |
|
| collaborative protocol reflection mechanism [20]. ICE is an example | | collaborative protocol reflection mechanism [21]. ICE is an example | |
| of a protocol that performs this type of function. Interestingly, | | of a protocol that performs this type of function. Interestingly, | |
| the process for ICE is not unilateral, but bilateral, and the | | the process for ICE is not unilateral, but bilateral, and the | |
| difference has a signficant impact on the issues raised by IAB. | | difference has a signficant impact on the issues raised by IAB. | |
| Indeed, ICE can be considered a B-SAF (Bilateral Self-Address Fixing) | | Indeed, ICE can be considered a B-SAF (Bilateral Self-Address Fixing) | |
| protocol, rather than an UNSAF protocol. Regardless, the IAB has | | protocol, rather than an UNSAF protocol. Regardless, the IAB has | |
| mandated that any protocols developed for this purpose document a | | mandated that any protocols developed for this purpose document a | |
| specific set of considerations. This section meets those | | specific set of considerations. This section meets those | |
| requirements. | | requirements. | |
| | | | |
|
| 19.1. Problem Definition | | 20.1. Problem Definition | |
| | | | |
| From RFC 3424 any UNSAF proposal must provide: | | From RFC 3424 any UNSAF proposal must provide: | |
| | | | |
| Precise definition of a specific, limited-scope problem that is to | | Precise definition of a specific, limited-scope problem that is to | |
| be solved with the UNSAF proposal. A short term fix should not be | | be solved with the UNSAF proposal. A short term fix should not be | |
| generalized to solve other problems; this is why "short term fixes | | generalized to solve other problems; this is why "short term fixes | |
| usually aren't". | | usually aren't". | |
| | | | |
| The specific problems being solved by ICE are: | | The specific problems being solved by ICE are: | |
| | | | |
| Provide a means for two peers to determine the set of transport | | Provide a means for two peers to determine the set of transport | |
| addresses which can be used for communication. | | addresses which can be used for communication. | |
| | | | |
| Provide a means for resolving many of the limitations of other | | Provide a means for resolving many of the limitations of other | |
| UNSAF mechanisms by wrapping them in an additional layer of | | UNSAF mechanisms by wrapping them in an additional layer of | |
| processing (the ICE methodology). | | processing (the ICE methodology). | |
| | | | |
| Provide a means for a agent to determine an address that is | | Provide a means for a agent to determine an address that is | |
| reachable by another peer with which it wishes to communicate. | | reachable by another peer with which it wishes to communicate. | |
| | | | |
|
| 19.2. Exit Strategy | | 20.2. Exit Strategy | |
| | | | |
| From RFC 3424, any UNSAF proposal must provide: | | From RFC 3424, any UNSAF proposal must provide: | |
| | | | |
| Description of an exit strategy/transition plan. The better short | | Description of an exit strategy/transition plan. The better short | |
| term fixes are the ones that will naturally see less and less use | | term fixes are the ones that will naturally see less and less use | |
| as the appropriate technology is deployed. | | as the appropriate technology is deployed. | |
| | | | |
| ICE itself doesn't easily get phased out. However, it is useful even | | 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 | | in a globally connected Internet, to serve as a means for detecting | |
| whether a router failure has temporarily disrupted connectivity, for | | whether a router failure has temporarily disrupted connectivity, for | |
| | | | |
| skipping to change at page 66, line 20 | | skipping to change at page 84, line 5 | |
| used, because higher priority connectivity exists to the native host | | used, because higher priority connectivity exists to the native host | |
| candidates. Therefore, the servers get used less and less, and can | | candidates. Therefore, the servers get used less and less, and can | |
| eventually be remove when their usage goes to zero. | | eventually be remove when their usage goes to zero. | |
| | | | |
| Indeed, ICE can assist in the transition from IPv4 to IPv6. It can | | 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 | | 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 | | hosts communicate with SIP (IPv6 gets used). It can also allow a | |
| network with both 6to4 and native v6 connectivity to determine which | | network with both 6to4 and native v6 connectivity to determine which | |
| address to use when communicating with a peer. | | address to use when communicating with a peer. | |
| | | | |
|
| 19.3. Brittleness Introduced by ICE | | 20.3. Brittleness Introduced by ICE | |
| | | | |
| From RFC3424, any UNSAF proposal must provide: | | From RFC3424, any UNSAF proposal must provide: | |
| | | | |
| Discussion of specific issues that may render systems more | | Discussion of specific issues that may render systems more | |
| "brittle". For example, approaches that involve using data at | | "brittle". For example, approaches that involve using data at | |
| multiple network layers create more dependencies, increase | | multiple network layers create more dependencies, increase | |
| debugging challenges, and make it harder to transition. | | debugging challenges, and make it harder to transition. | |
| | | | |
| ICE actually removes brittleness from existing UNSAF mechanisms. In | | ICE actually removes brittleness from existing UNSAF mechanisms. In | |
|
| particular, traditional STUN (as described in RFC 3489 [14]) has | | particular, traditional STUN (as described in RFC 3489 [15]) has | |
| several points of brittleness. One of them is the discovery process | | 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 | | which requires a agent to try and classify the type of NAT it is | |
| behind. This process is error-prone. With ICE, that discovery | | behind. This process is error-prone. With ICE, that discovery | |
| process is simply not used. Rather than unilaterally assessing the | | process is simply not used. Rather than unilaterally assessing the | |
| validity of the address, its validity is dynamically determined by | | validity of the address, its validity is dynamically determined by | |
| measuring connectivity to a peer. The process of determining | | measuring connectivity to a peer. The process of determining | |
| connectivity is very robust. | | connectivity is very robust. | |
| | | | |
| Another point of brittleness in traditional STUN and any other | | Another point of brittleness in traditional STUN and any other | |
| unilateral mechanism is its absolute reliance on an additional | | unilateral mechanism is its absolute reliance on an additional | |
| | | | |
| skipping to change at page 67, line 17 | | skipping to change at page 84, line 49 | |
| shared NAT between each agent and the STUN server, traditional STUN | | shared NAT between each agent and the STUN server, traditional STUN | |
| may not work. With ICE, that restriction is removed. | | may not work. With ICE, that restriction is removed. | |
| | | | |
| Traditional STUN also introduces some security considerations. | | Traditional STUN also introduces some security considerations. | |
| Fortunately, those security considerations are also mitigated by ICE. | | Fortunately, those security considerations are also mitigated by ICE. | |
| | | | |
| Consequently, ICE serves to repair the brittleness introduced in | | Consequently, ICE serves to repair the brittleness introduced in | |
| other UNSAF mechanisms, and does not introduce any additional | | other UNSAF mechanisms, and does not introduce any additional | |
| brittleness into the system. | | brittleness into the system. | |
| | | | |
|
| 19.4. Requirements for a Long Term Solution | | 20.4. Requirements for a Long Term Solution | |
| | | | |
| From RFC 3424, any UNSAF proposal must provide: | | From RFC 3424, any UNSAF proposal must provide: | |
| | | | |
| Identify requirements for longer term, sound technical solutions | | Identify requirements for longer term, sound technical solutions | |
| -- contribute to the process of finding the right longer term | | -- contribute to the process of finding the right longer term | |
| solution. | | solution. | |
| | | | |
| Our conclusions from STUN remain unchanged. However, we feel ICE | | Our conclusions from STUN remain unchanged. However, we feel ICE | |
| actually helps because we believe it can be part of the long term | | actually helps because we believe it can be part of the long term | |
| solution. | | solution. | |
| | | | |
|
| 19.5. Issues with Existing NAPT Boxes | | 20.5. Issues with Existing NAPT Boxes | |
| | | | |
| From RFC 3424, any UNSAF proposal must provide: | | From RFC 3424, any UNSAF proposal must provide: | |
| | | | |
| Discussion of the impact of the noted practical issues with | | Discussion of the impact of the noted practical issues with | |
| existing, deployed NA[P]Ts and experience reports. | | existing, deployed NA[P]Ts and experience reports. | |
| | | | |
| A number of NAT boxes are now being deployed into the market which | | A number of NAT boxes are now being deployed into the market which | |
| try and provide "generic" ALG functionality. These generic ALGs hunt | | try and provide "generic" ALG functionality. These generic ALGs hunt | |
| for IP addresses, either in text or binary form within a packet, and | | for IP addresses, either in text or binary form within a packet, and | |
| rewrite them if they match a binding. This interferes with | | rewrite them if they match a binding. This interferes with | |
|
| traditional STUN. However, the update to STUN [11] uses an encoding | | tradit |