NAT and STUN in VoIP

Short answer: NAT (network address translation) allows many devices to share a single public IP address, while STUN (Session Traversal Utilities for NAT) is the protocol that reports back which public IP and port a device actually appears from. SIP clients rely on STUN so the far side can send audio to an address that is actually reachable.

Most home and office routers run NAT, which explains why one-way audio and dropped calls are such a common first-time problem with a new softphone.

How it works

SIP messages carry the IP address and port where media is supposed to go. Behind NAT, a device only knows its own private address, so the far end's RTP audio can end up going nowhere useful. A STUN server (RFC 8489) reflects back the public mapping, and the client advertises that instead. Keep-alives, rport and ICE all help keep that mapping open over time.

NAT traversal, the short version

ItemWhat it does
STUN server (RFC 8489)Mirrors back the public address and port so the client knows what to announce
Keep-alives, rport, and ICEKeep the NAT mapping from closing
One-way audio issueTurn on STUN or NAT traversal inside the SIP client
Browser web dialerRequires no setup on the client side at all

How it applies to SMS Conecta

Registering a SMS Conecta number in Zoiper, Linphone or MicroSIP behind a router? Turn on STUN or NAT traversal in the client if audio is only working one way. Registration goes through sip.smsconecta.com on UDP/TCP port 5060 or TLS port 5061. The browser web dialer skips all of this client-side setup entirely.

Related terms

  • SIP
  • Softphone
  • G.711 codec
  • Web dialer

Frequently asked questions

What typically causes one-way audio?

Most often NAT, or a firewall blocking RTP; turning on STUN or switching to TCP/TLS tends to fix it.

Are STUN and TURN the same thing?

No — TURN relays media through a server, whereas STUN only figures out your public address.

Is turning off SIP ALG on my router a good idea?

Often, yes. SIP ALG frequently rewrites packets incorrectly, which is why so many troubleshooting guides suggest disabling it.

Related pages

Sources