-
Gather Public IP Information
Device behind NAT asks the Twilio STUN server to inform it what public IP and port it appears as to the rest of the world.
-
Public IP Returned & Relay Option Assigned
Twilio confirms how the device's local network's NAT has translated the device's private IP, and also issues a public IP TURN media relay option for use in case it's needed.
-
Direct Connectivity Test
Device shares the candidate IP/port to try direct streaming over by signaling it in SDP. Far end initiates a connectivity test to that IP to establish if peer‑to‑peer is possible.
-
Successful Peer‑to‑Peer Connection
If devices are able to contact each other directly through the candidate STUN returned, session is set up with direct media.
-
TURN Relay Connection
If devices are not able to connect to each other directly due to symmetric NAT or other issues, the SDP negotiates use of the offered TURN media relay IP so media relays through the geographically nearest relay point.
Features
NAT Traversal
Twilio provides the behind‑the‑scenes infrastructure so you can focus on building your app, rather than building a global media relay framework to traverse around firewalls.
Global, Scalable STUN
The first step in negotiating the connection for two WebRTC endpoints is STUN (Session Traversal Utilities for NAT), and around 85% of the time that’s all you need to get your media to flow directly. Twilio provides unlimited highly reliable STUN lookups for free, so your peer‑to‑peer calls are always free.
TURN Media Relay
When media cannot be routed peer‑to‑peer, Twilio provides you a TURN (Traversal Using Relay NAT) Media Relay point, ensuring your media can be routed through symmetric NATs and other enterprise grade firewall scenarios.
Latency Optimized
With relay points deployed in nine different regions around the globe, Geo‑DNS resolution makes sure your media is always routed with the lowest latency possible.
Developers that can benefit from Network Traversal Service
If you're building real‑time communications, whether you're using WebRTC, softphones or building your own stack, here's how Twilio helps you build a better service, faster.
Get Started Now
Simple pricing. Global Availability. Elastic Scaling. Free STUN. Better Communication.