idnits 2.17.1 draft-ietf-hip-native-nat-traversal-21.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 : ---------------------------------------------------------------------------- == There are 1 instance of lines with non-RFC6890-compliant IPv4 addresses in the document. If these are example addresses, they should be changed. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == Line 1691 has weird spacing: '...eserved zero...' == Line 1731 has weird spacing: '... Min Ta the ...' == Line 1762 has weird spacing: '...eserved rese...' == Line 1764 has weird spacing: '...Address an ...' == Line 1958 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. -- The document date (October 23, 2017) is 2377 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) ** 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-08 ** Downref: Normative reference to an Informational RFC: RFC 2475 -- Obsolete informational reference (is this intentional?): RFC 4423 (Obsoleted by RFC 9063) -- Obsolete informational reference (is this intentional?): RFC 5201 (Obsoleted by RFC 7401) Summary: 4 errors (**), 0 flaws (~~), 10 warnings (==), 3 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: April 26, 2018 Ericsson 6 October 23, 2017 8 Native NAT Traversal Mode for the Host Identity Protocol 9 draft-ietf-hip-native-nat-traversal-21 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 April 26, 2018. 37 Copyright Notice 39 Copyright (c) 2017 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 . . . . . . . . . . . . . . . . . . . . 7 57 4. Protocol Description . . . . . . . . . . . . . . . . . . . . 9 58 4.1. Relay Registration . . . . . . . . . . . . . . . . . . . 9 59 4.2. Transport Address Candidate Gathering at the Relay Client 12 60 4.3. NAT Traversal Mode Negotiation . . . . . . . . . . . . . 15 61 4.4. Connectivity Check Pacing Negotiation . . . . . . . . . . 16 62 4.5. Base Exchange via Control Relay Server . . . . . . . . . 16 63 4.6. Connectivity Checks . . . . . . . . . . . . . . . . . . . 19 64 4.6.1. Connectivity Check Procedure . . . . . . . . . . . . 20 65 4.6.2. Rules for Connectivity Checks . . . . . . . . . . . . 23 66 4.6.3. Rules for Concluding Connectivity Checks . . . . . . 25 67 4.7. NAT Traversal Optimizations . . . . . . . . . . . . . . . 26 68 4.7.1. Minimal NAT Traversal Support . . . . . . . . . . . . 26 69 4.7.2. Base Exchange without Connectivity Checks . . . . . . 26 70 4.7.3. Initiating a Base Exchange both with and without UDP 71 Encapsulation . . . . . . . . . . . . . . . . . . . . 28 72 4.8. Sending Control Packets after the Base Exchange . . . . . 28 73 4.9. Mobility Handover Procedure . . . . . . . . . . . . . . . 29 74 4.10. NAT Keepalives . . . . . . . . . . . . . . . . . . . . . 32 75 4.11. Closing Procedure . . . . . . . . . . . . . . . . . . . . 32 76 4.12. Relaying Considerations . . . . . . . . . . . . . . . . . 32 77 4.12.1. Forwarding Rules and Permissions . . . . . . . . . . 32 78 4.12.2. HIP Data Relay and Relaying of Control Packets . . . 33 79 4.12.3. Handling Conflicting SPI Values . . . . . . . . . . 34 80 5. Packet Formats . . . . . . . . . . . . . . . . . . . . . . . 35 81 5.1. HIP Control Packets . . . . . . . . . . . . . . . . . . . 35 82 5.2. Connectivity Checks . . . . . . . . . . . . . . . . . . . 36 83 5.3. Keepalives . . . . . . . . . . . . . . . . . . . . . . . 36 84 5.4. NAT Traversal Mode Parameter . . . . . . . . . . . . . . 36 85 5.5. Connectivity Check Transaction Pacing Parameter . . . . . 37 86 5.6. Relay and Registration Parameters . . . . . . . . . . . . 38 87 5.7. LOCATOR_SET Parameter . . . . . . . . . . . . . . . . . . 39 88 5.8. RELAY_HMAC Parameter . . . . . . . . . . . . . . . . . . 41 89 5.9. Registration Types . . . . . . . . . . . . . . . . . . . 41 90 5.10. Notify Packet Types . . . . . . . . . . . . . . . . . . . 41 91 5.11. ESP Data Packets . . . . . . . . . . . . . . . . . . . . 42 92 5.12. RELAYED_ADDRESS and MAPPED_ADDRESS Parameters . . . . . . 42 93 5.13. PEER_PERMISSION Parameter . . . . . . . . . . . . . . . . 43 94 5.14. HIP Connectivity Check Packets . . . . . . . . . . . . . 44 95 5.15. NOMINATE parameter . . . . . . . . . . . . . . . . . . . 45 96 6. Security Considerations . . . . . . . . . . . . . . . . . . . 45 97 6.1. Privacy Considerations . . . . . . . . . . . . . . . . . 45 98 6.2. Opportunistic Mode . . . . . . . . . . . . . . . . . . . 46 99 6.3. Base Exchange Replay Protection for Control Relay Server 46 100 6.4. Demultiplexing Different HIP Associations . . . . . . . . 47 101 6.5. Reuse of Ports at the Data Relay Server . . . . . . . . . 47 102 6.6. Amplification attacks . . . . . . . . . . . . . . . . . . 47 103 6.7. Attacks against Connectivity Checks and Candidate 104 Gathering . . . . . . . . . . . . . . . . . . . . . . . . 47 105 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 48 106 8. Contributors . . . . . . . . . . . . . . . . . . . . . . . . 48 107 9. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 49 108 10. References . . . . . . . . . . . . . . . . . . . . . . . . . 49 109 10.1. Normative References . . . . . . . . . . . . . . . . . . 49 110 10.2. Informative References . . . . . . . . . . . . . . . . . 50 111 Appendix A. Selecting a Value for Check Pacing . . . . . . . . . 51 112 Appendix B. Differences with respect to ICE . . . . . . . . . . 52 113 Appendix C. Differences to Base Exchange and UPDATE procedures . 53 114 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 56 116 1. Introduction 118 The Host Identity Protocol (HIP) [RFC7401] is specified to run 119 directly on top of IPv4 or IPv6. However, many middleboxes found in 120 the Internet, such as NATs and firewalls, often allow only UDP or TCP 121 traffic to pass [RFC5207]. Also, especially NATs usually require the 122 host behind a NAT to create a forwarding state in the NAT before 123 other hosts outside of the NAT can contact the host behind the NAT. 124 To overcome this problem, different methods, commonly referred to as 125 NAT traversal techniques, have been developed. 127 As one solution, the HIP experiment report [RFC6538] mentions that 128 Teredo based NAT traversal for HIP and related ESP traffic (with 129 double tunneling overhead). Another solution is specified in 130 [RFC5770], which will be referred as "Legacy ICE-HIP" in this 131 document. The experimental Legacy ICE-HIP specification combines 132 Interactive Connectivity Establishment (ICE) protocol 133 [I-D.ietf-ice-rfc5245bis] with HIP, so that basically ICE is 134 responsible of NAT traversal and connectivity testing, while HIP is 135 responsible of end-host authentication and IPsec key management. The 136 resulting protocol uses HIP, STUN and ESP messages tunneled over a 137 single UDP flow. The benefit of using ICE and its STUN/TURN 138 messaging formats is that one can re-use the NAT traversal 139 infrastructure already available in the Internet, such as STUN and 140 TURN servers. Also, some middleboxes may be STUN-aware and may be 141 able to do something "smart" when they see STUN being used for NAT 142 traversal. 144 Implementing a full ICE/STUN/TURN protocol stack as specified in 145 Legacy ICE-HIP results in a considerable amount of effort and code 146 which could be avoided by re-using and extending HIP messages and 147 state machines for the same purpose. Thus, this document specifies 148 an alternative NAT traversal mode referred as "Native ICE-HIP" that 149 employs HIP messaging format instead of STUN or TURN for the 150 connectivity checks, keepalives and data relaying. Native ICE-HIP 151 also specifies how mobility management works in the context of NAT 152 traversal, which is missing from the Legacy ICE-HIP specification. 153 The native specification is also based on HIPv2, whereas legacy 154 specification is based on HIPv1. 156 Similarly as Legacy ICE-HIP, also this specification builds on the 157 HIP registration extensions [RFC8003] and the base exchange procedure 158 [RFC7401] and its closing procedures, so the reader is recommended to 159 get familiar with the relevant specifications. In a nutshell, the 160 registration extensions allow a HIP Initiator (usually a "client" 161 host) to ask for specific services from a HIP Responder (usually a 162 "server" host). The registration parameters are included in a base 163 exchange, which is essentially a four-way Diffie-Hellman key exchange 164 authenticated using the public keys of the end-hosts. When the hosts 165 negotiate support for ESP [RFC7402] during the base exchange, they 166 can deliver ESP protected application payload to each other. When 167 either of the hosts moves and changes its IP address, the two hosts 168 re-establish connectivity using the mobility extensions [RFC8046]. 169 The reader is also recommended to get familiar with the mobility 170 extensions, but basically it is a three-way procedure, where the 171 mobile host first announces its new location to the peer, and then 172 the peer tests for connectivity (so called return routability check), 173 for which the mobile hosts must respond in order to activate its new 174 location. This specification builds on the mobility procedures, but 175 modifies it to be compatible with ICE. The differences to the 176 mobility extensions specified in Appendix C. It is worth noting that 177 multihoming support as specified in [RFC8078] is left for further 178 study. 180 This specification builds heavily on the ICE methodology, so it is 181 recommended that the reader is familiar with the ICE specification 182 [I-D.ietf-ice-rfc5245bis] (especially the overview). However, native 183 ICE-HIP does not implement all the features in ICE, and, hence, the 184 different features of ICE are cross referenced using [RFC2119] 185 terminology for clarity. Appendix B explains the differences to ICE. 187 2. Terminology 189 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 190 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 191 document are to be interpreted as described in [RFC2119]. 193 This document borrows terminology from [RFC5770], [RFC7401], 194 [RFC8046], [RFC4423], [I-D.ietf-ice-rfc5245bis], and [RFC5389]. The 195 following terms recur in the text: 197 ICE: 198 Interactive Connectivity Establishment (ICE) protocol as specified 199 in [I-D.ietf-ice-rfc5245bis] 201 Legacy ICE-HIP: 202 Refers to the "Basic Host Identity Protocol (HIP) Extensions for 203 Traversal of Network Address Translators" as specified in 204 [RFC5770]. The protocol specified in this document offers an 205 alternative to Legacy ICE-HIP. 207 Native ICE-HIP: 208 The protocol specified in this document (Native NAT Traversal Mode 209 for HIP). 211 Initiator: 212 The Initiator is the host that initiates the base exchange using 213 I1 message. 215 Responder: 216 The Responder is the host that receives the I1 packet from the 217 Initiator. 219 Control Relay Server 220 A registrar host that forwards any kind of HIP control plane 221 packets between the Initiator and the Responder. This host is 222 critical because it relays the locators between the Initiator and 223 the Responder, so that they can try to establish a direct 224 communication path with each other. This host is used to replace 225 HIP rendezvous servers [RFC8004] for hosts operating in private 226 address realms. In the Legacy ICE-HIP specification, this host is 227 denoted as "HIP relay server". 228 . 230 Control Relay Client: 231 A requester host that registers to a Control Relay Server 232 requesting it to forward control-plane traffic (i.e. HIP control 233 messages). In the Legacy ICE-HIP specification, this is denoted 234 as "HIP Relay Client". 236 Data Relay Server: 237 A registrar host that forwards HIP related data plane packets, 238 such as Encapsulating Security Payload (ESP) [RFC7402], between 239 two hosts. This host implements similar functionality as TURN 240 servers. 242 Data Relay Client: 243 A requester host that registers to a Data Relay Server requesting 244 it to forward data-plane traffic (e.g. ESP traffic). 246 Locator: 247 As defined in [RFC8046]: "A name that controls how the packet is 248 routed through the network and demultiplexed by the end-host. It 249 may include a concatenation of traditional network addresses such 250 as an IPv6 address and end-to-end identifiers such as an ESP SPI. 251 It may also include transport port numbers or IPv6 Flow Labels as 252 demultiplexing context, or it may simply be a network address." 254 LOCATOR_SET (written in capital letters): 255 Denotes a HIP control packet parameter that bundles multiple 256 locators together. 258 ICE offer: 259 The Initiator's LOCATOR_SET parameter in a HIP I2 control packet. 260 Corresponds to the ICE offer parameter, but is HIP specific. 262 ICE answer: 263 The Responder's LOCATOR_SET parameter in a HIP R2 control packet. 264 Corresponds to the ICE answer parameter, but is HIP specific. 266 HIP connectivity checks: 267 In order to obtain a direct end-to-end communication path (without 268 employing a Data Relay Server), two communicating HIP hosts try to 269 "punch holes" through their NAT boxes using this mechanism. It is 270 similar to the ICE connectivity checks, but implemented using HIP 271 return routability checks. 273 Controlling host: 274 The controlling host is the Initiator. It nominates the candidate 275 pair to be used with the controlled host. 277 Controlled host: 278 The controlled host is the Responder. It waits for the 279 controlling to nominate an address candidate pair. 281 Checklist: 282 A list of address candidate pairs that need to be tested for 283 connectivity. 285 Transport address: 287 Transport layer port and the corresponding IPv4/v6 address. 289 Candidate: 290 A transport address that is a potential point of contact for 291 receiving data. 293 Host candidate: 294 A candidate obtained by binding to a specific port from an IP 295 address on the host. 297 Server reflexive candidate: 298 A translated transport address of a host as observed by a Control 299 or Data Relay Server. 301 Peer reflexive candidate: 302 A translated transport address of a host as observed by its peer. 304 Relayed candidate: 305 A transport address that exists on a Data Relay Server. Packets 306 that arrive at this address are relayed towards the Data Relay 307 Client. 309 Permission: 310 In the context of Data Relay Server, permission refers to a 311 concept similar to TURN's channels. Before a host can use a 312 relayed candidate to forward traffic through a Data Relay Server, 313 the host must activate the relayed candidate with a specific peer 314 host. 316 Base: 317 The base of an candidate is the local source address a host uses 318 to send packets for the associated candidate. For example, the 319 base of a server reflexive address is the local address the host 320 used for registering itself to the associated Control or Data 321 Relay Server. The base of a host candidate is equal to the host 322 candidate itself. 324 3. Overview of Operation 325 +--------------+ 326 | Control | 327 +--------+ | Relay Server | +--------+ 328 | Data | +----+-----+---+ | Data | 329 | Relay | / \ | Relay | 330 | Server | / \ | Server | 331 +--------+ / \ +--------+ 332 / \ 333 / \ 334 / \ 335 / <- Signaling -> \ 336 / \ 337 +-------+ +-------+ 338 | NAT | | NAT | 339 +-------+ +-------+ 340 / \ 341 / \ 342 +-------+ +-------+ 343 | Init- | | Resp- | 344 | iator | | onder | 345 +-------+ +-------+ 347 Figure 1: Example Network Configuration 349 In the example configuration depicted in Figure 1, both Initiator and 350 Responder are behind one or more NATs, and both private networks are 351 connected to the public Internet. To be contacted from behind a NAT, 352 at least the Responder must be registered with a Control Relay Server 353 reachable on the public Internet. The Responder may have also 354 registered to a Data Relay Server that can forward the data plane in 355 case NAT traversal fails. While, strictly speaking, the Initiator 356 does not need any Relay Servers, it may act in the other role for 357 other hosts and connectivity with the Data Relay Server of the 358 Responder may fail, so it is the Initiator may also have registered 359 to a Control and/or Data Relay Server. It is worth noting that a 360 Control and Data Relay does not forge the source address of a passing 361 packet, but always translates the source address and source port of a 362 packet to be forwarded (to its own). 364 We assume, as a starting point, that the Initiator knows both the 365 Responder's Host Identity Tag (HIT) and the address(es) of the 366 Responder's Control Relay Server(s) (how the Initiator learns of the 367 Responder's Control Relay Server is outside of the scope of this 368 document, but may be through DNS or another name service). The first 369 steps are for both the Initiator and Responder to register with a 370 Control Relay Server (need not be the same one) and gather a set of 371 address candidates. The hosts use either Control Relay Servers or 372 Data Relay Servers (or other infrastructure including STUN or TURN 373 servers) for gathering the candidates. Next, the HIP base exchange 374 is carried out by encapsulating the HIP control packets in UDP 375 datagrams and sending them through the Responder's Control Relay 376 Server. As part of the base exchange, each HIP host learns of the 377 peer's candidate addresses through the HIP offer/answer procedure 378 embedded in the base exchange. 380 Once the base exchange is completed, two HIP hosts have established a 381 working communication session (for signaling) via a Control Relay 382 Server, but the hosts still have to find a better path, preferably 383 without a Data Relay Server, for the ESP data flow. For this, 384 connectivity checks are carried out until a working pair of addresses 385 is discovered. At the end of the procedure, if successful, the hosts 386 will have established a UDP-based tunnel that traverses both NATs, 387 with the data flowing directly from NAT to NAT or via a Data Relay 388 Server. At this point, also the HIP signaling can be sent over the 389 same address/port pair, and is demultiplexed from IPsec as described 390 in the UDP encapsulation standard for IPsec [RFC3948]. Finally, the 391 two hosts send NAT keepalives as needed in order keep their UDP- 392 tunnel state active in the associated NAT boxes. 394 If either one of the hosts knows that it is not behind a NAT, hosts 395 can negotiate during the base exchange a different mode of NAT 396 traversal that does not use HIP connectivity checks, but only UDP 397 encapsulation of HIP and ESP. Also, it is possible for the Initiator 398 to simultaneously try a base exchange with and without UDP 399 encapsulation. If a base exchange without UDP encapsulation 400 succeeds, no HIP connectivity checks or UDP encapsulation of ESP are 401 needed. 403 4. Protocol Description 405 This section describes the normative behavior of the "Native ICE-HIP" 406 protocol extension. Most of the procedures are similar to what is 407 defined in [RFC5770] but with different, or additional, parameter 408 types and values. In addition, a new type of relaying server, Data 409 Relay Server, is specified. Also, it should be noted that HIP 410 version 2 [RFC7401] (instead of [RFC5201] used in [RFC5770]) is 411 expected to be used with this NAT traversal mode. 413 4.1. Relay Registration 415 In order for two hosts to communicate over NATted environments, they 416 need a reliable way to exchange information. To achieve this, "HIP 417 relay server" is defined in [RFC5770]. It supports relaying of HIP 418 control plane traffic over UDP in NATted environments, and forwards 419 HIP control packets between the Initiator and the Responder. In this 420 document, the HIP relay server is denoted as "Control Relay Server" 421 for better alignment with the rest of the terminology. The 422 registration to the Control Relay Server can be achieved using 423 RELAY_UDP_ESP parameter as explained later in this section. 425 To guarantee also data plane delivery over varying types of NAT 426 devices, a host MAY also register for UDP encapsulated ESP relaying 427 using Registration Type RELAY_UDP_ESP (value [TBD by IANA: 3]). This 428 service may be coupled with the Control Relay Server server or 429 offered separately on another server. If the server supports 430 relaying of UDP encapsulated ESP, the host is allowed to register for 431 a data relaying service using the registration extensions in 432 Section 3.3 of [RFC8003]). If the server has sufficient relaying 433 resources (free port numbers, bandwidth, etc.) available, it opens a 434 UDP port on one of its addresses and signals the address and port to 435 the registering host using the RELAYED_ADDRESS parameter (as defined 436 in Section 5.12 in this document). If the Data Relay Server would 437 accept the data relaying request but does not currently have enough 438 resources to provide data relaying service, it MUST reject the 439 request with Failure Type "Insufficient resources" [RFC8003]. 441 A Control Relay Server MUST silently drop packets to a Control Relay 442 Client that has not previously registered with the HIP relay. The 443 registration process follows the generic registration extensions 444 defined in [RFC8003]. The HIP control plane relaying registration 445 follows [RFC5770], but the data plane registration is different. It 446 is worth noting that if the HIP control and data plane relay services 447 reside on different hosts, the client has to register separately to 448 each of them. In the example shown in Figure 2, the two services are 449 coupled on a single host. The text uses "Relay Client" and "Relay 450 Server" as a shorthand when the procedures apply both to control and 451 data cases. 453 Control/Data Control/Data 454 Relay Client (Initiator) Relay Server (Responder) 455 | 1. UDP(I1) | 456 +---------------------------------------------------------------->| 457 | | 458 | 2. UDP(R1(REG_INFO(RELAY_UDP_HIP,[RELAY_UDP_ESP]))) | 459 |<----------------------------------------------------------------+ 460 | | 461 | 3. UDP(I2(REG_REQ(RELAY_UDP_HIP),[RELAY_UDP_ESP])) | 462 +---------------------------------------------------------------->| 463 | | 464 | 4. UDP(R2(REG_RES(RELAY_UDP_HIP,[RELAY_UDP_ESP]), REG_FROM, | 465 | [RELAYED_ADDRESS])) | 466 |<----------------------------------------------------------------+ 467 | | 469 Figure 2: Example Registration with a HIP Relay 471 In step 1, the Relay Client (Initiator) starts the registration 472 procedure by sending an I1 packet over UDP to the Relay Server. It 473 is RECOMMENDED that the Relay Client select a random port number from 474 the ephemeral port range 49152-65535 for initiating a base exchange. 475 Alternatively, a host MAY also use a single fixed port for initiating 476 all outgoing connections. However, the allocated port MUST be 477 maintained until all of the corresponding HIP Associations are 478 closed. It is RECOMMENDED that the Relay Server listen to incoming 479 connections at UDP port 10500. If some other port number is used, it 480 needs to be known by potential Relay Clients. 482 In step 2, the Relay Server (Responder) lists the services that it 483 supports in the R1 packet. The support for HIP control plane over 484 UDP relaying is denoted by the Registration Type value RELAY_UDP_HIP 485 (see Section 5.9). If the server supports also relaying of ESP 486 traffic over UDP, it includes also Registration type value 487 RELAY_UDP_ESP. 489 In step 3, the Relay Client selects the services for which it 490 registers and lists them in the REG_REQ parameter. The Relay Client 491 registers for the Control Data Relay service by listing the 492 RELAY_UDP_HIP value in the request parameter. If the Relay Client 493 requires also ESP relaying over UDP, it lists also RELAY_UDP_ESP. 495 In step 4, the Relay Server concludes the registration procedure with 496 an R2 packet and acknowledges the registered services in the REG_RES 497 parameter. The Relay Server denotes unsuccessful registrations (if 498 any) in the REG_FAILED parameter of R2. The Relay Server also 499 includes a REG_FROM parameter that contains the transport address of 500 the Relay Client as observed by the Relay Server (Server Reflexive 501 candidate). If the Relay Client registered to ESP relaying service, 502 the Relay Server includes RELAYED_ADDRESS parameter that describes 503 the UDP port allocated to the Relay Client for ESP relaying. It is 504 worth noting that the Data Relay Client must first activate this UDP 505 port by sending an UPDATE message to the Data Relay Server that 506 includes a PEER_PERMISSION parameter as described in Section 4.12.1 507 both after base exchange and handover procedures. Also, the Data 508 Relay Server should follow the port allocation recommendations in 509 Section 6.5. 511 After the registration, the Relay Client sends periodically NAT 512 keepalives to the Relay Server in order to keep the NAT bindings 513 between the Relay Client and the relay alive. The keepalive 514 extensions are described in Section 4.10. 516 The Data Relay Client MUST maintain an active HIP association with 517 the Data Relay Server as long as it requires the data relaying 518 service. When the HIP association is closed (or times out), or the 519 registration lifetime passes without the Data Relay Client refreshing 520 the registration, the Data Relay Server MUST stop relaying packets 521 for that host and close the corresponding UDP port (unless other Data 522 Relay Clients are still using it). 524 The Data Relay Server MAY use the same relayed address and port for 525 multiple Data Relay Clients, but since this can cause problems with 526 stateful firewalls (see Section 6.5) it is NOT RECOMMENDED. 528 When a Control Relay Client sends an UPDATE (e.g., due to host 529 movement or to renew service registration), the Control Relay Server 530 MUST follow the general guidelines defined in [RFC8003], with the 531 difference that all UPDATE messages are delivered on top of UDP. In 532 addition to this, the Control Relay Server MUST include the REG_FROM 533 parameter in all UPDATE responses sent to the Control Relay Client. 534 This applies both renewals of service registration but also to host 535 movement, where especially the latter requires the Control Relay 536 Client to learn its new server reflexive address candidate. 538 4.2. Transport Address Candidate Gathering at the Relay Client 540 An Initiator needs to gather a set of address candidates before 541 contacting a (non-relay) Responder. The candidates are needed for 542 connectivity checks that allow two hosts to discover a direct, non- 543 relayed path for communicating with each other. One server reflexive 544 candidate can be discovered during the registration with the Control 545 Relay Server from the REG_FROM parameter (and another from Data Relay 546 Server if one is employed). 548 The candidate gathering can be done at any time, but it needs to be 549 done before sending an I2 or R2 in the base exchange if ICE-HIP-UDP 550 mode is to be used for the connectivity checks. It is RECOMMENDED 551 that all three types of candidates (host, server reflexive, and 552 relayed) are gathered to maximize the probability of successful NAT 553 traversal. However, if no Data Relay Server is used, and the host 554 has only a single local IP address to use, the host MAY use the local 555 address as the only host candidate and the address from the REG_FROM 556 parameter discovered during the Control Relay Server registration as 557 a server reflexive candidate. In this case, no further candidate 558 gathering is needed. 560 If a Relay Client has more than one network interface, it can 561 discover additional server reflexive candidates by sending UPDATE 562 messages from each of its interfaces to the Relay Server. Each such 563 UPDATE message MUST include the following parameters: registration 564 request (REG_REQ) parameter with Registration Type 565 CANDIDATE_DISCOVERY (value [TBD by IANA: 4]) and ECHO_REQUEST_SIGN 566 parameter. When a Control Relay Server receives an UPDATE message 567 with registration request containing a CANDIDATE_DISCOVERY type, it 568 MUST include a REG_FROM parameter, containing the same information as 569 if this were a Control Relay Server registration, to the response (in 570 addition to the mandatory ECHO_RESPONSE_SIGNED paramater). This 571 request type SHOULD NOT create any state at the Control Relay Server. 573 ICE guidelines [I-D.ietf-ice-rfc5245bis] for candidate gathering are 574 followed here. A number of host candidates (loopback, anycast and 575 others) should be excluded as described in the ICE specification 576 [I-D.ietf-ice-rfc5245bis]. Relayed candidates SHOULD be gathered in 577 order to guarantee successful NAT traversal, and implementations 578 SHOULD support this functionality even if it will not be used in 579 deployments in order to enable it by software configuration update if 580 needed at some point. A host SHOULD employ only a single server for 581 gathering the candidates for a single HIP association; either a one 582 server providing both Control and Data Relay Server functionality, or 583 one Control Relay Server and also Data Relay Server if the 584 functionality is offered by another server. When the relay service 585 is split between two hosts, the server reflexive candidate from the 586 Control Relay Server SHOULD be used instead of the one provided by 587 the Data Relay Server. If a relayed candidate is identical to a host 588 candidate, the relayed candidate must be discarded. NAT64 589 considerations in [I-D.ietf-ice-rfc5245bis] apply as well. 591 HIP based connectivity can be utilized by IPv4 applications using 592 LSIs and by IPv6 based applications using HITs. The LSIs and HITs of 593 the local virtual interfaces MUST be excluded in the candidate 594 gathering phase as well to avoid creating unnecessary loopback 595 connectivity tests. 597 Gathering of candidates MAY also be performed by other means than 598 described in this section. For example, the candidates could be 599 gathered as specified in Section 4.2 of [RFC5770] if STUN servers are 600 available, or if the host has just a single interface and no STUN or 601 Data Relay Server are available. 603 Each local address candidate MUST be assigned a priority. The 604 following recommended formula (as described in 605 [I-D.ietf-ice-rfc5245bis]) SHOULD be used: 607 priority = (2^24)*(type preference) + (2^8)*(local preference) + 608 (2^0)*(256 - component ID) 610 In the formula, type preference follows the ICE specification section 611 4.1.2.2 guidelines: the RECOMMENDED values are 126 for host 612 candidates, 100 for server reflexive candidates, 110 for peer 613 reflexive candidates, and 0 for relayed candidates. The highest 614 value is 126 (the most preferred) and lowest is 0 (last resort). For 615 all candidates of the same type, the preference type value MUST be 616 identical, and, correspondingly, the value MUST be different for 617 different types. For peer reflexive values, the type preference 618 value MUST be higher than for server reflexive types. It should be 619 noted that peer reflexive values are learned later during 620 connectivity checks, so a host cannot employ it during candidate 621 gathering stage yet. 623 Following the ICE specification, the local preference MUST be an 624 integer from 0 (lowest preference) to 65535 (highest preference) 625 inclusive. In the case the host has only a single address candidate, 626 the value SHOULD be 65535. In the case of multiple candidates, each 627 local preference value MUST be unique. Dual-stack considerations for 628 IPv6 in ICE apply also here. 630 Unlike ICE, this protocol only creates a single UDP flow between the 631 two communicating hosts, so only a single component exists. Hence, 632 the component ID value MUST always be set to 1. 634 As defined in ICE , the retransmission timeout (RTO) for address 635 gathering from a Control/Data Relay Server SHOULD be calculated as 636 follows: 638 RTO = MAX (500ms, Ta * (Num-Of-Pairs)) 640 where Ta is the value used for Ta is the value used for the 641 connectivity check pacing and Num-Of-Pairs is number of pairs of 642 candidates with Control and Data Relay Servers (e.g. in the case of a 643 single server, it would be 1). A smaller value than 500 ms for the 644 RTO MUST NOT be used. 646 4.3. NAT Traversal Mode Negotiation 648 This section describes the usage of a new non-critical parameter 649 type. The presence of the parameter in a HIP base exchange means 650 that the end-host supports NAT traversal extensions described in this 651 document. As the parameter is non-critical (as defined in 652 Section 5.2.1 of [RFC7401]), it can be ignored by a end-host, which 653 means that the host is not required to support it or may decline to 654 use it. 656 With registration with a Control/Data Relay Server, it is usually 657 sufficient to use the UDP-ENCAPSULATION mode of NAT traversal since 658 the Relay Server is assumed to be in public address space. Thus, the 659 Relay Server SHOULD propose the UDP-ENCAPSULATION mode as the 660 preferred or only mode. The NAT traversal mode negotiation in a HIP 661 base exchange is illustrated in Figure 3. It is worth noting that 662 the Relay Server could be located between the hosts, but is omitted 663 here for simplicity. 665 Initiator Responder 666 | 1. UDP(I1) | 667 +--------------------------------------------------------------->| 668 | | 669 | 2. UDP(R1(.., NAT_TRAVERSAL_MODE(ICE-HIP-UDP), ..)) | 670 |<---------------------------------------------------------------+ 671 | | 672 | 3. UDP(I2(.., NAT_TRAVERSAL_MODE(ICE-HIP-UDP), LOC_SET, ..)) | 673 +--------------------------------------------------------------->| 674 | | 675 | 4. UDP(R2(.., LOC_SET, ..)) | 676 |<---------------------------------------------------------------+ 677 | | 679 Figure 3: Negotiation of NAT Traversal Mode 681 In step 1, the Initiator sends an I1 to the Responder. In step 2, 682 the Responder responds with an R1. As specified in [RFC5770], the 683 NAT_TRAVERSAL_MODE parameter in R1 contains a list of NAT traversal 684 modes the Responder supports. The mode specified in this document is 685 ICE-HIP-UDP (value [TBD by IANA: 3]). 687 In step 3, the Initiator sends an I2 that includes a 688 NAT_TRAVERSAL_MODE parameter. It contains the mode selected by the 689 Initiator from the list of modes offered by the Responder. If ICE- 690 HIP-UDP mode was selected, the I2 also includes the "Transport 691 address" locators (as defined in Section 5.7) of the Initiator in a 692 LOCATOR_SET parameter (denoted here LOC_SET). The locators in I2 are 693 the "ICE offer". 695 In step 4, the Responder concludes the base exchange with an R2 696 packet. If the Initiator chose ICE NAT traversal mode, the Responder 697 includes a LOCATOR_SET parameter in the R2 packet. The locators in 698 R2, encoded like the locators in I2, are the "ICE answer". If the 699 NAT traversal mode selected by the Initiator is not supported by the 700 Responder, the Responder SHOULD reply with a NOTIFY packet with type 701 NO_VALID_NAT_TRAVERSAL_MODE_PARAMETER and abort the base exchange. 703 4.4. Connectivity Check Pacing Negotiation 705 As explained in Legacy ICE-HIP [RFC5770], when a NAT traversal mode 706 with connectivity checks is used, new transactions should not be 707 started too fast to avoid congestion and overwhelming the NATs. For 708 this purpose, during the base exchange, hosts can negotiate a 709 transaction pacing value, Ta, using a TRANSACTION_PACING parameter in 710 R1 and I2 packets. The parameter contains the minimum time 711 (expressed in milliseconds) the host would wait between two NAT 712 traversal transactions, such as starting a new connectivity check or 713 retrying a previous check. The value that is used by both of the 714 hosts is the higher of the two offered values. 716 The minimum Ta value SHOULD be configurable, and if no value is 717 configured, a value of 50 ms MUST be used. Guidelines for selecting 718 a Ta value are given in Appendix A. Hosts SHOULD NOT use values 719 smaller than 5 ms for the minimum Ta, since such values may not work 720 well with some NATs (as explained in [I-D.ietf-ice-rfc5245bis]). The 721 Initiator MUST NOT propose a smaller value than what the Responder 722 offered. If a host does not include the TRANSACTION_PACING parameter 723 in the base exchange, a Ta value of 50 ms MUST be used as that host's 724 minimum value. 726 4.5. Base Exchange via Control Relay Server 728 This section describes how the Initiator and Responder perform a base 729 exchange through a Control Relay Server. Connectivity pacing 730 (denoted as TA_P here) was described in Section 4.4 and is neither 731 repeated here. Similarly, the NAT traversal mode negotiation process 732 (denoted as NAT_TM in the example) was described in Section 4.3 and 733 is neither repeated here. If a Control Relay Server receives an R1 734 or I2 packet without the NAT traversal mode parameter, it MUST drop 735 it and SHOULD send a NOTIFY error packet with type 736 NO_VALID_NAT_TRAVERSAL_MODE_PARAMETER to the sender of the R1 or I2. 738 It is RECOMMENDED that the Initiator send an I1 packet encapsulated 739 in UDP when it is destined to an IPv4 address of the Responder. 741 Respectively, the Responder MUST respond to such an I1 packet with a 742 UDP-encapsulated R1 packet, and also the rest of the communication 743 related to the HIP association MUST also use UDP encapsulation. 745 Figure 4 illustrates a base exchange via a Control Relay Server. We 746 assume that the Responder (i.e. a Control Relay Client) has already 747 registered to the Control Relay Server. The Initiator may have also 748 registered to another (or the same Control Relay Server), but the 749 base exchange will traverse always through the Control Relay Server 750 of the Responder. 752 Initiator Control Relay Server Responder 753 | 1. UDP(I1) | | 754 +--------------------------------->| 2. UDP(I1(RELAY_FROM)) | 755 | +------------------------------->| 756 | | | 757 | | 3. UDP(R1(RELAY_TO, NAT_TM, | 758 | | TA_P)) | 759 | 4. UDP(R1(RELAY_TO, NAT_TM, |<-------------------------------+ 760 | TA_P)) | | 761 |<---------------------------------+ | 762 | | | 763 | 5. UDP(I2(LOC_SET, NAT_TM, | | 764 | TA_P)) | | 765 +--------------------------------->| 6. UDP(I2(LOC_SET, RELAY_FROM, | 766 | | NAT_TM, TA_P)) | 767 | +------------------------------->| 768 | | | 769 | | 7. UDP(R2(LOC_SET, RELAY_TO)) | 770 | 8. UDP(R2(LOC_SET, RELAY_TO)) |<-------------------------------+ 771 |<---------------------------------+ | 772 | | | 774 Figure 4: Base Exchange via a HIP Relay Server 776 In step 1 of Figure 4, the Initiator sends an I1 packet over UDP via 777 the Control Relay Server to the Responder. In the HIP header, the 778 source HIT belongs to the Initiator and the destination HIT to the 779 Responder. The initiator sends the I1 packet from its IP address to 780 the IP address of the Control Relay Server over UDP. 782 In step 2, the Control Relay Server receives the I1 packet. If the 783 destination HIT belongs to a registered Responder, the Control Relay 784 Server processes the packet. Otherwise, the Control Relay Server 785 MUST drop the packet silently. The Control Relay Server appends a 786 RELAY_FROM parameter to the I1 packet, which contains the transport 787 source address and port of the I1 as observed by the Control Relay 788 Server. The Control Relay Server protects the I1 packet with 789 RELAY_HMAC as described in [RFC8004], except that the parameter type 790 is different (see Section 5.8). The Control Relay Server changes the 791 source and destination ports and IP addresses of the packet to match 792 the values the Responder used when registering to the Control Relay 793 Server, i.e., the reverse of the R2 used in the registration. The 794 Control Relay Server MUST recalculate the transport checksum and 795 forward the packet to the Responder. 797 In step 3, the Responder receives the I1 packet. The Responder 798 processes it according to the rules in [RFC7401]. In addition, the 799 Responder validates the RELAY_HMAC according to [RFC8004] and 800 silently drops the packet if the validation fails. The Responder 801 replies with an R1 packet to which it includes RELAY_TO and NAT 802 traversal mode parameters. The responder MUST include ICE-HIP-UDP in 803 the NAT traversal modes. The RELAY_TO parameter MUST contain the 804 same information as the RELAY_FROM parameter, i.e., the Initiator's 805 transport address, but the type of the parameter is different. The 806 RELAY_TO parameter is not integrity protected by the signature of the 807 R1 to allow pre-created R1 packets at the Responder. 809 In step 4, the Control Relay Server receives the R1 packet. The 810 Control Relay Server drops the packet silently if the source HIT 811 belongs to a Control Relay Client that has not successfully 812 registered. The Control Relay Server MAY verify the signature of the 813 R1 packet and drop it if the signature is invalid. Otherwise, the 814 Control Relay Server rewrites the source address and port, and 815 changes the destination address and port to match RELAY_TO 816 information. Finally, the Control Relay Server recalculates 817 transport checksum and forwards the packet. 819 In step 5, the Initiator receives the R1 packet and processes it 820 according to [RFC7401]. The Initiator MAY use the address in the 821 RELAY_TO parameter as a local peer-reflexive candidate for this HIP 822 association if it is different from all known local candidates. The 823 Initiator replies with an I2 packet that uses the destination 824 transport address of R1 as the source address and port. The I2 825 packet contains a LOCATOR_SET parameter that lists all the HIP 826 candidates (ICE offer) of the Initiator. The candidates are encoded 827 using the format defined in Section 5.7. The I2 packet MUST also 828 contain a NAT traversal mode parameter that includes ICE-HIP-UDP 829 mode. 831 In step 6, the Control Relay Server receives the I2 packet. The 832 Control Relay Server appends a RELAY_FROM and a RELAY_HMAC to the I2 833 packet similarly as explained in step 2, and forwards the packet to 834 the Responder. 836 In step 7, the Responder receives the I2 packet and processes it 837 according to [RFC7401]. It replies with an R2 packet and includes a 838 RELAY_TO parameter as explained in step 3. The R2 packet includes a 839 LOCATOR_SET parameter that lists all the HIP candidates (ICE answer) 840 of the Responder. The RELAY_TO parameter is protected by the HMAC. 842 In step 8, the Control Relay Server processes the R2 as described in 843 step 4. The Control Relay Server forwards the packet to the 844 Initiator. After the Initiator has received the R2 and processed it 845 successfully, the base exchange is completed. 847 Hosts MUST include the address of one or more Control Relay Servers 848 (including the one that is being used for the initial signaling) in 849 the LOCATOR_SET parameter in I2 and R2 if they intend to use such 850 servers for relaying HIP signaling immediately after the base 851 exchange completes. The traffic type of these addresses MUST be "HIP 852 signaling" and they MUST NOT be used as HIP candidates. If the 853 Control Relay Server locator used for relaying the base exchange is 854 not included in I2 or R2 LOCATOR_SET parameters, it SHOULD NOT be 855 used after the base exchange. Instead, further HIP signaling SHOULD 856 use the same path as the data traffic. It is RECOMMENDED to use the 857 same Control Relay Server throughout the lifetime of the host 858 association that was used for forwarding the base exchange if the 859 Responder includes it in the locator parameter of the R2 message. 861 4.6. Connectivity Checks 863 When the Initiator and Responder complete the base exchange through 864 the Control Relay Server, both of them employ the IP address of the 865 Control Relay Server as the destination address for the packets. 866 This address MUST NOT be used as a destination for ESP traffic (i.e., 867 the corresponding Control Relay Client cannot advertise it to its 868 peer) unless the server supports also Data Relay Server 869 functionality, for which the client has successfully registered to. 870 When NAT traversal mode with ICE-HIP-UDP was successfully negotiated 871 and selected, the Initiator and Responder MUST start the connectivity 872 checks in order to attempt to obtain direct end-to-end connectivity 873 through NAT devices. It is worth noting that the connectivity checks 874 MUST be completed even though no ESP_TRANSFORM would be negotiated 875 and selected. 877 The connectivity checks follow the ICE methodology [MMUSIC-ICE], but 878 UDP encapsulated HIP control messages are used instead of ICE 879 messages. Only normal nomination MUST be used for the connectivity 880 checks, i.e., aggressive nomination MUST NOT be employed. As stated 881 in the ICE specification, the basic procedure for connectivity checks 882 has three phases: sorting the candidate pairs according their 883 priority, sending checks in the prioritized order and acknowledging 884 the checks from the peer host. 886 The Initiator MUST take the role of controlling host and the 887 Responder acts as the controlled host. The roles MUST persist 888 throughout the HIP associate lifetime (to be reused in the possibly 889 mobility UPDATE procedures). In the case both communicating nodes 890 are initiating the communications to each other using an I1 packet, 891 the conflict is resolved as defined in section 6.7 in [RFC7401]: the 892 host with the "larger" HIT changes to its Role to Responder. In such 893 a case, the host changing its role to Responder MUST also switch to 894 controlling role. 896 The protocol follows standard HIP UPDATE sending and processing rules 897 as defined in section 6.11 and 6.12 in [RFC7401], but some new 898 parameters are introduced (CANDIDATE_PRIORITY, MAPPED_ADDRESS and 899 NOMINATE). 901 4.6.1. Connectivity Check Procedure 903 Figure 5 illustrates connectivity checks in a simplified scenario, 904 where the Initiator and Responder have only a single candidate pair 905 to check. Typically, NATs drop messages until both sides have sent 906 messages using the same port pair. In this scenario, the Responder 907 sends a connectivity check first but the NAT of the Initiator drops 908 it. However, the connectivity check from the Initiator reaches the 909 Responder because it uses the same port pair as the first message. 910 It is worth noting that the message flow in this section is 911 idealistic, and, in practice, more messages would be dropped, 912 especially in the beginning. For instance, connectivity tests always 913 start with the candidates with the highest priority, which would be 914 host candidates (which would not reach the recipient in this 915 scenario). 917 Initiator NAT1 NAT2 Responder 918 | | 1. UDP(UPDATE(SEQ, CAND_PRIO, | | 919 | | ECHO_REQ_SIGN)) | | 920 | X<-----------------------------------+----------------+ 921 | | | | 922 | 2. UDP(UPDATE(SEQ, ECHO_REQ_SIGN, CAND_PRIO)) | | 923 +-------------+------------------------------------+--------------->| 924 | | | | 925 | 3. UDP(UPDATE(ACK, ECHO_RESP_SIGN, MAPPED_ADDR)) | | 926 |<------------+------------------------------------+----------------+ 927 | | | | 928 | 4. UDP(UPDATE(SEQ, ECHO_REQ_SIGN, CAND_PRIO)) | | 929 |<------------+------------------------------------+----------------+ 930 | | | | 931 | 5. UDP(UPDATE(ACK, ECHO_RESP_SIGN, MAPPED_ADDR)) | | 932 +-------------+------------------------------------+--------------->| 933 | | | | 934 | 6. Other connectivity checks using UPDATE over UDP | 935 |<------------+------------------------------------+----------------> 936 | | | | 937 | 7. UDP(UPDATE(SEQ, ECHO_REQ_SIGN, CAND_PRIO, NOMINATE)) | 938 +-------------+------------------------------------+--------------->| 939 | | | | 940 | 8. UDP(UPDATE(SEQ, ACK, ECHO_REQ_SIGN, ECHO_RESP_SIGN, | 941 | NOMINATE)) | | 942 |<------------+------------------------------------+----------------+ 943 | | | | 944 | 9. UDP(UPDATE(ACK, ECHO_RESP_SIGN)) | | 945 +-------------+------------------------------------+--------------->+ 946 | | | | 947 | 10. ESP data traffic over UDP | | 948 +<------------+------------------------------------+--------------->+ 949 | | | | 951 Figure 5: Connectivity Checks 953 In step 1, the Responder sends a connectivity check to the Initiator 954 that the NAT of the Initiator drops. The message includes a number 955 of parameters. As specified in [RFC7401]), the SEQ parameter 956 includes a running sequence identifier for the connectivity check. 957 The candidate priority (denoted "CAND_PRIO" in the figure) describes 958 the priority of the address candidate being tested. The 959 ECHO_REQUEST_SIGNED (denoted ECHO_REQ_SIGN in the figure) includes a 960 nonce that the recipient must sign and echo back as it is. 962 In step 2, the Initiator sends a connectivity check, using the same 963 address pair candidate as in the previous step, and the message 964 traverses successfully the NAT boxes. The message includes the same 965 parameters as in the previous step. It should be noted that the 966 sequence identifier is locally assigned by the Responder, so it can 967 be different than in the previous step. 969 In step 3, the Responder has successfully received the previous 970 connectivity check from the Initiator and starts to build a response 971 message. Since the message from the Initiator included a SEQ, the 972 Responder must acknowledge it using an ACK parameter. Also, the 973 nonce contained in the echo request must be echoed back in an 974 ECHO_REQUEST_SIGNED (denoted ECHO_REQUEST_SIGN) parameter. The 975 Responder includes also a MAPPED_ADDRESS parameter (denoted 976 MAPPED_ADDR in the figure) that contains the transport address of the 977 Initiator as observed by the Responder (i.e. peer reflexive 978 candidate). This message is successfully delivered to the Initiator, 979 and upon reception the Initiator marks the candidate pair as valid. 981 In step 4, the Responder retransmits the connectivity check sent in 982 the first step, since it was not acknowledged yet. 984 In step 5, the Initiator responds to the previous connectivity check 985 message from the Responder. The Initiator acknowledges the SEQ 986 parameter from the previous message using ACK parameter and the 987 ECHO_REQUEST_SIGN parameter with ECHO_RESPONSE_SIGNED. In addition, 988 it includes MAPPED_ADDR parameter that includes the peer reflexive 989 candidate. This response message is successfully delivered to the 990 Responder, and upon reception the Initiator marks the candidate pair 991 as valid. 993 In step 6, despite the two hosts now having valid address candidates, 994 the hosts still test the remaining address candidates in a similar 995 way as in the previous steps (due to the use of normal nomination). 996 It should be noted that each connectivity check has a unique sequence 997 number in the SEQ parameter. 999 In step 7, the Initiator has completed testing all address candidates 1000 and nominates one address candidate to be used. It sends an UPDATE 1001 message using the selected address candidates that includes a number 1002 of parameters: SEQ, ECHO_REQUEST_SIGN, CANDIDATE_PRIORITY and the 1003 NOMINATE parameter. 1005 In step 8, the Responder receives the message with NOMINATE parameter 1006 from the Initiator. It sends a response that includes the NOMINATE 1007 parameter in addition to a number of other parameters. The ACK and 1008 ECHO_RESPONSE_SIGNED parameters acknowledge the SEQ and 1009 ECHO_REQUEST_SIGN parameters from previous message from the 1010 Initiator. The Responder includes SEQ and ECHO_REQUEST_SIGN 1011 parameters in order to receive an acknowledgment from the Responder. 1013 In step 9, the Initiator completes the candidate nomination process 1014 by confirming the message reception to the Responder. In the 1015 confirmation message, the ACK and ECHO_RESPONSE_SIGNED parameters 1016 correspond to the SEQ and ECHO_REQUEST_SIGN parameters in the message 1017 sent by the Responder in the previous step. 1019 In step 10, the Initiator and Responder can start sending application 1020 payload over the successfully nominated address candidates. 1022 It is worth noting that if either host has registered a relayed 1023 address candidate from a Data Relay Server, the host MUST activate 1024 the address before connectivity checks by sending an UPDATE message 1025 containing PEER_PERMISSION parameter as described in Section 4.12.1. 1026 Otherwise, the Data Relay Server drops ESP packets using the relayed 1027 address. 1029 It should be noted that in the case both Initiator and Responder both 1030 advertising their own relayed address candidates, it is possible that 1031 the two hosts choose the two relayed addresses as a result of the ICE 1032 nomination algorithm. While this is possible (and even could be 1033 desirable for privacy reasons), it can be unlikely due to low 1034 priority assigned for the relayed address candidates. In such a 1035 event, the nominated address pair is always symmetric; the nomination 1036 algorithm prevents asymmetric address pairs (i.e. each side choosing 1037 different pair), such as a Data Relay Client using its own Data Relay 1038 Server to send data directly to its peer while receiving data from 1039 the Data Relay Server of its peer. 1041 4.6.2. Rules for Connectivity Checks 1043 The HITs of the two communicating hosts MUST be used as credentials 1044 in this protocol (in contrast to ICE which employs username-password 1045 fragments). A HIT pair uniquely identifies the corresponding HIT 1046 association, and a SEQ number in an UPDATE message identifies a 1047 particular connectivity check. 1049 All of the connectivity check packets MUST be protected with HMACs 1050 and signatures (even though the illustrations in this specification 1051 omit them for simplicity). Each connectivity check sent by a host 1052 MUST include a SEQ parameter and ECHO_REQUEST_SIGN parameter, and 1053 correspondingly the peer MUST respond to these using ACK and 1054 ECHO_RESPONSE_SIGNED according to the rules specified in [RFC7401]. 1056 The host sending a connectivity check MUST validate that the response 1057 uses the same pair of UDP ports, and drop the packet if this is not 1058 the case. 1060 A host may receive a connectivity check before it has received the 1061 candidates from its peer. In such a case, the host MUST immediately 1062 generate a response, and then continue waiting for the candidates. A 1063 host MUST NOT select a candidate pair until it has verified the pair 1064 using a connectivity check as defined in section Section 4.6.1. 1066 [RFC7401] states that UPDATE packets have to include either a SEQ or 1067 ACK parameter (or both). According to the RFC, each SEQ parameter 1068 should be acknowledged separately. In the context of NATs, this 1069 means that some of the SEQ parameters sent in connectivity checks 1070 will be lost or arrive out of order. From the viewpoint of the 1071 recipient, this is not a problem since the recipient will just 1072 "blindly" acknowledge the SEQ. However, the sender needs to be 1073 prepared for lost sequence identifiers and ACKs parameters that 1074 arrive out of order. 1076 As specified in [RFC7401], an ACK parameter may acknowledge multiple 1077 sequence identifiers. While the examples in the previous sections do 1078 not illustrate such functionality, it is also permitted when 1079 employing ICE-HIP-UDP mode. 1081 In ICE-HIP-UDP mode, a retransmission of a connectivity check SHOULD 1082 be sent with the same sequence identifier in the SEQ parameter. Some 1083 tested address candidates will never produce a working address pair, 1084 and thus may cause retransmissions. Upon successful nomination an 1085 address pair, a host MAY immediately stop sending such 1086 retransmissions. 1088 ICE procedures for prioritizing candidates, eliminating redundant 1089 candidates and forming check lists (including pruning) must be 1090 followed (as specified in [I-D.ietf-ice-rfc5245bis]), with the 1091 exception that the foundation, frozen candidates and default 1092 candidates are not used. From viewpoint of the ICE specification 1093 [I-D.ietf-ice-rfc5245bis], the protocol specified in this document 1094 operates using Component ID of 1 on all candidates, and the 1095 foundation of all candidates is unique. This specification defines 1096 only "full ICE" mode, and the "lite ICE" is not supported. The 1097 reasoning behind the missing features is described in Appendix B. 1099 The connectivity check messages MUST be paced by the Ta value 1100 negotiated during the base exchange as described in Section 4.4. If 1101 neither one of the hosts announced a minimum pacing value, a value of 1102 20 ms SHOULD be used. 1104 Both hosts MUST form a priority ordered checklist and begin to check 1105 transactions every Ta milliseconds as long as the checks are running 1106 and there are candidate pairs whose tests have not started. The 1107 retransmission timeout (RTO) for the connectivity check UPDATE 1108 packets SHOULD be calculated as follows: 1110 RTO = MAX (500ms, Ta * (Num-Waiting + Num-In-Progress)) 1112 In the RTO formula, Ta is the value used for the connectivity check 1113 pacing, Num-Waiting is the number of pairs in the checklist in the 1114 "Waiting" state, and Num-In-Progress is the number of pairs in the 1115 "In-Progress" state. This is identical to the formula in 1116 [I-D.ietf-ice-rfc5245bis] when there is only one checklist. A 1117 smaller value than 500 ms for the RTO MUST NOT be used. 1119 Each connectivity check request packet MUST contain a 1120 CANDIDATE_PRIORITY parameter (see Section 5.14) with the priority 1121 value that would be assigned to a peer reflexive candidate if one was 1122 learned from the corresponding check. An UPDATE packet that 1123 acknowledges a connectivity check request MUST be sent from the same 1124 address that received the check and delivered to the same address 1125 where the check was received from. Each acknowledgment UPDATE packet 1126 MUST contain a MAPPED_ADDRESS parameter with the port, protocol, and 1127 IP address of the address where the connectivity check request was 1128 received from. 1130 Following the ICE guidelines [I-D.ietf-ice-rfc5245bis], it is 1131 RECOMMENDED to restrict the total number of connectivity checks to 1132 100 for each host association. This can be achieved by limiting the 1133 connectivity checks to the 100 candidate pairs with the highest 1134 priority. 1136 4.6.3. Rules for Concluding Connectivity Checks 1138 The controlling agent may find multiple working candidate pairs. To 1139 conclude the connectivity checks, it SHOULD nominate the pair with 1140 the highest priority. The controlling agent MUST nominate a 1141 candidate pair essentially by repeating a connectivity check using an 1142 UPDATE message that contains a SEQ parameter (with new sequence 1143 number), a ECHO_REQUEST_SIGN parameter, the priority of the candidate 1144 in a CANDIDATE_PRIORITY parameter and NOMINATE parameter to signify 1145 conclusion of the connectivity checks. Since the nominated address 1146 pair has already been tested for reachability, the controlled host 1147 should be able to receive the message. Upon reception, the 1148 controlled host SHOULD select the nominated address pair. The 1149 response message MUST include a SEQ parameter with a new sequence id, 1150 acknowledgment of the sequence from the controlling host in an ACK 1151 parameter, a new ECHO_REQUEST_SIGNED parameter, ECHO_RESPONSE_SIGNED 1152 parameter corresponding to the ECHO_REQUEST_SIGNED parameter from the 1153 controlling host and the NOMINATE parameter. After sending this 1154 packet, the controlled host can create IPsec security associations 1155 using the nominated address candidate for delivering application 1156 payload to the controlling host. Since the message from the 1157 controlled host included a new sequence id and echo request for 1158 signature, the controlling host MUST acknowledge this with a new 1159 UPDATE message that includes an ACK and ECHO_RESPONSE_SIGNED 1160 parameters. After this final concluding message, the controlling 1161 host also can create IPsec security associations for delivering 1162 application payload to the controlled host. 1164 It is possible that packets are delayed by the network. Both hosts 1165 MUST continue to respond to any connectivity checks despite an 1166 address pair having been nominated. 1168 If all the connectivity checks have failed, the hosts MUST NOT send 1169 ESP traffic to each other but MAY continue communicating using HIP 1170 packets and the locators used for the base exchange. Also, the hosts 1171 SHOULD notify each other about the failure with a 1172 CONNECTIVITY_CHECKS_FAILED NOTIFY packet (see Section 5.10). 1174 4.7. NAT Traversal Optimizations 1176 4.7.1. Minimal NAT Traversal Support 1178 If the Responder has a fixed and publicly reachable IPv4 address and 1179 does not employ a Control Relay Server, the explicit NAT traversal 1180 mode negotiation MAY be omitted, and thus even the UDP-ENCAPSULATION 1181 mode does not have to be negotiated. In such a scenario, the 1182 Initiator sends an I1 message over UDP and the Responder responds 1183 with an R1 message over UDP without including any NAT traversal mode 1184 parameter. The rest of the base exchange follows the procedures 1185 defined in [RFC7401], except that the control and data plane use UDP 1186 encapsulation. Here, the use of UDP for NAT traversal is agreed 1187 implicitly. This way of operation is still subject to NAT timeouts, 1188 and the hosts MUST employ NAT keepalives as defined in Section 4.10. 1190 4.7.2. Base Exchange without Connectivity Checks 1192 It is possible to run a base exchange without any connectivity checks 1193 as defined in Legacy ICE-HIP section 4.8 [RFC5770]. The procedure is 1194 applicable also in the context of this specification, so it is 1195 repeated here for completeness. 1197 In certain network environments, the connectivity checks can be 1198 omitted to reduce initial connection set-up latency because a base 1199 exchange acts as an implicit connectivity test itself. For this to 1200 work, the Initiator MUST be able to reach the Responder by simply UDP 1201 encapsulating HIP and ESP packets sent to the Responder's address. 1203 Detecting and configuring this particular scenario is prone to 1204 failure unless carefully planned. 1206 In such a scenario, the Responder MAY include UDP-ENCAPSULATION NAT 1207 traversal mode as one of the supported modes in the R1 packet. If 1208 the Responder has registered to a Control Relay Server, it MUST also 1209 include a LOCATOR_SET parameter in R1 that contains a preferred 1210 address where the Responder is able to receive UDP-encapsulated ESP 1211 and HIP packets. This locator MUST be of type "Transport address", 1212 its Traffic type MUST be "both", and it MUST have the "Preferred bit" 1213 set (see Table 1). If there is no such locator in R1, the source 1214 address of R1 is used as the Responder's preferred address. 1216 The Initiator MAY choose the UDP-ENCAPSULATION mode if the Responder 1217 listed it in the supported modes and the Initiator does not wish to 1218 use the connectivity checks defined in this document for searching 1219 for a more optimal path. In this case, the Initiator sends the I2 1220 with UDP-ENCAPSULATION mode in the NAT traversal mode parameter 1221 directly to the Responder's preferred address (i.e., to the preferred 1222 locator in R1 or to the address where R1 was received from if there 1223 was no preferred locator in R1). The Initiator MAY include locators 1224 in I2 but they MUST NOT be taken as address candidates, since 1225 connectivity checks defined in this document will not be used for 1226 connections with UDP-ENCAPSULATION NAT traversal mode. Instead, if 1227 R2 and I2 are received and processed successfully, a security 1228 association can be created and UDP-encapsulated ESP can be exchanged 1229 between the hosts after the base exchange completes. However, the 1230 Responder SHOULD NOT send any ESP to the Initiator's address before 1231 it has received data from the Initiator, as specified in Sections 1232 4.4.3. and 6.9 of [RFC7401] and in Sections 3.2.9 and 5.4 of 1233 [RFC8046]. 1235 Since an I2 packet with UDP-ENCAPSULATION NAT traversal mode selected 1236 MUST NOT be sent via a Control Relay Server, the Responder SHOULD 1237 reject such I2 packets and reply with a 1238 NO_VALID_NAT_TRAVERSAL_MODE_PARAMETER NOTIFY packet (see 1239 Section 5.10). 1241 If there is no answer for the I2 packet sent directly to the 1242 Responder's preferred address, the Initiator MAY send another I2 via 1243 the Control Relay Server, but it MUST NOT choose UDP-ENCAPSULATION 1244 NAT traversal mode for that I2. 1246 4.7.3. Initiating a Base Exchange both with and without UDP 1247 Encapsulation 1249 It is possible to run a base exchange in parallel both with and 1250 without UDP encapsulation as defined in Legacy ICE-HIP section 4.9 in 1251 [RFC5770]. The procedure is applicable also in the context of this 1252 specification, so it is repeated here for completeness. 1254 The Initiator MAY also try to simultaneously perform a base exchange 1255 with the Responder without UDP encapsulation. In such a case, the 1256 Initiator sends two I1 packets, one without and one with UDP 1257 encapsulation, to the Responder. The Initiator MAY wait for a while 1258 before sending the other I1. How long to wait and in which order to 1259 send the I1 packets can be decided based on local policy. For 1260 retransmissions, the procedure is repeated. 1262 The I1 packet without UDP encapsulation may arrive directly, without 1263 passing any Control Data Relays, at the Responder. When this 1264 happens, the procedures in [RFC7401] are followed for the rest of the 1265 base exchange. The Initiator may receive multiple R1 packets, with 1266 and without UDP encapsulation, from the Responder. However, after 1267 receiving a valid R1 and answering it with an I2, further R1 packets 1268 that are not retransmissions of the original R1 message MUST be 1269 ignored. 1271 The I1 packet without UDP encapsulation may also arrive at a HIP- 1272 capable middlebox. When the middlebox is a HIP rendezvous server and 1273 the Responder has successfully registered with the rendezvous 1274 service, the middlebox follows rendezvous procedures in [RFC8004]. 1276 If the Initiator receives a NAT traversal mode parameter in R1 1277 without UDP encapsulation, the Initiator MAY ignore this parameter 1278 and send an I2 without UDP encapsulation and without any selected NAT 1279 traversal mode. When the Responder receives the I2 without UDP 1280 encapsulation and without NAT traversal mode, it will assume that no 1281 NAT traversal mechanism is needed. The packet processing will be 1282 done as described in [RFC7401]. The Initiator MAY store the NAT 1283 traversal modes for future use, e.g., in case of a mobility or 1284 multihoming event that causes NAT traversal to be used during the 1285 lifetime of the HIP association. 1287 4.8. Sending Control Packets after the Base Exchange 1289 The same considerations of sending control packets after the base 1290 exchange described in legacy ICE-HIP section 5.10 in [RFC5770] apply 1291 also here, so they are repeated here for completeness. 1293 After the base exchange, the two end-hosts MAY send HIP control 1294 packets directly to each other using the transport address pair 1295 established for a data channel without sending the control packets 1296 through any Control Relay Servers . When a host does not receive 1297 acknowledgments, e.g., to an UPDATE or CLOSE packet after a timeout 1298 based on local policies, a host SHOULD resend the packet through the 1299 associated Data Relay Server of the peer (if the peer listed it in 1300 its LOCATOR_SET parameter in the base exchange. 1302 If Control Relay Client sends a packet through a Control Relay 1303 Server, the Control Relay Client MUST always utilize the RELAY_TO 1304 parameter. The Control Relay Server SHOULD forward HIP control 1305 packets originating from a Control Relay Client to the address 1306 denoted in the RELAY_TO parameter. In the other direction, the 1307 Control Relay Server SHOULD forward HIP control packets to the 1308 Control Relay Clients, and MUST add a RELAY_FROM parameter to the 1309 control packets it relays to the Control Relay Clients. 1311 If the Control Relay Server is not willing or able to relay a HIP 1312 packet, it MAY notify the sender of the packet with 1313 MESSAGE_NOT_RELAYED error notification (see Section 5.10). 1315 4.9. Mobility Handover Procedure 1317 A host may move after base exchange and connectivity checks. 1318 Mobility extensions for HIP [RFC8046] define handover procedures 1319 without NATs. In this section, we define how two hosts interact with 1320 handover procedures in scenarios involving NATs. The specified 1321 extensions define only simple mobility using a pair of security 1322 associations, and multihoming extensions are left to be defined in 1323 later specifications. The procedures in this section offer the same 1324 functionality as "ICE restart" specified in 1325 [I-D.ietf-ice-rfc5245bis]. The example described in this section 1326 shows only a Control Relay Server for the peer host for the sake of 1327 simplicity, but also the mobile host may also have a Control Relay 1328 Server. 1330 The assumption here is that the two hosts have successfully 1331 negotiated and chosen the ICE-HIP-UDP mode during the base exchange 1332 as defined in Section 4.3. The Initiator of the base exchange MUST 1333 store information that it was the controlling host during the base 1334 exchange. Similarly, the Responder MUST store information that it 1335 was the controlled host during the base exchange. 1337 Prior to starting the handover procedures with all peer hosts, the 1338 mobile host SHOULD first send UPDATE messages to its Control and Data 1339 Relay Servers if it has registered to such. It SHOULD wait for all 1340 of them to respond for two minutes and then continue with the 1341 handover procedure without information from the Relay Server that did 1342 not respond. As defined in section Section 4.1, a response message 1343 from a Control Relay Server includes a REG_FROM parameter that 1344 describes the server reflexive candidate of the mobile host to be 1345 used in the candidate exchange during the handover. Similarly, an 1346 UPDATE to a Data Relay Server is necessary to make sure the Data 1347 Relay Server can forward data to the correct IP address after a 1348 handoff. 1350 The mobility extensions for NAT traversal are illustrated in 1351 Figure 6. The mobile host is the host that has changed its locators, 1352 and the peer host is the host it has a host association with. The 1353 mobile host may have multiple peers and it repeats the process with 1354 all of its peers. In the figure, the Control Relay Server belongs to 1355 the peer host, i.e., the peer host is a Control Relay Client for the 1356 Control Relay Server. Next, we describe the procedure in the figure 1357 in detail. 1359 Mobile Host Control Relay Server Peer Host 1360 | 1. UDP(UPDATE(ESP_INFO, | | 1361 | LOC_SET, SEQ)) | | 1362 +--------------------------------->| 2. UDP(UPDATE(ESP_INFO, | 1363 | | LOC_SET, SEQ, | 1364 | | RELAY_FROM)) | 1365 | +------------------------------->| 1366 | | | 1367 | | 3. UDP(UPDATE(ESP_INFO, ACK, | 1368 | | ECHO_REQ_SIGN)) | 1369 | 4. UDP(UPDATE(ESP_INFO, ACK, |<-------------------------------+ 1370 | ECHO_REQ_SIGN, | | 1371 | RELAY_TO)) | | 1372 |<---------------------------------+ | 1373 | | | 1374 | 5. connectivity checks over UDP | 1375 +<----------------------------------------------------------------->+ 1376 | | | 1377 | 6. ESP data over UDP | 1378 +<----------------------------------------------------------------->+ 1379 | | | 1381 Figure 6: HIP UPDATE procedure 1383 In step 1, the mobile host has changed location and sends a location 1384 update to its peer through the Control Relay Server of the peer. It 1385 sends an UPDATE packet with source HIT belonging to itself and 1386 destination HIT belonging to the peer host. In the packet, the 1387 source IP address belongs to the mobile host and the destination to 1388 the Control Relay Server. The packet contains an ESP_INFO parameter, 1389 where, in this case, the OLD SPI and NEW SPI parameters both contain 1390 the pre-existing incoming SPI. The packet also contains the locators 1391 of the mobile host in a LOCATOR_SET parameter. The packet contains 1392 also a SEQ number to be acknowledged by the peer. As specified in 1393 [RFC8046], the packet may also include a HOST_ID (for middlebox 1394 inspection) and DIFFIE_HELLMAN parameter for rekeying. 1396 In step 2, the Control Relay Server receives the UPDATE packet and 1397 forwards it to the peer host (i.e. Control Relay Client). The 1398 Control Relay Server rewrites the destination IP address and appends 1399 a RELAY_FROM parameter to the message. 1401 In step 3, the peer host receives the UPDATE packet, processes it and 1402 responds with another UPDATE message. The message is destined to the 1403 HIT of mobile host and to the IP address of the Control Relay Server. 1404 The message includes an ESP_INFO parameter where, in this case, the 1405 OLD SPI and NEW SPI parameters both contain the pre-existing incoming 1406 SPI. The peer includes a new SEQ and ECHO_REQUEST_SIGNED parameters 1407 to be acknowledged by the mobile host. The message acknowledges the 1408 SEQ parameter of the earlier message with an ACK parameter. After 1409 this step, the peer host can initiate the connectivity checks. 1411 In step 4, the Control Relay Server receives the message, rewrites 1412 the destination IP address, appends an RELAY_TO parameter and 1413 forwards the modified message to the mobile host. When mobile host 1414 has processed the message successfully, it can initiate the 1415 connectivity checks. 1417 In step 5, the two hosts test for connectivity across NATs according 1418 to procedures described in Section 4.6. The original Initiator of 1419 the communications is the controlling and the original Responder is 1420 the controlled host. 1422 In step 6, the connectivity checks are successfully completed and the 1423 controlling host has nominated one address pair to be used. The 1424 hosts set up security associations to deliver the application 1425 payload. 1427 If either host has registered a relayed address candidate from a Data 1428 Relay Server, the host MUST reactivate the address before 1429 connectivity checks by sending an UPDATE message containing 1430 PEER_PERMISSION parameter as described in Section 4.12.1. Otherwise, 1431 the Data Relay Server drops ESP packets using the relayed address. 1433 4.10. NAT Keepalives 1435 To prevent NAT states from expiring, communicating hosts send 1436 periodic keepalives to other hosts with which they have established a 1437 host associating. Both a registered client and Control/Data Relay 1438 Server SHOULD send HIP NOTIFY packets to each other every 15 seconds 1439 (the so called Tr value in ICE) unless they have exchange some other 1440 traffic over the used UDP ports. Other values MAY be used, but a Tr 1441 value smaller than 15 seconds MUST NOT be used. The keepalive 1442 message encoding format is defined in Section 5.3. If the base 1443 exchange or mobility handover procedure occurs during an extremely 1444 slow path, a host MAY also send HIP NOTIFY packet every 15 seconds to 1445 keep the path active with the recipient. 1447 4.11. Closing Procedure 1449 The two-way procedure for closing a HIP association and the related 1450 security associations is defined in [RFC7401]. One host initiates 1451 the procedure by sending a CLOSE message and the recipient confirms 1452 it with CLOSE_ACK. All packets are protected using HMACs and 1453 signatures, and the CLOSE messages includes a ECHO_REQUEST_SIGNED 1454 parameter to protect against replay attacks. 1456 The same procedure for closing HIP associations applies also here, 1457 but the messaging occurs using the UDP encapsulated tunnel that the 1458 two hosts employ. A host sending the CLOSE message SHOULD first send 1459 the message over a direct link. After a number of retransmissions, 1460 it MUST send over a Control Relay Server of the recipient if one 1461 exists. The host receiving the CLOSE message directly without a 1462 Control Data Relay SHOULD respond directly. If CLOSE message came 1463 via a Control Data Relay, the host SHOULD respond using the same 1464 Control Data Relay. 1466 4.12. Relaying Considerations 1468 4.12.1. Forwarding Rules and Permissions 1470 The Data Relay Server uses a similar permission model as a TURN 1471 server: before the Data Relay Server forwards any ESP data packets 1472 from a peer to a Data Relay Client (or the other direction), the 1473 client MUST set a permission for the peer's address. The permissions 1474 also install a forwarding rule for each direction, similar to TURN's 1475 channels, based on the Security Parameter Index (SPI) values in the 1476 ESP packets. 1478 Permissions are not required for HIP control packets. However, if a 1479 relayed address (as conveyed in the RELAYED_ADDRESS parameter from 1480 the Data Relay Server) is selected to be used for data, the Control 1481 Relay Client MUST send an UPDATE message to the Data Relay Server 1482 containing a PEER_PERMISSION parameter (see Section 5.13) with the 1483 address of the peer, and the outbound and inbound SPI values the 1484 Control Relay Client is using with this particular peer. To avoid 1485 packet dropping of ESP packets, the Control Relay Client SHOULD send 1486 the PEER_PERMISSION parameter before connectivity checks both in the 1487 case of base exchange and a mobility handover. It is worth noting 1488 that the UPDATE message includes a SEQ parameter (as specified in 1489 [RFC7401]) that the Data Relay Server must acknowledge, so that the 1490 Control Relay Client can resend the message with PEER_PERMISSION 1491 parameter if it gets lost. 1493 When a Data Relay Server receives an UPDATE with a PEER_PERMISSION 1494 parameter, it MUST check if the sender of the UPDATE is registered 1495 for data relaying service, and drop the UPDATE if the host was not 1496 registered. If the host was registered, the Data Relay Server checks 1497 if there is a permission with matching information (address, 1498 protocol, port and SPI values). If there is no such permission, a 1499 new permission MUST be created and its lifetime MUST be set to 5 1500 minutes. If an identical permission already existed, it MUST be 1501 refreshed by setting the lifetime to 5 minutes. A Data Relay Client 1502 SHOULD refresh permissions 1 minute before the expiration when the 1503 permission is still needed. 1505 When a Data Relay Server receives an UPDATE from a registered client 1506 but without a PEER_PERMISSION parameter and with a new locator set, 1507 the Data Relay Server can assume that the mobile host has changed its 1508 location and, thus, is not reachable in its previous location. In 1509 such an event, the Data Relay Server SHOULD deactivate the permission 1510 and stop relaying data plane traffic to the client. 1512 The relayed address MUST be activated with the PEER_PERMISSION 1513 parameter both after a base exchange and after a handover procedure 1514 with another ICE-HIP-UDP capable host. Unless activated, the Data 1515 Relay Server MUST drop all ESP packets. It is worth noting that a 1516 Data Relay Client does not have to renew its registration upon a 1517 change of location UPDATE, but only when the lifetime of the 1518 registration is close to end. 1520 4.12.2. HIP Data Relay and Relaying of Control Packets 1522 When a Data Relay Server accepts to relay UDP encapsulated ESP 1523 between a Data Relay Client and its peer, the Data Relay Server opens 1524 a UDP port (relayed address) for this purpose as described in 1525 Section 4.1. This port can be used for delivering also control 1526 packets because connectivity checks also cover the path through the 1527 Data Relay Server. If the Data Relay Server receives a UDP 1528 encapsulated HIP control packet on that port, it MUST forward the 1529 packet to the Data Relay Client and add a RELAY_FROM parameter to the 1530 packet as if the Data Relay Server were acting as a Control Relay 1531 Server. When the Data Relay Client replies to a control packet with 1532 a RELAY_FROM parameter via its Data Relay Server, the Data Relay 1533 Client MUST add a RELAY_TO parameter containing the peer's address 1534 and use the address of its Data Relay Server as the destination 1535 address. Further, the Data Relay Server MUST send this packet to the 1536 peer's address from the relayed address. 1538 If the Data Relay Server receives a UDP packet that is not a HIP 1539 control packet to the relayed address, it MUST check if it has a 1540 permission set for the peer the packet is arriving from (i.e., the 1541 sender's address and SPI value matches to an installed permission). 1542 If permissions are set, the Data Relay Server MUST forward the packet 1543 to the Data Relay Client that created the permission. The Data Relay 1544 Server MUST also implement the similar checks for the reverse 1545 direction (i.e. ESP packets from the Data Relay Client to the peer). 1546 Packets without a permission MUST be dropped silently. 1548 4.12.3. Handling Conflicting SPI Values 1550 Since a Data Relay Server may have to deal with multiple Relay 1551 Clients and their peers, such a Relay may experience collisions in 1552 the SPI namespace. Two problematic cases are described in this 1553 section. 1555 In the first scenario, an SPI collision may occur when two Initiators 1556 run a base exchange to the same Responder (i.e. Data Relay Client), 1557 and both the Initiators claim the same inbound SPI at the Data Relay 1558 Server using PEER_PERMISSION Parameter. In this case, the Data Relay 1559 Server cannot disambiguate the correct destination of an ESP packet 1560 originating from the Data Relay Client because the SPI could belong 1561 to either of the peers (and destination IP and UDP port belonging to 1562 the Data Relay Server are not unique either). The problem can be 1563 mitigated at the Data Relay Clients (i.e. Responder). Upon 1564 receiving an I2 with a colliding SPI, the Responder MUST NOT include 1565 the relayed address candidate in the R2 message because the Data 1566 Relay Server would not be able demultiplex the related ESP packet to 1567 the correct Initiator. The same applies also the handover 1568 procedures; the Data Relay Client MUST NOT include the relayed 1569 address candidate when sending its new locator set in an UPDATE to 1570 its peer if it would cause a SPI conflict with another peer. Since 1571 the SPI space is 32 bits and the SPI values should be random, the 1572 probability for a conflicting SPI value is fairly small. However, a 1573 Data Relay Client with many peers MAY proactively decrease the odds 1574 of a conflict by registering to multiple Data Relay Servers. Thus, 1575 the described collision scenario can be avoided if the Responder 1576 delivers a new relayed address candidate upon SPI collisions. Each 1577 relayed address has a separate UDP port reserved to it, so collision 1578 problem does not occur. 1580 In the second scenario, the SPI collision problems occurs if two 1581 hosts have registered to the same Data Relay Server and a third host 1582 initiates base exchange with both of them. Here, the two Responders 1583 (i.e. Data Relay Clients) claim the same inbound SPI number with the 1584 same Initiator (peer). However, in this case, the Data Relay Server 1585 has allocated separate UDP ports for the two Data Relay Clients 1586 acting now as Responders (as recommended in Section 6.5). When the 1587 peer sends an ESP packet, the Data Relay Server is able to forward 1588 the packet to the correct Data Relay Client because the destination 1589 UDP port for each of the clients. 1591 5. Packet Formats 1593 The following subsections define the parameter and packet encodings 1594 for the HIP and ESP packets. All values MUST be in network byte 1595 order. 1597 It is worth noting that most of the parameters are shown for the sake 1598 of completeness even though they are specified already in Legacy ICE- 1599 HIP [RFC5770]. New parameters are explicitly described as new. 1601 5.1. HIP Control Packets 1603 Figure 7 illustrates the packet format for UDP-encapsulated HIP. The 1604 format is identical to Legacy ICE-HIP [RFC5770]. 1606 0 1 2 3 1607 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 1608 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1609 | Source Port | Destination Port | 1610 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1611 | Length | Checksum | 1612 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1613 | 32 bits of zeroes | 1614 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1615 | | 1616 ~ HIP Header and Parameters ~ 1617 | | 1618 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1620 Figure 7: Format of UDP-Encapsulated HIP Control Packets 1622 HIP control packets are encapsulated in UDP packets as defined in 1623 Section 2.2 of [RFC3948], "IKE Header Format for Port 4500", except 1624 that a different port number is used. Figure 7 illustrates the 1625 encapsulation. The UDP header is followed by 32 zero bits that can 1626 be used to differentiate HIP control packets from ESP packets. The 1627 HIP header and parameters follow the conventions of [RFC7401] with 1628 the exception that the HIP header checksum MUST be zero. The HIP 1629 header checksum is zero for two reasons. First, the UDP header 1630 already contains a checksum. Second, the checksum definition in 1631 [RFC7401] includes the IP addresses in the checksum calculation. The 1632 NATs that are unaware of HIP cannot recompute the HIP checksum after 1633 changing IP addresses. 1635 A Control/Data Relay Server or a non-relay Responder SHOULD listen at 1636 UDP port 10500 for incoming UDP-encapsulated HIP control packets. If 1637 some other port number is used, it needs to be known by potential 1638 Initiators. 1640 5.2. Connectivity Checks 1642 HIP connectivity checks are HIP UPDATE packets. The format is 1643 specified in [RFC7401]. 1645 5.3. Keepalives 1647 The RECOMMENDED encoding format for keepalives is HIP NOTIFY packets 1648 as specified in [RFC7401] with Notify message type field set to 1649 NAT_KEEPALIVE [TBD by IANA: 16385] and with an empty Notification 1650 data field. It is worth noting that sending of such a HIP NOTIFY 1651 message MAY be omitted if the host is actively (or passively) sending 1652 other traffic to the peer host over the UDP tunnel associate with the 1653 host association (and IPsec security associations since the same port 1654 pair is reused) during the Tr period. For instance, the host MAY 1655 actively send ICMPv6 requests (or respond with an ICMPv6 response) 1656 inside the ESP tunnel to test the health of the associated IPsec 1657 security associations. Alternatively, the host MAY use UPDATE 1658 packets as a substitute. A minimal UPDATE packet would consist of a 1659 SEQ and ECHO_REQ_SIGN parameters, and a more complex would involve 1660 rekeying procedures as specified in section 6.8 in [RFC7402]. It is 1661 worth noting that a host actively sending periodic UPDATE packets to 1662 a busy server may increase the computational load of the server since 1663 it has to verify HMACs and signatures in UPDATE messages. 1665 5.4. NAT Traversal Mode Parameter 1667 The format of NAT traversal mode parameter is borrowed from Legacy 1668 ICE-HIP [RFC5770]. The format of the NAT_TRAVERSAL_MODE parameter is 1669 similar to the format of the ESP_TRANSFORM parameter in [RFC7402] and 1670 is shown in Figure 8. The Native ICE-HIP extension specified in this 1671 document defines the new NAT traversal mode identifier for ICE-HIP- 1672 UDP and reuses the UDP-ENCAPSULATION mode from Legacy ICE-HIP 1674 [RFC5770]. The identifier named RESERVED is reserved for future use. 1675 Future specifications may define more traversal modes. 1677 0 1 2 3 1678 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 1679 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1680 | Type | Length | 1681 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1682 | Reserved | Mode ID #1 | 1683 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1684 | Mode ID #2 | Mode ID #3 | 1685 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1686 | Mode ID #n | Padding | 1687 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1689 Type 608 1690 Length length in octets, excluding Type, Length, and padding 1691 Reserved zero when sent, ignored when received 1692 Mode ID defines the proposed or selected NAT traversal mode(s) 1694 The following NAT traversal mode IDs are defined: 1696 ID name Value 1697 RESERVED 0 1698 UDP-ENCAPSULATION 1 1699 ICE-HIP-UDP 3 1701 Figure 8: Format of the NAT_TRAVERSAL_MODE Parameter 1703 The sender of a NAT_TRAVERSAL_MODE parameter MUST make sure that 1704 there are no more than six (6) Mode IDs in one NAT_TRAVERSAL_MODE 1705 parameter. Conversely, a recipient MUST be prepared to handle 1706 received NAT traversal mode parameters that contain more than six 1707 Mode IDs by accepting the first six Mode IDs and dropping the rest. 1708 The limited number of Mode IDs sets the maximum size of the 1709 NAT_TRAVERSAL_MODE parameter. The modes MUST be in preference order, 1710 most preferred mode(s) first. 1712 Implementations conforming to this specification MUST implement UDP- 1713 ENCAPSULATION and SHOULD implement ICE-HIP-UDP modes. 1715 5.5. Connectivity Check Transaction Pacing Parameter 1717 The TRANSACTION_PACING is a new parameter, and it shown in Figure 9 1718 contains only the connectivity check pacing value, expressed in 1719 milliseconds, as a 32-bit unsigned integer. 1721 0 1 2 3 1722 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 1723 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1724 | Type | Length | 1725 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1726 | Min Ta | 1727 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1729 Type 610 1730 Length 4 1731 Min Ta the minimum connectivity check transaction pacing 1732 value the host would use (in milliseconds) 1734 Figure 9: Format of the TRANSACTION_PACING Parameter 1736 5.6. Relay and Registration Parameters 1738 The format of the REG_FROM, RELAY_FROM, and RELAY_TO parameters is 1739 shown in Figure 10. All parameters are identical except for the 1740 type. REG_FROM is the only parameter covered with the signature. 1742 0 1 2 3 1743 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 1744 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1745 | Type | Length | 1746 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1747 | Port | Protocol | Reserved | 1748 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1749 | | 1750 | Address | 1751 | | 1752 | | 1753 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1755 Type REG_FROM: 950 1756 RELAY_FROM: 63998 1757 RELAY_TO: 64002 1758 Length 20 1759 Port transport port number; zero when plain IP is used 1760 Protocol IANA assigned, Internet Protocol number. 1761 17 for UDP, 0 for plain IP 1762 Reserved reserved for future use; zero when sent, ignored 1763 when received 1764 Address an IPv6 address or an IPv4 address in "IPv4-Mapped 1765 IPv6 address" format 1767 Figure 10: Format of the REG_FROM, RELAY_FROM, and RELAY_TO 1768 Parameters 1770 REG_FROM contains the transport address and protocol from which the 1771 Control Relay Server sees the registration coming. RELAY_FROM 1772 contains the address from which the relayed packet was received by 1773 the Control Relay Server and the protocol that was used. RELAY_TO 1774 contains the same information about the address to which a packet 1775 should be forwarded. 1777 5.7. LOCATOR_SET Parameter 1779 This specification reuses the format for UDP-based locators as 1780 specified in Legacy ICE-HIP [RFC5770] to be used for communicating 1781 the address candidates between two hosts. The generic and NAT- 1782 traversal-specific locator parameters are illustrated in Figure 11. 1784 0 1 2 3 1785 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 1786 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1787 | Type | Length | 1788 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1789 | Traffic Type | Locator Type | Locator Length| Reserved |P| 1790 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1791 | Locator Lifetime | 1792 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1793 | Locator | 1794 | | 1795 | | 1796 | | 1797 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1798 . . 1799 . . 1800 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1801 | Traffic Type | Loc Type = 2 | Locator Length| Reserved |P| 1802 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1803 | Locator Lifetime | 1804 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1805 | Transport Port | Transp. Proto| Kind | 1806 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1807 | Priority | 1808 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1809 | SPI | 1810 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1811 | Address | 1812 | | 1813 | | 1814 | | 1815 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1817 Figure 11: LOCATOR_SET Parameter 1819 The individual fields in the LOCATOR_SET parameter are described in 1820 Table 1. 1822 +-----------+----------+--------------------------------------------+ 1823 | Field | Value(s) | Purpose | 1824 +-----------+----------+--------------------------------------------+ 1825 | Type | 193 | Parameter type | 1826 | Length | Variable | Length in octets, excluding Type and | 1827 | | | Length fields and padding | 1828 | Traffic | 0-2 | Is the locator for HIP signaling (1), for | 1829 | Type | | ESP (2), or for both (0) | 1830 | Locator | 2 | "Transport address" locator type | 1831 | Type | | | 1832 | Locator | 7 | Length of the fields after Locator | 1833 | Length | | Lifetime in 4-octet units | 1834 | Reserved | 0 | Reserved for future extensions | 1835 | Preferred | 0 or 1 | Set to 1 for a Locator in R1 if the | 1836 | (P) bit | | Responder can use it for the rest of the | 1837 | | | base exchange, otherwise set to zero | 1838 | Locator | Variable | Locator lifetime in seconds | 1839 | Lifetime | | | 1840 | Transport | Variable | Transport layer port number | 1841 | Port | | | 1842 | Transport | Variable | IANA assigned, transport layer Internet | 1843 | Protocol | | Protocol number. Currently only UDP (17) | 1844 | | | is supported. | 1845 | Kind | Variable | 0 for host, 1 for server reflexive, 2 for | 1846 | | | peer reflexive or 3 for relayed address | 1847 | Priority | Variable | Locator's priority as described in | 1848 | | | [I-D.ietf-ice-rfc5245bis]. It is worth | 1849 | | | noting that while the priority of a single | 1850 | | | locator candidate is 32-bits, but an | 1851 | | | implementation should use a 64-bit integer | 1852 | | | to calculate the priority of a candidate | 1853 | | | pair for the ICE priority algorithm. | 1854 | SPI | Variable | Security Parameter Index (SPI) value that | 1855 | | | the host expects to see in incoming ESP | 1856 | | | packets that use this locator | 1857 | Address | Variable | IPv6 address or an "IPv4-Mapped IPv6 | 1858 | | | address" format IPv4 address [RFC4291] | 1859 +-----------+----------+--------------------------------------------+ 1861 Table 1: Fields of the LOCATOR_SET Parameter 1863 5.8. RELAY_HMAC Parameter 1865 As specified in Legacy ICE-HIP [RFC5770], the RELAY_HMAC parameter 1866 value has the TLV type 65520. It has the same semantics as RVS_HMAC 1867 [RFC8004]. 1869 5.9. Registration Types 1871 The REG_INFO, REG_REQ, REG_RESP, and REG_FAILED parameters contain 1872 Registration Type [RFC8003] values for Control Relay Server 1873 registration. The value for RELAY_UDP_HIP is 2 as specified in 1874 Legacy ICE-HIP [RFC5770]. 1876 5.10. Notify Packet Types 1878 A Control Relay Server and end-hosts can use NOTIFY packets to signal 1879 different error conditions. The NOTIFY packet types are the same as 1880 in Legacy ICE-HIP [RFC5770]. 1882 The Notify Packet Types [RFC7401] are shown below. The Notification 1883 Data field for the error notifications SHOULD contain the HIP header 1884 of the rejected packet and SHOULD be empty for the 1885 CONNECTIVITY_CHECKS_FAILED type. 1887 NOTIFICATION PARAMETER - ERROR TYPES Value 1888 ------------------------------------ ----- 1890 NO_VALID_NAT_TRAVERSAL_MODE_PARAMETER 60 1892 If a Control Relay Server does not forward a base exchange packet 1893 due to missing NAT traversal mode parameter, or the Initiator 1894 selects a NAT traversal mode that the (non-relay) Responder did 1895 not expect, the Control Relay Server or the Responder may send 1896 back a NOTIFY error packet with this type. 1898 CONNECTIVITY_CHECKS_FAILED 61 1900 Used by the end-hosts to signal that NAT traversal connectivity 1901 checks failed and did not produce a working path. 1903 MESSAGE_NOT_RELAYED 62 1905 Used by a Control Relay Server to signal that is was not able or 1906 willing to relay a HIP packet. 1908 5.11. ESP Data Packets 1910 The format for ESP data packets is identical to Legacy ICE-HIP 1911 [RFC5770]. 1913 [RFC3948] describes the UDP encapsulation of the IPsec ESP transport 1914 and tunnel mode. On the wire, the HIP ESP packets do not differ from 1915 the transport mode ESP, and thus the encapsulation of the HIP ESP 1916 packets is same as the UDP encapsulation transport mode ESP. 1917 However, the (semantic) difference to Bound End-to-End Tunnel (BEET) 1918 mode ESP packets used by HIP is that IP header is not used in BEET 1919 integrity protection calculation. 1921 During the HIP base exchange, the two peers exchange parameters that 1922 enable them to define a pair of IPsec ESP security associations (SAs) 1923 as described in [RFC7402]. When two peers perform a UDP-encapsulated 1924 base exchange, they MUST define a pair of IPsec SAs that produces 1925 UDP-encapsulated ESP data traffic. 1927 The management of encryption/authentication protocols and SPIs is 1928 defined in [RFC7402]. The UDP encapsulation format and processing of 1929 HIP ESP traffic is described in Section 6.1 of [RFC7402]. 1931 5.12. RELAYED_ADDRESS and MAPPED_ADDRESS Parameters 1933 While the type values are new, the format of the RELAYED_ADDRESS and 1934 MAPPED_ADDRESS parameters (Figure 12) is identical to REG_FROM, 1935 RELAY_FROM and RELAY_TO parameters. This document specifies only the 1936 use of UDP relaying, and, thus, only protocol 17 is allowed. 1937 However, future documents may specify support for other protocols. 1939 0 1 2 3 1940 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 1941 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1942 | Type | Length | 1943 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1944 | Port | Protocol | Reserved | 1945 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1946 | | 1947 | Address | 1948 | | 1949 | | 1950 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1952 Type [TBD by IANA; 1953 RELAYED_ADDRESS: 4650 1954 MAPPED_ADDRESS: 4660] 1955 Length 20 1956 Port the UDP port number 1957 Protocol IANA assigned, Internet Protocol number (17 for UDP) 1958 Reserved reserved for future use; zero when sent, ignored 1959 when received 1960 Address an IPv6 address or an IPv4 address in "IPv4-Mapped 1961 IPv6 address" format 1963 Figure 12: Format of the RELAYED_ADDRESS and MAPPED_ADDRESS 1964 Parameters 1966 5.13. PEER_PERMISSION Parameter 1968 The format of the new PEER_PERMISSION parameter is shown in 1969 Figure 13. The parameter is used for setting up and refreshing 1970 forwarding rules and the permissions for data packets at the Data 1971 Relay Server. The parameter contains one or more sets of Port, 1972 Protocol, Address, Outbound SPI (OSPI), and Inbound SPI (ISPI) 1973 values. One set defines a rule for one peer address. 1975 0 1 2 3 1976 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 1977 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1978 | Type | Length | 1979 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1980 | Port | Protocol | Reserved | 1981 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1982 | | 1983 | Address | 1984 | | 1985 | | 1986 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1987 | OSPI | 1988 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1989 | ISPI | 1990 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1991 | | 1992 | ... | 1993 | | 1994 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1996 Type [TBD by IANA; 4680] 1997 Length length in octets, excluding Type and Length 1998 Port the transport layer (UDP) port number of the peer 1999 Protocol IANA assigned, Internet Protocol number (17 for UDP) 2000 Reserved reserved for future use; zero when sent, ignored 2001 when received 2002 Address an IPv6 address, or an IPv4 address in "IPv4-Mapped 2003 IPv6 address" format, of the peer 2004 OSPI the outbound SPI value the Data Relay Client is using for 2005 the peer with the Address and Port 2006 ISPI the inbound SPI value the Data Relay Client is using for 2007 the peer with the Address and Port 2009 Figure 13: Format of the PEER_PERMISSION Parameter 2011 5.14. HIP Connectivity Check Packets 2013 The connectivity request messages are HIP UPDATE packets containing a 2014 new CANDIDATE_PRIORITY parameter (Figure 14). Response UPDATE 2015 packets contain a MAPPED_ADDRESS parameter (Figure 12). 2017 0 1 2 3 2018 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 2019 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2020 | Type | Length | 2021 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2022 | Priority | 2023 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2025 Type [TBD by IANA; 4700] 2026 Length 4 2027 Priority the priority of a (potential) peer reflexive candidate 2029 Figure 14: Format of the CANDIDATE_PRIORITY Parameter 2031 5.15. NOMINATE parameter 2033 Figure 15 shows the NOMINATE parameter that is used to conclude the 2034 candidate nomination process. 2036 0 1 2 3 2037 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 2038 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2039 | Type | Length | 2040 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2041 | Reserved | 2042 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2044 Type [TBD by IANA; 4710] 2045 Length 4 2046 Reserved Reserved for future extension purposes 2048 Figure 15: Format of the NOMINATE Parameter 2050 6. Security Considerations 2052 The security considerations are the same as in Legacy ICE-HIP 2053 [RFC5770], but are repeated here for the sake of completeness. 2055 6.1. Privacy Considerations 2057 The locators are in plain text format in favor of inspection at HIP- 2058 aware middleboxes in the future. The current document does not 2059 specify encrypted versions of LOCATOR_SETs, even though it could be 2060 beneficial for privacy reasons to avoid disclosing them to 2061 middleboxes. 2063 It is also possible that end-users may not want to reveal all 2064 locators to each other. For example, tracking the physical location 2065 of a multihoming end-host may become easier if it reveals all 2066 locators to its peer during a base exchange. Also, revealing host 2067 addresses exposes information about the local topology that may not 2068 be allowed in all corporate environments. For these two reasons, an 2069 end-host may exclude certain host addresses from its LOCATOR_SET 2070 parameter. However, such behavior creates non-optimal paths when the 2071 hosts are located behind the same NAT. Especially, this could be 2072 problematic with a legacy NAT that does not support routing from the 2073 private address realm back to itself through the outer address of the 2074 NAT. This scenario is referred to as the hairpin problem [RFC5128]. 2075 With such a legacy NAT, the only option left would be to use a 2076 relayed transport address from a TURN server. 2078 The use of Control and Data Relay Servers can be also useful for 2079 privacy purposes. For example, a privacy concerned Responder may 2080 reveal only its Control Relay Server and Relayed candidates to 2081 Initiators. This same mechanism also protects the Responder against 2082 Denial-of-Service (DoS) attacks by allowing the Responder to initiate 2083 new connections even if its relays would be unavailable due to a DoS 2084 attack. 2086 6.2. Opportunistic Mode 2088 A Control Relay Server should have one address per Control Relay 2089 Client when the Control Relay Server is serving more than one Control 2090 Relay Client and supports opportunistic mode. Otherwise, it cannot 2091 be guaranteed that the Control Relay Server can deliver the I1 packet 2092 to the intended recipient. 2094 6.3. Base Exchange Replay Protection for Control Relay Server 2096 In certain scenarios, it is possible that an attacker, or two 2097 attackers, can replay an earlier base exchange through a Control 2098 Relay Server by masquerading as the original Initiator and Responder. 2099 The attack does not require the attacker(s) to compromise the private 2100 key(s) of the attacked host(s). However, for this attack to succeed, 2101 the legimitate Responder has to be disconnected from the Control 2102 Relay Server. 2104 The Control Relay Server can protect itself against replay attacks by 2105 becoming involved in the base exchange by introducing nonces that the 2106 end-hosts (Initiator and Responder) are required to sign. One way to 2107 do this is to add ECHO_REQUEST_M parameters to the R1 and I2 packets 2108 as described in [HIP-MIDDLE] and drop the I2 or R2 packets if the 2109 corresponding ECHO_RESPONSE_M parameters are not present. 2111 6.4. Demultiplexing Different HIP Associations 2113 Section 5.1 of [RFC3948] describes a security issue for the UDP 2114 encapsulation in the standard IP tunnel mode when two hosts behind 2115 different NATs have the same private IP address and initiate 2116 communication to the same Responder in the public Internet. The 2117 Responder cannot distinguish between two hosts, because security 2118 associations are based on the same inner IP addresses. 2120 This issue does not exist with the UDP encapsulation of HIP ESP 2121 transport format because the Responder uses HITs to distinguish 2122 between different Initiators. 2124 6.5. Reuse of Ports at the Data Relay Server 2126 If the Data Relay Server uses the same relayed address and port (as 2127 conveyed in the RELAYED_ADDRESS parameter) for multiple Data Relay 2128 Clients, it appears to all the peers, and their firewalls, that all 2129 the Data Relay Clients are at the same address. Thus, a stateful 2130 firewall may allow packets pass from hosts that would not normally be 2131 able to send packets to a peer behind the firewall. Therefore, a 2132 Data Relay Server SHOULD NOT re-use the port numbers. If port 2133 numbers need to be re-used, the Data Relay Server SHOULD have a 2134 sufficiently large pool of port numbers and select ports from the 2135 pool randomly to decrease the chances of a Data Relay Client 2136 obtaining the same address that a another host behind the same 2137 firewall is using. 2139 6.6. Amplification attacks 2141 A malicious host may send an invalid list of candidates for its peer 2142 that are used for targeting a victim host by flooding it with 2143 connectivity checks. To mitigate the attack, this protocol adopts 2144 the ICE mechanism to cap the total amount of connectivity checks as 2145 defined in section Section 4.7. 2147 6.7. Attacks against Connectivity Checks and Candidate Gathering 2149 [I-D.ietf-ice-rfc5245bis] describes attacks against ICE connectivity 2150 checks. HIP bases its control plane security on Diffie-Hellman key 2151 exchange, public keys and Hashed Message Authentication codes, 2152 meaning that the mentioned security concerns do not apply to HIP 2153 either. The mentioned section discusses also of man-in-the-middle 2154 replay attacks that are difficult to prevent. The connectivity 2155 checks in this protocol are immune against replay attacks because a 2156 connectivity request includes a random nonce that the recipient must 2157 sign and send back as a response. 2159 [I-D.ietf-ice-rfc5245bis] describes attacks on server reflexive 2160 address gathering. Similarly here, if the DNS, a Control Relay 2161 Server or a Data Relay Server has been compromised, not much can be 2162 done. However, the case where attacker can inject fake messages 2163 (located on a shared network segment like Wifi) does not apply here. 2164 HIP messages are integrity and replay protected, so it is not 2165 possible inject fake server reflexive address candidates. 2167 [I-D.ietf-ice-rfc5245bis] describes attacks on relayed candidate 2168 gathering. Similarly to ICE TURN servers, Data Relay Server require 2169 an authenticated base exchange that protects relayed address 2170 gathering against fake requests and responses. Further, replay 2171 attacks are not possible because the HIP base exchange (and also 2172 UPDATE procedure) is protected against replay attacks. 2174 7. IANA Considerations 2176 This section is to be interpreted according to [RFC5226]. 2178 This document updates the IANA Registry for HIP Parameter Types 2179 [RFC7401] by assigning new HIP Parameter Type values for the new HIP 2180 Parameters: RELAYED_ADDRESS, MAPPED_ADDRESS (defined in 2181 Section 5.12), and PEER_PERMISSION (defined in Section 5.13). 2183 This document updates the IANA Registry for HIP NAT traversal modes 2184 specified in Legacy ICE-HIP [RFC5770] by assigning value for the NAT 2185 traversal mode ICE-HIP-UDP (defined in Section 5.4) This 2186 specification introduces a new keepalive Notify message type field 2187 NAT_KEEPALIVE. 2189 This document defines additional registration types for the HIP 2190 Registration Extension [RFC8003] that allow registering with a Data 2191 Relay Server for ESP relaying service: RELAY_UDP_ESP (defined in 2192 Section 4.1, and performing server reflexive candidate discovery: 2193 CANDIDATE_DISCOVERY (defined in Section 4.2). 2195 ICE specification [I-D.ietf-ice-rfc5245bis] discusses "Unilateral 2196 Self-Address Fixing" . This protocol is based on ICE, and thus the 2197 same considerations apply also here with one exception: this protocol 2198 does not hide binary IP addresses from application-level gateways. 2200 8. Contributors 2202 Marcelo Bagnulo, Philip Matthews and Hannes Tschofenig have 2203 contributed to [RFC5770]. This document leans heavily on the work in 2204 the RFC. 2206 9. Acknowledgments 2208 Thanks to Jonathan Rosenberg and the rest of the MMUSIC WG folks for 2209 the excellent work on ICE. In addition, the authors would like to 2210 thank Andrei Gurtov, Simon Schuetz, Martin Stiemerling, Lars Eggert, 2211 Vivien Schmitt, and Abhinav Pathak for their contributions and Tobias 2212 Heer, Teemu Koponen, Juhana Mattila, Jeffrey M. Ahrenholz, Kristian 2213 Slavov, Janne Lindqvist, Pekka Nikander, Lauri Silvennoinen, Jukka 2214 Ylitalo, Juha Heinanen, Joakim Koskela, Samu Varjonen, Dan Wing, Tom 2215 Henderson, Alex Elsayed and Jani Hautakorpi for their comments to 2216 [RFC5770], which is the basis for this document. 2218 This work has been partially funded by CyberTrust programme by 2219 Digile/Tekes in Finland. 2221 10. References 2223 10.1. Normative References 2225 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 2226 Requirement Levels", BCP 14, RFC 2119, 2227 DOI 10.17487/RFC2119, March 1997, 2228 . 2230 [RFC7401] Moskowitz, R., Ed., Heer, T., Jokela, P., and T. 2231 Henderson, "Host Identity Protocol Version 2 (HIPv2)", 2232 RFC 7401, DOI 10.17487/RFC7401, April 2015, 2233 . 2235 [RFC8003] Laganier, J. and L. Eggert, "Host Identity Protocol (HIP) 2236 Registration Extension", RFC 8003, DOI 10.17487/RFC8003, 2237 October 2016, . 2239 [RFC8004] Laganier, J. and L. Eggert, "Host Identity Protocol (HIP) 2240 Rendezvous Extension", RFC 8004, DOI 10.17487/RFC8004, 2241 October 2016, . 2243 [RFC8046] Henderson, T., Ed., Vogt, C., and J. Arkko, "Host Mobility 2244 with the Host Identity Protocol", RFC 8046, 2245 DOI 10.17487/RFC8046, February 2017, . 2248 [RFC8078] Gudmundsson, O. and P. Wouters, "Managing DS Records from 2249 the Parent via CDS/CDNSKEY", RFC 8078, 2250 DOI 10.17487/RFC8078, March 2017, . 2253 [RFC5770] Komu, M., Henderson, T., Tschofenig, H., Melen, J., and A. 2254 Keranen, Ed., "Basic Host Identity Protocol (HIP) 2255 Extensions for Traversal of Network Address Translators", 2256 RFC 5770, DOI 10.17487/RFC5770, April 2010, 2257 . 2259 [RFC5389] Rosenberg, J., Mahy, R., Matthews, P., and D. Wing, 2260 "Session Traversal Utilities for NAT (STUN)", RFC 5389, 2261 DOI 10.17487/RFC5389, October 2008, 2262 . 2264 [RFC7402] Jokela, P., Moskowitz, R., and J. Melen, "Using the 2265 Encapsulating Security Payload (ESP) Transport Format with 2266 the Host Identity Protocol (HIP)", RFC 7402, 2267 DOI 10.17487/RFC7402, April 2015, 2268 . 2270 [RFC4291] Hinden, R. and S. Deering, "IP Version 6 Addressing 2271 Architecture", RFC 4291, DOI 10.17487/RFC4291, February 2272 2006, . 2274 [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an 2275 IANA Considerations Section in RFCs", BCP 26, RFC 5226, 2276 DOI 10.17487/RFC5226, May 2008, 2277 . 2279 [I-D.ietf-ice-rfc5245bis] 2280 Keranen, A., Holmberg, C., and J. Rosenberg, "Interactive 2281 Connectivity Establishment (ICE): A Protocol for Network 2282 Address Translator (NAT) Traversal", draft-ietf-ice- 2283 rfc5245bis-08 (work in progress), December 2016. 2285 [RFC2475] Blake, S., Black, D., Carlson, M., Davies, E., Wang, Z., 2286 and W. Weiss, "An Architecture for Differentiated 2287 Services", RFC 2475, DOI 10.17487/RFC2475, December 1998, 2288 . 2290 10.2. Informative References 2292 [RFC4423] Moskowitz, R. and P. Nikander, "Host Identity Protocol 2293 (HIP) Architecture", RFC 4423, DOI 10.17487/RFC4423, May 2294 2006, . 2296 [RFC5201] Moskowitz, R., Nikander, P., Jokela, P., Ed., and T. 2297 Henderson, "Host Identity Protocol", RFC 5201, 2298 DOI 10.17487/RFC5201, April 2008, 2299 . 2301 [RFC5207] Stiemerling, M., Quittek, J., and L. Eggert, "NAT and 2302 Firewall Traversal Issues of Host Identity Protocol (HIP) 2303 Communication", RFC 5207, DOI 10.17487/RFC5207, April 2304 2008, . 2306 [RFC6538] Henderson, T. and A. Gurtov, "The Host Identity Protocol 2307 (HIP) Experiment Report", RFC 6538, DOI 10.17487/RFC6538, 2308 March 2012, . 2310 [MMUSIC-ICE] 2311 Rosenberg, J., "Guidelines for Usage of Interactive 2312 Connectivity Establishment (ICE) by non Session Initiation 2313 Protocol (SIP) Protocols", Work in Progress, July 2008. 2315 [RFC5128] Srisuresh, P., Ford, B., and D. Kegel, "State of Peer-to- 2316 Peer (P2P) Communication across Network Address 2317 Translators (NATs)", RFC 5128, DOI 10.17487/RFC5128, March 2318 2008, . 2320 [HIP-MIDDLE] 2321 Heer, T., Wehrle, K., and M. Komu, "End-Host 2322 Authentication for HIP Middleboxes", Work in Progress, 2323 February 2009. 2325 [RFC3948] Huttunen, A., Swander, B., Volpe, V., DiBurro, L., and M. 2326 Stenberg, "UDP Encapsulation of IPsec ESP Packets", 2327 RFC 3948, DOI 10.17487/RFC3948, January 2005, 2328 . 2330 Appendix A. Selecting a Value for Check Pacing 2332 Selecting a suitable value for the connectivity check transaction 2333 pacing is essential for the performance of connectivity check-based 2334 NAT traversal. The value should not be so small that the checks 2335 cause network congestion or overwhelm the NATs. On the other hand, a 2336 pacing value that is too high makes the checks last for a long time, 2337 thus increasing the connection setup delay. 2339 The Ta value may be configured by the user in environments where the 2340 network characteristics are known beforehand. However, if the 2341 characteristics are not known, it is recommended that the value is 2342 adjusted dynamically. In this case, it is recommended that the hosts 2343 estimate the round-trip time (RTT) between them and set the minimum 2344 Ta value so that only two connectivity check messages are sent on 2345 every RTT. 2347 One way to estimate the RTT is to use the time that it takes for the 2348 Control Relay Server registration exchange to complete; this would 2349 give an estimate on the registering host's access link's RTT. Also, 2350 the I1/R1 exchange could be used for estimating the RTT, but since 2351 the R1 can be cached in the network, or the relaying service can 2352 increase the delay notably, this is not recommended. 2354 Appendix B. Differences with respect to ICE 2356 The Native ICE-HIP protocol specified in this document follows the 2357 semantics of ICE as close as possible, and most of the differences 2358 are syntactical due to the use of a different protocol. In this 2359 section, we describe the differences to the ICE protocol. 2361 o ICE operates at the application layer, whereas this protocol 2362 operates between transport and network layers, thus hiding the 2363 protocol details from the application. 2365 o The STUN protocol is not employed. Instead, native ICE-HIP reuses 2366 the HIP control plane format in order simplify demultiplexing of 2367 different protocols. For example, the STUN binding response is 2368 replaced with a HIP UPDATE message containing an ECHO_REQUEST_SIGN 2369 parameter and the STUN binding response with a HIP UPDATE message 2370 containing an ECHO_RESPONSE_SIGNED parameter as defined in section 2371 Section 4.6. 2373 o The TURN protocol is not utilized. Instead, native ICE-HIP reuses 2374 Control Relay Servers for the same purpose. 2376 o ICMP errors may be used in ICE to signal failure. In Native ICE- 2377 HIP protocol, HIP NOTIFY messages are used instead. 2379 o Instead of the ICE username fragment and password mechanism for 2380 credentials, native ICE-HIP uses the HIT, derived from a public 2381 key, for the same purpose. The username fragments are "transient 2382 host identifiers, bound to a particular session established as 2383 part of the candidate exchange" [I-D.ietf-ice-rfc5245bis]. 2384 Generally in HIP, a local public key and the derived HIT are 2385 considered long-term identifiers, and invariant across different 2386 host associations and different transport-layer flows. 2388 o In ICE, the conflict when two communicating end-points take the 2389 same controlling role is solved using random values (so called 2390 tie-breaker value). In Native ICE-HIP protocol, the conflict is 2391 solved by the standard HIP base exchange procedure, where the host 2392 with the "larger" HIT switches to Responder role, thus changing 2393 also to controlled role. 2395 o The ICE-CONTROLLED and ICE-CONTROLLING attributes are not included 2396 in the connectivity checks. 2398 o The foundation concept is unnecessary in native ICE-HIP because 2399 only a single UDP flow for the IPsec tunnel will be negotiated. 2401 o Frozen candidates are omitted for the same reason as foundation 2402 concept is excluded. 2404 o Components are omitted for the same reason as foundation concept 2405 is excluded. 2407 o Native ICE-HIP supports only "full ICE" where the two 2408 communicating hosts participate actively to the connectivity 2409 checks, and the "lite" mode is not supported. This design 2410 decision follows the guidelines of ICE which recommends full ICE 2411 implementations. However, it should be noted that a publicly 2412 reachable Responder may refuse to negotiate the ICE mode as 2413 described in Section 4.7.2. This would result in a [RFC7401] 2414 based HIP base exchange tunneled over UDP followed ESP traffic 2415 over the same tunnel, without the connectivity check procedures 2416 defined in this document (in some sense, this mode corresponds to 2417 the case where two ICE lite implementations connect since no 2418 connectivity checks are sent). 2420 o As the "ICE lite" is not adopted here and both sides are capable 2421 of ICE-HIP-UDP mode (negotiated during the base exchange), default 2422 candidates are not employed in Native ICE-HIP. 2424 o If the agent is using Diffserv Codepoint markings [RFC2475] in its 2425 media packets, it SHOULD apply those same markings to its 2426 connectivity checks. 2428 o Unlike in ICE, the addresses are not XOR-ed in Native ICE-HIP 2429 protocol in order to avoid middlebox tampering. 2431 o Native ICE-HIP protocol does not employ the ICE related address 2432 and related port attributes (that are used for diagnostic or SIP 2433 purposes). 2435 Appendix C. Differences to Base Exchange and UPDATE procedures 2437 This section gives some design guidance for implementers how the 2438 extensions in this protocol extends and differs from [RFC7401] and 2439 [RFC8046]. 2441 o Both control and data plane are operated on top of UDP, not 2442 directly on IP. 2444 o A minimal implementation would conform only to Section 4.7.1 or 2445 Section 4.7.2, thus merely tunneling HIP control and data traffic 2446 over UDP. The drawback here is that it works only in the limited 2447 cases where the Responder has a public address. 2449 o It is worth noting that while a rendezvous server [RFC8004] has 2450 not been designed to be used in NATted scenarios because it just 2451 relays the first I1 packet and does not employ UDP encapsulation, 2452 the Control Relay Server forwards all control traffic and, hence, 2453 is more suitable in NATted environments. Further, the Data Relay 2454 Server guarantees forwarding of data plane traffic also in the 2455 cases when the NAT traversal procedures fail. 2457 o Registration procedures with a Control/Data Relay Server are 2458 similar as with rendezvous server. However, a Control/Data Relay 2459 Server has different registration parameters than rendezvous 2460 because it offers a different service. Also, the Control/Data 2461 Relay Server includes also a REG_FROM parameter that informs the 2462 Control/Data Relay Client about its server reflexive address. A 2463 Data Relay Server includes also a RELAYED_ADDRESS containing the 2464 relayed address for the Data Relay Client. 2466 o In [RFC7401], the Initiator and Responder can start to exchange 2467 application payload immediately after the base exchange. While 2468 exchanging data immediately after a base exchange via a Data 2469 Control Relay would be possible also here, we follow the ICE 2470 methodology to establish a direct path between two hosts using 2471 connectivity checks. This means that there will be some 2472 additional delay after the base exchange before application 2473 payload can be transmitted. The same applies for the UPDATE 2474 procedure as the connectivity checks introduce some additional 2475 delay. 2477 o In HIP without any NAT traversal support, the base exchange acts 2478 as an implicit connectivity check, and the mobility and 2479 multihoming extensions support explicit connectivity checks. 2480 After a base exchange or UPDATE based connectivity checks, a host 2481 can use the associated address pair for transmitting application 2482 payload. In this Native ICE-HIP extension, we follow the ICE 2483 methodology, where one end-point acting in the controlled role 2484 chooses the used address pair also on behalf of the other end- 2485 point acting in controlled role, which is different from HIP 2486 without NAT traversal support. Another difference is that the 2487 process of choosing an address pair is explicitly signaled using 2488 the nomination packets. The nomination process in this protocol 2489 supports only single address pair, and multihoming extensions are 2490 left for further study. 2492 o The UPDATE procedure resembles the mobility extensions defined in 2493 [RFC8046]. The first UPDATE message from the mobile host is 2494 exactly the same as in the mobility extensions. The second UPDATE 2495 message from the peer host and third from the mobile host are 2496 different in the sense that they merely acknowledge and conclude 2497 the reception of the candidates through the Control Relay Server. 2498 In other words, they do not yet test for connectivity (besides 2499 reachability through the Control Relay Server) unlike in the 2500 mobility extensions. The idea is that connectivity check 2501 procedure follows the ICE specification, which is somewhat 2502 different from the HIP mobility extensions. 2504 o The connectivity checks as defined in the mobility extensions 2505 [RFC8046] are triggered only by the peer of the mobile host. 2506 Since successful NAT traversal requires that both end-points test 2507 connectivity, both the mobile host and its peer host have to test 2508 for connectivity. In addition, this protocol validates also the 2509 UDP ports; the ports in the connectivity check must match with the 2510 response, as required by ICE. 2512 o In HIP mobility extensions [RFC8046], an outbound locator has some 2513 associated state: UNVERIFIED mean that the locator has not been 2514 tested for reachability, ACTIVE means that the address has been 2515 verified for reachability and is being used actively, and 2516 DEPRECATED means that the locator lifetime has expired. In the 2517 subset of ICE specifications used by this protocol, an individual 2518 address candidate has only two properties: type and priority. 2519 Instead, the actual state in ICE is associated with candidate 2520 pairs rather than individual addresses. The subset of ICE 2521 specifications utilized by this protocol require the following 2522 attributes for a candidate pair: valid bit, nominated bit, base 2523 and the state of connectivity check. The connectivity checks have 2524 the following states: Waiting, In-progress, Succeeded and Failed. 2525 Handling of this state attribute requires some additional logic 2526 when compared to the mobility extensions since the state is 2527 associated with a local-remote address pair rather just a remote 2528 address, and, thus, the mobility and ICE states do not have an 2529 unambiguous one-to-one mapping. 2531 o Credit-based authorization as defined in [RFC8046] could be used 2532 before candidate nomination has been concluded upon discovering 2533 working candidate pairs. However, this may result in the use of 2534 asymmetric paths for a short time period in the beginning of 2535 communications (similarly as in aggressive ICE nomination). Thus, 2536 support of credit-based authorization is left for further study. 2538 Authors' Addresses 2540 Ari Keranen 2541 Ericsson 2542 Hirsalantie 11 2543 02420 Jorvas 2544 Finland 2546 Email: ari.keranen@ericsson.com 2548 Jan Melen 2549 Ericsson 2550 Hirsalantie 11 2551 02420 Jorvas 2552 Finland 2554 Email: jan.melen@ericsson.com 2556 Miika Komu (editor) 2557 Ericsson 2558 Hirsalantie 11 2559 02420 Jorvas 2560 Finland 2562 Email: miika.komu@ericsson.com