IPv6 URIs in IE7
One of the benefits of creating a new URI parsing API for IE7 was that we were able to more easily add support for IPv6 addresses in URIs throughout IE7. This blog post will describe the use of IPv6 URIs in IE7.
One of the advantages of IPv6 over IPv4 is that IPv6 addresses are four times longer than IPv4 addresses (128 bits vs. 32 bits) allowing for about 3.402 * 1038 unique IPv6 addresses. Due to the longer length, a new and more compact textual representation is used for IPv6 addresses. IPv6 addresses are written as groups of four hexadecimal digits delimited by colons. For the full details on IPv6 addresses and their textual representation, see the IPv6 Addressing standard. The following is an example of an IPv6 address:
The old URI syntax and the IPv6 address syntax conflicted so in accommodation, the URI syntax was modified. According to the latest URI standard, when you put an IPv6 address in the host, you must enclose it in square brackets. Thus, the previous example IPv6 address could appear as follows in a URI:
URIs containing IPv6 addresses are not considered “special” in IE and they may be used anywhere IE accepts or displays a URI.
One explicit omission from the latest URI standard concerning IPv6 addresses is IPv6 scope-ids. IPv6 scope-ids specify which zone (a group of network connections) on a computer should be used when resolving a particular IPv6 address. See the IPv6 Scoped Address Architecture proposed standard for a full description of scope-ids. The scope-id appears after the IPv6 address delimited by a percent character. The previous IPv6 address example with a scope-id of 1 looks like this:
Non-encoded percents are not permitted in URIs, so in order to support scope-ids in IPv6 URIs, IE7 allows scope-ids following the IPv6 address when delimited by a percent-encoded percent character. Therefore, the previous example IPv6 address could appear in a URI in IE7 as follows:
There is currently an IETF document describing an update to the URI standard to include scope-ids, however this is still in draft stage and so is not supported by IE7. MSDN has more details on IE7’s support for IPv6 scope-ids in URIs.
Trying It Out
If you’re interested in trying this out yourself with your own web server, but aren’t connected to an IPv6 network, you can enable the IPv6 stack in Windows, and open the URI http://[::1]/ in IE7. The IPv6 address ::1 is the loopback address, similar to the IPv4 address 127.0.0.1. This will allow you to connect to your own computer’s web server via an IPv6 address.
I’ve described the use of and syntax of IPv6 URIs in IE7 at a high level, but if you’re interested in the nitty-gritty details, check out the provided links to documents that describe IPv6 addressing and URIs in greater detail and try out IPv6 URIs on your own. Additionally, I should mention that although support for IPv6 URIs is new to IE7 and not available in IE6, IE6 does support DNS names backed by IPv6 addresses. Please leave me any IPv6 URI related comments or questions.
Software Design Engineer