2.2.2.8 Magic Cookie

The Magic Cookie attribute is specified in [IETFDRAFT-TURN-08] section 9.2.3. This attribute MUST be the first attribute following the TURN message header in all TURN messages. It is used to disambiguate TURN messages from data traffic.


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

Magic Cookie

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

Attribute Length (2 bytes): This field contains the length, in bytes, of the Magic Cookie field. Set to "0x0004" (4).

Magic Cookie (4 bytes): Set to "0x72c64bc6".