Network Working Group | M. Rosenau |
Internet-Draft | February 11, 2018 |
Intended status: Experimental | |
Expires: August 15, 2018 |
TCP option "request IPv6 connection"
draft-rosenau-request-v6-option-00
This document describes an idea for a header "option" for the Transmission Control Protocol (TCP).
The extension is used by dual-stack nodes to force the use of the IPv6 protocol instead of the IPv4 protocol when exchanging data over TCP.
Especially if one of the two nodes is a NAT64 or NAT46 router it makes sense not to use IPv4 but IPv6 if both nodes are dual-stack nodes.
This document also suggests to declare the usage of such a method mandatory for all nodes that use IPv4 addresses that will be assigned by RIRs in the future.
Doing so will make it impossible to (mis-) use IPv4 addresses assigned by RIRs to ISPs for IPv4-only nodes that do not support IPv6.
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."
This Internet-Draft will expire on August 15, 2018.
Copyright (c) 2018 IETF Trust and the persons identified as the document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.
Because of the IPv4 address shortage the IPv6 protocol has been developed. Unfortunately many nodes in the internet are still IPv4-only and many ISPs use NATs to establish connections to servers.
Some ISPs use NAT46 to allow IPv4-only clients to connect to an IPv6-only server. In many cases both nodes would be able to establish an IPv6 connection instead of an IPv4 connection because the use of the NAT can be avoided in this case.
This document describes a TCP header "option" which allows both nodes to negotiate the use of the IPv6 protocol instead of the IPv4 protocol.
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14, RFC 2119 and indicate requirement levels for compliant implementations.
In the context of this document a "client" is a node which is establishing a TCP connection to another node by sending the first TCP packet.
In the context of this document a "server" is a node which is waiting for a client to establish a TCP connection with that node.
A NAT64 is a node which allows an IPv6-only client to connect to an IPv4-only server by translating IPv4 to IPv6 packets and vice versa or by acting as IPv6 server and IPv4 client the same time forwarding the data from one TCP connection to the other one.
A NAT46 is a node allowing an IPv4-only client to connect to an IPv6-only server.
Note that according to the definitions above NAT64 and NAT46 nodes are both "clients" and "servers" the same time.
A connection to a server not supporting this extension looks the following way:
client server | | | TCP/IPv4, SYN, V6REQ(00) | +-------------------------------------->| | | | TCP/IPv4, SYN, ACK | |<--------------------------------------+ | | | ... |
Figure 1: Request not understood by server
The client adds an option described in this document to the "options" field of the TCP header.
The server does not understand the option described in this document and it will probably ignore it. The TCP connection will be established "normally"; the option described in this document is not used.
If both the client and the server support this extension but both nodes decide to use IPv4 for the connection the connection looks the following way:
client server | | | TCP/IPv4, SYN, V6REQ(00) | +-------------------------------------->| | | | TCP/IPv4, SYN, ACK, V6REQ(10) | |<--------------------------------------+ | | | ... |
Figure 2: IPv4 negotiated
The server will send the "normal" (SYN/ACK) packet back to the client - as it is done for a normal TCP connection. It will add a certain option to the "options" field of the TCP header indicating that the option in the first packet is understood and supported by the server but it is not used for the current connection.
If the client and the server decide to use IPv6 for the connection the connection looks like this:
client server | | | TCP/IPv4, SYN, V6REQ(00) | +-------------------------------------->| | | | TCP/IPv4, RST, V6REQ(11) | |<--------------------------------------+ | | | TCP/IPv6, SYN | +-------------------------------------->| | | | ... |
Figure 3: IPv6 negotiated
The server sends back a TCP packet containing the IPv6 address of the server and indicating that the IPv4 TCP connection is rejected.
The client will re-send an initial TCP packet (SYN) to the server using IPv6.
There is even a situation where using this option in an IPv6 packet makes sense: When using with NAT64. Such a connection looks like this:
client NAT server | | | | TCP/IPv6, SYN, V6REQ(00) | | +----------------------------------->| TCP/IP(v4 or v6), SYN, V6REQ(00) | | +------------------------------------>| | | | | | TCP/IP, RST, V6REQ(11) | | TCP/IPv6, RST, V6REQ(11) |<------------------------------------+ |<-----------------------------------+ | | | | | TCP/IPv6, SYN | +------------------------------------------------------------------------->| | | | ... |
Figure 4: Using with NATs
The NAT64 sends back a TCP packet containing the IPv6 address of the server and indicating that the TCP connection to the NAT's address is rejected.
The client will re-send an initial TCP packet (SYN) directly to the server using IPv6 not using the NAT64.
In the initial TCP packet (the packet sent by the client to the server that has the SYN field set and the ACK field clear) the following TCP header option will be added by the client:
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | TYPE=V6REQ | LENGTH=3 |0 0| CODE | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 5: Request option format
The first octet of the option is the code "V6REQ" to be assigned by the IANA
The second octet of the option is the length of the option (as described in RFC 793). All codes described in this document use a length of 3 octets.
The high two bits of the third octet are zero and the low six bits are the code described below.
A TCP implementation MUST ignore this option (with the two upper bits in the third octet being zero) when it is found in any other packet but the initial TCP packet (SYN) sent from the client to the server.
If a TCP implementation does not understand the "CODE" (or the "LENGTH" field does not match the "CODE" field) it MUST ignore the option but it SHOULD add a "request not understood" option to the packet sent back to the client.
If client and server decide to use IPv4 for the TCP connection the server answers as if the option was not present (SYN, ACK) but it adds the following option to the "options" field of the TCP header:
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--//---+ | TYPE=V6REQ | LENGTH |1 0| CODE | DATA | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--//---+
Figure 6: Informational response option format
The highest bit of the third octet is one and the bit below is set to zero. The low six bits are the code described below.
A TCP implementation MUST ignore this option (with the two upper bits in the third octet being one and zero) when it is found in any other packet but the TCP packet (SYN, ACK) sent as response to the first packet.
DATA is additional data depending on the "CODE" field.
If a TCP implementation does not understand the "CODE" (or the "LENGTH" field does not match the "CODE" field) it MUST ignore the option.
If client and server decide to use IPv6 for the TCP connection the server denies the IPv4-based connection and the client shall re-establish a connection via IPv6.
The server sends a packet with a special form that any TCP implementation that supports this option MUST understand:
The "source port" field contains the "destination port" of the initial packet and vice versa (just like in the case of a "normal" TCP response).
The "acknowledgement number" field contains the value of the "sequence number" field in the initial packet and vice versa. (Note that none of the two numbers is incremented.)
The "RST" bit MUST be set and "ACK" and "SYN" MUST be zero. The other control bits SHALL be zero.
The "options" field in the TCP header contains the following option:
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--//---+ | TYPE=V6REQ | LENGTH |1 1| CODE | DATA | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--//---+
Figure 7: Force restart response option format
The highest two bits of the third octet are one. The low six bits are the code described below.
A TCP implementation MUST ignore this option (with the two upper bits in the third octet being one) when it is found in any other packet but the TCP packet sent as response to the first packet.
No TCP connection has been established between client and server when the server answered with this packet.
Typically the "V6REQ" option will be the only option in the TCP header in this case because more options make no sense in this case.
The combination "zero-one" for the highest two bits in the third octet is reserved for future use:
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--//---+ | TYPE=V6REQ | LENGTH |0 1| | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--//---+
Figure 8: Reserved option format
A TCP implementation MUST ignore this option (with the two upper bits in the third octet being zero and one) when it is found in any TCP packet.
The following option codes are defined:
Type* Code Length Code 00 1 3 Strong IPv6 request 00 2 3 Weak IPv6 request 10 3 3 Supported for this port 10 4 3 Not supported for this port 10 5 4 Request not supported 11 6 21 Address to be used (*) 00 = valid in request 10 = valid in an informational response 11 = valid in a force restart response
Figure 9: List of option codes
A client sends this option in the initial TCP packet whenever it desires to use IPv6 for the connection as far as it is possible.
If the server understands this option but there is no TCP/IPv6 port which is equivalent to the TCP/IPv4 port the client wants to connect to it MUST answer with "not supported for this port".
If the server understands this option AND there is a TCP/IPv6 port which is equivalent to the TCP/IPv4 port the client wants to connect to the server MUST answer with "address to be used".
This option is similar to the "strong IPv6 request" however it is used if the client does not necessarily prefer IPv6 over IPv4.
If the server understands the option and there is a TCP/IPv6 equivalent for the TCP/IPv4 port but the server also does not prefer using IPv6 over IPv4 the server MUST answer with "supported for this port".
The client may later send a "strong IPv6 request" to get information about the TCP/IPv6 port that can be used instead of the TCP/IPv4 port.
In all other cases the server MUST react on this option the same way as it reacts on a "strong IPv6 request". Especially in the case that the server wants to communicate with the client over IPv6 instead of IPv4 it will answer with "address to be used".
A server sends this option in its first packet (in the answer to the first packet of the TCP connection) as a response to a "weak IPv6 request".
Using this option it indicates that it would support a "strong IPv6 request" for this TCP/IPv4 port.
A server sends this option in its first packet as a response to a "strong" or "weak IPv6 request".
Using this option it indicates that the it is not possible to establish the desired TCP connection via IPv6.
A server sends this option in its first packet as a response to any "request" option that was not understood by the server.
This is the case when the initial packet from the client contained a "V6REQ" option whose topmost two bits of the third octet were zero but the server did not understand the meaning of that option. (For example if the "CODE" field did not have a value understood by the server.)
The server indicates that it ignored the option it did not understand.
Note that the "request not supported" option is only of informational kind; the client SHOULD NOT treat this as error message.
If the server did not understand the value of the "CODE" field the "request not supported" option has the following form:
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | TYPE=V6REQ | LENGTH=4 |1 0| CODE=5 |L|0| ORG. CODE | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 10: Request not supported option format
"ORG. CODE" is the value of the "CODE" field in the request not understood by the server.
"L" is zero if the code is not understood by the server at all. "L" is one if the server understands the code but the length of the option is not correct (currently: 3).
Note: If there will be "requests" (type="00") in the future being longer than three octets a "response" indicating "invalid arguments" should be defined. "Request not supported" should not be used in this case.
A server sends this option in a "force restart response" described above.
Doing so the server instructs the client to use IPv6 instead of IPv4 to connect to the server.
The option has the following form:
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | TYPE=V6REQ | LENGTH=21 |1 1| CODE=6 | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | | | IPv6 ADDRESS | | +-+-+-+-+-+-+-+-+ | | TCP ... | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ... PORT | +-+-+-+-+-+-+-+-+
Figure 11: Address to be used option format
The "IPv6 ADDRESS" and "TCP PORT" fields are the IPv6 address and the TCP/IPv6 port number of a TCP port which is equivalent to the port the client wanted to connect to using IPv4.
Note that especially in the case of NAT46 the IPv6 address may be different for different TCP ports. The TCP port number to be used with IPv6 may also differ from the TCP port number to be used with IPv4 - especially in a NAT46 scenario.
The TCP/IPv6 port returned MUST be absolutely equivalent to the TCP/IPv4 port the client wanted to connect to. This means that when establishing a connection from an IPv6 client to the server there must be no difference in functionality when directly connecting to the TCP/IPv6 port returned by the server compared to connecting to the TCP/IPv4 port via a NAT64.
As described above the option may also used in TCP/IPv6 packets. This typically only makes sense if the server is a NAT.
If the server understands this option, it is a NAT and the client can connect to the actual server (behind the NAT) directly the NAT will respond to a "strong IPv6 request" with an "address to be used" answer.
If the server understands this option but it is not a NAT or the client cannot connect to the actual server directly it will respond with "not supported for this port".
A NAT may behave differently for different ports - e.g. if one port is forwarded to a server which can be accessed directly and another port is forwarded to a server which cannot be accessed directly.
The same is true when a "weak IPv6 request" is received; in this case the NAT may decide if it answers with a "supported for this port" option or with "address to be used".
IPv4 addresses are very rare.
Unfortunately there still seem to be ISPs who receive IPv4 addresses from the RIRs using these addresses for IPv4-only nodes.
To force these ISPs to use the IPv4 addresses they receive from the RIRs for dual-stack nodes and translation mechanisms only the author of the document has the following suggestion:
Possible rules could be (note that most of these rules are already mandatory for "new implementations" according to RFC 6540):
[RFC0793] | Postel, J., "Transmission Control Protocol", STD 7, RFC 793, DOI 10.17487/RFC0793, September 1981. |
[RFC2119] | Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997. |
[RFC0792] | Postel, J., "Internet Control Message Protocol", STD 5, RFC 792, DOI 10.17487/RFC0792, September 1981. |
[RFC6146] | Bagnulo, M., Matthews, P. and I. van Beijnum, "Stateful NAT64: Network Address and Protocol Translation from IPv6 Clients to IPv4 Servers", RFC 6146, DOI 10.17487/RFC6146, April 2011. |
[RFC6540] | George, W., Donley, C., Liljenstolpe, C. and L. Howard, "IPv6 Support Required for All IP-Capable Nodes", BCP 177, RFC 6540, DOI 10.17487/RFC6540, April 2012. |