2.2.6 Local Site Address

The Local Site Address attribute contains the IP address that the client is using to contact its TURN server. This address maps the client into the bandwidth admission control network topology, and is used to identify the network site that the client is in. There is an assumption that a client is in a single network site. In other words, if the client has multiple IP addresses, only one address from the client is needed to identify the client’s network site. This attribute MUST be included by the client in all Reservation Check and Reservation Commit request 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

Reserved

Family

X-Port

X-IP Address

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 "0x805B".

Attribute Length (2 bytes): Length of the following fields. Set to "0x0008" (8) for an IPv4 address or "0x0014" (20) for an IPv6 address.<9>

Reserved (1 byte): These bits MUST be set to zero on send and ignored on receive.

Family (1 byte): The address family of the IP Address. It MUST have the value "0x01" for an IPv4 address or "0x02" for an IPv6 address.<10> If the value is anything other than 0x01 or 0x02, the attribute MUST be silently ignored.

X-Port (2 bytes): The port is a network byte ordered representation of the IP port. This value is created from the exclusive-or of the source port with the most significant 16 bits of the Transaction ID specified in [MS-TURN] section 2.2.1. If the port was 0x1122 (network byte order) and the most significant 16 bits of the Transaction ID (specified in [MS-TURN] section 2.2.1) was 0x4455 (network byte order), the resulting X-Port is "0x1122 ^ 0x4455 = 0x5577".

X-IP Address (4 or 16 bytes): The client’s IPv4 or IPv6 address.<11>

If the address family is IPv4 (Family is set to "0x01") this is the client’s network byte ordered 32-bit (4 byte) IPv4 address. This value is created from the exclusive-or of the IP address with the most significant 32 bits of the Transaction ID specified in [MS-TURN] section 2.2.1. If the IPv4 address was 0x11223344 and the most significant 32 bits of the Transaction ID (specified in [MS-TURN] section 2.2.1) was 0xaabbccdd, the resulting X-IP Address is "0x11223344 ^ 0xaabbccdd = 0xbb99ff99". 

If the address family is IPv6 (Family is set to "0x02") this is the client’s network byte ordered 128-bit (16 byte) IPv6 address.<12> This value is created from the exclusive-or of the IP address with the 128 bits of the Transaction Id specified in [MS-TURN] section 2.2.1. If the IPv6 address was 0x20010DB8112233445566778899AABBCC and the 128bit Transaction ID (specified in [MS-TURN] section 2.2.1) was 0x112233445566778899AABBCCDDEEFF00, the resulting X-IP Address is "0x20010DB8112233445566778899AABBCC ^ 0x112233445566778899AABBCCDDEEFF00 = 0x31233EFC444444CCCCCCCC44444444CC ".