Skip to main content

18. IANA Considerations

IANA has created three new registries: the "STUN Methods Registry", the "STUN Attribute Registry", and the "STUN Error Codes Registry". IANA has also changed the IANA-assigned port name for STUN from "nat-stun-port" to "stun".

18.1. STUN Methods Registry

A STUN method is a hex number in the range 0x000 - 0xFFF. The encoding of STUN method into a STUN message is described in Section 6.

Initial STUN methods are:

  • 0x000: (Reserved)
  • 0x001: Binding
  • 0x002: (Reserved; was SharedSecret)

STUN methods in the range 0x000 - 0x7FF are assigned by IETF Review [RFC5226]. STUN methods in the range 0x800 - 0xFFF are assigned by Designated Expert [RFC5226]. The responsibility of the expert is to verify that the selected codepoint(s) are not in use and that the request is not for an abnormally large number of codepoints. Technical review of the extension itself is outside the scope of the designated expert responsibility.

18.2. STUN Attribute Registry

A STUN Attribute type is a hex number in the range 0x0000 - 0xFFFF. STUN attribute types in the range 0x0000 - 0x7FFF are considered comprehension-required; STUN attribute types in the range 0x8000 - 0xFFFF are considered comprehension-optional. A STUN agent handles unknown comprehension-required and comprehension-optional attributes differently.

Initial STUN Attribute types are:

Comprehension-required range (0x0000-0x7FFF):

  • 0x0000: (Reserved)
  • 0x0001: MAPPED-ADDRESS
  • 0x0002: (Reserved; was RESPONSE-ADDRESS)
  • 0x0003: (Reserved; was CHANGE-ADDRESS)
  • 0x0004: (Reserved; was SOURCE-ADDRESS)
  • 0x0005: (Reserved; was CHANGED-ADDRESS)
  • 0x0006: USERNAME
  • 0x0007: (Reserved; was PASSWORD)
  • 0x0008: MESSAGE-INTEGRITY
  • 0x0009: ERROR-CODE
  • 0x000A: UNKNOWN-ATTRIBUTES
  • 0x000B: (Reserved; was REFLECTED-FROM)
  • 0x0014: REALM
  • 0x0015: NONCE
  • 0x0020: XOR-MAPPED-ADDRESS

Comprehension-optional range (0x8000-0xFFFF):

  • 0x8022: SOFTWARE
  • 0x8023: ALTERNATE-SERVER
  • 0x8028: FINGERPRINT

STUN Attribute types in the first half of the comprehension-required range (0x0000 - 0x3FFF) and in the first half of the comprehension-optional range (0x8000 - 0xBFFF) are assigned by IETF Review [RFC5226]. STUN Attribute types in the second half of the comprehension-required range (0x4000 - 0x7FFF) and in the second half of the comprehension-optional range (0xC000 - 0xFFFF) are assigned by Designated Expert [RFC5226]. The responsibility of the expert is to verify that the selected codepoint(s) are not in use and that the request is not for an abnormally large number of codepoints. Technical review of the extension itself is outside the scope of the designated expert responsibility.

18.3. STUN Error Code Registry

A STUN error code is a number in the range 0 - 699. STUN error codes are accompanied by a textual reason phrase in UTF-8 [RFC3629] that is intended for human consumption and can be anything appropriate; this document proposes only suggested values.

STUN error codes are consistent in codepoint assignments and semantics with SIP [RFC3261] and HTTP [RFC2616].

The initial values in this registry are given in Section 15.6.

New STUN error codes are assigned based on IETF Review [RFC5226]. The specification must carefully consider how clients that do not understand this error code will process it before granting the request. See the rules in Section 7.3.4.

18.4. STUN UDP and TCP Port Numbers

IANA has previously assigned port 3478 for STUN. This port appears in the IANA registry under the name "nat-stun-port". To make the DNS SRV procedures work with the registered protocol service, IANA is requested to change the assignment of protocol name assigned to port 3478 from "nat-stun-port" to "stun" and to change the textual name from "Simple Traversal of UDP Through NAT (STUN)" to "Session Traversal Utilities for NAT", so that the IANA port registry would show:

stun   3478/tcp   Session Traversal Utilities for NAT (STUN) port
stun 3478/udp Session Traversal Utilities for NAT (STUN) port

In addition, IANA has assigned port number 5349 for the "stuns" service, defined over TCP and UDP. The UDP port is currently not defined; however, it is reserved for future use.