Jump to content

STUN

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by 202.138.120.37 (talk) at 07:56, 6 July 2006. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

STUN Maderchod(Simple Traversal of UDP over NATs) is a network protocol allowing clients behind NAT (or multiple NATs) to find out its public address, the type of NAT it is behind and the internet side port associated by the NAT with a particular local port. This information is used to set up UDP communication between two hosts that are both behind NAT routers. The protocol is defined in RFC 3489.

Once the clients have the Internet side UDP ports, communication can begin. If the NATs are full cone then either side can initiate communication. If they are restricted cone or restricted port cone both sides must start transmitting together.

Note that using the techniques described in the STUN RFC does not necessarily require using the STUN protocol. The same functionality can also be integrated into the server for the protocol being designed.

Protocols like SIP use UDP packets for the transfer of sound and/or video signaling traffic over the Internet. Unfortunately as both endpoints are often behind NAT, a connection can't be set up in the traditional way. This is where STUN is useful.

STUN is a client-server protocol. A VoIP phone or software package may include a STUN client, which will send a request to a STUN server. The server then reports back to the STUN client what the public IP address of the NAT router is, and what port was opened by the NAT to allow incoming traffic back in to the network.

The response also allows the STUN client to determine what type of NAT is in use, as different types of NATs handle incoming UDP packets differently. It will work with three of four main types: full cone NAT, restricted cone NAT, and port restricted cone NAT. It will not work with symmetric NAT (also known as bi-directional NAT) which is often found in the networks of large companies.

An example of a well-known VoIP application that uses STUN is Google Talk, which interoperates with STUN servers situated in Google's datacenters.

The STUN server is contacted on UDP port 3478, however the server will hint clients to perform tests on alternate IP and port number too (STUN servers have two IP addresses). The RFC states that this port and IP are arbitrary.

See also

  • RFC 3489, STUN - Simple Traversal of User Datagram Protocol (UDP) Through Network Address Translators (NATs)
  • NAT traversal White Paper comparing STUN with other NAT traversal techniques such as TURN, ICE, ALGs and Session Border Controllers - Source: Newport Networks
  • STUNT - "STUN and TCP too", which extends STUN to include TCP functionality

Implementations