rfc2765 (Stateless IP-ICMP Translation Algorithm (SIIT) )
rfc2765 (Stateless IP-ICMP Translation Algorithm (SIIT) )
Nordmark
Request for Comments: 2765 Sun Microsystems
Category: Standards Track February 2000
Copyright Notice
Abstract
Acknowledgements
Table of Contents
- A completely new network with new devices that all support IPv6.
In this case it might be beneficial to not have to configure the
routers within the new network to route IPv4 since none of the
hosts in the new network are configured with IPv4 addresses. But
these new IPv6 devices might occasionally need to communicate with
some IPv4 nodes out on the Internet.
This specification does not cover how an IPv6 node can acquire a
temporary IPv4 address and how such a temporary address be registered
in the DNS. The DHCP protocol, perhaps with some extensions, could
probably be used to acquire temporary addresses with short leases but
that is outside the scope of this document. Also, the mechanism for
routing this IPv4-translated IPv6 address in the site is not
specified in this document.
___________
/ \
[IPv6 Host]---[SIIT]---------< IPv4 network>--[IPv4 Host]
| \___________/
(pool of IPv4 addresses)
___________ ___________
/ \ / \
[IPv6 Host]--< Dual network>--[SIIT]--< IPv4 network>--[IPv4 Host]
\___________/ | \___________/
(pool of IPv4 addresses)
The use of this translation algorithm assumes that the IPv6 network
is somehow well connected i.e. when an IPv6 node wants to communicate
with another IPv6 node there is an IPv6 path between them. Various
tunneling schemes exist that can provide such a path, but those
mechanisms and their use is outside the scope of this document.
The IPv6 protocol [IPv6] has been designed so that the TCP and UDP
pseudo-header checksums are not affected by the translations
specified in this document, thus the translator does not need to
modify normal TCP and UDP headers. The only exceptions are
unfragmented IPv4 UDP packets which need to have a UDP checksum
computed since a pseudo-header checksum is required for UDP in IPv6.
Also, ICMPv6 include a pseudo-header checksum but it is not present
in ICMPv4 thus the checksum in ICMP messages need to be modified by
the translator. In addition, ICMP error messages contain an IP
header as part of the payload thus the translator need to rewrite
those parts of the packets to make the receiver be able to understand
the included IP header. However, all of the translator’s operations,
including path MTU discovery, are stateless in the sense that the
translator operates independently on each packet and does not retain
any state from one packet to another. This allows redundant
translator boxes without any coordination and a given TCP connection
can have the two directions of packets go through different
translator boxes.
For ESP Tunnel-mode to work through the translator the IPv6 node
would have to be able to both parse and generate "inner" IPv4 headers
since the inner IP will be encrypted together with the transport
protocol.
1.2. Assumptions
The IPv6 nodes using the translator must have an IPv4-translated IPv6
address while it is communicating with IPv4-only nodes.
The use of the algorithm assumes that there is an IPv4 address pool
used to generate IPv4-translated addresses. Routing needs to be able
to route any IPv4 packets, whether generated "outside" or "inside"
the translator, destined to addresses in this pool towards the
translator. This implies that the address pool can not be assigned
to subnets but must be separated from the IPv4 subnets used on the
"inside" of the translator.
Fragmented IPv4 UDP packets that do not contain a UDP checksum (i.e.
the UDP checksum field is zero) are not of significant use over
wide-areas in the Internet and will not be translated by the
translator. An informal trace [MILLER] in the backbone showed that
out of 34,984,468 IP packets there were 769 fragmented UDP packets
with a zero checksum. However, all of them were due to malicious or
broken behavior; a port scan and first fragments of IP packets that
are not a multiple of 8 bytes.
need to modify their behavior depending on the type of the peer, such
as ftp determining whether to fallback to using the PORT/PASV command
when EPRT/EPSV fails (as specified in [FTPEXT]), they already need to
do that when running on dual nodes and the presense of translators
does not add anything. For example, when using the socket API
[BSDAPI] the applications know that the peer is IPv6 if they get an
AF_INET6 address from the name service and the address is not an
IPv4-mapped address (i.e., IN6_IS_ADDR_V4MAPPED returns false). If
this is not the case, i.e., the address is AF_INET or an IPv4-mapped
IPv6 address, the peer is IPv4.
One way of viewing the translator, which might help clarify why
applications do not need to know that a translator is used, is to
look at the information that is passed from the transport layer to
the network layer. If the transport passes down an IPv4 address
(whether or not is in the IPv4-mapped encoding) this means that at
some point there will be IPv4 packets generated. In a dual node the
generation of the IPv4 packets takes place in the sending node. In
an IPv6-only node conceptually the only difference is that the IPv4
packet is generated by the translator - all the information that the
transport layer passed to the network layer will be conveyed to the
translator in some form. That form just "happens" to be in the form
of an IPv6 header.
2. Terminology
2.1. Addresses
IPv4-mapped:
An address of the form 0::ffff:a.b.c.d which refers
to a node that is not IPv6-capable. In addition to
its use in the API this protocol uses IPv4-mapped
addresses in IPv6 packets to refer to an IPv4 node.
IPv4-compatible:
An address of the form 0::0:a.b.c.d which refers to
an IPv6/IPv4 node that supports automatic tunneling.
Such addresses are not used in this protocol.
IPv4-translated:
An address of the form 0::ffff:0:a.b.c.d which refers
to an IPv6-enabled node. Note that the prefix
0::ffff:0:0:0/96 is chosen to checksum to zero to
avoid any changes to the transport protocol’s pseudo
header checksum.
2.2. Requirements
The keywords MUST, MUST NOT, REQUIRED, SHALL, SHALL NOT, SHOULD,
SHOULD NOT, RECOMMENDED, MAY, and OPTIONAL, when they appear in this
document, are to be interpreted as described in [KEYWORDS].
+-------------+ +-------------+
| IPv4 | | IPv6 |
| Header | | Header |
+-------------+ +-------------+
| Transport | | Fragment |
| Layer | ===> | Header |
| Header | |(not always) |
+-------------+ +-------------+
| | | Transport |
~ Data ~ | Layer |
| | | Header |
+-------------+ +-------------+
| |
~ Data ~
| |
+-------------+
IPv4-to-IPv6 Translation
One of the differences between IPv4 and IPv6 is that in IPv6 path MTU
discovery is mandatory but it is optional in IPv4. This implies that
IPv6 routers will never fragment a packet - only the sender can do
fragmentation.
When the IPv4 node performs path MTU discovery (by setting the DF bit
in the header) the path MTU discovery can operate end-to-end i.e.
across the translator. In this case either IPv4 or IPv6 routers
might send back ICMP "packet too big" messages to the sender. When
these ICMP errors are sent by the IPv6 routers they will pass through
a translator which will translate the ICMP error to a form that the
IPv4 sender can understand. In this case an IPv6 fragment header is
only included if the IPv4 packet is already fragmented.
However, when the IPv4 sender does not perform path MTU discovery the
translator has to ensure that the packet does not exceed the path MTU
on the IPv6 side. This is done by fragmenting the IPv4 packet so
that it fits in 1280 byte IPv6 packet since IPv6 guarantees that 1280
byte packets never need to be fragmented. Also, when the IPv4 sender
does not perform path MTU discovery the translator MUST always
include an IPv6 fragment header to indicate that the sender allows
fragmentation. That is needed should the packet pass through an
IPv6-to-IPv4 translator.
The above rules ensure that when packets are fragmented either by the
sender or by IPv4 routers that the low-order 16 bits of the fragment
identification is carried end-end to ensure that packets are
correctly reassembled. In addition, the rules use the presence of an
IPv6 fragment header to indicate that the sender might not be using
path MTU discovery i.e. the packet should not have the DF flag set
should it later be translated back to IPv4.
Other than the special rules for handling fragments and path MTU
discovery the actual translation of the packet header consists of a
simple mapping as defined below. Note that ICMP packets require
special handling in order to translate the content of ICMP error
message and also to add the ICMP pseudo-header checksum.
If the DF flag is not set and the IPv4 packet will result in an IPv6
packet larger than 1280 bytes the IPv4 packet MUST be fragmented
prior to translating it. Since IPv4 packets with DF not set will
always result in a fragment header being added to the packet the IPv4
packets must be fragmented so that their length, excluding the IPv4
header, is at most 1232 bytes (1280 minus 40 for the IPv6 header and
8 for the Fragment header). The resulting fragments are then
translated independently using the logic described below.
If the DF bit is set and the packet is not a fragment (i.e., the MF
flag is not set and the Fragment Offset is zero) then there is no
need to add a fragment header to the packet. The IPv6 header fields
are set as follows:
Version:
6
Traffic Class:
By default, copied from IP Type Of Service and
Precedence field (all 8 bits are copied). According
to [DIFFSERV] the semantics of the bits are identical
in IPv4 and IPv6. However, in some IPv4 environments
these fields might be used with the old semantics of
"Type Of Service and Precedence". An implementation
of a translator SHOULD provide the ability to ignore
the IPv4 "TOS" and always set the IPv6 traffic class
to zero.
Flow Label:
0 (all zero bits)
Payload Length:
Total length value from IPv4 header, minus the size
of the IPv4 header and IPv4 options, if present.
Next Header:
Protocol field copied from IPv4 header
Hop Limit:
TTL value copied from IPv4 header. Since the
translator is a router, as part of forwarding the
packet it needs to decrement either the IPv4 TTL
(before the translation) or the IPv6 Hop Limit (after
the translation). As part of decrementing the TTL or
Hop Limit the translator (as any router) needs to
check for zero and send the ICMPv4 or ICMPv6 "ttl
exceeded" error.
Source Address:
The low-order 32 bits is the IPv4 source address.
The high-order 96 bits is the IPv4-mapped prefix
(::ffff:0:0/96)
Destination Address:
The low-order 32 bits is the IPv4 destination
address. The high-order 96 bits is the IPv4-
translated prefix (0::ffff:0:0:0/96)
If IPv4 options are present in the IPv4 packet, they are ignored
i.e., there is no attempt to translate them. However, if an
unexpired source route option is present then the packet MUST instead
be discarded, and an ICMPv4 "destination unreachable/source route
failed" (Type 3/Code 5) error message SHOULD be returned to the
sender.
IPv6 fields:
Payload Length:
Total length value from IPv4 header, plus 8 for the
fragment header, minus the size of the IPv4 header
and IPv4 options, if present.
Next Header:
Fragment Header (44).
Next Header:
Protocol field copied from IPv4 header.
Fragment Offset:
Fragment Offset copied from the IPv4 header.
M flag:
More Fragments bit copied from the IPv4 header.
Identification:
The low-order 16 bits copied from the Identification
field in the IPv4 header. The high-order 16 bits set
to zero.
If a UDP packet has a zero UDP checksum then a valid checksum must be
calculated in order to translate the packet. A stateless translator
can not do this for fragmented packets but [MILLER] indicates that
fragmented UDP packets with a zero checksum appear to only be used
for malicious purposes. Thus this is not believed to be a noticeable
limitation.
All ICMP messages that are to be translated require that the ICMP
checksum field be updated as part of the translation since ICMPv6,
unlike ICMPv4, has a pseudo-header checksum just like UDP and TCP.
In addition all ICMP packets need to have the Type value translated
and for ICMP error messages the included IP header also needs
translation.
IGMP messages:
Code 6,7:
Set Code to 0 (no route to destination).
Code 8:
Set Code to 0 (no route to destination).
Redirect (Type 5)
Single hop message. Silently drop.
There are some differences between the IPv4 and the IPv6 ICMP error
message formats as detailed above. In addition, the ICMP error
messages contain the IP header for the packet in error which needs to
be translated just like a normal IP header. The translation of this
"packet in error" is likely to change the length of the datagram thus
the Payload Length field in the outer IPv6 header might need to be
updated.
+-------------+ +-------------+
| IPv4 | | IPv6 |
| Header | | Header |
+-------------+ +-------------+
| ICMPv4 | | ICMPv6 |
| Header | | Header |
+-------------+ +-------------+
| IPv4 | ===> | IPv6 |
| Header | | Header |
+-------------+ +-------------+
| Partial | | Partial |
| Transport | | Transport |
| Layer | | Layer |
| Header | | Header |
+-------------+ +-------------+
+-------------+ +-------------+
| IPv6 | | IPv4 |
| Header | | Header |
+-------------+ +-------------+
| Fragment | | Transport |
| Header | ===> | Layer |
|(if present) | | Header |
+-------------+ +-------------+
| Transport | | |
| Layer | ~ Data ~
| Header | | |
+-------------+ +-------------+
| |
~ Data ~
| |
+-------------+
IPv6-to-IPv4 Translation
There are some differences between IPv6 and IPv4 in the area of
fragmentation and the minimum link MTU that effect the translation.
An IPv6 link has to have an MTU of 1280 bytes or greater. The
corresponding limit for IPv4 is 68 bytes. Thus, unless there were
special measures, it would not be possible to do end-to-end path MTU
discovery when the path includes an IPv6-to-IPv4 translator since the
IPv6 node might receive ICMP "packet too big" messages originated by
an IPv4 router that report an MTU less than 1280. However, [IPv6]
requires that IPv6 nodes handle such an ICMP "packet too big" message
by reducing the path MTU to 1280 and including an IPv6 fragment
header with each packet. This allows end-to-end path MTU discovery
across the translator as long as the path MTU is 1280 bytes or
greater. When the path MTU drops below the 1280 limit the IPv6
sender will originate 1280 byte packets that will be fragmented by
IPv4 routers along the path after being translated to IPv4.
The only drawback with this scheme is that it is not possible to use
PMTU to do optimal UDP fragmentation (as opposed to completely
avoiding fragmentation) at sender since the presence of an IPv6
Other than the special rules for handling fragments and path MTU
discovery the actual translation of the packet header consists of a
simple mapping as defined below. Note that ICMP packets require
special handling in order to translate the content of ICMP error
message and also to add the ICMP pseudo-header checksum.
If there is no IPv6 Fragment header the IPv4 header fields are set as
follows:
Version:
4
Total Length:
Payload length value from IPv6 header, plus the size
of the IPv4 header.
Identification:
All zero.
Flags:
The More Fragments flag is set to zero. The Don’t
Fragments flag is set to one.
Fragment Offset:
All zero.
Time to Live:
Hop Limit value copied from IPv6 header. Since the
translator is a router, as part of forwarding the
packet it needs to decrement either the IPv6 Hop
Limit (before the translation) or the IPv4 TTL (after
the translation). As part of decrementing the TTL or
Hop Limit the translator (as any router) needs to
check for zero and send the ICMPv4 or ICMPv6 "ttl
exceeded" error.
Protocol:
Next Header field copied from IPv6 header.
Header Checksum:
Computed once the IPv4 header has been created.
Source Address:
If the IPv6 source address is an IPv4-translated
address then the low-order 32 bits of the IPv6 source
address is copied to the IPv4 source address.
Otherwise, the source address is set to 0.0.0.0. The
use of 0.0.0.0 is to avoid completely dropping e.g.
ICMPv6 error messages sent by IPv6-only routers which
makes e.g. traceroute present something for the
IPv6-only hops.
Destination Address:
IPv6 packets that are translated have an IPv4-mapped
destination address. Thus the low-order 32 bits of
the IPv6 destination address is copied to the IPv4
destination address.
If the IPv6 packet contains a Fragment header the header fields are
set as above with the following exceptions:
Total Length:
Payload length value from IPv6 header, minus 8 for
the Fragment header, plus the size of the IPv4
header.
Identification:
Copied from the low-order 16-bits in the
Identification field in the Fragment header.
Flags:
The More Fragments flag is copied from the M flag in
the Fragment header. The Don’t Fragments flag is set
to zero allowing this packet to be fragmented by IPv4
routers.
Fragment Offset:
Copied from the Fragment Offset field in the Fragment
Header.
Protocol:
Next Header value copied from Fragment header.
All ICMP messages that are to be translated require that the ICMP
checksum field be updated as part of the translation since ICMPv6,
unlike ICMPv4, has a pseudo-header checksum just like UDP and TCP.
In addition all ICMP packets need to have the Type value translated
and for ICMP error messages the included IP header also needs
translation.
There are some differences between the IPv4 and the IPv6 ICMP error
message formats as detailed above. In addition, the ICMP error
messages contain the IP header for the packet in error which needs to
be translated just like a normal IP header. The translation of this
"packet in error" is likely to change the length of the datagram thus
the Total Length field in the outer IPv4 header might need to be
updated.
+-------------+ +-------------+
| IPv6 | | IPv4 |
| Header | | Header |
+-------------+ +-------------+
| ICMPv6 | | ICMPv4 |
| Header | | Header |
+-------------+ +-------------+
| IPv6 | ===> | IPv4 |
| Header | | Header |
+-------------+ +-------------+
| Partial | | Partial |
| Transport | | Transport |
| Layer | | Layer |
| Header | | Header |
+-------------+ +-------------+
o Should the peer have AAAA/A6 address records the application (or
resolver) SHOULD never fall back to looking for A address records
even if communication fails using the available AAAA/A6 records.
The reason for this restriction is to prevent traffic between two
IPv6 nodes (which AAAA/A6 records in the DNS) from accidentally
going through SIIT translators twice; from IPv6 to IPv4 and to
IPv6 again. It is considered preferable to instead signal a
failure to communicate to the application.
6. Security Considerations
The use of stateless IP/ICMP translators does not introduce any new
security issues beyond the security issues that are already present
in the IPv4 and IPv6 protocols and in the routing protocols which are
used to make the packets reach the translator.
Packets with ESP can be translated since ESP does not depend on
header fields prior to the ESP header. Note that ESP transport mode
is easier to handle than ESP tunnel mode; in order to use ESP tunnel
mode the IPv6 node needs to be able to generate an inner IPv4 header
when transmitting packets and remove such an IPv4 header when
receiving packets.
References
Author’s Address
Erik Nordmark
Sun Microsystems, Inc.
901 San Antonio Road
Palo Alto, CA 94303
USA
The limited permissions granted above are perpetual and will not be
revoked by the Internet Society or its successors or assigns.
Acknowledgement