Difference between revisions of "IPv4-Mapped IPv6 Address"

From Teknologisk videncenter
Jump to: navigation, search
m
m (IP Addresses with a Dual-Stack Socket)
 
(4 intermediate revisions by the same user not shown)
Line 14: Line 14:
 
}}
 
}}
 
IPv4-mapped IPv6 addresses are used in scenarios where IPv6 an IPv6-only application need to communicate with an IPv4 only application using IPv4 packets.
 
IPv4-mapped IPv6 addresses are used in scenarios where IPv6 an IPv6-only application need to communicate with an IPv4 only application using IPv4 packets.
 +
=IPv4-mapped address=
 +
 +
The IPv4-mapped address, 0:0:0:0:0:FFFF:w.x.y.z or ::FFFF:w.x.y.z, is used to represent an IPv4-only node to an IPv6 node. It is used only for internal representation. The IPv4-mapped address is never used as a source or destination address for an IPv6 packet. The IPv6 protocol does not support the use of IPv4-mapped addresses.<ref>http://technet.microsoft.com/en-us/library/cc759208(WS.10).aspx</ref>
 +
 +
=IP Addresses with a Dual-Stack Socket=
 +
Dual-stack sockets always require IPv6 addresses. The ability to interact with an IPv4 address requires the use of the IPv4-mapped IPv6 address format. Any IPv4 addresses must be represented in the IPv4-mapped IPv6 address format which enables an IPv6 only application to communicate with an IPv4 node. The IPv4-mapped IPv6 address format allows the IPv4 address of an IPv4 node to be represented as an IPv6 address. The IPv4 address is encoded into the low-order 32 bits of the IPv6 address, and the high-order 96 bits hold the fixed prefix 0:0:0:0:0:FFFF. The IPv4-mapped IPv6 address format is specified in RFC 4291. For more information, see www.ietf.org/rfc/rfc4291.txt. The IN6ADDR_SETV4MAPPED macro in Mstcpip.h can be used to convert an IPv4 address to the required IPv4-mapped IPv6 address format.
 +
 +
If the underlying protocol is actually IPv4, then the IPv4 address is mapped into an IPv4-mapped IPv6 address format. That is the, family field in the SOCKADDR structure indicates AF_INET6, but an IPv4-mapped IPv6 address is encoded in the IPv6 address structure. For a dual-stack socket in listening mode, this means that any accepted IPv4 connections will return an IPv4-mapped IPv6 address. For a dual-stack socket that is connecting to an IPv4 destination, the SOCKADDR structure passed to connect must be an IPv4-mapped IPv6 address. Applications must take care to handle these IPv4-mapped IPv6 addresses appropriately and only use them with dual stack sockets. If an IP address is to be passed to a regular IPv4 socket, the address must be a regular IPv4 address not a IPv4-mapped IPv6 address.<ref>http://msdn.microsoft.com/en-us/library/windows/desktop/bb513665(v=vs.85).aspx</ref>
 +
 +
=Examples=
 +
Only seen working application using IPv4-mapped IPv6 addresses is Windows 7 ping!!!
 
<source lang=cli>
 
<source lang=cli>
 
<input>
 
<input>
C:\Users\Henrik thomsen><notice>ping ::ffff:192.168.146.1</notice>
+
C:\Users\Henrik thomsen><notice>ping ::ffff:192.168.139.50</notice>
  
Pinging 192.168.146.1 with 32 bytes of data:
+
Pinging 192.168.139.50 with 32 bytes of data:
Reply from 192.168.146.1: bytes=32 time=1ms TTL=255
+
Reply from 192.168.139.50: bytes=32 time<1ms TTL=62
Reply from 192.168.146.1: bytes=32 time=1ms TTL=255
+
Reply from 192.168.139.50: bytes=32 time<1ms TTL=62
Reply from 192.168.146.1: bytes=32 time=2ms TTL=255
+
Reply from 192.168.139.50: bytes=32 time<1ms TTL=62
Reply from 192.168.146.1: bytes=32 time=2ms TTL=255
+
Reply from 192.168.139.50: bytes=32 time<1ms TTL=62
  
Ping statistics for 192.168.146.1:
+
Ping statistics for 192.168.139.50:
 
     Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
 
     Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
 
Approximate round trip times in milli-seconds:
 
Approximate round trip times in milli-seconds:
     Minimum = 1ms, Maximum = 2ms, Average = 1ms
+
     Minimum = 0ms, Maximum = 0ms, Average = 0ms
 +
 
 
</input>
 
</input>
 
</source>
 
</source>
Line 47: Line 59:
 
</input>
 
</input>
 
</source>
 
</source>
 +
=References=
 +
<references/>
 
{{source cli}}
 
{{source cli}}

Latest revision as of 08:29, 25 November 2011

IPv4 Mapped
IPv6 Address Type: IPv4 Mapped
Prefix:  ::ffff/96
Local Routeable: Yes
Global Routeable: Yes
Global Unique: Yes
Example:  ::ffff:83.90.47.30
IPv4 Equivalent: None
Described in: rfc4291
rfc4038 section 4.2
Explanation

These addresses are used to embed IPv4 addresses in an IPv6 address. One use for this is in a dual stack transition scenario where IPv4 addresses can be mapped into an IPv6 address.

See RFC 4038 for more details

IPv4-mapped IPv6 addresses are used in scenarios where IPv6 an IPv6-only application need to communicate with an IPv4 only application using IPv4 packets.

IPv4-mapped address

The IPv4-mapped address, 0:0:0:0:0:FFFF:w.x.y.z or ::FFFF:w.x.y.z, is used to represent an IPv4-only node to an IPv6 node. It is used only for internal representation. The IPv4-mapped address is never used as a source or destination address for an IPv6 packet. The IPv6 protocol does not support the use of IPv4-mapped addresses.[1]

IP Addresses with a Dual-Stack Socket

Dual-stack sockets always require IPv6 addresses. The ability to interact with an IPv4 address requires the use of the IPv4-mapped IPv6 address format. Any IPv4 addresses must be represented in the IPv4-mapped IPv6 address format which enables an IPv6 only application to communicate with an IPv4 node. The IPv4-mapped IPv6 address format allows the IPv4 address of an IPv4 node to be represented as an IPv6 address. The IPv4 address is encoded into the low-order 32 bits of the IPv6 address, and the high-order 96 bits hold the fixed prefix 0:0:0:0:0:FFFF. The IPv4-mapped IPv6 address format is specified in RFC 4291. For more information, see www.ietf.org/rfc/rfc4291.txt. The IN6ADDR_SETV4MAPPED macro in Mstcpip.h can be used to convert an IPv4 address to the required IPv4-mapped IPv6 address format.

If the underlying protocol is actually IPv4, then the IPv4 address is mapped into an IPv4-mapped IPv6 address format. That is the, family field in the SOCKADDR structure indicates AF_INET6, but an IPv4-mapped IPv6 address is encoded in the IPv6 address structure. For a dual-stack socket in listening mode, this means that any accepted IPv4 connections will return an IPv4-mapped IPv6 address. For a dual-stack socket that is connecting to an IPv4 destination, the SOCKADDR structure passed to connect must be an IPv4-mapped IPv6 address. Applications must take care to handle these IPv4-mapped IPv6 addresses appropriately and only use them with dual stack sockets. If an IP address is to be passed to a regular IPv4 socket, the address must be a regular IPv4 address not a IPv4-mapped IPv6 address.[2]

Examples

Only seen working application using IPv4-mapped IPv6 addresses is Windows 7 ping!!!

<input>
C:\Users\Henrik thomsen><notice>ping ::ffff:192.168.139.50</notice>

Pinging 192.168.139.50 with 32 bytes of data:
Reply from 192.168.139.50: bytes=32 time<1ms TTL=62
Reply from 192.168.139.50: bytes=32 time<1ms TTL=62
Reply from 192.168.139.50: bytes=32 time<1ms TTL=62
Reply from 192.168.139.50: bytes=32 time<1ms TTL=62

Ping statistics for 192.168.139.50:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

</input>

or same as

<input>
C:\Users\Henrik thomsen><notice>ping ::ffff:c0a8:8b32</notice>

Pinging 192.168.139.50 with 32 bytes of data:
Reply from 192.168.139.50: bytes=32 time<1ms TTL=62
Reply from 192.168.139.50: bytes=32 time<1ms TTL=62
Reply from 192.168.139.50: bytes=32 time<1ms TTL=62
Reply from 192.168.139.50: bytes=32 time<1ms TTL=62

Ping statistics for 192.168.139.50:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms
</input>

References