STUN: Session Traversal Utilities for NAT

December 31 , 2021
STUN
Session Traversal Utilities for NAT (STUN) is a standardized set of methods, including a network protocol, for traversal of network address translator (NAT) gateways in applications of real-time voice, video, messaging, and other interactive communications. The software of Tonmind IP Speaker-Tonmind PA System Lite has built-in SIP Server, which adopts STUN and ICE technologies to solve NAT penetration problems.

STUN is a tool used by other protocols, such as Interactive Connectivity Establishment (ICE), the Session Initiation Protocol (SIP), and WebRTC. It provides a tool for hosts to discover the presence of a network address translator, and to discover the mapped, usually public, Internet Protocol (IP) address and port number that the NAT has allocated for the application's User Datagram Protocol (UDP) flows to remote hosts. The protocol requires assistance from a third-party network server (STUN server) located on the opposing (public) side of the NAT, usually the public Internet.

Originally, STUN was an acronym for Simple Traversal of User Datagram Protocol (UDP) through Network Address Translators, but this title was changed in a specification of an updated set of methods published as RFC 5389, retaining the same acronym.


What Is STUN?
A point-to-point (P2P) network requires that two communicating parties be able to proactively access each other. However, NAT devices block the access, thereby affecting normal running of P2P applications. STUN technology is commonly used to overcome this NAT traversal problem. It allows network devices to discover post-NAT IP addresses and port numbers of communicating parties and to use this information to establish P2P data channels traversing the NAT devices for P2P communication.

Why We Need STUN?
NAT is widely deployed to mitigate the exhaustion of IPv4 addresses. It also protects against attacks from external networks by dropping some packets sent from external networks to the internal network. However, it is not suitable for P2P communication, such as a P2P network, since it cannot enable two P2P communicating parties to initiate access.

To solve the problems, some NAT traversal techniques for P2P networks emerge, such as reverse link, application layer gateway (ALG), hole punching, and middleware techniques. Tonmind PA System software has applied STUN ti make voice communication with SIP devices (for example, IP Speakers, IP Phone) more smooth.


The STUN protocol defined by RFC is used to discover NAT devices located along the path between two communicating parties and to obtain post-NAT IP addresses and port numbers of the communicating parties. Then, a P2P channel traversing NAT devices can be set up between two communicating parties for communication. This process is also called hole punching. The STUN technology is widely used because it works with existing NAT devices and does not require any modification on them, while only one STUN server needs to be deployed on the network.


What Is STUN Server?
STUN uses the client/server model and consists of the STUN server and STUN client:
STUN server: A router can function as a STUN server and send STUN binding responses and receive STUN binding requests. The STUN server is usually deployed on a public network.
STUN client: A router can function as a STUN client and send STUN binding requests and receive STUN binding responses.


In the STUN standard, NAT is classified into four types according to the mapping mode from the private IP address and port to the public IP address and port: full cone NAT, restricted cone NAT, port restricted cone NAT, and symmetric NAT. For details about the four NAT types, see NAT.

How Does STUN Work?

Through message exchange with a STUN client, a STUN server can discover a NAT device and obtain the IP address and port number allocated by the NAT device to the STUN client. After a data channel is established between STUN clients, the clients can access each other. The STUN message exchange process consists of two phases: NAT detection and hole punching. The following figure shows the detailed process.


With application of STUN, Tonmind PA System has better communication between SIP devices. Tonmind PA System Lite is a broadcast software which support SIP and RTP Multicast. Users can play various audio sources from SIP call, live radio, local media player, universal windows media (for example, Spotify, iTunes, VLC, etc.) via RTP Multicast. Users can control zones, contents, rings, volume and scheduling, especially useful in School PA System.



Leave A Message
Leave A Message
If you are interested in our products and want to know more details,please leave a message here,we will reply you as soon as we can.

Home

Products

skype

whatsapp