The Full Wiki

Session Traversal Utilities for NAT: Wikis

Advertisements

Note: Many of our articles have direct quotes from sources you can cite, within the Wikipedia article! This article doesn't yet, but we're working on it! See more info or our list of citable articles.

Encyclopedia

(Redirected to STUN article)

From Wikipedia, the free encyclopedia

"stun" redirects here. For other topics including this term, see stun (disambiguation).

STUN is an Internet standards-track suite of methods, including a network protocol, used in NAT traversal for applications of real-time voice, video, messaging, and other interactive IP communications.

In the original specification in RFC 3489,[1] STUN was an acronym for Simple Traversal of User Datagram Protocol through Network Address Translators (NATs), but this title has been changed in a specification of an updated set of methods published as RFC 5389 with the title Session Traversal Utilities for NAT, retaining the same acronym.[2]

The STUN protocol allows applications operating through a network address translator (NAT) to discover the presence of a network address translator and to obtain the mapped (public) IP address (NAT address) and port number that the NAT has allocated for the application's User Datagram Protocol (UDP) connections to remote hosts. The protocol requires assistance from a 3rd-party network server (STUN server) located on the opposing (public) side of the NAT, usually the public Internet. The original version of the protocol also specified methods to ascertain the specific type of NAT, but those methods have been deprecated in the newer specification, because of the plethora of specific NAT implementation behavior in various networking equipment and the resulting intractability of the problem and the deficiencies of the method used.

The Internet Protocol Suite
Application Layer
BGP · DHCP · DNS · FTP · GTP · HTTP · IMAP · IRC · Megaco · MGCP · NNTP · NTP · POP · RIP · RPC · RTP · RTSP · SDP · SIP · SMTP · SNMP · SOAP · SSH · Telnet · TLS/SSL · XMPP · (more)
Transport Layer
TCP · UDP · DCCP · SCTP · RSVP · ECN · (more)
Internet Layer
IP (IPv4, IPv6) · ICMP · ICMPv6 · IGMP · IPsec · (more)
Link Layer
ARP/InARP · NDP · OSPF · Tunnels (L2TP) · PPP · Media Access Control (Ethernet, DSL, ISDN, FDDI) · (more)

Contents

NAT traversal solutions

NAT devices are implemented in a number of different types of address and port mapping schemes (cf. network address translation), none of which are standardized.

STUN is not a self-contained NAT traversal solution applicable in all NAT deployment scenarios and does not work correctly with all of them.[2] It is a tool among other methods, most notably Traversal Using Relay NAT (TURN) and Interactive Connectivity Establishment (ICE).

STUN does work with primarily three types: full cone NAT, restricted cone NAT, and port restricted cone NAT. In the cases of restricted cone or port restricted cone NATs, the client must send out a packet to the endpoint before the NAT will allow packets from the endpoint through to the client. STUN does not work with symmetric NAT (also known as bi-directional NAT) which is often found in the networks of large companies. Since the IP address of the STUN server is different than that of the endpoint, in the symmetric NAT case, the NAT mapping will be different for the STUN server than for an endpoint. TURN offers better results with symmetric NAT.

Protocol overview

STUN is a light-weight client-server protocol requiring only simple query and response via UDP. The client side is implemented in the user's communications application, such as a Voice over Internet Protocol (VoIP) phone or instant messaging client. The client, operating inside the NAT-masqueraded network, initiates a short sequence of requests to a STUN protocol server listening at two IP addresses in the network on the public side of the NAT, traversing the NAT. The server responds with the results, which are the mapped IP address and port on the 'outside' of the NAT for each request to its two listeners. From the results of several different types of requests, the client application can learn the operating method of the network address translator, including the lifetime of the NAT's port bindings.

STUN usually operates on a User Datagram Protocol (UDP) messaging transport. Since UDP does not provide reliable transport guarantees, reliability is achieved by application-controlled retransmissions of the STUN requests. STUN servers do not implement any reliability mechanism for their responses.[2] When reliability is mandatory, Transmission Control Protocol (TCP) may be used, but induces extra networking overhead. In security-sensitive applications, STUN may be transported and encrypted via TCP/TLS.

An application may automatically determine a suitable STUN server for communications with a particular peer by querying for the stun (for UDP) or stuns (for TCP/TLS) SRV Domain Name System (DNS) resource record, (e.g., _stun._udp.example.com). The standard listening port number for a STUN server is 3478, for UDP and TCP, and 5349 for TLS. Alternately, TLS may also be run on the TCP port if the server implementation can de-multiplex TLS and STUN packets. In case no STUN server is found using SRV lookups, the standard[2] recommends that the destination domain name should be queried for address records (A or AAAA) which would be used with the default port numbers.

In addition to using protocol encryption via TLS, STUN also has built-in authentication and message-integrity mechanisms via specialized STUN packet types.

When a client has discovered its external address, it can communicate with communication peers by advertising its external NAT address to its peers, rather than the masqueraded (internal) address that is not reachable for its peers on the public network. In some cases of NATs (e.g., full-cone type) then either side can initiate communication. With other types (restricted cone or restricted port cone types) both sides must commence transmitting at about the same time to establish the port bindings in the network address translator.

Protocols like the Real-time Transport Protocol (RTP) and the Session Initiation Protocol (SIP) use UDP packets for the transfer of media and signaling traffic over the Internet.

In many application scenarios it is common that both endpoints are located behind a NAT. This double-NAT problem is often not easily overcome even with STUN and sometimes an intermediate application proxy server is required.

NAT characterization algorithm

The original STUN specification (RFC 3489) used the following algorithm to characterize NAT gateways and firewalls according to the address mapping behavior. It should be noted that this algorithm is not a reliably successful procedure and only applicable to a subset of NAT devices deployed today. The method has therefore been officially removed from the latest version of the standard (RFC 5389).

The algorithm consists of a series of tests to be performed by an application. When the path through the diagram ends in a red box, UDP communication is not possible and when the path ends in a yellow or green box, communication is possible.

STUN Algorithm3.svg

Successor to original STUN specification

The methods of RFC 3489 have proven too unreliable to cope with the plethora of different NAT implementations and application scenarios encountered in production networks. The document is now obsolete. The STUN protocol and method have been updated in RFC 5389, retaining many of the original specifications as a subset of methods, but dropping others.

Implementations

See also

References

  1. ^ RFC 3489, STUN - Simple Traversal of User Datagram Protocol (UDP) Through Network Address Translators (NATs), J. Rosenberg, J. Weinberger, C. Huitema, R. Mahy, The Internet Society (March 2003)
  2. ^ a b c d RFC 5389, Session Traversal Utilities for NAT (STUN), J. Rosenberg, R. Mahy, P. Matthews, D. Wing, The Internet Society (October 2008)

External links

Advertisements

"stun" redirects here. For other topics including this term, see stun (disambiguation).

STUN is an Internet standards-track suite of methods, including a network protocol, used in NAT traversal for applications of real-time voice, video, messaging, and other interactive IP communications.

In the original specification in RFC 3489,[1] STUN was an acronym for Simple Traversal of User Datagram Protocol (UDP) through Network Address Translators (NATs), but this title has been changed in a specification of an updated set of methods published as RFC 5389 with the title Session Traversal Utilities for NAT, retaining the same acronym.[2]

The STUN protocol allows applications operating through a network address translator (NAT) to discover the presence of a network address translator and to obtain the mapped (public) IP address (NAT address) and port number that the NAT has allocated for the application's User Datagram Protocol (UDP) connections to remote hosts. The protocol requires assistance from a 3rd-party network server (STUN server) located on the opposing (public) side of the NAT, usually the public Internet. The original version of the protocol also specified methods to ascertain the specific type of NAT, but those methods have been deprecated in the newer specification, because of the plethora of specific NAT implementation behavior in various networking equipment and the resulting intractability of the problem and the deficiencies of the method used.

Internet Protocol Suite
Application Layer

BGP

  1. REDIRECT template:· DHCP
  2. REDIRECT template:· DNS
  3. REDIRECT template:· FTP
  4. REDIRECT template:· HTTP
  5. REDIRECT template:· IMAP
  6. REDIRECT template:· IRC
  7. REDIRECT template:· LDAP
  8. REDIRECT template:· MGCP
  9. REDIRECT template:· NNTP
  10. REDIRECT template:· NTP
  11. REDIRECT template:· POP
  12. REDIRECT template:· RIP
  13. REDIRECT template:· RPC
  14. REDIRECT template:· RTP
  15. REDIRECT template:· SIP
  16. REDIRECT template:· SMTP
  17. REDIRECT template:· SNMP
  18. REDIRECT template:· SSH
  19. REDIRECT template:· Telnet
  20. REDIRECT template:· TLS/SSL
  21. REDIRECT template:· XMPPTemplate:·
(more)
Transport Layer

TCP

  1. REDIRECT template:· UDP
  2. REDIRECT template:· DCCP
  3. REDIRECT template:· SCTP
  4. REDIRECT template:· RSVP
  5. REDIRECT template:· ECNTemplate:·
(more)
Internet Layer

IP (IPv4, IPv6)

  1. REDIRECT template:· ICMP
  2. REDIRECT template:· ICMPv6
  3. REDIRECT template:· IGMP
  4. REDIRECT template:· IPsecTemplate:·
(more)
Link Layer

ARP/InARP

  1. REDIRECT template:· NDP
  2. REDIRECT template:· OSPF
  3. REDIRECT template:· Tunnels (L2TP)
  4. REDIRECT template:· PPP
  5. REDIRECT template:· Media Access Control (Ethernet, DSL, ISDN, FDDI)Template:· (more)

Contents

NAT traversal solutions

Network address translation is implemented via a number of different address and port mapping schemes, none of which are standardized.

STUN is not a self-contained NAT traversal solution applicable in all NAT deployment scenarios and does not work correctly with all of them.[2] It is a tool among other methods, most notably Traversal Using Relay NAT (TURN) and Interactive Connectivity Establishment (ICE).

STUN does work with primarily three types: full cone NAT, restricted cone NAT, and port restricted cone NAT. In the cases of restricted cone or port restricted cone NATs, the client must send out a packet to the endpoint before the NAT will allow packets from the endpoint through to the client. STUN does not work with symmetric NAT (also known as bi-directional NAT) which is often found in the networks of large companies. Since the IP address of the STUN server is different than that of the endpoint, in the symmetric NAT case, the NAT mapping will be different for the STUN server than for an endpoint. TURN offers better results with symmetric NAT.

Protocol overview

STUN is a light-weight client-server protocol requiring only simple query and response via UDP. The client side is implemented in the user's communications application, such as a Voice over Internet Protocol (VoIP) phone or instant messaging client. The client, operating inside the NAT-masqueraded network, initiates a short sequence of requests to a STUN protocol server listening at two IP addresses in the network on the public side of the NAT, traversing the NAT. The server responds with the results, which are the mapped IP address and port on the 'outside' of the NAT for each request to its two listeners. From the results of several different types of requests, the client application can learn the operating method of the network address translator, including the lifetime of the NAT's port bindings.

STUN usually operates on a User Datagram Protocol (UDP) messaging transport. Since UDP does not provide reliable transport guarantees, reliability is achieved by application-controlled retransmissions of the STUN requests. STUN servers do not implement any reliability mechanism for their responses.[2] When reliability is mandatory, Transmission Control Protocol (TCP) may be used, but induces extra networking overhead. In security-sensitive applications, STUN may be transported and encrypted via TCP/TLS.

An application may automatically determine a suitable STUN server for communications with a particular peer by querying for the stun (for UDP) or stuns (for TCP/TLS) SRV Domain Name System (DNS) resource record, (e.g., _stun._udp.example.com). The standard listening port number for a STUN server is 3478, for UDP and TCP, and 5349 for TLS. Alternately, TLS may also be run on the TCP port if the server implementation can de-multiplex TLS and STUN packets. In case no STUN server is found using SRV lookups, the standard[2] recommends that the destination domain name should be queried for address records (A or AAAA) which would be used with the default port numbers.

In addition to using protocol encryption via TLS, STUN also has built-in authentication and message-integrity mechanisms via specialized STUN packet types.

When a client has discovered its external address, it can communicate with communication peers by advertising its external NAT address to its peers, rather than the masqueraded (internal) address that is not reachable for its peers on the public network. In some cases of NATs (e.g., full-cone type) then either side can initiate communication. With other types (restricted cone or restricted port cone types) both sides must commence transmitting at about the same time to establish the port bindings in the network address translator.

Protocols like the Real-time Transport Protocol (RTP) and the Session Initiation Protocol (SIP) use UDP packets for the transfer of media and signaling traffic over the Internet.

In many application scenarios it is common that both endpoints are located behind a NAT. This double-NAT problem is often not easily overcome even with STUN and sometimes an intermediate application proxy server is required.

NAT characterization algorithm

The original STUN specification (RFC 3489) used the following algorithm to characterize NAT gateways and firewalls according to the address mapping behavior. This algorithm is not a reliably successful procedure and only applicable to a subset of NAT devices deployed today. The method has therefore been officially removed from the latest version of the standard (RFC 5389).

The algorithm consists of a series of tests to be performed by an application. When the path through the diagram ends in a red box, UDP communication is not possible and when the path ends in a yellow or green box, communication is possible.

Successor to original STUN specification

The methods of RFC 3489 have proven too unreliable to cope with the plethora of different NAT implementations and application scenarios encountered in production networks. The document is now obsolete. The STUN protocol and method have been updated in RFC 5389, retaining many of the original specifications as a subset of methods, but dropping others.

Implementations

See also

References

  1. ^ RFC 3489, STUN - Simple Traversal of User Datagram Protocol (UDP) Through Network Address Translators (NATs), J. Rosenberg, J. Weinberger, C. Huitema, R. Mahy, The Internet Society (March 2003)
  2. ^ a b c d RFC 5389, Session Traversal Utilities for NAT (STUN), J. Rosenberg, R. Mahy, P. Matthews, D. Wing, The Internet Society (October 2008)

External links


Advertisements






Got something to say? Make a comment.
Your name
Your email address
Message