• Welcome to Hurricane Electric's IPv6 Tunnel Broker Forums.

IPv4- mapped and -compatible addresses

Started by Ninho, September 15, 2009, 11:16:40 AM

Previous topic - Next topic

Ninho

I don't get a hint, what purpose can be served by addresses such as (e.g.)

::208.77.188.166
::ffff:208.77.188.166

jimb

Quote from: Ninho on September 15, 2009, 11:16:40 AM
I don't get a hint, what purpose can be served by addresses such as (e.g.)

::208.77.188.166
::ffff:208.77.188.166
The first is an "IPv4-Compatible IPv6 address" and is deprecated.  It was used with some transition methods, and to represent IPv4 addresses using the space of an IPv6.  It was deprecated in favor if IPv4-mapped IPv6 addresses.

The second is an "IPv4-Mapped IPv6 Address".  It's another transition thing that is used to represent v4 addresses in a v6.  It's mainly used as an OS API thing to allow applications to do IPv4 via the IPv6 networking APIs (sockets, etc).  That way, when you write an application and want to do both IPv6 and IPv4, you can use the same calls and structures, etc, for both IPv6 and IPv4.  Without such a mechanism, an application such as a web server would have to reserve a socket and do a separate listen on both an IPv4 and IPv6 socket, manage them separately, etc.  With this mechanism, the application need only do a listen using the IPv6 API, and it can accept both IPv4 and IPv6 connections through the same API.  Doing a TCP connect also works similarly.  If the destination address in the sockaddr structure is a mapped address, it'll go through the IPv4 stack, otherwise it'll use the IPv6 stack.

So, when you see ::ffff:a.b.c.d type addresses in configuration files, output of commands, in your logs, etc, it means those applications are using the IPv6 networking APIs in the manner I described.

See this wiki, rfc4291, and rfc4038 for more detail.

Ninho

Quote from: jimb on September 15, 2009, 12:35:10 PM
See http://en.wikipedia.org/wiki/IPv6#IPv4_mapped_addresses

Ah, great! I was trying those addresses in Windows 2k, and perplex cause I could not make anything work : your 'pedia article explains why (separated 6- & 4-stacks.)

I should've tried in Linux instead : this works as designed!

ninho@kiwi:~> telnet ::ffff:10.0.0.138
Trying ::ffff:10.0.0.138...
Connected to ::ffff:10.0.0.138.
Escape character is '^]'.


snarked

Technically, Windows works as designed too.  Its design is poor!