idnits 2.17.1 draft-ietf-shim6-proto-09.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- ** It looks like you're using RFC 3978 boilerplate. You should update this to the boilerplate described in the IETF Trust License Policy document (see https://trustee.ietf.org/license-info), which is required now. -- Found old boilerplate from RFC 3978, Section 5.1 on line 16. -- Found old boilerplate from RFC 3978, Section 5.5, updated by RFC 4748 on line 5550. -- Found old boilerplate from RFC 3979, Section 5, paragraph 1 on line 5561. -- Found old boilerplate from RFC 3979, Section 5, paragraph 2 on line 5568. -- Found old boilerplate from RFC 3979, Section 5, paragraph 3 on line 5574. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- == No 'Intended status' indicated for this document; assuming Proposed Standard Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust Copyright Line does not match the current year == Line 3295 has weird spacing: '...payload exten...' -- The document seems to lack a disclaimer for pre-RFC5378 work, but may have content which was first submitted before 10 November 2008. If you have contacted all the original authors and they are all willing to grant the BCP78 rights to the IETF Trust, then this is fine, and you can ignore this comment. If not, you may need to add the pre-RFC5378 disclaimer. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (October 2007) is 6036 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) -- Looks like a reference, but probably isn't: 'CGA' on line 2162 -- Looks like a reference, but probably isn't: 'FII' on line 2349 == Outdated reference: A later version (-05) exists of draft-ietf-shim6-hba-03 == Outdated reference: A later version (-13) exists of draft-ietf-shim6-failure-detection-09 -- Obsolete informational reference (is this intentional?): RFC 3484 (ref. '8') (Obsoleted by RFC 6724) -- Obsolete informational reference (is this intentional?): RFC 3697 (ref. '12') (Obsoleted by RFC 6437) == Outdated reference: A later version (-03) exists of draft-schuetz-tcpm-tcp-rlci-01 Summary: 1 error (**), 0 flaws (~~), 6 warnings (==), 11 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 SHIM6 WG E. Nordmark 3 Internet-Draft Sun Microsystems 4 Expires: April 3, 2008 M. Bagnulo 5 UC3M 6 October 2007 8 Shim6: Level 3 Multihoming Shim Protocol for IPv6 9 draft-ietf-shim6-proto-09.txt 11 Status of this Memo 13 By submitting this Internet-Draft, each author represents that any 14 applicable patent or other IPR claims of which he or she is aware 15 have been or will be disclosed, and any of which he or she becomes 16 aware will be disclosed, in accordance with Section 6 of BCP 79. 18 Internet-Drafts are working documents of the Internet Engineering 19 Task Force (IETF), its areas, and its working groups. Note that 20 other groups may also distribute working documents as Internet- 21 Drafts. 23 Internet-Drafts are draft documents valid for a maximum of six months 24 and may be updated, replaced, or obsoleted by other documents at any 25 time. It is inappropriate to use Internet-Drafts as reference 26 material or to cite them other than as "work in progress." 28 The list of current Internet-Drafts can be accessed at 29 http://www.ietf.org/ietf/1id-abstracts.txt. 31 The list of Internet-Draft Shadow Directories can be accessed at 32 http://www.ietf.org/shadow.html. 34 This Internet-Draft will expire on April 3, 2008. 36 Copyright Notice 38 Copyright (C) The IETF Trust (2007). 40 Abstract 42 This document defines the Shim6 protocol, a layer 3 shim for 43 providing locator agility below the transport protocols, so that 44 multihoming can be provided for IPv6 with failover and load sharing 45 properties, without assuming that a multihomed site will have a 46 provider independent IPv6 address prefix which is announced in the 47 global IPv6 routing table. The hosts in a site which has multiple 48 provider allocated IPv6 address prefixes, will use the Shim6 protocol 49 specified in this document to setup state with peer hosts, so that 50 the state can later be used to failover to a different locator pair, 51 should the original one stop working. 53 Table of Contents 55 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 5 56 1.1. Goals . . . . . . . . . . . . . . . . . . . . . . . . . . 5 57 1.2. Non-Goals . . . . . . . . . . . . . . . . . . . . . . . . 6 58 1.3. Locators as Upper-layer IDentifiers (ULID) . . . . . . . 6 59 1.4. IP Multicast . . . . . . . . . . . . . . . . . . . . . . 7 60 1.5. Renumbering Implications . . . . . . . . . . . . . . . . 8 61 1.6. Placement of the shim . . . . . . . . . . . . . . . . . . 9 62 1.7. Traffic Engineering . . . . . . . . . . . . . . . . . . . 11 63 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 12 64 2.1. Definitions . . . . . . . . . . . . . . . . . . . . . . . 12 65 2.2. Notational Conventions . . . . . . . . . . . . . . . . . 15 66 3. Assumptions . . . . . . . . . . . . . . . . . . . . . . . . . 16 67 4. Protocol Overview . . . . . . . . . . . . . . . . . . . . . . 18 68 4.1. Context Tags . . . . . . . . . . . . . . . . . . . . . . 20 69 4.2. Context Forking . . . . . . . . . . . . . . . . . . . . . 20 70 4.3. API Extensions . . . . . . . . . . . . . . . . . . . . . 21 71 4.4. Securing Shim6 . . . . . . . . . . . . . . . . . . . . . 21 72 4.5. Overview of Shim Control Messages . . . . . . . . . . . . 22 73 4.6. Extension Header Order . . . . . . . . . . . . . . . . . 23 74 5. Message Formats . . . . . . . . . . . . . . . . . . . . . . . 25 75 5.1. Common Shim6 Message Format . . . . . . . . . . . . . . . 25 76 5.2. Payload Extension Header Format . . . . . . . . . . . . . 26 77 5.3. Common Shim6 Control header . . . . . . . . . . . . . . . 26 78 5.4. I1 Message Format . . . . . . . . . . . . . . . . . . . . 28 79 5.5. R1 Message Format . . . . . . . . . . . . . . . . . . . . 29 80 5.6. I2 Message Format . . . . . . . . . . . . . . . . . . . . 31 81 5.7. R2 Message Format . . . . . . . . . . . . . . . . . . . . 33 82 5.8. R1bis Message Format . . . . . . . . . . . . . . . . . . 34 83 5.9. I2bis Message Format . . . . . . . . . . . . . . . . . . 36 84 5.10. Update Request Message Format . . . . . . . . . . . . . . 38 85 5.11. Update Acknowledgement Message Format . . . . . . . . . . 39 86 5.12. Keepalive Message Format . . . . . . . . . . . . . . . . 40 87 5.13. Probe Message Format . . . . . . . . . . . . . . . . . . 41 88 5.14. Error Message Format . . . . . . . . . . . . . . . . . . 41 89 5.15. Option Formats . . . . . . . . . . . . . . . . . . . . . 42 90 5.15.1. Responder Validator Option Format . . . . . . . . . 45 91 5.15.2. Locator List Option Format . . . . . . . . . . . . . 45 92 5.15.3. Locator Preferences Option Format . . . . . . . . . 47 93 5.15.4. CGA Parameter Data Structure Option Format . . . . . 49 94 5.15.5. CGA Signature Option Format . . . . . . . . . . . . 49 95 5.15.6. ULID Pair Option Format . . . . . . . . . . . . . . 50 96 5.15.7. Forked Instance Identifier Option Format . . . . . . 51 97 5.15.8. Keepalive Timeout Option Format . . . . . . . . . . 51 98 6. Conceptual Model of a Host . . . . . . . . . . . . . . . . . 52 99 6.1. Conceptual Data Structures . . . . . . . . . . . . . . . 52 100 6.2. Context States . . . . . . . . . . . . . . . . . . . . . 54 101 7. Establishing ULID-Pair Contexts . . . . . . . . . . . . . . . 56 102 7.1. Uniqueness of Context Tags . . . . . . . . . . . . . . . 56 103 7.2. Locator Verification . . . . . . . . . . . . . . . . . . 56 104 7.3. Normal context establishment . . . . . . . . . . . . . . 57 105 7.4. Concurrent context establishment . . . . . . . . . . . . 57 106 7.5. Context recovery . . . . . . . . . . . . . . . . . . . . 59 107 7.6. Context confusion . . . . . . . . . . . . . . . . . . . . 61 108 7.7. Sending I1 messages . . . . . . . . . . . . . . . . . . . 62 109 7.8. Retransmitting I1 messages . . . . . . . . . . . . . . . 63 110 7.9. Receiving I1 messages . . . . . . . . . . . . . . . . . . 63 111 7.10. Sending R1 messages . . . . . . . . . . . . . . . . . . . 64 112 7.10.1. Generating the R1 Validator . . . . . . . . . . . . 65 113 7.11. Receiving R1 messages and sending I2 messages . . . . . . 65 114 7.12. Retransmitting I2 messages . . . . . . . . . . . . . . . 66 115 7.13. Receiving I2 messages . . . . . . . . . . . . . . . . . . 66 116 7.14. Sending R2 messages . . . . . . . . . . . . . . . . . . . 68 117 7.15. Match for Context Confusion . . . . . . . . . . . . . . . 68 118 7.16. Receiving R2 messages . . . . . . . . . . . . . . . . . . 69 119 7.17. Sending R1bis messages . . . . . . . . . . . . . . . . . 70 120 7.17.1. Generating the R1bis Validator . . . . . . . . . . . 71 121 7.18. Receiving R1bis messages and sending I2bis messages . . . 71 122 7.19. Retransmitting I2bis messages . . . . . . . . . . . . . . 72 123 7.20. Receiving I2bis messages and sending R2 messages . . . . 72 124 8. Handling ICMP Error Messages . . . . . . . . . . . . . . . . 75 125 9. Teardown of the ULID-Pair Context . . . . . . . . . . . . . . 77 126 10. Updating the Peer . . . . . . . . . . . . . . . . . . . . . . 78 127 10.1. Sending Update Request messages . . . . . . . . . . . . . 78 128 10.2. Retransmitting Update Request messages . . . . . . . . . 78 129 10.3. Newer Information While Retransmitting . . . . . . . . . 79 130 10.4. Receiving Update Request messages . . . . . . . . . . . . 79 131 10.5. Receiving Update Acknowledgement messages . . . . . . . . 81 132 11. Sending ULP Payloads . . . . . . . . . . . . . . . . . . . . 83 133 11.1. Sending ULP Payload after a Switch . . . . . . . . . . . 83 134 12. Receiving Packets . . . . . . . . . . . . . . . . . . . . . . 85 135 12.1. Receiving payload without extension headers . . . . . . . 85 136 12.2. Receiving Payload Extension Headers . . . . . . . . . . . 85 137 12.3. Receiving Shim Control messages . . . . . . . . . . . . . 86 138 12.4. Context Lookup . . . . . . . . . . . . . . . . . . . . . 86 139 13. Initial Contact . . . . . . . . . . . . . . . . . . . . . . . 89 140 14. Protocol constants . . . . . . . . . . . . . . . . . . . . . 90 141 15. Implications Elsewhere . . . . . . . . . . . . . . . . . . . 91 142 15.1. Congestion Control Considerations . . . . . . . . . . . . 91 143 15.2. Middle-boxes considerations . . . . . . . . . . . . . . . 91 144 15.3. Other considerations . . . . . . . . . . . . . . . . . . 92 145 16. Security Considerations . . . . . . . . . . . . . . . . . . . 94 146 17. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 97 147 18. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 99 148 Appendix A. Possible Protocol Extensions . . . . . . . . . . 100 149 Appendix B. Simplified State Machine . . . . . . . . . . . . 102 150 Appendix B.1. Simplified State Machine diagram . . . . . . . . 107 151 Appendix C. Context Tag Reuse . . . . . . . . . . . . . . . . 109 152 Appendix C.1. Context Recovery . . . . . . . . . . . . . . . . 109 153 Appendix C.2. Context Confusion . . . . . . . . . . . . . . . . 109 154 Appendix C.3. Three Party Context Confusion . . . . . . . . . . 110 155 Appendix D. Design Alternatives . . . . . . . . . . . . . . . 111 156 Appendix D.1. Context granularity . . . . . . . . . . . . . . . 111 157 Appendix D.2. Demultiplexing of data packets in Shim6 158 communications . . . . . . . . . . . . . . . . . 111 159 Appendix D.2.1. Flow-label . . . . . . . . . . . . . . . . . . . 112 160 Appendix D.2.2. Extension Header . . . . . . . . . . . . . . . . 114 161 Appendix D.3. Context Loss Detection . . . . . . . . . . . . . 115 162 Appendix D.4. Securing locator sets . . . . . . . . . . . . . . 117 163 Appendix D.5. ULID-pair context establishment exchange . . . . 120 164 Appendix D.6. Updating locator sets . . . . . . . . . . . . . . 121 165 Appendix D.7. State Cleanup . . . . . . . . . . . . . . . . . . 121 166 Appendix E. Change Log . . . . . . . . . . . . . . . . . . . 124 167 19. References . . . . . . . . . . . . . . . . . . . . . . . . . 130 168 19.1. Normative References . . . . . . . . . . . . . . . . . . 130 169 19.2. Informative References . . . . . . . . . . . . . . . . . 130 170 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 132 171 Intellectual Property and Copyright Statements . . . . . . . . . 133 173 1. Introduction 175 This document describes a layer 3 shim approach and protocol for 176 providing locator agility below the transport protocols, so that 177 multihoming can be provided for IPv6 with failover and load sharing 178 properties [11], without assuming that a multihomed site will have a 179 provider independent IPv6 address which is announced in the global 180 IPv6 routing table. The hosts in a site which has multiple provider 181 allocated IPv6 address prefixes, will use the Shim6 protocol 182 specified in this document to setup state with peer hosts, so that 183 the state can later be used to failover to a different locator pair, 184 should the original one stop working (the term locator is defined in 185 Section 2). 187 The Shim6 protocol is a site multihoming solution in the sense that 188 it allows existing communication to continue when a site that has 189 multiple connections to the internet experiences an outage on a 190 subset of these connections or further upstream. However, Shim6 191 processing is performed in individual hosts rather than through site- 192 wide mechanisms. 194 We assume that redirection attacks are prevented using Hash Based 195 Addresses (HBA) as defined in [4]. 197 The reachability and failure detection mechanisms, including how a 198 new working locator pair is discovered after a failure, are specified 199 in a separate document [5]. This document allocates message types 200 and option types for that sub-protocol, and leaves the specification 201 of the message and option formats as well as the protocol behavior to 202 that document. 204 1.1. Goals 206 The goals for this approach are to: 208 o Preserve established communications in the presence of certain 209 classes of failures, for example, TCP connections and UDP streams. 211 o Have minimal impact on upper layer protocols in general and on 212 transport protocols and applications in particular. 214 o Address the security threats in [15] through the combination of 215 the HBA/CGA approach specified in a separate document [4] and 216 techniques described in this document. 218 o Not require extra roundtrip up front to setup shim specific state. 219 Instead allow the upper layer traffic (e.g., TCP) to flow as 220 normal and defer the setup of the shim state until some number of 221 packets have been exchanged. 223 o Take advantage of multiple locators/addresses for load spreading 224 so that different sets of communication to a host (e.g., different 225 connections) might use different locators of the host. Note that 226 this might cause load to be spread unevenly, thus we use the term 227 "load spreading" instead of "load balancing". This capability 228 might enable some forms of traffic engineering, but the details 229 for traffic engineering, including what requirements can be 230 satisfied, are not specified in this document, and form part of a 231 potential extensions to this protocol. 233 1.2. Non-Goals 235 The assumption is that the problem we are trying to solve is site 236 multihoming, with the ability to have the set of site prefixes change 237 over time due to site renumbering. Further, we assume that such 238 changes to the set of locator prefixes can be relatively slow and 239 managed; slow enough to allow updates to the DNS to propagate (since 240 the protocol defined in this document depends on the DNS to find the 241 appropriate locator sets). Note, however that it is an explicit non- 242 goal to make communication survive a renumbering event (which causes 243 all the locators of a host to change to a new set of locators). This 244 proposal does not attempt to solve the related problem of host 245 mobility. However, it might turn out that the Shim6 protocol can be 246 a useful component for future host mobility solutions, e.g., for 247 route optimization. 249 Finally, this proposal also does not try to provide a new network 250 level or transport level identifier name space distinct from the 251 current IP address name space. Even though such a concept would be 252 useful to Upper Layer Protocols (ULPs) and applications, especially 253 if the management burden for such a name space was negligible and 254 there was an efficient yet secure mechanism to map from identifiers 255 to locators, such a name space isn't necessary (and furthermore 256 doesn't seem to help) to solve the multihoming problem. 258 The Shim6 proposal doesn't fully separate the identifier and locator 259 functions that have traditionally been overloaded in the IP address. 260 However, throughout this document the term "identifier", or more 261 specifically, Upper Layer Identifier (ULID) refers to the identifying 262 function of an IPv6 address, and "locator" to the network layer 263 routing and forwarding properties of an IPv6 address. 265 1.3. Locators as Upper-layer IDentifiers (ULID) 267 The approach described in this document does not introduce a new 268 identifier name space but instead uses the locator that is selected 269 in the initial contact with the remote peer as the preserved Upper- 270 Layer Identifier (ULID). While there may be subsequent changes in 271 the selected network level locators over time in response to failures 272 in using the original locator, the upper level protocol stack 273 elements will continue to use this upper level identifier without 274 change. 276 This implies that the ULID selection is performed as today's default 277 address selection as specified in RFC 3484 [8]. Some extensions are 278 needed to RFC 3484 to try different source addresses, whether or not 279 the Shim6 protocol is used, as outlined in [9]. Underneath, and 280 transparently, the multihoming shim selects working locator pairs 281 with the initial locator pair being the ULID pair. If communication 282 subsequently fails the shim can test and select alternate locators. 283 A subsequent section discusses the issues when the selected ULID is 284 not initially working hence there is a need to switch locators up 285 front. 287 Using one of the locators as the ULID has certain benefits for 288 applications which have long-lived session state or performs 289 callbacks or referrals, because both the FQDN and the 128-bit ULID 290 work as handles for the applications. However, using a single 128- 291 bit ULID doesn't provide seamless communication when that locator is 292 unreachable. See [18] for further discussion of the application 293 implications. 295 There has been some discussion of using non-routable addresses, such 296 as Unique-Local Addresses (ULAs) [14], as ULIDs in a multihoming 297 solution. While this document doesn't specify all aspects of this, 298 it is believed that the approach can be extended to handle the non- 299 routable address case. For example, the protocol already needs to 300 handle ULIDs that are not initially reachable. Thus the same 301 mechanism can handle ULIDs that are permanently unreachable from 302 outside their site. The issue becomes how to make the protocol 303 perform well when the ULID is known a priori to be not reachable 304 (e.g. the ULID is a ULA), for instance, avoiding any timeout and 305 retries in this case. In addition one would need to understand how 306 the ULAs would be entered in the DNS to avoid a performance impact on 307 existing, non-Shim6 aware, IPv6 hosts potentially trying to 308 communicate to the (unreachable) ULA. 310 1.4. IP Multicast 312 IP Multicast requires that the IP source address field contain a 313 topologically correct locator for interface that is used to send the 314 packet, since IP multicast routing uses both the source address and 315 the destination group to determine where to forward the packet. In 316 particular, it need to be able to do the RPF check. (This isn't much 317 different than the situation with widely implemented ingress 318 filtering [7] for unicast.) 320 While in theory it would be possible to apply the shim re-mapping of 321 the IP address fields between ULIDs and locators, the fact that all 322 the multicast receivers would need to know the mapping to perform, 323 makes such an approach difficult in practice. Thus it makes sense to 324 have multicast ULPs operate directly on locators and not use the 325 shim. This is quite a natural fit for protocols which use RTP [10], 326 since RTP already has an explicit identifier in the form of the SSRC 327 field in the RTP headers. Thus the actual IP address fields are not 328 important to the application. 330 In summary, IP multicast will not need the shim to remap the IP 331 addresses. 333 This doesn't prevent the receiver of multicast to change its 334 locators, since the receiver is not explicitly identified; the 335 destination address is a multicast address and not the unicast 336 locator of the receiver. 338 1.5. Renumbering Implications 340 As stated above, this approach does not try to make communication 341 survive renumbering in the general case. 343 When a host is renumbered, the effect is that one or more locators 344 become invalid, and zero or more locators are added to the host's 345 network interface. This means that the set of locators that is used 346 in the shim will change, which the shim can handle as long as not all 347 the original locators become invalid at the same time and depending 348 on the time that is required to update the DNS and for those updates 349 to propagate. 351 But IP addresses are also used as ULIDs, and making the communication 352 survive locators becoming invalid can potentially cause some 353 confusion at the upper layers. The fact that a ULID might be used 354 with a different locator over time open up the possibility that 355 communication between two ULIDs might continue to work after one or 356 both of those ULIDs are no longer reachable as locators, for example 357 due to a renumbering event. This opens up the possibility that the 358 ULID (or at least the prefix on which it is based) is reassigned to 359 another site while it is still being used (with another locator) for 360 existing communication. 362 In the worst case we could end up with two separate hosts using the 363 same ULID while both of them are communicating with the same host. 365 This potential source for confusion is avoided requiring that any 366 communication using a ULID MUST be terminated when the ULID becomes 367 invalid (due to the underlying prefix becoming invalid). This 368 behaviour can be accomplished by explicitly discarding the shim state 369 when the ULID becomes invalid. The context recovery mechanism will 370 then make the peer aware that the context is gone, and that the ULID 371 is no longer present at the same locator(s). 373 1.6. Placement of the shim 375 ----------------------- 376 | Transport Protocols | 377 ----------------------- 379 ------ ------- -------------- ------------- IP endpoint 380 | AH | | ESP | | Frag/reass | | Dest opts | sub-layer 381 ------ ------- -------------- ------------- 383 --------------------- 384 | Shim6 shim layer | 385 --------------------- 387 ------ IP routing 388 | IP | sub-layer 389 ------ 391 Figure 1: Protocol stack 393 The proposal uses a multihoming shim layer within the IP layer, i.e., 394 below the ULPs, as shown in Figure 1, in order to provide ULP 395 independence. The multihoming shim layer behaves as if it is 396 associated with an extension header, which would be placed after any 397 routing-related headers in the packet (such as any hop-by-hop 398 options, or routing header). However, when the locator pair is the 399 ULID pair there is no data that needs to be carried in an extension 400 header, thus none is needed in that case. 402 Layering AH and ESP above the multihoming shim means that IPsec can 403 be made to be unaware of locator changes the same way that transport 404 protocols can be unaware. Thus the IPsec security associations 405 remain stable even though the locators are changing. This means that 406 the IP addresses specified in the selectors should be the ULIDs. 408 Layering the fragmentation header above the multihoming shim makes 409 reassembly robust in the case that there is broken multi-path routing 410 which results in using different paths, hence potentially different 411 source locators, for different fragments. Thus, effectively the 412 multihoming shim layer is placed between the IP endpoint sublayer, 413 which handles fragmentation, reassembly, and IPsec, and the IP 414 routing sublayer, which selects which next hop and interface to use 415 for sending out packets. 417 Applications and upper layer protocols use ULIDs which the Shim6 418 layer map to/from different locators. The Shim6 layer maintains 419 state, called ULID-pair context, per ULID pair (that is, applies to 420 all ULP connections between the ULID pair) in order to perform this 421 mapping. The mapping is performed consistently at the sender and the 422 receiver so that ULPs see packets that appear to be sent using ULIDs 423 from end to end. This property is maintained even though the packets 424 travel through the network containing locators in the IP address 425 fields, and even though those locators may be changed by the 426 transmitting Shim6 layer. 428 The context state is maintained per remote ULID i.e. approximately 429 per peer host, and not at any finer granularity. In particular, it 430 is independent of the ULPs and any ULP connections. However, the 431 forking capability enables shim-aware ULPs to use more than one 432 locator pair at a time for an single ULID pair. 434 ---------------------------- ---------------------------- 435 | Sender A | | Receiver B | 436 | | | | 437 | ULP | | ULP | 438 | | src ULID(A)=L1(A) | | ^ | 439 | | dst ULID(B)=L1(B) | | | src ULID(A)=L1(A) | 440 | v | | | dst ULID(B)=L1(B) | 441 | multihoming shim | | multihoming shim | 442 | | src L2(A) | | ^ | 443 | | dst L3(B) | | | src L2(A) | 444 | v | | | dst L3(B) | 445 | IP | | IP | 446 ---------------------------- ---------------------------- 447 | ^ 448 ------- cloud with some routers ------- 450 Figure 2: Mapping with changed locators 452 The result of this consistent mapping is that there is no impact on 453 the ULPs. In particular, there is no impact on pseudo-header 454 checksums and connection identification. 456 Conceptually, one could view this approach as if both ULIDs and 457 locators are being present in every packet, and with a header 458 compression mechanism applied that removes the need for the ULIDs to 459 be carried in the packets once the compression state has been 460 established. In order for the receiver to recreate a packet with the 461 correct ULIDs there is a need to include some "compression tag" in 462 the data packets. This serves to indicate the correct context to use 463 for decompression when the locator pair in the packet is insufficient 464 to uniquely identify the context. 466 1.7. Traffic Engineering 468 At the time of this writing it is not clear what requirements for 469 traffic engineering make sense for the Shim6 protocol, since the 470 requirements must both result in some useful behavior as well as be 471 implementable using a host-to-host locator agility mechanism like 472 Shim6. 474 Inherent in a scalable multihoming mechanism that separates the 475 locator function of the IP address from identifying function of the 476 IP address is that each host ends up with multiple locators. This 477 means that at least for initial contact, it is the remote peer 478 application (or layer working on its behalf) needs to select an 479 initial ULID, which automatically becomes the initial locator. In 480 the case of Shim6 this is performed by applying RFC 3484 address 481 selection. 483 This is quite different than the common case of IPv4 multihoming 484 where the site has a single IP address prefix, since in that case the 485 peer performs no destination address selection. 487 Thus in "single prefix multihoming" the site, and in many cases its 488 upstream ISPs, can use BGP to exert some control of the ingress path 489 used to reach the site. This capability can't easily be recreated in 490 "multiple prefix multihoming" such as Shim6. 492 The protocol provides a placeholder, in the form of the Locator 493 Preferences option, which can be used by hosts to express priority 494 and weight values for each locator. This is intentionally made 495 identical to the DNS SRV [6] specification of priority and weight, so 496 that DNS SRV records can be used for initial contact and the shim for 497 failover, and they can use the same way to describe the preferences. 498 But the Locator Preference option is merely a place holder when it 499 comes to providing traffic engineering; in order to use this in a 500 large site there would have to be a mechanism by which the host can 501 find out what preference values to use, either statically (e.g., some 502 new DHCPv6 option) or dynamically. 504 Thus traffic engineering is listed as a possible extension in 505 Appendix A. 507 2. Terminology 509 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 510 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 511 document are to be interpreted as described in RFC 2119 [1]. 513 2.1. Definitions 515 This document introduces the following terms: 517 upper layer protocol (ULP) 518 A protocol layer immediately above IP. Examples 519 are transport protocols such as TCP and UDP, 520 control protocols such as ICMP, routing protocols 521 such as OSPF, and internet or lower-layer 522 protocols being "tunneled" over (i.e., 523 encapsulated in) IP such as IPX, AppleTalk, or IP 524 itself. 526 interface A node's attachment to a link. 528 address An IP layer name that contains both topological 529 significance and acts as a unique identifier for 530 an interface. 128 bits. This document only uses 531 the "address" term in the case where it isn't 532 specific whether it is a locator or an 533 identifier. 535 locator An IP layer topological name for an interface or 536 a set of interfaces. 128 bits. The locators are 537 carried in the IP address fields as the packets 538 traverse the network. 540 identifier An IP layer name for an IP layer endpoint. The 541 transport endpoint name is a function of the 542 transport protocol and would typically include 543 the IP identifier plus a port number. 544 NOTE: This proposal does not specify any new form 545 of IP layer identifier, but still separates the 546 identifying and locating properties of the IP 547 addresses. 549 upper-layer identifier (ULID) 550 An IP address which has been selected for 551 communication with a peer to be used by the upper 552 layer protocol. 128 bits. This is used for 553 pseudo-header checksum computation and connection 554 identification in the ULP. Different sets of 555 communication to a host (e.g., different 556 connections) might use different ULIDs in order 557 to enable load spreading. 559 Since the ULID is just one of the IP locators/ 560 addresses of the node, there is no need for a 561 separate name space and allocation mechanisms. 563 address field The source and destination address fields in the 564 IPv6 header. As IPv6 is currently specified this 565 fields carry "addresses". If identifiers and 566 locators are separated these fields will contain 567 locators for packets on the wire. 569 FQDN Fully Qualified Domain Name 571 ULID-pair context The state that the multihoming shim maintains 572 between a pair of Upper-layer identifiers. The 573 context is identified by a context tag for each 574 direction of the communication, and also 575 identified by the pair of ULID and a Forked 576 Instance Identifier (see below). 578 Context tag Each end of the context allocates a context tag 579 for the context. This is used to uniquely 580 associate both received control packets and 581 payload extension headers as belonging to the 582 context. 584 Current locator pair 585 Each end of the context has a current locator 586 pair which is used to send packets to the peer. 587 The two ends might use different current locator 588 pairs though. 590 Default context At the sending end, the shim uses the ULID pair 591 (passed down from the ULP) to find the context 592 for that pair. Thus, normally, a host can have 593 at most one context for a ULID pair. We call 594 this the "default context". 596 Context forking A mechanism which allows ULPs that are aware of 597 multiple locators to use separate contexts for 598 the same ULID pair, in order to be able use 599 different locator pairs for different 600 communication to the same ULID. Context forking 601 causes more than just the default context to be 602 created for a ULID pair. 604 Forked Instance Identifier (FII) 605 In order to handle context forking, a context is 606 identified by a ULID-pair and a forked context 607 identifier. The default context has a FII of 608 zero. 610 Initial contact We use this term to refer to the pre-shim 611 communication when some ULP decides to start 612 communicating with a peer by sending and 613 receiving ULP packets. Typically this would not 614 invoke any operations in the shim, since the shim 615 can defer the context establishment until some 616 arbitrary later point in time. 618 Hash Based Addresses (HBA) 619 A form of IPv6 address where the interface ID is 620 derived from a cryptographic hash of all the 621 prefixes assigned to the host. See [4]. 623 Cryptographically Generated Addresses (CGA) 624 A form of IPv6 address where the interface ID is 625 derived from a cryptographic hash of the public 626 key. See [2]. 628 CGA Parameter Data Structure (PDS) 629 The information that CGA and HBA exchanges in 630 order to inform the peer of how the interface ID 631 was computed. See [2], [4]. 633 2.2. Notational Conventions 635 A, B, and C are hosts. X is a potentially malicious host. 637 FQDN(A) is the Fully qualified Domain Name for A. 639 Ls(A) is the locator set for A, which consists of the locators L1(A), 640 L2(A), ... Ln(A). The locator set in not ordered in any particular 641 way other than maybe what is returned by the DNS. 643 ULID(A) is an upper-layer ID for A. In this proposal, ULID(A) is 644 always one member of A's locator set. 646 CT(A) is a context tag assigned by A. 648 This document also makes use of internal conceptual variables to 649 describe protocol behavior and external variables that an 650 implementation must allow system administrators to change. The 651 specific variable names, how their values change, and how their 652 settings influence protocol behavior are provided to demonstrate 653 protocol behavior. An implementation is not required to have them in 654 the exact form described here, so long as its external behavior is 655 consistent with that described in this document. See Section 6 for a 656 description of the conceptual data structures. 658 3. Assumptions 660 The design intent is to ensure that the Shim6 protocol is capable of 661 handling path failures independently of the number of IP addresses 662 (locators) available to the two communicating hosts, and 663 independently of which host detects the failure condition. 665 Consider, for example, the case in which both A and B have active 666 Shim6 state and where A has only one locator while B has multiple 667 locators. In this case, it might be that B is trying to send a 668 packet to A, and has detected a failure condition with the current 669 locator pair. Since B has multiple locators it presumably has 670 multiple ISPs, and consequently likely has alternate egress paths 671 toward A. However, B cannot vary the destination address (i.e., A's 672 locator), since A has only one locator. 674 The above scenario leads to the assumption that a host should be able 675 to cause different egress paths from its site to be used. The most 676 reasonable approach to accomplish this is to have the host use 677 different source addresses and have the source address affect the 678 selection of the site egress. The details of how this can be 679 accomplished is beyond the scope of this document, but without this 680 capability the ability of the shim to try different "paths" by trying 681 different locator pairs will have limited utility. 683 The above assumption applies whether or not the ISPs perform ingress 684 filtering. 686 In addition, when the site's ISPs perform ingress filtering based on 687 packet source addresses, Shim6 assumes that packets sent with 688 different source and destination combinations have a reasonable 689 chance of making it through the relevant ISP's ingress filters. This 690 can be accomplished in several ways (all outside the scope of this 691 document), such as having the ISPs relax their ingress filters, or 692 selecting the egress such that it matches the IP source address 693 prefix. 695 Further discussion of this issue is captured in [16]. 697 The Shim6 approach assumes that there are no IPv6-to-IPv6 NATs on the 698 paths, i.e., that the two ends can exchange their own notion of their 699 IPv6 addresses and that those addresses will also make sense to their 700 peer. 702 The security of the Shim6 protocol relies on the usage of Hash Based 703 Addresses (HBA) [4] and/or Cryptographically Generated Addresses 704 (CGA) [2]. In the case that HBAs are used, all the addresses 705 assigned to the host that are included in the Shim6 protocol (either 706 as a locator or as a ULID) must be part of the same HBA set. In the 707 case that CGAs are used, the address used as ULID must be a CGA but 708 the other addresses that are used as locators do not need to be 709 neither CGAs nor HBAs. It should be noted that it is perfectly 710 acceptable to run the Shim6 protocol between a host that has multiple 711 locators and another host that has a single IP address. In this 712 case, the address of the host with a single address does not need to 713 be an HBA nor a CGA. 715 4. Protocol Overview 717 The Shim6 protocol operates in several phases over time. The 718 following sequence illustrates the concepts: 720 o An application on host A decides to contact an application on host 721 B using some upper-layer protocol. This results in the ULP on 722 host A sending packets to host B. We call this the initial 723 contact. Assuming the IP addresses selected by Default Address 724 Selection [8] and its extensions [9] work, then there is no action 725 by the shim at this point in time. Any shim context establishment 726 can be deferred until later. 728 o Some heuristic on A or B (or both) determine that it is 729 appropriate to pay the Shim6 overhead to make this host-to-host 730 communication robust against locator failures. For instance, this 731 heuristic might be that more than 50 packets have been sent or 732 received, or a timer expiration while active packet exchange is in 733 place. This makes the shim initiate the 4-way context 734 establishment exchange. The purpose of this heuristic is to avoid 735 setting up a shim context when only a small number of packets is 736 exchanged between two hosts. 738 As a result of this exchange, both A and B will know a list of 739 locators for each other. 741 If the context establishment exchange fails, the initiator will 742 then know that the other end does not support Shim6, and will 743 continue with standard (non-Shim6) behavior for the session. 745 o Communication continues without any change for the ULP packets. 746 In particular, there are no shim extension headers added to the 747 ULP packets, since the ULID pair is the same as the locator pair. 748 In addition, there might be some messages exchanged between the 749 shim sub-layers for (un)reachability detection. 751 o At some point in time something fails. Depending on the approach 752 to reachability detection, there might be some advice from the 753 ULP, or the shim (un)reachability detection might discover that 754 there is a problem. 756 At this point in time one or both ends of the communication need 757 to probe the different alternate locator pairs until a working 758 pair is found, and switch to using that locator pair. 760 o Once a working alternative locator pair has been found, the shim 761 will rewrite the packets on transmit, and tag the packets with 762 Shim6 Payload extension header, which contains the receiver's 763 context tag. The receiver will use the context tag to find the 764 context state which will indicate which addresses to place in the 765 IPv6 header before passing the packet up to the ULP. The result 766 is that from the perspective of the ULP the packet passes 767 unmodified end-to-end, even though the IP routing infrastructure 768 sends the packet to a different locator. 770 o The shim (un)reachability detection will monitor the new locator 771 pair as it monitored the original locator pair, so that subsequent 772 failures can be detected. 774 o In addition to failures detected based on end-to-end observations, 775 one endpoint might know for certain that one or more of its 776 locators is not working. For instance, the network interface 777 might have failed or gone down (at layer 2), or an IPv6 address 778 might have become deprecated or invalid. In such cases the host 779 can signal its peer that this address is no longer recommended to 780 try. This triggers something similar to a failure handling and a 781 new working locator pair must be found. 783 The protocol also has the ability to express other forms of 784 locator preferences. A change in any preferences can be signaled 785 to the peer, which will have made the peer record the new 786 preferences. A change in the preferences might optionally make 787 the peer want to use a different locator pair. In this case, the 788 peer follows the same locator switching procedure as after a 789 failure (by verifying that its peer is indeed present at the 790 alternate locator, etc). 792 o When the shim thinks that the context state is no longer used, it 793 can garbage collect the state; there is no coordination necessary 794 with the peer host before the state is removed. There is a 795 recovery message defined to be able to signal when there is no 796 context state, which can be used to detect and recover from both 797 premature garbage collection, as well as complete state loss 798 (crash and reboot) of a peer. 800 The exact mechanism to determine when the context state is no 801 longer used is implementation dependent. For example, an 802 implementation might use the existence of ULP state (where known 803 to the implementation) as an indication that the state is still 804 used, combined with a timer (to handle ULP state that might not be 805 known to the shim sub-layer) to determine when the state is likely 806 to no longer be used. 808 NOTE 1: The ULP packets in Shim6 can be carried completely unmodified 809 as long as the ULID pair is used as the locator pair. After a switch 810 to a different locator pair the packets are "tagged" with a Shim6 811 extension header, so that the receiver can always determine the 812 context to which they belong. This is accomplished by including an 813 8-octet Shim6 Payload Extension header before the (extension) headers 814 that are processed by the IP endpoint sublayer and ULPs. If 815 subsequently the original ULIDs are selected as the active locator 816 pair then the tagging of packets with the Shim6 extension header is 817 no longer necessary. 819 4.1. Context Tags 821 A context between two hosts is actually a context between two ULIDs. 822 The context is identified by a pair of context tags. Each end gets 823 to allocate a context tag, and once the context is established, most 824 Shim6 control messages contain the context tag that the receiver of 825 the message allocated. Thus at a minimum the combination of have to uniquely identify one 827 context. But since the Payload extension headers are demultiplexed 828 without looking at the locators in the packet, the receiver will need 829 to allocate context tags that are unique for all its contexts. The 830 context tag is a 47-bit number (the largest which can fit in an 831 8-octet extension header), while preserving one bit to differentiate 832 the Shim6 signalling messages from the Shim6 header included in data 833 packets, allowing both to use the same protocol number. 835 The mechanism for detecting a loss of context state at the peer 836 assumes that the receiver can tell the packets that need locator 837 rewriting, even after it has lost all state (e.g., due to a crash 838 followed by a reboot). This is achieved because after a rehoming 839 event the packets that need receive-side rewriting, carry the Payload 840 extension header. 842 4.2. Context Forking 844 It has been asserted that it will be important for future ULPs, in 845 particular, future transport protocols, to be able to control which 846 locator pairs are used for different communication. For instance, 847 host A and host B might communicate using both VoIP traffic and ftp 848 traffic, and those communications might benefit from using different 849 locator pairs. However, the basic Shim6 mechanism uses a single 850 current locator pair for each context, thus a single context cannot 851 accomplish this. 853 For this reason, the Shim6 protocol supports the notion of context 854 forking. This is a mechanism by which a ULP can specify (using some 855 API not yet defined) that a context for e.g., the ULID pair 856 should be forked into two contexts. In this case the forked-off 857 context will be assigned a non-zero Forked Instance Identifier, while 858 the default context has FII zero. 860 The Forked Instance Identifier (FII) is a 32-bit identifier which has 861 no semantics in the protocol other then being part of the tuple which 862 identifies the context. For example, a host might allocate FIIs as 863 sequential numbers for any given ULID pair. 865 No other special considerations are needed in the Shim6 protocol to 866 handle forked contexts. 868 Note that forking as specified does NOT allow A to be able to tell B 869 that certain traffic (a 5-tuple?) should be forked for the reverse 870 direction. The Shim6 forking mechanism as specified applies only to 871 the sending of ULP packets. If some ULP wants to fork for both 872 directions, it is up to the ULP to set this up, and then instruct the 873 shim at each end to transmit using the forked context. 875 4.3. API Extensions 877 Several API extensions have been discussed for Shim6, but their 878 actual specification is out of scope for this document. The simplest 879 one would be to add a socket option to be able to have traffic bypass 880 the shim (not create any state, and not use any state created by 881 other traffic). This could be an IPV6_DONTSHIM socket option. Such 882 an option would be useful for protocols, such as DNS, where the 883 application has its own failover mechanism (multiple NS records in 884 the case of DNS) and using the shim could potentially add extra 885 latency with no added benefits. 887 Some other API extensions are discussed in Appendix A 889 4.4. Securing Shim6 891 The mechanisms are secured using a combination of techniques: 893 o The HBA technique [4] for verifying the locators to prevent an 894 attacker from redirecting the packet stream to somewhere else. 896 o Requiring a Reachability Probe+Reply /defined in [5]) before a new 897 locator is used as the destination, in order to prevent 3rd party 898 flooding attacks. 900 o The first message does not create any state on the responder. 901 Essentially a 3-way exchange is required before the responder 902 creates any state. This means that a state-based DoS attack 903 (trying to use up all of memory on the responder) at least 904 provides an IPv6 address that the attacker was using. 906 o The context establishment messages use nonces to prevent replay 907 attacks, and to prevent off-path attackers from interfering with 908 the establishment. 910 o Every control message of the Shim6 protocol, past the context 911 establishment, carry the context tag assigned to the particular 912 context. This implies that an attacker needs to discover that 913 context tag before being able to spoof any Shim6 control message. 914 Such discovery probably requires any potential attacker to be 915 along the path in order to be sniff the context tag value. The 916 result is that through this technique, the Shim6 protocol is 917 protected against off-path attackers. 919 4.5. Overview of Shim Control Messages 921 The Shim6 context establishment is accomplished using four messages; 922 I1, R1, I2, R2. Normally they are sent in that order from initiator 923 and responder, respectively. Should both ends attempt to set up 924 context state at the same time (for the same ULID pair), then their 925 I1 messages might cross in flight, and result in an immediate R2 926 message. [The names of these messages are borrowed from HIP [19].] 928 R1bis and I2bis messages are defined, which are used to recover a 929 context after it has been lost. A R1bis message is sent when a Shim6 930 control or Payload extension header arrives and there is no matching 931 context state at the receiver. When such a message is received, it 932 will result in the re-creation of the Shim6 context using the I2bis 933 and R2 messages. 935 The peers' lists of locators are normally exchanged as part of the 936 context establishment exchange. But the set of locators might be 937 dynamic. For this reason there are Update Request and Update 938 Acknowledgement messages, and a Locator List option. 940 Even when the list of locators is fixed, a host might determine that 941 some preferences might have changed. For instance, it might 942 determine that there is a locally visible failure that implies that 943 some locator(s) are no longer usable. This uses a Locator 944 Preferences option in the Update Request message. 946 The mechanism for (un)reachability detection is called Forced 947 Bidirectional Communication (FBD). FBD uses a Keepalive message 948 which is sent when a host has received packets from its peer but has 949 not yet sent any packets from its ULP to the peer. The message type 950 is reserved in this document, but the message format and processing 951 rules are specified in [5]. 953 In addition, when the context is established and there is a 954 subsequent failure there needs to be a way to probe the set of 955 locator pairs to efficiently find a working pair. This document 956 reserves a Probe message type, with the packet format and processing 957 rules specified in [5]. 959 The above probe and keepalive messages assume we have an established 960 ULID-pair context. However, communication might fail during the 961 initial contact (that is, when the application or transport protocol 962 is trying to setup some communication). This is handled using the 963 mechanisms in the ULP to try different address pairs as specified in 964 [8] [9]. In the future versions of the protocol, and with a richer 965 API between the ULP and the shim, the shim might be help optimize 966 discovering a working locator pair during initial contact. This is 967 for further study. 969 4.6. Extension Header Order 971 Since the shim is placed between the IP endpoint sub-layer and the IP 972 routing sub-layer, the shim header will be placed before any endpoint 973 extension headers (fragmentation headers, destination options header, 974 AH, ESP), but after any routing related headers (hop-by-hop 975 extensions header, routing header, a destinations options header 976 which precedes a routing header). When tunneling is used, whether 977 IP-in-IP tunneling or the special form of tunneling that Mobile IPv6 978 uses (with Home Address Options and Routing header type 2), there is 979 a choice whether the shim applies inside the tunnel or outside the 980 tunnel, which affects the location of the Shim6 header. 982 In most cases IP-in-IP tunnels are used as a routing technique, thus 983 it makes sense to apply them on the locators which means that the 984 sender would insert the Shim6 header after any IP-in-IP 985 encapsulation; this is what occurs naturally when routers apply IP- 986 in-IP encapsulation. Thus the packets would have: 988 o Outer IP header 990 o Inner IP header 992 o Shim6 extension header (if needed) 994 o ULP 995 But the shim can also be used to create "shimmed tunnels" i.e., where 996 an IP-in-IP tunnel uses the shim to be able to switch the tunnel 997 endpoint addresses between different locators. In such a case the 998 packets would have: 1000 o Outer IP header 1002 o Shim6 extension header (if needed) 1004 o Inner IP header 1006 o ULP 1008 In any case, the receiver behavior is well-defined; a receiver 1009 processes the extension headers in order. However, the precise 1010 interaction between Mobile IPv6 and Shim6 is for further study, but 1011 it might make sense to have Mobile IPv6 operate on locators as well, 1012 meaning that the shim would be layered on top of the MIPv6 mechanism. 1014 5. Message Formats 1016 The Shim6 messages are all carried using a new IP protocol number [to 1017 be assigned by IANA]. The Shim6 messages have a common header, 1018 defined below, with some fixed fields, followed by type specific 1019 fields. 1021 The Shim6 messages are structured as an IPv6 extension header since 1022 the Payload extension header is used to carry the ULP packets after a 1023 locator switch. The Shim6 control messages use the same extension 1024 header formats so that a single "protocol number" needs to be allowed 1025 through firewalls in order for Shim6 to function across the firewall. 1027 5.1. Common Shim6 Message Format 1029 The first 17 bits of the Shim6 header is common for the Payload 1030 extension header and the control messages and looks as follows: 1032 0 1 1033 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 1034 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1035 | Next Header | Hdr Ext Len |P| 1036 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1038 Fields: 1040 Next Header: The payload which follows this header. 1042 Hdr Ext Len: 8-bit unsigned integer. Length of the Shim6 header in 1043 8-octet units, not including the first 8 octets. 1045 P: A single bit to distinguish Payload extension headers 1046 from control messages. 1048 Shim6 signalling packets may not be larger than 1280 bytes, including 1049 the IPv6 header and any intermediate headers between the IPv6 header 1050 and the Shim6 header. One way to meet this requirement is to omit 1051 part of the locator address information if with this information 1052 included, the packet would become larger than 1280 bytes. Another 1053 option is to perform option engineering, dividing into different 1054 Shim6 messages the information to be transmitted. An implementation 1055 may impose administrative restrictions to avoid excessively large 1056 Shim6 packets, such as a limitation on the number of locators to be 1057 used. 1059 5.2. Payload Extension Header Format 1061 The payload extension headers is used to carry ULP packets where the 1062 receiver must replace the content of the source and/or destination 1063 fields in the IPv6 header before passing the packet to the ULP. Thus 1064 this extension header is required when the locators pair that is used 1065 is not the same as the ULID pair. 1067 0 1 2 3 1068 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 1069 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1070 | Next Header | 0 |1| | 1071 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 1072 | Receiver Context Tag | 1073 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1075 Fields: 1077 Next Header: The payload which follows this header. 1079 Hdr Ext Len: 0 (since the header is 8 octets). 1081 P: Set to one. A single bit to distinguish this from the 1082 Shim6 control messages. 1084 Receiver Context Tag: 47-bit unsigned integer. Allocated by the 1085 receiver for use to identify the context. 1087 5.3. Common Shim6 Control header 1089 The common part of the header has a next header and header extension 1090 length field which is consistent with the other IPv6 extension 1091 headers, even if the next header value is always "NO NEXT HEADER" for 1092 the control messages. 1094 The Shim6 headers must be a multiple of 8 octets, hence the minimum 1095 size is 8 octets. 1097 The common shim control message header is as follows: 1099 0 1 2 3 1100 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 1101 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1102 | Next Header | Hdr Ext Len |P| Type |Type-specific|S| 1103 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1104 | Checksum | | 1105 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 1106 | Type-specific format | 1107 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1109 Fields: 1111 Next Header: 8-bit selector. Normally set to NO_NXT_HDR (59). 1113 Hdr Ext Len: 8-bit unsigned integer. Length of the Shim6 header in 1114 8-octet units, not including the first 8 octets. 1116 P: Set to zero. A single bit to distinguish this from 1117 the Shim6 payload extension header. 1119 Type: 7-bit unsigned integer. Identifies the actual message 1120 from the table below. Type codes 0-63 will not 1121 trigger R1bis messages on a missing context, while 64- 1122 127 will trigger R1bis. 1124 S: A single bit set to zero which allows Shim6 and HIP to 1125 have a common header format yet telling Shim6 and HIP 1126 messages apart. 1128 Checksum: 16-bit unsigned integer. The checksum is the 16-bit 1129 one's complement of the one's complement sum of the 1130 entire Shim6 header message starting with the Shim6 1131 next header field, and ending as indicated by the Hdr 1132 Ext Len. Thus when there is a payload following the 1133 Shim6 header, the payload is NOT included in the Shim6 1134 checksum. Note that unlike protocol like ICMPv6, 1135 there is no pseudo-header checksum part of the 1136 checksum, in order to provide locator agility without 1137 having to change the checksum. 1139 Type-specific: Part of message that is different for different 1140 message types. 1142 +------------+-----------------------------------------------------+ 1143 | Type Value | Message | 1144 +------------+-----------------------------------------------------+ 1145 | 1 | I1 (first establishment message from the initiator) | 1146 | | | 1147 | 2 | R1 (first establishment message from the responder) | 1148 | | | 1149 | 3 | I2 (2nd establishment message from the initiator) | 1150 | | | 1151 | 4 | R2 (2nd establishment message from the responder) | 1152 | | | 1153 | 5 | R1bis (Reply to reference to non-existent context) | 1154 | | | 1155 | 6 | I2bis (Reply to a R1bis message) | 1156 | | | 1157 | 64 | Update Request | 1158 | | | 1159 | 65 | Update Acknowledgement | 1160 | | | 1161 | 66 | Keepalive | 1162 | | | 1163 | 67 | Probe Message | 1164 | | | 1165 | 68 | Error Message | 1166 +------------+-----------------------------------------------------+ 1168 Table 1 1170 5.4. I1 Message Format 1172 The I1 message is the first message in the context establishment 1173 exchange. 1175 0 1 2 3 1176 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 1177 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1178 | 59 | Hdr Ext Len |0| Type = 1 | Reserved1 |0| 1179 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1180 | Checksum |R| | 1181 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 1182 | Initiator Context Tag | 1183 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1184 | Initiator Nonce | 1185 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1186 | | 1187 + Options + 1188 | | 1189 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1190 Fields: 1192 Next Header: NO_NXT_HDR (59). 1194 Hdr Ext Len: At least 1, since the header is 16 octets when there 1195 are no options. 1197 Type: 1 1199 Reserved1: 7-bit field. Reserved for future use. Zero on 1200 transmit. MUST be ignored on receipt. 1202 R: 1-bit field. Reserved for future use. Zero on 1203 transmit. MUST be ignored on receipt. 1205 Initiator Context Tag: 47-bit field. The Context Tag the initiator 1206 has allocated for the context. 1208 Initiator Nonce: 32-bit unsigned integer. A random number picked by 1209 the initiator which the responder will return in the 1210 R1 message. 1212 The following options are defined for this message: 1214 ULID pair: When the IPv6 source and destination addresses in the 1215 IPv6 header does not match the ULID pair, this option 1216 MUST be included. An example of this is when 1217 recovering from a lost context. 1219 Forked Instance Identifier: When another instance of an existent 1220 context with the same ULID pair is being created, a 1221 Forked Instance Identifier option MUST be included to 1222 distinguish this new instance from the existent one. 1224 Future protocol extensions might define additional options for this 1225 message. The C-bit in the option format defines how such a new 1226 option will be handled by an implementation. See Section 5.15. 1228 5.5. R1 Message Format 1230 The R1 message is the second message in the context establishment 1231 exchange. The responder sends this in response to an I1 message, 1232 without creating any state specific to the initiator. 1234 0 1 2 3 1235 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 1236 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1237 | 59 | Hdr Ext Len |0| Type = 2 | Reserved1 |0| 1238 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1239 | Checksum | Reserved2 | 1240 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1241 | Initiator Nonce | 1242 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1243 | Responder Nonce | 1244 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1245 | | 1246 + Options + 1247 | | 1248 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1250 Fields: 1252 Next Header: NO_NXT_HDR (59). 1254 Hdr Ext Len: At least 1, since the header is 16 octets when there 1255 are no options. 1257 Type: 2 1259 Reserved1: 7-bit field. Reserved for future use. Zero on 1260 transmit. MUST be ignored on receipt. 1262 Reserved2: 16-bit field. Reserved for future use. Zero on 1263 transmit. MUST be ignored on receipt. 1265 Initiator Nonce: 32-bit unsigned integer. Copied from the I1 1266 message. 1268 Responder Nonce: 32-bit unsigned integer. A number picked by the 1269 responder which the initiator will return in the I2 1270 message. 1272 The following options are defined for this message: 1274 Responder Validator: Variable length option. This option MUST be 1275 included in the R1 message. Typically it contains a 1276 hash generated by the responder, which the responder 1277 uses together with the Responder Nonce value to verify 1278 that an I2 message is indeed sent in response to a R1 1279 message, and that the parameters in the I2 message are 1280 the same as those in the I1 message. 1282 Future protocol extensions might define additional options for this 1283 message. The C-bit in the option format defines how such a new 1284 option will be handled by an implementation. See Section 5.15. 1286 5.6. I2 Message Format 1288 The I2 message is the third message in the context establishment 1289 exchange. The initiator sends this in response to a R1 message, 1290 after checking the Initiator Nonce, etc. 1292 0 1 2 3 1293 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 1294 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1295 | 59 | Hdr Ext Len |0| Type = 3 | Reserved1 |0| 1296 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1297 | Checksum |R| | 1298 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 1299 | Initiator Context Tag | 1300 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1301 | Initiator Nonce | 1302 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1303 | Responder Nonce | 1304 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1305 | Reserved2 | 1306 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1307 | | 1308 + Options + 1309 | | 1310 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1312 Fields: 1314 Next Header: NO_NXT_HDR (59). 1316 Hdr Ext Len: At least 2, since the header is 24 octets when there 1317 are no options. 1319 Type: 3 1321 Reserved1: 7-bit field. Reserved for future use. Zero on 1322 transmit. MUST be ignored on receipt. 1324 R: 1-bit field. Reserved for future use. Zero on 1325 transmit. MUST be ignored on receipt. 1327 Initiator Context Tag: 47-bit field. The Context Tag the initiator 1328 has allocated for the context. 1330 Initiator Nonce: 32-bit unsigned integer. A random number picked by 1331 the initiator which the responder will return in the 1332 R2 message. 1334 Responder Nonce: 32-bit unsigned integer. Copied from the R1 1335 message. 1337 Reserved2: 32-bit field. Reserved for future use. Zero on 1338 transmit. MUST be ignored on receipt. (Needed to 1339 make the options start on a multiple of 8 octet 1340 boundary.) 1342 The following options are defined for this message: 1344 Responder Validator: Variable length option. This option MUST be 1345 included in the I2 message and MUST be generated 1346 copying the Responder Validator option received in the 1347 R1 message. 1349 ULID pair: When the IPv6 source and destination addresses in the 1350 IPv6 header does not match the ULID pair, this option 1351 MUST be included. An example of this is when 1352 recovering from a lost context. 1354 Forked Instance Identifier: When another instance of an existent 1355 context with the same ULID pair is being created, a 1356 Forked Instance Identifier option MUST be included to 1357 distinguish this new instance from the existent one. 1359 Locator list: Optionally sent when the initiator immediately wants 1360 to tell the responder its list of locators. When it 1361 is sent, the necessary HBA/CGA information for 1362 verifying the locator list MUST also be included. 1364 Locator Preferences: Optionally sent when the locators don't all 1365 have equal preference. 1367 CGA Parameter Data Structure: This option MUST be included in the I2 1368 message when the locator list is included so the 1369 receiver can verify the locator list. 1371 CGA Signature: This option MUST be included in the I2 message when 1372 some of the locators in the list use CGA (and not HBA) 1373 for verification. 1375 Future protocol extensions might define additional options for this 1376 message. The C-bit in the option format defines how such a new 1377 option will be handled by an implementation. See Section 5.15. 1379 5.7. R2 Message Format 1381 The R2 message is the fourth message in the context establishment 1382 exchange. The responder sends this in response to an I2 message. 1383 The R2 message is also used when both hosts send I1 messages at the 1384 same time and the I1 messages cross in flight. 1386 0 1 2 3 1387 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 1388 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1389 | 59 | Hdr Ext Len |0| Type = 4 | Reserved1 |0| 1390 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1391 | Checksum |R| | 1392 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 1393 | Responder Context Tag | 1394 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1395 | Initiator Nonce | 1396 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1397 | | 1398 + Options + 1399 | | 1400 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1402 Fields: 1404 Next Header: NO_NXT_HDR (59). 1406 Hdr Ext Len: At least 1, since the header is 16 octets when there 1407 are no options. 1409 Type: 4 1411 Reserved1: 7-bit field. Reserved for future use. Zero on 1412 transmit. MUST be ignored on receipt. 1414 R: 1-bit field. Reserved for future use. Zero on 1415 transmit. MUST be ignored on receipt. 1417 Responder Context Tag: 47-bit field. The Context Tag the responder 1418 has allocated for the context. 1420 Initiator Nonce: 32-bit unsigned integer. Copied from the I2 1421 message. 1423 The following options are defined for this message: 1425 Locator List: Optionally sent when the responder immediately wants 1426 to tell the initiator its list of locators. When it 1427 is sent, the necessary HBA/CGA information for 1428 verifying the locator list MUST also be included. 1430 Locator Preferences: Optionally sent when the locators don't all 1431 have equal preference. 1433 CGA Parameter Data Structure: Included when the locator list is 1434 included so the receiver can verify the locator list. 1436 CGA Signature: Included when the some of the locators in the list use 1437 CGA (and not HBA) for verification. 1439 Future protocol extensions might define additional options for this 1440 message. The C-bit in the option format defines how such a new 1441 option will be handled by an implementation. See Section 5.15. 1443 5.8. R1bis Message Format 1445 Should a host receive a packet with a shim Payload extension header 1446 or Shim6 control message with type code 64-127 (such as an Update or 1447 Probe message), and the host does not have any context state for the 1448 received context tag, then it will generate a R1bis message. 1450 This message allows the sender of the packet referring to the non- 1451 existent context to re-establish the context with a reduced context 1452 establishment exchange. Upon the reception of the R1bis message, the 1453 receiver can proceed reestablishing the lost context by directly 1454 sending an I2bis message. 1456 0 1 2 3 1457 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 1458 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1459 | 59 | Hdr Ext Len |0| Type = 5 | Reserved1 |0| 1460 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1461 | Checksum |R| | 1462 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 1463 | Packet Context Tag | 1464 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1465 | Responder Nonce | 1466 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1467 | | 1468 + Options + 1469 | | 1470 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1472 Fields: 1474 Next Header: NO_NXT_HDR (59). 1476 Hdr Ext Len: At least 1, since the header is 16 octets when there 1477 are no options. 1479 Type: 5 1481 Reserved1: 7-bit field. Reserved for future use. Zero on 1482 transmit. MUST be ignored on receipt. 1484 R: 1-bit field. Reserved for future use. Zero on 1485 transmit. MUST be ignored on receipt. 1487 Packet Context Tag: 47-bit unsigned integer. The context tag 1488 contained in the received packet that triggered the 1489 generation of the R1bis message. 1491 Responder Nonce: 32-bit unsigned integer. A number picked by the 1492 responder which the initiator will return in the I2bis 1493 message. 1495 The following options are defined for this message: 1497 Responder Validator: Variable length option. Typically a hash 1498 generated by the responder, which the responder uses 1499 together with the Responder Nonce value to verify that 1500 an I2bis message is indeed sent in response to a R1bis 1501 message. 1503 Future protocol extensions might define additional options for this 1504 message. The C-bit in the option format defines how such a new 1505 option will be handled by an implementation. See Section 5.15. 1507 5.9. I2bis Message Format 1509 The I2bis message is the third message in the context recovery 1510 exchange. This is sent in response to a R1bis message, after 1511 checking that the R1bis message refers to an existing context, etc. 1513 0 1 2 3 1514 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 1515 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1516 | 59 | Hdr Ext Len |0| Type = 6 | Reserved1 |0| 1517 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1518 | Checksum |R| | 1519 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 1520 | Initiator Context Tag | 1521 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1522 | Initiator Nonce | 1523 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1524 | Responder Nonce | 1525 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1526 | Reserved2 | 1527 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1528 | | | 1529 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 1530 | Packet Context Tag | 1531 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1532 | | 1533 + Options + 1534 | | 1535 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1537 Fields: 1539 Next Header: NO_NXT_HDR (59). 1541 Hdr Ext Len: At least 3, since the header is 32 octets when there 1542 are no options. 1544 Type: 6 1546 Reserved1: 7-bit field. Reserved for future use. Zero on 1547 transmit. MUST be ignored on receipt. 1549 R: 1-bit field. Reserved for future use. Zero on 1550 transmit. MUST be ignored on receipt. 1552 Initiator Context Tag: 47-bit field. The Context Tag the initiator 1553 has allocated for the context. 1555 Initiator Nonce: 32-bit unsigned integer. A random number picked by 1556 the initiator which the responder will return in the 1557 R2 message. 1559 Responder Nonce: 32-bit unsigned integer. Copied from the R1bis 1560 message. 1562 Reserved2: 49-bit field. Reserved for future use. Zero on 1563 transmit. MUST be ignored on receipt. (Note that 17 1564 bits are not sufficient since the options need start 1565 on a multiple of 8 octet boundary.) 1567 Packet Context Tag: 47-bit unsigned integer. Copied from the Packet 1568 Context Tag contained in the received R1bis. 1570 The following options are defined for this message: 1572 Responder Validator: Variable length option. Just a copy of the 1573 Responder Validator option in the R1bis message. 1575 ULID pair: When the IPv6 source and destination addresses in the 1576 IPv6 header does not match the ULID pair, this option 1577 MUST be included. 1579 Forked Instance Identifier: When another instance of an existent 1580 context with the same ULID pair is being created, a 1581 Forked Instance Identifier option is included to 1582 distinguish this new instance from the existent one. 1584 Locator list: Optionally sent when the initiator immediately wants 1585 to tell the responder its list of locators. When it 1586 is sent, the necessary HBA/CGA information for 1587 verifying the locator list MUST also be included. 1589 Locator Preferences: Optionally sent when the locators don't all 1590 have equal preference. 1592 CGA Parameter Data Structure: Included when the locator list is 1593 included so the receiver can verify the locator list. 1595 CGA Signature: Included when the some of the locators in the list use 1596 CGA (and not HBA) for verification. 1598 Future protocol extensions might define additional options for this 1599 message. The C-bit in the option format defines how such a new 1600 option will be handled by an implementation. See Section 5.15. 1602 5.10. Update Request Message Format 1604 The Update Request Message is used to update either the list of 1605 locators, the locator preferences, and both. When the list of 1606 locators is updated, the message also contains the option(s) 1607 necessary for HBA/CGA to secure this. The basic sanity check that 1608 prevents off-path attackers from generating bogus updates is the 1609 context tag in the message. 1611 The update message contains options (the Locator List and the Locator 1612 Preferences) that, when included, completely replace the previous 1613 locator list and locator preferences, respectively. Thus there is no 1614 mechanism to just send deltas to the locator list. 1616 0 1 2 3 1617 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 1618 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1619 | 59 | Hdr Ext Len |0| Type = 64 | Reserved1 |0| 1620 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1621 | Checksum |R| | 1622 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 1623 | Receiver Context Tag | 1624 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1625 | Request Nonce | 1626 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1627 | | 1628 + Options + 1629 | | 1630 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1632 Fields: 1634 Next Header: NO_NXT_HDR (59). 1636 Hdr Ext Len: At least 1, since the header is 16 octets when there 1637 are no options. 1639 Type: 64 1640 Reserved1: 7-bit field. Reserved for future use. Zero on 1641 transmit. MUST be ignored on receipt. 1643 R: 1-bit field. Reserved for future use. Zero on 1644 transmit. MUST be ignored on receipt. 1646 Receiver Context Tag: 47-bit field. The Context Tag the receiver 1647 has allocated for the context. 1649 Request Nonce: 32-bit unsigned integer. A random number picked by 1650 the initiator which the peer will return in the 1651 acknowledgement message. 1653 The following options are defined for this message: 1655 Locator List: The list of the sender's (new) locators. The locators 1656 might be unchanged and only the preferences have 1657 changed. 1659 Locator Preferences: Optionally sent when the locators don't all 1660 have equal preference. 1662 CGA Parameter Data Structure (PDS): Included when the locator list 1663 is included and the PDS was not included in the I2/ 1664 I2bis/R2 messages, so the receiver can verify the 1665 locator list. 1667 CGA Signature: Included when the some of the locators in the list use 1668 CGA (and not HBA) for verification. 1670 Future protocol extensions might define additional options for this 1671 message. The C-bit in the option format defines how such a new 1672 option will be handled by an implementation. See Section 5.15. 1674 5.11. Update Acknowledgement Message Format 1676 This message is sent in response to a Update Request message. It 1677 implies that the Update Request has been received, and that any new 1678 locators in the Update Request can now be used as the source locators 1679 of packets. But it does not imply that the (new) locators have been 1680 verified to be used as a destination, since the host might defer the 1681 verification of a locator until it sees a need to use a locator as 1682 the destination. 1684 0 1 2 3 1685 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 1686 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1687 | 59 | Hdr Ext Len |0| Type = 65 | Reserved1 |0| 1688 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1689 | Checksum |R| | 1690 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 1691 | Receiver Context Tag | 1692 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1693 | Request Nonce | 1694 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1695 | | 1696 + Options + 1697 | | 1698 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1700 Fields: 1702 Next Header: NO_NXT_HDR (59). 1704 Hdr Ext Len: At least 1, since the header is 16 octets when there 1705 are no options. 1707 Type: 65 1709 Reserved1: 7-bit field. Reserved for future use. Zero on 1710 transmit. MUST be ignored on receipt. 1712 R: 1-bit field. Reserved for future use. Zero on 1713 transmit. MUST be ignored on receipt. 1715 Receiver Context Tag: 47-bit field. The Context Tag the receiver 1716 has allocated for the context. 1718 Request Nonce: 32-bit unsigned integer. Copied from the Update 1719 Request message. 1721 No options are currently defined for this message. 1723 Future protocol extensions might define additional options for this 1724 message. The C-bit in the option format defines how such a new 1725 option will be handled by an implementation. See Section 5.15. 1727 5.12. Keepalive Message Format 1729 This message format is defined in [5]. 1731 The message is used to ensure that when a peer is sending ULP packets 1732 on a context, it always receives some packets in the reverse 1733 direction. When the ULP is sending bidirectional traffic, no extra 1734 packets need to be inserted. But for a unidirectional ULP traffic 1735 pattern, the shim will send back some Keepalive messages when it is 1736 receiving ULP packets. 1738 5.13. Probe Message Format 1740 This message and its semantics are defined in [5]. 1742 The goal of this mechanism is to test whether locator pairs work or 1743 not in the general case. In particular, this mechanism is to be able 1744 to handle the case when one locator pair works in from A to B, and 1745 another locator pair works from B to A, but there is no locator pair 1746 which works in both directions. The protocol mechanism is that as A 1747 is sending probe messages to B, B will observe which locator pairs it 1748 has received from and report that back in probe messages it is 1749 sending to A. 1751 5.14. Error Message Format 1753 The Error Message is generated by a Shim6 receiver upon the reception 1754 of a Shim6 message containing critical information that cannot be 1755 processed properly. 1757 In the case that a Shim6 node receives a Shim6 packet which contains 1758 information that is critical for the Shim6 protocol that is not 1759 supported by the receiver, it sends an Error Message back to the 1760 originator of the Shim6 message. The Error Message is 1761 unacknowledged. 1763 In addition, Shim6 Error messages defined in this section can be used 1764 to identify problems with Shim6 implementations. In order to do 1765 that, a range of Error Code Types is reserved for that purpose. In 1766 particular, implementations may generate Shim6 Error messages with 1767 Code Type in that range instead of silently discarding Shim6 packets 1768 during the debugging process. 1770 0 1 2 3 1771 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 1772 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1773 | 59 | Hdr Ext Len |0| Type = 68 | Error Code |0| 1774 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1775 | Checksum | Pointer | 1776 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1777 | | 1778 + Packet in error + 1779 | | 1780 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1782 Fields: 1784 Next Header: NO_NXT_HDR (59). 1786 Hdr Ext Len: At least 1, since the header is 16 octets. Depends on 1787 the specific Error Data. 1789 Type: 68 1791 Error Code: 7-bit field describing the error that generated the 1792 Error Message. See Error Code list below 1794 Pointer: 16-bit field.Identifies the octet offset within the 1795 invoking packet where the error was detected. 1797 Packet in error: As much of invoking packet as possible without the 1798 Error message packet exceeding the minimum IPv6 MTU. 1800 The following Error Codes are defined: 1802 +---------+---------------------------------------------------------+ 1803 | Code | Description | 1804 | Value | | 1805 +---------+---------------------------------------------------------+ 1806 | 0 | Unknown Shim6 message type | 1807 | | | 1808 | 1 | Critical Option not recognized | 1809 | | | 1810 | 2 | Locator verification method failed (Pointer to the | 1811 | | inconsistent Verification method octet) | 1812 | | | 1813 | 3 | Locator List Generation number out of sync. | 1814 | | | 1815 | 4 | Error in the number of locators in a Locator Preference | 1816 | | option | 1817 | | | 1818 | 120-127 | Reserved for debugging pruposes | 1819 +---------+---------------------------------------------------------+ 1821 Table 2 1823 5.15. Option Formats 1825 The format of the options is a snapshot of the current HIP option 1826 format [19]. However, there is no intention to track any changes to 1827 the HIP option format, nor is there an intent to use the same name 1828 space for the option type values. But using the same format will 1829 hopefully make it easier to import HIP capabilities into Shim6 as 1830 extensions to Shim6, should this turn out to be useful. 1832 All of the TLV parameters have a length (including Type and Length 1833 fields) which is a multiple of 8 bytes. When needed, padding MUST be 1834 added to the end of the parameter so that the total length becomes a 1835 multiple of 8 bytes. This rule ensures proper alignment of data. If 1836 padding is added, the Length field MUST NOT include the padding. Any 1837 added padding bytes MUST be zeroed by the sender, and their values 1838 SHOULD NOT be checked by the receiver. 1840 Consequently, the Length field indicates the length of the Contents 1841 field (in bytes). The total length of the TLV parameter (including 1842 Type, Length, Contents, and Padding) is related to the Length field 1843 according to the following formula: 1845 Total Length = 11 + Length - (Length + 3) mod 8; 1847 The Total Length of the option is the smallest multiple of 8 bytes 1848 that allows for the 4 bytes of option header and the option itself. 1849 The amount of padding required can be calculated as follows: 1851 padding = 7 - ((Length + 3) mod 8) 1853 And: 1855 Total Length = 4 + Length + padding 1857 0 1 2 3 1858 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 1859 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1860 | Type |C| Length | 1861 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1862 ~ ~ 1863 ~ Contents ~ 1864 ~ +-+-+-+-+-+-+-+-+ 1865 ~ | Padding | 1866 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1868 Fields: 1870 Type: 15-bit identifier of the type of option. The options 1871 defined in this document are below. 1873 C: Critical. One if this parameter is critical, and MUST 1874 be recognized by the recipient, zero otherwise. An 1875 implementation might view the C bit as part of the 1876 Type field, by multiplying the type values in this 1877 specification by two. 1879 Length: Length of the Contents, in bytes. 1881 Contents: Parameter specific, defined by Type. 1883 Padding: Padding, 0-7 bytes, added if needed. 1885 +------+------------------------------+ 1886 | Type | Option Name | 1887 +------+------------------------------+ 1888 | 1 | Responder Validator | 1889 | | | 1890 | 2 | Locator List | 1891 | | | 1892 | 3 | Locator Preferences | 1893 | | | 1894 | 4 | CGA Parameter Data Structure | 1895 | | | 1896 | 5 | CGA Signature | 1897 | | | 1898 | 6 | ULID Pair | 1899 | | | 1900 | 7 | Forked Instance Identifier | 1901 | | | 1902 | 10 | Keepalive Timeout Option | 1903 +------+------------------------------+ 1905 Table 3 1907 Future protocol extensions might define additional options for the 1908 Shim6 messages. The C-bit in the option format defines how such a 1909 new option will be handled by an implementation. 1911 If a host receives an option that it does not understand (an option 1912 that was defined in some future extension to this protocol) or is not 1913 listed as a valid option for the different message types above, then 1914 the Critical bit in the option determines the outcome. 1916 o If C=0 then the option is silently ignored, and the rest of the 1917 message is processed. 1919 o If C=1 then the host SHOULD send back a Shim6 Error Message with 1920 Error Code=1, with the Pointer referencing the first octet in the 1921 Option Type field. When C=1 the rest of the message MUST NOT be 1922 processed. 1924 5.15.1. Responder Validator Option Format 1926 The responder can choose exactly what input is used to compute the 1927 validator, and what one-way function (such as MD5, SHA1) it uses, as 1928 long as the responder can check that the validator it receives back 1929 in the I2 or I2bis message is indeed one that: 1931 1)- it computed, 1933 2)- it computed for the particular context, and 1935 3)- that it isn't a replayed I2/I2bis message. 1937 Some suggestions on how to generate the validators are captured in 1938 Section 7.10.1 and Section 7.17.1. 1940 0 1 2 3 1941 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 1942 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1943 | Type = 1 |0| Length | 1944 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1945 ~ Validator ~ 1946 ~ +-+-+-+-+-+-+-+-+ 1947 ~ | Padding | 1948 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1950 Fields: 1952 Validator: Variable length content whose interpretation is local 1953 to the responder. 1955 Padding: Padding, 0-7 bytes, added if needed. See 1956 Section 5.15. 1958 5.15.2. Locator List Option Format 1960 The Locator List Option is used to carry all the locators of the 1961 sender. Note that the order of the locators is important, since the 1962 Locator Preferences refers to the locators by using the index in the 1963 list. 1965 Note that we carry all the locators in this option even though some 1966 of them can be created automatically from the CGA Parameter Data 1967 Structure. 1969 0 1 2 3 1970 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 1971 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1972 | Type = 2 |0| Length | 1973 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1974 | Locator List Generation | 1975 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1976 | Num Locators | N Octets of Verification Method | 1977 +-+-+-+-+-+-+-+-+ | 1978 ~ ~ 1979 ~ +-+-+-+-+-+-+-+-+ 1980 ~ | Padding | 1981 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1982 ~ Locators 1 through N ~ 1983 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1985 Fields: 1987 Locator List Generation: 32-bit unsigned integer. Indicates a 1988 generation number which is increased by one for each 1989 new locator list. This is used to ensure that the 1990 index in the Locator Preferences refer to the right 1991 version of the locator list. 1993 Num Locators: 8-bit unsigned integer. The number of locators that 1994 are included in the option. We call this number "N" 1995 below. 1997 Verification Method: N octets. The i'th octet specifies the 1998 verification method for the i'th locator. 2000 Padding: Padding, 0-7 bytes, added if needed so that the 2001 Locators start on a multiple of 8 octet boundary. 2002 NOTE that for this option there is never a need to pad 2003 at the end, since the locators are a multiple of 8 2004 octets in length. This internal padding is included 2005 in the length field. 2007 Locators: N 128-bit locators. 2009 The defined verification methods are: 2011 +-------+----------+ 2012 | Value | Method | 2013 +-------+----------+ 2014 | 0 | Reserved | 2015 | | | 2016 | 1 | HBA | 2017 | | | 2018 | 2 | CGA | 2019 | | | 2020 | 3-255 | Reserved | 2021 +-------+----------+ 2023 Table 4 2025 5.15.3. Locator Preferences Option Format 2027 The Locator Preferences option can have some flags to indicate 2028 whether or not a locator is known to work. In addition, the sender 2029 can include a notion of preferences. It might make sense to define 2030 "preferences" as a combination of priority and weight the same way 2031 that DNS SRV records has such information. The priority would 2032 provide a way to rank the locators, and within a given priority, the 2033 weight would provide a way to do some load sharing. See [6] for how 2034 SRV defines the interaction of priority and weight. 2036 The minimum notion of preferences we need is to be able to indicate 2037 that a locator is "dead". We can handle this using a single octet 2038 flag for each locator. 2040 We can extend that by carrying a larger "element" for each locator. 2041 This document presently also defines 2-octet and 3-octet elements, 2042 and we can add more information by having even larger elements if 2043 need be. 2045 The locators are not included in the preference list. Instead, the 2046 first element refers to locator that was in the first element in the 2047 Locator List option. The generation number carried in this option 2048 and the Locator List option is used to verify that they refer to the 2049 same version of the locator list. 2051 0 1 2 3 2052 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 2053 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2054 | Type = 3 |0| Length | 2055 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2056 | Locator List Generation | 2057 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2058 | Element Len | Element[1] | Element[2] | Element[3] | 2059 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2060 ~ ... ~ 2061 ~ +-+-+-+-+-+-+-+-+ 2062 ~ | Padding | 2063 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2065 Case of Element Len = 1 is depicted. 2067 Fields: 2069 Locator List Generation: 32-bit unsigned integer. Indicates a 2070 generation number for the locator list to which the 2071 elements should apply. 2073 Element Len: 8-bit unsigned integer. The length in octets of each 2074 element. This specification defines the cases when 2075 the length is 1, 2, or 3. 2077 Element[i]: A field with a number of octets defined by the Element 2078 Len field. Provides preferences for the i'th locator 2079 in the Locator List option that is in use. 2081 Padding: Padding, 0-7 bytes, added if needed. See 2082 Section 5.15. 2084 When the Element length equals one, then the element consists of only 2085 a one octet flags field. The currently defined set of flags are: 2087 BROKEN: 0x01 2089 TRANSIENT: 0x02 2091 The intent of the BROKEN flag is to inform the peer that a given 2092 locator is known to be not working. The intent of TRANSIENT is to 2093 allow the distinction between more stable addresses and less stable 2094 addresses when Shim6 is combined with IP mobility, when we might have 2095 more stable home locators, and less stable care-of-locators. 2097 When the Element length equals two, then the element consists of a 1 2098 octet flags field followed by a 1 octet priority field. The priority 2099 has the same semantics as the priority in DNS SRV records. 2101 When the Element length equals three, then the element consists of a 2102 1 octet flags field followed by a 1 octet priority field, and a 1 2103 octet weight field. The weight has the same semantics as the weight 2104 in DNS SRV records. 2106 This document doesn't specify the format when the Element length is 2107 more than three, except that any such formats MUST be defined so that 2108 the first three octets are the same as in the above case, that is, a 2109 of a 1 octet flags field followed by a 1 octet priority field, and a 2110 1 octet weight field. 2112 5.15.4. CGA Parameter Data Structure Option Format 2114 This option contains the CGA Parameter Data Structure (PDS). When 2115 HBA is used to verify the locators, the PDS contains the HBA 2116 multiprefix extension in addition to the PDS mandatory fields and 2117 other extensions unrelated to Shim6 that the PDS might have. When 2118 CGA is used to verify the locators, in addition to the PDS option, 2119 the host also needs to include the signature in the form of a CGA 2120 Signature option. 2122 0 1 2 3 2123 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 2124 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2125 | Type = 4 |0| Length | 2126 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2127 ~ CGA Parameter Data Structure ~ 2128 ~ +-+-+-+-+-+-+-+-+ 2129 ~ | Padding | 2130 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2132 Fields: 2134 CGA Parameter Data Structure: Variable length content. Content 2135 defined in [2] and [4]. 2137 Padding: Padding, 0-7 bytes, added if needed. See 2138 Section 5.15. 2140 5.15.5. CGA Signature Option Format 2142 When CGA is used for verification of one or more of the locators in 2143 the Locator List option, then the message in question will need to 2144 contain this option. 2146 0 1 2 3 2147 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 2148 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2149 | Type = 5 |0| Length | 2150 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2151 ~ CGA Signature ~ 2152 ~ +-+-+-+-+-+-+-+-+ 2153 ~ | Padding | 2154 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2156 Fields: 2158 CGA Signature: A variable-length field containing a PKCS#1 v1.5 2159 signature, constructed by using the sender's private 2160 key over the following sequence of octets: 2162 1. The 128-bit CGA Message Type tag [CGA] value for 2163 Shim6, 0x4A 30 5662 4858 574B 3655 416F 506A 6D48. 2164 (The tag value has been generated randomly by the 2165 editor of this specification.). 2167 2. The Locator List Generation value of the 2168 correspondent Locator List Option. 2170 3. The subset of locators included in the 2171 correspondent Locator List Option which 2172 verification method is set to CGA. The locators 2173 MUST be included in the order they are listed in 2174 the Locator List Option. 2176 Padding: Padding, 0-7 bytes, added if needed. See 2177 Section 5.15. 2179 5.15.6. ULID Pair Option Format 2181 I1, I2, and I2bis messages MUST contain the ULID pair; normally this 2182 is in the IPv6 source and destination fields. In case that the ULID 2183 for the context differ from the address pair included in the source 2184 and destination address fields of the IPv6 packet used to carry the 2185 I1/I2/I2bis message, the ULID pair option MUST be included in the I1/ 2186 I2/I2bis message. 2188 0 1 2 3 2189 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 2190 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2191 | Type = 6 |0| Length = 36 | 2192 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2193 | Reserved2 | 2194 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2195 | | 2196 + Sender ULID + 2197 | | 2198 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2199 | | 2200 + Receiver ULID + 2201 | | 2202 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2204 Fields: 2206 Reserved2: 32-bit field. Reserved for future use. Zero on 2207 transmit. MUST be ignored on receipt. (Needed to 2208 make the ULIDs start on a multiple of 8 octet 2209 boundary.) 2211 Sender ULID: A 128-bit IPv6 address. 2213 Receiver ULID: A 128-bit IPv6 address. 2215 5.15.7. Forked Instance Identifier Option Format 2217 0 1 2 3 2218 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 2219 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2220 | Type = 7 |0| Length = 4 | 2221 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2222 | Forked Instance Identifier | 2223 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2225 Fields: 2227 Forked Instance Identifier: 32-bit field containing the identifier 2228 of the particular forked instance. 2230 5.15.8. Keepalive Timeout Option Format 2232 This option is defined in [5]. 2234 6. Conceptual Model of a Host 2236 This section describes a conceptual model of one possible data 2237 structure organization that hosts will maintain for the purposes of 2238 Shim6. The described organization is provided to facilitate the 2239 explanation of how the Shim6 protocol should behave. This document 2240 does not mandate that implementations adhere to this model as long as 2241 their external behavior is consistent with that described in this 2242 document. 2244 6.1. Conceptual Data Structures 2246 The key conceptual data structure for the Shim6 protocol is the ULID 2247 pair context. This is a data structure which contains the following 2248 information: 2250 o The state of the context. See Section 6.2. 2252 o The peer ULID; ULID(peer) 2254 o The local ULID; ULID(local) 2256 o The Forked Instance Identifier; FII. This is zero for the default 2257 context i.e., when there is no forking. 2259 o The list of peer locators, with their preferences; Ls(peer) 2261 o The generation number for the most recently received, verified 2262 peer locator list. 2264 o For each peer locator, the verification method to use (from the 2265 Locator List option). 2267 o For each peer locator, a flag whether it has been verified using 2268 HBA or CGA, and a bit whether the locator has been probed to 2269 verify that the ULID is present at that location. 2271 o The current peer locator, is the locator used as destination 2272 address when sending packets; Lp(peer) 2274 o The set of local locators and the preferences; Ls(local) 2276 o The generation number for the most recently sent Locator List 2277 option. 2279 o The current local locator, is the locator used as source address 2280 when sending packets; Lp(local) 2282 o The context tag used to transmit control messages and payload 2283 extension headers - allocated by the peer; CT(peer) 2285 o The context to expect in received control messages and payload 2286 extension headers - allocated by the local host; CT(local) 2288 o Timers for retransmission of the messages during context 2289 establishment and update messages. 2291 o Depending how an implementation determines whether a context is 2292 still in use, there might be a need to track the last time a 2293 packet was sent/received using the context. 2295 o Reachability state for the locator pairs as specified in [5]. 2297 o During pair exploration, information about the probe messages that 2298 have been sent and received as specified in [5]. 2300 o During context establishment phase, Init Nonce, Responder Nonce, 2301 Responder Validator and timers related to the different packets 2302 sent (I1,I2, R2), as described in Section 7 2304 6.2. Context States 2306 The states that are used to describe the Shim6 protocol are as 2307 follows: 2309 +---------------------+---------------------------------------------+ 2310 | State | Explanation | 2311 +---------------------+---------------------------------------------+ 2312 | IDLE | State machine start | 2313 | | | 2314 | I1-SENT | Initiating context establishment exchange | 2315 | | | 2316 | I2-SENT | Waiting to complete context establishment | 2317 | | exchange | 2318 | | | 2319 | I2BIS-SENT | Potential context loss detected | 2320 | | | 2321 | | | 2322 | ESTABLISHED | SHIM context established | 2323 | | | 2324 | E-FAILED | Context establishment exchange failed | 2325 | | | 2326 | NO-SUPPORT | ICMP Unrecognized Next Header type | 2327 | | (type 4, code 1) received indicating | 2328 | | that Shim6 is not supported | 2329 +---------------------+---------------------------------------------+ 2330 In addition, in each of the aforementioned states, the following 2331 state information is stored: 2333 +---------------------+---------------------------------------------+ 2334 | State | Information | 2335 +---------------------+---------------------------------------------+ 2336 | IDLE | None | 2337 | | | 2338 | I1-SENT | ULID(peer), ULID(local), [FII], CT(local), | 2339 | | INIT nonce, Lp(local), Lp(peer), Ls(local) | 2340 | | | 2341 | I2-SENT | ULID(peer), ULID(local), [FII], CT(local), | 2342 | | INIT nonce, RESP nonce, Lp(local), Lp(peer),| 2343 | | Ls(local), Responder Validator | 2344 | | | 2345 | ESTABLISHED | ULID(peer), ULID(local), [FII], CT(local), | 2346 | | CT(peer), Lp(local), Lp(peer), Ls(local) | 2347 | | Ls(peer), INIT nonce?(to receive late R2) | 2348 | | | 2349 | I2BIS-SENT | ULID(peer), ULID(local), [FII], CT(local), | 2350 | | CT(peer), Lp(local), Lp(peer), Ls(local) | 2351 | | Ls(peer), CT(R1bis), RESP nonce, | 2352 | | INIT nonce, Responder validator | 2353 | | | 2354 | E-FAILED | ULID(peer), ULID(local) | 2355 | | | 2356 | NO-SUPPORT | ULID(peer), ULID(local) | 2357 +---------------------+---------------------------------------------+ 2359 7. Establishing ULID-Pair Contexts 2361 ULID-pair contexts are established using a 4-way exchange, which 2362 allows the responder to avoid creating state on the first packet. As 2363 part of this exchange each end allocates a context tag, and it shares 2364 this context tag and its set of locators with the peer. 2366 In some cases the 4-way exchange is not necessary, for instance when 2367 both ends try to setup the context at the same time, or when 2368 recovering from a context that has been garbage collected or lost at 2369 one of the hosts. 2371 7.1. Uniqueness of Context Tags 2373 As part of establishing a new context, each host has to assign a 2374 unique context tag. Since the Payload Extension headers are 2375 demultiplexed based solely on the context tag value (without using 2376 the locators), the context tag MUST be unique for each context. 2378 It is important that context tags are hard to guess for off-path 2379 attackers. Therefore, if an implementation uses structure in the 2380 context tag to facilitate efficient lookups, at least 30 bits of the 2381 context tag MUST be unstructured and populated by random or pseudo- 2382 random bits. 2384 In addition, in order to minimize the reuse of context tags, the host 2385 SHOULD randomly cycle through the unstrucutred tag name space 2386 reserved for randomly assigned context tag values,(e.g. following the 2387 guidelines described in [13]). 2389 7.2. Locator Verification 2391 The peer's locators might need to be verified during context 2392 establishment as well as when handling locator updates in Section 10. 2394 There are two separate aspects of locator verification. One is to 2395 verify that the locator is tied to the ULID, i.e., that the host 2396 which "owns" the ULID is also the one that is claiming the locator 2397 "ownership". The Shim6 protocol uses the HBA or CGA techniques for 2398 doing this verification. The other is to verify that the host is 2399 indeed reachable at the claimed locator. Such verification is needed 2400 both to make sure communication can proceed, but also to prevent 3rd 2401 party flooding attacks [15]. These different verifications happen at 2402 different times, since the first might need to be performed before 2403 packets can be received by the peer with the source locator in 2404 question, but the latter verification is only needed before packets 2405 are sent to the locator. 2407 Before a host can use a locator (different than the ULID) as the 2408 source locator, it must know that the peer will accept packets with 2409 that source locator as being part of this context. Thus the HBA/CGA 2410 verification SHOULD be performed by the host before the host 2411 acknowledges the new locator, by sending an Update Acknowledgement 2412 message, or an R2 message. 2414 Before a host can use a locator (different than the ULID) as the 2415 destination locator it MUST perform the HBA/CGA verification if this 2416 was not performed before upon the reception of the locator set. In 2417 addition, it MUST verify that the ULID is indeed present at that 2418 locator. This verification is performed by doing a return- 2419 routability test as part of the Probe sub-protocol [5]. 2421 If the verification method in the Locator List option is not 2422 supported by the host, or if the verification method is not 2423 consistent with the CGA Parameter Data Structure (e.g., the Parameter 2424 Data Structure doesn't contain the multiprefix extension, and the 2425 verification method says to use HBA), then the host MUST ignore the 2426 Locator List and the message in which it is contained, and the host 2427 SHOULD generate a Shim6 Error Message with Error Code=2, with the 2428 Pointer referencing the octet in the Verification method that was 2429 found inconsistent. 2431 7.3. Normal context establishment 2433 The normal context establishment consists of a 4 message exchange in 2434 the order of I1, R1, I2, R2 as can be seen in Figure 25. 2436 Initiator Responder 2438 IDLE IDLE 2439 ------------- I1 --------------> 2440 I1-SENT 2441 <------------ R1 --------------- 2442 IDLE 2443 ------------- I2 --------------> 2444 I2-SENT 2445 <------------ R2 --------------- 2446 ESTABLISHED ESTABLISHED 2448 Figure 25: Normal context establishment 2450 7.4. Concurrent context establishment 2452 When both ends try to initiate a context for the same ULID pair, then 2453 we might end up with crossing I1 messages. Alternatively, since no 2454 state is created when receiving the I1, a host might send a I1 after 2455 having sent a R1 message. 2457 Since a host remembers that it has sent an I1, it can respond to an 2458 I1 from the peer (for the same ULID-pair), with a R2, resulting in 2459 the message exchange shown in Figure 26. Such behavior is needed for 2460 other reasons such as to correctly respond to retransmitted I1 2461 messages, which occur when the R2 message has been lost. 2463 Host A Host B 2465 IDLE IDLE 2466 -\ 2467 I1-SENT---\ 2468 ---\ /--- 2469 --- I1 ---\ /--- I1-SENT 2470 ---\ 2471 /--- I1 ---/ ---\ 2472 /--- --> 2473 <--- 2475 -\ 2476 I1-SENT---\ 2477 ---\ /--- 2478 --- R2 ---\ /--- I1-SENT 2479 ---\ 2480 /--- R2 ---/ ---\ 2481 /--- --> 2482 <--- ESTABLISHED 2483 ESTABLISHED 2485 Figure 26: Crossing I1 messages 2487 If a host has received an I1 and sent an R1, it has no state to 2488 remember this. Thus if the ULP on the host sends down packets, this 2489 might trigger the host to send an I1 message itself. Thus while one 2490 end is sending an I1 the other is sending an I2 as can be seen in 2491 Figure 27. 2493 Host A Host B 2495 IDLE IDLE 2496 -\ 2497 ---\ 2498 I1-SENT ---\ 2499 --- I1 ---\ 2500 ---\ 2501 ---\ 2502 --> 2504 /--- 2505 /--- IDLE 2506 --- 2507 /--- R1--/ 2508 /--- 2509 <--- 2511 -\ 2512 I2-SENT---\ 2513 ---\ /--- 2514 --- I2---\ /--- I1-SENT 2515 ---\ 2516 /--- I1 ---/ ---\ 2517 /--- --> 2518 <--- ESTABLISHED 2520 -\ 2521 I2-SENT---\ 2522 ---\ /--- 2523 --- R2 ---\ /--- 2524 ---\ 2525 /--- R2 ---/ ---\ 2526 /--- --> 2527 <--- ESTABLISHED 2528 ESTABLISHED 2530 Figure 27: Crossing I2 and I1 2532 7.5. Context recovery 2534 Due to garbage collection, we can end up with one end having and 2535 using the context state, and the other end not having any state. We 2536 need to be able to recover this state at the end that has lost it, 2537 before we can use it. 2539 This need can arise in the following cases: 2541 o The communication is working using the ULID pair as the locator 2542 pair, but a problem arises, and the end that has retained the 2543 context state decides to probe alternate locator pairs. 2545 o The communication is working using a locator pair that is not the 2546 ULID pair, hence the ULP packets sent from a peer that has 2547 retained the context state use the Shim6 Payload extension header. 2549 o The host that retained the state sends a control message (e.g. an 2550 Update Request message). 2552 In all the cases the result is that the peer without state receives a 2553 shim message for which it has no context for the context tag. 2555 In all of those cases we can recover the context by having the node 2556 which doesn't have a context state, send back an R1bis message, and 2557 have then complete the recovery with a I2bis and R2 message as can be 2558 seen in Figure 28. 2560 Host A Host B 2562 Context for 2563 CT(peer)=X Discards context for 2564 CT(local)=X 2566 ESTABLISHED IDLE 2568 ---- payload, probe, etc. -----> No context state 2569 for CT(local)=X 2571 <------------ R1bis ------------ 2572 IDLE 2574 ------------- I2bis -----------> 2575 I2BIS_SENT 2576 <------------ R2 --------------- 2577 ESTABLISHED ESTABLISHED 2579 Figure 28: Context loss at receiver 2581 If one end has garbage collected or lost the context state, it might 2582 try to create a new context state (for the same ULID pair), by 2583 sending an I1 message. The peer (that still has the context state) 2584 will reply with an R1 message and the full 4-way exchange will be 2585 performed again in this case as can be seen in Figure 29. 2587 Host A Host B 2589 Context for 2590 CT(peer)=X Discards context for 2591 ULIDs A1, B1 CT(local)=X 2593 ESTABLISHED IDLE 2595 Finds <------------ I1 --------------- Tries to setup 2596 existing for ULIDs A1, B1 2597 context, 2598 but CT(peer) I1-SENT 2599 doesn't match 2600 ------------- R1 ---------------> 2601 Left old context 2602 in ESTABLISHED 2604 <------------ I2 --------------- 2605 Recreate context 2607 with new CT(peer) I2-SENT 2608 and Ls(peer). 2610 ESTABLISHED 2611 ------------- R2 --------------> 2612 ESTABLISHED ESTABLISHED 2614 Figure 29: Context loss at sender 2616 7.6. Context confusion 2618 Since each end might garbage collect the context state we can have 2619 the case when one end has retained the context state and tries to use 2620 it, while the other end has lost the state. We discussed this in the 2621 previous section on recovery. But for the same reasons, when one 2622 host retains context tag X as CT(peer) for ULID pair , the 2623 other end might end up allocating that context tag as CT(local) for 2624 another ULID pair, e.g., between the same hosts. In this 2625 case we can not use the recovery mechanisms since there need to be 2626 separate context tags for the two ULID pairs. 2628 This type of "confusion" can be observed in two cases (assuming it is 2629 A that has retained the state and B has dropped it): 2631 o B decides to create a context for ULID pair , and 2632 allocates X as its context tag for this, and sends an I1 to A. 2634 o A decides to create a context for ULID pair , and starts 2635 the exchange by sending I1 to B. When B receives the I2 message, 2636 it allocates X as the context tag for this context. 2638 In both cases, A can detect that B has allocated X for ULID pair even though that A still X as CT(peer) for ULID pair . 2640 Thus A can detect that B must have lost the context for . 2642 The confusion can be detected when I2/I2bis/R2 is received since we 2643 require that those messages MUST include a sufficiently large set of 2644 locators in a Locator List option that the peer can determine whether 2645 or not two contexts have the same host as the peer by comparing if 2646 there is any common locators in Ls(peer). 2648 The requirement is that the old context which used the context tag 2649 MUST be removed; it can no longer be used to send packets. Thus A 2650 would forcibly remove the context state for , so that it 2651 can accept the new context for . An implementation MAY 2652 re-create a context to replace the one that was removed; in this case 2653 for . The normal I1, R1, I2, R2 establishment exchange would 2654 then pick unique context tags for that replacement context. This re- 2655 creation is OPTIONAL, but might be useful when there is ULP 2656 communication which is using the ULID pair whose context was removed. 2658 Note that an I1 message with a duplicate context tag should not cause 2659 the removal of the old context state; this operation needs to be 2660 deferred until the reception of the I2 message. 2662 7.7. Sending I1 messages 2664 When the shim layer decides to setup a context for a ULID pair, it 2665 starts by allocating and initializing the context state for its end. 2666 As part of this it assigns a random context tag to the context that 2667 is not being used as CT(local) by any other context . In the case 2668 that a new API is used and the ULP requests a forked context, the 2669 Forked Instance Identifier value will be set to a non-zero value. 2670 Otherwise, the FII value is zero. Then the initiator can send an I1 2671 message and set the context state to I1-SENT. The I1 message MUST 2672 include the ULID pair; normally in the IPv6 source and destination 2673 fields. But if the ULID pair for the context is not used as locator 2674 pair for the I1 message, then a ULID option MUST be included in the 2675 I1 message. In addition, if a Forked Instance Identifier value is 2676 non-zero, the I1 message MUST include a Context Instance Identifier 2677 option containing the correspondent value. 2679 7.8. Retransmitting I1 messages 2681 If the host does not receive an I2 or R2 message in response to the 2682 I1 message after I1_TIMEOUT time, then it needs to retransmit the I1 2683 message. The retransmissions should use a retransmission timer with 2684 binary exponential backoff to avoid creating congestion issues for 2685 the network when lots of hosts perform I1 retransmissions. Also, the 2686 actual timeout value should be randomized between 0.5 and 1.5 of the 2687 nominal value to avoid self-synchronization. 2689 If, after I1_RETRIES_MAX retransmissions, there is no response, then 2690 most likely the peer does not implement the Shim6 protocol, or there 2691 could be a firewall that blocks the protocol. In this case it makes 2692 sense for the host to remember to not try again to establish a 2693 context with that ULID. However, any such negative caching should 2694 retained for at most NO_R1_HOLDDOWN_TIME, to be able to later setup a 2695 context should the problem have been that the host was not reachable 2696 at all when the shim tried to establish the context. 2698 If the host receives an ICMP error with "Unrecognized Next Header" 2699 type (type 4, code 1) and the included packet is the I1 message it 2700 just sent, then this is a more reliable indication that the peer ULID 2701 does not implement Shim6. Again, in this case, the host should 2702 remember to not try again to establish a context with that ULID. 2703 Such negative caching should retained for at most ICMP_HOLDDOWN_TIME, 2704 which should be significantly longer than the previous case. 2706 7.9. Receiving I1 messages 2708 A host MUST silently discard any received I1 messages that do not 2709 satisfy all of the following validity checks in addition to those 2710 specified in Section 12.3: 2712 o The Hdr Ext Len field is at least 1, i.e., the length is at least 2713 16 octets. 2715 Upon the reception of an I1 message, the host extracts the ULID pair 2716 and the Forked Instance Identifier from the message. If there is no 2717 ULID-pair option, then the ULID pair is taken from the source and 2718 destination fields in the IPv6 header. If there is no FII option in 2719 the message, then the FII value is taken to be zero. 2721 Next the host looks for an existing context which matches the ULID 2722 pair and the FII. 2724 If no state is found (i.e., the state is IDLE), then the host replies 2725 with a R1 message as specified below. 2727 If such a context exists in ESTABLISHED state, the host verifies that 2728 the locator of the Initiator is included in Ls(peer) (This check is 2729 unnecessary if there is no ULID-pair option in the I1 message). 2731 If the state exists in ESTABLISHED state and the locators do not fall 2732 in the locator sets, then the host replies with a R1 message as 2733 specified below. This completes the I1 processing, with the context 2734 state being unchanged. 2736 If the state exists in ESTABLISHED state and the locators do fall in 2737 the sets, then the host compares CT(peer) for the context with the CT 2738 contained in the I1 message. 2740 o If the context tags match, then this probably means that the R2 2741 message was lost and this I1 is a retransmission. In this case, 2742 the host replies with a R2 message containing the information 2743 available for the existent context. 2745 o If the context tags do not match, then it probably means that the 2746 Initiator has lost the context information for this context and it 2747 is trying to establish a new one for the same ULID-pair. In this 2748 case, the host replies with a R1 message as specified below. This 2749 completes the I1 processing, with the context state being 2750 unchanged. 2752 If the state exists in other state (I1-SENT, I2-SENT, I2BIS-SENT), we 2753 are in the situation of Concurrent context establishment described in 2754 Section 7.4. In this case, the host leaves CT(peer) unchanged, and 2755 replies with a R2 message. This completes the I1 processing, with 2756 the context state being unchanged. 2758 7.10. Sending R1 messages 2760 When the host needs to send a R1 message in response to the I1 2761 message, it copies the Initiator Nonce from the I1 message to the R1 2762 message, generates a Responder Nonce and calculates a Responder 2763 Validator option as suggested in the following section. No state is 2764 created on the host in this case.(Note that the information used to 2765 generate the R1 reply message is either contained in the received I1 2766 message or it is global information that is not associated with the 2767 particular requested context (the S and the Responder nonce values)). 2769 When the host needs to send a R2 message in response to the I1 2770 message, it copies the Initiator Nonce from the I1 message to the R2 2771 message, and otherwise follows the normal rules for forming an R2 2772 message (see Section 7.14). 2774 7.10.1. Generating the R1 Validator 2776 One way for the responder to properly generate validators is to 2777 maintain a single secret (S) and a running counter (C) for the 2778 Responder Nonce that is incremented in fixed periods of time (this 2779 allows the Responder to verify the age of a Responder Nonce, 2780 independently of the context in which it is used). 2782 In the case the validator is generated to be included in a R1 2783 message, for each I1 message. The responder use the current counter 2784 C value as the Responder Nonce, and use the following information 2785 concatenated as input to the one-way function: 2787 o The secret S 2789 o That Responder Nonce 2791 o The Initiator Context Tag from the I1 message 2793 o The ULIDs from the I1 message 2795 o The locators from the I1 message (strictly only needed if they are 2796 different from the ULIDs) 2798 o The forked instance identifier if such option was included in the 2799 I1 message 2801 and then the output of the hash function is used as the validator 2802 octet string. 2804 7.11. Receiving R1 messages and sending I2 messages 2806 A host MUST silently discard any received R1 messages that do not 2807 satisfy all of the following validity checks in addition to those 2808 specified in Section 12.3: 2810 o The Hdr Ext Len field is at least 1, i.e., the length is at least 2811 16 octets. 2813 Upon the reception of an R1 message, the host extracts the Initiator 2814 Nonce and the Locator Pair from the message (the latter from the 2815 source and destination fields in the IPv6 header). Next the host 2816 looks for an existing context which matches the Initiator Nonce and 2817 where the locators are contained in Ls(peer) and Ls(local), 2818 respectively. If no such context is found, then the R1 message is 2819 silently discarded. 2821 If such a context is found, then the host looks at the state: 2823 o If the state is I1-SENT, then it sends an I2 message as specified 2824 below. 2826 o In any other state (I2-SENT, I2BIS-SENT, ESTABLISHED) then the 2827 host has already sent an I2 message then this is probably a reply 2828 to a retransmitted I1 message, so this R1 message MUST be silently 2829 discarded. 2831 When the host sends an I2 message, then it includes the Responder 2832 Validator option that was in the R1 message. The I2 message MUST 2833 include the ULID pair; normally in the IPv6 source and destination 2834 fields. If a ULID-pair option was included in the I1 message then it 2835 MUST be included in the I2 message as well. In addition, if the 2836 Forked Instance Identifier value for this context is non-zero, the I2 2837 message MUST contain a Forked Instance Identifier Option carrying 2838 this value. Besides, the I2 message contains an Initiator Nonce. 2839 This is not required to be the same than the one included in the 2840 previous I1 message. 2842 The I2 message may also include the Initiator's locator list. If 2843 this is the the case, then it must also include the CGA Parameter 2844 Data Structure. If CGA (and not HBA) is used to verify one or more 2845 fo the locators included in the locator list, then Initiator must 2846 also include a CGA signature option containing the signature. 2848 When the I2 message has been sent, the state is set to I2-SENT. 2850 7.12. Retransmitting I2 messages 2852 If the initiator does not receive an R2 message after I2_TIMEOUT time 2853 after sending an I2 message it MAY retransmit the I2 message, using 2854 binary exponential backoff and randomized timers. The Responder 2855 Validator option might have a limited lifetime, that is, the peer 2856 might reject Responder Validator options that are older than 2857 VALIDATOR_MIN_LIFETIME to avoid replay attacks. In the case that the 2858 initiator decides not to retransmit I2 messages or in the case that 2859 the initiator still does not recieve an R2 message after 2860 retransmitting I2 messages I2_RETRIES_MAX times, the initiator SHOULD 2861 fall back to retransmitting the I1 message. 2863 7.13. Receiving I2 messages 2865 A host MUST silently discard any received I2 messages that do not 2866 satisfy all of the following validity checks in addition to those 2867 specified in Section 12.3: 2869 o The Hdr Ext Len field is at least 2, i.e., the length is at least 2870 24 octets. 2872 Upon the reception of an I2 message, the host extracts the ULID pair 2873 and the Forked Instance identifier from the message. If there is no 2874 ULID-pair option, then the ULID pair is taken from the source and 2875 destination fields in the IPv6 header. If there is no FII option in 2876 the message, then the FII value is taken to be zero. 2878 Next the host verifies that the Responder Nonce is a recent one 2879 (Nonces that are no older than VALIDATOR_MIN_LIFETIME SHOULD be 2880 considered recent), and that the Responder Validator option matches 2881 the validator the host would have computed for the ULID, locators, 2882 responder nonce, initiator nonce and FII. 2884 If a CGA Parameter Data Structure (PDS) is included in the message, 2885 then the host MUST verify if the actual PDS contained in the message 2886 corresponds to the ULID(peer). 2888 If any of the above verifications fails, then the host silently 2889 discards the message and it has completed the I2 processing. 2891 If all the above verifications are successful, then the host proceeds 2892 to look for a context state for the Initiator. The host looks for a 2893 context with the extracted ULID pair and FII. If none exist then 2894 state of the (non-existing) context is viewed as being IDLE, thus the 2895 actions depend on the state as follows: 2897 o If the state is IDLE (i.e., the context does not exist) the host 2898 allocates a context tag (CT(local)), creates the context state for 2899 the context, and sets its state to ESTABLISHED. It records 2900 CT(peer), and the peer's locator set as well as its own locator 2901 set in the context. It SHOULD perform the HBA/CGA verification of 2902 the peer's locator set at this point in time, as specified in 2903 Section 7.2. Then the host sends an R2 message back as specified 2904 below. 2906 o If the state is I1-SENT, then the host verifies if the source 2907 locator is included in Ls(peer) or, it is included in the Locator 2908 List contained in the I2 message and the HBA/CGA verification for 2909 this specific locator is successful 2911 * If this is not the case, then the message is silently discarded 2912 and the context state remains unchanged. 2914 * If this is the case, then the host updates the context 2915 information (CT(peer), Ls(peer)) with the data contained in the 2916 I2 message and the host MUST send a R2 message back as 2917 specified below. Note that before updating Ls(peer) 2918 information, the host SHOULD perform the HBA/CGA validation of 2919 the peer's locator set at this point in time as specified in 2920 Section 7.2. The host moves to ESTABLISHED state. 2922 o If the state is ESTABLISHED, I2-SENT, or I2BIS-SENT, then the host 2923 verifies if the source locator is included in Ls(peer) or, it is 2924 included in the Locator List contained in the I2 message and the 2925 HBA/CGA verification for this specific locator is successful 2927 * If this is not the case, then the message is silently discarded 2928 and the context state remains unchanged. 2930 * If this is the case, then the host updates the context 2931 information (CT(peer), Ls(peer)) with the data contained in the 2932 I2 message and the host MUST send a R2 message back as 2933 specified in Section 7.14. Note that before updating Ls(peer) 2934 information, the host SHOULD perform the HBA/CGA validation of 2935 the peer's locator set at this point in time as specified in 2936 Section 7.2. The context state remains unchanged. 2938 7.14. Sending R2 messages 2940 Before the host sends the R2 message it MUST look for a possible 2941 context confusion i.e. where it would end up with multiple contexts 2942 using the same CT(peer) for the same peer host. See Section 7.15. 2944 When the host needs to send an R2 message, the host forms the message 2945 its context tag, copies the Initiator Nonce from the triggering 2946 message (I2, I2bis, or I1). In addition, it may include alternative 2947 locators and the the necessary options so that the peer can verify 2948 them. In particular, the R2 message may include the Responder's 2949 locator list and the PDS option. If CGA (and not HBA) is used to 2950 verify the locator list, then the Responder also signs the key parts 2951 of the message and includes a CGA Signature option containing the 2952 signature. 2954 R2 messages are never retransmitted. If the R2 message is lost, then 2955 the initiator will retransmit either the I2/I2bis or I1 message. 2956 Either retransmission will cause the responder to find the context 2957 state and respond with an R2 message. 2959 7.15. Match for Context Confusion 2961 When the host receives an I2, I2bis, or R2 it MUST look for a 2962 possible context confusion i.e. where it would end up with multiple 2963 contexts using the same CT(peer) for the same peer host. This can 2964 happen when it has received the above messages since they create a 2965 new context with a new CT(peer). Same issue applies when CT(peer) is 2966 updated for an existing context. 2968 The host takes CT(peer) for the newly created or updated context, and 2969 looks for other contexts which: 2971 o Are in state ESTABLISHED or I2BIS-SENT. 2973 o Have the same CT(peer). 2975 o Where Ls(peer) has at least one locator in common with the newly 2976 created or updated context. 2978 If such a context is found, then the host checks if the ULID pair or 2979 the Forked Instance Identifier different than the ones in the newly 2980 created or updated context: 2982 o If either or both are different, then the peer is reusing the 2983 context tag for the creation of a context with different ULID pair 2984 or FII, which is an indication that the peer has lost the original 2985 context. In this case, we are in the Context confusion situation, 2986 and the host MUST NOT use the old context to send any packets. It 2987 MAY just discard the old context (after all, the peer has 2988 discarded it), or it MAY attempt to re-establish the old context 2989 by sending a new I1 message and moving its state to I1-SENT. In 2990 any case, once that this situation is detected, the host MUST NOT 2991 keep two contexts with overlapping Ls(peer) locator sets and the 2992 same context tag in ESTABLISHED state, since this would result in 2993 demultiplexing problems on the peer. 2995 o If both are the same, then this context is actually the context 2996 that is created or updated, hence there is no confusion. 2998 7.16. Receiving R2 messages 3000 A host MUST silently discard any received R2 messages that do not 3001 satisfy all of the following validity checks in addition to those 3002 specified in Section 12.3: 3004 o The Hdr Ext Len field is at least 1, i.e., the length is at least 3005 16 octets. 3007 Upon the reception of an R2 message, the host extracts the Initiator 3008 Nonce and the Locator Pair from the message (the latter from the 3009 source and destination fields in the IPv6 header). Next the host 3010 looks for an existing context which matches the Initiator Nonce and 3011 where the locators are Lp(peer) and Lp(local), respectively. Based 3012 on the state: 3014 o If no such context is found, i.e., the state is IDLE, then the 3015 message is silently dropped. 3017 o If state is I1-SENT, I2-SENT, or I2BIS-SENT then the host performs 3018 the following actions: If a CGA Parameter Data Structure (PDS) is 3019 included in the message, then the host MUST verify that the actual 3020 PDS contained in the message corresponds to the ULID(peer) as 3021 specified in Section 7.2. If the verification fails, then the 3022 message is silently dropped. If the verification succeeds, then 3023 the host records the information from the R2 message in the 3024 context state; it records the peer's locator set and CT(peer). 3025 The host SHOULD perform the HBA/CGA verification of the peer's 3026 locator set at this point in time, as specified in Section 7.2. 3027 The host sets its state to ESTABLISHED. 3029 o If the state is ESTABLISHED, the R2 message is silently ignored, 3030 (since this is likely to be a reply to a retransmitted I2 3031 message). 3033 Before the host completes the R2 processing it MUST look for a 3034 possible context confusion i.e. where it would end up with multiple 3035 contexts using the same CT(peer) for the same peer host. See 3036 Section 7.15. 3038 7.17. Sending R1bis messages 3040 Upon the receipt of a Shim6 payload extension header where there is 3041 no current Shim6 context at the receiver, the receiver is to respond 3042 with an R1bis message in order to enable a fast re-establishment of 3043 the lost Shim6 context. 3045 Also a host is to respond with a R1bis upon receipt of any control 3046 messages that has a message type in the range 64-127 (i.e., excluding 3047 the context setup messages such as I1, R1, R1bis, I2, I2bis, R2 and 3048 future extensions), where the control message refers to a non 3049 existent context. 3051 We assume that all the incoming packets that trigger the generation 3052 of an R1bis message contain a locator pair (in the address fields of 3053 the IPv6 header) and a Context Tag. 3055 Upon reception of any of the packets described above, the host will 3056 reply with an R1bis including the following information: 3058 o The Responder Nonce is a number picked by the responder which the 3059 initiator will return in the I2bis message. 3061 o Packet Context Tag is the context tag contained in the received 3062 packet that triggered the generation of the R1bis message. 3064 o The Responder Validator option is included, with a validator that 3065 is computed as suggested in the next section. 3067 7.17.1. Generating the R1bis Validator 3069 One way for the responder to properly generate validators is to 3070 maintain a single secret (S) and a running counter C for the 3071 Responder Nonce that is incremented in fixed periods of time (this 3072 allows the Responder to verify the age of a Responder Nonce, 3073 independently of the context in which it is used). 3075 In the case the validator is generated to be included in a R1bis 3076 message, for each received payload extension header or control 3077 message, the responder use the counter C value as the Responder 3078 Nonce, and use the following information concatenated as input to the 3079 one-way function: 3081 o The secret S 3083 o That Responder Nonce 3085 o The Receiver Context tag included in the received packet 3087 o The locators from the received packet 3089 and then the output of the hash function is used as the validator 3090 octet string. 3092 7.18. Receiving R1bis messages and sending I2bis messages 3094 A host MUST silently discard any received R1bis messages that do not 3095 satisfy all of the following validity checks in addition to those 3096 specified in Section 12.3: 3098 o The Hdr Ext Len field is at least 1, i.e., the length is at least 3099 16 octets. 3101 Upon the reception of an R1bis message, the host extracts the Packet 3102 Context Tag and the Locator Pair from the message (the latter from 3103 the source and destination fields in the IPv6 header). Next the host 3104 looks for an existing context where the Packet Context Tag matches 3105 CT(peer) and where the locators match Lp(peer) and Lp(local), 3106 respectively. 3108 o If no such context is not found, i.e., the state is IDLE, then the 3109 R1bis message is silently discarded. 3111 o If the state is I1-SENT, I2-SENT, or I2BIS-SENT, then the R1bis 3112 message is silently discarded. 3114 o If the state is ESTABLISHED, then we are in the case where the 3115 peer has lost the context and the goal is to try to re-establish 3116 it. For that, the host leaves CT(peer) unchanged in the context 3117 state, transitions to I2BIS-SENT state, and sends a I2bis message, 3118 including the computed Responder Validator option, the Packet 3119 Context Tag, and the Responder Nonce received in the R1bis 3120 message. This I2bis message is sent using the locator pair 3121 included in the R1bis message. In the case that this locator pair 3122 differs from the ULID pair defined for this context, then an ULID 3123 option MUST be included in the I2bis message. In addition, if the 3124 Forked Instance Identifier for this context is non-zero, then a 3125 Forked Instance Identifier option carrying the instance identifier 3126 value for this context MUST be included in the I2bis message. The 3127 I2bis message may also include a locator list. If this is the the 3128 case, then it must also include the CGA Parameter Data Structure. 3129 If CGA (and not HBA) is used to verify one or more fo the locators 3130 included in the locator list, then Initiator must also include a 3131 CGA signature option containing the signature. 3133 7.19. Retransmitting I2bis messages 3135 If the initiator does not receive an R2 message after I2bis_TIMEOUT 3136 time after sending an I2bis message it MAY retransmit the I2bis 3137 message, using binary exponential backoff and randomized timers. The 3138 Responder Validator option might have a limited lifetime, that is, 3139 the peer might reject Responder Validator options that are older than 3140 VALIDATOR_MIN_LIFETIME to avoid replay attacks. In the case that the 3141 initiator decides not to retransmit I2bis messages or in the case 3142 that the initiator still does not recieve an R2 message after 3143 retransmitting I2bis messages I2bis_RETRIES_MAX times, the initiator 3144 SHOULD fallback to retransmitting the I1 message. 3146 7.20. Receiving I2bis messages and sending R2 messages 3148 A host MUST silently discard any received I2bis messages that do not 3149 satisfy all of the following validity checks in addition to those 3150 specified in Section 12.3: 3152 o The Hdr Ext Len field is at least 3, i.e., the length is at least 3153 32 octets. 3155 Upon the reception of an I2bis message, the host extracts the ULID 3156 pair and the Forked Instance identifier from the message. If there 3157 is no ULID-pair option, then the ULID pair is taken from the source 3158 and destination fields in the IPv6 header. If there is no FII option 3159 in the message, then the FII value is taken to be zero. 3161 Next the host verifies that the Responder Nonce is a recent one 3162 (Nonces that are no older than VALIDATOR_MIN_LIFETIME SHOULD be 3163 considered recent), and that the Responder Validator option matches 3164 the validator the host would have computed for the locators, 3165 Responder Nonce, and Receiver Context tag as part of sending an R1bis 3166 message. 3168 If a CGA Parameter Data Structure (PDS) is included in the message, 3169 then the host MUST verify if the actual PDS contained in the message 3170 corresponds to the ULID(peer). 3172 If any of the above verifications fails, then the host silently 3173 discard the message and it has completed the I2bis processing. 3175 If both verifications are successful, then the host proceeds to look 3176 for a context state for the Initiator. The host looks for a context 3177 with the extracted ULID pair and FII. If none exist then state of 3178 the (non-existing) context is viewed as being IDLE, thus the actions 3179 depend on the state as follows: 3181 o If the state is IDLE (i.e., the context does not exist) the host 3182 allocates a context tag (CT(local)), creates the context state for 3183 the context, and sets its state to ESTABLISHED. The host SHOULD 3184 NOT use the Packet Context Tag in the I2bis message for CT(local); 3185 instead it should pick a new random context tag just as when it 3186 processes an I2 message. It records CT(peer), and the peer's 3187 locator set as well as its own locator set in the context. It 3188 SHOULD perform the HBA/CGA verification of the peer's locator set 3189 at this point in time as specified in Section 7.2. Then the host 3190 sends an R2 message back as specified in Section 7.14. 3192 o If the state is I1-SENT, then the host verifies if the source 3193 locator is included in Ls(peer) or, it is included in the Locator 3194 List contained in the I2 message and the HBA/CGA verification for 3195 this specific locator is successful 3197 * If this is not the case, then the message is silently 3198 discarded. The the context state remains unchanged. 3200 * If this is the case, then the host updates the context 3201 information (CT(peer), Ls(peer)) with the data contained in the 3202 I2 message and the host MUST send a R2 message back as 3203 specified below. Note that before updating Ls(peer) 3204 information, the host SHOULD perform the HBA/CGA validation of 3205 the peer's locator set at this point in time as specified in 3206 Section 7.2. The host moves to ESTABLISHED state. 3208 o If the state is ESTABLISHED, I2-SENT, or I2BIS-SENT, then the host 3209 verifies if the source locator is included in Ls(peer) or, it is 3210 included in the Locator List contained in the I2 message and the 3211 HBA/CGA verification for this specific locator is successful 3213 * If this is not the case, then the message is silently 3214 discarded. The the context state remains unchanged. 3216 * If this is the case, then the host updates the context 3217 information (CT(peer), Ls(peer)) with the data contained in the 3218 I2 message and the host MUST send a R2 message back as 3219 specified in Section 7.14. Note that before updating Ls(peer) 3220 information, the host SHOULD perform the HBA/CGA validation of 3221 the peer's locator set at this point in time as specified in 3222 Section 7.2. The context state remains unchanged. 3224 8. Handling ICMP Error Messages 3226 The routers in the path as well as the destination might generate 3227 various ICMP error messages, such as host unreachable, packet too 3228 big, and Unrecognized Next Header type. It is critical that these 3229 packets make it back up to the ULPs so that they can take appropriate 3230 action. 3232 This is an implementation issue in the sense that the mechanism is 3233 completely local to the host itself. But the issue of how ICMP 3234 errors are correctly dispatched to the ULP on the host are important, 3235 hence this section specifies the issue. 3237 +--------------+ 3238 | IPv6 Header | 3239 | | 3240 +--------------+ 3241 | ICMPv6 | 3242 | Header | 3243 - - +--------------+ - - 3244 | IPv6 Header | 3245 | src, dst as | Can be dispatched 3246 IPv6 | sent by ULP | unmodified to ULP 3247 | on host | ICMP error handler 3248 Packet +--------------+ 3249 | ULP | 3250 in | Header | 3251 +--------------+ 3252 Error | | 3253 ~ Data ~ 3254 | | 3255 - - +--------------+ - - 3257 Figure 30: ICMP error handling without payload extension header 3259 When the ULP packets are sent without the payload extension header, 3260 that is, while the initial locators=ULIDs are working, this 3261 introduces no new concerns; an implementation's existing mechanism 3262 for delivering these errors to the ULP will work. See Figure 30. 3264 But when the shim on the transmitting side inserts the payload 3265 extension header and replaces the ULIDs in the IP address fields with 3266 some other locators, then an ICMP error coming back will have a 3267 "packet in error" which is not a packet that the ULP sent. Thus the 3268 implementation will have to apply the reverse mapping to the "packet 3269 in error" before passing the ICMP error up to the ULP. See 3270 Figure 31. 3272 +--------------+ 3273 | IPv6 Header | 3274 | | 3275 +--------------+ 3276 | ICMPv6 | 3277 | Header | 3278 - - +--------------+ - - 3279 | IPv6 Header | 3280 | src, dst as | Needs to be 3281 IPv6 | modified by | transformed to 3282 | shim on host | have ULIDs 3283 +--------------+ in src, dst fields, 3284 Packet | Shim6 ext. | and Shim6 ext. 3285 | Header | header removed 3286 in +--------------+ before it can be 3287 | Transport | dispatched to the ULP 3288 Error | Header | ICMP error handler. 3289 +--------------+ 3290 | | 3291 ~ Data ~ 3292 | | 3293 - - +--------------+ - - 3295 Figure 31: ICMP error handling with payload extension header 3297 Note that this mapping is different than when receiving packets from 3298 the peer with a payload extension headers, because in that case the 3299 packets contain CT(local). But the ICMP errors have a "packet in 3300 error" with an payload extension header containing CT(peer). This is 3301 because they were intended to be received by the peer. In any case, 3302 since the has to be 3303 unique when received by the peer, the local host should also only be 3304 able to find one context that matches this tuple. 3306 If the ICMP error is a Packet Too Big, the reported MTU must be 3307 adjusted to be 8 octets less, since the shim will add 8 octets when 3308 sending packets. 3310 After the "packet in error" has had the original ULIDs inserted, then 3311 this payload extension header can be removed. The result is a 3312 "packet in error" that is passed to the ULP which looks as if the 3313 shim did not exist. 3315 9. Teardown of the ULID-Pair Context 3317 Each host can unilaterally decide when to tear down a ULID-pair 3318 context. It is RECOMMENDED that hosts do not tear down the context 3319 when they know that there is some upper layer protocol that might use 3320 the context. For example, an implementation might know this if there 3321 is an open socket which is connected to the ULID(peer). However, 3322 there might be cases when the knowledge is not readily available to 3323 the shim layer, for instance for UDP applications which do not 3324 connect their sockets, or any application which retains some higher 3325 level state across (TCP) connections and UDP packets. 3327 Thus it is RECOMMENDED that implementations minimize premature 3328 teardown by observing the amount of traffic that is sent and received 3329 using the context, and only after it appears quiescent, tear down the 3330 state. A reasonable approach would be not to tear down a context 3331 until at least 5 minutes have passed since the last message was sent 3332 or received using the context. (Note that packets that use the ULID 3333 pair as locator pair and that do not require address rewriting by the 3334 Shim6 layer are also considered as packets using the associated Shim6 3335 context) 3337 Since there is no explicit, coordinated removal of the context state, 3338 there are potential issues around context tag reuse. One end might 3339 remove the state, and potentially reuse that context tag for some 3340 other communication, and the peer might later try to use the old 3341 context (which it didn't remove). The protocol has mechanisms to 3342 recover from this, which work whether the state removal was total and 3343 accidental (e.g., crash and reboot of the host), or just a garbage 3344 collection of shim state that didn't seem to be used. However, the 3345 host should try to minimize the reuse of context tags by trying to 3346 randomly cycle through the 2^47 context tag values. (See Appendix C 3347 for a summary how the recovery works in the different cases.) 3349 10. Updating the Peer 3351 The Update Request and Acknowledgement are used both to update the 3352 list of locators (only possible when CGA is used to verify the 3353 locator(s)), as well as updating the preferences associated with each 3354 locator. 3356 10.1. Sending Update Request messages 3358 When a host has a change in the locator set, then it can communicate 3359 this to the peer by sending an Update Request. When a host has a 3360 change in the preferences for its locator set, it can also 3361 communicate this to the peer. The Update Request message can include 3362 just a Locator List option, to convey the new set of locators, just a 3363 Locator Preferences option, or both a new Locator List and new 3364 Locator Preferences. 3366 Should the host send a new Locator List, the host picks a new random 3367 local generation number, records this in the context, and puts it in 3368 the Locator List option. Any Locator Preference option, whether send 3369 in the same Update Request or in some future Update Request, will use 3370 that generation number to make sure the preferences get applied to 3371 the correct version of the locator list. 3373 The host picks a random Request Nonce for each update, and keeps the 3374 same nonce for any retransmissions of the Update Request. The nonce 3375 is used to match the acknowledgement with the request. 3377 The UPDATE message can also include a CGA Parameter Data Structure 3378 (this is needed if the CGA PDS was not previously exchanged,). If 3379 CGA (and not HBA) is used to verify one or more fo the locators 3380 included in the locator list, then a CGA signature option containing 3381 the signature must also be included in the UPDATE message. 3383 10.2. Retransmitting Update Request messages 3385 If the host does not receive an Update Acknowledgement R2 message in 3386 response to the Update Request message after UPDATE_TIMEOUT time, 3387 then it needs to retransmit the Update Request message. The 3388 retransmissions should use a retransmission timer with binary 3389 exponential backoff to avoid creating congestion issues for the 3390 network when lots of hosts perform Update Request retransmissions. 3391 Also, the actual timeout value should be randomized between 0.5 and 3392 1.5 of the nominal value to avoid self-synchronization. 3394 Should there be no response, the retransmissions continue forever. 3395 The binary exponential backoff stops at MAX_UPDATE_TIMEOUT. But the 3396 only way the retransmissions would stop when there is no 3397 acknowledgement, is when the shim, through the Probe protocol or some 3398 other mechanism, decides to discard the context state due to lack of 3399 ULP usage in combination with no responses to the Probes. 3401 10.3. Newer Information While Retransmitting 3403 There can be at most one outstanding Update Request message at any 3404 time. Thus until e.g. an update with a new Locator List has been 3405 acknowledged, any even newer Locator List or new Locator Preferences 3406 can not just be sent. However, when there is newer information and 3407 the older information has not yet been acknowledged, the host can 3408 instead of waiting for an acknowledgement, abandon the previous 3409 update and construct a new Update Request (with a new Request Nonce) 3410 which includes the new information as well as the information that 3411 hadn't yet been acknowledged. 3413 For example, if the original locator list was just (A1, A2), and if 3414 an Update Request with the Locator List (A1, A3) is outstanding, and 3415 the host determines that it should both add A4 to the locator list, 3416 and mark A1 as BROKEN, then it would need to: 3418 o Pick a new random Request Nonce for the new Update Request. 3420 o Pick a new random Generation number for the new locator list. 3422 o Form the new locator list - (A1, A3, A4) 3424 o Form a Locator Preference option which uses the new generation 3425 number and has the BROKEN flag for the first locator. 3427 o Send the Update Request and start a retransmission timer. 3429 Any Update Acknowledgement which doesn't match the current request 3430 nonce, for instance an acknowledgement for the abandoned Update 3431 Request, will be silently ignored. 3433 10.4. Receiving Update Request messages 3435 A host MUST silently discard any received Update Request messages 3436 that do not satisfy all of the following validity checks in addition 3437 to those specified in Section 12.3: 3439 o The Hdr Ext Len field is at least 1, i.e., the length is at least 3440 16 octets. 3442 Upon the reception of an Update Request message, the host extracts 3443 the Context Tag from the message. It then looks for a context which 3444 has a CT(local) that matches the context tag. If no such context is 3445 found, it sends a R1bis message as specified in Section 7.17. 3447 Since context tags can be reused, the host MUST verify that the IPv6 3448 source address field is part of Ls(peer) and that the IPv6 3449 destination address field is part of Ls(local). If this is not the 3450 case, the sender of the Update Request has a stale context which 3451 happens to match the CT(local) for this context. In this case the 3452 host MUST send a R1bis message, and otherwise ignore the Update 3453 Request message. 3455 If a CGA Parameter Data Structure (PDS) is included in the message, 3456 then the host MUST verify if the actual PDS contained in the packet 3457 corresponds to the ULID(peer). If this verification fails, the 3458 message is silently discarded. 3460 Then, depending on the state of the context: 3462 o If ESTABLISHED: Proceed to process message. 3464 o If I1-SENT, discard the message and stay in I1-SENT. 3466 o If I2-SENT, then send I2 and proceed to process the message. 3468 o If I2BIS-SENT, then send I2bis and proceed to process the message. 3470 The verification issues for the locators carried in the Locator 3471 Update message are specified in Section 7.2. If the locator list can 3472 not be verified, this procedure should send a Shim6 Error message 3473 with Error Code=2. In any case, if it can not be verified, there is 3474 no further processing of the Update Request. 3476 Once any Locator List option in the Update Request has been verified, 3477 the peer generation number in the context is updated to be the one in 3478 the Locator List option. 3480 If the Update message contains a Locator Preference option, then the 3481 Generation number in the preference option is compared with the peer 3482 generation number in the context. If they do not match, then the 3483 host generates a Shim6 Error Message with Error Code=3 with the 3484 Pointer field referring to the first octet in the Generation number 3485 in the Locator Preference option. In addition, if the number of 3486 elements in the Locator Preference option does not match the number 3487 of locators in Ls(peer), then a Shim6 Error Message with Error Code=4 3488 is sent with the Pointer referring to the first octet of the Length 3489 field in the Locator Preference option. In both cases of failures, 3490 no further processing is performed for the Locator Update message. 3492 If the generation number matches, the locator preferences are 3493 recorded in the context. 3495 Once the Locator List option (if present) has been verified and any 3496 new locator list or locator preferences have been recorded, the host 3497 sends an Update Acknowledgement message, copying the nonce from the 3498 request, and using the CT(peer) in as the Receiver Context Tag. 3500 Any new locators, or more likely new locator preferences, might 3501 result in the host wanting to select a different locator pair for the 3502 context. For instance, if the Locator Preferences lists the current 3503 Lp(peer) as BROKEN. The host uses the reachability exploration 3504 procedure described in [5] to verify that the new locator is 3505 reachable before changing Lp(peer). 3507 10.5. Receiving Update Acknowledgement messages 3509 A host MUST silently discard any received Update Acknowledgement 3510 messages that do not satisfy all of the following validity checks in 3511 addition to those specified in Section 12.3: 3513 o The Hdr Ext Len field is at least 1, i.e., the length is at least 3514 16 octets. 3516 Upon the reception of an Update Acknowledgement message, the host 3517 extracts the Context Tag and the Request Nonce from the message. It 3518 then looks for a context which has a CT(local) that matches the 3519 context tag. If no such context is found, it sends a R1bis message 3520 as specified in Section 7.17. 3522 Since context tags can be reused, the host MUST verify that the IPv6 3523 source address field is part of Ls(peer) and that the IPv6 3524 destination address field is part of Ls(local). If this is not the 3525 case, the sender of the Update Acknowledgement has a stale context 3526 which happens to match the CT(local) for this context. In this case 3527 the host MUST send a R1bis message, and otherwise ignore the Update 3528 Acknowledgement message. 3530 Then, depending on the state of the context: 3532 o If ESTABLISHED: Proceed to process message. 3534 o If I1-SENT, discard the message and stay in I1-SENT. 3536 o If I2-SENT, then send R2 and proceed to process the message. 3538 o If I2BIS-SENT, then send R2 and proceed to process the message. 3540 If the Request Nonce doesn't match the Nonce for the last sent Update 3541 Request for the context, then the Update Acknowledgement is silently 3542 ignored. If the nonce matches, then the update has been completed 3543 and the Update retransmit timer can be reset. 3545 11. Sending ULP Payloads 3547 When there is no context state for the ULID pair on the sender, there 3548 is no effect on how ULP packets are sent. If the host is using some 3549 heuristic for determining when to perform a deferred context 3550 establishment, then the host might need to do some accounting (count 3551 the number of packets sent and received) even before there is a ULID- 3552 pair context. 3554 If the context is not in ESTABLISHED or I2BIS-SENT state, then it 3555 there is also no effect on how the ULP packets are sent. Only in the 3556 ESTABLISHED and I2BIS-SENT states does the host have CT(peer) and 3557 Ls(peer) set. 3559 If there is a ULID-pair context for the ULID pair, then the sender 3560 needs to verify whether context uses the ULIDs as locators, that is, 3561 whether Lp(peer) == ULID(peer) and Lp(local) == ULID(local). 3563 If this is the case, then packets can be sent unmodified by the shim. 3564 If it is not the case, then the logic in Section 11.1 will need to be 3565 used. 3567 There will also be some maintenance activity relating to 3568 (un)reachability detection, whether packets are sent with the 3569 original locators or not. The details of this is out of scope for 3570 this document and is specified in [5]. 3572 11.1. Sending ULP Payload after a Switch 3574 When sending packets, if there is a ULID-pair context for the ULID 3575 pair, and the ULID pair is no longer used as the locator pair, then 3576 the sender needs to transform the packet. Apart from replacing the 3577 IPv6 source and destination fields with a locator pair, an 8-octet 3578 header is added so that the receiver can find the context and inverse 3579 the transformation. 3581 If there has been a failure causing a switch, and later the context 3582 switches back to sending things using the ULID pair as the locator 3583 pair, then there is no longer a need to do any packet transformation 3584 by the sender, hence there is no need to include the 8-octet 3585 extension header. 3587 First, the IP address fields are replaced. The IPv6 source address 3588 field is set to Lp(local) and the destination address field is set to 3589 Lp(peer). NOTE that this MUST NOT cause any recalculation of the ULP 3590 checksums, since the ULP checksums are carried end-to-end and the ULP 3591 pseudo-header contains the ULIDs which are preserved end-to-end. 3593 The sender skips any "routing sub-layer extension headers" that the 3594 ULP might have included, thus it skips any hop-by-hop extension 3595 header, any routing header, and any destination options header that 3596 is followed by a routing header. After any such headers the Shim6 3597 extension header will be added. This might be before a Fragment 3598 header, a Destination Options header, an ESP or AH header, or a ULP 3599 header. 3601 The inserted Shim6 Payload extension header includes the peer's 3602 context tag. It takes on the next header value from the preceding 3603 extension header, since that extension header will have a next header 3604 value of Shim6. 3606 12. Receiving Packets 3608 The receive side of the communication can receive packets associated 3609 to a Shim6 context with or without the Shim6 extenson header. In 3610 case that the ULID pair is being used as locator pair, the packets 3611 received will not have the Shim6 extension header and will be 3612 processed by the Shim6 layer as described below. If the received 3613 packet does carry the Shim6 extension header, as in normal IPv6 3614 receive side packet processing the receiver parses the (extension) 3615 headers in order. Should it find a Shim6 extension header it will 3616 look at the "P" field in that header. If this bit is zero, then the 3617 packet must be passed to the Shim6 payload handling for rewriting. 3618 Otherwise, the packet is passed to the Shim6 control handling. 3620 12.1. Receiving payload without extension headers 3622 The receiver extracts the IPv6 source and destination fields, and 3623 uses this to find a ULID-pair context, such that the IPv6 address 3624 fields match the ULID(local) and ULID(peer). If such a context is 3625 found, the context appears not to be quiescent and this should be 3626 remembered in order to avoid tearing down the context and for 3627 reachability detection porpuses as described in [5]. The host 3628 continues with the normal processing of the IP packet. 3630 12.2. Receiving Payload Extension Headers 3632 The receiver extracts the context tag from the payload extension 3633 header, and uses this to find a ULID-pair context. If no context is 3634 found, the receiver SHOULD generate a R1bis message (see 3635 Section 7.17). 3637 Then, depending on the state of the context: 3639 o If ESTABLISHED: Proceed to process message. 3641 o If I1-SENT, discard the message and stay in I1-SENT. 3643 o If I2-SENT, then send I2 and proceed to process the message. 3645 o If I2BIS-SENT, then send I2bis and proceed to process the message. 3647 With the context in hand, the receiver can now replace the IP address 3648 fields with the ULIDs kept in the context. Finally, the Payload 3649 extension header is removed from the packet (so that the ULP doesn't 3650 get confused by it), and the next header value in the preceding 3651 header is set to be the actual protocol number for the payload. Then 3652 the packet can be passed to the protocol identified by the next 3653 header value (which might be some function associated with the IP 3654 endpoint sublayer, or a ULP). 3656 If the host is using some heuristic for determining when to perform a 3657 deferred context establishment, then the host might need to do some 3658 accounting (count the number of packets sent and received) for 3659 packets that does not have a Shim6 extension header and for which 3660 there is no context. But the need for this depends on what 3661 heuristics the implementation has chosen. 3663 12.3. Receiving Shim Control messages 3665 A shim control message has the checksum field verified. The Shim 3666 header length field is also verified against the length of the IPv6 3667 packet to make sure that the shim message doesn't claim to end past 3668 the end of the IPv6 packet. Finally, it checks that the neither the 3669 IPv6 destination field nor the IPv6 source field is a multicast 3670 address nor the unspecified address. If any of those checks fail, 3671 the packet is silently dropped. 3673 The message is then dispatched based on the shim message type. Each 3674 message type is then processed as described elsewhere in this 3675 document. If the packet contains a shim message type which is 3676 unknown to the receiver, then a Shim6 Error Message with Error Code=0 3677 is generated and sent back. The Pointer field is set to point at the 3678 first octet of the shim message type. 3680 All the control messages can contain any options with C=0. If there 3681 is any option in the message with C=1 that isn't known to the host, 3682 then the host MUST send a Shim6 Error Message with Error Code=1, with 3683 the Pointer field referencing the first octet of the Option Type. 3685 12.4. Context Lookup 3687 We assume that each shim context has its own state machine. We 3688 assume that a dispatcher delivers incoming packets to the state 3689 machine that it belongs to. Here we describe the rules used for the 3690 dispatcher to deliver packets to the correct shim context state 3691 machine. 3693 There is one state machine per context identified that is 3694 conceptually identified by ULID pair and Forked Instance Identifier 3695 (which is zero by default), or identified by CT(local). However, the 3696 detailed lookup rules are more complex, especially during context 3697 establishment. 3699 Clearly, if the required context is not established, it will be in 3700 IDLE state. 3702 During context establishment, the context is identified as follows: 3704 o I1 packets: Deliver to the context associated with the ULID pair 3705 and the Forked Instance Identifier. 3707 o I2 packets: Deliver to the context associated with the ULID pair 3708 and the Forked Instance Identifier. 3710 o R1 packets: Deliver to the context with the locator pair included 3711 in the packet and the Initiator nonce included in the packet (R1 3712 does not contain ULID pair nor the CT(local)). If no context 3713 exist with this locator pair and Initiator nonce, then silently 3714 discard. 3716 o R2 packets: Deliver to the context with the locator pair included 3717 in the packet and the Initiator nonce included in the packet (R2 3718 does not contain ULID pair nor the CT(local)). If no context 3719 exists with this locator pair and INIT nonce, then silently 3720 discard. 3722 o R1bis packet: deliver to the context that has the locator pair and 3723 the CT(peer) equal to the Packet Context Tag included in the R1bis 3724 packet. 3726 o I2bis packets: Deliver to the context associated with the ULID 3727 pair and the Forked Instance Identifier. 3729 o Payload extension headers: Deliver to the context with CT(local) 3730 equal to the Receiver Context Tag included in the packet. 3732 o Other control messages (Update, Keepalive, Probe): Deliver to the 3733 context with CT(local) equal to the Receiver Context Tag included 3734 in the packet. Verify that the IPv6 source address field is part 3735 of Ls(peer) and that the IPv6 destination address field is part of 3736 Ls(local). If not, send a R1bis message. 3738 o Shim6 Error Messages and ICMP errors which contain a Shim6 payload 3739 extension header or other shim control packet in the "packet in 3740 error": Use the "packet in error" for dispatching as follows. 3741 Deliver to the context with CT(peer) equal to the Receiver Context 3742 Tag, Lp(local) being the IPv6 source address, and Lp(peer) being 3743 the IPv6 destination address. 3745 In addition, the shim on the sending side needs to be able to find 3746 the context state when a ULP packet is passed down from the ULP. In 3747 that case the lookup key is the pair of ULIDs and FII=0. If we have 3748 a ULP API that allows the ULP to do context forking, then presumably 3749 the ULP would pass down the Forked Instance Identifier. 3751 13. Initial Contact 3753 The initial contact is some non-shim communication between two ULIDs, 3754 as described in Section 2. At that point in time there is no 3755 activity in the shim. 3757 Whether the shim ends up being used or not (e.g., the peer might not 3758 support Shim6) it is highly desirable that the initial contact can be 3759 established even if there is a failure for one or more IP addresses. 3761 The approach taken is to rely on the applications and the transport 3762 protocols to retry with different source and destination addresses, 3763 consistent with what is already specified in Default Address 3764 Selection [8], and some fixes to that specification [9] to make it 3765 try different source addresses and not only different destination 3766 addresses. 3768 The implementation of such an approach can potentially result in long 3769 timeouts. For instance, a naive implementation at the socket API 3770 which uses getaddrinfo() to retrieve all destination addresses and 3771 then tries to bind() and connect() to try all source and destination 3772 address combinations waiting for TCP to time out for each combination 3773 before trying the next one. 3775 However, if implementations encapsulate this in some new connect-by- 3776 name() API, and use non-blocking connect calls, it is possible to 3777 cycle through the available combinations in a more rapid manner until 3778 a working source and destination pair is found. Thus the issues in 3779 this domain are issues of implementations and the current socket API, 3780 and not issues of protocol specification. In all honesty, while 3781 providing an easy to use connect-by-name() API for TCP and other 3782 connection-oriented transports is easy; providing a similar 3783 capability at the API for UDP is hard due to the protocol itself not 3784 providing any "success" feedback. But even the UDP issue is one of 3785 APIs and implementation. 3787 14. Protocol constants 3789 The protocol uses the following constants: 3791 I1_RETRIES_MAX = 4 3793 I1_TIMEOUT = 4 seconds 3795 NO_R1_HOLDDOWN_TIME = 1 min 3797 ICMP_HOLDDOWN_TIME = 10 min 3799 I2_TIMEOUT = 4 seconds 3801 I2_RETRIES_MAX = 2 3803 I2bis_TIMEOUT = 4 seconds 3805 I2bis_RETRIES_MAX = 2 3807 VALIDATOR_MIN_LIFETIME = 30 seconds 3809 UPDATE_TIMEOUT = 4 seconds 3811 The retransmit timers (I1_TIMEOUT, I2_TIMEOUT, UPDATE_TIMEOUT) are 3812 subject to binary exponential backoff, as well as randomization 3813 across a range of 0.5 and 1.5 times the nominal (backed off) value. 3814 This removes any risk of synchronization between lots of hosts 3815 performing independent shim operations at the same time. 3817 The randomization is applied after the binary exponential backoff. 3818 Thus the first retransmission would happen based on a uniformly 3819 distributed random number in the range [0.5*4, 1.5*4] seconds, the 3820 second retransmission [0.5*8, 1.5*8] seconds after the first one, 3821 etc. 3823 15. Implications Elsewhere 3825 15.1. Congestion Control Considerations 3827 When the locator pair currently used for exchanging packets in a 3828 Shim6 context becomes unreachable, the Shim6 layer will divert the 3829 communication through an alternative locator pair, which in most 3830 cases will result in redirecting the packet flow through an 3831 alternative network path. In this case, it recommended that the 3832 Shim6 follows the recommendation defined in [20] and it informs the 3833 upper layers about the path change, in order to allow the congestion 3834 control mechanisms of the upper layers to react accordingly. 3836 15.2. Middle-boxes considerations 3838 Data packets belonging to a Shim6 context carrying the Shim6 Payload 3839 Header contain alternative locators other than the ULIDs in the 3840 source and destination address fields of the IPv6 header. On the 3841 other hand, the upper layers of the peers involved in the 3842 communication operate on the ULID pair presented by the Shim6 layer 3843 to them, rather on the locator pair contained in the IPv6 header of 3844 the actual packets. It should be noted that the Shim6 layer does not 3845 modify the data packets, but because a constant ULID pair is 3846 presented to upper layers irrespective of the locator pair changes, 3847 the relation between the upper layer header (such as TCP, UDP, ICMP, 3848 ESP, etc) and the IPv6 header is modified. In particular, when the 3849 Shim6 Extension header is present in the packet, if those data 3850 packets are TCP, UDP or ICMP packets, the presudoheader used for the 3851 checksum calculation will contain the ULID pair, rather than the 3852 locator pair contained in the data packet. 3854 It is possible that some firewalls or other middle boxes try to 3855 verify the validity of upper layer sanity checks of the packet on the 3856 fly. If they do that based on the actual source and destination 3857 addresses contained in the IPv6 header without considering the Shim6 3858 context information (in particular without replacing the locator pair 3859 by the ULID pair used by the Shim6 context) such verifications may 3860 fail. Those middle-boxes need to be updated in order to be able to 3861 parse the Shim6 payload header and find the next header header after 3862 that. It is recommended that firewalls and other middle-boxes do not 3863 drop packets that carry the Shim6 Payload header with apparently 3864 incorrect upper layer validity checks that involve the addresses in 3865 the IPv6 header for their computation, unless they are able to 3866 determine the ULID pair of the Shim6 context associated to the data 3867 packet and use the ULID pair for the verification of the validity 3868 check. 3870 In the particular case of TCP, UDP and ICMP checksums, it is 3871 recommended that firewalls and other middle-boxes do not drop TCP, 3872 UDP and ICMP packets that carry the Shim6 Payload header with 3873 apparently incorrect checksums when using the addresses in the IPv6 3874 header for the pseudoheader computation, unless they implement are 3875 able to determine the ULID pair of the Shim6 context associated to 3876 the data packet and use the ULID pair to determine the checksum that 3877 must be present in a packet with addresses rewritten by Shim6. 3879 In addition, firewalls that today pass limited traffic, e.g., 3880 outbound TCP connections, would presumably block the Shim6 protocol. 3881 This means that even when Shim6 capable hosts are communicating, the 3882 I1 messages would be dropped, hence the hosts would not discover that 3883 their peer is Shim6 capable. This is in fact a feature, since if the 3884 hosts managed to establish a ULID-pair context, then the firewall 3885 would probably drop the "different" packets that are sent after a 3886 failure (those using the Shim6 payload extension header with a TCP 3887 packet inside it). Thus stateful firewalls that are modified to pass 3888 Shim6 messages should also be modified to pass the payload extension 3889 header, so that the shim can use the alternate locators to recover 3890 from failures. This presumably implies that the firewall needs to 3891 track the set of locators in use by looking at the Shim6 control 3892 exchanges. Such firewalls might even want to verify the locators 3893 using the HBA/CGA verification themselves, which they can do without 3894 modifying any of the Shim6 packets they pass through. 3896 15.3. Other considerations 3898 The general Shim6 approach, as well as the specifics of this proposed 3899 solution, has implications elsewhere, including: 3901 o Applications that perform referrals, or callbacks using IP 3902 addresses as the 'identifiers' can still function in limited ways, 3903 as described in [18]. But in order for such applications to be 3904 able to take advantage of the multiple locators for redundancy, 3905 the applications need to be modified to either use fully qualified 3906 domain names as the 'identifiers', or they need to pass all the 3907 locators as the 'identifiers' i.e., the 'identifier' from the 3908 applications perspective becomes a set of IP addresses instead of 3909 a single IP address. 3911 o Signaling protocols for QoS or other things that involve having 3912 devices in the network path look at IP addresses and port numbers, 3913 or IP addresses and Flow Labels, need to be invoked on the hosts 3914 when the locator pair changes due to a failure. At that point in 3915 time those protocols need to inform the devices that a new pair of 3916 IP addresses will be used for the flow. Note that this is the 3917 case even though this protocol, unlike some earlier proposals, 3918 does not overload the flow label as a context tag; the in-path 3919 devices need to know about the use of the new locators even though 3920 the flow label stays the same. 3922 o MTU implications. The path MTU mechanisms we use are robust 3923 against different packets taking different paths through the 3924 Internet, by computing a minimum over the recently observed path 3925 MTUs. When Shim6 fails over from using one locator pair to 3926 another pair, this means that packets might travel over a 3927 different path through the Internet, hence the path MTU might be 3928 quite different. Perhaps such a path change would be a good hint 3929 to the path MTU mechanism to try a larger MTU? 3931 The fact that the shim will add an 8 octet Payload Extension 3932 header to the ULP packets after a locator switch, can also affect 3933 the usable path MTU for the ULPs. In this case the MTU change is 3934 local to the sending host, thus conveying the change to the ULPs 3935 is an implementation matter. 3937 16. Security Considerations 3939 This document satisfies the concerns specified in [15] as follows: 3941 o The HBA [2] and CGA technique [4] for verifying the locators to 3942 prevent an attacker from redirecting the packet stream to 3943 somewhere else. The minimum acceptable key length for public keys 3944 used in the generation of CGAs SHOULD be 1024 bits. Any 3945 implementation should follow prudent cryptographic practice in 3946 determining the appropriate key lengths. 3948 o Requiring a Reachability Probe+Reply before a new locator is used 3949 as the destination, in order to prevent 3rd party flooding 3950 attacks. 3952 o The first message does not create any state on the responder. 3953 Essentially a 3-way exchange is required before the responder 3954 creates any state. This means that a state-based DoS attack 3955 (trying to use up all of memory on the responder) at least 3956 requires the attacker to create state, consuming his own resources 3957 and also it provides an IPv6 address that the attacker was using. 3959 o The context establishment messages use nonces to prevent replay 3960 attacks, and to prevent off-path attackers from interfering with 3961 the establishment. 3963 o Every control message of the Shim6 protocol, past the context 3964 establishment, carry the context tag assigned to the particular 3965 context. This implies that an attacker needs to discover that 3966 context tag before being able to spoof any Shim6 control message. 3967 Such discovery probably requires to be along the path in order to 3968 be sniff the context tag value. The result is that through this 3969 technique, the Shim6 protocol is protected against off-path 3970 attackers. 3972 Interaction with IPsec 3974 The Shim6 sub-layer is implemented below the IPsec layer within the 3975 IP layer. This deserves some additional considerations for a couple 3976 of specific cases: First, it should be noted that the Shim6 approach 3977 does not preclude using IPsec tunnels on Shim6 packets within the 3978 network transit path. Second, in case that IPsec is implemented as 3979 Bump-In-The-Wire (BITW) [3], either the shim MUST be disabled, or the 3980 shim MUST also be implemented as Bump-In-The-Wire, in order to 3981 satisfy the requirement that IPsec is layered above the shim. 3983 Some of the residual threats in this proposal are: 3985 o An attacker which arrives late on the path (after the context has 3986 been established) can use the R1bis message to cause one peer to 3987 recreate the context, and at that point in time the attacker can 3988 observe all of the exchange. But this doesn't seem to open any 3989 new doors for the attacker since such an attacker can observe the 3990 context tags that are being used, and once known it can use those 3991 to send bogus messages. 3993 o An attacker which is present on the path so that it can find out 3994 the context tags, can generate a R1bis message after it has moved 3995 off the path. For this packet to be effective it needs to have a 3996 source locator which belongs to the context, thus there can not be 3997 "too much" ingress filtering between the attackers new location 3998 and the communicating peers. But this doesn't seem to be that 3999 severe, because once the R1bis causes the context to be re- 4000 established, a new pair of context tags will be used, which will 4001 not be known to the attacker. If this is still a concern, we 4002 could require a 2-way handshake "did you really lose the state?" 4003 in response to the error message. 4005 o It might be possible for an attacker to try random 47-bit context 4006 tags and see if they can cause disruption for communication 4007 between two hosts. In particular, in the case of payload packets, 4008 the effects of such attack would be similar of those of an 4009 attacker sending packets with spoofed source address. In the case 4010 of control packets, it is not enough to find the correct context 4011 tag, but additional information is required (e.g. nonces, proper 4012 source addresses) (see previous bullet for the case of R1bis). If 4013 a 47-bit tag, which is the largest that fits in an 8-octet 4014 extension header, isn't sufficient, one could use an even larger 4015 tag in the Shim6 control messages, and use the low-order 47 bits 4016 in the payload extension header. 4018 o When the payload extension header is used, an attacker that can 4019 guess the 47-bit random context tag, can inject packets into the 4020 context with any source locator. Thus if there is ingress 4021 filtering between the attacker, this could potentially allow to 4022 bypass the ingress filtering. However, in addition to guessing 4023 the 47-bit context tag, the attacker also needs to find a context 4024 where, after the receiver's replacement of the locators with the 4025 ULIDs, the the ULP checksum is correct. But even this wouldn't be 4026 sufficient with ULPs like TCP, since the TCP port numbers and 4027 sequence numbers must match an existing connection. Thus, even 4028 though the issues for off-path attackers injecting packets are 4029 different than today with ingress filtering, it is still very hard 4030 for an off-path attacker to guess. If IPsec is applied then the 4031 issue goes away completely. 4033 o The validator included in the R1 and R1bis packets are generated 4034 as a hash of several input parameters. While most of the inputs 4035 are actually determined by the sender, and only the secret value S 4036 is unknown to the sender, the resulting protection is deemed to be 4037 enough since it would be easier for the attacker to just obtain a 4038 new validator sending a I1 packet than performing all the 4039 computations required to determine the secret S. Nevertheless, it 4040 is recommended that the host changes the secret S periodically. 4042 17. IANA Considerations 4044 IANA is directed to allocate a new IP Protocol Number value for the 4045 Shim6 Protocol. 4047 IANA is directed to record a CGA message type for the Shim6 Protocol 4048 in the CGA Extension Type Tags registry with the value 0x4A30 5662 4049 4858 574B 3655 416F 506A 6D48. 4051 IANA is directed to establish a Shim6 Parameter Registry with three 4052 components: Shim6 Type registrations, Shim6 Options registrations 4053 Shim6 Error Code registrations. 4055 The initial contents of the Shim6 Type registry are as follows: 4057 +------------+-----------------------------------------------------+ 4058 | Type Value | Message | 4059 +------------+-----------------------------------------------------+ 4060 | 0 | RESERVED | 4061 | | | 4062 | 1 | I1 (first establishment message from the initiator) | 4063 | | | 4064 | 2 | R1 (first establishment message from the responder) | 4065 | | | 4066 | 3 | I2 (2nd establishment message from the initiator) | 4067 | | | 4068 | 4 | R2 (2nd establishment message from the responder) | 4069 | | | 4070 | 5 | R1bis (Reply to reference to non-existent context) | 4071 | | | 4072 | 6 | I2bis (Reply to a R1bis message) | 4073 | | | 4074 | 7-59 | Can be allocated using Standards Action | 4075 | | | 4076 | 60-63 | For Experimental use | 4077 | | | 4078 | 64 | Update Request | 4079 | | | 4080 | 65 | Update Acknowledgement | 4081 | | | 4082 | 66 | Keepalive | 4083 | | | 4084 | 67 | Probe Message | 4085 | | | 4086 | 68-123 | Can be allocated using Standards Action | 4087 | | | 4088 | 124-127 | For Experimental use | 4089 +------------+-----------------------------------------------------+ 4090 The initial contents of the Shim6 Options registry are as follows: 4092 +-------------+----------------------------------+ 4093 | Type | Option Name | 4094 +-------------+----------------------------------+ 4095 | 0 | RESERVED | 4096 | | | 4097 | 1 | Responder Validator | 4098 | | | 4099 | 2 | Locator List | 4100 | | | 4101 | 3 | Locator Preferences | 4102 | | | 4103 | 4 | CGA Parameter Data Structure | 4104 | | | 4105 | 5 | CGA Signature | 4106 | | | 4107 | 6 | ULID Pair | 4108 | | | 4109 | 7 | Forked Instance Identifier | 4110 | | | 4111 | 8-9 | Allocated using Standards action | 4112 | | | 4113 | 10 | Keepalive Timeout Option | 4114 | | | 4115 | 11-16383 | Allocated using Standards action | 4116 | | | 4117 | 16384-32767 | For Experimental use | 4118 +-------------+----------------------------------+ 4120 The initial contents of the Shim6 Error Code registry are as follows: 4122 +------------+--------------------------------------------+ 4123 | Code Value | Description | 4124 +------------+--------------------------------------------+ 4125 | 0 | Unknown Shim6 message type | 4126 | | | 4127 | 1 | Critical Option not recognized | 4128 | | | 4129 | 2 | Locator verification method failed | 4130 | | | 4131 | 3 | Locator List Generation number out of sync | 4132 | | | 4133 | 4 | Error in the number of locators | 4134 | | | 4135 | 120-127 | Reserved for debugging pruposes | 4136 +------------+--------------------------------------------+ 4138 18. Acknowledgements 4140 Over the years many people active in the multi6 and shim6 WGs have 4141 contributed ideas a suggestions that are reflected in this 4142 specification. Special thanks to the careful comments from Geoff 4143 Huston, Shinta Sugimoto, Pekka Savola, Dave Meyer, Deguang Le, Jari 4144 Arkko, Iljitsch van Beijnum, Jim Bound, Brian Carpenter, Sebastien 4145 Barre, Matthijs Mekking, Dave Thaler, Bob Braden Wesley Eddy and Tom 4146 Henderson on earlier versions of this document. 4148 Appendix A. Possible Protocol Extensions 4150 During the development of this protocol, several issues have been 4151 brought up as important one to address, but are ones that do not need 4152 to be in the base protocol itself but can instead be done as 4153 extensions to the protocol. The key ones are: 4155 o As stated in the assumptions in Section 3, the in order for the 4156 Shim6 protocol to be able to recover from a wide range of 4157 failures, for instance when one of the communicating hosts is 4158 singly-homed, and cope with a site's ISPs that do ingress 4159 filtering based on the source IPv6 address, there is a need for 4160 the host to be able to influence the egress selection from its 4161 site. Further discussion of this issue is captured in [16]. 4163 o Is there need for keeping the list of locators private between the 4164 two communicating endpoints? We can potentially accomplish that 4165 when using CGA but not with HBA, but it comes at the cost of doing 4166 some public key encryption and decryption operations as part of 4167 the context establishment. The suggestion is to leave this for a 4168 future extension to the protocol. 4170 o Defining some form of end-to-end "compression" mechanism that 4171 removes the need for including the Shim6 Payload extension header 4172 when the locator pair is not the ULID pair. 4174 o Supporting the dynamic setting of locator preferences on a site- 4175 wide basis, and use the Locator Preference option in the Shim6 4176 protocol to convey these preferences to remote communicating 4177 hosts. This could mirror the DNS SRV record's notion of priority 4178 and weight. 4180 o Potentially recommend that more application protocols use DNS SRV 4181 records to allow a site some influence on load spreading for the 4182 initial contact (before the Shim6 context establishment) as well 4183 as for traffic which does not use the shim. 4185 o Specifying APIs for the ULPs to be aware of the locators the shim 4186 is using, and be able to influence the choice of locators 4187 (controlling preferences as well as triggering a locator pair 4188 switch). This includes providing APIs the ULPs can use to fork a 4189 shim context. 4191 o Whether it is feasible to relax the suggestions for when context 4192 state is removed, so that one can end up with an asymmetric 4193 distribution of the context state and still get (most of) the shim 4194 benefits. For example, the busy server would go through the 4195 context setup but would quickly remove the context state after 4196 this (in order to save memory) but the not-so-busy client would 4197 retain the context state. The context recovery mechanism 4198 presented in Section 7.5 would then be recreate the state should 4199 the client send either a shim control message (e.g., probe message 4200 because it sees a problem), or a ULP packet in an payload 4201 extension header (because it had earlier failed over to an 4202 alternative locator pair, but had been silent for a while). This 4203 seems to provide the benefits of the shim as long as the client 4204 can detect the failure. If the client doesn't send anything, and 4205 it is the server that tries to send, then it will not be able to 4206 recover because the shim on the server has no context state, hence 4207 doesn't know any alternate locator pairs. 4209 o Study what it would take to make the Shim6 control protocol not 4210 rely at all on a stable source locator in the packets. This can 4211 probably be accomplished by having all the shim control messages 4212 include the ULID-pair option. 4214 o If each host might have lots of locators, then the currently 4215 requirement to include essentially all of them in the I2 and R2 4216 messages might be constraining. If this is the case we can look 4217 into using the CGA Parameter Data Structure for the comparison, 4218 instead of the prefix sets, to be able to detect context 4219 confusion. This would place some constraint on a (logical) only 4220 using e.g., one CGA public key, and would require some carefully 4221 crafted rules on how two PDSs are compared for "being the same 4222 host". But if we don't expect more than a handful locators per 4223 host, then we don't need this added complexity. 4225 o ULP specified timers for the reachability detection mechanism 4226 (which can be useful particularly when there are forked contexts). 4228 o Pre-verify some "backup" locator pair, so that the failover time 4229 can be shorter. 4231 o Study how Shim6 and Mobile IPv6 might interact. There existing an 4232 initial draft on this topic [17]. 4234 Appendix B. Simplified State Machine 4236 The states are defined in Section 6.2. The intent is that the 4237 stylized description below be consistent with the textual description 4238 in the specification, but should they conflict, the textual 4239 description is normative. 4241 The following table describes the possible actions in state IDLE and 4242 their respective triggers: 4244 +---------------------+---------------------------------------------+ 4245 | Trigger | Action | 4246 +---------------------+---------------------------------------------+ 4247 | Receive I1 | Send R1 and stay in IDLE | 4248 | | | 4249 | Heuristics trigger | Send I1 and move to I1-SENT | 4250 | a new context | | 4251 | establishment | | 4252 | | | 4253 | Receive I2, verify | If successful, send R2 and move to | 4254 | validator and | ESTABLISHED | 4255 | RESP nonce | | 4256 | | If fail, stay in IDLE | 4257 | | | 4258 | Receive I2bis, | If successful, send R2 and move to | 4259 | verify validator | ESTABLISHED | 4260 | and RESP nonce | | 4261 | | If fail, stay in IDLE | 4262 | | | 4263 | R1, R1bis, R2 | N/A (This context lacks the required info | 4264 | | for the dispatcher to deliver them) | 4265 | | | 4266 | Receive payload | Send R1bis and stay in IDLE | 4267 | extension header | | 4268 | or other control | | 4269 | packet | | 4270 +---------------------+---------------------------------------------+ 4271 The following table describes the possible actions in state I1-SENT 4272 and their respective triggers: 4274 +---------------------+---------------------------------------------+ 4275 | Trigger | Action | 4276 +---------------------+---------------------------------------------+ 4277 | Receive R1, verify | If successful, send I2 and move to I2-SENT | 4278 | INIT nonce | | 4279 | | If fail, discard and stay in I1-SENT | 4280 | | | 4281 | Receive I1 | Send R2 and stay in I1-SENT | 4282 | | | 4283 | Receive R2, verify | If successful, move to ESTABLISHED | 4284 | INIT nonce | | 4285 | | If fail, discard and stay in I1-SENT | 4286 | | | 4287 | Receive I2, verify | If successful, send R2 and move to | 4288 | validator and RESP | ESTABLISHED | 4289 | nonce | | 4290 | | If fail, discard and stay in I1-SENT | 4291 | | | 4292 | Receive I2bis, | If successful, send R2 and move to | 4293 | verify validator | ESTABLISHED | 4294 | and RESP nonce | | 4295 | | If fail, discard and stay in I1-SENT | 4296 | | | 4297 | Timeout, increment | If counter =< I1_RETRIES_MAX, send I1 and | 4298 | timeout counter | stay in I1-SENT | 4299 | | | 4300 | | If counter > I1_RETRIES_MAX, go to E-FAILED | 4301 | | | 4302 | Receive ICMP payload| Move to E-FAILED | 4303 | unknown error | | 4304 | | | 4305 | R1bis | N/A (Dispatcher doesn't deliver since | 4306 | | CT(peer) is not set) | 4307 | | | 4308 | Receive Payload or | Discard and stay in I1-SENT | 4309 | extension header | | 4310 | or other control | | 4311 | packet | | 4312 +---------------------+---------------------------------------------+ 4313 The following table describes the possible actions in state I2-SENT 4314 and their respective triggers: 4316 +---------------------+---------------------------------------------+ 4317 | Trigger | Action | 4318 +---------------------+---------------------------------------------+ 4319 | Receive R2, verify | If successful move to ESTABLISHED | 4320 | INIT nonce | | 4321 | | If fail, stay in I2-SENT | 4322 | | | 4323 | Receive I1 | Send R2 and stay in I2-SENT | 4324 | | | 4325 | Receive I2 | Send R2 and stay in I2-SENT | 4326 | verify validator | | 4327 | and RESP nonce | | 4328 | | | 4329 | Receive I2bis | Send R2 and stay in I2-SENT | 4330 | verify validator | | 4331 | and RESP nonce | | 4332 | | | 4333 | Receive R1 | Discard and stay in I2-SENT | 4334 | | | 4335 | Timeout, increment | If counter =< I2_RETRIES_MAX, send I2 and | 4336 | timeout counter | stay in I2-SENT | 4337 | | | 4338 | | If counter > I2_RETRIES_MAX, send I1 and go | 4339 | | to I1-SENT | 4340 | | | 4341 | R1bis | N/A (Dispatcher doesn't deliver since | 4342 | | CT(peer) is not set) | 4343 | | | 4344 | Receive payload or | Accept and send I2 (probably R2 was sent | 4345 | extension header | by peer and lost) | 4346 | other control | | 4347 | packet | | 4348 +---------------------+---------------------------------------------+ 4349 The following table describes the possible actions in state I2BIS- 4350 SENT and their respective triggers: 4352 +---------------------+---------------------------------------------+ 4353 | Trigger | Action | 4354 +---------------------+---------------------------------------------+ 4355 | Receive R2, verify | If successful move to ESTABLISHED | 4356 | INIT nonce | | 4357 | | If fail, stay in I2BIS-SENT | 4358 | | | 4359 | Receive I1 | Send R2 and stay in I2BIS-SENT | 4360 | | | 4361 | Receive I2 | Send R2 and stay in I2BIS-SENT | 4362 | verify validator | | 4363 | and RESP nonce | | 4364 | | | 4365 | Receive I2bis | Send R2 and stay in I2BIS-SENT | 4366 | verify validator | | 4367 | and RESP nonce | | 4368 | | | 4369 | Receive R1 | Discard and stay in I2BIS-SENT | 4370 | | | 4371 | Timeout, increment | If counter =< I2_RETRIES_MAX, send I2bis | 4372 | timeout counter | and stay in I2BIS-SENT | 4373 | | | 4374 | | If counter > I2_RETRIES_MAX, send I1 and | 4375 | | go to I1-SENT | 4376 | | | 4377 | R1bis | N/A (Dispatcher doesn't deliver since | 4378 | | CT(peer) is not set) | 4379 | | | 4380 | Receive payload or | Accept and send I2bis (probably R2 was | 4381 | extension header | sent by peer and lost) | 4382 | other control | | 4383 | packet | | 4384 +---------------------+---------------------------------------------+ 4385 The following table describes the possible actions in state 4386 ESTABLISHED and their respective triggers: 4388 +---------------------+---------------------------------------------+ 4389 | Trigger | Action | 4390 +---------------------+---------------------------------------------+ 4391 | Receive I1, compare | If no match, send R1 and stay in ESTABLISHED| 4392 | CT(peer) with | | 4393 | received CT | If match, send R2 and stay in ESTABLISHED | 4394 | | | 4395 | | | 4396 | Receive I2, verify | If successful, then send R2 and stay in | 4397 | validator and RESP | ESTABLISHED | 4398 | nonce | | 4399 | | Otherwise, discard and stay in ESTABLISHED | 4400 | | | 4401 | Receive I2bis, | If successful, then send R2 and stay in | 4402 | verify validator | ESTABLISHED | 4403 | and RESP nonce | | 4404 | | Otherwise, discard and stay in ESTABLISHED | 4405 | | | 4406 | Receive R2 | Discard and stay in ESTABLISHED | 4407 | | | 4408 | Receive R1 | Discard and stay in ESTABLISHED | 4409 | | | 4410 | Receive R1bis | Send I2bis and move to I2BIS-SENT | 4411 | | | 4412 | | | 4413 | Receive payload or | Process and stay in ESTABLISHED | 4414 | extension header | | 4415 | other control | | 4416 | packet | | 4417 | | | 4418 | Implementation | Discard state and go to IDLE | 4419 | specific heuristic | | 4420 | (E.g., No open ULP | | 4421 | sockets and idle | | 4422 | for some time ) | | 4423 +---------------------+---------------------------------------------+ 4424 The following table describes the possible actions in state E-FAILED 4425 and their respective triggers: 4427 +---------------------+---------------------------------------------+ 4428 | Trigger | Action | 4429 +---------------------+---------------------------------------------+ 4430 | Wait for | Go to IDLE | 4431 | NO_R1_HOLDDOWN_TIME | | 4432 | | | 4433 | Any packet | Process as in IDLE | 4434 +---------------------+---------------------------------------------+ 4436 The following table describes the possible actions in state NO- 4437 SUPPORT and their respective triggers: 4439 +---------------------+---------------------------------------------+ 4440 | Trigger | Action | 4441 +---------------------+---------------------------------------------+ 4442 | Wait for | Go to IDLE | 4443 | ICMP_HOLDDOWN_TIME | | 4444 | | | 4445 | Any packet | Process as in IDLE | 4446 +---------------------+---------------------------------------------+ 4448 Appendix B.1. Simplified State Machine diagram 4449 Timeout/Null +------------+ 4450 I1/R1 +------------------| NO SUPPORT | 4451 Payload or Control/R1bis | +------------+ 4452 +---------+ | ^ 4453 | | | ICMP Error/Null| 4454 | V V | 4455 +-----------------+ Timeout/Null +----------+ | 4456 | |<---------------| E-FAILED | | 4457 +-| IDLE | +----------+ | 4458 I2 or I2bis/R2 | | | ^ | 4459 | +-----------------+ (Tiemout#>MAX)/Null| | 4460 | ^ | | | 4461 | | +------+ | | 4462 I2 or I2bis/R2 | | Heuristic/I1| I1/R2 | | 4463 Payload/Null | | | Control/Null | | 4464 I1/R1 or R2 | +--+ | Payload/Null | | 4465 R1 or R2/Null | |Heuristic/Null | (Tiemout#| | 4470 | ESTABLISHED |<----------------------------| I1-SENT | 4471 | | | | 4472 +-------------------+ +----------------+ 4473 | ^ ^ | ^ ^ 4474 | | |R2/Null +-------------+ | | 4475 | | +----------+ |R1/I2 | | 4476 | | | V | | 4477 | | +------------------+ | | 4478 | | | |-------------+ | 4479 | | | I2-SENT | (Timeout#>Max)/I1 | 4480 | | | | | 4481 | | +------------------+ | 4482 | | | ^ | 4483 | | +--------------+ | 4484 | | I1 or I2bis or I2/R2 | 4485 | | (Timeout#Max)/I1 | 4488 | R2/Null| +------------------------------------------+ 4489 | V | 4490 | +-------------------+ 4491 | | |<-+ (Timeout#| I2bis-SENT | | I1 or I2 or I2bis/R2 4493 R1bis/I2bis | |--+ R1 or R1bis/Null 4494 +-------------------+ Payload/I2bis 4496 Appendix C. Context Tag Reuse 4498 The Shim6 protocol doesn't have a mechanism for coordinated state 4499 removal between the peers, because such state removal doesn't seem to 4500 help given that a host can crash and reboot at any time. A result of 4501 this is that the protocol needs to be robust against a context tag 4502 being reused for some other context. This section summarizes the 4503 different cases in which a tag can be reused, and how the recovery 4504 works. 4506 The different cases are exemplified by the following case. Assume 4507 host A and B were communicating using a context with the ULID pair 4508 , and that B had assigned context tag X to this context. We 4509 assume that B uses only the context tag to demultiplex the received 4510 payload extension headers, since this is the more general case. 4511 Further we assume that B removes this context state, while A retains 4512 it. B might then at a later time assign CT(local)=X to some other 4513 context, and we have several cases: 4515 o The context tag is reassigned to a context for the same ULID pair 4516 . We've called this "Context Recovery" in this document. 4518 o The context tag is reassigned to a context for a different ULID 4519 pair between the same to hosts, e.g., . We've called this 4520 "Context Confusion" in this document. 4522 o The context tag is reassigned to a context between B and other 4523 host C, for instance for the ULID pair . That is a form 4524 of three party context confusion. 4526 Appendix C.1. Context Recovery 4528 This case is relatively simple, and is discussed in Section 7.5. The 4529 observation is that since the ULID pair is the same, when either A or 4530 B tries to establish the new context, A can keep the old context 4531 while B re-creates the context with the same context tag CT(B) = X. 4533 Appendix C.2. Context Confusion 4535 This cases is a bit more complex, and is discussed in Section 7.6. 4536 When the new context is created, whether A or B initiates it, host A 4537 can detect when it receives B's locator set (in the I2, or R2 4538 message), that it ends up with two contexts to the same peer host 4539 (overlapping Ls(peer) locator sets) that have the same context tag 4540 CT(peer) = X. At this point in time host A can clear up any 4541 possibility of causing confusion by not using the old context to send 4542 any more packets. It either just discards the old context (it might 4543 not be used by any ULP traffic, since B had discarded it), or it 4544 recreates a different context for the old ULID pair (), for 4545 which B will assign a unique CT(B) as part of the normal context 4546 establishment mechanism. 4548 Appendix C.3. Three Party Context Confusion 4550 The third case does not have a place where the old state on A can be 4551 verified, since the new context is established between B and C. Thus 4552 when B receives payload extension headers with X as the context tag, 4553 it will find the context for , hence rewrite the packets to 4554 have C3 in the source address field and B2 in the destination address 4555 field before passing them up to the ULP. This rewriting is correct 4556 when the packets are in fact sent by host C, but if host A ever 4557 happens to send a packet using the old context, then the ULP on A 4558 sends a packet with ULIDs and the packet arrives at the ULP 4559 on B with ULIDs . 4561 This is clearly an error, and the packet will most likely be rejected 4562 by the ULP on B due to a bad pseudo-header checksum. Even if the 4563 checksum is ok (probability 2^-16), the ULP isn't likely to have a 4564 connection for those ULIDs and port numbers. And if the ULP is 4565 connection-less, processing the packet is most likely harmless; such 4566 a ULP must be able to copy with random packets being sent by random 4567 peers in any case. 4569 This broken state, where packets sent from A to B using the old 4570 context on host A might persist for some time, but it will not remain 4571 for very long. The unreachability detection on host A will kick in, 4572 because it does not see any return traffic (payload or Keepalive 4573 messages) for the context. This will result in host A sending Probe 4574 messages to host B to find a working locator pair. The effect of 4575 this is that host B will notice that it does not have a context for 4576 the ULID pair and CT(B) = X, which will make host B send an 4577 R1bis packet to re-establish that context. The re-established 4578 context, just like in the previous section, will get a unique CT(B) 4579 assigned by host B, thus there will no longer be any confusion. 4581 In summary, there are cases where a context tag might be reused while 4582 some peer retains the state, but the protocol can recover from it. 4583 The probability of these events is low given the 47 bit context tag 4584 size. However, it is important that these recovery mechanisms be 4585 tested. Thus during development and testing it is recommended that 4586 implementations not use the full 47 bit space, but instead keep e.g. 4587 the top 40 bits as zero, only leaving the host with 128 unique 4588 context tags. This will help test the recovery mechanisms. 4590 Appendix D. Design Alternatives 4592 This document has picked a certain set of design choices in order to 4593 try to work out a bunch of the details, and stimulate discussion. 4594 But as has been discussed on the mailing list, there are other 4595 choices that make sense. This appendix tries to enumerate some 4596 alternatives. 4598 Appendix D.1. Context granularity 4600 Over the years various suggestions have been made whether the shim 4601 should, even if it operates at the IP layer, be aware of ULP 4602 connections and sessions, and as a result be able to make separate 4603 shim contexts for separate ULP connections and sessions. A few 4604 different options have been discussed: 4606 o Each ULP connection maps to its own shim context. 4608 o The shim is unaware of the ULP notion of connections and just 4609 operates on a host-to-host (IP address) granularity. 4611 o Hybrids where the shim is aware of some ULPs (such as TCP) and 4612 handles other ULPs on a host-to-host basis. 4614 Having shim state for every ULP connection potentially means higher 4615 overhead since the state setup overhead might become significant; 4616 there is utility in being able to amortize this over multiple 4617 connections. 4619 But being completely unaware of the ULP connections might hamper ULPs 4620 that want different communication to use different locator pairs, for 4621 instance for quality or cost reasons. 4623 The protocol has a shim which operates with host-level granularity 4624 (strictly speaking, with ULID-pair granularity, to be able to 4625 amortize the context establishment over multiple ULP connections. 4626 This is combined with the ability for shim-aware ULPs to request 4627 context forking so that different ULP traffic can use different 4628 locator pairs. 4630 Appendix D.2. Demultiplexing of data packets in Shim6 communications 4632 Once a ULID-pair context is established between two hosts, packets 4633 may carry locators that differ from the ULIDs presented to the ULPs 4634 using the established context. One of main functions of the Shim6 4635 layer is to perform the mapping between the locators used to forward 4636 packets through the network and the ULIDs presented to the ULP. In 4637 order to perform that translation for incoming packets, the Shim6 4638 layer needs to first identify which of the incoming packets need to 4639 be translated and then perform the mapping between locators and ULIDs 4640 using the associated context. Such operation is called 4641 demultiplexing. It should be noted that because any address can be 4642 used both as a locator and as a ULID, additional information other 4643 than the addresses carried in packets, need to be taken into account 4644 for this operation. 4646 For example, if a host has address A1 and A2 and starts communicating 4647 with a peer with addresses B1 and B2, then some communication 4648 (connections) might use the pair as ULID and others might 4649 use e.g., . Initially there are no failures so these address 4650 pairs are used as locators i.e. in the IP address fields in the 4651 packets on the wire. But when there is a failure the Shim6 layer on 4652 A might decide to send packets that used as ULIDs using as the locators. In this case B needs to be able to rewrite the 4654 IP address field for some packets and not others, but the packets all 4655 have the same locator pair. 4657 In order to accomplish the demultiplexing operation successfully, 4658 data packets carry a context tag that allows the receiver of the 4659 packet to determine the shim context to be used to perform the 4660 operation. 4662 Two mechanisms for carrying the context tag information have been 4663 considered in depth during the shim protocol design. Those carrying 4664 the context tag in the flow label field of the IPv6 header and the 4665 usage of a new extension header to carry the context tag. In this 4666 appendix we will describe the pros and cons of each approach and 4667 justify the selected option. 4669 Appendix D.2.1. Flow-label 4671 A possible approach is to carry the context tag in the Flow Label 4672 field of the IPv6 header. This means that when a Shim6 context is 4673 established, a Flow Label value is associated with this context (and 4674 perhaps a separate flow label for each direction). 4676 The simplest approach that does this is to have the triple identify the context at 4678 the receiver. 4680 The problem with this approach is that because the locator sets are 4681 dynamic, it is not possible at any given moment to be sure that two 4682 contexts for which the same context tag is allocated will have 4683 disjoint locator sets during the lifetime of the contexts. 4685 Suppose that Node A has addresses IPA1, IPA2, IPA3 and IPA4 and that 4686 Host B has addresses IPB1 and IPB2. 4688 Suppose that two different contexts are established between HostA and 4689 HostB. 4691 Context #1 is using IPA1 and IPB1 as ULIDs. The locator set 4692 associated to IPA1 is IPA1 and IPA2 while the locator set associated 4693 to IPB1 is just IPB1. 4695 Context #2 uses IPA3 and IPB2 as ULIDs. The locator set associated 4696 to IPA3 is IPA3 and IPA4 and the locator set associated to IPB2 is 4697 just IPB2. 4699 Because the locator sets of the Context #1 and Context #2 are 4700 disjoint, hosts could think that the same context tag value can be 4701 assigned to both of them. The problem arrives when later on IPA3 is 4702 added as a valid locator for IPA1 and IPB2 is added as a valid 4703 locator for IPB1 in Context #1. In this case, the triple would not identify a 4705 unique context anymore and correct demultiplexing is no longer 4706 possible. 4708 A possible approach to overcome this limitation is simply not to 4709 repeat the Flow Label values for any communication established in a 4710 host. This basically means that each time a new communication that 4711 is using different ULIDs is established, a new Flow Label value is 4712 assigned to it. By this mean, each communication that is using 4713 different ULIDs can be differentiated because it has a different Flow 4714 Label value. 4716 The problem with such approach is that it requires that the receiver 4717 of the communication allocates the Flow Label value used for incoming 4718 packets, in order to assign them uniquely. For this, a shim 4719 negotiation of the Flow Label value to use in the communication is 4720 needed before exchanging data packets. This poses problems with non- 4721 shim capable hosts, since they would not be able to negotiate an 4722 acceptable value for the Flow Label. This limitation can be lifted 4723 by marking the packets that belong to shim sessions from those that 4724 do not. These marking would require at least a bit in the IPv6 4725 header that is not currently available, so more creative options 4726 would be required, for instance using new Next Header values to 4727 indicate that the packet belongs to a Shim6 enabled communication and 4728 that the Flow Label carries context information as proposed in the 4729 now expired NOID draft. However, even if this is done, this approach 4730 is incompatible with the deferred establishment capability of the 4731 shim protocol, which is a preferred function, since it suppresses the 4732 delay due to the shim context establishment prior to initiation of 4733 the communication and it also allows nodes to define at which stage 4734 of the communication they decide, based on their own policies, that a 4735 given communication requires to be protected by the shim. 4737 In order to cope with the identified limitations, an alternative 4738 approach that does not constraints the flow label values used by 4739 communications that are using ULIDs equal to the locators (i.e. no 4740 shim translation) is to only require that different flow label values 4741 are assigned to different shim contexts. In such approach 4742 communications start with unmodified flow label usage (could be zero, 4743 or as suggested in [12]). The packets sent after a failure when a 4744 different locator pair is used would use a completely different flow 4745 label, and this flow label could be allocated by the receiver as part 4746 of the shim context establishment. Since it is allocated during the 4747 context establishment, the receiver of the "failed over" packets can 4748 pick a flow label of its choosing (that is unique in the sense that 4749 no other context is using it as a context tag), without any 4750 performance impact, and respecting that for each locator pair, the 4751 flow label value used for a given locator pair doesn't change due to 4752 the operation of the multihoming shim. 4754 In this approach, the constraint is that Flow Label values being used 4755 as context identifiers cannot be used by other communications that 4756 use non-disjoint locator sets. This means that once that a given 4757 Flow Label value has been assigned to a shim context that has a 4758 certain locator sets associated, the same value cannot be used for 4759 other communications that use an address pair that is contained in 4760 the locator sets of the context. This is a constraint in the 4761 potential Flow Label allocation strategies. 4763 A possible workaround to this constraint is to mark shim packets that 4764 require translation, in order to differentiate them from regular IPv6 4765 packets, using the artificial Next Header values described above. In 4766 this case, the Flow Label values constrained are only those of the 4767 packets that are being translated by the shim. This last approach 4768 would be the preferred approach if the context tag is to be carried 4769 in the Flow Label field. This is not only because it imposes the 4770 minimum constraints to the Flow Label allocation strategies, limiting 4771 the restrictions only to those packets that need to be translated by 4772 the shim, but also because Context Loss detection mechanisms greatly 4773 benefit from the fact that shim data packets are identified as such, 4774 allowing the receiving end to identify if a shim context associated 4775 to a received packet is suppose to exist, as it will be discussed in 4776 the Context Loss detection appendix below. 4778 Appendix D.2.2. Extension Header 4780 Another approach, which is the one selected for this protocol, is to 4781 carry the context tag in a new Extension Header. These context tags 4782 are allocated by the receiving end during the Shim6 protocol initial 4783 negotiation, implying that each context will have two context tags, 4784 one for each direction. Data packets will be demultiplexed using the 4785 context tag carried in the Extension Header. This seems a clean 4786 approach since it does not overload existing fields. However, it 4787 introduces additional overhead in the packet due to the additional 4788 header. The additional overhead introduced is 8 octets. However, it 4789 should be noted that the context tag is only required when a locator 4790 other than the one used as ULID is contained in the packet. Packets 4791 where both the source and destination address fields contain the 4792 ULIDs do not require a context tag, since no rewriting is necessary 4793 at the receiver. This approach would reduce the overhead, because 4794 the additional header is only required after a failure. On the other 4795 hand, this approach would cause changes in the available MTU for some 4796 packets, since packets that include the Extension Header will have an 4797 MTU 8 octets shorter. However, path changes through the network can 4798 result in different MTU in any case, thus having a locator change, 4799 which implies a path change, affect the MTU doesn't introduce any new 4800 issues. 4802 Appendix D.3. Context Loss Detection 4804 In this appendix we will present different approaches considered to 4805 detect context loss and potential context recovery strategies. The 4806 scenario being considered is the following: Node A and Node B are 4807 communicating using IPA1 and IPB1. Sometime later, a shim context is 4808 established between them, with IPA1 and IPB1 as ULIDs and 4809 IPA1,...,IPAn and IPB1,...,IPBm as locator set respectively. 4811 It may happen, that later on, one of the hosts, e.g. Host A loses 4812 the shim context. The reason for this can be that Host A has a more 4813 aggressive garbage collection policy than HostB or that an error 4814 occurred in the shim layer at host A resulting in the loss of the 4815 context state. 4817 The mechanisms considered in this appendix are aimed to deal with 4818 this problem. There are essentially two tasks that need to be 4819 performed in order to cope with this problem: first, the context loss 4820 must be detected and second the context needs to be recovered/ 4821 reestablished. 4823 Mechanisms for detecting context loss. 4825 These mechanisms basically consist in that each end of the context 4826 periodically sends a packet containing context-specific information 4827 to the other end. Upon reception of such packets, the receiver 4828 verifies that the required context exists. In case that the context 4829 does not exist, it sends a packet notifying the problem to the 4830 sender. 4832 An obvious alternative for this would be to create a specific context 4833 keepalive exchange, which consists in periodically sending packets 4834 with this purpose. This option was considered and discarded because 4835 it seemed an overkill to define a new packet exchange to deal with 4836 this issue. 4838 An alternative is to piggyback the context loss detection function in 4839 other existent packet exchanges. In particular, both shim control 4840 and data packets can be used for this. 4842 Shim control packets can be trivially used for this, because they 4843 carry context specific information, so that when a node receives one 4844 of such packets, it will verify if the context exists. However, shim 4845 control frequency may not be adequate for context loss detection 4846 since control packet exchanges can be very limited for a session in 4847 certain scenarios. 4849 Data packets, on the other hand, are expected to be exchanged with a 4850 higher frequency but they do not necessarily carry context specific 4851 information. In particular, packets flowing before a locator change 4852 (i.e. packet carrying the ULIDs in the address fields) do not need 4853 context information since they do not need any shim processing. 4854 Packets that carry locators that differ from the ULIDs carry context 4855 information. 4857 However, we need to make a distinction here between the different 4858 approaches considered to carry the context tag, in particular between 4859 those approaches where packets are explicitly marked as shim packets 4860 and those approaches where packets are not marked as such. For 4861 instance, in the case where the context tag is carried in the Flow 4862 Label and packets are not marked as shim packets (i.e. no new Next 4863 Header values are defined for shim), a receiver that has lost the 4864 associated context is not able to detect that the packet is 4865 associated with a missing context. The result is that the packet 4866 will be passed unchanged to the upper layer protocol, which in turn 4867 will probably silently discard it due to a checksum error. The 4868 resulting behavior is that the context loss is undetected. This is 4869 one additional reason to discard an approach that carries the context 4870 tag in the Flow Label field and does not explicitly mark the shim 4871 packets as such. On the other hand, approaches that mark shim data 4872 packets (like the Extension Header or the Flow Label with new Next 4873 Header values approaches) allow the receiver to detect if the context 4874 associated to the received packet is missing. In this case, data 4875 packets also perform the function of a context loss detection 4876 exchange. However, it must be noted that only those packets that 4877 carry a locator that differs form the ULID are marked. This 4878 basically means that context loss will be detected after an outage 4879 has occurred i.e. alternative locators are being used. 4881 Summarizing, the proposed context loss detection mechanisms uses shim 4882 control packets and payload extension headers to detect context loss. 4883 Shim control packets detect context loss during the whole lifetime of 4884 the context, but the expected frequency in some cases is very low. 4885 On the other hand, payload extension headers have a higher expected 4886 frequency in general, but they only detect context loss after an 4887 outage. This behavior implies that it will be common that context 4888 loss is detected after a failure i.e. once that it is actually 4889 needed. Because of that, a mechanism for recovering from context 4890 loss is required if this approach is used. 4892 Overall, the mechanism for detecting lost context would work as 4893 follows: the end that still has the context available sends a message 4894 referring to the context. Upon the reception of such message, the 4895 end that has lost the context identifies the situation and notifies 4896 the context loss event to the other end by sending a packet 4897 containing the lost context information extracted from the received 4898 packet. 4900 One option is to simply send an error message containing the received 4901 packets (or at least as much of the received packet that the MTU 4902 allows to fit in). One of the goals of this notification is to allow 4903 the other end that still retains context state, to reestablish the 4904 lost context. The mechanism to reestablish the loss context consists 4905 in performing the 4-way initial handshake. This is a time consuming 4906 exchange and at this point time may be critical since we are 4907 reestablishing a context that is currently needed (because context 4908 loss detection may occur after a failure). So, another option, which 4909 is the one used in this protocol, is to replace the error message by 4910 a modified R1 message, so that the time required to perform the 4911 context establishment exchange can be reduced. Upon the reception of 4912 this modified R1 message, the end that still has the context state 4913 can finish the context establishment exchange and restore the lost 4914 context. 4916 Appendix D.4. Securing locator sets 4918 The adoption of a protocol like SHIM that allows the binding of a 4919 given ULID with a set of locators opens the doors for different types 4920 of redirection attacks as described in [15]. The goal in terms of 4921 security for the design of the shim protocol is not to introduce any 4922 new vulnerability in the Internet architecture. It is a non-goal to 4923 provide additional protection than the currently available in the 4924 single-homed IPv6 Internet. 4926 Multiple security mechanisms were considered to protect the shim 4927 protocol. In this appendix we will present some of them. 4929 The simplest option to protect the shim protocol was to use cookies 4930 i.e. a randomly generated bit string that is negotiated during the 4931 context establishment phase and then it is included in following 4932 signaling messages. By this mean, it would be possible to verify 4933 that the party that was involved in the initial handshake is the same 4934 party that is introducing new locators. Moreover, before using a new 4935 locator, an exchange is performed through the new locator, verifying 4936 that the party located at the new locator knows the cookie i.e. that 4937 it is the same party that performed the initial handshake. 4939 While this security mechanisms does indeed provide a fair amount of 4940 protection, it does leave the door open for the so-called time 4941 shifted attacks. In these attacks, an attacker that once was on the 4942 path, it discovers the cookie by sniffing any signaling message. 4943 After that, the attacker can leave the path and still perform a 4944 redirection attack, since as he is in possession of the cookie, he 4945 can introduce a new locator in the locator set and he can also 4946 successfully perform the reachability exchange if he is able to 4947 receive packets at the new locator. The difference with the current 4948 single-homed IPv6 situation is that in the current situation the 4949 attacker needs to be on-path during the whole lifetime of the attack, 4950 while in this new situation where only cookie protection if provided, 4951 an attacker that once was on the path can perform attacks after he 4952 has left the on-path location. 4954 Moreover, because the cookie is included in signaling messages, the 4955 attacker can discover the cookie by sniffing any of them, making the 4956 protocol vulnerable during the whole lifetime of the shim context. A 4957 possible approach to increase the security was to use a shared secret 4958 i.e. a bit string that is negotiated during the initial handshake but 4959 that is used as a key to protect following messages. With this 4960 technique, the attacker must be present on the path sniffing packets 4961 during the initial handshake, since it is the only moment where the 4962 shared secret is exchanged. While this improves the security, it is 4963 still vulnerable to time shifted attacks, even though it imposes that 4964 the attacker must be on path at a very specific moment (the 4965 establishment phase) to actually be able to launch the attack. While 4966 this seems to substantially improve the situation, it should be noted 4967 that, depending on protocol details, an attacker may be able to force 4968 the recreation of the initial handshake (for instance by blocking 4969 messages and making the parties think that the context has been 4970 lost), so the resulting situation may not differ that much from the 4971 cookie based approach. 4973 Another option that was discussed during the design of the protocol 4974 was the possibility of using IPsec for protecting the shim protocol. 4975 Now, the problem under consideration in this scenario is how to 4976 securely bind an address that is being used as ULID with a locator 4977 set that can be used to exchange packets. The mechanism provided by 4978 IPsec to securely bind the address used with the cryptographic keys 4979 is the usage of digital certificates. This implies that an IPsec 4980 based solution would require that the generation of digital 4981 certificates that bind the key and the ULID by a common third trusted 4982 party for both parties involved in the communication. Considering 4983 that the scope of application of the shim protocol is global, this 4984 would imply a global public key infrastructure. The major issues 4985 with this approach are the deployment difficulties associated with a 4986 global PKI. 4988 Finally two different technologies were selected to protect the shim 4989 protocol: HBA [4] and CGA [2]. These two approaches provide a 4990 similar level of protection but they provide different functionality 4991 with a different computational cost. 4993 The HBA mechanism relies on the capability of generating all the 4994 addresses of a multihomed host as an unalterable set of intrinsically 4995 bound IPv6 addresses, known as an HBA set. In this approach, 4996 addresses incorporate a cryptographic one-way hash of the prefix-set 4997 available into the interface identifier part. The result is that the 4998 binding between all the available addresses is encoded within the 4999 addresses themselves, providing hijacking protection. Any peer using 5000 the shim protocol node can efficiently verify that the alternative 5001 addresses proposed for continuing the communication are bound to the 5002 initial address through a simple hash calculation. A limitation of 5003 the HBA technique is that once generated the address set is fixed and 5004 cannot be changed without also changing all the addresses of the HBA 5005 set. In other words, the HBA technique does not support dynamic 5006 addition of address to a previously generated HBA set. An advantage 5007 of this approach is that it requires only hash operations to verify a 5008 locator set, imposing very low computational cost to the protocol. 5010 In a CGA based approach the address used as ULID is a CGA that 5011 contains a hash of a public key in its interface identifier. The 5012 result is a secure binding between the ULID and the associated key 5013 pair. This allows each peer to use the corresponding private key to 5014 sign the shim messages that convey locator set information. The 5015 trust chain in this case is the following: the ULID used for the 5016 communication is securely bound to the key pair because it contains 5017 the hash of the public key, and the locator set is bound to the 5018 public key through the signature. The CGA approach then supports 5019 dynamic addition of new locators in the locator set, since in order 5020 to do that, the node only needs to sign the new locator with the 5021 private key associated with the CGA used as ULID. A limitation of 5022 this approach is that it imposes systematic usage of public key 5023 cryptography with its associate computational cost. 5025 Any of these two mechanisms HBA and CGA provide time-shifted attack 5026 protection, since the ULID is securely bound to a locator set that 5027 can only be defined by the owner of the ULID. 5029 So, the design decision adopted was that both mechanisms HBA and CGA 5030 are supported, so that when only stable address sets are required, 5031 the nodes can benefit from the low computational cost offered by HBA 5032 while when dynamic locator sets are required, this can be achieved 5033 through CGAs with an additional cost. Moreover, because HBAs are 5034 defined as a CGA extension, the addresses available in a node can 5035 simultaneously be CGAs and HBAs, allowing the usage of the HBA and 5036 CGA functionality when needed without requiring a change in the 5037 addresses used. 5039 Appendix D.5. ULID-pair context establishment exchange 5041 Two options were considered for the ULID-pair context establishment 5042 exchange: a 2-way handshake and a 4-way handshake. 5044 A key goal for the design of this exchange was that protection 5045 against DoS attacks. The attack under consideration was basically a 5046 situation where an attacker launches a great amount of ULID-pair 5047 establishment request packets, exhausting victim's resources, similar 5048 to TCP SYN flooding attacks. 5050 A 4 way-handshake exchange protects against these attacks because the 5051 receiver does not creates any state associate to a given context 5052 until the reception of the second packet which contains a prior 5053 contact proof in the form of a token. At this point the receiver can 5054 verify that at least the address used by the initiator is at some 5055 extent valid, since the initiator is able to receive packets at this 5056 address. In the worse case, the responder can track down the 5057 attacker using this address. The drawback of this approach is that 5058 it imposes a 4 packet exchange for any context establishment. This 5059 would be a great deal if the shim context needed to be established up 5060 front, before the communication can proceed. However, thanks to 5061 deferred context establishment capability of the shim protocol, this 5062 limitation has a reduced impact in the performance of the protocol. 5063 (It may however have a greater impact in the situation of context 5064 recover as discussed earlier, but in this case, it is possible to 5065 perform optimizations to reduce the number of packets as described 5066 above) 5068 The other option considered was a 2-way handshake with the 5069 possibility to fall back to a 4-way handshake in case of attack. In 5070 this approach, the ULID-pair establishment exchange normally consists 5071 in a 2-packet exchange and it does not verify that the initiator has 5072 performed a prior contact before creating context state. In case 5073 that a DoS attack is detected, the responder falls back to a 4-way 5074 handshake similar to the one described previously in order to prevent 5075 the detected attack to proceed. The main difficulty with this attack 5076 is how to detect that a responder is currently under attack. It 5077 should be noted, that because this is 2-way exchange, it is not 5078 possible to use the number of half open sessions (as in TCP) to 5079 detect an ongoing attack and different heuristics need to be 5080 considered. 5082 The design decision taken was that considering the current impact of 5083 DoS attacks and the low impact of the 4-way exchange in the shim 5084 protocol thanks to the deferred context establishment capability, a 5085 4-way exchange would be adopted for the base protocol. 5087 Appendix D.6. Updating locator sets 5089 There are two possible approaches to the addition and removal of 5090 locators: atomic and differential approaches. The atomic approach 5091 essentially send the complete locators set each time that a variation 5092 in the locator set occurs. The differential approach send the 5093 differences between the existing locator set and the new one. The 5094 atomic approach imposes additional overhead, since all the locator 5095 set has to be exchanged each time while the differential approach 5096 requires re-synchronization of both ends through changes i.e. that 5097 both ends have the same idea about what the current locator set is. 5099 Because of the difficulties imposed by the synchronization 5100 requirement, the atomic approach was selected. 5102 Appendix D.7. State Cleanup 5104 There are essentially two approaches for discarding an existing state 5105 about locators, keys and identifiers of a correspondent node: a 5106 coordinated approach and an unilateral approach. 5108 In the unilateral approach, each node discards the information about 5109 the other node without coordination with the other node based on some 5110 local timers and heuristics. No packet exchange is required for 5111 this. In this case, it would be possible that one of the nodes has 5112 discarded the state while the other node still hasn't. In this case, 5113 a No-Context error message may be required to inform about the 5114 situation and possibly a recovery mechanism is also needed. 5116 A coordinated approach would use an explicit CLOSE mechanism, akin to 5117 the one specified in HIP [19]. If an explicit CLOSE handshake and 5118 associated timer is used, then there would no longer be a need for 5119 the No Context Error message due to a peer having garbage collected 5120 its end of the context. However, there is still potentially a need 5121 to have a No Context Error message in the case of a complete state 5122 loss of the peer (also known as a crash followed by a reboot). Only 5123 if we assume that the reboot takes at least the CLOSE timer, or that 5124 it is ok to not provide complete service until CLOSE timer minutes 5125 after the crash, can we completely do away with the No Context Error 5126 message. 5128 In addition, other aspect that is relevant for this design choice is 5129 the context confusion issue. In particular, using an unilateral 5130 approach to discard context state clearly opens the possibility of 5131 context confusion, where one of the ends unilaterally discards the 5132 context state, while the peer does not. In this case, the end that 5133 has discarded the state can re-use the context tag value used for the 5134 discarded state for a another context, creating a potential context 5135 confusion situation. In order to illustrate the cases where problems 5136 would arise consider the following scenario: 5138 o Hosts A and B establish context 1 using CTA and CTB as context 5139 tags. 5141 o Later on, A discards context 1 and the context tag value CTA 5142 becomes available for reuse. 5144 o However, B still keeps context 1. 5146 This would become a context confusion situation in the following two 5147 cases: 5149 o A new context 2 is established between A and B with a different 5150 ULID pair (or Forked Instance Identifier), and A uses CTA as 5151 context tag, If the locator sets used for both contexts are not 5152 disjoint, we are in a context confusion situation. 5154 o A new context is established between A and C and A uses CTA as 5155 context tag value for this new context. Later on, B sends Payload 5156 extension header and/or control messages containing CTA, which 5157 could be interpreted by A as belonging to context 2 (if no proper 5158 care is taken). Again we are in a context confusion situation. 5160 One could think that using a coordinated approach would eliminate 5161 these context confusion situations, making the protocol much simpler. 5162 However, this is not the case, because even in the case of a 5163 coordinated approach using a CLOSE/CLOSE ACK exchange, there is still 5164 the possibility of a host rebooting without having the time to 5165 perform the CLOSE exchange. So, it is true that the coordinated 5166 approach eliminates the possibility of a context confusion situation 5167 because premature garbage collection, but it does not prevent the 5168 same situations due to a crash and reboot of one of the involved 5169 hosts. The result is that even if we went for a coordinated 5170 approach, we would still need to deal with context confusion and 5171 provide the means to detect and recover from this situations. 5173 Appendix E. Change Log 5175 [RFC Editor: please remove this section] 5177 The following changes have been made since draft-ietf-shim6-proto-08: 5179 o Clarified that the validator option must be included in R1 and I2 5180 messages 5182 o changed preferred peer/local locator to current peer/local locator 5183 to align it with faliure detection draft 5185 o Reworded sections describing the generation and reception of 5186 I2,I2bis, R2 and Update message to clarify that the CGA PDS may be 5187 included in them 5189 o ruled out the unspcified address as posible address to be used in 5190 shim6 control messages 5192 o added clarifyig note that explains that is possible that one of 5193 the peers is not multiaddrssed and does not have CGA/HBA 5195 o added assumption explaining that ULIDs are HBAs or CGAs 5197 o Editorial changes 5199 The following changes have been made since draft-ietf-shim6-proto-07: 5201 o New Error Message format added in the Format section 5203 o Added new registry for Error codes in the IANA considerations 5204 section 5206 o Changed the Format section so a Shim6 error message is sent back 5207 when a crtical option is not recognized (instead of an ICMP error 5208 message) 5210 o Changed the ULID estbalishment section so that a Shim6 error 5211 message is sent back when the locator verification is not 5212 recgnized or not consistent with the current CGA PDS 5214 o Changed the Locator Update section so that Shim6 error messages 5215 are sent instead of ICMP error messages 5217 o Changed the receiving packet section so that Shim6 error messages 5218 are generated instead of ICMP error messages 5220 o added new section about middle box consideration in the 5221 implication elsewhere section 5223 o added text for allowing strcuture in context tag name space, while 5224 still randomly cycling though part of the tag name space 5226 o changed the name of TEMPORARY flag for the TRANSIENT flag 5228 o clarified option length calculation 5230 o Editorial commnets from Iljitsch review 5232 o added new sub-section in the introduction about congestion 5233 notification to upper layer and include a reference to 5234 I-D.schuetz-tcpm-tcp-rlci 5236 o added reccomendation to keep the shim6 message length below 1280 5237 bytes 5239 o added the init nonce in the description of the verification of the 5240 validator when receiving I2 messages 5242 o removed FII and ULID in the verification of the validator when 5243 receiving I2BIS meesages, and added receiver context tag. 5245 o Clarified section about retransmision of I2 and I2bis messages, in 5246 case that the initiator decides not to retransmit I2/I2bis 5247 messages and retransmits I1 message 5249 o Clarified the effect of packets associated with a context but 5250 without the shim6 header when considering tearing down a context 5252 o Added new section in section 12 about how to process packets 5253 associated with a context that do not carry the shim6 ext header 5255 o Added respon der validator as information stored in I2-SENT and 5256 Responder validator, init nonce and RESP nonce as information 5257 available in I2BISSENT 5259 o Added Init Nonce, Responder Nonce, and Responder validator as 5260 information available for a shim6 context in the conceptual model 5261 during establishment phase. 5263 o Clarified how the Responder Validator is calculated based on a 5264 running counter that is independent of any received message 5266 o Editorial corrections resulting from Dave Thaler and Bob Braden 5267 reviews. 5269 The following changes have been made since draft-ietf-shim6-proto-06: 5271 o Changed wording in the renumberin considerations section, so that 5272 a shim6 context using a ULID that has been renumbered, MUST be 5273 discarded 5275 o Included text in the security considerations about IPSec BITW and 5276 IPSec tunnels. 5278 o Added text about the minimum key length of CGA in the security 5279 considerations section 5281 o fixed Payload/update message processing 5283 o synchonized with READ draft 5285 The following changes have been made since draft-ietf-shim6-proto-05: 5287 o Removed the possibility to keep on using the ULID after a 5288 renumbering event 5290 o Editorial corrections resulting from Dave Meyer's and Jim Bound's 5291 reviews. 5293 The following changes have been made since draft-ietf-shim6-proto-04: 5295 o Defined I1_RETRIES_MAX as 4. 5297 o Added text in section 7.9 clarifying the no per context state is 5298 stored at the receiver in order to reply an I1 message. 5300 o Added text in section 5 and in section 5.14 in particular, on 5301 defining additional options (including critical and non critical 5302 options). 5304 o Added text in the security considerations about threats related to 5305 secret S for generating the validators and recommendation to 5306 change S periodically. 5308 o Added text in the security considerations about the effects of 5309 attacks based on guessing the context tag being similar to 5310 spoofing source addresses in the case of payload packets. 5312 o Added clarification on what a recent nonce is in I2 and I2bis. 5314 o Removed (empty) open issues section. 5316 o Editorial corrections. 5318 The following changes have been made since draft-ietf-shim6-proto-03: 5320 o Editorial clarifications based on comments from Geoff, Shinta, 5321 Jari. 5323 o Added "no IPv6 NATs as an explicit assumption. 5325 o Moving some things out of the Introduction and Overview sections 5326 to remove all SHOULDs and MUSTs from there. 5328 o Added requirement that any Locator Preference options which use an 5329 element length greater than 3 octets have the already defined 5330 first 3 octets of flags, priority and weight. 5332 o Fixed security hole where a single message (I1) could cause 5333 CT(peer) to be updated. Now a three-way handshake is required 5334 before CT(peer) is updated for an existing context. 5336 The following changes have been made since draft-ietf-shim6-proto-02: 5338 o Replaced the Context Error message with the R1bis message. 5340 o Removed the Packet In Error option, since it was only used in the 5341 Context Error message. 5343 o Introduced a I2bis message which is sent in response to an I1bis 5344 message, since the responders processing is quite in this case 5345 than in the regular R1 case. 5347 o Moved the packet formats for the Keepalive and Probe message types 5348 and Event option to [5]. Only the message type values and option 5349 type value are specified for those in this document. 5351 o Removed the unused message types. 5353 o Added a state machine description as an appendix. 5355 o Filled in all the TBDs - except the IANA assignment of the 5356 protocol number. 5358 o Specified how context recovery and forked contexts work together. 5359 This required the introduction of a Forked Instance option to be 5360 able to tell which of possibly forked instances is being 5361 recovered. 5363 o Renamed the "host-pair context" to be "ULID-pair context". 5365 o Picked some initial retransmit timers for I1 and I2; 4 seconds. 5367 o Added timer values as protocol constants. The retransmit timers 5368 use binary exponential backoff and randomization (between .5 and 5369 1.5 of the nominal value). 5371 o Require that the R1/R1bis verifiers be usable for some minimum 5372 time so that the initiator knows for how long time it can safely 5373 retransmit I2 before it needs to go back to sending I1 again. 5374 Picked 30 seconds. 5376 o Split the message type codes into 0-63, which will not generate 5377 R1bis messages, and 64-127 which will generate R1bis messages. 5378 This allows extensibility of the protocol with new message types 5379 while being able to control when R1bis is generated. 5381 o Expanded the context tag from 32 to 47 bits. 5383 o Specified that enough locators need to be included in I2 and R2 5384 messages. Specified that the HBA/CGA verification must be 5385 performed when the locator set is received. 5387 o Specified that ICMP parameter problem errors are sent in certain 5388 error cases, for instance when the verification method is unknown 5389 to the receiver, or there is an unknown message type or option 5390 type. 5392 o Renamed "payload message" to be "payload extension header". 5394 o Many editorial clarifications suggested by Geoff Huston. 5396 o Modified the dispatching of payload extension header to only 5397 compare CT(local) i.e., not compare the source and destination 5398 IPv6 address fields. 5400 The following changes have been made since draft-ietf-shim6-proto-00: 5402 o Removed the use of the flow label and the overloading of the IP 5403 protocol numbers. Instead, when the locator pair is not the ULID 5404 pair, the ULP payloads will be carried with an 8 octet extension 5405 header. The belief is that it is possible to remove these extra 5406 bytes by defining future Shim6 extensions that exchange more 5407 information between the hosts, without having to overload the flow 5408 label or the IP protocol numbers. 5410 o Grew the context tag from 20 bits to 32 bits, with the possibility 5411 to grow it to 47 bits. This implies changes to the message 5412 formats. 5414 o Almost by accident, the new Shim6 message format is very close to 5415 the HIP message format. 5417 o Adopted the HIP format for the options, since this makes it easier 5418 to describe variable length options. The original, ND-style, 5419 option format requires internal padding in the options to make 5420 them 8 octet length in total, while the HIP format handles that 5421 using the option length field. 5423 o Removed some of the control messages, and renamed the other ones. 5425 o Added a "generation" number to the Locator List option, so that 5426 the peers can ensure that the preferences refer to the right 5427 "version" of the Locator List. 5429 o In order for FBD and exploration to work when there the use of the 5430 context is forked, that is different ULP messages are sent over 5431 different locator pairs, things are a lot easier if there is only 5432 one current locator pair used for each context. Thus the forking 5433 of the context is now causing a new context to be established for 5434 the same ULID; the new context having a new context tag. The 5435 original context is referred to as the "default" context for the 5436 ULID pair. 5438 o Added more background material and textual descriptions. 5440 19. References 5442 19.1. Normative References 5444 [1] Bradner, S., "Key words for use in RFCs to Indicate Requirement 5445 Levels", BCP 14, RFC 2119, March 1997. 5447 [2] Aura, T., "Cryptographically Generated Addresses (CGA)", 5448 RFC 3972, March 2005. 5450 [3] Kent, S. and K. Seo, "Security Architecture for the Internet 5451 Protocol", RFC 4301, December 2005. 5453 [4] Bagnulo, M., "Hash Based Addresses (HBA)", 5454 draft-ietf-shim6-hba-03 (work in progress), May 2007. 5456 [5] Arkko, J. and I. Beijnum, "Failure Detection and Locator Pair 5457 Exploration Protocol for IPv6 Multihoming", 5458 draft-ietf-shim6-failure-detection-09 (work in progress), 5459 July 2007. 5461 19.2. Informative References 5463 [6] Gulbrandsen, A., Vixie, P., and L. Esibov, "A DNS RR for 5464 specifying the location of services (DNS SRV)", RFC 2782, 5465 February 2000. 5467 [7] Ferguson, P. and D. Senie, "Network Ingress Filtering: 5468 Defeating Denial of Service Attacks which employ IP Source 5469 Address Spoofing", BCP 38, RFC 2827, May 2000. 5471 [8] Draves, R., "Default Address Selection for Internet Protocol 5472 version 6 (IPv6)", RFC 3484, February 2003. 5474 [9] Bagnulo, M., "Updating RFC 3484 for multihoming support", 5475 draft-bagnulo-ipv6-rfc3484-update-00 (work in progress), 5476 December 2005. 5478 [10] Schulzrinne, H., Casner, S., Frederick, R., and V. Jacobson, 5479 "RTP: A Transport Protocol for Real-Time Applications", STD 64, 5480 RFC 3550, July 2003. 5482 [11] Abley, J., Black, B., and V. Gill, "Goals for IPv6 Site- 5483 Multihoming Architectures", RFC 3582, August 2003. 5485 [12] Rajahalme, J., Conta, A., Carpenter, B., and S. Deering, "IPv6 5486 Flow Label Specification", RFC 3697, March 2004. 5488 [13] Eastlake, D., Schiller, J., and S. Crocker, "Randomness 5489 Requirements for Security", BCP 106, RFC 4086, June 2005. 5491 [14] Hinden, R. and B. Haberman, "Unique Local IPv6 Unicast 5492 Addresses", RFC 4193, October 2005. 5494 [15] Nordmark, E. and T. Li, "Threats Relating to IPv6 Multihoming 5495 Solutions", RFC 4218, October 2005. 5497 [16] Huitema, C., "Ingress filtering compatibility for IPv6 5498 multihomed sites", draft-huitema-shim6-ingress-filtering-00 5499 (work in progress), September 2005. 5501 [17] Bagnulo, M. and E. Nordmark, "SHIM - MIPv6 Interaction", 5502 draft-bagnulo-shim6-mip-00 (work in progress), July 2005. 5504 [18] Nordmark, E., "Shim6 Application Referral Issues", 5505 draft-ietf-shim6-app-refer-00 (work in progress), July 2005. 5507 [19] Moskowitz, R., Nikander, P., Jokela, P., and T. Henderson, 5508 "Host Identity Protocol", draft-ietf-hip-base-10 (work in 5509 progress), October 2007. 5511 [20] Schuetz, S., "TCP Response to Lower-Layer Connectivity-Change 5512 Indications", draft-schuetz-tcpm-tcp-rlci-01 (work in 5513 progress), March 2007. 5515 Authors' Addresses 5517 Erik Nordmark 5518 Sun Microsystems 5519 17 Network Circle 5520 Menlo Park, CA 94025 5521 USA 5523 Phone: +1 650 786 2921 5524 Email: erik.nordmark@sun.com 5526 Marcelo Bagnulo 5527 Universidad Carlos III de Madrid 5528 Av. Universidad 30 5529 Leganes, Madrid 28911 5530 SPAIN 5532 Phone: +34 91 6248814 5533 Email: marcelo@it.uc3m.es 5534 URI: http://www.it.uc3m.es 5536 Full Copyright Statement 5538 Copyright (C) The IETF Trust (2007). 5540 This document is subject to the rights, licenses and restrictions 5541 contained in BCP 78, and except as set forth therein, the authors 5542 retain all their rights. 5544 This document and the information contained herein are provided on an 5545 "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS 5546 OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY, THE IETF TRUST AND 5547 THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS 5548 OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF 5549 THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED 5550 WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. 5552 Intellectual Property 5554 The IETF takes no position regarding the validity or scope of any 5555 Intellectual Property Rights or other rights that might be claimed to 5556 pertain to the implementation or use of the technology described in 5557 this document or the extent to which any license under such rights 5558 might or might not be available; nor does it represent that it has 5559 made any independent effort to identify any such rights. Information 5560 on the procedures with respect to rights in RFC documents can be 5561 found in BCP 78 and BCP 79. 5563 Copies of IPR disclosures made to the IETF Secretariat and any 5564 assurances of licenses to be made available, or the result of an 5565 attempt made to obtain a general license or permission for the use of 5566 such proprietary rights by implementers or users of this 5567 specification can be obtained from the IETF on-line IPR repository at 5568 http://www.ietf.org/ipr. 5570 The IETF invites any interested party to bring to its attention any 5571 copyrights, patents or patent applications, or other proprietary 5572 rights that may cover technology that may be required to implement 5573 this standard. Please address the information to the IETF at 5574 ietf-ipr@ietf.org. 5576 Acknowledgment 5578 Funding for the RFC Editor function is provided by the IETF 5579 Administrative Support Activity (IASA).