What are STUN and TURN in SIP?

SIP Trunking FAQs > What are STUN and TURN in SIP?

Answer

STUN and TURN are two essential protocols that ensure your SIP softphone (like CommPeak’s Softphone) can successfully make and receive calls when your device is behind a router or firewall. They work together to overcome common network restrictions.

📘

NOTE

Check the Network Options section of the following guides to learn how to enable STUN and TURN protocols in different CommPeak Softphone options to enjoy clear audio and uninterrupted calls from anywhere:

🧊STUN (Session Traversal Utilities for NAT)

STUN's goal is to help your softphone figure out its public address on the internet.

FeatureExplanation
What it doesIt's a lightweight tool that tells your SIP softphone exactly how it looks to the outside world (its public IP address and port).
Why it mattersThis information is crucial for call setup. It allows the SIP softphone to tell the person you are calling where to send the voice data (RTP stream).
The benefitsWhen STUN works, the voice traffic can flow directly between the two callers (peer-to-peer), resulting in the fastest, clearest audio.
The drawbackSTUN only works with certain "friendly" types of NATs (Network Address Translation). It fails when facing very strict or symmetric NATs or restrictive firewalls.

🔄 TURN (Traversal Using Relays around NAT)

TURN's goal is to guarantee media flow when a direct connection is impossible.

FeatureExplanation
What it doesTURN acts as a relay server for your voice traffic. It is used as a necessary fallback when the simpler STUN method fails because of strict NATs or firewalls.
Why it mattersThe SIP softphone is instructed to send all voice traffic through the dedicated TURN server instead of trying to send it directly. This guarantees that the media stream flows and the call connects.
The benefitsConnection reliability is much higher. This ensures your calls work smoothly in the most restrictive environments (e.g., corporate networks, strict mobile hotspots).
The drawbackSince voice packets must travel an extra hop through the TURN server, there might be a slight increase in latency and bandwidth usage.

Enabling STUN and TURN in your softphone is crucial for reliable voice communication, especially when you're working remotely or traveling.

📘

NOTE

Please check the Why Enable STUN/TURN in CommPeak Softphone? article for more details about the benefits of enabling STUN and TURN in your Softphone app.