Your browser does not support JavaScript!
Home » Blog » What is a STUN Server?

What is a STUN Server?

What is a STUN server?

When troubleshooting audio quality issues, you’ll probably hear people suggest using a STUN server.

Here’s a brief look at what STUN servers are, what they do, and how they can help improve the quality of VoIP calls.

STUN Servers and VoIP: What’s the Connection?

Network Address Translation (NAT) works by selecting gateways that sit between two local networks:

  • the internal private IP network of your office or home
  • and the outside network such as the internet.

Systems on the inside network are typically assigned IP addresses that cannot be routed to external networks.

“Externally valid Public IP addresses are assigned to a gateway (router or edge device such as a firewall). That gateway creates outbound traffic from an inside system and makes it appear to be coming from one of the valid external IP addresses. Conversely, it takes incoming traffic aimed at an external IP address and sends it to the correct internal system.

This provides accessibility and routing to and from internal network devices and applications. NAT also helps provide security because each outgoing or incoming request must go through a translation process. This process offers the opportunity to qualify or authenticate incoming streams and match them to the outgoing request.” — Anthony Percivalle, Senior Engineer, United World Telecom.

It’s a useful tool. However, using NAT can sometimes prove problematic for VoIP, especially for a VoIP network that relies on UDP.

And that is where a STUN server comes in. VoIP networks use STUN to communicate between two endpoints located behind NAT gateways. But what is it, and how does it do this? Let’s find out!

What is a STUN Server?

A Session Traversal Utilities for NAT or STUN server is a server-client protocol that allows privately addressed clients within a local network to traverse NAT and set up voice calls to a VoIP provider outside of that local network.

The original full form of STUN is Simple Traversal of User Datagram Protocol (UDP) through Network Address Translators (NAT).

A STUN server can be used in several network implementations by protocols such as SIP and WebRTC. This server enables NAT clients (devices running behind a NAT) to identify:

  • its public address or public IP,
  • the type of NAT it is connected to (static or dynamic), and
  • the port translation done by the NAT (the port other devices outside the network can connect to).

By doing this, it enables high-quality and reliable VoIP calls across private and public networks.

How Does a STUN Request Work?

The STUN server is commonly implemented as a client-server protocol with request (query) and response components and a connection to the third-party server located on an accessible network, typically the internet. These STUN messages travel through UDP packets.

Here’s a quick glimpse into how a STUN request and response works:

A diagram showing how STUN servers work.

  • Step 1: A device sends an initial request – binding STUN request – to discover its ports and IP. It sends this through the gateway to a STUN server located outside the local network, typically the internet. These servers usually listen on port 5060 or 3478.
  • Step 2: The STUN server then sends a success response back to the device with the public IP address and port number of the client.
  • Result: When this device makes a SIP-based VoIP call with the external entity (in this case, the VoIP provider), the provider can send responses back to the public IP and new port, enabling easy communication of data and information between the two endpoints.

This way, a STUN server helps two devices running behind a NAT gateway to establish a UDP connection.

Related: How to Achieve the Best VoIP Call Quality for Your Business?

Where to Find Your STUN Server?

Some businesses will have access to their own STUN server. Similarly, most VoIP applications have their own default servers, so you can check with your providers and vendors which one to use. However, you can also access an online public STUN list and pick one that works best for your needs. Instead of using a default server, you can enter your own custom server from such a list.

You can always reach out to your provider to determine the best for you.

When to Use STUN Servers for VoIP?

Currently, most applications don’t require a STUN server to work efficiently. But, it can come in handy for troubleshooting VoIP call issues.

Alain Rodriguez, our Customer Service and Tech Support Manager, explains that “if your devices are sitting behind NAT, your VoIP provider may suggest using a STUN server to remedy any VoIP issues you may experience with connection, jitter, or latency.”

Troubleshooting VoIP Quality Issues

Using a STUN protocol is just one solution to fixing VoIP problems. However, you can take other remedial measures depending on the issue itself.

Need more help troubleshooting VoIP call quality issues? Our experts at United World Telecom can help! Reach out to learn more or chat with us online!

How To Get Started

Sign Up Online, Instantly
Or
Request a Custom Quote