idnits 2.17.1 draft-ietf-hip-native-nat-traversal-12.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == Line 1338 has weird spacing: '...eserved zero...' == Line 1374 has weird spacing: '... Min Ta the ...' == Line 1405 has weird spacing: '...eserved rese...' == Line 1407 has weird spacing: '...Address an ...' == Line 1594 has weird spacing: '...eserved reser...' == (5 more instances...) == The document seems to use 'NOT RECOMMENDED' as an RFC 2119 keyword, but does not include the phrase in its RFC 2119 key words list. == Using lowercase 'not' together with uppercase 'MUST', 'SHALL', 'SHOULD', or 'RECOMMENDED' is not an accepted usage according to RFC 2119. Please use uppercase 'NOT' together with RFC 2119 keywords (if that is what you mean). Found 'MUST not' in this paragraph: In first case, the SPI collision problem occurs when two Initiators run a base exchange to the same Responder (i.e. registered host), and both the Initiators claim the same inbound SPI. Upon receiving an I2 with a colliding SPI, the Responder MUST not include the relayed address in the R2 message because the data relay would not be able demultiplex the related ESP packet to the correct Initiator. Since the SPI space is 32 bits and the SPI values should be random, the probability for a conflicting SPI value is fairly small. However, a registered host with many peers MAY proactively decrease the odds of a conflict by registering to multiple data relays. The described collision scenario can be avoided if the Responder delivers a new relayed address candidate upon SPI collisions. Each relayed address has a separate UDP port reserved to it, so the relay can demultiplex properly conflicting SPIs of the Initiators based on the SPI and port number towards the correct Responder. -- The document date (June 23, 2016) is 2862 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Missing Reference: 'Data' is mentioned on line 340, but not defined == Outdated reference: A later version (-11) exists of draft-ietf-hip-rfc5203-bis-10 == Outdated reference: A later version (-08) exists of draft-ietf-hip-rfc5204-bis-07 == Outdated reference: A later version (-14) exists of draft-ietf-hip-rfc5206-bis-12 ** Downref: Normative reference to an Experimental RFC: RFC 5770 ** Obsolete normative reference: RFC 5389 (Obsoleted by RFC 8489) ** Obsolete normative reference: RFC 5226 (Obsoleted by RFC 8126) == Outdated reference: A later version (-20) exists of draft-ietf-ice-rfc5245bis-03 -- Obsolete informational reference (is this intentional?): RFC 4423 (Obsoleted by RFC 9063) -- Obsolete informational reference (is this intentional?): RFC 5201 (Obsoleted by RFC 7401) -- Obsolete informational reference (is this intentional?): RFC 5766 (Obsoleted by RFC 8656) Summary: 3 errors (**), 0 flaws (~~), 14 warnings (==), 4 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 HIP Working Group A. Keranen 3 Internet-Draft J. Melen 4 Intended status: Standards Track M. Komu, Ed. 5 Expires: December 25, 2016 Ericsson 6 June 23, 2016 8 Native NAT Traversal Mode for the Host Identity Protocol 9 draft-ietf-hip-native-nat-traversal-12 11 Abstract 13 This document specifies a new Network Address Translator (NAT) 14 traversal mode for the Host Identity Protocol (HIP). The new mode is 15 based on the Interactive Connectivity Establishment (ICE) methodology 16 and UDP encapsulation of data and signaling traffic. The main 17 difference from the previously specified modes is the use of HIP 18 messages for all NAT traversal procedures. 20 Status of This Memo 22 This Internet-Draft is submitted in full conformance with the 23 provisions of BCP 78 and BCP 79. 25 Internet-Drafts are working documents of the Internet Engineering 26 Task Force (IETF). Note that other groups may also distribute 27 working documents as Internet-Drafts. The list of current Internet- 28 Drafts is at http://datatracker.ietf.org/drafts/current/. 30 Internet-Drafts are draft documents valid for a maximum of six months 31 and may be updated, replaced, or obsoleted by other documents at any 32 time. It is inappropriate to use Internet-Drafts as reference 33 material or to cite them other than as "work in progress." 35 This Internet-Draft will expire on December 25, 2016. 37 Copyright Notice 39 Copyright (c) 2016 IETF Trust and the persons identified as the 40 document authors. All rights reserved. 42 This document is subject to BCP 78 and the IETF Trust's Legal 43 Provisions Relating to IETF Documents 44 (http://trustee.ietf.org/license-info) in effect on the date of 45 publication of this document. Please review these documents 46 carefully, as they describe your rights and restrictions with respect 47 to this document. Code Components extracted from this document must 48 include Simplified BSD License text as described in Section 4.e of 49 the Trust Legal Provisions and are provided without warranty as 50 described in the Simplified BSD License. 52 Table of Contents 54 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 55 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 4 56 3. Overview of Operation . . . . . . . . . . . . . . . . . . . . 5 57 4. Protocol Description . . . . . . . . . . . . . . . . . . . . 7 58 4.1. Relay Registration . . . . . . . . . . . . . . . . . . . 7 59 4.2. Transport Address Candidate Gathering . . . . . . . . . . 9 60 4.3. NAT Traversal Mode Negotiation . . . . . . . . . . . . . 10 61 4.4. Connectivity Check Pacing Negotiation . . . . . . . . . . 11 62 4.5. Base Exchange via HIP Relay Server . . . . . . . . . . . 12 63 4.6. Connectivity Checks . . . . . . . . . . . . . . . . . . . 15 64 4.6.1. Connectivity Check Procedure . . . . . . . . . . . . 15 65 4.6.2. Rules for Connectivity Checks . . . . . . . . . . . . 18 66 4.7. NAT Traversal Alternatives . . . . . . . . . . . . . . . 19 67 4.7.1. Minimal NAT Traversal Support . . . . . . . . . . . . 19 68 4.7.2. Base Exchange without Connectivity Checks . . . . . . 20 69 4.7.3. Initiating a Base Exchange both with and without UDP 70 Encapsulation . . . . . . . . . . . . . . . . . . . . 21 71 4.8. Sending Control Packets after the Base Exchange . . . . . 22 72 4.9. Mobility Handover Procedure . . . . . . . . . . . . . . . 22 73 4.10. NAT Keepalives . . . . . . . . . . . . . . . . . . . . . 25 74 4.11. Closing Procedure . . . . . . . . . . . . . . . . . . . . 25 75 4.12. Relaying Considerations . . . . . . . . . . . . . . . . . 25 76 4.12.1. Forwarding Rules and Permissions . . . . . . . . . . 25 77 4.12.2. Relaying UDP Encapsulated Control and Data Packets . 26 78 4.12.3. Handling Conflicting SPI Values . . . . . . . . . . 27 79 5. Packet Formats . . . . . . . . . . . . . . . . . . . . . . . 28 80 5.1. HIP Control Packets . . . . . . . . . . . . . . . . . . . 28 81 5.2. Connectivity Checks . . . . . . . . . . . . . . . . . . . 29 82 5.3. Keepalives . . . . . . . . . . . . . . . . . . . . . . . 29 83 5.4. NAT Traversal Mode Parameter . . . . . . . . . . . . . . 29 84 5.5. Connectivity Check Transaction Pacing Parameter . . . . . 30 85 5.6. Relay and Registration Parameters . . . . . . . . . . . . 30 86 5.7. LOCATOR_SET Parameter . . . . . . . . . . . . . . . . . . 31 87 5.8. RELAY_HMAC Parameter . . . . . . . . . . . . . . . . . . 33 88 5.9. Registration Types . . . . . . . . . . . . . . . . . . . 33 89 5.10. Notify Packet Types . . . . . . . . . . . . . . . . . . . 34 90 5.11. ESP Data Packets . . . . . . . . . . . . . . . . . . . . 34 91 5.12. RELAYED_ADDRESS and MAPPED_ADDRESS Parameters . . . . . . 35 92 5.13. PEER_PERMISSION Parameter . . . . . . . . . . . . . . . . 35 93 5.14. HIP Connectivity Check Packets . . . . . . . . . . . . . 36 94 5.15. NOMINATE parameter . . . . . . . . . . . . . . . . . . . 37 95 6. Security Considerations . . . . . . . . . . . . . . . . . . . 37 96 6.1. Privacy Considerations . . . . . . . . . . . . . . . . . 37 97 6.2. Opportunistic Mode . . . . . . . . . . . . . . . . . . . 38 98 6.3. Base Exchange Replay Protection for HIP Relay Server . . 38 99 6.4. Demuxing Different HIP Associations . . . . . . . . . . . 38 100 6.5. Reuse of Ports at the Data Relay . . . . . . . . . . . . 39 101 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 39 102 8. Contributors . . . . . . . . . . . . . . . . . . . . . . . . 39 103 9. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 40 104 10. References . . . . . . . . . . . . . . . . . . . . . . . . . 40 105 10.1. Normative References . . . . . . . . . . . . . . . . . . 40 106 10.2. Informative References . . . . . . . . . . . . . . . . . 41 107 Appendix A. Selecting a Value for Check Pacing . . . . . . . . . 42 108 Appendix B. Base Exchange through a Rendezvous Server . . . . . 43 109 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 43 111 1. Introduction 113 The Host Identity Protocol (HIP) [RFC7401] is specified to run 114 directly on top of IPv4 or IPv6. However, many middleboxes found in 115 the Internet, such as NATs and firewalls, often allow only UDP or TCP 116 traffic to pass [RFC5207]. Also, especially NATs usually require the 117 host behind a NAT to create a forwarding state in the NAT before 118 other hosts outside of the NAT can contact the host behind the NAT. 119 To overcome this problem, different methods, commonly referred to as 120 NAT traversal techniques, have been developed. 122 Two NAT traversal techniques for HIP are specified in [RFC5770]. One 123 of them uses only UDP encapsulation, while the other uses also the 124 Interactive Connectivity Establishment (ICE) 125 [I-D.ietf-ice-rfc5245bis] protocol, which in turn uses Session 126 Traversal Utilities for NAT (STUN) [RFC5389] and Traversal Using 127 Relays around NAT (TURN) [RFC5766] protocols to achieve a reliable 128 NAT traversal solution. 130 The benefit of using ICE and STUN/TURN is that one can re-use the NAT 131 traversal infrastructure already available in the Internet, such as 132 STUN and TURN servers. Also, some middleboxes may be STUN-aware and 133 could be able to do something "smart" when they see STUN being used 134 for NAT traversal. However, implementing a full ICE/STUN/TURN 135 protocol stack results in a considerable amount of effort and code 136 which could be avoided by re-using and extending HIP messages and 137 state machines for the same purpose. Thus, this document specifies 138 an alternative NAT traversal mode that uses HIP messages instead of 139 STUN for the connectivity checks keepalives, and data relaying. This 140 document also specifies how mobility management works in the context 141 of NAT traversal, which was missing from [RFC5770]. 143 2. Terminology 145 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 146 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 147 document are to be interpreted as described in [RFC2119]. 149 This document borrows terminology from [RFC5770], [RFC7401], 150 [I-D.ietf-hip-rfc5206-bis], [RFC4423], [I-D.ietf-ice-rfc5245bis], and 151 [RFC5389]. The following terms recur in the text: 153 HIP relay server: 154 A host that forwards any kind of HIP control packets between the 155 Initiator and the Responder. 157 HIP data relay: 158 A host that forwards HIP data packets, such as Encapsulating 159 Security Payload (ESP) [RFC7402], between two hosts. 161 Registered host: 162 A host that has registered for a relaying service with a HIP data 163 relay. 165 Locator: 166 As defined in [I-D.ietf-hip-rfc5206-bis]: "A name that controls 167 how the packet is routed through the network and demultiplexed by 168 the end-host. It may include a concatenation of traditional 169 network addresses such as an IPv6 address and end-to-end 170 identifiers such as an ESP SPI. It may also include transport 171 port numbers or IPv6 Flow Labels as demultiplexing context, or it 172 may simply be a network address." 174 LOCATOR_SET (written in capital letters): 175 Denotes a HIP control packet parameter that bundles multiple 176 locators together. 178 ICE offer: 179 The Initiator's LOCATOR_SET parameter in a HIP I2 control packet. 180 Corresponds to the ICE offer parameter, but is HIP specific. 182 ICE answer: 183 The Responder's LOCATOR_SET parameter in a HIP R2 control packet. 184 Corresponds to the ICE answer parameter, but is HIP specific. 186 HIP connectivity checks: 187 In order to obtain a non-relayed communication path, two 188 communicating HIP hosts try to "punch holes" through their NAT 189 boxes using this mechanism. Similar to the ICE connectivity 190 checks, but implemented using HIP return routability checks. 192 Controlling host : 193 The controlling host nominates the candidate pair to be used with 194 the controlled host. 196 Controlled host : 197 The controlled host waits for the controlling to nominate an 198 address candidate pair. 200 Checklist: 201 A list of address candidate pairs that need to be tested for 202 connectivity. 204 Transport address: 205 Transport layer port and the corresponding IPv4/v6 address. 207 Candidate: 208 A transport address that is a potential point of contact for 209 receiving data. 211 Host candidate: 212 A candidate obtained by binding to a specific port from an IP 213 address on the host. 215 Server reflexive candidate: 216 A translated transport address of a host as observed by a HIP 217 relay server or a STUN/TURN server. 219 Peer reflexive candidate: 220 A translated transport address of a host as observed by its peer. 222 Relayed candidate: 223 A transport address that exists on a HIP data relay. Packets that 224 arrive at this address are relayed towards the registered host. 226 3. Overview of Operation 227 +-------+ 228 | HIP | 229 +--------+ | Relay | +--------+ 230 | Data | +-------+ | Data | 231 | Relay | / \ | Relay | 232 +--------+ / \ +--------+ 233 / \ 234 / \ 235 / \ 236 / <- Signaling -> \ 237 / \ 238 +-------+ +-------+ 239 | NAT | | NAT | 240 +-------+ +-------+ 241 / \ 242 / \ 243 +-------+ +-------+ 244 | Init- | | Resp- | 245 | iator | | onder | 246 +-------+ +-------+ 248 Figure 1: Example Network Configuration 250 In the example configuration depicted in Figure 1, both Initiator and 251 Responder are behind one or more NATs, and both private networks are 252 connected to the public Internet. To be contacted from behind a NAT, 253 the Responder must be registered with a HIP relay server reachable on 254 the public Internet, and we assume, as a starting point, that the 255 Initiator knows both the Responder's Host Identity Tag (HIT) and the 256 address of one of its relay servers (how the Initiator learns of the 257 Responder's relay server is outside of the scope of this document, 258 but may be through DNS or another name service). 260 The first steps are for both the Initiator and Responder to register 261 with a relay server (need not be the same one) and gather a set of 262 address candidates. The hosts may use HIP relay servers (or even 263 STUN or TURN servers) for gathering the candidates. Next, the HIP 264 base exchange is carried out by encapsulating the HIP control packets 265 in UDP datagrams and sending them through the Responder's relay 266 server. As part of the base exchange, each HIP host learns of the 267 peer's candidate addresses through the HIP offer/answer procedure 268 embedded in the base exchange, which follows closely the ICE 269 [I-D.ietf-ice-rfc5245bis] protocol. 271 Once the base exchange is completed, two HIP hosts have established a 272 working communication session (for signaling) via a HIP relay server, 273 but the hosts still have to find a better path, preferably without a 274 HIP data relay, for the ESP data flow. For this, connectivity checks 275 are carried out until a working pair of addresses is discovered. At 276 the end of the procedure, if successful, the hosts will have 277 established a UDP-based tunnel that traverses both NATs, with the 278 data flowing directly from NAT to NAT or via a HIP data relay server. 279 At this point, also the HIP signaling can be sent over the same 280 address/port pair, and is demultiplexed from IPsec as described in 281 the UDP encapsulation standard for IPsec [RFC3948] Finally, the two 282 hosts send NAT keepalives as needed in order keep their UDP-tunnel 283 state active in the associated NAT boxes. 285 If either one of the hosts knows that it is not behind a NAT, hosts 286 can negotiate during the base exchange a different mode of NAT 287 traversal that does not use HIP connectivity checks, but only UDP 288 encapsulation of HIP and ESP. Also, it is possible for the Initiator 289 to simultaneously try a base exchange with and without UDP 290 encapsulation. If a base exchange without UDP encapsulation 291 succeeds, no HIP connectivity checks or UDP encapsulation of ESP are 292 needed. 294 4. Protocol Description 296 This section describes the normative behavior of the protocol 297 extension. Most of the procedures are similar to what is defined in 298 [RFC5770] but with different, or additional, parameter types and 299 values. In addition, a new type of relaying server, HIP data relay, 300 is specified. Also, it should be noted that HIP version 2 [RFC7401] 301 (instead of [RFC5201] used in [RFC5770]) is expected to be used with 302 this NAT traversal mode. 304 4.1. Relay Registration 306 In order for two hosts to communicate over NATted environments, they 307 need a reliable way to exchange information. HIP relay servers as 308 defined in [RFC5770] support relaying of HIP control plane traffic 309 over UDP in NATted environments. A HIP relay server forwards HIP 310 control packets between the Initiator and the Responder. 312 To guarantee also data plane delivery over varying types of NAT 313 devices, a host MAY also register for UDP encapsulated ESP relaying 314 using Registration Type RELAY_UDP_ESP (value [TBD by IANA: 3]). This 315 service may be coupled with the HIP relay server or offered 316 separately on another server. If the server supports relaying of UDP 317 encapsulated ESP, the host is allowed to register for a data relaying 318 service using the registration extensions in Section 3.3 of 319 [I-D.ietf-hip-rfc5203-bis]). If the server has sufficient relaying 320 resources (free port numbers, bandwidth, etc.) available, it opens a 321 UDP port on one of its addresses and signals the address and port to 322 the registering host using the RELAYED_ADDRESS parameter (as defined 323 in Section 5.12 in this document). If the relay would accept the 324 data relaying request but does not currently have enough resources to 325 provide data relaying service, it MUST reject the request with 326 Failure Type "Insufficient resources" [I-D.ietf-hip-rfc5203-bis]. 328 A HIP relay server MUST silently drop packets to a HIP relay client 329 that has not previously registered with the HIP relay. The 330 registration process follows the generic registration extensions 331 defined in [I-D.ietf-hip-rfc5203-bis]. The HIP control plane 332 relaying registration follows [RFC5770], but the data plane 333 registration is different. It is worth noting that if the HIP 334 control and data plane relay services reside on different hosts, the 335 relay client has to register separately to each of them. In the 336 example shown in Figure 2, the two services are coupled on a single 337 host. 339 HIP HIP 340 Relay [Data] Relay 341 Client Server 342 | 1. UDP(I1) | 343 +---------------------------------------------------------------->| 344 | | 345 | 2. UDP(R1(REG_INFO(RELAY_UDP_HIP,[RELAY_UDP_ESP]))) | 346 |<----------------------------------------------------------------+ 347 | | 348 | 3. UDP(I2(REG_REQ(RELAY_UDP_HIP),[RELAY_UDP_ESP]))) | 349 +---------------------------------------------------------------->| 350 | | 351 | 4. UDP(R2(REG_RES(RELAY_UDP_HIP,[RELAY_UDP_ESP]), REG_FROM, | 352 | [RELAYED_ADDRESS])) | 353 |<----------------------------------------------------------------+ 354 | | 356 Figure 2: Example Registration with a HIP Relay 358 In step 1, the relay client (Initiator) starts the registration 359 procedure by sending an I1 packet over UDP to the relay. It is 360 RECOMMENDED that the Initiator select a random port number from the 361 ephemeral port range 49152-65535 for initiating a base exchange. 362 Alternatively, a host MAY also use a single fixed port for initiating 363 all outgoing connections. However, the allocated port MUST be 364 maintained until all of the corresponding HIP Associations are 365 closed. It is RECOMMENDED that the HIP relay server listen to 366 incoming connections at UDP port 10500. If some other port number is 367 used, it needs to be known by potential Initiators. 369 In step 2, the HIP relay server (Responder) lists the services that 370 it supports in the R1 packet. The support for HIP control plane over 371 UDP relaying is denoted by the Registration Type value RELAY_UDP_HIP 372 (see Section 5.9). If the server supports also relaying of ESP 373 traffic over UDP, it includes also Registration type value 374 RELAY_UDP_ESP. 376 In step 3, the Initiator selects the services for which it registers 377 and lists them in the REG_REQ parameter. The Initiator registers for 378 HIP relay service by listing the RELAY_UDP_HIP value in the request 379 parameter. If the Initiator requires also ESP relaying over UDP, it 380 lists also RELAY_UDP_ESP. 382 In step 4, the Responder concludes the registration procedure with an 383 R2 packet and acknowledges the registered services in the REG_RES 384 parameter. The Responder denotes unsuccessful registrations (if any) 385 in the REG_FAILED parameter of R2. The Responder also includes a 386 REG_FROM parameter that contains the transport address of the client 387 as observed by the relay (Server Reflexive candidate). If the 388 Initiator registered to ESP relaying service, the Responder includes 389 RELAYED_ADDRESS paramater that describes the UDP port allocated to 390 the Initiator for ESP relaying. It is worth noting that this client 391 must first activate this UDP port by sending an UPDATE message to the 392 relay server that includes a PEER_PERMISSION parameter as described 393 in Section 4.12.1 both after base exchange and handover procedures. 395 After the registration, the relay client sends periodically NAT 396 keepalives to the relay server in order to keep the NAT bindings 397 between the initiator and the relay alive. The keepalive extensions 398 are described in Section 4.10. 400 The registered host MUST maintain an active HIP association with the 401 data relay as long as it requires the data relaying service. When 402 the HIP association is closed (or times out), or the registration 403 lifetime passes without the registered host refreshing the 404 registration, the data relay MUST stop relaying packets for that host 405 and close the corresponding UDP port (unless other registered hosts 406 are still using it). 408 The data relay MAY use the same relayed address and port for multiple 409 registered hosts, but since this can cause problems with stateful 410 firewalls (see Section 6.5) it is NOT RECOMMENDED. 412 4.2. Transport Address Candidate Gathering 414 A host needs to gather a set of address candidates before contacting 415 a non-relay host. The candidates are needed for connectivity checks 416 that allow two hosts to discover a direct, non-relayed path for 417 communicating with each other. One server reflexive candidate can be 418 discovered during the registration with the HIP relay server from the 419 REG_FROM parameter. 421 The candidate gathering can be done at any time, but it needs to be 422 done before sending an I2 or R2 in the base exchange if ICE is to be 423 used for the connectivity checks. It is RECOMMENDED that all three 424 types of candidates (host, server reflexive, and relayed) are 425 gathered to maximize the probability of successful NAT traversal. 426 However, if no data relay is used, and the host has only a single 427 local IP address to use, the host MAY use the local address as the 428 only host candidate and the address from the REG_FROM parameter 429 discovered during the relay registration as a server reflexive 430 candidate. In this case, no further candidate gathering is needed. 432 If a host has more than one network interface, additional server 433 reflexive candidates can be discovered by sending registration 434 requests with Registration Type CANDIDATE_DISCOVERY (value [TBD by 435 IANA: 4]) from each of the interfaces to a HIP relay server. When a 436 HIP relay server receives a registration request with 437 CANDIDATE_DISCOVERY type, it MUST add a REG_FROM parameter, 438 containing the same information as if this was a relay registration, 439 to the response. This request type SHOULD NOT create any state at 440 the HIP relay server. 442 Gathering of candidates MAY also be performed as specified in 443 Section 4.2 of [RFC5770] if STUN servers are available, or if the 444 host has just a single interface and no TURN or HIP data relay 445 servers are available. 447 4.3. NAT Traversal Mode Negotiation 449 This section describes the usage of a new non-critical parameter 450 type. The presence of the parameter in a HIP base exchange means 451 that the end-host supports NAT traversal extensions described in this 452 document. As the parameter is non-critical (as defined in 453 Section 5.2.1 of [RFC7401]), it can be ignored by an end-host, which 454 means that the host does not support or is not willing to use these 455 extensions. 457 With registration with a HIP relay, it is usually sufficient to use 458 the UDP-ENCAPSULATION mode of NAT traversal since the relay is 459 assumed to be in public address space. Thus, the relay SHOULD 460 propose the UDP-ENCAPSULATION mode as the preferred or only mode. 461 The NAT traversal mode negotiation in a HIP base exchange is 462 illustrated in Figure 3. It is worth noting that the HIP relay could 463 be located between the hosts, but omitted here for simplicity. 465 Initiator Responder 466 | 1. UDP(I1) | 467 +--------------------------------------------------------------->| 468 | | 469 | 2. UDP(R1(.., NAT_TRAVERSAL_MODE(ICE-HIP-UDP), ..)) | 470 |<---------------------------------------------------------------+ 471 | | 472 | 3. UDP(I2(.., NAT_TRAVERSAL_MODE(ICE-HIP-UDP), LOC_SET, ..)) | 473 +--------------------------------------------------------------->| 474 | | 475 | 4. UDP(R2(.., LOC_SET, ..)) | 476 |<---------------------------------------------------------------+ 477 | | 479 Figure 3: Negotiation of NAT Traversal Mode 481 In step 1, the Initiator sends an I1 to the Responder. In step 2, 482 the Responder responds with an R1. As specified in [RFC5770], the 483 NAT_TRAVERSAL_MODE parameter in R1 contains a list of NAT traversal 484 modes the Responder supports. The mode specified in this document is 485 ICE-HIP-UDP (value [TBD by IANA: 3]). 487 In step 3, the Initiator sends an I2 that includes a 488 NAT_TRAVERSAL_MODE parameter. It contains the mode selected by the 489 Initiator from the list of modes offered by the Responder. If ICE- 490 HIP-UDP mode was selected, the I2 also includes the "Transport 491 address" locators (as defined in Section 5.7) of the Initiator in a 492 LOCATOR_SET parameter (denoted here LOC_SET). The locators in I2 are 493 the "ICE offer". 495 In step 4, the Responder concludes the base exchange with an R2 496 packet. If the Initiator chose ICE NAT traversal mode, the Responder 497 includes a LOCATOR_SET parameter in the R2 packet. The locators in 498 R2, encoded like the locators in I2, are the "ICE answer". If the 499 NAT traversal mode selected by the Initiator is not supported by the 500 Responder, the Responder SHOULD reply with a NOTIFY packet with type 501 NO_VALID_NAT_TRAVERSAL_MODE_PARAMETER and abort the base exchange. 503 4.4. Connectivity Check Pacing Negotiation 505 As explained in [RFC5770], when a NAT traversal mode with 506 connectivity checks is used, new transactions should not be started 507 too fast to avoid congestion and overwhelming the NATs. For this 508 purpose, during the base exchange, hosts can negotiate a transaction 509 pacing value, Ta, using a TRANSACTION_PACING parameter in R1 and I2 510 packets. The parameter contains the minimum time (expressed in 511 milliseconds) the host would wait between two NAT traversal 512 transactions, such as starting a new connectivity check or retrying a 513 previous check. The value that is used by both of the hosts is the 514 higher out of the two offered values. 516 The minimum Ta value SHOULD be configurable, and if no value is 517 configured, a value of 500 ms MUST be used. Guidelines for selecting 518 a Ta value are given in Appendix A. Hosts SHOULD NOT use values 519 smaller than 20 ms for the minimum Ta, since such values may not work 520 well with some NATs, as explained in [I-D.ietf-ice-rfc5245bis]. The 521 Initiator MUST NOT propose a smaller value than what the Responder 522 offered. If a host does not include the TRANSACTION_PACING parameter 523 in the base exchange, a Ta value of 500 ms MUST be used as that 524 host's minimum value. 526 4.5. Base Exchange via HIP Relay Server 528 This section describes how the Initiator and Responder perform a base 529 exchange through a HIP relay server. Connectivity pacing (denoted as 530 TA_P here) was described in Section 4.4 and is neither repeated here. 531 Similarly, the NAT traversal mode negotiation process (denoted as 532 NAT_TM in the example) was described in Section 4.3 and is neither 533 repeated here. If a relay receives an R1 or I2 packet without the 534 NAT traversal mode parameter, it MUST drop it and SHOULD send a 535 NOTIFY error packet with type NO_VALID_NAT_TRAVERSAL_MODE_PARAMETER 536 to the sender of the R1 or I2. 538 It is RECOMMENDED that the Initiator send an I1 packet encapsulated 539 in UDP when it is destined to an IPv4 address of the Responder. 540 Respectively, the Responder MUST respond to such an I1 packet with a 541 UDP-encapsulated R1 packet, and also the rest of the communication 542 related to the HIP association MUST also use UDP encapsulation. 544 Figure 4 illustrates a base exchange via a HIP relay server. We 545 assume that the Responder (i.e. a HIP relay client) has already 546 registered to the HIP relay server. The Initiator may have also 547 registered to another (or the same relay server), but the base 548 exchange will traverse always through the relay of the Responder. 550 Initiator HIP relay Responder 551 | 1. UDP(I1) | | 552 +--------------------------------->| 2. UDP(I1(RELAY_FROM)) | 553 | +------------------------------->| 554 | | | 555 | | 3. UDP(R1(RELAY_TO, NAT_TM, | 556 | | TA_P)) | 557 | 4. UDP(R1(RELAY_TO, NAT_TM, |<-------------------------------+ 558 | TA_P)) | | 559 |<---------------------------------+ | 560 | | | 561 | 5. UDP(I2(LOC_SET, NAT_TM, | | 562 | TA_P)) | | 563 +--------------------------------->| 6. UDP(I2(LOC_SET, RELAY_FROM, | 564 | | NAT_TM, TA_P)) | 565 | +------------------------------->| 566 | | | 567 | | 7. UDP(R2(LOC_SET, RELAY_TO)) | 568 | 8. UDP(R2(LOC_SET, RELAY_TO)) |<-------------------------------+ 569 |<---------------------------------+ | 570 | | | 572 Figure 4: Base Exchange via a HIP Relay Server 574 In step 1 of Figure 4, the Initiator sends an I1 packet over UDP via 575 the relay server to the Responder. In the HIP header, the source HIT 576 belongs to the Initiator and the destination HIT to the Responder. 577 The initiator sends the I1 packet from its IP address to the IP 578 address of the HIP relay over UDP. 580 In step 2, the HIP relay server receives the I1 packet. If the 581 destination HIT belongs to a registered Responder, the relay 582 processes the packet. Otherwise, the relay MUST drop the packet 583 silently. The relay appends a RELAY_FROM parameter to the I1 packet, 584 which contains the transport source address and port of the I1 as 585 observed by the relay. The relay protects the I1 packet with 586 RELAY_HMAC as described in [I-D.ietf-hip-rfc5204-bis], except that 587 the parameter type is different (see Section 5.8). The relay changes 588 the source and destination ports and IP addresses of the packet to 589 match the values the Responder used when registering to the relay, 590 i.e., the reverse of the R2 used in the registration. The relay MUST 591 recalculate the transport checksum and forward the packet to the 592 Responder. 594 In step 3, the Responder receives the I1 packet. The Responder 595 processes it according to the rules in [RFC7401]. In addition, the 596 Responder validates the RELAY_HMAC according to 598 [I-D.ietf-hip-rfc5204-bis] and silently drops the packet if the 599 validation fails. The Responder replies with an R1 packet to which 600 it includes RELAY_TO and NAT traversal mode parameters. The 601 responder MUST include ICE-HIP-UDP in the NAT traversal modes. The 602 RELAY_TO parameter MUST contain the same information as the 603 RELAY_FROM parameter, i.e., the Initiator's transport address, but 604 the type of the parameter is different. The RELAY_TO parameter is 605 not integrity protected by the signature of the R1 to allow pre- 606 created R1 packets at the Responder. 608 In step 4, the relay receives the R1 packet. The relay drops the 609 packet silently if the source HIT belongs to an unregistered host. 610 The relay MAY verify the signature of the R1 packet and drop it if 611 the signature is invalid. Otherwise, the relay rewrites the source 612 address and port, and changes the destination address and port to 613 match RELAY_TO information. Finally, the relay recalculates 614 transport checksum and forwards the packet. 616 In step 5, the Initiator receives the R1 packet and processes it 617 according to [RFC7401]. The Initiator MAY use the address in the 618 RELAY_TO parameter as a local peer-reflexive candidate for this HIP 619 association if it is different from all known local candidates. The 620 Initiator replies with an I2 packet that uses the destination 621 transport address of R1 as the source address and port. The I2 622 packet contains a LOCATOR_SET parameter that lists all the HIP 623 candidates (ICE offer) of the Initiator. The candidates are encoded 624 using the format defined in Section 5.7. The I2 packet MUST also 625 contain a NAT traversal mode parameter that includes ICE-HIP-UDP 626 mode. 628 In step 6, the relay receives the I2 packet. The relay appends a 629 RELAY_FROM and a RELAY_HMAC to the I2 packet similarly as explained 630 in step 2, and forwards the packet to the Responder. 632 In step 7, the Responder receives the I2 packet and processes it 633 according to [RFC7401]. It replies with an R2 packet and includes a 634 RELAY_TO parameter as explained in step 3. The R2 packet includes a 635 LOCATOR_SET parameter that lists all the HIP candidates (ICE answer) 636 of the Responder. The RELAY_TO parameter is protected by the HMAC. 638 In step 8, the relay processes the R2 as described in step 4. The 639 relay forwards the packet to the Initiator. After the Initiator has 640 received the R2 and processed it successfully, the base exchange is 641 completed. 643 Hosts MUST include the address of one or more HIP relay servers 644 (including the one that is being used for the initial signaling) in 645 the LOCATOR_SET parameter in I2 and R2 if they intend to use such 646 servers for relaying HIP signaling immediately after the base 647 exchange completes. The traffic type of these addresses MUST be "HIP 648 signaling" and they MUST NOT be used as HIP candidates. If the HIP 649 relay server locator used for relaying the base exchange is not 650 included in I2 or R2 LOCATOR_SET parameters, it SHOULD NOT be used 651 after the base exchange. Instead, further HIP signaling SHOULD use 652 the same path as the data traffic. 654 4.6. Connectivity Checks 656 When the Initiator and Responder complete the base exchange through 657 the HIP relay, both of them employ the IP address of the relay as the 658 destination address for the packets. This address MUST NOT be used 659 as a destination for ESP traffic unless the HIP relay supports also 660 ESP data relaying. When NAT traversal mode with ICE-HIP-UDP was 661 successfully negotiated and selected, the Initiator and Responder 662 MUST start the connectivity checks in order to attempt to obtain 663 direct end-to-end connectivity through NAT devices. 665 The connectivity checks follow the ICE methodology [MMUSIC-ICE], but 666 UDP encapsulated HIP control messages are used instead of ICE 667 messages. Only normal connectivity checks can be used because 668 aggressive connectivity checks are deprecated. The Initiator MUST 669 take the role of controlling host and the Responder acts as the 670 controlled host. The protocol follows standard HIP UPDATE sending 671 and processing rules as defined in section 6.11 and 6.12 in 672 [RFC7401], but some new parameters are introduced: 673 CANDIDATE_PRIORITY, MAPPED_ADDR and NOMINATE. 675 4.6.1. Connectivity Check Procedure 677 Figure 5 illustrates connectivity checks in a simplified scenario, 678 where the Initiator and Responder have only a single candidate pair 679 to check. Typically, NATs drop messages messages until both sides 680 have sent messages using the same port pair. In this scenario, the 681 Responder sends a connectivity check first but the NAT of the 682 Initiator drops it. However, the connectivity check from the 683 Initiator reaches the Responder because it uses the same port pair as 684 the first message. 686 Initiator NAT1 NAT2 Responder 687 | | 1. UDP(UPDATE(SEQ, CAND_PRIO, | | 688 | | ECHO_REQ_SIGN)) | | 689 | X<-----------------------------------+----------------+ 690 | | | | 691 | 2. UDP(UPDATE(SEQ, ECHO_REQ_SIGN, CAND_PRIO)) | | 692 +-------------+------------------------------------+--------------->| 693 | | | | 694 | 3. UDP(UPDATE(SEQ, ACK, ECHO_REQ_SIGN, ECHO_RESP_SIGN, | 695 | | MAPPED_ADDR)) | | 696 |<------------+------------------------------------+----------------+ 697 | | | | 698 | 4. UDP(UPDATE(ACK, ECHO_RESP_SIGN, MAPPED_ADDR)) | | 699 +-------------+------------------------------------+--------------->+ 700 | | | | 701 | 5. Other connectivity checks using UPDATE over UDP | 702 <-------------+------------------------------------+----------------> 703 | | | | 704 | 6. UDP(UPDATE(SEQ, ECHO_REQ_SIGN, CAND_PRIO, NOMINATE)) | 705 +-------------+------------------------------------+--------------->| 706 | | | | 707 | 7. UDP(UPDATE(SEQ, ACK, ECHO_REQ_SIGN, ECHO_RESP_SIGN, | 708 | NOMINATE)) | | 709 |<------------+------------------------------------+----------------+ 710 | | | | 711 | 8. UDP(UPDATE(ACK, ECHO_RESP_SIGN)) | | 712 +-------------+------------------------------------+--------------->+ 713 | | | | 714 | 9. ESP data traffic over UDP | | 715 +<------------+------------------------------------+--------------->+ 716 | | | | 718 Figure 5: Connectivity Checks 720 In step 1, the Responder sends a connectivity check to the Initiator 721 that the NAT of the Initiator drops. The message includes a number 722 of parameters. As specified in [RFC7401]), the SEQ parameter 723 includes a running sequence identifier for the connectivity check. 724 The candidate priority (denoted "CAND_PRIO" in the figure) describes 725 the priority of the address candidate being tested. The 726 ECHO_REQUEST_SIGNED (denoted ECHO_REQ_SIGN in the figure) includes a 727 nonce that the recipient must sign and echo back as it is. 729 In step 2, the Initiator sends a connectivity check using the same 730 address pair candidate as the Responder did and the message traverses 731 successfully the NAT boxes. The message includes the same parameters 732 as in the previous step. 734 In step 3, the Responder has successfully received the previous 735 connectivity check from the Initiator and starts to build a response 736 message. Since the message from the Initiator included a SEQ, the 737 Responder must acknowledge it using an ACK parameter. Also, the 738 nonce contained in the echo request must be echoed back in an 739 ECHO_REQUEST_SIGNED (denoted ECHO_REQUEST_SIGN) parameter. The 740 Responder includes also a MAPPED_ADDRESS parameter that contains the 741 transport address of the Initiator as observed by the Responder (i.e. 742 peer reflexive candidate). The Initiator should acknowledge the 743 message from the Responder, so the Responder also includes its own 744 SEQ in the message and its own echo request for additional security. 746 In step 4, the Initiator receives the message from the Responder and 747 builds a corresponding response that concludes connectivity checks. 748 Since the previous message from the Responder included a new SEQ and 749 ECHO_REQUEST_SIGN parameters, the Initiator includes the 750 corresponding ACK and ECHO_RESPONSE_SIGN parameters. Before sending, 751 it also includes a MAPPED_ADDR parameter describing the peer 752 reflexive candidate. 754 In step 5, the Initiator and Responder test the remaining address 755 candidates (if any). 757 In step 6, the Initiator has completed testing all address candidates 758 and nominates one address candidate to be used. It sends an UPDATE 759 message using the selected address candidates that includes a number 760 of parameters: SEQ, ECHO_REQUEST_SIGN, CANDIDATE_PRIORITY and the 761 NOMINATE parameter. 763 In step 7, the Responder receives the message with NOMINATE parameter 764 from the Initiator. It sends a response that includes the NOMINATE 765 parameter in addition to a number of other parameters. The ACK and 766 ECHO_RESPONSE_SIGN parameters acknowledge the SEQ and 767 ECHO_REQUEST_SIGN parameters from previous message from the 768 Initiator. The Responder includes SEQ and ECHO_REQUEST_SIGN 769 parameters in order to receive an acknowledgment from the Responder. 771 In step 8, the Initiator completes the candidate nomination process 772 by confirming the message reception to the Responder. In the 773 confirmation message, the ACK and ECHO_RESPONSE_SIGN parameters 774 correspond to the SEQ and ECHO_REQUEST_SIGN parameters in the message 775 sent by the Responder in the previous step. 777 In step 9, the Initiator and Responder can start sending application 778 payload over the successfully nominated address candidates. 780 It is worth noting that if either host has registered a relayed 781 address candidate from a data relay, the host MUST activate the 782 address before connectivity checks by sending an UPDATE message 783 containing PEER_PERMISSION parameter as described in Section 4.12.1. 784 Otherwise, the relay drops ESP packets using the relayed address. 786 4.6.2. Rules for Connectivity Checks 788 All of the connectivity check packets MUST be protected with HMACs 789 and signatures (even though the illustrations omitted them for 790 simplicity). To provide strong replay protection, for each pair of 791 address candidates, both the Initiator and Responder MUST send a send 792 a nonce to each other for signing using the ECHO_REQUEST_SIGNED 793 parameter (that then has to be echoed back by the recipient). 794 Similarly, the SEQ parameter enforces the the recipient to 795 acknowledge a received message. Effectively these two mechanisms 796 combined result in a secure three way packet exchange that tests both 797 sides for return routability. 799 [RFC7401] states that UPDATE packets have to include either a SEQ or 800 ACK parameter (or both). According to the RFC, each SEQ parameter 801 should be acknowledged separately. In the context of NATs, this 802 means that some of the SEQ parameters sent in connectivity checks 803 will lost or arrive out of order. From the viewpoint of the 804 recipient, this is not a problem since the the recipient will just 805 "blindly" acknowledge the SEQ. However, the sender needs to be 806 prepared for lost sequence identifiers and ACKs parameters that 807 arrive out of order. 809 As specified in [RFC7401], an ACK parameter may acknowledge multiple 810 sequence identifiers. While the examples in the previous sections do 811 not illustrate such functionality, it is also permitted when 812 employing ICE-HIP-UDP mode. 814 In ICE-HIP-UDP mode, a retransmission of a connectivity checks SHOULD 815 be sent with the same sequence identifier in the SEQ parameter. Some 816 of tested address candidates will never produce a working address 817 pair, and thus may cause retransmissions. Upon successful nomination 818 an address pair, a host MAY immediately stop sending such 819 retransmissions. 821 The packet flow illustrations are missing a scenario where both the 822 Initiator and Responder send simultaneously connectivity checks to 823 each other using the same address candidates, and the NATs at both 824 sides let the packets pass. From the viewpoint of NAT penetration, 825 this results in a bit more unnecessary packet exchanges, but both 826 ends SHOULD nevertheless complete the three way connectivity check 827 process they initiated. 829 The connectivity check messages MUST be paced by the value negotiated 830 during the base exchange as described in Section 4.4. If neither one 831 of the hosts announced a minimum pacing value, a value of 500 ms MUST 832 be used. 834 As defined in [RFC5770], both hosts MUST form a priority ordered 835 checklist and start to check transactions every Ta milliseconds as 836 long as the checks are running and there are candidate pairs whose 837 tests have not started. The retransmission timeout (RTO) for the 838 connectivity check UPDATE packets MUST be calculated as follows: 840 RTO = MAX (500ms, Ta * (Num-Waiting + Num-In-Progress)) 842 In the RTO formula, Ta is the value used for the connectivity check 843 pacing, Num-Waiting is the number of pairs in the checklist in the 844 "Waiting" state, and Num-In-Progress is the number of pairs in the 845 "In-Progress" state. This is identical to the formula in 846 [I-D.ietf-ice-rfc5245bis] if there is only one checklist. 848 Each connectivity check request packet MUST contain a 849 CANDIDATE_PRIORITY parameter (see Section 5.14) with the priority 850 value that would be assigned to a peer reflexive candidate if one was 851 learned from the corresponding check. An UPDATE packet that 852 acknowledges a connectivity check request MUST be sent from the same 853 address that received the check and delivered to the same address 854 where the check was received from. Each acknowledgment UPDATE packet 855 MUST contain a MAPPED_ADDRESS parameter with the port, protocol, and 856 IP address of the address where the connectivity check request was 857 received from. 859 If the connectivity checks failed, the hosts MUST NOT send ESP 860 traffic to each other but MAY continue communicating using HIP 861 packets and the locators used for the base exchange. Also, the hosts 862 SHOULD notify each other about the failure with a 863 CONNECTIVITY_CHECKS_FAILED NOTIFY packet (see Section 5.10). 865 4.7. NAT Traversal Alternatives 867 4.7.1. Minimal NAT Traversal Support 869 If the Responder has a fixed and publicly reachable IPv4 address and 870 does not employ a HIP relay, the explicit NAT traversal mode 871 negotiation MAY be omitted, and thus even the UDP-ENCAPSULATION mode 872 does not have to be negotiated. In such a scenario, the Initiator 873 sends an I1 message over UDP and the Responder responds with an R1 874 message without including any NAT traversal mode parameter. The rest 875 of the base exchange follows the procedures defined in [RFC7401], 876 except that the control and data plane use UDP encapsulation. Here, 877 the use of UDP for NAT traversal is agreed implicitly. This way of 878 operation is still subject to NAT timeouts, and the hosts MUST employ 879 NAT keepalives as defined in section Section 4.10. 881 4.7.2. Base Exchange without Connectivity Checks 883 It is possible to run a base exchange without any connectivity checks 884 as defined in section 4.8 in [RFC5770]. The procedure is applicable 885 also in the context of this specification, so it is repeated here for 886 completeness. 888 In certain network environments, the connectivity checks can be 889 omitted to reduce initial connection set-up latency because a base 890 exchange acts as an implicit connectivity test itself. For this to 891 work, the Initiator MUST be able to reach the Responder by simply UDP 892 encapsulating HIP and ESP packets sent to the Responder's address. 893 Detecting and configuring this particular scenario is prone to 894 failure unless carefully planned. 896 In such a scenario, the Responder MAY include UDP-ENCAPSULATION NAT 897 traversal mode as one of the supported modes in the R1 packet. If 898 the Responder has registered to a HIP relay server, it MUST also 899 include a LOCATOR_SET parameter in R1 that contains a preferred 900 address where the Responder is able to receive UDP-encapsulated ESP 901 and HIP packets. This locator MUST be of type "Transport address", 902 its Traffic type MUST be "both", and it MUST have the "Preferred bit" 903 set (see Table 1). If there is no such locator in R1, the source 904 address of R1 is used as the Responder's preferred address. 906 The Initiator MAY choose the UDP-ENCAPSULATION mode if the Responder 907 listed it in the supported modes and the Initiator does not wish to 908 use the connectivity checks defined in this document for searching 909 for a more optimal path. In this case, the Initiator sends the I2 910 with UDP-ENCAPSULATION mode in the NAT traversal mode parameter 911 directly to the Responder's preferred address (i.e., to the preferred 912 locator in R1 or to the address where R1 was received from if there 913 was no preferred locator in R1). The Initiator MAY include locators 914 in I2 but they MUST NOT be taken as address candidates, since 915 connectivity checks defined in this document will not be used for 916 connections with UDP-ENCAPSULATION NAT traversal mode. Instead, if 917 R2 and I2 are received and processed successfully, a security 918 association can be created and UDP-encapsulated ESP can be exchanged 919 between the hosts after the base exchange completes. However, the 920 Responder SHOULD NOT send any ESP to the Initiator's address before 921 it has received data from the Initiator, as specified in Sections 922 4.4.3. and 6.9 of [RFC7401] and in Sections 3.2.9 and 5.4 of 923 [I-D.ietf-hip-rfc5206-bis]. 925 Since an I2 packet with UDP-ENCAPSULATION NAT traversal mode selected 926 MUST NOT be sent via a relay, the Responder SHOULD reject such I2 927 packets and reply with a NO_VALID_NAT_TRAVERSAL_MODE_PARAMETER NOTIFY 928 packet (see Section 5.10). 930 If there is no answer for the I2 packet sent directly to the 931 Responder's preferred address, the Initiator MAY send another I2 via 932 the HIP relay server, but it MUST NOT choose UDP-ENCAPSULATION NAT 933 traversal mode for that I2. 935 4.7.3. Initiating a Base Exchange both with and without UDP 936 Encapsulation 938 It is possible to run a base exchange in parallel both with and 939 without UDP encapsulation as defined in section 4.9 in [RFC5770]. 940 The procedure is applicable also in the context of this 941 specification, so it is repeated here for completeness. 943 The Initiator MAY also try to simultaneously perform a base exchange 944 with the Responder without UDP encapsulation. In such a case, the 945 Initiator sends two I1 packets, one without and one with UDP 946 encapsulation, to the Responder. The Initiator MAY wait for a while 947 before sending the other I1. How long to wait and in which order to 948 send the I1 packets can be decided based on local policy. For 949 retransmissions, the procedure is repeated. 951 The I1 packet without UDP encapsulation may arrive directly, without 952 any relays, at the Responder. When this happens, the procedures in 953 [RFC7401] are followed for the rest of the base exchange. The 954 Initiator may receive multiple R1 packets, with and without UDP 955 encapsulation, from the Responder. However, after receiving a valid 956 R1 and answering it with an I2, further R1 packets that are not 957 retransmits of the original R1 MUST be ignored. 959 The I1 packet without UDP encapsulation may also arrive at a HIP- 960 capable middlebox. When the middlebox is a HIP rendezvous server and 961 the Responder has successfully registered with the rendezvous 962 service, the middlebox follows rendezvous procedures in 963 [I-D.ietf-hip-rfc5204-bis]. 965 If the Initiator receives a NAT traversal mode parameter in R1 966 without UDP encapsulation, the Initiator MAY ignore this parameter 967 and send an I2 without UDP encapsulation and without any selected NAT 968 traversal mode. When the Responder receives the I2 without UDP 969 encapsulation and without NAT traversal mode, it will assume that no 970 NAT traversal mechanism is needed. The packet processing will be 971 done as described in [RFC7401]. The Initiator MAY store the NAT 972 traversal modes for future use, e.g., in case of a mobility or 973 multihoming event that causes NAT traversal to be used during the 974 lifetime of the HIP association. 976 4.8. Sending Control Packets after the Base Exchange 978 The same considerations of sending control packets after the base 979 exchange described in section 5.10 in [RFC5770] apply also here, so 980 they are repeated here for completeness. 982 After the base exchange, the end-hosts MAY send HIP control packets 983 directly to each other using the transport address pair established 984 for a data channel without sending the control packets through the 985 HIP relay server. When a host does not get acknowledgments, e.g., to 986 an UPDATE or CLOSE packet after a timeout based on local policies, 987 the host SHOULD resend the packet through the relay, if it was listed 988 in the LOCATOR_SET parameter in the base exchange. 990 If control packets are sent through a HIP relay server, the host 991 registered with the relay MUST utilize the RELAY_TO parameter as in 992 the base exchange. The HIP relay server SHOULD forward HIP packets 993 to the registered hosts and forward packets from a registered host to 994 the address in the RELAY_TO parameter. The relay MUST add a 995 RELAY_FROM parameter to the control packets it relays to the 996 registered hosts. 998 If the HIP relay server is not willing or able to relay a HIP packet, 999 it MAY notify the sender of the packet with MESSAGE_NOT_RELAYED error 1000 notification (see Section 5.10). 1002 4.9. Mobility Handover Procedure 1004 A host may move after base exchange and connectivity checks. 1005 Mobility extensions for HIP [I-D.ietf-hip-rfc5206-bis] define 1006 handover procedures without NATs. In this section, we define how two 1007 hosts interact handover procedures in scenarios involving NATs. The 1008 specified extensions define only simple mobility using a pair of 1009 security associations, and multihoming extensions are left to be 1010 defined in later specifications. 1012 We assume that the two hosts have successfully negotiated and chosen 1013 the ICE-HIP-UDP mode during the base exchange as defined in 1014 Section 4.3. The Initiator of the base exchange MUST store 1015 information that it was the controlling host during the base 1016 exchange. Similarly, the Responder MUST store information that it 1017 was the controlled host during the base exchange. 1019 The mobility extensions for NAT traversal are illustrated in 1020 Figure 6. The mobile host is the host that has changed its locators, 1021 and the peer host is the host it has a host association with. The 1022 mobile host may have multiple peers and it repeats the process with 1023 all of its peers. In the figure, the HIP relay belongs to the peer 1024 host, i.e., the peer host is a relay client for the HIP relay. It is 1025 worth noting that the figure corresponds to figure 3 in Figure 6, but 1026 the difference is that the main UPDATE procedure is carried over the 1027 relay and the connectivity is tested separately. Next, we describe 1028 the procedure in the figure in detail. 1030 Mobile Host HIP relay Peer Host 1031 | 1. UDP(UPDATE(ESP_INFO, | | 1032 | LOC_SET, SEQ)) | | 1033 +--------------------------------->| 2. UDP(UPDATE(ESP_INFO, | 1034 | | LOC_SET, SEQ, | 1035 | | RELAY_FROM)) | 1036 | +------------------------------->| 1037 | | | 1038 | | 3. UDP(UPDATE(ESP_INFO, SEQ, | 1039 | | ACK, ECHO_REQ_SIGN)) | 1040 | 4. UDP(UPDATE(ESP_INFO, SEQ, |<-------------------------------+ 1041 | ACK, ECHO_REQ_SIGN, | | 1042 | RELAY_TO)) | | 1043 |<---------------------------------+ | 1044 | | | 1045 | 5. UDP(UPDATE(ACK, | | 1046 | ECHO_RESP_SIGN)) | | 1047 +--------------------------------->| 6. UDP(UPDATE(ACK, | 1048 | | ECHO_RESP_SIGN, | 1049 | | RELAY_FROM)) | 1050 | +------------------------------->| 1051 | | | 1052 | 7. connectivity checks over UDP | 1053 +<----------------------------------------------------------------->+ 1054 | | | 1055 | 8. ESP data over UDP | 1056 +<----------------------------------------------------------------->+ 1057 | | | 1059 Figure 6: HIP UPDATE procedure 1061 In step 1, the mobile host has changed location and sends a location 1062 update to its peer through the HIP relay of the peer. It sends an 1063 UPDATE packet with source HIT belonging to itself and destination HIT 1064 belonging to the peer host. In the packet, the source IP address 1065 belongs to the mobile host and the destination to the HIP relay. The 1066 packet contains an ESP_INFO parameter, where, in this case, the OLD 1067 SPI and NEW SPI parameters both contain the pre-existing incoming 1068 SPI. The packet also contains the locators of the mobile host in a 1069 LOCATOR_SET parameter. The packet contains also a SEQ number to be 1070 acknowledged by the peer. As specified in 1071 [I-D.ietf-hip-rfc5206-bis], the packet may also include a HOST_ID 1072 (for middlebox inspection) and DIFFIE_HELLMAN parameter for rekeying. 1074 In step 2, HIP relay receives the UPDATE packet and forwards it to 1075 the peer host (i.e. relay client). The HIP relay rewrites the 1076 destination IP address and appends a RELAY_FROM parameter to the 1077 message. 1079 In step 3, the peer host receives the UPDATE packet, processes it and 1080 responds with another UPDATE message. The message is destined to the 1081 HIT of mobile host and to the IP address of the HIP relay. The 1082 message includes an ESP_INFO parameter where, in this case, the OLD 1083 SPI and NEW SPI parameters both contain the pre-existing incoming 1084 SPI. The peer includes a new SEQ and ECHO_REQUEST_SIGN parameters to 1085 be acknowledged by the mobile host. The message acknowledges the SEQ 1086 parameter of the earlier message with an ACK parameter. 1088 In step 4, the HIP relay receives the message, rewrites the 1089 destination IP address, appends an RELAY_TO parameter and forwards 1090 the modified message to the mobile host. 1092 In step 5, the mobile host receives the UPDATE packet from the peer 1093 and processes it. It concludes the information exchange by 1094 acknowledging the received SEQ parameter with an ACK parameter and 1095 the ECHO_REQUEST_SIGN parameter with ECHO_RESPONSE_SIGN parameter. 1096 The mobile host delivers the packet to the HIT of the peer and to the 1097 address of the HIP relay. The mobile host can start connectivity 1098 checks after this packet. 1100 In step 6, HIP relay receives the UPDATE packet and forwards it to 1101 the peer host (i.e. relay client). The HIP relay rewrites the 1102 destination IP address and appends a RELAY_FROM parameter to the 1103 message. When the peer host receives this concluding UPDATE packet, 1104 it can initiate the connectivity checks. 1106 In step 7, the two hosts test for connectivity across NATs according 1107 to procedures described in Section 4.6. The original Initiator of 1108 the communications is the controlling and the original Responder is 1109 the controlled host. 1111 In step 8, the connectivity checks are successfully completed and the 1112 controlling host has nominated one address pair to be used. The 1113 hosts set up security associations to deliver the application 1114 payload. 1116 If either host has registered a relayed address candidate from a data 1117 relay, the host MUST reactivate the address before connectivity 1118 checks by sending an UPDATE message containing PEER_PERMISSION 1119 parameter as described in Section 4.12.1. Otherwise, the relay drops 1120 ESP packets using the relayed address. 1122 4.10. NAT Keepalives 1124 To prevent NAT states from expiring, communicating hosts send 1125 periodic keepalives to other hosts that they have established a host 1126 associating with. If a registered host has not sent any data or 1127 control messages to its HIP or data relay for 15 seconds, it MUST 1128 send a HIP NOTIFY packet to the relay. Likewise, if a host has not 1129 sent any data to another host it has established a host association 1130 in the ICE-HIP_UDP mode, it MUST send either a HIP NOTIFY packet or 1131 an ICMPv6 echo request inside the related ESP tunnel. HIP relay 1132 servers MAY refrain from sending keepalives if it's known that they 1133 are not behind a middlebox that requires keepalives. If the base 1134 exchange or mobility handover procedure occurs during an extremely 1135 slow path, a host MAY also send HIP notify packets every 15 seconds 1136 to keep to path active. 1138 4.11. Closing Procedure 1140 The two-way procedure for closing a HIP and the related security 1141 associations is defined in [RFC7401]. One hosts initiates the 1142 procedure by sending a CLOSE party and the recipient confirms it with 1143 CLOSE_ACK. All packets are protected using HMACs and signatures, and 1144 the CLOSE messages includes a ECHO_REQUEST_SIGNED parameter to 1145 protect against replay attacks. 1147 The same procedure for closing HIP associations applies also here, 1148 but the messaging occurs using the UDP encapsulated tunnel that the 1149 two hosts employ. A host sending the CLOSE message SHOULD first send 1150 the message over a direct link. After a number of retransmissions, 1151 it MUST send over a HIP relay of the recipient if one exists. The 1152 host receiving the CLOSE message directly without a relay SHOULD 1153 respond directly. The the CLOSE message came via a relay, it SHOULD 1154 respond using the same relay. 1156 4.12. Relaying Considerations 1158 4.12.1. Forwarding Rules and Permissions 1160 The HIP data relay uses a similar permission model as a TURN server: 1161 before the data relay forwards any ESP data packets from a peer to a 1162 registered host (or the other direction), the client MUST set a 1163 permission for the peer's address. The permissions also install a 1164 forwarding rule for each direction, similar to TURN's channels, based 1165 on the Security Parameter Index (SPI) values in the ESP packets. 1167 Permissions are not required for HIP control packets. However, if a 1168 relayed address (as conveyed in the RELAYED_ADDRESS parameter from 1169 the data relay) is selected to be used for data, the registered host 1170 MUST send an UPDATE message to the data relay containing a 1171 PEER_PERMISSION parameter (see Section 5.13) with the address of the 1172 peer, and the outbound and inbound SPI values the registered host is 1173 using with this particular peer. To avoid packet dropping of ESP 1174 packets, the registered host SHOULD send the PEER_PERMISSION 1175 parameter before connectivity checks both in the case of base 1176 exchange and a mobility handover. It is worth noting that the UPDATE 1177 message includes a SEQ parameter (as specified in [RFC7401]) that the 1178 data relay must acknowledge, so that the registered host can resend 1179 the message with PEER_PERMISSION parameter if it gets lost. 1181 When a data relay receives an UPDATE with a PEER_PERMISSION 1182 parameter, it MUST check if the sender of the UPDATE is registered 1183 for data relaying service, and drop the UPDATE if the host was not 1184 registered. If the host was registered, the relay checks if there is 1185 a permission with matching information (address, protocol, port and 1186 SPI values). If there is no such permission, a new permission MUST 1187 be created and its lifetime MUST be set to 5 minutes. If an 1188 identical permission already existed, it MUST be refreshed by setting 1189 the lifetime to 5 minutes. A registered host SHOULD refresh 1190 permissions 1 minute before the expiration when the permission is 1191 still needed. 1193 The relayed address MUST be activated with the PEER_PERMISSION 1194 parameter both after the base exchange and after a handover. Unless 1195 activated, the data relay MUST drop all ESP packets. 1197 4.12.2. Relaying UDP Encapsulated Control and Data Packets 1199 When a HIP data relay accepts to relay UDP encapsulated ESP between a 1200 registered host and its peer, the relay opens a UDP port (relayed 1201 address) for this purpose as described in Section 4.1. This port can 1202 be used for delivering also control packets because connectivity 1203 checks also cover the path through the data relay. If the data relay 1204 receives a UDP encapsulated HIP control packet on that port, it MUST 1205 forward the packet to the registered host and add a RELAY_FROM 1206 parameter to the packet as if the data relay was acting as a HIP 1207 relay server. When the registered host replies to a control packet 1208 with a RELAY_FROM parameter via its relay, the registered host MUST 1209 add a RELAY_TO parameter containing the peer's address and use the 1210 address of its data relay as the destination address. Further, the 1211 data relay MUST send this packet to the peer's address from the 1212 relayed address. 1214 If the data relay receives a UDP packet that is not a HIP control 1215 packet to the relayed address, it MUST check if it has a permission 1216 set for the peer the packet is arriving from (i.e., the sender's 1217 address and SPI value matches to an installed permission). If 1218 permissions are set, the data relay MUST forward the packet to the 1219 registered host that created the permission. The data relay MUST 1220 also implement the similar checks for the reverse direction (i.e. 1221 ESP packets from the registered host to the peer). Packets without a 1222 permission MUST be dropped silently. 1224 4.12.3. Handling Conflicting SPI Values 1226 The inbound SPI values of the registered clients should be unique so 1227 that a data relay can properly demultiplex incoming packets from peer 1228 hosts to the correct registered clients. Vice versa, the inbound 1229 SPIs of the peer hosts should be unique for the same reason. These 1230 two cases are discussed in this section separately. 1232 In first case, the SPI collision problem occurs when two Initiators 1233 run a base exchange to the same Responder (i.e. registered host), and 1234 both the Initiators claim the same inbound SPI. Upon receiving an I2 1235 with a colliding SPI, the Responder MUST not include the relayed 1236 address in the R2 message because the data relay would not be able 1237 demultiplex the related ESP packet to the correct Initiator. Since 1238 the SPI space is 32 bits and the SPI values should be random, the 1239 probability for a conflicting SPI value is fairly small. However, a 1240 registered host with many peers MAY proactively decrease the odds of 1241 a conflict by registering to multiple data relays. The described 1242 collision scenario can be avoided if the Responder delivers a new 1243 relayed address candidate upon SPI collisions. Each relayed address 1244 has a separate UDP port reserved to it, so the relay can demultiplex 1245 properly conflicting SPIs of the Initiators based on the SPI and port 1246 number towards the correct Responder. 1248 In the second case, the SPI collision problems occurs if two hosts 1249 have registered to the same data relay and a third host initiates 1250 base exchange with both of them. In this case, the data relay has 1251 allocated separate UDP ports for the two registered hosts acting now 1252 as Responders. When the Responders send identical SPI values in 1253 their I2 messages via the relay, it can properly demultiplex it to 1254 the correct Responder because the UDP ports are different. 1256 5. Packet Formats 1258 The following subsections define the parameter and packet encodings 1259 for the HIP and ESP packets. All values MUST be in network byte 1260 order. 1262 It is worth noting that most of the parameters are shown for 1263 completeness sake even though they are specified already in 1264 [RFC5770]. New parameters are explicitly described as new. 1266 5.1. HIP Control Packets 1268 Figure 7 illustrates the packet format for UDP-encapsulated HIP. The 1269 format is identical to [RFC5770]. 1271 0 1 2 3 1272 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 1273 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1274 | Source Port | Destination Port | 1275 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1276 | Length | Checksum | 1277 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1278 | 32 bits of zeroes | 1279 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1280 | | 1281 ~ HIP Header and Parameters ~ 1282 | | 1283 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1285 Figure 7: Format of UDP-Encapsulated HIP Control Packets 1287 HIP control packets are encapsulated in UDP packets as defined in 1288 Section 2.2 of [RFC3948], "IKE Header Format for Port 4500", except a 1289 different port number is used. Figure 7 illustrates the 1290 encapsulation. The UDP header is followed by 32 zero bits that can 1291 be used to differentiate HIP control packets from ESP packets. The 1292 HIP header and parameters follow the conventions of [RFC7401] with 1293 the exception that the HIP header checksum MUST be zero. The HIP 1294 header checksum is zero for two reasons. First, the UDP header 1295 already contains a checksum. Second, the checksum definition in 1296 [RFC7401] includes the IP addresses in the checksum calculation. The 1297 NATs unaware of HIP cannot recompute the HIP checksum after changing 1298 IP addresses. 1300 A HIP relay server or a Responder without a relay SHOULD listen at 1301 UDP port 10500 for incoming UDP-encapsulated HIP control packets. If 1302 some other port number is used, it needs to be known by potential 1303 Initiators. 1305 5.2. Connectivity Checks 1307 HIP connectivity checks are HIP UPDATE packets. The format is 1308 specified in [RFC7401]. 1310 5.3. Keepalives 1312 The keepalives are either HIP NOTIFY packets as specified in 1313 [RFC7401] or ICMPv6 packets inside the ESP tunnel. 1315 5.4. NAT Traversal Mode Parameter 1317 The format of NAT traversal mode parameter is borrowed from 1318 [RFC5770]. The format of the NAT_TRAVERSAL_MODE parameter is similar 1319 to the format of the ESP_TRANSFORM parameter in [RFC7402] and is 1320 shown in Figure 8. This specification defines traversal mode 1321 identifier for ICE-HIP-UDP. The identifier RESERVED is reserved for 1322 future use. Future specifications may define more traversal modes. 1324 0 1 2 3 1325 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 1326 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1327 | Type | Length | 1328 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1329 | Reserved | Mode ID #1 | 1330 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1331 | Mode ID #2 | Mode ID #3 | 1332 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1333 | Mode ID #n | Padding | 1334 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1336 Type 608 1337 Length length in octets, excluding Type, Length, and padding 1338 Reserved zero when sent, ignored when received 1339 Mode ID defines the proposed or selected NAT traversal mode(s) 1341 The following NAT traversal mode IDs are defined: 1343 ID name Value 1344 RESERVED 0 1345 ICE-HIP-UDP 3 1347 Figure 8: Format of the NAT_TRAVERSAL_MODE Parameter 1349 The sender of a NAT_TRAVERSAL_MODE parameter MUST make sure that 1350 there are no more than six (6) Mode IDs in one NAT_TRAVERSAL_MODE 1351 parameter. Conversely, a recipient MUST be prepared to handle 1352 received NAT traversal mode parameters that contain more than six 1353 Mode IDs by accepting the first six Mode IDs and dropping the rest. 1354 The limited number of Mode IDs sets the maximum size of the 1355 NAT_TRAVERSAL_MODE parameter. The modes MUST be in preference order, 1356 most preferred mode(s) first. 1358 5.5. Connectivity Check Transaction Pacing Parameter 1360 The TRANSACTION_PACING is a new parameter, and it shown in Figure 9 1361 contains only the connectivity check pacing value, expressed in 1362 milliseconds, as a 32-bit unsigned integer. 1364 0 1 2 3 1365 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 1366 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1367 | Type | Length | 1368 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1369 | Min Ta | 1370 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1372 Type 610 1373 Length 4 1374 Min Ta the minimum connectivity check transaction pacing 1375 value the host would use 1377 Figure 9: Format of the TRANSACTION_PACING Parameter 1379 5.6. Relay and Registration Parameters 1381 The format of the REG_FROM, RELAY_FROM, and RELAY_TO parameters is 1382 shown in Figure 10. All parameters are identical except for the 1383 type. REG_FROM is the only parameter covered with the signature. 1385 0 1 2 3 1386 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 1387 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1388 | Type | Length | 1389 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1390 | Port | Protocol | Reserved | 1391 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1392 | | 1393 | Address | 1394 | | 1395 | | 1396 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1398 Type REG_FROM: 950 1399 RELAY_FROM: 63998 1400 RELAY_TO: 64002 1401 Length 20 1402 Port transport port number; zero when plain IP is used 1403 Protocol IANA assigned, Internet Protocol number. 1404 17 for UDP, 0 for plain IP 1405 Reserved reserved for future use; zero when sent, ignored 1406 when received 1407 Address an IPv6 address or an IPv4 address in "IPv4-Mapped 1408 IPv6 address" format 1410 Figure 10: Format of the REG_FROM, RELAY_FROM, and RELAY_TO 1411 Parameters 1413 REG_FROM contains the transport address and protocol from which the 1414 HIP relay server sees the registration coming. RELAY_FROM contains 1415 the address from which the relayed packet was received by the relay 1416 server and the protocol that was used. RELAY_TO contains the same 1417 information about the address to which a packet should be forwarded. 1419 5.7. LOCATOR_SET Parameter 1421 This specification reuses the format for UDP-based locators specified 1422 in [RFC5770] to be used for communicating the address candidates 1423 between two hosts. The generic and NAT-traversal-specific locator 1424 parameters are illustrated in Figure 11. 1426 0 1 2 3 1427 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 1428 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1429 | Type | Length | 1430 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1431 | Traffic Type | Locator Type | Locator Length| Reserved |P| 1432 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1433 | Locator Lifetime | 1434 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1435 | Locator | 1436 | | 1437 | | 1438 | | 1439 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1440 . . 1441 . . 1442 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1443 | Traffic Type | Loc Type = 2 | Locator Length| Reserved |P| 1444 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1445 | Locator Lifetime | 1446 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1447 | Transport Port | Transp. Proto| Kind | 1448 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1449 | Priority | 1450 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1451 | SPI | 1452 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1453 | Address | 1454 | | 1455 | | 1456 | | 1457 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1459 Figure 11: LOC_SET Parameter 1461 The individual fields in the LOCATOR_SET parameter are described in 1462 Table 1. 1464 +-----------+----------+--------------------------------------------+ 1465 | Field | Value(s) | Purpose | 1466 +-----------+----------+--------------------------------------------+ 1467 | Type | 193 | Parameter type | 1468 | Length | Variable | Length in octets, excluding Type and | 1469 | | | Length fields and padding | 1470 | Traffic | 0-2 | Is the locator for HIP signaling (1), for | 1471 | Type | | ESP (2), or for both (0) | 1472 | Locator | 2 | "Transport address" locator type | 1473 | Type | | | 1474 | Locator | 7 | Length of the fields after Locator | 1475 | Length | | Lifetime in 4-octet units | 1476 | Reserved | 0 | Reserved for future extensions | 1477 | Preferred | 0 or 1 | Set to 1 for a Locator in R1 if the | 1478 | (P) bit | | Responder can use it for the rest of the | 1479 | | | base exchange, otherwise set to zero | 1480 | Locator | Variable | Locator lifetime in seconds | 1481 | Lifetime | | | 1482 | Transport | Variable | Transport layer port number | 1483 | Port | | | 1484 | Transport | Variable | IANA assigned, transport layer Internet | 1485 | Protocol | | Protocol number. Currently only UDP (17) | 1486 | | | is supported. | 1487 | Kind | Variable | 0 for host, 1 for server reflexive, 2 for | 1488 | | | peer reflexive or 3 for relayed address | 1489 | Priority | Variable | Locator's priority as described in | 1490 | | | [I-D.ietf-ice-rfc5245bis] | 1491 | SPI | Variable | Security Parameter Index (SPI) value that | 1492 | | | the host expects to see in incoming ESP | 1493 | | | packets that use this locator | 1494 | Address | Variable | IPv6 address or an "IPv4-Mapped IPv6 | 1495 | | | address" format IPv4 address [RFC4291] | 1496 +-----------+----------+--------------------------------------------+ 1498 Table 1: Fields of the LOCATOR_SET Parameter 1500 5.8. RELAY_HMAC Parameter 1502 As specified in [RFC5770], the RELAY_HMAC parameter value has the TLV 1503 type 65520. It has the same semantics as RVS_HMAC 1504 [I-D.ietf-hip-rfc5204-bis]. 1506 5.9. Registration Types 1508 The REG_INFO, REG_REQ, REG_RESP, and REG_FAILED parameters contain 1509 Registration Type [I-D.ietf-hip-rfc5203-bis] values for HIP relay 1510 server registration. The value for RELAY_UDP_HIP is 2 as specified 1511 in [RFC5770]. 1513 5.10. Notify Packet Types 1515 A HIP relay server and end-hosts can use NOTIFY packets to signal 1516 different error conditions. The NOTIFY packet types are the same as 1517 in [RFC5770]. 1519 The Notify Packet Types [RFC7401] are shown below. The Notification 1520 Data field for the error notifications SHOULD contain the HIP header 1521 of the rejected packet and SHOULD be empty for the 1522 CONNECTIVITY_CHECKS_FAILED type. 1524 NOTIFICATION PARAMETER - ERROR TYPES Value 1525 ------------------------------------ ----- 1527 NO_VALID_NAT_TRAVERSAL_MODE_PARAMETER 60 1529 If a HIP relay server does not forward a base exchange packet due 1530 to missing NAT traversal mode parameter, or the Initiator selects 1531 a NAT traversal mode that the Responder did not expect, the relay 1532 or the Responder may send back a NOTIFY error packet with this 1533 type. 1535 CONNECTIVITY_CHECKS_FAILED 61 1537 Used by the end-hosts to signal that NAT traversal connectivity 1538 checks failed and did not produce a working path. 1540 MESSAGE_NOT_RELAYED 62 1542 Used by a HIP relay server to signal that is was not able or 1543 willing to relay a HIP packet. 1545 5.11. ESP Data Packets 1547 The format for ESP data packets is identical to [RFC5770]. 1549 [RFC3948] describes the UDP encapsulation of the IPsec ESP transport 1550 and tunnel mode. On the wire, the HIP ESP packets do not differ from 1551 the transport mode ESP, and thus the encapsulation of the HIP ESP 1552 packets is same as the UDP encapsulation transport mode ESP. 1553 However, the (semantic) difference to Bound End-to-End Tunnel (BEET) 1554 mode ESP packets used by HIP is that IP header is not used in BEET 1555 integrity protection calculation. 1557 During the HIP base exchange, the two peers exchange parameters that 1558 enable them to define a pair of IPsec ESP security associations (SAs) 1559 as described in [RFC7402]. When two peers perform a UDP-encapsulated 1560 base exchange, they MUST define a pair of IPsec SAs that produces 1561 UDP-encapsulated ESP data traffic. 1563 The management of encryption/authentication protocols and SPIs is 1564 defined in [RFC7402]. The UDP encapsulation format and processing of 1565 HIP ESP traffic is described in Section 6.1 of [RFC7402]. 1567 5.12. RELAYED_ADDRESS and MAPPED_ADDRESS Parameters 1569 While the type values are new, the format of the RELAYED_ADDRESS and 1570 MAPPED_ADDRESS parameters (Figure 12) is identical to REG_FROM, 1571 RELAY_FROM and RELAY_TO parameters. This document specifies only the 1572 use of UDP relaying, and, thus, only protocol 17 is allowed. 1573 However, future documents may specify support for other protocols. 1575 0 1 2 3 1576 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 1577 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1578 | Type | Length | 1579 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1580 | Port | Protocol | Reserved | 1581 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1582 | | 1583 | Address | 1584 | | 1585 | | 1586 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1588 Type [TBD by IANA; 1589 RELAYED_ADDRESS: 4650 1590 MAPPED_ADDRESS: 4660] 1591 Length 20 1592 Port the UDP port number 1593 Protocol IANA assigned, Internet Protocol number (17 for UDP) 1594 Reserved reserved for future use; zero when sent, ignored 1595 when received 1596 Address an IPv6 address or an IPv4 address in "IPv4-Mapped 1597 IPv6 address" format 1599 Figure 12: Format of the RELAYED_ADDRESS and MAPPED_ADDRESS 1600 Parameters 1602 5.13. PEER_PERMISSION Parameter 1604 The format of the new PEER_PERMISSION parameter is shown in 1605 Figure 13. The parameter is used for setting up and refreshing 1606 forwarding rules and the permissions for data packets at the data 1607 relay. The parameter contains one or more sets of Port, Protocol, 1608 Address, Outbound SPI (OSPI), and Inbound SPI (ISPI) values. One set 1609 defines a rule for one peer address. 1611 0 1 2 3 1612 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 1613 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1614 | Type | Length | 1615 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1616 | Port | Protocol | Reserved | 1617 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1618 | | 1619 | Address | 1620 | | 1621 | | 1622 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1623 | OSPI | 1624 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1625 | ISPI | 1626 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1627 | | 1628 | ... | 1629 | | 1630 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1632 Type [TBD by IANA; 4680] 1633 Length length in octets, excluding Type and Length 1634 Port the transport layer (UDP) port number of the peer 1635 Protocol IANA assigned, Internet Protocol number (17 for UDP) 1636 Reserved reserved for future use; zero when sent, ignored 1637 when received 1638 Address an IPv6 address, or an IPv4 address in "IPv4-Mapped 1639 IPv6 address" format, of the peer 1640 OSPI the outbound SPI value the registered host is using for 1641 the peer with the Address and Port 1642 ISPI the inbound SPI value the registered host is using for 1643 the peer with the Address and Port 1645 Figure 13: Format of the PEER_PERMISSION Parameter 1647 5.14. HIP Connectivity Check Packets 1649 The connectivity request messages are HIP UPDATE packets containing a 1650 new CANDIDATE_PRIORITY parameter (Figure 14). Response UPDATE 1651 packets contain a MAPPED_ADDRESS parameter (Figure 12). 1653 0 1 2 3 1654 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 1655 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1656 | Type | Length | 1657 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1658 | Priority | 1659 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1661 Type [TBD by IANA; 4700] 1662 Length 4 1663 Priority the priority of a (potential) peer reflexive candidate 1665 Figure 14: Format of the CANDIDATE_PRIORITY Parameter 1667 5.15. NOMINATE parameter 1669 Figure 15 shows the NOMINATE parameter that is used to conclude the 1670 candidate nomination process. 1672 0 1 2 3 1673 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 1674 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1675 | Type | Length | 1676 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1677 | Reserved | 1678 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1680 Type [TBD by IANA; 4710] 1681 Length 4 1682 Reserved Reserved for future extension purposes 1684 Figure 15: Format of the NOMINATE Parameter 1686 6. Security Considerations 1688 The security considerations are the same as in [RFC5770], but are 1689 repeated here for completeness sake. 1691 6.1. Privacy Considerations 1693 The locators are in plain text format in favor of inspection at HIP- 1694 aware middleboxes in the future. The current document does not 1695 specify encrypted versions of LOCATOR_SETs, even though it could be 1696 beneficial for privacy reasons to avoid disclosing them to 1697 middleboxes. 1699 It is also possible that end-users may not want to reveal all 1700 locators to each other. For example, tracking the physical location 1701 of a multihoming end-host may become easier if it reveals all 1702 locators to its peer during a base exchange. Also, revealing host 1703 addresses exposes information about the local topology that may not 1704 be allowed in all corporate environments. For these two reasons, an 1705 end-host may exclude certain host addresses from its LOCATOR_SET 1706 parameter. However, such behavior creates non-optimal paths when the 1707 hosts are located behind the same NAT. Especially, this could be 1708 problematic with a legacy NAT that does not support routing from the 1709 private address realm back to itself through the outer address of the 1710 NAT. This scenario is referred to as the hairpin problem [RFC5128]. 1711 With such a legacy NAT, the only option left would be to use a 1712 relayed transport address from a TURN server. 1714 The use of HIP and data relays can be also useful for privacy 1715 purposes. For example, a privacy concerned Responder may reveal only 1716 its HIP relay server and Relayed candidates to Initiators. This same 1717 mechanism also protects the Responder against Denial-of-Service (DoS) 1718 attacks by allowing the Responder to initiate new connections even if 1719 its relays would be unavailable due to a DoS attack. 1721 6.2. Opportunistic Mode 1723 A HIP relay server should have one address per relay client when a 1724 HIP relay is serving more than one relay client and supports 1725 opportunistic mode. Otherwise, it cannot be guaranteed that the HIP 1726 relay server can deliver the I1 packet to the intended recipient. 1728 6.3. Base Exchange Replay Protection for HIP Relay Server 1730 In certain scenarios, it is possible that an attacker, or two 1731 attackers, can replay an earlier base exchange through a HIP relay 1732 server by masquerading as the original Initiator and Responder. The 1733 attack does not require the attacker(s) to compromise the private 1734 key(s) of the attacked host(s). However, for this attack to succeed, 1735 the Responder has to be disconnected from the HIP relay server. 1737 The relay can protect itself against replay attacks by becoming 1738 involved in the base exchange by introducing nonces that the end- 1739 hosts (Initiator and Responder) are required to sign. One way to do 1740 this is to add ECHO_REQUEST_M parameters to the R1 and I2 packets as 1741 described in [HIP-MIDDLE] and drop the I2 or R2 packets if the 1742 corresponding ECHO_RESPONSE_M parameters are not present. 1744 6.4. Demuxing Different HIP Associations 1746 Section 5.1 of [RFC3948] describes a security issue for the UDP 1747 encapsulation in the standard IP tunnel mode when two hosts behind 1748 different NATs have the same private IP address and initiate 1749 communication to the same Responder in the public Internet. The 1750 Responder cannot distinguish between two hosts, because security 1751 associations are based on the same inner IP addresses. 1753 This issue does not exist with the UDP encapsulation of HIP ESP 1754 transport format because the Responder uses HITs to distinguish 1755 between different Initiators. 1757 6.5. Reuse of Ports at the Data Relay 1759 If the data relay uses the same relayed address and port (as conveyed 1760 in the RELAYED_ADDRESS parameter) for multiple registered hosts, it 1761 appears to all the peers, and their firewalls, that all the 1762 registered hosts using the relay are at the same address. Thus, a 1763 stateful firewall may allow packets pass from hosts that would not 1764 normally be able to send packets to a peer behind the firewall. 1765 Therefore, a HIP data relay SHOULD NOT re-use the port numbers. If 1766 port numbers need to be re-used, the relay SHOULD have a sufficiently 1767 large pool of port numbers and select ports from the pool randomly to 1768 decrease the chances of a registered host obtaining the same address 1769 that a another host behind the same firewall is using. 1771 7. IANA Considerations 1773 This section is to be interpreted according to [RFC5226]. 1775 This document updates the IANA Registry for HIP Parameter Types 1776 [RFC7401] by assigning new HIP Parameter Type values for the new HIP 1777 Parameters: RELAYED_ADDRESS, MAPPED_ADDRESS (defined in 1778 Section 5.12), and PEER_PERMISSION (defined in Section 5.13). 1780 This document also updates the IANA Registry for HIP NAT traversal 1781 modes [RFC5770] by assigning value for the NAT traversal mode ICE- 1782 HIP-UDP (defined in Section 5.4). 1784 This document defines additional registration types for the HIP 1785 Registration Extension [I-D.ietf-hip-rfc5203-bis] that allow 1786 registering with a HIP relay server for ESP relaying service: 1787 RELAY_UDP_ESP (defined in Section 4.1; and performing server 1788 reflexive candidate discovery: CANDIDATE_DISCOVERY (defined in 1789 Section 4.2). 1791 8. Contributors 1793 Marcelo Bagnulo, Philip Matthews and Hannes Tschofenig have 1794 contributed to [RFC5770]. This document leans heavily on the work in 1795 the RFC. 1797 9. Acknowledgments 1799 Thanks to Jonathan Rosenberg and the rest of the MMUSIC WG folks for 1800 the excellent work on ICE. In addition, the authors would like to 1801 thank Andrei Gurtov, Simon Schuetz, Martin Stiemerling, Lars Eggert, 1802 Vivien Schmitt, and Abhinav Pathak for their contributions and Tobias 1803 Heer, Teemu Koponen, Juhana Mattila, Jeffrey M. Ahrenholz, Kristian 1804 Slavov, Janne Lindqvist, Pekka Nikander, Lauri Silvennoinen, Jukka 1805 Ylitalo, Juha Heinanen, Joakim Koskela, Samu Varjonen, Dan Wing, and 1806 Jani Hautakorpi for their comments to [RFC5770], which is the basis 1807 for this document. 1809 This work has been partially funded by CyberTrust programme by 1810 Digile/Tekes in Finland. 1812 10. References 1814 10.1. Normative References 1816 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1817 Requirement Levels", BCP 14, RFC 2119, 1818 DOI 10.17487/RFC2119, March 1997, 1819 . 1821 [RFC7401] Moskowitz, R., Ed., Heer, T., Jokela, P., and T. 1822 Henderson, "Host Identity Protocol Version 2 (HIPv2)", 1823 RFC 7401, DOI 10.17487/RFC7401, April 2015, 1824 . 1826 [I-D.ietf-hip-rfc5203-bis] 1827 Laganier, J. and L. Eggert, "Host Identity Protocol (HIP) 1828 Registration Extension", draft-ietf-hip-rfc5203-bis-10 1829 (work in progress), January 2016. 1831 [I-D.ietf-hip-rfc5204-bis] 1832 Laganier, J. and L. Eggert, "Host Identity Protocol (HIP) 1833 Rendezvous Extension", draft-ietf-hip-rfc5204-bis-07 (work 1834 in progress), December 2015. 1836 [I-D.ietf-hip-rfc5206-bis] 1837 Henderson, T., Vogt, C., and J. Arkko, "Host Mobility with 1838 the Host Identity Protocol", draft-ietf-hip-rfc5206-bis-12 1839 (work in progress), May 2016. 1841 [RFC5770] Komu, M., Henderson, T., Tschofenig, H., Melen, J., and A. 1842 Keranen, Ed., "Basic Host Identity Protocol (HIP) 1843 Extensions for Traversal of Network Address Translators", 1844 RFC 5770, DOI 10.17487/RFC5770, April 2010, 1845 . 1847 [RFC5389] Rosenberg, J., Mahy, R., Matthews, P., and D. Wing, 1848 "Session Traversal Utilities for NAT (STUN)", RFC 5389, 1849 DOI 10.17487/RFC5389, October 2008, 1850 . 1852 [RFC7402] Jokela, P., Moskowitz, R., and J. Melen, "Using the 1853 Encapsulating Security Payload (ESP) Transport Format with 1854 the Host Identity Protocol (HIP)", RFC 7402, 1855 DOI 10.17487/RFC7402, April 2015, 1856 . 1858 [RFC4291] Hinden, R. and S. Deering, "IP Version 6 Addressing 1859 Architecture", RFC 4291, DOI 10.17487/RFC4291, February 1860 2006, . 1862 [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an 1863 IANA Considerations Section in RFCs", BCP 26, RFC 5226, 1864 DOI 10.17487/RFC5226, May 2008, 1865 . 1867 [I-D.ietf-ice-rfc5245bis] 1868 Ker채nen, A., Holmberg, C., and J. Rosenberg, 1869 "Interactive Connectivity Establishment (ICE): A Protocol 1870 for Network Address Translator (NAT) Traversal", draft- 1871 ietf-ice-rfc5245bis-03 (work in progress), June 2016. 1873 10.2. Informative References 1875 [RFC4423] Moskowitz, R. and P. Nikander, "Host Identity Protocol 1876 (HIP) Architecture", RFC 4423, DOI 10.17487/RFC4423, May 1877 2006, . 1879 [RFC5201] Moskowitz, R., Nikander, P., Jokela, P., Ed., and T. 1880 Henderson, "Host Identity Protocol", RFC 5201, 1881 DOI 10.17487/RFC5201, April 2008, 1882 . 1884 [RFC5207] Stiemerling, M., Quittek, J., and L. Eggert, "NAT and 1885 Firewall Traversal Issues of Host Identity Protocol (HIP) 1886 Communication", RFC 5207, DOI 10.17487/RFC5207, April 1887 2008, . 1889 [RFC5766] Mahy, R., Matthews, P., and J. Rosenberg, "Traversal Using 1890 Relays around NAT (TURN): Relay Extensions to Session 1891 Traversal Utilities for NAT (STUN)", RFC 5766, 1892 DOI 10.17487/RFC5766, April 2010, 1893 . 1895 [MMUSIC-ICE] 1896 Rosenberg, J., "Guidelines for Usage of Interactive 1897 Connectivity Establishment (ICE) by non Session Initiation 1898 Protocol (SIP) Protocols", Work in Progress, July 2008. 1900 [RFC5128] Srisuresh, P., Ford, B., and D. Kegel, "State of Peer-to- 1901 Peer (P2P) Communication across Network Address 1902 Translators (NATs)", RFC 5128, DOI 10.17487/RFC5128, March 1903 2008, . 1905 [HIP-MIDDLE] 1906 Heer, T., Wehrle, K., and M. Komu, "End-Host 1907 Authentication for HIP Middleboxes", Work in Progress, 1908 February 2009. 1910 [RFC3948] Huttunen, A., Swander, B., Volpe, V., DiBurro, L., and M. 1911 Stenberg, "UDP Encapsulation of IPsec ESP Packets", 1912 RFC 3948, DOI 10.17487/RFC3948, January 2005, 1913 . 1915 Appendix A. Selecting a Value for Check Pacing 1917 Selecting a suitable value for the connectivity check transaction 1918 pacing is essential for the performance of connectivity check-based 1919 NAT traversal. The value should not be so small that the checks 1920 cause network congestion or overwhelm the NATs. On the other hand, a 1921 pacing value that is too high makes the checks last for a long time, 1922 thus increasing the connection setup delay. 1924 The Ta value may be configured by the user in environments where the 1925 network characteristics are known beforehand. However, if the 1926 characteristics are not known, it is recommended that the value is 1927 adjusted dynamically. In this case, it's recommended that the hosts 1928 estimate the round-trip time (RTT) between them and set the minimum 1929 Ta value so that only two connectivity check messages are sent on 1930 every RTT. 1932 One way to estimate the RTT is to use the time it takes for the HIP 1933 relay server registration exchange to complete; this would give an 1934 estimate on the registering host's access link's RTT. Also, the I1/ 1935 R1 exchange could be used for estimating the RTT, but since the R1 1936 can be cached in the network, or the relaying service can increase 1937 the delay notably, it is not recommended. 1939 Appendix B. Base Exchange through a Rendezvous Server 1941 When the Initiator looks up the information of the Responder from 1942 DNS, it's possible that it discovers a rendezvous server (RVS) record 1943 [I-D.ietf-hip-rfc5204-bis]. In this case, if the Initiator uses NAT 1944 traversal methods described in this document, it MAY use its own HIP 1945 relay server to forward HIP traffic to the rendezvous server. The 1946 Initiator will send the I1 packet using its HIP relay server, which 1947 will then forward it to the RVS server of the Responder. In this 1948 case, the value of the protocol field in the RELAY_TO parameter MUST 1949 be IP since RVS does not support UDP-encapsulated base exchange 1950 packets. The Responder will send the R1 packet directly to the 1951 Initiator's HIP relay server and the following I2 and R2 packets are 1952 also sent directly using the relay. 1954 In case the Initiator is not able to distinguish which records are 1955 RVS address records and which are Responder's address records (e.g., 1956 if the DNS server did not support HIP extensions), the Initiator 1957 SHOULD first try to contact the Responder directly, without using a 1958 HIP relay server. If none of the addresses are reachable, it MAY try 1959 them out using its own HIP relay server as described above. 1961 Authors' Addresses 1963 Ari Keranen 1964 Ericsson 1965 Hirsalantie 11 1966 02420 Jorvas 1967 Finland 1969 Email: ari.keranen@ericsson.com 1971 Jan Melen 1972 Ericsson 1973 Hirsalantie 11 1974 02420 Jorvas 1975 Finland 1977 Email: jan.melen@ericsson.com 1978 Miika Komu (editor) 1979 Ericsson 1980 Hirsalantie 11 1981 02420 Jorvas 1982 Finland 1984 Email: miika.komu@ericsson.com