ICE - Interactive Connectivity Establishment =============================================== .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow **What is ICE?** ICE is a framework used in real-time communication protocols (like WebRTC and VoIP) to find the best path for media streams (audio, video, data) between two peers. It helps devices behind NATs (Network Address Translators) and firewalls establish a direct connection. .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow **Why is ICE useful?** * Enables peer-to-peer communication even when devices are behind NATs or firewalls * Improves connection reliability by trying multiple network paths * Optimizes media quality by selecting the fastest and most stable route * Supports fallback to relay servers (TURN) if direct connection fails .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow **How it works?** * **Candidate Gathering** – Each peer collects possible IP addresses and ports (called “candidates”) from local interfaces, STUN, and TURN servers * **Candidate Exchange** – Peers exchange their candidates via signaling (e.g., SDP in WebRTC) * **Connectivity Checks** – Peers test each candidate pair using STUN to see which paths work * **Nomination** – The best working candidate pair is selected for communication * **Connection Established** – Media/data flows through the selected path .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow **Where is ICE used?** * WebRTC applications – Video conferencing, screen sharing, and real-time chat * VoIP systems – SIP-based voice and video calls * Online gaming – Peer-to-peer multiplayer connections * IoT and smart devices – Secure and efficient device-to-device communication .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow **Which OSI layer does ICE belong to?** * ICE is implemented in application-level protocols like WebRTC and SIP * It interacts with signaling protocols and uses STUN/TURN at the transport layer * It belongs to the **Application Layer (Layer 7)** of the OSI model .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow Topics in this section, * :ref:`Learnings in this section ` * :ref:`Terminology ` * :ref:`Version Info ` * :ref:`ICE Version&RFC Details ` * :ref:`ICE Basic Setup on Ubuntu using IPv4 ` * :ref:`ICE Basic Setup on Ubuntu using IPv6 ` * :ref:`ICE Protocol Packet Details ` * :ref:`ICE Usecases ` * :ref:`ICE Basic Features ` * :ref:`ICE Feature : Candidate Gathering ` * :ref:`ICE Feature : Candidate Prioritization ` * :ref:`ICE Feature : Candidate Pairing ` * :ref:`ICE Feature : Connectivity Checks ` * :ref:`ICE Feature : Nomination ` * :ref:`ICE Feature : NAT Traversal ` * :ref:`ICE Feature : STUN Integration ` * :ref:`ICE Feature : TURN Integration ` * :ref:`ICE Feature : Consent Freshness ` * :ref:`ICE Feature : Trickle ICE Support ` * :ref:`Reference links ` .. _ICE_step1: .. tab-set:: .. tab-item:: Learnings in this section * In this section, you are going to learn .. _ICE_step2: .. tab-set:: .. tab-item:: Terminology * Terminology .. _ICE_step3: .. tab-set:: .. tab-item:: Version Info * Version Info .. _ICE_step5: .. tab-set:: .. tab-item:: ICE Version&RFC Details .. csv-table:: :file: ./ICE/ICE_RFC_Details.csv :widths: 1,10,10,10,30 :header-rows: 1 .. _ICE_step19: .. tab-set:: .. tab-item:: ICE Basic Setup on Ubuntu using IPv4 * Setup .. _ICE_step20: .. tab-set:: .. tab-item:: ICE Basic Setup on Ubuntu using IPv6 * Setup .. _ICE_step6: .. tab-set:: .. tab-item:: ICE Protocol Packet Details **STUN Binding Request** .. csv-table:: :file: ./ICE/ICE_Protocol_Packet_1.csv :widths: 10,20,30,10 :header-rows: 1 **STUN Binding Response** .. csv-table:: :file: ./ICE/ICE_Protocol_Packet_2.csv :widths: 10,20,30,10 :header-rows: 1 **STUN Binding Error** .. csv-table:: :file: ./ICE/ICE_Protocol_Packet_3.csv :widths: 10,20,30,10 :header-rows: 1 **Candidate Exchange (SDP)** .. csv-table:: :file: ./ICE/ICE_Protocol_Packet_4.csv :widths: 10,20,30,10 :header-rows: 1 **Connectivity Check** .. csv-table:: :file: ./ICE/ICE_Protocol_Packet_5.csv :widths: 10,20,30,10 :header-rows: 1 **Nomination Packet** .. csv-table:: :file: ./ICE/ICE_Protocol_Packet_6.csv :widths: 10,20,30,10 :header-rows: 1 **TURN Allocation Request** .. csv-table:: :file: ./ICE/ICE_Protocol_Packet_7.csv :widths: 10,20,30,10 :header-rows: 1 **TURN Data Packet** .. csv-table:: :file: ./ICE/ICE_Protocol_Packet_8.csv :widths: 10,20,30,10 :header-rows: 1 **Keep-Alive Packet** .. csv-table:: :file: ./ICE/ICE_Protocol_Packet_9.csv :widths: 10,20,30,10 :header-rows: 1 **Consent Freshness Check** .. csv-table:: :file: ./ICE/ICE_Protocol_Packet_10.csv :widths: 10,20,30,10 :header-rows: 1 .. _ICE_step7: .. tab-set:: .. tab-item:: ICE Usecases .. csv-table:: :file: ./ICE/ICE_Usecases.csv :widths: 10,20,30 :header-rows: 1 .. _ICE_step8: .. tab-set:: .. tab-item:: ICE Basic Features .. csv-table:: :file: ./ICE/ICE_Features.csv :widths: 10,10,30 :header-rows: 1 .. _ICE_step9: .. tab-set:: .. tab-item:: ICE Feature : Candidate Gathering **Candidate Gathering - Testcases** .. csv-table:: :file: ./ICE/ICE_Feature_1_Candidate_Gathering_Testcase.csv :widths: 10,10,30,20 :header-rows: 1 .. _ICE_step10: .. tab-set:: .. tab-item:: ICE Feature : Candidate Prioritization **Candidate Prioritization - Testcases** .. csv-table:: :file: ./ICE/ICE_Feature_2_Candidate_Prioritization_Testcase.csv :widths: 10,10,30,20 :header-rows: 1 .. _ICE_step11: .. tab-set:: .. tab-item:: ICE Feature : Candidate Pairing **Candidate Pairing - Testcases** .. csv-table:: :file: ./ICE/ICE_Feature_3_Candidate_Pairing_Testcase.csv :widths: 10,10,30,20 :header-rows: 1 .. _ICE_step12: .. tab-set:: .. tab-item:: ICE Feature : Connectivity Checks **Connectivity Checks - Testcases** .. csv-table:: :file: ./ICE/ICE_Feature_4_Connectivity_Checks_Testcase.csv :widths: 10,10,30,20 :header-rows: 1 .. _ICE_step13: .. tab-set:: .. tab-item:: ICE Feature : Nomination **Nomination - Testcases** .. csv-table:: :file: ./ICE/ICE_Feature_5_Nomination_Testcase.csv :widths: 10,10,30,20 :header-rows: 1 .. _ICE_step14: .. tab-set:: .. tab-item:: ICE Feature : NAT Traversal **NAT Traversal - Testcases** .. csv-table:: :file: ./ICE/ICE_Feature_6_NAT_Traversal_Testcase.csv :widths: 10,10,30,20 :header-rows: 1 .. _ICE_step15: .. tab-set:: .. tab-item:: ICE Feature : STUN Integration **STUN Integration - Testcases** .. csv-table:: :file: ./ICE/ICE_Feature_7_STUN_Integration_Testcase.csv :widths: 10,10,30,20 :header-rows: 1 .. _ICE_step16: .. tab-set:: .. tab-item:: ICE Feature : TURN Integration **TURN Integration - Testcases** .. csv-table:: :file: ./ICE/ICE_Feature_8_TURN_Integration_Testcase.csv :widths: 10,10,30,20 :header-rows: 1 .. _ICE_step17: .. tab-set:: .. tab-item:: ICE Feature : Consent Freshness **Consent Freshness - Testcases** .. csv-table:: :file: ./ICE/ICE_Feature_9_Consent_Freshness_Testcase.csv :widths: 10,10,30,20 :header-rows: 1 .. _ICE_step18: .. tab-set:: .. tab-item:: ICE Feature : Trickle ICE Support **Trickle ICE Support - Testcases** .. csv-table:: :file: ./ICE/ICE_Feature_10_Trickle_ICE_Support_Testcase.csv :widths: 10,10,30,20 :header-rows: 1 .. _ICE_step21: .. tab-set:: .. tab-item:: Reference links * Reference links