IPv6 Addressing
Each Teredo client is assigned a public IPv6 address which is constructed as follows (the higher order bit is numbered 0):
- Bits 0 to 31 are set to the Teredo prefix (2001::/32).
- Bits 32 to 63 embed the primary IPv4 address of the Teredo server that is used.
- Bits 64 to 79 holds some flags and other bits; the format for these 16 bits, MSB first, is "CRAAAAUG AAAAAAAA". The "C" bit was set to 1 if the Teredo client is located behind a cone NAT, 0 otherwise, but RFC 5991 changed it to always be 0 to avoid revealing this fact to strangers. The "R" bit is currently unassigned and should be sent as 0. The "U" and "G" bits are set to 0 to emulate the "Universal/local" and "Group/individual" bits in MAC Addresses. The 12 "A" bits were 0 in the original RFC 4380 specification, but were changed to be random bits chosen by the Teredo client in RFC 5991 to introduce additional protection for the Teredo node against IPv6-based scanning attacks.
- Bits 80 to 95 contains the obfuscated UDP port number. This is the port number that is mapped by the NAT to the Teredo client with all bits inverted.
- Bits 96 to 127 contains the obfuscated IPv4 address. This is the public IPv4 address of the NAT with all bits inverted.
Teredo IPv6 addressing table
Bits | 0 - 31 | 32 - 63 | 64 - 79 | 80 - 95 | 96 - 127 |
---|---|---|---|---|---|
Length | 32 bits | 32 bits | 16 bits | 16 bits | 32 bits |
Description | Prefix | Teredo server IPv4 |
Flags | Obfuscated UDP port |
Obfuscated Client public IPv4 |
As an example, the IPv6 address 2001:0000:4136:e378:8000:63bf:3fff:fdd2 refers to a Teredo client:
- using Teredo server at address 65.54.227.120 (4136e378 in hexadecimal),
- located behind a cone NAT and client is not fully compliant with RFC 5991 (bit 64 is set),
- probably (99.98%) not compliant with RFC 5991 (the 12 random bits are all 0, which happens less than 0.025% of the time),
- using UDP mapped port 40000 on its NAT (in hexadecimal not 63bf equals 9c40, or decimal number 40000),
- whose NAT has public IPv4 address 192.0.2.45 (not 3ffffdd2 equals c000022d, which is to say 192.0.2.45).
Teredo IPv6 example table
Bits | 0 - 31 | 32 - 63 | 64 - 79 | 80 - 95 | 96 - 127 |
---|---|---|---|---|---|
Length | 32 bits | 32 bits | 16 bits | 16 bits | 32 bits |
Description | Prefix | Teredo server IPv4 |
Flags | Obfuscated UDP port |
Obfuscated Client public IPv4 |
Part | 2001:0000 | 4136:e378 | 8000 | 63bf | 3fff:fdd2 |
Decoded | 65.54.227.120 | cone NAT | 40000 | 192.0.2.45 |
There is a JavaScript Teredo-IP address calculator available.
Read more about this topic: Teredo Tunneling, Overview
Famous quotes containing the word addressing:
“He took up his pen, which seemed to parch like a martyr in his hand. He began to write, nevertheless, addressing the nine-and-ninety lies of the moment he hoped with for a night of saloperie at the side of the twisted strumpet, Fiction, who lasciviously rolled her eyes at him, hiked up her skirt, and beckoned him on.”
—Alexander Theroux (b. 1940)