Quick Mode. The initiator MUST send the payloads if it proposes any
UDP-Encapsulated-Transport mode, and the responder MUST send the
payload only if it selected UDP-Encapsulated-Transport mode. It is
possible that the initiator sends the NAT-OA payload but proposes
both UDP-Encapsulated transport and tunnel mode. Then the responder
selects the UDP-Encapsulated tunnel mode and does not send the NAT-OA
payload back.
The format of the NAT-OA packet is
1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8
+---------------+---------------+---------------+---------------+
| Next Payload | RESERVED | Payload length |
+---------------+---------------+---------------+---------------+
| ID Type | RESERVED | RESERVED |
+---------------+---------------+---------------+---------------+
| IPv4 (4 octets) or IPv6 address (16 octets) |
+---------------+---------------+---------------+---------------+
The payload type for the NAT original address payload is 21.
The ID type is defined in the [RFC2407]. Only ID_IPV4_ADDR and
ID_IPV6_ADDR types are allowed. The two reserved fields after the ID
Type must be zero.
The following example is of Quick Mode using NAT-OA payloads:
Initiator Responder
------------ ------------
HDR*, HASH(1), SA, Ni, [, KE]
[, IDci, IDcr ]
[, NAT-OAi, NAT-OAr] -->
<-- HDR*, HASH(2), SA, Nr, [, KE]
[, IDci, IDcr ]
[, NAT-OAi, NAT-OAr]
HDR*, HASH(3) -->
6. Initial Contact Notifications
The source IP and port address of the INITIAL-CONTACT notification
for the host behind NAT are not meaningful (as NAT can change them),
so the IP and port numbers MUST NOT be used to determine which
IKE/IPsec SAs to remove (see [RFC3715], section 2.1, case c). The ID
payload sent from the other end SHOULD be used instead; i.e., when an
INITIAL-CONTACT notification is received from the other end, the
receiving end SHOULD remove all the SAs associated with the same ID
payload.
7. Recovering from the Expiring NAT Mappings
There are cases where NAT box decides to remove mappings that are
still alive (for example, when the keepalive interval is too long, or
when the NAT box is rebooted). To recover from this, ends that are
NOT behind NAT SHOULD use the last valid UDP encapsulated IKE or
IPsec packet from the other end to determine which IP and port
addresses should be used. The host behind dynamic NAT MUST NOT do
this, as otherwise it opens a DoS attack possibility because the IP
address or port of the other host will not change (it is not behind
NAT).
Keepalives cannot be used for these purposes, as they are not
authenticated, but any IKE authenticated IKE packet or ESP packet can
be used to detect whether the IP address or the port has changed.
8. Security Considerations
Whenever changes to some fundamental parts of a security protocol are
proposed, the examination of security implications cannot be skipped.
Therefore, here are some observations about the effects, and about
whether or not these effects matter.
o IKE probes reveal NAT-Traversal support to anyone watching the
traffic. Disclosing that NAT-Traversal is supported does not
introduce new vulnerabilities.
o The value of authentication mechanisms based on IP addresses
disappears once NATs are in the picture. That is not necessarily
a bad thing (for any real security, authentication measures other
than IP addresses should be used). This means that authentication
with pre-shared keys cannot be used in Main Mode without using
group-shared keys for everybody behind the NAT box. Using group
shared keys is a huge risk because it allows anyone in the group
to authenticate to any other party and claim to be anybody in the
group; e.g., a normal user could impersonate a vpn-gateway and act
as a man in the middle, and read/modify all traffic to/from others
in the group. Use of group-shared keys is NOT RECOMMENDED.
o As the internal address space is only 32 bits and is usually very
sparse, it might be possible for the attacker to find out the
internal address used behind the NAT box by trying all possible
IP-addresses to find the matching hash. The port numbers are
normally fixed to 500, and the cookies can be extracted from the
packet. This limits the hash calculations to 2^32. If an
educated guess of the private address space is made, then the
number of hash calculations needed to find out the internal IP
address goes down to 2^24 + 2 * (2^16).
o Neither NAT-D payloads nor Vendor ID payloads are authenticated in
Main Mode nor in Aggressive Mode. This means that attacker can
remove those payloads, modify them, or add them. By removing or
adding them, the attacker can cause Denial of Service attacks. By
modifying the NAT-D packets, the attacker can cause both ends to
use UDP-Encapsulated modes instead of directly using tunnel or
transport mode, thus wasting some bandwidth.
o Sending the original source address in the Quick Mode reveals the
internal IP address behind the NAT to the other end. In this case
we have already authenticated the other end, and sending the
original source address is only needed in transport mode.
o Updating the IKE SA/ESP UDP encapsulation IP addresses and ports
for each valid authenticated packet can cause DoS if an attacker
can listen to all traffic in the network, change the order of the
packets, and inject new packets before the packet he has already
seen. In other words, the attacker can take an authenticated
packet from the host behind NAT, change the packet UDP source or
destination ports or IP addresses and send it out to the other end
before the real packet reaches it. The host not behind the NAT
will update its IP address and port mapping and send further
traffic to the wrong host or port. This situation is fixed
immediately when the attacker stops modifying the packets, as the
first real packet will fix the situation. Implementations SHOULD
AUDIT the event every time the mapping is changed, as it should
not happen that often.
9. IANA Considerations
This document contains two new "magic numbers" allocated from the
existing IANA registry for IPsec and renames existing registered port
4500. This document also defines 2 new payload types for IKE.
The following are new items that have been added in the "Internet
Security Association and Key Management Protocol (ISAKMP)
Identifiers" Encapsulation Mode registry:
Name Value Reference
---- ----- ---------
UDP-Encapsulated-Tunnel 3 [RFC3947]
UDP-Encapsulated-Transport 4 [RFC3947]
Change in the registered port registry:
Keyword Decimal Description Reference
------- ------- ----------- ---------
ipsec-nat-t 4500/tcp IPsec NAT-Traversal [RFC3947]
ipsec-nat-t 4500/udp IPsec NAT-Traversal [RFC3947]
New IKE payload numbers need to be added to the Next Payload Types
registry:
NAT-D 20 NAT Discovery Payload
NAT-OA 21 NAT Original Address Payload
10. IAB Considerations
The UNSAF [RFC3424] questions are addressed by the IPsec-NAT
compatibility requirements document [RFC3715].
11. Acknowledgments
Thanks to Markus Stenberg, Larry DiBurro, and William Dixon, who
contributed actively to this document.
Thanks to Tatu Ylonen, Santeri Paavolainen, and Joern Sierwald, who
contributed to the document used as the base for this document.
12. References
12.1. Normative References
[RFC2409] Harkins, D. and D. Carrel, "The Internet Key Exchange
(IKE)", RFC 2409, November 1998.
[RFC2407] Piper, D., "The Internet IP Security Domain of
Interpretation for ISAKMP", RFC 2407, November 1998.
[RFC3948] Huttunen, A., Swander, B., Volpe, V., DiBurro, L., and M.
Stenberg, "UDP Encapsulation of IPsec Packets", RFC 3948,
January 2005.
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119, March 1997.
12.2. Informative References
[RFC3715] Aboba, B. and W. Dixon, "IPsec-Network Address Translation
(NAT) Compatibility Requirements", RFC 3715, March 2004.
[RFC3424] Daigle, L. and IAB, "IAB Considerations for UNilateral
Self-Address Fixing (UNSAF) Across Network Address
Translation", RFC 3424, November 2002.
Authors’ Addresses
Tero Kivinen
SafeNet, Inc.
Fredrikinkatu 47
FIN-00100 HELSINKI
Finland
EMail: kivinen@safenet-inc.com
Ari Huttunen
F-Secure Corporation
Tammasaarenkatu 7,
FIN-00181 HELSINKI
Finland
EMail: Ari.Huttunen@F-Secure.com
Brian Swander
Microsoft
One Microsoft Way
Redmond, WA 98052
USA
EMail: briansw@microsoft.com
Victor Volpe
Cisco Systems
124 Grove Street
Suite 205
Franklin, MA 02038
USA
EMail: vvolpe@cisco.com
Full Copyright Statement
Copyright (C) The Internet Society (2005).
This document is subject to the rights, licenses and restrictions
contained in BCP 78, and except as set forth therein, the authors
retain all their rights.
This document and the information contained herein are provided on an
"AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS
OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET
ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE
INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
Intellectual Property
The IETF takes no position regarding the validity or scope of any
Intellectual Property Rights or other rights that might be claimed to
pertain to the implementation or use of the technology described in
this document or the extent to which any license under such rights
might or might not be available; nor does it represent that it has
made any independent effort to identify any such rights. Information
on the IETF’s procedures with respect to rights in IETF Documents can
be found in BCP 78 and BCP 79.
Copies of IPR disclosures made to the IETF Secretariat and any
assurances of licenses to be made available, or the result of an
attempt made to obtain a general license or permission for the use of
such proprietary rights by implementers or users of this
specification can be obtained from the IETF on-line IPR repository at
http://www.ietf.org/ipr.
The IETF invites any interested party to bring to its attention any
copyrights, patents or patent applications, or other proprietary
rights that may cover technology that may be required to implement
this standard. Please address the information to the IETF at ietf-
ipr@ietf.org.
Acknowledgement
Funding for the RFC Editor function is currently provided by the
Internet Society.