2.2.2 Message Attribute

After the TURN header, all TURN messages consist of 1 or more attributes. All attributes MUST be TLV encoded and have the same format as specified in [IETFDRAFT-STUN-02] section 10.2. The Magic Cookie attribute MUST be the first attribute in all TURN messages.


0


1


2


3


4


5


6


7


8


9

1
0


1


2


3


4


5


6


7


8


9

2
0


1


2


3


4


5


6


7


8


9

3
0


1

Attribute Type

Attribute Length

Value (variable)

...

Attribute Type (2 bytes): The TURN attributes are specified in [IETFDRAFT-STUN-02] section 10.2 and [IETFDRAFT-TURN-08] section 9.2.

The following mandatory attribute types are supported in this extension. Any other attributes from the mandatory attribute space MUST generate an error response with an error response code of Unknown Attribute.

  • "0x0001": Mapped Address

  • "0x0006": Username

  • "0x0008": Message Integrity

  • "0x0009: Error Code

  • "0x000A": Unknown Attributes

  • "0x000D": Lifetime

  • "0x000E": Alternate Server

  • "0x000F": Magic Cookie

  • "0x0010": Bandwidth

  • "0x0011": Destination Address

  • "0x0012": Remote Address

  • "0x0013": Data

  • "0x0014": Nonce

  • "0x0015": Realm

  • "0x0017": Requested Address Family<2>

The following optional attributes are also supported in this extension. Any other attributes from the optional attribute space SHOULD be ignored.

  • "0x8008": MS-Version

  • "0x8020": XOR Mapped Address

  • “0x8032”: MS-Alternate Host Name

  • “0x8037”: App ID<3>

  • “0x8039”: Secure Tag<4>

  • "0x8050": MS-Sequence Number

  • "0x8055": MS-Service Quality<5>

  • "0x8090": MS-Alternate Mapped Address<6>

  • "0x8095": Multiplexed TURN Session ID<7>

Attribute Length (2 bytes): The length of bytes of the Value data following the Attribute Length field itself.

Value (variable): Variable-length field that contains information dependent on the attribute type.