idnits 2.17.1 draft-ietf-shim6-proto-04.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 on line 5082. -- Found old boilerplate from RFC 3979, Section 5, paragraph 1 on line 5059. -- Found old boilerplate from RFC 3979, Section 5, paragraph 2 on line 5066. -- Found old boilerplate from RFC 3979, Section 5, paragraph 3 on line 5072. ** This document has an original RFC 3978 Section 5.4 Copyright Line, instead of the newer IETF Trust Copyright according to RFC 4748. ** This document has an original RFC 3978 Section 5.5 Disclaimer, instead of the newer disclaimer which includes the IETF Trust according to RFC 4748. 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 RFC 3978 Section 5.4 Copyright Line does not match the current year == Line 2568 has weird spacing: '... in the situa...' == Line 2719 has weird spacing: '...message and t...' == Line 2735 has weird spacing: '...message and t...' == Line 2994 has weird spacing: '...message and t...' == Line 3010 has weird spacing: '...message and t...' == (1 more instance...) == The document seems to lack the recommended RFC 2119 boilerplate, even if it appears to use RFC 2119 keywords. (The document does seem to have the reference to RFC 2119 which the ID-Checklist requires). -- 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 (March 4, 2006) is 6620 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 3734 -- Looks like a reference, but probably isn't: 'FII' on line 2172 == Unused Reference: '4' is defined on line 4947, but no explicit reference was found in the text == Unused Reference: '23' is defined on line 5014, but no explicit reference was found in the text == Unused Reference: '24' is defined on line 5018, but no explicit reference was found in the text == Unused Reference: '26' is defined on line 5025, but no explicit reference was found in the text ** Obsolete normative reference: RFC 2460 (ref. '2') (Obsoleted by RFC 8200) ** Obsolete normative reference: RFC 2461 (ref. '3') (Obsoleted by RFC 4861) ** Obsolete normative reference: RFC 2462 (ref. '4') (Obsoleted by RFC 4862) ** Obsolete normative reference: RFC 2463 (ref. '5') (Obsoleted by RFC 4443) == Outdated reference: A later version (-05) exists of draft-ietf-shim6-hba-01 == Outdated reference: A later version (-13) exists of draft-ietf-shim6-failure-detection-03 -- Obsolete informational reference (is this intentional?): RFC 3041 (ref. '11') (Obsoleted by RFC 4941) -- Obsolete informational reference (is this intentional?): RFC 3484 (ref. '12') (Obsoleted by RFC 6724) -- Obsolete informational reference (is this intentional?): RFC 3697 (ref. '16') (Obsoleted by RFC 6437) == Outdated reference: A later version (-08) exists of draft-ietf-shim6-applicability-00 == Outdated reference: A later version (-10) exists of draft-ietf-hip-base-05 Summary: 7 errors (**), 0 flaws (~~), 17 warnings (==), 12 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: September 5, 2006 M. Bagnulo 5 UC3M 6 March 4, 2006 8 Level 3 multihoming shim protocol 9 draft-ietf-shim6-proto-04.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 September 5, 2006. 36 Copyright Notice 38 Copyright (C) The Internet Society (2006). 40 Abstract 42 The SHIM6 protocol is a layer 3 shim for providing locator agility 43 below the transport protocols, so that multihoming can be provided 44 for IPv6 with failover and load sharing properties, without assuming 45 that a multihomed site will have a provider independent IPv6 address 46 prefix which is announced in the global IPv6 routing table. The 47 hosts in a site which has multiple provider allocated IPv6 address 48 prefixes, will use the shim6 protocol specified in this document to 49 setup state with peer hosts, so that the state can later be used to 50 failover to a different locator pair, should the original one stop 51 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 . . . . . . . . . . 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 . . . . . . . . . . . . . . . . . . . . . 17 68 4.1 Context Tags . . . . . . . . . . . . . . . . . . . . . . 19 69 4.2 Context Forking . . . . . . . . . . . . . . . . . . . . 19 70 4.3 API Extensions . . . . . . . . . . . . . . . . . . . . . 20 71 4.4 Securing shim6 . . . . . . . . . . . . . . . . . . . . . 20 72 4.5 Overview of Shim Control Messages . . . . . . . . . . . 21 73 4.6 Extension Header Order . . . . . . . . . . . . . . . . . 22 74 5. Message Formats . . . . . . . . . . . . . . . . . . . . . . 24 75 5.1 Common shim6 Message Format . . . . . . . . . . . . . . 24 76 5.2 Payload Extension Header Format . . . . . . . . . . . . 24 77 5.3 Common Shim6 Control header . . . . . . . . . . . . . . 25 78 5.4 I1 Message Format . . . . . . . . . . . . . . . . . . . 27 79 5.5 R1 Message Format . . . . . . . . . . . . . . . . . . . 28 80 5.6 I2 Message Format . . . . . . . . . . . . . . . . . . . 30 81 5.7 R2 Message Format . . . . . . . . . . . . . . . . . . . 31 82 5.8 R1bis Message Format . . . . . . . . . . . . . . . . . . 33 83 5.9 I2bis Message Format . . . . . . . . . . . . . . . . . . 34 84 5.10 Update Request Message Format . . . . . . . . . . . . . 36 85 5.11 Update Acknowledgement Message Format . . . . . . . . . 38 86 5.12 Keepalive Message Format . . . . . . . . . . . . . . . . 39 87 5.13 Probe Message Format . . . . . . . . . . . . . . . . . . 39 88 5.14 Option Formats . . . . . . . . . . . . . . . . . . . . . 39 89 5.14.1 Responder Validator Option Format . . . . . . . . . 41 90 5.14.2 Locator List Option Format . . . . . . . . . . . . . 42 91 5.14.3 Locator Preferences Option Format . . . . . . . . . 43 92 5.14.4 CGA Parameter Data Structure Option Format . . . . . 45 93 5.14.5 CGA Signature Option Format . . . . . . . . . . . . 46 94 5.14.6 ULID Pair Option Format . . . . . . . . . . . . . . 47 95 5.14.7 Forked Instance Identifier Option Format . . . . . . 48 96 5.14.8 Probe Option Format . . . . . . . . . . . . . . . . 48 97 5.14.9 Reachability Option Format . . . . . . . . . . . . . 48 98 5.14.10 Payload Reception Report Option Format . . . . . . 48 99 6. Conceptual Model of a Host . . . . . . . . . . . . . . . . . 49 100 6.1 Conceptual Data Structures . . . . . . . . . . . . . . . 49 101 6.2 Context States . . . . . . . . . . . . . . . . . . . . . 50 102 7. Establishing ULID-Pair Contexts . . . . . . . . . . . . . . 52 103 7.1 Uniqness of Context Tags . . . . . . . . . . . . . . . . 52 104 7.2 Locator Verification . . . . . . . . . . . . . . . . . . 52 105 7.3 Normal context establishment . . . . . . . . . . . . . . 53 106 7.4 Concurrent context establishment . . . . . . . . . . . . 53 107 7.5 Context recovery . . . . . . . . . . . . . . . . . . . . 55 108 7.6 Context confusion . . . . . . . . . . . . . . . . . . . 57 109 7.7 Sending I1 messages . . . . . . . . . . . . . . . . . . 58 110 7.8 Retransmitting I1 messages . . . . . . . . . . . . . . . 58 111 7.9 Receiving I1 messages . . . . . . . . . . . . . . . . . 59 112 7.9.1 Generating the R1 Validator . . . . . . . . . . . . 60 113 7.10 Receiving R1 messages and sending I2 messages . . . . . 61 114 7.11 Retransmitting I2 messages . . . . . . . . . . . . . . . 62 115 7.12 Receiving I2 messages . . . . . . . . . . . . . . . . . 62 116 7.13 Sending R2 messages . . . . . . . . . . . . . . . . . . 64 117 7.14 Match for Context Confusion . . . . . . . . . . . . . . 64 118 7.15 Receiving R2 messages . . . . . . . . . . . . . . . . . 65 119 7.16 Sending R1bis messages . . . . . . . . . . . . . . . . . 66 120 7.16.1 Generating the R1bis Validator . . . . . . . . . . . 66 121 7.17 Receiving R1bis messages and sending I2bis messages . . 67 122 7.18 Retransmitting I2bis messages . . . . . . . . . . . . . 68 123 7.19 Receiving I2bis messages and sending R2 messages . . . . 68 124 8. Handling ICMP Error Messages . . . . . . . . . . . . . . . . 70 125 9. Teardown of the ULID-Pair Context . . . . . . . . . . . . . 72 126 10. Updating the Peer . . . . . . . . . . . . . . . . . . . . 73 127 10.1 Sending Update Request messages . . . . . . . . . . . . 73 128 10.2 Retransmitting Update Request messages . . . . . . . . . 73 129 10.3 Newer Information While Retransmitting . . . . . . . . . 74 130 10.4 Receiving Update Request messages . . . . . . . . . . . 74 131 10.5 Receiving Update Acknowledgement messages . . . . . . . 76 132 11. Sending ULP Payloads . . . . . . . . . . . . . . . . . . . 77 133 11.1 Sending ULP Payload after a Switch . . . . . . . . . . . 77 134 12. Receiving Packets . . . . . . . . . . . . . . . . . . . . 79 135 12.1 Receiving Payload Extension Headers . . . . . . . . . . 79 136 12.2 Receiving Shim Control messages . . . . . . . . . . . . 79 137 12.3 Context Lookup . . . . . . . . . . . . . . . . . . . . . 80 138 13. Initial Contact . . . . . . . . . . . . . . . . . . . . . 82 139 14. Protocol constants . . . . . . . . . . . . . . . . . . . . 83 140 15. Implications Elsewhere . . . . . . . . . . . . . . . . . . 84 141 16. Security Considerations . . . . . . . . . . . . . . . . . 86 142 17. IANA Considerations . . . . . . . . . . . . . . . . . . . 88 143 18. Acknowledgements . . . . . . . . . . . . . . . . . . . . . 90 144 A. Open Issues . . . . . . . . . . . . . . . . . . . . . . . . 91 145 B. Possible Protocol Extensions . . . . . . . . . . . . . . . . 92 146 C. Change Log . . . . . . . . . . . . . . . . . . . . . . . . . 94 147 D. Simplified State Machine . . . . . . . . . . . . . . . . . . 97 148 D.1 Simplified State Machine diagram . . . . . . . . . . . . 102 149 E. Context Tag Reuse . . . . . . . . . . . . . . . . . . . . . 103 150 E.1 Context Recovery . . . . . . . . . . . . . . . . . . . . 103 151 E.2 Context Confusion . . . . . . . . . . . . . . . . . . . 103 152 E.3 Three Party Context Confusion . . . . . . . . . . . . . 104 153 F. Design Alternatives . . . . . . . . . . . . . . . . . . . . 105 154 F.1 Context granularity . . . . . . . . . . . . . . . . . . 105 155 F.2 Demultiplexing of data packets in shim6 communications . 105 156 F.2.1 Flow-label . . . . . . . . . . . . . . . . . . . . . 106 157 F.2.2 Extension Header . . . . . . . . . . . . . . . . . . 108 158 F.3 Context Loss Detection . . . . . . . . . . . . . . . . . 109 159 F.4 Securing locator sets . . . . . . . . . . . . . . . . . 111 160 F.5 ULID-pair context establishment exchange . . . . . . . . 114 161 F.6 Updating locator sets . . . . . . . . . . . . . . . . . 115 162 F.7 State Cleanup . . . . . . . . . . . . . . . . . . . . . 115 163 19. References . . . . . . . . . . . . . . . . . . . . . . . . 118 164 19.1 Normative References . . . . . . . . . . . . . . . . . . 118 165 19.2 Informative References . . . . . . . . . . . . . . . . . 118 166 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . 120 167 Intellectual Property and Copyright Statements . . . . . . . 121 169 1. Introduction 171 This document describes a layer 3 shim approach and protocol for 172 providing locator agility below the transport protocols, so that 173 multihoming can be provided for IPv6 with failover and load sharing 174 properties [15], without assuming that a multihomed site will have a 175 provider independent IPv6 address which is announced in the global 176 IPv6 routing table. The hosts in a site which has multiple provider 177 allocated IPv6 address prefixes, will use the shim6 protocol 178 specified in this document to setup state with peer hosts, so that 179 the state can later be used to failover to a different locator pair, 180 should the original one stop working. 182 We assume that redirection attacks are prevented using the mechanism 183 specified in HBA [7]. 185 The reachability detection and failure detection, including how a new 186 working locator pair is discovered after a failure, is specified in a 187 separate documents [8] This document allocates message types and 188 option types for that sub-protocol, and leaves the specification of 189 the message and option formats as well as the protocol behavior to 190 that document. 192 1.1 Goals 194 The goals for this approach is to: 196 o Preserve established communications through certain classes of 197 failures, for example, TCP connections and application 198 communications using UDP. 200 o Have minimal impact on upper layer protocols in general and on 201 transport protocols in particular. 203 o Address the security threats in [19] through the combination of 204 the HBA/CGA approach specified in a separate document [7], and 205 techniques described in this document. 207 o Do not require an extra roundtrip up front to setup shim specific 208 state. Instead allow the upper layer traffic (e.g., TCP) to flow 209 as normal and defer the setup of the shim state until some number 210 of packets have been exchanged. 212 o Take advantage of multiple locators/addresses for load spreading 213 so that different sets of communication to a host (e.g., different 214 connections) might use different locators of the host. Note that 215 this might cause load to be spread unevenly, thus we use the term 216 "load spreading" instead of "load balancing". This capability 217 might enable some forms of traffic engineering, but the details 218 for traffic engineering, including what requirements can be 219 satisfied, are not specified in this document, and form part of a 220 potential extensions to this protocol. 222 1.2 Non-Goals 224 The assumption is that the problem we are trying to solve is site 225 multihoming, with the ability to have the set of site locator 226 prefixes change over time due to site renumbering. Further, we 227 assume that such changes to the set of locator prefixes can be 228 relatively slow and managed; slow enough to allow updates to the DNS 229 to propagate. But it is not a goal to try to make communication 230 survive a renumbering event (which causes all the locators of a host 231 to change to a new set of locators). This proposal does not attempt 232 to solve the, perhaps related, problem of host mobility. However, it 233 might turn out that the shim6 protocol can be a useful component for 234 future host mobility solutions, e.g., for route optimization. 236 This proposal also does not try to provide a new network level or 237 transport level identifier namespace separated from the current IP 238 address namespace. Even though such a concept would be useful to 239 ULPs and applications, especially if the management burden for such a 240 name space was negligible and there was an efficient yet secure 241 mechanism to map from identifiers to locators, such a name space 242 isn't necessary (and furthermore doesn't seem to help) to solve the 243 multihoming problem. 245 1.3 Locators as Upper-layer Identifiers 247 This approach does not introduce a new identifier name space but 248 instead uses the locator that is selected in the initial contact with 249 the remote peer as the preserved upper-level identifier. While there 250 may be subsequent changes in the selected network level locators over 251 time in response to failures in using the original locator, the upper 252 level protocol stack elements will continue to use this upper level 253 identifier without change. 255 This implies that the ULID selection is performed as today's default 256 address selection as specified in RFC 3484 [12]. Some extensions are 257 needed to RFC 3484 to try different source addresses, whether or not 258 the shim6 protocol is used, as outlined in [13]. Underneath, and 259 transparently, the multihoming shim selects working locator pairs 260 with the initial locator pair being the ULID pair. When 261 communication fails the shim can test and select alternate locators. 262 A subsequent section discusses the issues when the selected ULID is 263 not initially working hence there is a need to switch locators up 264 front. 266 Using one of the locators as the ULID has certain benefits for 267 applications which have long-lived session state, or performs 268 callbacks or referrals, because both the FQDN and the 128-bit ULID 269 work as handles for the applications. However, using a single 128- 270 bit ULID doesn't provide seamless communication when that locator is 271 unreachable. See [22] for further discussion of the application 272 implications. 274 There has been some discussion of using non-routable locators, such 275 as unique-local addresses [18], as ULIDs in a multihoming solution. 276 While this document doesn't specify all aspects of this, it is 277 believed that the approach can be extended to handle such a case. 278 For example, the protocol already needs to handle ULIDs that are not 279 initially reachable. Thus the same mechanism can handle ULIDs that 280 are permanently unreachable from outside their site. The issue 281 becomes how to make the protocol perform well when the ULID is known 282 a priori to be not reachable (e.g., the ULID is a ULA), for instance, 283 avoiding any timeout and retries in this case. In addition one would 284 need to understand how the ULAs would be entered in the DNS to avoid 285 a performance impact on existing, non-shim6 aware, IPv6 hosts 286 potentially trying to communicate to the (unreachable) ULA. 288 1.4 IP Multicast 290 IP Multicast requires that the IP source address field contain a 291 topologically correct locator for interface that is used to send the 292 packet, since IP multicast routing uses both the source address and 293 the destination group to determine where to forward the packet. 294 (This isn't much different than the situation with widely implemented 295 ingress filtering [10] for unicast.) 297 While in theory it would be possible to apply the shim re-mapping of 298 the IP address fields between ULIDs and locators, the fact that all 299 the multicast receivers would need to know the mapping to perform, 300 makes such an approach difficult in practice. Thus it makes sense to 301 have multicast ULPs operate directly on locators and not use the 302 shim. This is quite a natural fit for protocols which use RTP [14], 303 since RTP already has an explicit identifier in the form of the SSRC 304 field in the RTP headers. Thus the actual IP address fields are not 305 important to the application. 307 In summary, IP multicast will not need the shim to remap the IP 308 addresses. 310 This doesn't prevent the receiver of multicast to change its 311 locators, since the receiver is not explicitly identified; the 312 destination address is a multicast address and not the unicast 313 locator of the receiver. 315 1.5 Renumbering Implications 317 As stated above, this approach does not try to make communication 318 survive renumbering in the general case. 320 When a host is renumbered, the effect is that one or more locators 321 become invalid, and zero or more locators are added to the host's 322 network interface. This means that the set of locators that is used 323 in the shim will change, which the shim can handle as long as not all 324 the original locators become invalid at the same time. 326 But IP addresses are also used as ULID, and making the communication 327 survive locators becoming invalid can potentially cause some 328 confusion at the upper layers. The fact that a ULID might be used 329 with a different locator over time open up the possibility that 330 communication between two ULIDs might continue to work after one or 331 both of those ULIDs are no longer reachable as locators, for example 332 due to a renumbering event. This opens up the possibility that the 333 ULID (or at least the prefix on which it is based) is reassigned to 334 another site while it is still being used (with another locator) for 335 existing communication. 337 Worst case we could end up with two separate hosts using the same 338 ULID while both of them are communicating with the same host. 340 This potential source for confusion can be avoided if we require that 341 any communication using a ULID must be terminated when the ULID 342 becomes invalid (due to the underlying prefix becoming invalid). If 343 that behavior is desired, it can be accomplished by explicitly 344 discarding the shim state when the ULID becomes invalid. The context 345 recovery mechanism will then make the peer aware that the context is 346 gone, and that the ULID is no longer present at the same locator(s). 348 However, terminating the communication might be overkill. Even when 349 an IPv6 prefix is retired and reassigned to some other site, there is 350 a very small probability that another host in that site picks the 351 same 128 bit address (whether using DHCPv6, stateless address 352 autoconfiguration, or picking a random interface ID [11]). Should 353 the identical address be used by another host, then there still 354 wouldn't be a problem until that host attempts to communicate with 355 the same peer host with which the initial user of the IPv6 address 356 was communicating. 358 The protocol as specified in this document does not perform any 359 action when an address becomes invalid. As we gain further 360 understanding of the practical impact of renumbering this might 361 change in a future version of the protocol. 363 1.6 Placement of the shim 365 ----------------------- 366 | Transport Protocols | 367 ----------------------- 369 ------ ------- -------------- ------------- IP endpoint 370 | AH | | ESP | | Frag/reass | | Dest opts | sub-layer 371 ------ ------- -------------- ------------- 373 --------------------- 374 | shim6 shim layer | 375 --------------------- 377 ------ IP routing 378 | IP | sub-layer 379 ------ 381 Figure 1: Protocol stack 383 The proposal uses an multihoming shim layer within the IP layer, 384 i.e., below the ULPs, as shown in Figure 1, in order to provide ULP 385 independence. The multihoming shim layer behaves as if it is 386 associated with an extension header, which would be placed after any 387 routing-related headers in the packet (such as any hop-by-hop 388 options, or routing header). However, when the locator pair is the 389 ULID pair there is no data that needs to be carried in an extension 390 header, thus none is needed in that case. 392 Layering AH and ESP above the multihoming shim means that IPsec can 393 be made to be unaware of locator changes the same way that transport 394 protocols can be unaware. Thus the IPsec security associations 395 remain stable even though the locators are changing. This means that 396 the IP addresses specified in the selectors should be the ULIDs. 398 Layering the fragmentation header above the multihoming shim makes 399 reassembly robust in the case that there is broken multi-path routing 400 which results in using different paths, hence potentially different 401 source locators, for different fragments. Thus, effectively the 402 multihoming shim layer is placed between the IP endpoint sublayer, 403 which handles fragmentation, reassembly, and IPsec, and the IP 404 routing sublayer, which selects which next hop and interface to use 405 for sending out packets. 407 Applications and upper layer protocols use ULIDs which the shim6 408 layer will map to/from different locators. The shim6 layer maintains 409 state, called ULID-pair context, per ULID pairs (that is, applies to 410 all ULP connections between the ULID pair) in order to perform this 411 mapping. The mapping is performed consistently at the sender and the 412 receiver, thus from the perspective of the upper layer protocols, 413 packets appear to be sent using ULIDs from end to end, even though 414 the packets travel through the network containing locators in the IP 415 address fields, and even though those locators might be changed by 416 the transmitting shim6 layer. 418 The context state in this approach is maintained per remote ULID i.e. 419 approximately per peer host, and not at any finer granularity. In 420 particular, it is independent of the ULPs and any ULP connections. 421 However, the forking capability enables shim-aware ULPs to use more 422 than one locator pair at a time for an single ULID pair. 424 ---------------------------- ---------------------------- 425 | Sender A | | Receiver B | 426 | | | | 427 | ULP | | ULP | 428 | | src ULID(A)=L1(A) | | ^ | 429 | | dst ULID(B)=L1(B) | | | src ULID(A)=L1(A) | 430 | v | | | dst ULID(B)=L1(B) | 431 | multihoming shim | | multihoming shim | 432 | | src L2(A) | | ^ | 433 | | dst L3(B) | | | src L2(A) | 434 | v | | | dst L3(B) | 435 | IP | | IP | 436 ---------------------------- ---------------------------- 437 | ^ 438 ------- cloud with some routers ------- 440 Figure 2: Mapping with changed locators 442 The result of this consistent mapping is that there is no impact on 443 the ULPs. In particular, there is no impact on pseudo-header 444 checksums and connection identification. 446 Conceptually one could view this approach as if both ULIDs and 447 locators are being present in every packet, and with a header 448 compression mechanism applied that removes the need for the ULIDs to 449 be carried in the packets once the compression state has been 450 established. In order for the receiver to recreate a packet with the 451 correct ULIDs there is a need to include some "compression tag" in 452 the data packets. This serves to indicate the correct context to use 453 for decompression when the locator pair in the packet is insufficient 454 to uniquely identify the context. 456 1.7 Traffic Engineering 458 At the time of this writing it is not clear what requirements for 459 traffic engineering make sense for the shim6 protocol, since the 460 requirements must both result in some useful behavior as well as be 461 implementable using a host-to-host locator agility mechanism like 462 shim6. 464 Inherent in a scalable multihoming mechanism that separates locators 465 from identifiers is that each host ends up with multiple locators. 466 This means that at least for initial contact, it is the remote peer 467 that needs to select which peer locator to try first. In the case of 468 shim6 this is performed by applying RFC 3484 address selection. 470 This is quite different than the common case of IPv4 multihoming 471 where the site has a single IP address prefix, since in that case the 472 peer performs no destination address selection. 474 Thus in "single prefix multihoming" the site, and in many cases its 475 upstream ISPs, can use BGP to exert some control of the ingress used 476 to reach the site. This capability can't easily be recreated in 477 "multiple prefix multihoming" such as shim6. 479 The protocol provides a placeholder, in the form of the Locator 480 Preferences option, which can be used by hosts to express priority 481 and weight values for each locator. This is intentionally made 482 identical to the DNS SRV [9] specification of priority and weight, so 483 that DNS SRV records can be used for initial contact and the shim for 484 failover, and they can use the same way to describe the preferences. 485 The format allows adding additional notions of "metrics" over time. 486 But the Locator Preference option is merely a place holder when it 487 comes to providing traffic engineering; in order to use this in a 488 large site there would have to be a mechanism by which the host can 489 find out what preference values to use, either statically (e.g., some 490 new DHCPv6 option) or dynamically. 492 Thus traffic engineering is listed as a possible extension in 493 Appendix B. 495 2. Terminology 497 This document uses the terms MUST, SHOULD, RECOMMENDED, MAY, SHOULD 498 NOT and MUST NOT defined in RFC 2119 [1]. The terms defined in RFC 499 2460 [2] are also used. 501 2.1 Definitions 503 This document introduces the following terms: 505 upper layer protocol (ULP) 506 A protocol layer immediately above IP. Examples 507 are transport protocols such as TCP and UDP, 508 control protocols such as ICMP, routing protocols 509 such as OSPF, and internet or lower-layer 510 protocols being "tunneled" over (i.e., 511 encapsulated in) IP such as IPX, AppleTalk, or IP 512 itself. 514 interface A node's attachment to a link. 516 address An IP layer name that contains both topological 517 significance and acts as a unique identifier for 518 an interface. 128 bits. This document only uses 519 the "address" term in the case where it isn't 520 specific whether it is a locator or an 521 identifier. 523 locator An IP layer topological name for an interface or 524 a set of interfaces. 128 bits. The locators are 525 carried in the IP address fields as the packets 526 traverse the network. 528 identifier An IP layer name for an IP layer endpoint. The 529 transport endpoint name is a function of the 530 transport protocol and would typically include 531 the IP identifier plus a port number. 532 NOTE: This proposal does not specify any new form 533 of IP layer identifier, but still separates the 534 identifying and locating properties of the IP 535 addresses. 537 upper-layer identifier (ULID) 538 An IP address which has been selected for 539 communication with a peer to be used by the upper 540 layer protocol. 128 bits. This is used for 541 pseudo-header checksum computation and connection 542 identification in the ULP. Different sets of 543 communication to a host (e.g., different 544 connections) might use different ULIDs in order 545 to enable load spreading. 547 Since the ULID is just one of the IP locators/ 548 addresses of the node, there is no need for a 549 separate name space and allocation mechanisms. 551 address field The source and destination address fields in the 552 IPv6 header. As IPv6 is currently specified this 553 fields carry "addresses". If identifiers and 554 locators are separated these fields will contain 555 locators for packets on the wire. 557 FQDN Fully Qualified Domain Name 559 ULID-pair context The state that the multihoming shim maintains 560 between a pair of Upper-layer identifiers. The 561 context is identified by a context tag for each 562 direction of the communication, and also 563 identified by the pair of ULID and a Forked 564 Instance Identifier (see below). 566 Context tag Each end of the context allocates a context tag 567 for the context. This is used to uniquely 568 associate both received control packets and 569 payload extension headers as belonging to the 570 context. 572 Current locator pair 573 Each end of the context has a current locator 574 pair which is used to send packets to the peer. 575 The two ends might use different current locator 576 pairs though. 578 Default context At the sending end, the shim uses the ULID pair 579 (passed down from the ULP) to find the context 580 for that pair. Thus, normally, a host can have 581 at most one context for a ULID pair. We call 582 this the "default context". 584 Context forking A mechanism which allows ULPs that are aware of 585 multiple locators to use separate contexts for 586 the same ULID pair, in order to be able use 587 different locator pairs for different 588 communication to the same ULID. Context forking 589 causes more than just the default context to be 590 created for a ULID pair. 592 Forked Instance Identifier (FII) 593 In order to handle context forking, a context is 594 identified by a ULID-pair and a forked context 595 identifier. The default context has a FII of 596 zero. 598 Initial contact We use this term to refer to the pre-shim 599 communication when some ULP decides to start 600 communicating with a peer by sending and 601 receiving ULP packets. Typically this would not 602 invoke any operations in the shim, since the shim 603 can defer the context establishment until some 604 arbitrary later point in time. 606 Hash Based Addresses (HBA) 607 A form of IPv6 address where the interface ID is 608 derived from a cryptographic hash of all the 609 prefixes assigned to the host. See [7]. 611 Cryptographically Generated Addresses (CGA) 612 A form of IPv6 address where the interface ID is 613 derived from a cryptographic hash of the public 614 key. See [6]. 616 CGA Parameter Data Structure (PDS) 617 The information that CGA and HBA exchanges in 618 order to inform the peer of how the interface ID 619 was computed. See [6]., [7]. 621 2.2 Notational Conventions 623 A, B, and C are hosts. X is a potentially malicious host. 625 FQDN(A) is the domain name for A. 627 Ls(A) is the locator set for A, which consists of the locators L1(A), 628 L2(A), ... Ln(A). 630 ULID(A) is an upper-layer ID for A. In this proposal, ULID(A) is 631 always one member of A's locator set. 633 CT(X) is a context tag assigned by X. 635 This document also makes use of internal conceptual variables to 636 describe protocol behavior and external variables that an 637 implementation must allow system administrators to change. The 638 specific variable names, how their values change, and how their 639 settings influence protocol behavior are provided to demonstrate 640 protocol behavior. An implementation is not required to have them in 641 the exact form described here, so long as its external behavior is 642 consistent with that described in this document. See Section 6 for a 643 description of the conceptual data structures. 645 3. Assumptions 647 The design intent is to ensure that the shim6 protocol is capable of 648 handling path failures independently of the number of IP addresses 649 (locators) available to the two communicating hosts, and 650 independently of which host detects the failure condition. 652 In the case when host A and host B have an active shim6 state, with 653 host A having only one locator and host B having multiple locators, 654 it might be that host B is trying to send a packet to host A, and has 655 detected a failure condition with the current locator pair. As host 656 B has multiple locators it presumably has multiple ISPs. In this 657 case there are probably alternate egress paths for host B to be able 658 to try to reach A, but B can not vary the destination address (host A 659 locator) to select such alternate paths, since A has only one 660 locator. 662 This leads to the assumption that a host should be able to cause 663 different egress paths from its site to be used. The most reasonable 664 approach to accomplish this is to have the host use different source 665 addresses and have the source address affect the selection of the 666 site egress. The details of how this can be accomplished is beyond 667 the scope of this document, but without this capability the ability 668 of the shim to try different "paths" by trying different locator 669 pairs will have limited utility. 671 The above assumption applies whether or not the ISPs perform ingress 672 filtering. 674 In addition, when the site's ISPs perform ingress filtering based on 675 packet source addresses, shim6 assumes that packets sent with 676 different source and destination combinations have a reasonable 677 chance of making it through the relevant ISP's ingress filters. This 678 can be accomplished in several ways (all outside the scope of this 679 document), such as having the ISPs relax there ingress filters, or 680 selecting the egress such that it matches the IP source address 681 prefix. 683 Further discussion of this issue is captured in [20]. 685 The shim6 approach assumes that there are no IPv6-to-IPv6 NATs on the 686 paths, i.e., that the two ends can exchange their own notion of their 687 IPv6 addresses and that those addresses will also make sense to their 688 peer. 690 4. Protocol Overview 692 The shim6 protocol operates in several phases over time. The 693 following sequence illustrates the concepts: 695 o An application on host A decides to contact B using some upper- 696 layer protocol. This results in the ULP on A sending packets to 697 B. We call this the initial contact. Assuming the IP addresses 698 selected by Default Address Selection [12] and its extensions [13] 699 work, then there is no action by the shim at this point in time. 700 Any shim context establishment can be deferred until later. 702 o Some heuristic on A or B (or both) determine that it is 703 appropriate to pay the shim6 overhead to make this host-to-host 704 communication robust against locator failures. For instance, this 705 heuristic might be that more than 50 packets have been sent or 706 received, or a timer expiration while active packet exchange is in 707 place. This makes the shim initiate the 4-way context 708 establishment exchange. 710 As a result of this exchange, both A and B will know a list of 711 locators for each other. 713 If the context establishment exchange fails, the initiator will 714 then know that the other end does not support shim6, and will 715 continue with standard unicast behavior for the session. 717 o Communication continues without any change for the ULP packets. 718 In particular, there are no shim extension headers added to the 719 ULP packets, since the ULID pair is the same as the locator pair. 720 In addition, there might be some messages exchanged between the 721 shim sub-layers for (un)reachability detection. 723 o At some point in time something fails. Depending on the approach 724 to reachability detection, there might be some advice from the 725 ULP, or the shim (un)reachability detection might discover that 726 there is a problem. 728 At this point in time one or both ends of the communication need 729 to probe the different alternate locator pairs until a working 730 pair is found, and switch to using that locator pair. 732 o Once a working alternative locator pair has been found, the shim 733 will rewrite the packets on transmit, and tag the packets with 734 shim6 Payload extension header, which contains the receiver's 735 context tag. The receiver will use the context tag to find the 736 context state which will indicate which addresses to place in the 737 IPv6 header before passing the packet up to the ULP. The result 738 is that from the perspective of the ULP the packet passes 739 unmodified end-to-end, even though the IP routing infrastructure 740 sends the packet to a different locator. 742 o The shim (un)reachability detection will monitor the new locator 743 pair as it monitored the original locator pair, so that subsequent 744 failures can be detected. 746 o In addition to failures detected based on end-to-end observations, 747 one endpoint might know for certain that one or more of its 748 locators is not working. For instance, the network interface 749 might have failed or gone down (at layer 2), or an IPv6 address 750 might have become deprecated or invalid. In such cases the host 751 can signal its peer that this address is no longer recommended to 752 try. Thus this triggers something similar to a failure handling 753 in that a new, working locator pair must be found. 755 The protocol also has the ability to express other forms of 756 locator preferences. A change in any preferences can be signaled 757 to the peer, which will made the peer record the new preferences. 758 A change in the preferences might optionally make the peer want to 759 use a different locator pair. If it makes this decision, it 760 follows the same locator switching procedure as after a failure 761 (by verifying that its peer is indeed present at the alternate 762 locator, etc). 764 o When the shim thinks that the context state is no longer used, it 765 can garbage collect the state; there is no coordination necessary 766 with the peer host before the state is removed. There is a 767 recovery message defined to be able to signal when there is no 768 context state, which can be used to detect and recover from both 769 premature garbage collection, as well as complete state loss 770 (crash and reboot) of a peer. 772 The exact mechanism to determine when the context state is no 773 longer used is implementation dependent. An implementation might 774 use the existence of ULP state (where known to the implementation) 775 as an indication that the state is still used, combined with a 776 timer (to handle ULP state that might not be known to the shim 777 sub-layer) to determine when the state is likely to no longer be 778 used. 780 NOTE: The ULP packets in shim6 can be carried completely unmodified 781 as long as the ULID pair is used as the locator pair. After a switch 782 to a different locator pair the packets are "tagged" with a shim6 783 extension header, so that the receiver can always determine the 784 context to which they belong. This is accomplished by including an 785 8-octet shim6 Payload Extension header before the (extension) headers 786 that are processed by the IP endpoint sublayer and ULPs. If 787 subsequently the original ULIDs are selected as the active locator 788 pair then the tagging of packets with the shim6 extension header can 789 also be stopped. 791 4.1 Context Tags 793 A context between two hosts is actually a context between two ULIDs. 794 The context is identified by a pair of context tags. Each end gets 795 to allocate a context tag, and once the context is established, most 796 shim6 control messages contain the context tag that the receiver of 797 the message allocated. Thus at a minimum the combination of have to uniquely identify one 799 context. But since the Payload extension headers are demultiplexed 800 without looking at the locators in the packet, the receiver will need 801 to allocate context tags that are unique for all its contexts. The 802 context tag is a 47-bit number (the largest which can fit in an 803 8-octet extension header). 805 The mechanism for detecting a loss of context state at the peer that 806 is currently proposed in this document assumes that the receiver can 807 tell the packets that need locator rewriting, even after it has lost 808 all state (e.g., due to a crash followed by a reboot). This is 809 achieved because after a rehoming event the packets that need 810 receive-side rewriting, carry the Payload extension header. 812 4.2 Context Forking 814 It has been asserted that it will be important for future ULPs, in 815 particular, future transport protocols, to be able to control which 816 locator pairs are used for different communication. For instance, 817 host A and host B might communicate using both VoIP traffic and ftp 818 traffic, and those communications might benefit from using different 819 locator pairs. However, the fundamental shim6 mechanism uses a 820 single current locator pair for each context, thus a single context 821 can not accomplish this. 823 For this reason, the shim6 protocol supports the notion of context 824 forking. This is a mechanism by which a ULP can specify (using some 825 API not yet defined) that a context for e.g., the ULID pair 826 should be forked into two contexts. In this case the forked-off 827 context will be assigned a non-zero Forked Instance Identifier, while 828 the default context has FII zero. 830 The Forked Instance Identifier is a 32-bit identifier which has no 831 semantics in the protocol other then being part of the tuple which 832 identifies the context. The hosts can allocate FIIs e.g., as 833 sequential numbers for any given ULID pair. 835 No other special considerations are needed in the shim6 protocol to 836 handle forked contexts. 838 Note that forking as specified does NOT allow A to be able to tell B 839 that certain traffic (a 5-tuple?) should be forked for the reverse 840 direction. The shim6 forking mechanism as specified applies only to 841 the sending of ULP packets. If some ULP wants to fork for both 842 directions, it is up to the ULP to set this up, and then instruct the 843 shim at each end to transmit using the forked context. 845 4.3 API Extensions 847 Several API extensions have been discussed for shim6, but their 848 actual specification is out of scope for this document. The simplest 849 one would be to add a socket option to be able to have traffic bypass 850 the shim (not create any state, and not use any state created by 851 other traffic). This could be an IPV6_DONTSHIM socket option. Such 852 an option would be useful for protocols, such as DNS, where the 853 application has its own failover mechanism (multiple NS records in 854 the case of DNS) and using the shim could potentially add extra 855 latency with no added benefits. 857 Some other API extensions are discussed in Appendix B 859 4.4 Securing shim6 861 The mechanisms are secured using a combination of techniques: 863 o The HBA technique [7] for verifying the locators to prevent an 864 attacker from redirecting the packet stream to somewhere else. 866 o Requiring a Reachability Probe+Reply before a new locator is used 867 as the destination, in order to prevent 3rd party flooding 868 attacks. 870 o The first message does not create any state on the responder. 871 Essentially a 3-way exchange is required before the responder 872 creates any state. This means that a state-based DoS attack 873 (trying to use up all of memory on the responder) at least 874 provides an IPv6 address that the attacker was using. 876 o The context establishment messages use nonces to prevent replay 877 attacks, and to prevent off-path attackers from interfering with 878 the establishment. 880 o Every control message of the shim6 protocol, past the context 881 establishment, carry the context tag assigned to the particular 882 context. This implies that an attacker needs to discover that 883 context tag before being able to spoof any shim6 control message. 884 Such discovery probably requires to be along the path in order to 885 be sniff the context tag value. The result is that through this 886 technique, the shim6 protocol is protected against off-path 887 attackers. 889 4.5 Overview of Shim Control Messages 891 The shim6 context establishment is accomplished using four messages; 892 I1, R1, I2, R2. Normally they are sent in that order from initiator 893 and responder, respectively. Should both ends attempt to set up 894 context state at the same time (for the same ULID pair), then their 895 I1 messages might cross in flight, and result in an immediate R2 896 message. [The names of these messages are borrowed from HIP [25].] 898 R1bis and I2bis messages are defined, which are used to recover a 899 context after it has been lost. A R1bis message is sent when a shim6 900 control or Payload extension header arrives and there is no matching 901 context state at the receiver. When such a message is received, it 902 will result in the re-creation of the shim6 context using the I2bis 903 and R2 messages. 905 The peers' lists of locators are normally exchanged as part of the 906 context establishment exchange. But the set of locators might be 907 dynamic. For this reason there is a Update Request and Update 908 Acknowledgement messages, and a Locator List option. 910 Even when the list of locators is fixed, a host might determine that 911 some preferences might have changed. For instance, it might 912 determine that there is a locally visible failure that implies that 913 some locator(s) are no longer usable. This uses a Locator 914 Preferences option in the Update Request message. 916 The mechanism for (un)reachability detection is called Forced 917 Bidirectional Communication (FBD). The FBD approach uses a Keepalive 918 message, which is sent when a host has received packets from the 919 peer, but the ULP has not given the host an opportunity to send any 920 packet to the peer. The message type is reserved in this document, 921 but the message format and processing rules are specified in [8]. 923 In addition, when the context is established and there is a failure 924 there needs to be a way to probe the set of locator pairs to 925 efficiently find a working pair. This document reserves an Probe 926 message type, with the packet format and processing rules specified 927 in [8]. 929 The above probe and keepalive messages assume we have an established 930 ULID-pair context. However, communication might fail during the 931 initial contact (that is, when the application or transport protocol 932 is trying to setup some communication). This is handled using the 933 mechanisms in the ULP to try different address pairs as specified in 934 [12] [13]. In the future versions of the protocol, and with a richer 935 API between the ULP and the shim, the shim might be help optimize 936 discovering a working locator pair during initial contact. This is 937 for further study. 939 4.6 Extension Header Order 941 Since the shim is placed between the IP endpoint sub-layer and the IP 942 routing sub-layer in the host, the shim header will be placed before 943 any endpoint extension headers (fragmentation headers, destination 944 options header, AH, ESP), but after any routing related headers (hop- 945 by-hop extensions header, routing header, a destinations options 946 header which precedes a routing header). When tunneling is used, 947 whether IP-in-IP tunneling or the special form of tunneling that 948 Mobile IPv6 uses (with Home Address Options and Routing header type 949 2), there is a choice whether the shim applies inside the tunnel or 950 outside the tunnel, which effects the location of the shim6 header. 952 In most cases IP-in-IP tunnels are used as a routing technique, thus 953 it makes sense to apply them on the locators which means that the 954 sender would insert the shim6 header after any IP-in-IP 955 encapsulation; this is what occurs naturally when routers apply IP- 956 in-IP encapsulation. Thus the packets would have: 958 o Outer IP header 960 o Inner IP header 962 o Shim6 extension header (if needed> 964 o ULP 966 But the shim can also be used to create "shimmed tunnels" i.e., where 967 an IP-in-IP tunnel uses the shim to be able to switch the tunnel 968 endpoint addresses between different locators. In such a case the 969 packets would have: 971 o Outer IP header 973 o Shim6 extension header (if needed> 975 o Inner IP header 977 o ULP 979 In any case, the receiver behavior is well-defined; a receiver 980 processes the extension headers in order. However, the precise 981 interaction between Mobile IPv6 and shim6 is for further study, but 982 it might make sense to have Mobile IPv6 operate on locators as well, 983 meaning that the shim would be layered on top of the MIPv6 mechanism. 985 5. Message Formats 987 The shim6 messages are all carried using a new IP protocol number [to 988 be assigned by IANA]. The shim6 messages have a common header, 989 defined below, with some fixed fields, followed by type specific 990 fields. 992 The shim6 messages are structured as an IPv6 extension header since 993 the Payload extension header is used to carry the ULP packets after a 994 locator switch. The shim6 control messages use the same extension 995 header formats so that a single "protocol number" needs to be allowed 996 through firewalls in order for shim6 to function across the firewall. 998 5.1 Common shim6 Message Format 1000 The first 17 bits of the shim6 header is common for the Payload 1001 extension header and the control messages and looks as follows: 1003 0 1 1004 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 1005 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1006 | Next Header | Hdr Ext Len |P| 1007 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1009 Fields: 1011 Next Header: The payload which follows this header. 1013 Hdr Ext Len: 8-bit unsigned integer. Length of the shim6 header in 1014 8-octet units, not including the first 8 octets. 1016 P: A single bit to distinguish Payload extension headers 1017 from control messages. 1019 5.2 Payload Extension Header Format 1021 The payload extension headers is used to carry ULP packets where the 1022 receiver must replace the content of the source and/or destination 1023 fields in the IPv6 header before passing the packet to the ULP. Thus 1024 this extension header is required when the locators pair that is used 1025 is not the same as the ULID pair. 1027 0 1 2 3 1028 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 1029 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1030 | Next Header | 0 |1| | 1031 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 1032 | Receiver Context Tag | 1033 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1035 Fields: 1037 Next Header: The payload which follows this header. 1039 Hdr Ext Len: 0 (since the header is 8 octets). 1041 P: Set to one. A single bit to distinguish this from the 1042 shim6 control messages. 1044 Receiver Context Tag: 47-bit unsigned integer. Allocated by the 1045 receiver for use to identify the context. 1047 5.3 Common Shim6 Control header 1049 The common part of the header has a next header and header extension 1050 length field which is consistent with the other IPv6 extension 1051 headers, even if the next header value is always "NO NEXT HEADER" for 1052 the control messages; only the payload extension header use the Next 1053 Header field. 1055 The shim6 headers must be a multiple of 8 octets, hence the minimum 1056 size is 8 octets. 1058 The common shim control message header is as follows: 1060 0 1 2 3 1061 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 1062 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1063 | Next Header | Hdr Ext Len |0| Type |Type-specific|0| 1064 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1065 | Checksum | | 1066 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 1067 | Type-specific format | 1068 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1070 Fields: 1072 Next Header: 8-bit selector. Normally set to NO_NXT_HDR (59). 1074 Hdr Ext Len: 8-bit unsigned integer. Length of the shim6 header in 1075 8-octet units, not including the first 8 octets. 1077 P: Set to zero. A single bit to distinguish this from 1078 the shim6 payload extension header. 1080 Type: 7-bit unsigned integer. Identifies the actual message 1081 from the table below. Type codes 0-63 will not 1082 trigger R1bis messages on a missing context, while 64- 1083 127 will trigger R1bis. 1085 0: A single bit (set to zero) which allows shim6 and HIP 1086 to have a common header format yet telling shim6 and 1087 HIP messages apart. 1089 Checksum: 16-bit unsigned integer. The checksum is the 16-bit 1090 one's complement of the one's complement sum of the 1091 entire shim6 header message starting with the shim6 1092 next header field, and ending as indicated by the Hdr 1093 Ext Len. Thus when there is a payload following the 1094 shim6 header, the payload is NOT included in the shim6 1095 checksum. Note that unlike protocol like ICMPv6, 1096 there is no pseudo-header checksum part of the 1097 checksum, in order to provide locator agility without 1098 having to change the checksum. 1100 Type-specific: Part of message that is different for different 1101 message types. 1103 +------------+-----------------------------------------------------+ 1104 | Type Value | Message | 1105 +------------+-----------------------------------------------------+ 1106 | 1 | I1 (first establishment message from the initiator) | 1107 | | | 1108 | 2 | R1 (first establishment message from the responder) | 1109 | | | 1110 | 3 | I2 (2nd establishment message from the initiator) | 1111 | | | 1112 | 4 | R2 (2nd establishment message from the responder) | 1113 | | | 1114 | 5 | R1bis (Reply to reference to non-existent context) | 1115 | | | 1116 | 6 | I2bis (Reply to a R1bis message) | 1117 | | | 1118 | 64 | Update Request | 1119 | | | 1120 | 65 | Update Acknowledgement | 1121 | | | 1122 | 66 | Keepalive | 1123 | | | 1124 | 67 | Probe Message | 1125 +------------+-----------------------------------------------------+ 1127 Table 1 1129 5.4 I1 Message Format 1131 The I1 message is the first message in the context establishment 1132 exchange. 1134 0 1 2 3 1135 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 1136 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1137 | 59 | Hdr Ext Len |0| Type = 1 | Reserved1 |0| 1138 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1139 | Checksum |R| | 1140 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 1141 | Initiator Context Tag | 1142 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1143 | Initiator Nonce | 1144 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1145 | | 1146 + Options + 1147 | | 1148 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1149 Fields: 1151 Next Header: NO_NXT_HDR (59). 1153 Hdr Ext Len: At least 1, since the header is 16 octets when there 1154 are no options. 1156 Type: 1 1158 Reserved1: 7-bit field. Reserved for future use. Zero on 1159 transmit. MUST be ignored on receipt. 1161 R: 1-bit field. Reserved for future use. Zero on 1162 transmit. MUST be ignored on receipt. 1164 Initiator Context Tag: 47-bit field. The Context Tag the initiator 1165 has allocated for the context. 1167 Initiator Nonce: 32-bit unsigned integer. A random number picked by 1168 the initiator which the responder will return in the 1169 R1 message. 1171 The following options are defined for this message: 1173 ULID pair: When the IPv6 source and destination addresses in the 1174 IPv6 header does not match the ULID pair, this option 1175 MUST be included. An example of this is when 1176 recovering from a lost context. 1178 Forked Instance Identifier: When another instance of an existent 1179 context with the same ULID pair is being created, a 1180 Forked Instance Identifier option is included to 1181 distinguish this new instance from the existent one. 1183 5.5 R1 Message Format 1185 The R1 message is the second message in the context establishment 1186 exchange. The responder sends this in response to an I1 message, 1187 without creating any state specific to the initiator. 1189 0 1 2 3 1190 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 1191 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1192 | 59 | Hdr Ext Len |0| Type = 2 | Reserved1 |0| 1193 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1194 | Checksum | Reserved2 | 1195 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1196 | Initiator Nonce | 1197 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1198 | Responder Nonce | 1199 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1200 | | 1201 + Options + 1202 | | 1203 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1205 Fields: 1207 Next Header: NO_NXT_HDR (59). 1209 Hdr Ext Len: At least 1, since the header is 16 octets when there 1210 are no options. 1212 Type: 2 1214 Reserved1: 7-bit field. Reserved for future use. Zero on 1215 transmit. MUST be ignored on receipt. 1217 Reserved2: 16-bit field. Reserved for future use. Zero on 1218 transmit. MUST be ignored on receipt. 1220 Initiator Nonce: 32-bit unsigned integer. Copied from the I1 1221 message. 1223 Responder Nonce: 32-bit unsigned integer. A number picked by the 1224 responder which the initiator will return in the I2 1225 message. 1227 The following options are defined for this message: 1229 Responder Validator: Variable length option. Typically a hash 1230 generated by the responder, which the responder uses 1231 together with the Responder Nonce value to verify that 1232 an I2 message is indeed sent in response to a R1 1233 message, and that the parameters in the I2 message are 1234 the same as those in the I1 message. 1236 5.6 I2 Message Format 1238 The I2 message is the third message in the context establishment 1239 exchange. The initiator sends this in response to a R1 message, 1240 after checking the Initiator Nonce, etc. 1242 0 1 2 3 1243 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 1244 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1245 | 59 | Hdr Ext Len |0| Type = 3 | Reserved1 |0| 1246 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1247 | Checksum |R| | 1248 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 1249 | Initiator Context Tag | 1250 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1251 | Initiator Nonce | 1252 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1253 | Responder Nonce | 1254 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1255 | Reserved2 | 1256 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1257 | | 1258 + Options + 1259 | | 1260 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1262 Fields: 1264 Next Header: NO_NXT_HDR (59). 1266 Hdr Ext Len: At least 2, since the header is 24 octets when there 1267 are no options. 1269 Type: 3 1271 Reserved1: 7-bit field. Reserved for future use. Zero on 1272 transmit. MUST be ignored on receipt. 1274 R: 1-bit field. Reserved for future use. Zero on 1275 transmit. MUST be ignored on receipt. 1277 Initiator Context Tag: 47-bit field. The Context Tag the initiator 1278 has allocated for the context. 1280 Initiator Nonce: 32-bit unsigned integer. A random number picked by 1281 the initiator which the responder will return in the 1282 R2 message. 1284 Responder Nonce: 32-bit unsigned integer. Copied from the R1 1285 message. 1287 Reserved2: 32-bit field. Reserved for future use. Zero on 1288 transmit. MUST be ignored on receipt. (Needed to 1289 make the options start on a multiple of 8 octet 1290 boundary.) 1292 The following options are defined for this message: 1294 Responder Validator: Variable length option. Just a copy of the 1295 Responder Validator option in the R1 message. 1297 ULID pair: When the IPv6 source and destination addresses in the 1298 IPv6 header does not match the ULID pair, this option 1299 MUST be included. An example of this is when 1300 recovering from a lost context. 1302 Forked Instance Identifier: When another instance of an existent 1303 context with the same ULID pair is being created, a 1304 Forked Instance Identifier option is included to 1305 distinguish this new instance from the existent one. 1307 Locator list: Optionally sent when the initiator immediately wants 1308 to tell the responder its list of locators. When it 1309 is sent, the necessary HBA/CGA information for 1310 verifying the locator list MUST also be included. 1312 Locator Preferences: Optionally sent when the locators don't all have 1313 equal preference. 1315 CGA Parameter Data Structure: Included when the locator list is 1316 included so the receiver can verify the locator list. 1318 CGA Signature: Included when the some of the locators in the list use 1319 CGA (and not HBA) for verification. 1321 5.7 R2 Message Format 1323 The R2 message is the fourth message in the context establishment 1324 exchange. The responder sends this in response to an I2 message. 1325 The R2 message is also used when both hosts send I1 messages at the 1326 same time and the I1 messages cross in flight. 1328 0 1 2 3 1329 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 1330 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1331 | 59 | Hdr Ext Len |0| Type = 4 | Reserved1 |0| 1332 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1333 | Checksum |R| | 1334 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 1335 | Responder Context Tag | 1336 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1337 | Initiator Nonce | 1338 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1339 | | 1340 + Options + 1341 | | 1342 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1344 Fields: 1346 Next Header: NO_NXT_HDR (59). 1348 Hdr Ext Len: At least 1, since the header is 16 octets when there 1349 are no options. 1351 Type: 4 1353 Reserved1: 7-bit field. Reserved for future use. Zero on 1354 transmit. MUST be ignored on receipt. 1356 R: 1-bit field. Reserved for future use. Zero on 1357 transmit. MUST be ignored on receipt. 1359 Responder Context Tag: 47-bit field. The Context Tag the responder 1360 has allocated for the context. 1362 Initiator Nonce: 32-bit unsigned integer. Copied from the I2 1363 message. 1365 The following options are defined for this message: 1367 Locator List: Optionally sent when the responder immediately wants 1368 to tell the initiator its list of locators. When it 1369 is sent, the necessary HBA/CGA information for 1370 verifying the locator list MUST also be included. 1372 Locator Preferences: Optionally sent when the locators don't all have 1373 equal preference. 1375 CGA Parameter Data Structure: Included when the locator list is 1376 included so the receiver can verify the locator list. 1378 CGA Signature: Included when the some of the locators in the list use 1379 CGA (and not HBA) for verification. 1381 5.8 R1bis Message Format 1383 Should a host receive a packet with a shim Payload extension header 1384 or shim6 control message with type code 64-127 (such as an Update or 1385 Probe message), and the host does not have any context state for the 1386 received context tag, then it will generate a R1bis message. 1388 This message allows the sender of the packet referring to the non- 1389 existent context to re-establish the context with a reduced context 1390 establishment exchange. Upon the reception of the R1bis message, the 1391 receiver can proceed reestablishing the lost context by directly 1392 sending an I2bis message. 1394 0 1 2 3 1395 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 1396 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1397 | 59 | Hdr Ext Len |0| Type = 5 | Reserved1 |0| 1398 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1399 | Checksum |R| | 1400 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 1401 | Packet Context Tag | 1402 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1403 | Responder Nonce | 1404 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1405 | | 1406 + Options + 1407 | | 1408 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1410 Fields: 1412 Next Header: NO_NXT_HDR (59). 1414 Hdr Ext Len: At least 1, since the header is 16 octets when there 1415 are no options. 1417 Type: 5 1418 Reserved1: 7-bit field. Reserved for future use. Zero on 1419 transmit. MUST be ignored on receipt. 1421 R: 1-bit field. Reserved for future use. Zero on 1422 transmit. MUST be ignored on receipt. 1424 Packet Context Tag: 47-bit unsigned integer. The context tag 1425 contained in the received packet that triggered the 1426 generation of the R1bis message. 1428 Responder Nonce: 32-bit unsigned integer. A number picked by the 1429 responder which the initiator will return in the I2bis 1430 message. 1432 The following options are defined for this message: 1434 Responder Validator: Variable length option. Typically a hash 1435 generated by the responder, which the responder uses 1436 together with the Responder Nonce value to verify that 1437 an I2bis message is indeed sent in response to a R1bis 1438 message. 1440 5.9 I2bis Message Format 1442 The I2bis message is the third message in the context recovery 1443 exchange. This is sent in response to a R1bis message, after 1444 checking that the R1bis message refers to an existing context, etc. 1446 0 1 2 3 1447 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 1448 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1449 | 59 | Hdr Ext Len |0| Type = 6 | Reserved1 |0| 1450 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1451 | Checksum |R| | 1452 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 1453 | Initiator Context Tag | 1454 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1455 | Initiator Nonce | 1456 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1457 | Responder Nonce | 1458 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1459 | Reserved2 | 1460 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1461 | | | 1462 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 1463 | Packet Context Tag | 1464 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1465 | | 1466 + Options + 1467 | | 1468 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1470 Fields: 1472 Next Header: NO_NXT_HDR (59). 1474 Hdr Ext Len: At least 3, since the header is 32 octets when there 1475 are no options. 1477 Type: 6 1479 Reserved1: 7-bit field. Reserved for future use. Zero on 1480 transmit. MUST be ignored on receipt. 1482 R: 1-bit field. Reserved for future use. Zero on 1483 transmit. MUST be ignored on receipt. 1485 Initiator Context Tag: 47-bit field. The Context Tag the initiator 1486 has allocated for the context. 1488 Initiator Nonce: 32-bit unsigned integer. A random number picked by 1489 the initiator which the responder will return in the 1490 R2 message. 1492 Responder Nonce: 32-bit unsigned integer. Copied from the R1bis 1493 message. 1495 Reserved2: 49-bit field. Reserved for future use. Zero on 1496 transmit. MUST be ignored on receipt. (Note that 17 1497 bits are not sufficient since the options need start 1498 on a multiple of 8 octet boundary.) 1500 Packet Context Tag: 47-bit unsigned integer. Copied from the Packet 1501 Context Tag contained in the received R1bis. 1503 The following options are defined for this message: 1505 Responder Validator: Variable length option. Just a copy of the 1506 Responder Validator option in the R1bis message. 1508 ULID pair: When the IPv6 source and destination addresses in the 1509 IPv6 header does not match the ULID pair, this option 1510 MUST be included. 1512 Forked Instance Identifier: When another instance of an existent 1513 context with the same ULID pair is being created, a 1514 Forked Instance Identifier option is included to 1515 distinguish this new instance from the existent one. 1517 Locator list: Optionally sent when the initiator immediately wants 1518 to tell the responder its list of locators. When it 1519 is sent, the necessary HBA/CGA information for 1520 verifying the locator list MUST also be included. 1522 Locator Preferences: Optionally sent when the locators don't all have 1523 equal preference. 1525 CGA Parameter Data Structure: Included when the locator list is 1526 included so the receiver can verify the locator list. 1528 CGA Signature: Included when the some of the locators in the list use 1529 CGA (and not HBA) for verification. 1531 5.10 Update Request Message Format 1533 The Update Request Message is used to update either the list of 1534 locators, the locator preferences, and both. When the list of 1535 locators is updated, the message also contains the option(s) 1536 necessary for HBA/CGA to secure this. The basic sanity check that 1537 prevents off-path attackers from generating bogus updates is the 1538 context tag in the message. 1540 The update message contains options (the Locator List and the Locator 1541 Preferences) that, when included, completely replace the previous 1542 locator list and locator preferences, respectively. Thus there is no 1543 mechanism to just send deltas to the locator list. 1545 0 1 2 3 1546 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 1547 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1548 | 59 | Hdr Ext Len |0| Type = 64 | Reserved1 |0| 1549 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1550 | Checksum |R| | 1551 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 1552 | Receiver Context Tag | 1553 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1554 | Request Nonce | 1555 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1556 | | 1557 + Options + 1558 | | 1559 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1561 Fields: 1563 Next Header: NO_NXT_HDR (59). 1565 Hdr Ext Len: At least 1, since the header is 16 octets when there 1566 are no options. 1568 Type: 64 1570 Reserved1: 7-bit field. Reserved for future use. Zero on 1571 transmit. MUST be ignored on receipt. 1573 R: 1-bit field. Reserved for future use. Zero on 1574 transmit. MUST be ignored on receipt. 1576 Receiver Context Tag: 47-bit field. The Context Tag the receiver has 1577 allocated for the context. 1579 Request Nonce: 32-bit unsigned integer. A random number picked by 1580 the initiator which the peer will return in the 1581 acknowledgement message. 1583 The following options are defined for this message: 1585 Locator List: The list of the sender's (new) locators. The locators 1586 might be unchanged and only the preferences have 1587 changed. 1589 Locator Preferences: Optionally sent when the locators don't all have 1590 equal preference. 1592 CGA Parameter Data Structure (PDS): Included when the locator list is 1593 included and the PDS was not included in the 1594 I2/I2bis/R2 messages, so the receiver can verify the 1595 locator list. 1597 CGA Signature: Included when the some of the locators in the list use 1598 CGA (and not HBA) for verification. 1600 5.11 Update Acknowledgement Message Format 1602 This message is sent in response to a Update Request message. It 1603 implies that the Update Request has been received, and that any new 1604 locators in the Update Request can now be used as the source locators 1605 of packets. But it does not imply that the (new) locators have been 1606 verified to be used as a destination, since the host might defer the 1607 verification of a locator until it sees a need to use a locator as 1608 the destination. 1610 0 1 2 3 1611 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 1612 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1613 | 59 | Hdr Ext Len |0| Type = 65 | Reserved1 |0| 1614 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1615 | Checksum |R| | 1616 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 1617 | Receiver Context Tag | 1618 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1619 | Request Nonce | 1620 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1621 | | 1622 + Options + 1623 | | 1624 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1626 Fields: 1628 Next Header: NO_NXT_HDR (59). 1630 Hdr Ext Len: At least 1, since the header is 16 octets when there 1631 are no options. 1633 Type: 65 1635 Reserved1: 7-bit field. Reserved for future use. Zero on 1636 transmit. MUST be ignored on receipt. 1638 R: 1-bit field. Reserved for future use. Zero on 1639 transmit. MUST be ignored on receipt. 1641 Receiver Context Tag: 47-bit field. The Context Tag the receiver has 1642 allocated for the context. 1644 Request Nonce: 32-bit unsigned integer. Copied from the Update 1645 Request message. 1647 No options are currently defined for this message. 1649 5.12 Keepalive Message Format 1651 This message format is defined in [8]. 1653 The message is used to ensure that when a peer is sending ULP packets 1654 on a context, it always receives some packets in the reverse 1655 direction. When the ULP is sending bidirectional traffic, no extra 1656 packets need to be inserted. But for a unidirectional ULP traffic 1657 pattern, the shim will send back some Keepalive messages when it is 1658 receiving ULP packets. 1660 5.13 Probe Message Format 1662 This message and its semantics are defined in [8]. 1664 The idea behind that mechanism is to be able to handle the case when 1665 one locator pair works in from A to B, and another locator pair works 1666 from B to A, but there is no locator pair which works in both 1667 directions. The protocol mechanism is that as A is sending probe 1668 messages to B, B will observe which locator pairs it has received 1669 from and report that back in probe messages it is sending to A. 1671 5.14 Option Formats 1673 The format of the options is a snapshot of the current HIP option 1674 format [25]. However, there is no intention to track any changes to 1675 the HIP option format, nor is there an intent to use the same name 1676 space for the option type values. But using the same format will 1677 hopefully make it easier to import HIP capabilities into shim6 as 1678 extensions to shim6, should this turn out to be useful. 1680 All of the TLV parameters have a length (including Type and Length 1681 fields) which is a multiple of 8 bytes. When needed, padding MUST be 1682 added to the end of the parameter so that the total length becomes a 1683 multiple of 8 bytes. This rule ensures proper alignment of data. If 1684 padding is added, the Length field MUST NOT include the padding. Any 1685 added padding bytes MUST be zeroed by the sender, and their values 1686 SHOULD NOT be checked by the receiver. 1688 Consequently, the Length field indicates the length of the Contents 1689 field (in bytes). The total length of the TLV parameter (including 1690 Type, Length, Contents, and Padding) is related to the Length field 1691 according to the following formula: 1693 Total Length = 11 + Length - (Length + 3) % 8; 1695 0 1 2 3 1696 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 1697 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1698 | Type |C| Length | 1699 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1700 ~ ~ 1701 ~ Contents ~ 1702 ~ +-+-+-+-+-+-+-+-+ 1703 ~ | Padding | 1704 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1706 Fields: 1708 Type: 15-bit identifier of the type of option. The options 1709 defined in this document are below. 1711 C: Critical. One if this parameter is critical, and MUST 1712 be recognized by the recipient, zero otherwise. An 1713 implementation might view the C bit as part of the 1714 Type field, by multiplying the type values in this 1715 specification by two. 1717 Length: Length of the Contents, in bytes. 1719 Contents: Parameter specific, defined by Type. 1721 Padding: Padding, 0-7 bytes, added if needed. 1723 +------+---------------------------------+ 1724 | Type | Option Name | 1725 +------+---------------------------------+ 1726 | 1 | Responder Validator | 1727 | | | 1728 | 2 | Locator List | 1729 | | | 1730 | 3 | Locator Preferences | 1731 | | | 1732 | 4 | CGA Parameter Data Structure | 1733 | | | 1734 | 5 | CGA Signature | 1735 | | | 1736 | 6 | ULID Pair | 1737 | | | 1738 | 7 | Forked Instance Identifier | 1739 | | | 1740 | 10 | Probe Option | 1741 | | | 1742 | 11 | Reachability Option | 1743 | | | 1744 | 12 | Payload Reception Report Option | 1745 +------+---------------------------------+ 1747 Table 2 1749 5.14.1 Responder Validator Option Format 1751 The responder can choose exactly what input uses to compute the 1752 validator, and what one-way function (MD5, SHA1) it uses, as long as 1753 the responder can check that the validator it receives back in the I2 1754 or I2bis message is indeed one that: 1756 1)- it computed, 1758 2)- it computed for the particular context, and 1760 3)- that it isn't a replayed I2/I2bis message. 1762 Some suggestions on how to generate the validators are captured in 1763 Section 7.9.1 and Section 7.16.1. 1765 0 1 2 3 1766 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 1767 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1768 | Type = 1 |0| Length | 1769 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1770 ~ Validator ~ 1771 ~ +-+-+-+-+-+-+-+-+ 1772 ~ | Padding | 1773 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1775 Fields: 1777 Validator: Variable length content whose interpretation is local 1778 to the responder. 1780 Padding: Padding, 0-7 bytes, added if needed. See 1781 Section 5.14. 1783 5.14.2 Locator List Option Format 1785 The Locator List Option is used to carry all the locators of the 1786 sender. Note that the order of the locators is important, since the 1787 Locator Preferences refers to the locators by using the index in the 1788 list. 1790 Note that we carry all the locators in this option even though some 1791 of them can be created automatically from the CGA Parameter Data 1792 Structure. 1794 0 1 2 3 1795 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 1796 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1797 | Type = 2 |0| Length | 1798 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1799 | Locator List Generation | 1800 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1801 | Num Locators | N Octets of Verification Method | 1802 +-+-+-+-+-+-+-+-+ | 1803 ~ ~ 1804 ~ +-+-+-+-+-+-+-+-+ 1805 ~ | Padding | 1806 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1807 ~ Locators 1 through N ~ 1808 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1810 Fields: 1812 Locator List Generation: 32-bit unsigned integer. Indicates a 1813 generation number which is increased by one for each 1814 new locator list. This is used to ensure that the 1815 index in the Locator Preferences refer to the right 1816 version of the locator list. 1818 Num Locators: 8-bit unsigned integer. The number of locators that 1819 are included in the option. We call this number "N" 1820 below. 1822 Verification Method: N octets. The i'th octet specifies the 1823 verification method for the i'th locator. 1825 Padding: Padding, 0-7 bytes, added if needed so that the 1826 Locators start on a multiple of 8 octet boundary. 1827 NOTE that for this option there is never a need to pad 1828 at the end, since the locators are a multiple of 8 1829 octets in length. This internal padding is included 1830 in the length field. 1832 Locators: N 128-bit locators. 1834 The defined verification methods are: 1836 +-------+----------+ 1837 | Value | Method | 1838 +-------+----------+ 1839 | 0 | Reserved | 1840 | | | 1841 | 1 | HBA | 1842 | | | 1843 | 2 | CGA | 1844 | | | 1845 | 3-255 | Reserved | 1846 +-------+----------+ 1848 Table 3 1850 5.14.3 Locator Preferences Option Format 1852 The Locator Preferences option can have some flags to indicate 1853 whether or not a locator is known to work. In addition, the sender 1854 can include a notion of preferences. It might make sense to define 1855 "preferences" as a combination of priority and weight the same way 1856 that DNS SRV records has such information. The priority would 1857 provide a way to rank the locators, and within a given priority, the 1858 weight would provide a way to do some load sharing. See [9] for how 1859 SRV defines the interaction of priority and weight. 1861 The minimum notion of preferences we need is to be able to indicate 1862 that a locator is "dead". We can handle this using a single octet 1863 flag for each locator. 1865 We can extend that by carrying a larger "element" for each locator. 1866 This document presently also defines 2-octet and 3-octet elements, 1867 and we can add more information by having even larger elements if 1868 need be. 1870 The locators are not included in the preference list. Instead, the 1871 first element refers to locator that was in the first element in the 1872 Locator List option. The generation number carried in this option 1873 and the Locator List option is used to verify that they refer to the 1874 same version of the locator list. 1876 0 1 2 3 1877 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 1878 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1879 | Type = 3 |0| Length | 1880 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1881 | Locator List Generation | 1882 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1883 | Element Len | Element[1] | Element[2] | Element[3] | 1884 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1885 ~ ... ~ 1886 ~ +-+-+-+-+-+-+-+-+ 1887 ~ | Padding | 1888 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1890 Case of Element Len = 1 is depicted. 1892 Fields: 1894 Locator List Generation: 32-bit unsigned integer. Indicates a 1895 generation number for the locator list to which the 1896 elements should apply. 1898 Element Len: 8-bit unsigned integer. The length in octets of each 1899 element. This specification defines the cases when 1900 the length is 1, 2, or 3. 1902 Element[i]: A field with a number of octets defined by the Element 1903 Len field. Provides preferences for the i'th locator 1904 in the Locator List option that is in use. 1906 Padding: Padding, 0-7 bytes, added if needed. See 1907 Section 5.14. 1909 When the Element length equals one, then the element consists of only 1910 a one octet flags field. The currently defined set of flags are: 1912 BROKEN: 0x01 1914 TEMPORARY: 0x02 1916 The intent of TEMPORARY is to allow the distinction between more 1917 stable addresses and less stable addresses when shim6 is combined 1918 with IP mobility, when we might have more stable home locators, and 1919 less stable care-of-locators. 1921 When the Element length equals two, then the element consists of a 1 1922 octet flags field followed by a 1 octet priority field. The priority 1923 has the same semantics as the priority in DNS SRV records. 1925 When the Element length equals three, then the element consists of a 1926 1 octet flags field followed by a 1 octet priority field, and a 1 1927 octet weight field. The weight has the same semantics as the weight 1928 in DNS SRV records. 1930 This document doesn't specify the format when the Element length is 1931 more than three, except that any such formats MUST be defined so that 1932 the first three octets are the same as in the above case, that is, a 1933 of a 1 octet flags field followed by a 1 octet priority field, and a 1934 1 octet weight field. 1936 5.14.4 CGA Parameter Data Structure Option Format 1938 This option contains the CGA Parameter Data Structure (PDS). When 1939 HBA is used to verify the locators, the PDS contains the HBA 1940 multiprefix extension. When CGA is used to verify the locators, in 1941 addition to the PDS option, the host also needs to include the 1942 signature in the form of a CGA Signature option. 1944 0 1 2 3 1945 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 1946 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1947 | Type = 4 |0| Length | 1948 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1949 ~ CGA Parameter Data Structure ~ 1950 ~ +-+-+-+-+-+-+-+-+ 1951 ~ | Padding | 1952 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1953 Fields: 1955 CGA Parameter Data Structure: Variable length content. Content 1956 defined in [6] and [7]. 1958 Padding: Padding, 0-7 bytes, added if needed. See 1959 Section 5.14. 1961 5.14.5 CGA Signature Option Format 1963 When CGA is used for verification of one or more of the locators in 1964 the Locator List option, then the message in question will need to 1965 contain this option. 1967 0 1 2 3 1968 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 1969 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1970 | Type = 5 |0| Length | 1971 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1972 ~ CGA Signature ~ 1973 ~ +-+-+-+-+-+-+-+-+ 1974 ~ | Padding | 1975 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1977 Fields: 1979 CGA Signature: A variable-length field containing a PKCS#1 v1.5 1980 signature, constructed by using the sender's private 1981 key over the following sequence of octets: 1983 1. The 128-bit CGA Message Type tag [CGA] value for 1984 SHIM6, 0x4A 30 5662 4858 574B 3655 416F 506A 6D48. 1985 (The tag value has been generated randomly by the 1986 editor of this specification.). 1988 2. The Locator List Generation value of the 1989 correspondent Locator List Option. 1991 3. The subset of locators included in the 1992 correspondent Locator List Option which 1993 verification method is set to CGA. The locators 1994 MUST be included in the order they are listed in 1995 the Locator List Option. 1997 Padding: Padding, 0-7 bytes, added if needed. See 1998 Section 5.14. 2000 5.14.6 ULID Pair Option Format 2002 I1, I2, and I2bis messages MUST contain the ULID pair; normally this 2003 is in the IPv6 source and destination fields. In case that the ULID 2004 for the context differ from the address pair included in the source 2005 and destination address fields of the IPv6 packet used to carry the 2006 I1/I2/I2bis message, the ULID pair option MUST be included in the I1/ 2007 I2/I2bis message. 2009 0 1 2 3 2010 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 2011 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2012 | Type = 6 |0| Length = 36 | 2013 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2014 | Reserved2 | 2015 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2016 | | 2017 + Sender ULID + 2018 | | 2019 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2020 | | 2021 + Receiver ULID + 2022 | | 2023 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2025 Fields: 2027 Reserved2: 32-bit field. Reserved for future use. Zero on 2028 transmit. MUST be ignored on receipt. (Needed to 2029 make the ULIDs start on a multiple of 8 octet 2030 boundary.) 2032 Sender ULID: A 128-bit IPv6 address. 2034 Receiver ULID: A 128-bit IPv6 address. 2036 5.14.7 Forked Instance Identifier Option Format 2038 0 1 2 3 2039 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 2040 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2041 | Type = 7 |0| Length = 4 | 2042 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2043 | Forked Instance Identifier | 2044 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2046 Fields: 2048 Forked Instance Identifier: 32-bit field containing the identifier of 2049 the particular forked instance. 2051 5.14.8 Probe Option Format 2053 This option is defined in [8]. 2055 5.14.9 Reachability Option Format 2057 This option is defined in [8]. 2059 5.14.10 Payload Reception Report Option Format 2061 This option is defined in [8]. 2063 6. Conceptual Model of a Host 2065 This section describes a conceptual model of one possible data 2066 structure organization that hosts will maintain for the purposes of 2067 shim6. The described organization is provided to facilitate the 2068 explanation of how the shim6 protocol should behave. This document 2069 does not mandate that implementations adhere to this model as long as 2070 their external behavior is consistent with that described in this 2071 document. 2073 6.1 Conceptual Data Structures 2075 The key conceptual data structure for the shim6 protocol is the ULID 2076 pair context. This is a data structure which contains the following 2077 information: 2079 o The state of the context. See Section 6.2. 2081 o The peer ULID; ULID(peer) 2083 o The local ULID; ULID(local) 2085 o The Forked Instance Identifier; FII. This is zero for the default 2086 context i.e., when there is no forking. 2088 o The list of peer locators, with their preferences; Ls(peer) 2090 o The generation number for the most recently received, verified 2091 peer locator list. 2093 o For each peer locator, the verification method to use (from the 2094 Locator List option). 2096 o For each peer locator, a bit whether it has been verified using 2097 HBA or CGA, and a bit whether the locator has been probed to 2098 verify that the ULID is present at that location. 2100 o The preferred peer locator - used as destination; Lp(peer) 2102 o The set of local locators and the preferences; Ls(local) 2104 o The generation number for the most recently sent Locator List 2105 option. 2107 o The preferred local locator - used as source; Lp(local) 2109 o The context tag used to transmit control messages and payload 2110 extension headers - allocated by the peer; CT(peer) 2112 o The context to expect in received control messages and payload 2113 extension headers - allocated by the local host; CT(local) 2115 o Timers for retransmission of the messages during context 2116 establishment and update messages. 2118 o Depending how an implementation determines whether a context is 2119 still in use, there might be a need to track the last time a 2120 packet was sent/received using the context. 2122 o Reachability state for the locator pairs as specified in [8]. 2124 o During pair exploration, information about the probe messages that 2125 have been sent and received as specified in [8]. 2127 6.2 Context States 2129 The states that are used to describe the shim6 protocol are as 2130 follows: 2132 +---------------------+---------------------------------------------+ 2133 | State | Explanation | 2134 +---------------------+---------------------------------------------+ 2135 | IDLE | State machine start | 2136 | | | 2137 | I1-SENT | Initiating context establishment exchange | 2138 | | | 2139 | I2-SENT | Waiting to complete context establishment | 2140 | | exchange | 2141 | | | 2142 | I2BIS-SENT | Potential context loss detected | 2143 | | | 2144 | | | 2145 | ESTABLISHED | SHIM context established | 2146 | | | 2147 | E-FAILED | Context establishment exchange failed | 2148 | | | 2149 | NO-SUPPORT | ICMP payload type unknown (type 4, code 1) | 2150 | | received indicating that shim6 is not | 2151 | | supported | 2152 +---------------------+---------------------------------------------+ 2153 In addition, in each of the aforementioned states, the following 2154 state information is stored: 2156 +---------------------+---------------------------------------------+ 2157 | State | Information | 2158 +---------------------+---------------------------------------------+ 2159 | IDLE | None | 2160 | | | 2161 | I1-SENT | ULID(peer), ULID(local), [FII], CT(local), | 2162 | | INIT nonce, Lp(local), Lp(peer), Ls(local) | 2163 | | | 2164 | I2-SENT | ULID(peer), ULID(local), [FII], CT(local), | 2165 | | INIT nonce, RESP nonce, Lp(local), Lp(peer),| 2166 | | Ls(local) | 2167 | | | 2168 | ESTABLISHED | ULID(peer), ULID(local), [FII], CT(local), | 2169 | | CT(peer), Lp(local), Lp(peer), Ls(local) | 2170 | | Ls(peer), INIT nonce?(to receive late R2) | 2171 | | | 2172 | I2BIS-SENT | ULID(peer), ULID(local), [FII], CT(local), | 2173 | | CT(peer), Lp(local), Lp(peer), Ls(local) | 2174 | | Ls(peer), CT(R1bis) | 2175 | | | 2176 | E-FAILED | ULID(peer), ULID(local) | 2177 | | | 2178 | NO-SUPPORT | ULID(peer), ULID(local) | 2179 +---------------------+---------------------------------------------+ 2181 7. Establishing ULID-Pair Contexts 2183 ULID-pair contexts are established using a 4-way exchange, which 2184 allows the responder to avoid creating state on the first packet. As 2185 part of this exchange each end allocates a context tag, and it shares 2186 this context tag and its set of locators with the peer. 2188 In some cases the 4-way exchange is not necessary, for instance when 2189 both ends try to setup the context at the same time, or when 2190 recovering from a context that has been garbage collected or lost at 2191 one of the hosts. 2193 7.1 Uniqness of Context Tags 2195 As part of establishing a new context, each host has to assign a 2196 unique context tag. Since the Payload Extension headers are 2197 demultiplexed based solely on the context tag value (without using 2198 the locators), the context tag MUST be unique for each context. 2200 In addition, in order to minimize the reuse of context tags, the host 2201 SHOULD randomly cycle through the 2^47 context tag values,(e.g. 2202 following the guidelines described in [17]). 2204 7.2 Locator Verification 2206 The peer's locators might need to be verified during context 2207 establishment as well as when handling locator updates in Section 10. 2209 There are two separate aspects of locator verification. One is to 2210 verify that the locator is tied to the ULID, i.e., that the host 2211 which "owns" the ULID is also the one that is claiming the locator 2212 "ownership". The shim6 protocol uses the HBA or CGA techniques for 2213 doing this verification. The other is to verify that the host is 2214 indeed reachable at the claimed locator. Such verification is needed 2215 both to make sure communication can proceed, but also to prevent 3rd 2216 party flooding attacks [19]. These different verifications happen at 2217 different times, since the first might need to be performed before 2218 packets can be received by the peer with the source locator in 2219 question, but the latter verification is only needed before packets 2220 are sent to the locator. 2222 Before a host can use a locator (different than the ULID) as the 2223 source locator, it must know that the peer will accept packets with 2224 that source locator as being part of this context. Thus the HBA/CGA 2225 verification SHOULD be performed by the host before the host 2226 acknowledges the new locator, by sending an Update Acknowledgement 2227 message, or an R2 message. 2229 Before a host can use a locator (different than the ULID) as the 2230 destination locator it MUST perform the HBA/CGA verification if this 2231 was not performed before upon the reception of the locator set. In 2232 addition, it MUST verify that the ULID is indeed present at that 2233 locator. This verification is performed by doing a return- 2234 routability test as part of the Probe sub-protocol [8]. 2236 If the verification method in the Locator List option is not 2237 supported by the host, or if the verification method is not 2238 consistent with the CGA Parameter Data Structure (e.g., the Parameter 2239 Data Structure doesn't contain the multiprefix extension, and the 2240 verification method says to use HBA), then the host MUST ignore the 2241 Locator List and the message in which it is contained, and the host 2242 SHOULD generates an ICMP parameter problem (type 4, code 0), with the 2243 Pointer referencing the octet in the Verification method that was 2244 found inconsistent. 2246 7.3 Normal context establishment 2248 The normal context establishment consists of a 4 message exchange in 2249 the order of I1, R1, I2, R2 as can be seen in Figure 24. 2251 Initiator Responder 2253 IDLE IDLE 2254 ------------- I1 --------------> 2255 I1-SENT 2256 <------------ R1 --------------- 2257 IDLE 2258 ------------- I2 --------------> 2259 I2-SENT 2260 <------------ R2 --------------- 2261 ESTABLISHED ESTABLISHED 2263 Figure 24: Normal context establishment 2265 7.4 Concurrent context establishment 2267 When both ends try to initiate a context for the same ULID pair, then 2268 we might end up with crossing I1 messages. Alternatively, since no 2269 state is created when receiving the I1, a host might send a I1 after 2270 having sent a R1 message. 2272 Since a host remembers that it has sent an I1, it can respond to an 2273 I1 from the peer (for the same ULID-pair), with a R2, resulting in 2274 the message exchange shown in Figure 25. Such behavior is needed for 2275 other reasons such as to correctly respond to retransmitted I1 2276 messages, which occur when the R2 message has been lost. 2278 Host A Host B 2280 IDLE IDLE 2281 -\ 2282 I1-SENT---\ 2283 ---\ /--- 2284 --- I1 ---\ /--- I1-SENT 2285 ---\ 2286 /--- I1 ---/ ---\ 2287 /--- --> 2288 <--- 2290 -\ 2291 I1-SENT---\ 2292 ---\ /--- 2293 --- R2 ---\ /--- I1-SENT 2294 ---\ 2295 /--- R2 ---/ ---\ 2296 /--- --> 2297 <--- ESTABLISHED 2298 ESTABLISHED 2300 Figure 25: Crossing I1 messages 2302 If a host has received an I1 and sent an R1, it has no state to 2303 remember this. Thus if the ULP on the host sends down packets, this 2304 might trigger the host to send an I1 message itself. Thus while one 2305 end is sending an I1 the other is sending an I2 as can be seen in 2306 Figure 26. 2308 Host A Host B 2310 IDLE IDLE 2311 -\ 2312 ---\ 2313 I1-SENT ---\ 2314 --- I1 ---\ 2315 ---\ 2316 ---\ 2317 --> 2319 /--- 2320 /--- IDLE 2321 --- 2322 /--- R1--/ 2323 /--- 2324 <--- 2326 -\ 2327 I2-SENT---\ 2328 ---\ /--- 2329 --- I2---\ /--- I1-SENT 2330 ---\ 2331 /--- I1 ---/ ---\ 2332 /--- --> 2333 <--- ESTABLISHED 2335 -\ 2336 I2-SENT---\ 2337 ---\ /--- 2338 --- R2 ---\ /--- 2339 ---\ 2340 /--- R2 ---/ ---\ 2341 /--- --> 2342 <--- ESTABLISHED 2343 ESTABLISHED 2345 Figure 26: Crossing I2 and I1 2347 7.5 Context recovery 2349 Due to garbage collection, we can end up with one end having and 2350 using the context state, and the other end not having any state. We 2351 need to be able to recover this state at the end that has lost it, 2352 before we can use it. 2354 This need can arise in the following cases: 2356 o The communication is working using the ULID pair as the locator 2357 pair, but a problem arises, and the end that has retained the 2358 context state decides to probe alternate locator pairs. 2360 o The communication is working using a locator pair that is not the 2361 ULID pair, hence the ULP packets sent from a peer that has 2362 retained the context state use the shim6 Payload extension header. 2364 o The host that retained the state sends a control message (e.g. an 2365 Update Request message). 2367 In all the cases the result is that the peer without state receives a 2368 shim message for which it has to context for the context tag. 2370 In all of those cases we can recover the context by having the node 2371 which doesn't have a context state, send back an R1bis message, and 2372 have then complete the recovery with a I2bis and R2 message as can be 2373 seen in Figure 27. 2375 Host A Host B 2377 Context for 2378 CT(peer)=X Discards context for 2379 CT(local)=X 2381 ESTABLISHED IDLE 2383 ---- payload, probe, etc. -----> No context state 2384 for CT(local)=X 2386 <------------ R1bis ------------ 2387 IDLE 2389 ------------- I2bis -----------> 2390 I2BIS_SENT 2391 <------------ R2 --------------- 2392 ESTABLISHED ESTABLISHED 2394 Figure 27: Context loss at receiver 2396 If one end has garbage collected or lost the context state, it might 2397 try to create a new context state (for the same ULID pair), by 2398 sending an I1 message. The peer (that still has the context state) 2399 will reply with an R1 message and the full 4-way exchange will be 2400 performed again in this case as can be seen in Figure 28. 2402 Host A Host B 2404 Context for 2405 CT(peer)=X Discards context for 2406 ULIDs A1, B1 CT(local)=X 2408 ESTABLISHED IDLE 2410 Finds <------------ I1 --------------- Tries to setup 2411 existing for ULIDs A1, B1 2412 context, 2413 but CT(peer) I1-SENT 2414 doesn't match 2415 ------------- R1 ---------------> 2416 Left old context 2417 in ESTABLISHED 2419 <------------ I2 --------------- 2420 Recreate context 2422 with new CT(peer) I2-SENT 2423 and Ls(peer). 2425 ESTABLISHED 2426 ------------- R2 --------------> 2427 ESTABLISHED ESTABLISHED 2429 Figure 28: Context loss at sender 2431 7.6 Context confusion 2433 Since each end might garbage collect the context state we can have 2434 the case when one end has retained the context state and tries to use 2435 it, while the other end has lost the state. We discussed this in the 2436 previous section on recovery. But for the same reasons, when one 2437 host retains context tag X as CT(peer) for ULID pair , the 2438 other end might end up allocating that context tag as CT(local) for 2439 another ULID pair, e.g., between the same hosts. In this 2440 case we can not use the recovery mechanisms since there needs to be 2441 separate context tags for the two ULID pairs. 2443 This type of "confusion" can be observed in two cases (assuming it is 2444 A that has retained the state and B has dropped it): 2446 o B decides to create a context for ULID pair , and 2447 allocates X as its context tag for this, and sends an I1 to A. 2449 o A decides to create a context for ULID pair , and starts 2450 the exchange by sending I1 to B. When B receives the I2 message, 2451 it allocates X as the context tag for this context. 2453 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 . 2455 Thus A can detect that B must have lost the context for . 2457 The confusion can be detected when I2/I2bis/R2 is received since we 2458 require that those messages MUST include a sufficiently large set of 2459 locators in a Locator List option that the peer can determine whether 2460 or not two contexts have the same host as the peer by comparing if 2461 there is any common locators in Ls(peer). 2463 The requirement is that the old context which used the context tag 2464 MUST be removed; it can no longer be used to send packets. Thus A 2465 would forcibly remove the context state for , so that it 2466 can accept the new context for . An implementation MAY 2467 re-create a context to replace the one that was removed; in this case 2468 for . The normal I1, R1, I2, R2 establishment exchange would 2469 then pick unique context tags for that replacement context. This re- 2470 creation is OPTIONAL, but might be useful when there is ULP 2471 communication which is using the ULID pair whose context was removed. 2473 Note that an I1 message with a duplicate context tag should not cause 2474 the removal of the old context state; this operation needs to be 2475 deferred until the reception of the I2 message. 2477 7.7 Sending I1 messages 2479 When the shim layer decides to setup a context for a ULID pair, it 2480 starts by allocating and initializing the context state for its end. 2481 As part of this it assigns a random context tag to the context that 2482 is not being used as CT(local) by any other context . In the case 2483 that a new API is used and the ULP requests a forked context, the 2484 Forked Instance Identifier value will be set to a non-zero value. 2485 Otherwise, the FII value is zero. Then the initiator can send an I1 2486 message and set the context state to I1-SENT. The I1 message MUST 2487 include the ULID pair; normally in the IPv6 source and destination 2488 fields. But if the ULID pair for the context is not used as locator 2489 pair for the I1 message, then a ULID option MUST be included in the 2490 I1 message. In addition, if a Forked Instance Identifier value is 2491 non-zero, the I1 message MUST include a Context Instance Identifier 2492 option containing the correspondent value. 2494 7.8 Retransmitting I1 messages 2496 If the host does not receive an I2 or R2 message in response to the 2497 I1 message after I1_TIMEOUT time, then it needs to retransmit the I1 2498 message. The retransmissions should use a retransmission timer with 2499 binary exponential backoff to avoid creating congestion issues for 2500 the network when lots of hosts perform I1 retransmissions. Also, the 2501 actual timeout value should be randomized between 0.5 and 1.5 of the 2502 nominal value to avoid self-synchronization. 2504 If, after I1_RETRIES_MAX retransmissions, there is no response, then 2505 most likely the peer does not implement the shim6 protocol, or there 2506 could be a firewall that blocks the protocol. In this case it makes 2507 sense for the host to remember to not try again to establish a 2508 context with that ULID. However, any such negative caching should 2509 retained for at most NO_R1_HOLDDOWN_TIME, to be able to later setup a 2510 context should the problem have been that the host was not reachable 2511 at all when the shim tried to establish the context. 2513 If the host receives an ICMP error with "payload type unknown" (type 2514 4, code 1) and the included packet is the I1 message it just sent, 2515 then this is a more reliable indication that the peer ULID does not 2516 implement shim6. Again, in this case, the host should remember to 2517 not try again to establish a context with that ULID. Such negative 2518 caching should retained for at most ICMP_HOLDDOWN_TIME, which should 2519 be significantly longer than the previous case. 2521 7.9 Receiving I1 messages 2523 A host MUST silently discard any received I1 messages that do not 2524 satisfy all of the following validity checks in addition to those 2525 specified in Section 12.2: 2527 o The Hdr Ext Len field is at least 1, i.e., the length is at least 2528 16 octets. 2530 Upon the reception of an I1 message, the host extracts the ULID pair 2531 and the Forked Instance Identifier from the message. If there is no 2532 ULID-pair option, then the ULID pair is taken from the source and 2533 destination fields in the IPv6 header. If there is no FII option in 2534 the message, then the FII value is taken to be zero. 2536 Next the host looks for an existing context which matches the ULID 2537 pair and the FII. 2539 If no state is found (i.e., the state is IDLE), then the host replies 2540 with a R1 message as specified below. 2542 If such a context exists in ESTABLISHED state, the host verifies that 2543 the locator of the Initiator is included in Ls(peer) (This check is 2544 unnecessary if there is no ULID-pair option in the I1 message). 2546 If the state exists in ESTABLISHED state and the locators do not fall 2547 in the locator sets, then the host replies with a R1 message as 2548 specified below. This completes the I1 processing, with the context 2549 state being unchanged. 2551 If the state exists in ESTABLISHED state and the locators do fall in 2552 the sets, then the host compares CT(peer) for the context with the CT 2553 contained in the I1 message. 2555 o If the context tags match, then this probably means that the R2 2556 message was lost and this I1 is a retransmission. In this case, 2557 the host replies with a R2 message containing the information 2558 available for the existent context. 2560 o If the context tags do not match, then it probably means that the 2561 Initiator has lost the context information for this context and it 2562 is trying to establish a new one for the same ULID-pair. In this 2563 case, the host replies with a R1 message as specified below. This 2564 completes the I1 processing, with the context state being 2565 unchanged. 2567 If the state exists in other state (I1-SENT, I2-SENT, I2BIS-SENT), we 2568 are in the situation of Concurrent context establishment described 2569 in Section 7.4. In this case, the host leaves CT(peer) unchanged, 2570 and replies with a R2 message. This completes the I1 processing, 2571 with the context state being unchanged. 2573 When the host needs to send a R1 message in response to the I1 2574 message, it copies the Initiator Nonce from the I1 message to the R1 2575 message, generates a Responder Nonce and calculates a Responder 2576 Validator option as suggested in the following section. No state is 2577 created on the host in this case. 2579 When the host needs to send a R2 message in response to the I1 2580 message, it copies the Initiator Nonce from the I1 message to the R2 2581 message, and otherwise follows the normal rules for forming an R2 2582 message (see Section 7.13). 2584 7.9.1 Generating the R1 Validator 2586 One way for the responder to properly generate validators is to 2587 maintain a single secret (S) and a running counter for the Responder 2588 Nonce. 2590 In the case the validator is generated to be included in a R1 2591 message, for each I1 message. The responder can increase the 2592 counter, use the counter value as the responder nonce, and use the 2593 following information as input to the one-way function: 2595 o The the secret S 2597 o That Responder Nonce 2599 o The Initiator Context Tag from the I1 message 2601 o The ULIDs from the I1 message 2603 o The locators from the I1 message (strictly only needed if they are 2604 different from the ULIDs) 2606 o The forked instance identifier if such option was included in the 2607 I1 message 2609 and then the output of the hash function is used as the validator 2610 octet string. 2612 7.10 Receiving R1 messages and sending I2 messages 2614 A host MUST silently discard any received R1 messages that do not 2615 satisfy all of the following validity checks in addition to those 2616 specified in Section 12.2: 2618 o The Hdr Ext Len field is at least 1, i.e., the length is at least 2619 16 octets. 2621 Upon the reception of an R1 message, the host extracts the Initiator 2622 Nonce and the Locator Pair from the message (the latter from the 2623 source and destination fields in the IPv6 header). Next the host 2624 looks for an existing context which matches the Initiator Nonce and 2625 where the locators are contained in Ls(peer) and Ls(local), 2626 respectively. If no such context is found, then the R1 message is 2627 silently discarded. 2629 If such a context is found, then the host looks at the state: 2631 o If the state is I1-SENT, then it sends an I2 message as specified 2632 below. 2634 o In any other state (I2-SENT, I2BIS-SENT, ESTABLISHED) then the 2635 host has already sent an I2 message then this is probably a reply 2636 to a retransmitted I1 message, so this R1 message MUST be silently 2637 discarded. 2639 When the host sends an I2 message, then it includes the Responder 2640 Validator option that was in the R1 message. The I2 message MUST 2641 include the ULID pair; normally in the IPv6 source and destination 2642 fields. If a ULID-pair option was included in the I1 message then it 2643 MUST be included in the I2 message as well. In addition, if the 2644 Forked Instance Identifier value for this context is non-zero, the I2 2645 message MUST contain a Forked Instance Identifier Option carrying 2646 this value. Besides, the I2 message contains an Initiator Nonce. 2647 This is not required to be the same than the one included in the 2648 previous I1 message. 2650 The I2 message also includes the Initiator's locator list and the CGA 2651 parameter data structure. If CGA (and not HBA) is used to verify the 2652 locator list, then Initiator also signs the key parts of the message 2653 and includes a CGA signature option containing the signature. 2655 When the I2 message has been sent, the state is set to I2-SENT. 2657 7.11 Retransmitting I2 messages 2659 If the initiator does not receive an R2 message after I2_TIMEOUT time 2660 after sending an I2 message it MAY retransmit the I2 message, using 2661 binary exponential backoff and randomized timers. The Responder 2662 Validator option might have a limited lifetime, that is, the peer 2663 might reject Responder Validator options that are older than 2664 VALIDATOR_MIN_LIFETIME to avoid replay attacks. Thus the initiator 2665 SHOULD fall back to retransmitting the I1 message when there is no R2 2666 received after retransmitting the I2 message I2_RETRIES_MAX times. 2668 7.12 Receiving I2 messages 2670 A host MUST silently discard any received I2 messages that do not 2671 satisfy all of the following validity checks in addition to those 2672 specified in Section 12.2: 2674 o The Hdr Ext Len field is at least 2, i.e., the length is at least 2675 24 octets. 2677 Upon the reception of an I2 message, the host extracts the ULID pair 2678 and the Forked Instance identifier from the message. If there is no 2679 ULID-pair option, then the ULID pair is taken from the source and 2680 destination fields in the IPv6 header. If there is no FII option in 2681 the message, then the FII value is taken to be zero. 2683 Next the host verifies that the Responder Nonce is a recent one, and 2684 that the Responder Validator option matches the validator the host 2685 would have computed for the ULID, locators, responder nonce, and FII. 2687 If a CGA Parameter Data Structure (PDS) is included in the message, 2688 then the host MUST verify if the actual PDS contained in the message 2689 corresponds to the ULID(peer). 2691 If any of the above verifications fails, then the host silently 2692 discard the message and it has completed the I2 processing. 2694 If all the above verifications are successful, then the host proceeds 2695 to look for a context state for the Initiator. The host looks for a 2696 context with the extracted ULID pair and FII. If none exist then 2697 state of the (non-existing) context is viewed as being IDLE, thus the 2698 actions depend on the state as follows: 2700 o If the state is IDLE (i.e., the context does not exist) the host 2701 allocates a context tag (CT(local)), creates the context state for 2702 the context, and sets its state to ESTABLISHED. It records 2703 CT(peer), and the peer's locator set as well as its own locator 2704 set in the context. It SHOULD perform the HBA/CGA verification of 2705 the peer's locator set at this point in time, as specified in 2706 Section 7.2. Then the host sends an R2 message back as specified 2707 below. 2709 o If the state is I1-SENT, then the host verifies if the source 2710 locator is included in Ls(peer) or, it is included in the Locator 2711 List contained in the the I2 message and the HBA/CGA verification 2712 for this specific locator is successful 2714 * If this is not the case, then the message is silently discarded 2715 and the context state remains unchanged. 2717 * If this is the case, then the host updates the context 2718 information (CT(peer), Ls(peer)) with the data contained in the 2719 I2 message and the host MUST send a R2 message back as 2720 specified below. Note that before updating Ls(peer) 2721 information, the host SHOULD perform the HBA/CGA validation of 2722 the peer's locator set at this point in time as specified in 2723 Section 7.2. The host moves to ESTABLISHED state. 2725 o If the state is ESTABLISHED, I2-SENT, or I2BIS-SENT, then the host 2726 verifies if the source locator is included in Ls(peer) or, it is 2727 included in the Locator List contained in the the I2 message and 2728 the HBA/CGA verification for this specific locator is successful 2730 * If this is not the case, then the message is silently discarded 2731 and the context state remains unchanged. 2733 * If this is the case, then the host updates the context 2734 information (CT(peer), Ls(peer)) with the data contained in the 2735 I2 message and the host MUST send a R2 message back as 2736 specified in Section 7.13. Note that before updating Ls(peer) 2737 information, the host SHOULD perform the HBA/CGA validation of 2738 the peer's locator set at this point in time as specified in 2739 Section 7.2. The context state remains unchanged. 2741 7.13 Sending R2 messages 2743 Before the host sends the R2 message it MUST look for a possible 2744 context confusion i.e. where it would end up with multiple contexts 2745 using the same CT(peer) for the same peer host. See Section 7.14. 2747 When the host needs to send an R2 message, the host forms the message 2748 using its locators and its context tag, copies the Initiator Nonce 2749 from the triggering message (I2, I2bis, or I1), and includes the 2750 necessary options so that the peer can verify the locators. In 2751 particular, the R2 message includes the Responder's locator list and 2752 the PDS option. If CGA (and not HBA) is used to verify the locator 2753 list, then the Responder also signs the key parts of the message and 2754 includes a CGA Signature option containing the signature. 2756 R2 messages are never retransmitted. If the R2 message is lost, then 2757 the initiator will retransmit either the I2/I2bis or I1 message. 2758 Either retransmission will cause the responder to find the context 2759 state and respond with an R2 message. 2761 7.14 Match for Context Confusion 2763 When the host receives an I2, I2bis, or R2 it MUST look for a 2764 possible context confusion i.e. where it would end up with multiple 2765 contexts using the same CT(peer) for the same peer host. This can 2766 happen when it has received the above messages since they create a 2767 new context with a new CT(peer). Same issue applies when CT(peer) is 2768 updated for an existing context. 2770 The host takes CT(peer) for the newly created or updated context, and 2771 looks for other contexts which: 2773 o Are in state ESTABLISHED or I2BIS-SENT. 2775 o Have the same CT(peer). 2777 o Where Ls(peer) has at least one locator in common with the newly 2778 created or updated context. 2780 If such a context is found, then the host checks if the ULID pair or 2781 the Forked Instance Identifier different than the ones in the newly 2782 created or updated context: 2784 o If either or both are different, then the peer is reusing the 2785 context tag for the creation of a context with different ULID pair 2786 or FII, which is an indication that the peer has lost the original 2787 context. In this case, we are in the Context confusion situation, 2788 and the host MUST NOT use the old context to send any packets. It 2789 MAY just discard the old context (after all, the peer has 2790 discarded it), or it MAY attempt to re-establish the old context 2791 by sending a new I1 message and moving its state to I1-SENT. In 2792 any case, once that this situation is detected, the host MUST NOT 2793 keep two contexts with overlapping Ls(peer) locator sets and the 2794 same context tag in ESTABLISHED state, since this would result in 2795 demultiplexing problems on the peer. 2797 o If both are the same, then this context is actually the context 2798 that is created or updated, hence there is no confusion. 2800 7.15 Receiving R2 messages 2802 A host MUST silently discard any received R2 messages that do not 2803 satisfy all of the following validity checks in addition to those 2804 specified in Section 12.2: 2806 o The Hdr Ext Len field is at least 1, i.e., the length is at least 2807 16 octets. 2809 Upon the reception of an R2 message, the host extracts the Initiator 2810 Nonce and the Locator Pair from the message (the latter from the 2811 source and destination fields in the IPv6 header). Next the host 2812 looks for an existing context which matches the Initiator Nonce and 2813 where the locators are Lp(peer) and Lp(local), respectively. Based 2814 on the state: 2816 o If no such context is found, i.e., the state is IDLE, then the 2817 message is silently dropped. 2819 o If state is I1-SENT, I2-SENT, or I2BIS-SENT then the host performs 2820 the following actions: If a CGA Parameter Data Structure (PDS) is 2821 included in the message, then the host MUST verify that the actual 2822 PDS contained in the message corresponds to the ULID(peer) as 2823 specified in Section 7.2. If the verification fails, then the 2824 message is silently dropped. If the verification succeeds, then 2825 the host records the information from the R2 message in the 2826 context state; it records the peer's locator set and CT(peer). 2827 The host SHOULD perform the HBA/CGA verification of the peer's 2828 locator set at this point in time, as specified in Section 7.2. 2829 The host sets its state to ESTABLISHED. 2831 o If the state is ESTABLISHED, the R2 message is silently ignored, 2832 (since this is likely to be a reply to a retransmitted I2 2833 message). 2835 Before the host completes the R2 processing it MUST look for a 2836 possible context confusion i.e. where it would end up with multiple 2837 contexts using the same CT(peer) for the same peer host. See 2838 Section 7.14. 2840 7.16 Sending R1bis messages 2842 Upon the receipt of a shim6 payload extension header where there is 2843 no current SHIM6 context at the receiver, the receiver is to respond 2844 with an R1bis message in order to enable a fast re-establishment of 2845 the lost SHIM6 context. 2847 Also a host is to respond with a R1bis upon receipt of any control 2848 messages that has a message type in the range 64-127 (i.e., excluding 2849 the context setup messages such as I1, R1, R1bis, I2, I2bis, R2 and 2850 future extensions), where the control message refers to a non 2851 existent context. 2853 We assume that all the incoming packets that trigger the generation 2854 of an R1bis message contain a locator pair (in the address fields of 2855 the IPv6 header) and a Context Tag. 2857 Upon reception of any of the packets described above, the host will 2858 reply with an R1bis including the following information: 2860 o The Responder Nonce is a number picked by the responder which the 2861 initiator will return in the I2bis message. 2863 o Packet Context Tag is the context tag contained in the received 2864 packet that triggered the generation of the R1bis message. 2866 o The Responder Validator option is included, with a validator that 2867 is computed as suggested in the next section. 2869 7.16.1 Generating the R1bis Validator 2871 One way for the responder to properly generate validators is to 2872 maintain a single secret (S) and a running counter for the Responder 2873 Nonce. 2875 In the case the validator is generated to be included in a R1bis 2876 message, for each received payload extension header or control 2877 message, the responder can increase the counter, use the counter 2878 value as the responder nonce, and use the following information as 2879 input to the one-way function: 2881 o The the secret S 2883 o That Responder Nonce 2885 o The Receiver Context tag included in the received packet 2887 o The locators from the received packet 2889 and then the output of the hash function is used as the validator 2890 octet string. 2892 7.17 Receiving R1bis messages and sending I2bis messages 2894 A host MUST silently discard any received R1bis messages that do not 2895 satisfy all of the following validity checks in addition to those 2896 specified in Section 12.2: 2898 o The Hdr Ext Len field is at least 1, i.e., the length is at least 2899 16 octets. 2901 Upon the reception of an R1bis message, the host extracts the Packet 2902 Context Tag and the Locator Pair from the message (the latter from 2903 the source and destination fields in the IPv6 header). Next the host 2904 looks for an existing context where the Packet Context Tag matches 2905 CT(peer) and where the locators match Lp(peer) and Lp(local), 2906 respectively. 2908 o If no such context is not found, i.e., the state is IDLE, then the 2909 R1bis message is silently discarded. 2911 o If the state is I1-SENT, I2-SENT, or I2BIS-SENT, then the R1bis 2912 message is silently discarded. 2914 o If the state is ESTABLISHED, then we are in the case where the 2915 peer has lost the context and the goal is to try to re-establish 2916 it. For that, the host leaves CT(peer) unchanged in the context 2917 state, transitions to I2BIS-SENT state, and sends a I2bis message, 2918 including the computed Responder Validator option, the Packet 2919 Context Tag, and the Responder Nonce received in the R1bis 2920 message. This I2bis message is sent using the locator pair 2921 included in the R1bis message. In the case that this locator pair 2922 differs from the ULID pair defined for this context, then an ULID 2923 option MUST be included in the I2bis message. In addition, if the 2924 Forked Instance Identifier for this context is non-zero, then a 2925 Forked Instance Identifier option carrying the instance identifier 2926 value for this context MUST be included in the I2bis message. 2928 7.18 Retransmitting I2bis messages 2930 If the initiator does not receive an R2 message after I2bis_TIMEOUT 2931 time after sending an I2bis message it MAY retransmit the I2bis 2932 message, using binary exponential backoff and randomized timers. The 2933 Responder Validator option might have a limited lifetime, that is, 2934 the peer might reject Responder Validator options that are older than 2935 VALIDATOR_MIN_LIFETIME to avoid replay attacks. Thus the initiator 2936 SHOULD fall back to retransmitting the I1 message when there is no R2 2937 received after retransmitting the I2bis message I2bis_RETRIES_MAX 2938 times. 2940 7.19 Receiving I2bis messages and sending R2 messages 2942 A host MUST silently discard any received I2bis messages that do not 2943 satisfy all of the following validity checks in addition to those 2944 specified in Section 12.2: 2946 o The Hdr Ext Len field is at least 3, i.e., the length is at least 2947 32 octets. 2949 Upon the reception of an I2bis message, the host extracts the ULID 2950 pair and the Forked Instance identifier from the message. If there 2951 is no ULID-pair option, then the ULID pair is taken from the source 2952 and destination fields in the IPv6 header. If there is no FII option 2953 in the message, then the FII value is taken to be zero. 2955 Next the host verifies that the Responder Nonce is a recent one, and 2956 that the Responder Validator option matches the validator the host 2957 would have computed for the ULID, locators, responder nonce, and FII 2958 as part of sending an R1bis message. 2960 If a CGA Parameter Data Structure (PDS) is included in the message, 2961 then the host MUST verify if the actual PDS contained in the message 2962 corresponds to the ULID(peer). 2964 If any of the above verifications fails, then the host silently 2965 discard the message and it has completed the I2bis processing. 2967 If both verifications are successful, then the host proceeds to look 2968 for a context state for the Initiator. The host looks for a context 2969 with the extracted ULID pair and FII. If none exist then state of 2970 the (non-existing) context is viewed as being IDLE, thus the actions 2971 depend on the state as follows: 2973 o If the state is IDLE (i.e., the context does not exist) the host 2974 allocates a context tag (CT(local)), creates the context state for 2975 the context, and sets its state to ESTABLISHED. The host SHOULD 2976 NOT use the Packet Context Tag in the I2bis message for CT(local); 2977 instead it should pick a new random context tag just as when it 2978 processes an I2 message. It records CT(peer), and the peer's 2979 locator set as well as its own locator set in the context. It 2980 SHOULD perform the HBA/CGA verification of the peer's locator set 2981 at this point in time as specified in Section 7.2. Then the host 2982 sends an R2 message back as specified in Section 7.13. 2984 o If the state is I1-SENT, then the host verifies if the source 2985 locator is included in Ls(peer) or, it is included in the Locator 2986 List contained in the the I2 message and the HBA/CGA verification 2987 for this specific locator is successful 2989 * If this is not the case, then the message is silently 2990 discarded. The the context state remains unchanged. 2992 * If this is the case, then the host updates the context 2993 information (CT(peer), Ls(peer)) with the data contained in the 2994 I2 message and the host MUST send a R2 message back as 2995 specified below. Note that before updating Ls(peer) 2996 information, the host SHOULD perform the HBA/CGA validation of 2997 the peer's locator set at this point in time as specified in 2998 Section 7.2. The host moves to ESTABLISHED state. 3000 o If the state is ESTABLISHED, I2-SENT, or I2BIS-SENT, then the host 3001 verifies if the source locator is included in Ls(peer) or, it is 3002 included in the Locator List contained in the the I2 message and 3003 the HBA/CGA verification for this specific locator is successful 3005 * If this is not the case, then the message is silently 3006 discarded. The the context state remains unchanged. 3008 * If this is the case, then the host updates the context 3009 information (CT(peer), Ls(peer)) with the data contained in the 3010 I2 message and the host MUST send a R2 message back as 3011 specified in Section 7.13. Note that before updating Ls(peer) 3012 information, the host SHOULD perform the HBA/CGA validation of 3013 the peer's locator set at this point in time as specified in 3014 Section 7.2. The context state remains unchanged. 3016 8. Handling ICMP Error Messages 3018 The routers in the path as well as the destination might generate 3019 various ICMP error messages, such as host unreachable, packet too 3020 big, and payload type unknown. It is critical that these packets 3021 make it back up to the ULPs so that they can take appropriate action. 3023 This is an implementation issue in the sense that the mechanism is 3024 completely local to the host itself. But the issue of how ICMP 3025 errors are correctly dispatched to the ULP on the host are important, 3026 hence this section specifies the issue. 3028 +--------------+ 3029 | IPv6 Header | 3030 | | 3031 +--------------+ 3032 | ICMPv6 | 3033 | Header | 3034 - - +--------------+ - - 3035 | IPv6 Header | 3036 | src, dst as | Can be dispatched 3037 IPv6 | sent by ULP | unmodified to ULP 3038 | on host | ICMP error handler 3039 Packet +--------------+ 3040 | ULP | 3041 in | Header | 3042 +--------------+ 3043 Error | | 3044 ~ Data ~ 3045 | | 3046 - - +--------------+ - - 3048 Figure 29: ICMP error handling without payload extension header 3050 When the ULP packets are sent without the payload extension header, 3051 that is, while the initial locators=ULIDs are working, this 3052 introduces no new concerns; an implementation's existing mechanism 3053 for delivering these errors to the ULP will work. See Figure 29. 3055 But when the shim on the transmitting side inserts the payload 3056 extension header and replaces the ULIDs in the IP address fields with 3057 some other locators, then an ICMP error coming back will have a 3058 "packet in error" which is not a packet that the ULP sent. Thus the 3059 implementation will have to apply the reverse mapping to the "packet 3060 in error" before passing the ICMP error up to the ULP. See 3061 Figure 30. 3063 +--------------+ 3064 | IPv6 Header | 3065 | | 3066 +--------------+ 3067 | ICMPv6 | 3068 | Header | 3069 - - +--------------+ - - 3070 | IPv6 Header | 3071 | src, dst as | Needs to be 3072 IPv6 | modified by | transformed to 3073 | shim on host | have ULIDs 3074 +--------------+ in src, dst fields, 3075 Packet | SHIM6 ext. | and SHIM6 ext. 3076 | Header | header removed 3077 in +--------------+ before it can be 3078 | Transport | dispatched to the ULP 3079 Error | Header | ICMP error handler. 3080 +--------------+ 3081 | | 3082 ~ Data ~ 3083 | | 3084 - - +--------------+ - - 3086 Figure 30: ICMP error handling with payload extension header 3088 Note that this mapping is different than when receiving packets from 3089 the peer with a payload extension headers, because in that case the 3090 packets contain CT(local). But the ICMP errors have a "packet in 3091 error" with an payload extension header containing CT(peer). This is 3092 because they were intended to be received by the peer. In any case, 3093 since the has to be 3094 unique when received by the peer, the local host should also only be 3095 able to find one context that matches this tuple. 3097 If the ICMP error is a Packet Too Big, the reported MTU must be 3098 adjusted to be 8 octets less, since the shim will add 8 octets when 3099 sending packets. 3101 After the "packet in error" has had the original ULIDs inserted, then 3102 this payload extension header can be removed. The result is a 3103 "packet in error" that is passed to the ULP which looks as if the 3104 shim did not exist. 3106 9. Teardown of the ULID-Pair Context 3108 Each host can unilaterally decide when to tear down a ULID-pair 3109 context. It is RECOMMENDED that hosts do not tear down the context 3110 when they know that there is some upper layer protocol that might use 3111 the context. For example, an implementation might know this if there 3112 is an open socket which is connected to the ULID(peer). However, 3113 there might be cases when the knowledge is not readily available to 3114 the shim layer, for instance for UDP applications which do not 3115 connect their sockets, or any application which retains some higher 3116 level state across (TCP) connections and UDP packets. 3118 Thus it is RECOMMENDED that implementations minimize premature 3119 teardown by observing the amount of traffic that is sent and received 3120 using the context, and only after it appears quiescent, tear down the 3121 state. A reasonable approach would be not to tear down a context 3122 until at least 5 minutes have passed since the last message was sent 3123 or received using the context. 3125 Since there is no explicit, coordinated removal of the context state, 3126 there are potential issues around context tag reuse. One end might 3127 remove the state, and potentially reuse that context tag for some 3128 other communication, and the peer might later try to use the old 3129 context (which it didn't remove). The protocol has mechanisms to 3130 recover from this, which work whether the state removal was total and 3131 accidental (e.g., crash and reboot of the host), or just a garbage 3132 collection of shim state that didn't seem to be used. However, the 3133 host should try to minimize the reuse of context tags by trying to 3134 randomly cycle through the 2^47 context tag values. (See Appendix E 3135 for a summary how the recovery works in the different cases.) 3137 10. Updating the Peer 3139 The Update Request and Acknowledgement are used both to update the 3140 list of locators (only possible when CGA is used to verify the 3141 locator(s)), as well as updating the preferences associated with each 3142 locator. 3144 10.1 Sending Update Request messages 3146 When a host has a change in the locator set, then it can communicate 3147 this to the peer by sending an Update Request. When a host has a 3148 change in the preferences for its locator set, it can also 3149 communicate this to the peer. The Update Request message can include 3150 just a Locator List option, to convey the new set of locators (which 3151 requires a CGA signature option as well), just a Locator Preferences 3152 option, or both a new Locator List and new Locator Preferences. 3154 Should the host send a new Locator List, the host picks a new random 3155 local generation number, records this in the context, and puts it in 3156 the Locator List option. Any Locator Preference option, whether send 3157 in the same Update Request or in some future Update Request, will use 3158 that generation number to make sure the preferences get applied to 3159 the correct version of the locator list. 3161 The host picks a random Request Nonce for each update, and keeps the 3162 same nonce for any retransmissions of the Update Request. The nonce 3163 is used to match the acknowledgement with the request. 3165 10.2 Retransmitting Update Request messages 3167 If the host does not receive an Update Acknowledgement R2 message in 3168 response to the Update Request message after UPDATE_TIMEOUT time, 3169 then it needs to retransmit the Update Request message. The 3170 retransmissions should use a retransmission timer with binary 3171 exponential backoff to avoid creating congestion issues for the 3172 network when lots of hosts perform Update Request retransmissions. 3173 Also, the actual timeout value should be randomized between 0.5 and 3174 1.5 of the nominal value to avoid self-synchronization. 3176 Should there be no response, the retransmissions continue forever. 3177 The binary exponential backoff stops at MAX_UPDATE_TIMEOUT. But the 3178 only way the retransmissions would stop when there is no 3179 acknowledgement, is when the shim, through the Probe protocol or some 3180 other mechanism, decides to discard the context state due to lack of 3181 ULP usage in combination with no responses to the Probes. 3183 10.3 Newer Information While Retransmitting 3185 There can be at most one outstanding Update Request message at any 3186 time. Thus until e.g. an update with a new Locator List has been 3187 acknowledged, any even newer Locator List or new Locator Preferences 3188 can not just be sent. However, when there is newer information and 3189 the older information has not yet been acknowledged, the host can 3190 instead of waiting for an acknowledgement, abandon the previous 3191 update and construct a new Update Request (with a new Request Nonce) 3192 which includes the new information as well as the information that 3193 hadn't yet been acknowledged. 3195 For example, if the original locator list was just (A1, A2), and if 3196 an Update Request with the Locator List (A1, A3) is outstanding, and 3197 the host determines that it should both add A4 to the locator list, 3198 and mark A1 as BROKEN, then it would need to: 3200 o Pick a new random Request Nonce for the new Update Request. 3202 o Pick a new random Generation number for the new locator list. 3204 o Form the new locator list - (A1, A3, A4) 3206 o Form a Locator Preference option which uses the new generation 3207 number and has the BROKEN flag for the first locator. 3209 o Send the Update Request and start a retransmission timer. 3211 Any Update Acknowledgement which doesn't match the current request 3212 nonce, for instance an acknowledgement for the abandoned Update 3213 Request, will be silently ignored. 3215 10.4 Receiving Update Request messages 3217 A host MUST silently discard any received Update Request messages 3218 that do not satisfy all of the following validity checks in addition 3219 to those specified in Section 12.2: 3221 o The Hdr Ext Len field is at least 1, i.e., the length is at least 3222 16 octets. 3224 Upon the reception of an Update Request message, the host extracts 3225 the Context Tag from the message. It then looks for a context which 3226 has a CT(local) that matches the context tag. If no such context is 3227 found, it sends a R1bis message as specified in Section 7.16. 3229 Since context tags can be reused, the host MUST verify that the IPv6 3230 source address field is part of Ls(peer) and that the IPv6 3231 destination address field is part of Ls(local). If this is not the 3232 case, the sender of the Update Request has a stale context which 3233 happens to match the CT(local) for this context. In this case the 3234 host MUST send a R1bis message, and otherwise ignore the Update 3235 Request message. 3237 If a CGA Parameter Data Structure (PDS) is included in the message, 3238 then the host MUST verify if the actual PDS contained in the packet 3239 corresponds to the ULID(peer). If this verification fails, the 3240 message is silently discarded. 3242 Then, depending on the state of the context: 3244 o If ESTABLISHED: Proceed to process message. 3246 o If I1-SENT, discard the message and stay in I1-SENT. 3248 o If I2-SENT, then send R2 and proceed to process the message. 3250 o If I2BIS-SENT, then send R2 and proceed to process the message. 3252 The verification issues for the locators carried in the Locator 3253 Update message are specified in Section 7.2. If the locator list can 3254 not be verified, this procedure might send an ICMP Parameter Problem 3255 error. In any case, if it can not be verified, there is no further 3256 processing of the Update Request. 3258 Once any Locator List option in the Update Request has been verified, 3259 the peer generation number in the context is updated to be the one in 3260 the Locator List option. 3262 If the Update message contains a Locator Preference option, then the 3263 Generation number in the preference option is compared with the peer 3264 generation number in the context. If they do not match, then the 3265 host generates an ICMP parameter problem (type 4, code 0) with the 3266 Pointer field referring to the first octet in the Generation number 3267 in the Locator Preference option. In addition, if the number of 3268 elements in the Locator Preference option does not match the number 3269 of locators in Ls(peer), then an ICMP parameter problem is sent with 3270 the Pointer referring to the first octet of the Length field in the 3271 Locator Preference option. In both cases of failures, no further 3272 processing is performed for the Locator Update message. 3274 If the generation number matches, the locator preferences are 3275 recorded in the context. 3277 Once the Locator List option (if present) has been verified and any 3278 new locator list or locator preferences have been recorded, the host 3279 sends an Update Acknowledgement message, copying the nonce from the 3280 request, and using the CT(peer) in as the Receiver Context Tag. 3282 Any new locators, or more likely new locator preferences, might 3283 result in the host wanting to select a different locator pair for the 3284 context. For instance, if the Locator Preferences lists the current 3285 Lp(peer) as BROKEN. The host uses the Probe message in [8] to verify 3286 that the new locator is reachable before changing Lp(peer). 3288 10.5 Receiving Update Acknowledgement messages 3290 A host MUST silently discard any received Update Acknowledgement 3291 messages that do not satisfy all of the following validity checks in 3292 addition to those specified in Section 12.2: 3294 o The Hdr Ext Len field is at least 1, i.e., the length is at least 3295 16 octets. 3297 Upon the reception of an Update Acknowledgement message, the host 3298 extracts the Context Tag and the Request Nonce from the message. It 3299 then looks for a context which has a CT(local) that matches the 3300 context tag. If no such context is found, it sends a R1bis message 3301 as specified in Section 7.16. 3303 Since context tags can be reused, the host MUST verify that the IPv6 3304 source address field is part of Ls(peer) and that the IPv6 3305 destination address field is part of Ls(local). If this is not the 3306 case, the sender of the Update Acknowledgement has a stale context 3307 which happens to match the CT(local) for this context. In this case 3308 the host MUST send a R1bis message, and otherwise ignore the Update 3309 Acknowledgement message. 3311 Then, depending on the state of the context: 3313 o If ESTABLISHED: Proceed to process message. 3315 o If I1-SENT, discard the message and stay in I1-SENT. 3317 o If I2-SENT, then send R2 and proceed to process the message. 3319 o If I2BIS-SENT, then send R2 and proceed to process the message. 3321 If the Request Nonce doesn't match the Nonce for the last sent Update 3322 Request for the context, then the Update Acknowledgement is silently 3323 ignored. If the nonce matches, then the update has been completed 3324 and the Update retransmit timer can be reset. 3326 11. Sending ULP Payloads 3328 When there is no context state for the ULID pair on the sender, there 3329 is no effect on how ULP packets are sent. If the host is using some 3330 heuristic for determining when to perform a deferred context 3331 establishment, then the host might need to do some accounting (count 3332 the number of packets sent and received) even before there is a ULID- 3333 pair context. 3335 If the context is not in ESTABLISHED or I2BIS-SENT state, then it 3336 there is also no effect on how the ULP packets are sent. Only in the 3337 ESTABLISHED and I2BIS-SENT states does the host have CT(peer) and 3338 Ls(peer) set. 3340 If there is a ULID-pair context for the ULID pair, then the sender 3341 needs to verify whether context uses the ULIDs as locators, that is, 3342 whether Lp(peer) == ULID(peer) and Lp(local) == ULID(local). 3344 If this is the case, then packets can be sent unmodified by the shim. 3345 If it is not the case, then the logic in Section 11.1 will need to be 3346 used. 3348 There will also be some maintenance activity relating to 3349 (un)reachability detection, whether packets are sent with the 3350 original locators or not. The details of this is out of scope for 3351 this document and is specified in [8]. 3353 11.1 Sending ULP Payload after a Switch 3355 When sending packets, if there is a ULID-pair context for the ULID 3356 pair, and the ULID pair is no longer used as the locator pair, then 3357 the sender needs to transform the packet. Apart from replacing the 3358 IPv6 source and destination fields with a locator pair, an 8-octet 3359 header is added so that the receiver can find the context and inverse 3360 the transformation. 3362 If there has been a failure causing a switch, and later the context 3363 switches back to sending things using the ULID pair as the locator 3364 pair, then there is no longer a need to do any packet transformation 3365 by the sender, hence there is no need to include the 8-octet 3366 extension header. 3368 First, the IP address fields are replaced. The IPv6 source address 3369 field is set to Lp(local) and the destination address field is set to 3370 Lp(peer). NOTE that this MUST NOT cause any recalculation of the ULP 3371 checksums, since the ULP checksums are carried end-to-end and the ULP 3372 pseudo-header contains the ULIDs which are preserved end-to-end. 3374 The sender skips any "routing sub-layer extension headers" that the 3375 ULP might have included, thus it skips any hop-by-hop extension 3376 header, any routing header, and any destination options header that 3377 is followed by a routing header. After any such headers the shim6 3378 extension header will be added. This might be before a Fragment 3379 header, a Destination Options header, an ESP or AH header, or a ULP 3380 header. 3382 The inserted shim6 Payload extension header includes the peer's 3383 context tag. It takes on the next header value from the preceding 3384 extension header, since that extension header will have a next header 3385 value of SHIM6. 3387 12. Receiving Packets 3389 As in normal IPv6 receive side packet processing the receiver parses 3390 the (extension) headers in order. Should it find a shim6 extension 3391 header it will look at the "P" field in that header. If this bit is 3392 zero, then the packet must be passed to the shim6 payload handling 3393 for rewriting. Otherwise, the packet is passed to the shim6 control 3394 handling. 3396 12.1 Receiving Payload Extension Headers 3398 The receiver extracts the context tag from the payload extension 3399 header, and uses this to find a ULID-pair context. If no context is 3400 found, the receiver SHOULD generate a R1bis message (see 3401 Section 7.16). 3403 Then, depending on the state of the context: 3405 o If ESTABLISHED: Proceed to process message. 3407 o If I1-SENT, discard the message and stay in I1-SENT. 3409 o If I2-SENT, then send R2 and proceed to process the message. 3411 o If I2BIS-SENT, then send R2 and proceed to process the message. 3413 With the context in hand, the receiver can now replace the IP address 3414 fields with the ULIDs kept in the context. Finally, the Payload 3415 extension header is removed from the packet (so that the ULP doesn't 3416 get confused by it), and the next header value in the preceding 3417 header is set to be the actual protocol number for the payload. Then 3418 the packet can be passed to the protocol identified by the next 3419 header value (which might be some function associated with the IP 3420 endpoint sublayer, or a ULP). 3422 If the host is using some heuristic for determining when to perform a 3423 deferred context establishment, then the host might need to do some 3424 accounting (count the number of packets sent and received) for 3425 packets that does not have a shim6 extension header and for which 3426 there is no context. But the need for this depends on what 3427 heuristics the implementation has chosen. 3429 12.2 Receiving Shim Control messages 3431 A shim control message has the checksum field verified. The Shim 3432 header length field is also verified against the length of the IPv6 3433 packet to make sure that the shim message doesn't claim to end past 3434 the end of the IPv6 packet. Finally, it checks that the neither the 3435 IPv6 destination field nor the IPv6 source field is a multicast 3436 address. If any of those checks fail, the packet is silently 3437 dropped. 3439 The message is then dispatched based on the shim message type. Each 3440 message type is then processed as described elsewhere in this 3441 document. If the packet contains a shim message type which is 3442 unknown to the receiver, then an ICMPv6 Parameter Problem error is 3443 generated and sent back. The pointer field in the Parameter Problem 3444 is set to point at the first octet of the shim message type. The 3445 error is rate limited just like other ICMP errors [5]. 3447 All the control messages can contain any options with C=0. If there 3448 is any option in the message with C=1 that isn't known to the host, 3449 then the host MUST send an ICMPv6 Parameter Problem, with the Pointer 3450 field referencing the first octet of the Option Type. 3452 12.3 Context Lookup 3454 We assume that each shim context has its own state machine. We 3455 assume that a dispatcher delivers incoming packets to the state 3456 machine that it belongs to. Here we describe the rules used for the 3457 dispatcher to deliver packets to the correct shim context state 3458 machine. 3460 There is one state machine per context identified that is 3461 conceptually identified by ULID pair and Forked Instance Identifier 3462 (which is zero by default), or identified by CT(local). However, the 3463 detailed lookup rules are more complex, especially during context 3464 establishment. 3466 Clearly, if the required context is not established, it will be in 3467 IDLE state. 3469 During context establishment, the context is identified as follows: 3471 o I1 packets: Deliver to the context associated with the ULID pair 3472 and the Forked Instance Identifier. 3474 o I2 packets: Deliver to the context associated with the ULID pair 3475 and the Forked Instance Identifier. 3477 o R1 packets: Deliver to the context with the locator pair included 3478 in the packet and the Initiator nonce included in the packet (R1 3479 does not contain ULID pair nor the CT(local)). If no context 3480 exist with this locator pair and Initiator nonce, then silently 3481 discard. 3483 o R2 packets: Deliver to the context with the locator pair included 3484 in the packet and the Initiator nonce included in the packet (R2 3485 does not contain ULID pair nor the CT(local)). If no context 3486 exists with this locator pair and INIT nonce, then silently 3487 discard. 3489 o R1bis packet: deliver to the context that has the locator pair and 3490 the CT(peer) equal to the Packet Context Tag included in the R1bis 3491 packet. 3493 o I2bis packets: Deliver to the context associated with the ULID 3494 pair and the Forked Instance Identifier. 3496 o Payload extension headers: Deliver to the context with CT(local) 3497 equal to the Receiver Context Tag included in the packet. 3499 o Other control messages (Update, Keepalive, Probe): Deliver to the 3500 context with CT(local) equal to the Receiver Context Tag included 3501 in the packet. Verify that the IPv6 source address field is part 3502 of Ls(peer) and that the IPv6 destination address field is part of 3503 Ls(local). If not, send a R1bis message. 3505 o ICMP errors which contain a shim6 payload extension header or 3506 other shim control packet in the "packet in error": Use the 3507 "packet in error" for dispatching as follows. Deliver to the 3508 context with CT(peer) equal to the Receiver Context Tag, Lp(local) 3509 being the IPv6 source address, and Lp(peer) being the IPv6 3510 destination address. 3512 In addition, the shim on the sending side needs to be able to find 3513 the context state when a ULP packet is passed down from the ULP. In 3514 that case the lookup key is the pair of ULIDs and FII=0. If we have 3515 a ULP API that allows the ULP to do context forking, then presumably 3516 the ULP would pass down the Forked Instance Identifier. 3518 13. Initial Contact 3520 The initial contact is some non-shim communication between two ULIDs, 3521 as described in Section 2. At that point in time there is no 3522 activity in the shim. 3524 Whether the shim ends up being used or not (e.g., the peer might not 3525 support shim6) it is highly desirable that the initial contact can be 3526 established even if there is a failure for one or more IP addresses. 3528 The approach taken is to rely on the applications and the transport 3529 protocols to retry with different source and destination addresses, 3530 consistent with what is already specified in Default Address 3531 Selection [12], and some fixes to that specification [13] to make it 3532 try different source addresses and not only different destination 3533 addresses. 3535 The implementation of such an approach can potentially result in long 3536 timeouts. For instance, a naive implementation at the socket API 3537 which uses getaddrinfo() to retrieve all destination addresses and 3538 then tries to bind() and connect() to try all source and destination 3539 address combinations waiting for TCP to time out for each combination 3540 before trying the next one. 3542 However, if implementations encapsulate this in some new connect-by- 3543 name() API, and use non-blocking connect calls, it is possible to 3544 cycle through the available combinations in a more rapid manner until 3545 a working source and destination pair is found. Thus the issues in 3546 this domain are issues of implementations and the current socket API, 3547 and not issues of protocol specification. In all honesty, while 3548 providing an easy to use connect-by-name() API for TCP and other 3549 connection-oriented transports is easy; providing a similar 3550 capability at the API for UDP is hard due to the protocol itself not 3551 providing any "success" feedback. But even the UDP issue is one of 3552 APIs and implementation. 3554 14. Protocol constants 3556 The protocol uses the following constants: 3558 I1_RETRIES_MAX 3560 I1_TIMEOUT = 4 seconds 3562 NO_R1_HOLDDOWN_TIME = 1 min 3564 ICMP_HOLDDOWN_TIME = 10 min 3566 I2_TIMEOUT = 4 seconds 3568 I2_RETRIES_MAX = 2 3570 I2bis_TIMEOUT = 4 seconds 3572 I2bis_RETRIES_MAX = 2 3574 VALIDATOR_MIN_LIFETIME = 30 seconds 3576 UPDATE_TIMEOUT = 4 seconds 3578 The retransmit timers (I1_TIMEOUT, I2_TIMEOUT, UPDATE_TIMEOUT) are 3579 subject to binary exponential backoff, as well as randomization 3580 across a range of 0.5 and 1.5 times the nominal (backed off) value. 3581 This removes any risk of synchronization between lots of hosts 3582 performing independent shim operations at the same time. 3584 The randomization is applied after the binary exponential backoff. 3585 Thus the first retransmission would happen based on a uniformly 3586 distributed random number in the range [0.5*4, 1.5*4] seconds, the 3587 second retransmission [0.5*8, 1.5*8] seconds after the first one, 3588 etc. 3590 15. Implications Elsewhere 3592 The general shim6 approach, as well as the specifics of this proposed 3593 solution, has implications elsewhere. The key implications are: 3595 o Applications that perform referrals, or callbacks using IP 3596 addresses as the 'identifiers' can still function in limited ways, 3597 as described in [22]. But in order for such applications to be 3598 able to take advantage of the multiple locators for redundancy, 3599 the applications need to be modified to either use fully qualified 3600 domain names as the 'identifiers', or they need to pass all the 3601 locators as the 'identifiers' i.e., the 'identifier' from the 3602 applications perspective becomes a set of IP addresses instead of 3603 a single IP address. 3605 o Firewalls that today pass limited traffic, e.g., outbound TCP 3606 connections, would presumably block the shim6 protocol. This 3607 means that even when shim6 capable hosts are communicating, the I1 3608 messages would be dropped, hence the hosts would not discover that 3609 their peer is shim6 capable. This is in fact a feature, since if 3610 the hosts managed to establish a ULID-pair context, then the 3611 firewall would probably drop the "different" packets that are sent 3612 after a failure (those using the shim6 payload extension header 3613 with a TCP packet inside it). Thus stateful firewalls that are 3614 modified to pass shim6 messages should also be modified to pass 3615 the payload extension header, so that the shim can use the 3616 alternate locators to recover from failures. This presumably 3617 implies that the firewall needs to track the set of locators in 3618 use by looking at the shim6 control exchanges. Such firewalls 3619 might even want to verify the locators using the HBA/CGA 3620 verification themselves, which they can do without modifying any 3621 of the shim6 packets they pass through. 3623 o Signaling protocols for QoS or other things that involve having 3624 devices in the network path look at IP addresses and port numbers, 3625 or IP addresses and Flow Labels, need to be invoked on the hosts 3626 when the locator pair changes due to a failure. At that point in 3627 time those protocols need to inform the devices that a new pair of 3628 IP addresses will be used for the flow. Note that this is the 3629 case even though this protocol, unlike some earlier proposals, 3630 does not overload the flow label as a context tag; the in-path 3631 devices need to know about the use of the new locators even though 3632 the flow label stays the same. 3634 o MTU implications. The path MTU mechanisms we use are robust 3635 against different packets taking different paths through the 3636 Internet, by computing a minimum over the recently observed path 3637 MTUs. When shim6 fails over from using one locator pair to 3638 another pair, this means that packets might travel over a 3639 different path through the Internet, hence the path MTU might be 3640 quite different. Perhaps such a path change would be a good hint 3641 to the path MTU mechanism to try a larger MTU? 3643 The fact that the shim will add an 8 octet payload extension 3644 header to the ULP packets after a locator switch, can also affect 3645 the usable path MTU for the ULPs. In this case the MTU change is 3646 local to the sending host, thus conveying the change to the ULPs 3647 is an implementation matter. 3649 o The precise interaction between Mobile IPv6 and shim6 is for 3650 further study, but it might make sense to have Mobile IPv6 operate 3651 on locators, meaning that the shim would be layered on top of the 3652 MIPv6 mechanism. 3654 16. Security Considerations 3656 This document satisfies the concerns specified in [19] as follows: 3658 o The HBA technique [7] for verifying the locators to prevent an 3659 attacker from redirecting the packet stream to somewhere else. 3661 o Requiring a Reachability Probe+Reply before a new locator is used 3662 as the destination, in order to prevent 3rd party flooding 3663 attacks. 3665 o The first message does not create any state on the responder. 3666 Essentially a 3-way exchange is required before the responder 3667 creates any state. This means that a state-based DoS attack 3668 (trying to use up all of memory on the responder) at least 3669 provides an IPv6 address that the attacker was using. 3671 o The context establishment messages use nonces to prevent replay 3672 attacks, and to prevent off-path attackers from interfering with 3673 the establishment. 3675 o Every control message of the shim6 protocol, past the context 3676 establishment, carry the context tag assigned to the particular 3677 context. This implies that an attacker needs to discover that 3678 context tag before being able to spoof any shim6 control message. 3679 Such discovery probably requires to be along the path in order to 3680 be sniff the context tag value. The result is that through this 3681 technique, the shim6 protocol is protected against off-path 3682 attackers. 3684 Some of the residual threats in this proposal are: 3686 o An attacker which arrives late on the path (after the context has 3687 been established) can use the R1bis message to cause one peer to 3688 recreate the context, and at that point in time the attacker can 3689 observe all of the exchange. But this doesn't seem to open any 3690 new doors for the attacker since such an attacker can observe the 3691 context tags that are being used, and once known it can use those 3692 to send bogus messages. 3694 o An attacker which is present on the path so that it can find out 3695 the context tags, can generate a R1bis message after it has moved 3696 off the path. For this packet to be effective it needs to have a 3697 source locator which belongs to the context, thus there can not be 3698 "too much" ingress filtering between the attackers new location 3699 and the communicating peers. But this doesn't seem to be that 3700 severe, because once the R1bis causes the context to be re- 3701 established, a new pair of context tags will be used, which will 3702 not be known to the attacker. If this is still a concern, we 3703 could require a 2-way handshake "did you really loose the state?" 3704 in response to the error message. 3706 o It might be possible for an attacker to try random 47-bit context 3707 tags and see if they can cause disruption for communication 3708 between two hosts. If a 47-bit tag, which is the largest that 3709 fits in an 8-octet extension header, isn't sufficient, one could 3710 use an even larger tag in the shim6 control messages, and use the 3711 low-order 47 bits in the payload extension header. 3713 o When the payload extension header is used, an attacker that can 3714 guess the 47-bit random context tag, can inject packets into the 3715 context with any source locator. Thus if there is ingress 3716 filtering between the attacker, this could potentially allow to 3717 bypass the ingress filtering. However, in addition to guessing 3718 the 47-bit context tag, the attacker also needs to find a context 3719 where, after the receiver's replacement of the locators with the 3720 ULIDs, the the ULP checksum is correct. But even this wouldn't be 3721 sufficient with ULPs like TCP, since the TCP port numbers and 3722 sequence numbers must match an existing connection. Thus, even 3723 though the issues for off-path attackers injecting packets are 3724 different than today with ingress filtering, it is still very hard 3725 for an off-path attacker to guess. If IPsec is applied then the 3726 issue goes away completely. 3728 17. IANA Considerations 3730 IANA is directed to allocate a new IP Protocol Number value for the 3731 SHIM6 Protocol. 3733 IANA is directed to record a CGA message type for the SHIM6 Protocol 3734 in the [CGA] namespace registry with the value 0x4A30 5662 4858 574B 3735 3655 416F 506A 6D48. 3737 IANA is directed to establish a SHIM6 Parameter Registry with two 3738 components: SHIM6 Type registrations and SHIM6 Options registrations. 3740 The initial contents of the SHIM6 Type registry are as follows: 3742 +------------+-----------------------------------------------------+ 3743 | Type Value | Message | 3744 +------------+-----------------------------------------------------+ 3745 | 0 | RESERVED | 3746 | | | 3747 | 1 | I1 (first establishment message from the initiator) | 3748 | | | 3749 | 2 | R1 (first establishment message from the responder) | 3750 | | | 3751 | 3 | I2 (2nd establishment message from the initiator) | 3752 | | | 3753 | 4 | R2 (2nd establishment message from the responder) | 3754 | | | 3755 | 5 | R1bis (Reply to reference to non-existent context) | 3756 | | | 3757 | 6 | I2bis (Reply to a R1bis message) | 3758 | | | 3759 | 7-59 | Can be allocated using Standards Action | 3760 | | | 3761 | 60-63 | For Experimental use | 3762 | | | 3763 | 64 | Update Request | 3764 | | | 3765 | 65 | Update Acknowledgement | 3766 | | | 3767 | 66 | Keepalive | 3768 | | | 3769 | 67 | Probe Message | 3770 | | | 3771 | 68-123 | Can be allocated using Standards Action | 3772 | | | 3773 | 124-127 | For Experimental use | 3774 +------------+-----------------------------------------------------+ 3775 The initial contents of the SHIM6 Options registry are as follows: 3777 +--------------+----------------------------------+ 3778 | Type | Option Name | 3779 +--------------+----------------------------------+ 3780 | 0 | RESERVED | 3781 | | | 3782 | 1 | Responder Validator | 3783 | | | 3784 | 2 | Locator List | 3785 | | | 3786 | 3 | Locator Preferences | 3787 | | | 3788 | 4 | CGA Parameter Data Structure | 3789 | | | 3790 | 5 | CGA Signature | 3791 | | | 3792 | 6 | ULID Pair | 3793 | | | 3794 | 7 | Forked Instance Identifier | 3795 | | | 3796 | 8-9 | Allocated using Standards action | 3797 | | | 3798 | 10 | Probe Option | 3799 | | | 3800 | 11 | Reachability Option | 3801 | | | 3802 | 12 | Payload Reception Report Option | 3803 | | | 3804 | 13-16383 | Allocated using Standards action | 3805 | | | 3806 | 16384-32767 | For Experimental use | 3807 +--------------+----------------------------------+ 3809 18. Acknowledgements 3811 Over the years many people active in the multi6 and shim6 WGs have 3812 contributed ideas a suggestions that are reflected in this 3813 specification. Special thanks to the careful comments from Geoff 3814 Houston and Shinta Sugimoto on earlier versions of this draft. 3816 Appendix A. Open Issues 3818 The following known open issues in this protocol specification are: 3820 o NONE. 3822 Appendix B. Possible Protocol Extensions 3824 During the development of this protocol, several issues have been 3825 brought up as important one to address, but are ones that do not need 3826 to be in the base protocol itself but can instead be done as 3827 extensions to the protocol. The key ones are: 3829 o As stated in the assumptions in Section 3, the in order for the 3830 shim6 protocol to be able to recover from a wide range of 3831 failures, for instance when one of the communicating hosts is 3832 singly-homed, and cope with a site's ISPs that do ingress 3833 filtering based on the source IPv6 address, there is a need for 3834 the host to be able to influence the egress selection from its 3835 site. Further discussion of this issue is captured in [20]. 3837 o Is there need for keeping the list of locators private between the 3838 two communicating endpoints? We can potentially accomplish that 3839 when using CGA but not with HBA, but it comes at the cost of doing 3840 some public key encryption and decryption operations as part of 3841 the context establishment. The suggestion is to leave this for a 3842 future extension to the protocol. 3844 o Defining some form of end-to-end "compression" mechanism that 3845 removes the need for including the Shim6 Payload extension header 3846 when the locator pair is not the ULID pair. 3848 o Supporting the dynamic setting of locator preferences on a site- 3849 wide basis, and use the Locator Preference option in the shim6 3850 protocol to convey these preferences to remote communicating 3851 hosts. This could mirror the DNS SRV record's notion of priority 3852 and weight. 3854 o Potentially recommend that more application protocols use DNS SRV 3855 records to allow a site some influence on load spreading for the 3856 initial contact (before the shim6 context establishment) as well 3857 as for traffic which does not use the shim. 3859 o Specifying APIs for the ULPs to be aware of the locators the shim 3860 is using, and be able to influence the choice of locators 3861 (controlling preferences as well as triggering a locator pair 3862 switch). This includes providing APIs the ULPs can use to fork a 3863 shim context. 3865 o Whether it is feasible to relax the suggestions for when context 3866 state is removed, so that one can end up with an asymmetric 3867 distribution of the context state and still get (most of) the shim 3868 benefits. For example, the busy server would go through the 3869 context setup but would quickly remove the context state after 3870 this (in order to save memory) but the not-so-busy client would 3871 retain the context state. The context recovery mechanism 3872 presented in Section 7.5 would then be recreate the state should 3873 the client send either a shim control message (e.g., probe message 3874 because it sees a problem), or a ULP packet in an payload 3875 extension header (because it had earlier failed over to an 3876 alternative locator pair, but had been silent for a while). This 3877 seems to provide the benefits of the shim as long as the client 3878 can detect the failure. If the client doesn't send anything, and 3879 it is the server that tries to send, then it will not be able to 3880 recover because the shim on the server has no context state, hence 3881 doesn't know any alternate locator pairs. 3883 o Study whether a host explicitly fail communication when a ULID 3884 becomes invalid (based on RFC 2462 lifetimes or DHCPv6), or should 3885 we let the communication continue using the invalidated ULID (it 3886 can certainly work since other locators will be used). 3888 o Study what it would take to make the shim6 control protocol not 3889 rely at all on a stable source locator in the packets. This can 3890 probably be accomplished by having all the shim control messages 3891 include the ULID-pair option. 3893 o If each host might have lots of locators, then the currently 3894 requirement to include essentially all of them in the I2 and R2 3895 messages might be constraining. If this is the case we can look 3896 into using the CGA Parameter Data Structure for the comparison, 3897 instead of the prefix sets, to be able to detect context 3898 confusion. This would place some constraint on a (logical) only 3899 using e.g., one CGA public key, and would require some carefully 3900 crafted rules on how two PDSs are compared for "being the same 3901 host". But if we don't expect more than a handful locators per 3902 host, then we don't need this added complexity. 3904 o ULP specified timers for the reachability detection mechanism 3905 (which can be useful particularly when there are forked contexts). 3907 o Pre-verify some "backup" locator pair, so that the failover time 3908 can be shorter. 3910 o Study how shim6 and Mobile IPv6 might interact. There existing an 3911 initial draft on this topic [21]. 3913 Appendix C. Change Log 3915 The following changes have been made since draft-ietf-shim6-proto-03: 3917 o Editorial clarifications based on comments from Geoff, Shinta, 3918 Jari. 3920 o Added "no IPv6 NATs as an explicit assumption. 3922 o Moving some things out of the Introduction and Overview sections 3923 to remove all SHOULDs and MUSTs from there. 3925 o Added requirement that any Locator Preference options which use an 3926 element length greater than 3 octets have the already defined 3927 first 3 octets of flags, priority and weight. 3929 o Fixed security hole where a single message (I1) could cause 3930 CT(peer) to be updated. Now a three-way handshake is required 3931 before CT(peer) is updated for an existing context. 3933 The following changes have been made since draft-ietf-shim6-proto-02: 3935 o Replaced the Context Error message with the R1bis message. 3937 o Removed the Packet In Error option, since it was only used in the 3938 Context Error message. 3940 o Introduced a I2bis message which is sent in response to an I1bis 3941 message, since the responders processing is quite in this case 3942 than in the regular R1 case. 3944 o Moved the packet formats for the Keepalive and Probe message types 3945 and Event option to [8]. Only the message type values and option 3946 type value are specified for those in this document. 3948 o Removed the unused message types. 3950 o Added a state machine description as an appendix. 3952 o Filled in all the TBDs - except the IANA assignment of the 3953 protocol number. 3955 o Specified how context recovery and forked contexts work together. 3956 This required the introduction of a Forked Instance option to be 3957 able to tell which of possibly forked instances is being 3958 recovered. 3960 o Renamed the "host-pair context" to be "ULID-pair context". 3962 o Picked some initial retransmit timers for I1 and I2; 4 seconds. 3964 o Added timer values as protocol constants. The retransmit timers 3965 use binary exponential backoff and randomization (between .5 and 3966 1.5 of the nominal value). 3968 o Require that the R1/R1bis verifiers be usable for some minimum 3969 time so that the initiator knows for how long time it can safely 3970 retransmit I2 before it needs to go back to sending I1 again. 3971 Picked 30 seconds. 3973 o Split the message type codes into 0-63, which will not generate 3974 R1bis messages, and 64-127 which will generate R1bis messages. 3975 This allows extensibility of the protocol with new message types 3976 while being able to control when R1bis is generated. 3978 o Expanded the context tag from 32 to 47 bits. 3980 o Specified that enough locators need to be included in I2 and R2 3981 messages. Specified that the HBA/CGA verification must be 3982 performed when the locator set is received. 3984 o Specified that ICMP parameter problem errors are sent in certain 3985 error cases, for instance when the verification method is unknown 3986 to the receiver, or there is an unknown message type or option 3987 type. 3989 o Renamed "payload message" to be "payload extension header". 3991 o Many editorial clarifications suggested by Geoff Huston. 3993 o Modified the dispatching of payload extension header to only 3994 compare CT(local) i.e., not compare the source and destination 3995 IPv6 address fields. 3997 The following changes have been made since draft-ietf-shim6-proto-00: 3999 o Removed the use of the flow label and the overloading of the IP 4000 protocol numbers. Instead, when the locator pair is not the ULID 4001 pair, the ULP payloads will be carried with an 8 octet extension 4002 header. The belief is that it is possible to remove these extra 4003 bytes by defining future shim6 extensions that exchange more 4004 information between the hosts, without having to overload the flow 4005 label or the IP protocol numbers. 4007 o Grew the context tag from 20 bits to 32 bits, with the possibility 4008 to grow it to 47 bits. This implies changes to the message 4009 formats. 4011 o Almost by accident, the new shim6 message format is very close to 4012 the HIP message format. 4014 o Adopted the HIP format for the options, since this makes it easier 4015 to describe variable length options. The original, ND-style, 4016 option format requires internal padding in the options to make 4017 them 8 octet length in total, while the HIP format handles that 4018 using the option length field. 4020 o Removed some of the control messages, and renamed the other ones. 4022 o Added a "generation" number to the Locator List option, so that 4023 the peers can ensure that the preferences refer to the right 4024 "version" of the Locator List. 4026 o In order for FBD and exploration to work when there the use of the 4027 context is forked, that is different ULP messages are sent over 4028 different locator pairs, things are a lot easier if there is only 4029 one current locator pair used for each context. Thus the forking 4030 of the context is now causing a new context to be established for 4031 the same ULID; the new context having a new context tag. The 4032 original context is referred to as the "default" context for the 4033 ULID pair. 4035 o Added more background material and textual descriptions. 4037 Appendix D. Simplified State Machine 4039 The states are defined in Section 6.2. The intent is that the 4040 stylized description below be consistent with the textual description 4041 in the specification, but should they conflict, the textual 4042 description is normative. 4044 The following table describes the possible actions in state IDLE and 4045 their respective triggers: 4047 +---------------------+---------------------------------------------+ 4048 | Trigger | Action | 4049 +---------------------+---------------------------------------------+ 4050 | Receive I1 | Send R1 and stay in IDLE | 4051 | | | 4052 | Heuristics trigger | Send I1 and move to I1-SENT | 4053 | a new context | | 4054 | establishment | | 4055 | | | 4056 | Receive I2, verify | If successful, send R2 and move to | 4057 | validator and | ESTABLISHED | 4058 | RESP nonce | | 4059 | | If fail, stay in IDLE | 4060 | | | 4061 | Receive I2bis, | If successful, send R2 and move to | 4062 | verify validator | ESTABLISHED | 4063 | and RESP nonce | | 4064 | | If fail, stay in IDLE | 4065 | | | 4066 | R1, R1bis, R2 | N/A (This context lacks the required info | 4067 | | for the dispatcher to deliver them) | 4068 | | | 4069 | Receive payload | Send R1bis and stay in IDLE | 4070 | extension header | | 4071 | or other control | | 4072 | packet | | 4073 +---------------------+---------------------------------------------+ 4074 The following table describes the possible actions in state I1-SENT 4075 and their respective triggers: 4077 +---------------------+---------------------------------------------+ 4078 | Trigger | Action | 4079 +---------------------+---------------------------------------------+ 4080 | Receive R1, verify | If successful, send I2 and move to I2-SENT | 4081 | INIT nonce | | 4082 | | If fail, discard and stay in I1-SENT | 4083 | | | 4084 | Receive I1 | Send R2 and stay in I1-SENT | 4085 | | | 4086 | Receive R2, verify | If successful, move to ESTABLISHED | 4087 | INIT nonce | | 4088 | | If fail, discard and stay in I1-SENT | 4089 | | | 4090 | Receive I2, verify | If successful, send R2 and move to | 4091 | validator and RESP | ESTABLISHED | 4092 | nonce | | 4093 | | If fail, discard and stay in I1-SENT | 4094 | | | 4095 | Receive I2bis, | If successful, send R2 and move to | 4096 | verify validator | ESTABLISHED | 4097 | and RESP nonce | | 4098 | | If fail, discard and stay in I1-SENT | 4099 | | | 4100 | Timeout, increment | If counter =< I1_RETRIES_MAX, send I1 and | 4101 | timeout counter | stay in I1-SENT | 4102 | | | 4103 | | If counter > I1_RETRIES_MAX, go to E-FAILED | 4104 | | | 4105 | Receive ICMP payload| Move to E-FAILED | 4106 | unknown error | | 4107 | | | 4108 | R1bis | N/A (Dispatcher doesn't deliver since | 4109 | | CT(peer) is not set) | 4110 | | | 4111 | Receive Payload or | Discard and stay in I1-SENT | 4112 | extension header | | 4113 | or other control | | 4114 | packet | | 4115 +---------------------+---------------------------------------------+ 4116 The following table describes the possible actions in state I2-SENT 4117 and their respective triggers: 4119 +---------------------+---------------------------------------------+ 4120 | Trigger | Action | 4121 +---------------------+---------------------------------------------+ 4122 | Receive R2, verify | If successful move to ESTABLISHED | 4123 | INIT nonce | | 4124 | | If fail, stay in I2-SENT | 4125 | | | 4126 | Receive I1 | Send R2 and stay in I2-SENT | 4127 | | | 4128 | Receive I2 | Send R2 and stay in I2-SENT | 4129 | verify validator | | 4130 | and RESP nonce | | 4131 | | | 4132 | Receive I2bis | Send R2 and stay in I2-SENT | 4133 | verify validator | | 4134 | and RESP nonce | | 4135 | | | 4136 | Receive R1 | Discard and stay in I2-SENT | 4137 | | | 4138 | Timeout, increment | If counter =< I2_RETRIES_MAX, send I2 and | 4139 | timeout counter | stay in I2-SENT | 4140 | | | 4141 | | If counter > I2_RETRIES_MAX, send I1 and go | 4142 | | to I1-SENT | 4143 | | | 4144 | R1bis | N/A (Dispatcher doesn't deliver since | 4145 | | CT(peer) is not set) | 4146 | | | 4147 | Receive payload or | Accept and send I2 (probably R2 was sent | 4148 | extension header | by peer and lost) | 4149 | other control | | 4150 | packet | | 4151 +---------------------+---------------------------------------------+ 4152 The following table describes the possible actions in state I2BIS- 4153 SENT and their respective triggers: 4155 +---------------------+---------------------------------------------+ 4156 | Trigger | Action | 4157 +---------------------+---------------------------------------------+ 4158 | Receive R2, verify | If successful move to ESTABLISHED | 4159 | INIT nonce | | 4160 | | If fail, stay in I2BIS-SENT | 4161 | | | 4162 | Receive I1 | Send R2 and stay in I2BIS-SENT | 4163 | | | 4164 | Receive I2 | Send R2 and stay in I2BIS-SENT | 4165 | verify validator | | 4166 | and RESP nonce | | 4167 | | | 4168 | Receive I2bis | Send R2 and stay in I2BIS-SENT | 4169 | verify validator | | 4170 | and RESP nonce | | 4171 | | | 4172 | Receive R1 | Discard and stay in I2BIS-SENT | 4173 | | | 4174 | Timeout, increment | If counter =< I2_RETRIES_MAX, send I2bis | 4175 | timeout counter | and stay in I2BIS-SENT | 4176 | | | 4177 | | If counter > I2_RETRIES_MAX, send I1 and | 4178 | | go to I1-SENT | 4179 | | | 4180 | R1bis | N/A (Dispatcher doesn't deliver since | 4181 | | CT(peer) is not set) | 4182 | | | 4183 | Receive payload or | Accept and send I2bis (probably R2 was | 4184 | extension header | sent by peer and lost) | 4185 | other control | | 4186 | packet | | 4187 +---------------------+---------------------------------------------+ 4188 The following table describes the possible actions in state 4189 ESTABLISHED and their respective triggers: 4191 +---------------------+---------------------------------------------+ 4192 | Trigger | Action | 4193 +---------------------+---------------------------------------------+ 4194 | Receive I1, compare | If no match, send R1 and stay in ESTABLISHED| 4195 | CT(peer) with | | 4196 | received CT | If match, send R2 and stay in ESTABLISHED | 4197 | | | 4198 | | | 4199 | Receive I2, verify | If successful, then send R2 and stay in | 4200 | validator and RESP | ESTABLISHED | 4201 | nonce | | 4202 | | Otherwise, discard and stay in ESTABLISHED | 4203 | | | 4204 | Receive I2bis, | If successful, then send R2 and stay in | 4205 | verify validator | ESTABLISHED | 4206 | and RESP nonce | | 4207 | | Otherwise, discard and stay in ESTABLISHED | 4208 | | | 4209 | Receive R2 | Discard and stay in ESTABLISHED | 4210 | | | 4211 | Receive R1 | Discard and stay in ESTABLISHED | 4212 | | | 4213 | Receive R1bis | Send I2bis and move to I2BIS-SENT | 4214 | | | 4215 | | | 4216 | Receive payload or | Process and stay in ESTABLISHED | 4217 | extension header | | 4218 | other control | | 4219 | packet | | 4220 | | | 4221 | Implementation | Discard state and go to IDLE | 4222 | specific heuristic | | 4223 | (E.g., No open ULP | | 4224 | sockets and idle | | 4225 | for some time ) | | 4226 +---------------------+---------------------------------------------+ 4227 The following table describes the possible actions in state E-FAILED 4228 and their respective triggers: 4230 +---------------------+---------------------------------------------+ 4231 | Trigger | Action | 4232 +---------------------+---------------------------------------------+ 4233 | Wait for | Go to IDLE | 4234 | NO_R1_HOLDDOWN_TIME | | 4235 | | | 4236 | Any packet | Process as in IDLE | 4237 +---------------------+---------------------------------------------+ 4239 The following table describes the possible actions in state NO- 4240 SUPPORT and their respective triggers: 4242 +---------------------+---------------------------------------------+ 4243 | Trigger | Action | 4244 +---------------------+---------------------------------------------+ 4245 | Wait for | Go to IDLE | 4246 | ICMP_HOLDDOWN_TIME | | 4247 | | | 4248 | Any packet | Process as in IDLE | 4249 +---------------------+---------------------------------------------+ 4251 Appendix D.1 Simplified State Machine diagram 4253 For the time being, a pdf version of the state machine diagram can be 4254 found at: http://www.it.uc3m.es/marcelo/state_machine.pdf 4256 Appendix E. Context Tag Reuse 4258 The shim6 protocol doesn't have a mechanism for coordinated state 4259 removal between the peers, because such state removal doesn't seem to 4260 help given that a host can crash and reboot at any time. A result of 4261 this is that the protocol needs to be robust against a context tag 4262 being reused for some other context. This section summarizes the 4263 different cases in which a tag can be reused, and how the recovery 4264 works. 4266 The different cases are exemplified by the following case. Assume 4267 host A and B were communicating using a context with the ULID pair 4268 , and that B had assigned context tag X to this context. We 4269 assume that B uses only the context tag to demultiplex the received 4270 payload extension headers, since this is the more general case. 4271 Further we assume that B removes this context state, while A retains 4272 it. B might then at a later time assign CT(local)=X to some other 4273 context, and we have several cases: 4275 o The context tag is reassigned to a context for the same ULID pair 4276 . We've called this "Context Recovery" in this document. 4278 o The context tag is reassigned to a context for a different ULID 4279 pair between the same to hosts, e.g., . We've called this 4280 "Context Confusion" in this document. 4282 o The context tag is reassigned to a context between B and other 4283 host C, for instance for the ULID pair . That is a form 4284 of three party context confusion. 4286 Appendix E.1 Context Recovery 4288 This case is relatively simple, and is discussed in Section 7.5. The 4289 observation is that since the ULID pair is the same, when either A or 4290 B tries to establish the new context, A can keep the old context 4291 while B re-creates the context with the same context tag CT(B) = X. 4293 Appendix E.2 Context Confusion 4295 This cases is a bit more complex, and is discussed in Section 7.6. 4296 When the new context is created, whether A or B initiates it, host A 4297 can detect when it receives B's locator set (in the I2, or R2 4298 message), that it ends up with two contexts to the same peer host 4299 (overlapping Ls(peer) locator sets) that have the same context tag 4300 CT(peer) = X. At this point in time host A can clear up any 4301 possibility of causing confusion by not using the old context to send 4302 any more packets. It either just discards the old context (it might 4303 not be used by any ULP traffic, since B had discarded it), or it 4304 recreates a different context for the old ULID pair (), for 4305 which B will assign a unique CT(B) as part of the normal context 4306 establishment mechanism. 4308 Appendix E.3 Three Party Context Confusion 4310 The third case does not have a place where the old state on A can be 4311 verified, since the new context is established between B and C. Thus 4312 when B receives payload extension headers with X as the context tag, 4313 it will find the context for , hence rewrite the packets to 4314 have C3 in the source address field and B2 in the destination address 4315 field before passing them up to the ULP. This rewriting is correct 4316 when the packets are in fact sent by host C, but if host A ever 4317 happens to send a packet using the old context, then the ULP on A 4318 sends a packet with ULIDs and the packet arrives at the ULP 4319 on B with ULIDs . 4321 This is clearly an error, and the packet will most likely be rejected 4322 by the ULP on B due to a bad pseudo-header checksum. Even if the 4323 checksum is ok (probability 2^-16), the ULP isn't likely to have a 4324 connection for those ULIDs and port numbers. And if the ULP is 4325 connection-less, processing the packet is most likely harmless; such 4326 a ULP must be able to copy with random packets being sent by random 4327 peers in any case. 4329 This broken state, where packets sent from A to B using the old 4330 context on host A might persist for some time, but it will not remain 4331 for very long. The unreachability detection on host A will kick in, 4332 because it does not see any return traffic (payload or Keepalive 4333 messages) for the context. This will result in host A sending Probe 4334 messages to host B to find a working locator pair. The effect of 4335 this is that host B will notice that it does not have a context for 4336 the ULID pair and CT(B) = X, which will make host B send an 4337 R1bis packet to re-establish that context. The re-established 4338 context, just like in the previous section, will get a unique CT(B) 4339 assigned by host B, thus there will no longer be any confusion. 4341 In summary, there are cases where a context tag might be reused while 4342 some peer retains the state, but the protocol can recover from it. 4343 The probability of these events is low given the 47 bit context tag 4344 size. However, it is important that these recovery mechanisms be 4345 tested. Thus during development and testing it is recommended that 4346 implementations not use the full 47 bit space, but instead keep e.g. 4347 the top 40 bits as zero, only leaving the host with 128 unique 4348 context tags. This will help test the recovery mechanisms. 4350 Appendix F. Design Alternatives 4352 This document has picked a certain set of design choices in order to 4353 try to work out a bunch of the details, and stimulate discussion. 4354 But as has been discussed on the mailing list, there are other 4355 choices that make sense. This appendix tries to enumerate some 4356 alternatives. 4358 Appendix F.1 Context granularity 4360 Over the years various suggestions have been made whether the shim 4361 should, even if it operates at the IP layer, be aware of ULP 4362 connections and sessions, and as a result be able to make separate 4363 shim contexts for separate ULP connections and sessions. A few 4364 different options have been discussed: 4366 o Each ULP connection maps to its own shim context. 4368 o The shim is unaware of the ULP notion of connections and just 4369 operates on a host-to-host (IP address) granularity. 4371 o Hybrids where the shim is aware of some ULPs (such as TCP) and 4372 handles other ULPs on a host-to-host basis. 4374 Having shim state for every ULP connection potentially means higher 4375 overhead since the state setup overhead might become significant; 4376 there is utility in being able to amortize this over multiple 4377 connections. 4379 But being completely unaware of the ULP connections might hamper ULPs 4380 that want different communication to use different locator pairs, for 4381 instance for quality or cost reasons. 4383 The protocol has a shim which operates with host-level granularity 4384 (strictly speaking, with ULID-pair granularity, to be able to 4385 amortize the context establishment over multiple ULP connections. 4386 This is combined with the ability for shim-aware ULPs to request 4387 context forking so that different ULP traffic can use different 4388 locator pairs. 4390 Appendix F.2 Demultiplexing of data packets in shim6 communications 4392 Once a ULID-pair context is established between two hosts, packets 4393 may carry locators that differ from the ULIDs presented to the ULPs 4394 using the established context. One of main functions of the SHIM6 4395 layer is to perform the mapping between the locators used to forward 4396 packets through the network and the ULIDs presented to the ULP. In 4397 order to perform that translation for incoming packets, the SHIM6 4398 layer needs to first identify which of the incoming packets need to 4399 be translated and then perform the mapping between locators and ULIDs 4400 using the associated context. Such operation is called 4401 demultiplexing. It should be noted that because any address can be 4402 used both as a locator and as a ULID, additional information other 4403 than the addresses carried in packets, need to be taken into account 4404 for this operation. 4406 For example, if a host has address A1 and A2 and starts communicating 4407 with a peer with addresses B1 and B2, then some communication 4408 (connections) might use the pair as ULID and others might 4409 use e.g., . Initially there are no failures so these address 4410 pairs are used as locators i.e. in the IP address fields in the 4411 packets on the wire. But when there is a failure the shim6 layer on 4412 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 4414 IP address field for some packets and not others, but the packets all 4415 have the same locator pair. 4417 In order to accomplish the demultiplexing operation successfully, 4418 data packets carry a context tag that allows the receiver of the 4419 packet to determine the shim context to be used to perform the 4420 operation. 4422 Two mechanisms for carrying the context tag information have been 4423 considered in depth during the shim protocol design. Those carrying 4424 the context tag in the flow label field of the IPv6 header and the 4425 usage of a new extension header to carry the context tag. In this 4426 appendix we will describe the pros and cons of each approach and 4427 justify the selected option. 4429 Appendix F.2.1 Flow-label 4431 A possible approach is to carry the context tag in the Flow Label 4432 field of the IPv6 header. This means that when a shim6 context is 4433 established, a Flow Label value is associated with this context (and 4434 perhaps a separate flow label for each direction). 4436 The simplest approach that does this is to have the triple identify the context at 4438 the receiver. 4440 The problem with this approach is that because the locator sets are 4441 dynamic, it is not possible at any given moment to be sure that two 4442 contexts for which the same context tag is allocated will have 4443 disjoint locator sets during the lifetime of the contexts. 4445 Suppose that Node A has addresses IPA1, IPA2, IPA3 and IPA4 and that 4446 Host B has addresses IPB1 and IPB2. 4448 Suppose that two different contexts are established between HostA and 4449 HostB. 4451 Context #1 is using IPA1 and IPB1 as ULIDs. The locator set 4452 associated to IPA1 is IPA1 and IPA2 while the locator set associated 4453 to IPB1 is just IPB1. 4455 Context #2 uses IPA3 and IPB2 as ULIDs. The locator set associated 4456 to IPA3 is IPA3 and IPA4 and the locator set associated to IPB2 is 4457 just IPB2. 4459 Because the locator sets of the Context #1 and Context #2 are 4460 disjoint, hosts could think that the same context tag value can be 4461 assigned to both of them. The problem arrives when later on IPA3 is 4462 added as a valid locator for IPA1 and IPB2 is added as a valid 4463 locator for IPB1 in Context #1. In this case, the triple would not identify a 4465 unique context anymore and correct demultiplexing is no longer 4466 possible. 4468 A possible approach to overcome this limitation is simply not to 4469 repeat the Flow Label values for any communication established in a 4470 host. This basically means that each time a new communication that 4471 is using different ULIDs is established, a new Flow Label value is 4472 assigned to it. By this mean, each communication that is using 4473 different ULIDs can be differentiated because it has a different Flow 4474 Label value. 4476 The problem with such approach is that it requires that the receiver 4477 of the communication allocates the Flow Label value used for incoming 4478 packets, in order to assign them uniquely. For this, a shim 4479 negotiation of the Flow Label value to use in the communication is 4480 needed before exchanging data packets. This poses problems with non- 4481 shim capable hosts, since they would not be able to negotiate an 4482 acceptable value for the Flow Label. This limitation can be lifted 4483 by marking the packets that belong to shim sessions from those that 4484 do not. These marking would require at least a bit in the IPv6 4485 header that is not currently available, so more creative options 4486 would be required, for instance using new Next Header values to 4487 indicate that the packet belongs to a shim6 enabled communication and 4488 that the Flow Label carries context information as proposed in the 4489 now expired NOID draft. . However, even if this is done, this 4490 approach is incompatible with the deferred establishment capability 4491 of the shim protocol, which is a preferred function, since it 4492 suppresses the delay due to the shim context establishment prior to 4493 initiation of the communication and it also allows nodes to define at 4494 which stage of the communication they decide, based on their own 4495 policies, that a given communication requires to be protected by the 4496 shim. 4498 In order to cope with the identified limitations, an alternative 4499 approach that does not constraints the flow label values used by 4500 communications that are using ULIDs equal to the locators (i.e. no 4501 shim translation) is to only require that different flow label values 4502 are assigned to different shim contexts. In such approach 4503 communications start with unmodified flow label usage (could be zero, 4504 or as suggested in [16]). The packets sent after a failure when a 4505 different locator pair is used would use a completely different flow 4506 label, and this flow label could be allocated by the receiver as part 4507 of the shim context establishment. Since it is allocated during the 4508 context establishment, the receiver of the "failed over" packets can 4509 pick a flow label of its choosing (that is unique in the sense that 4510 no other context is using it as a context tag), without any 4511 performance impact, and respecting that for each locator pair, the 4512 flow label value used for a given locator pair doesn't change due to 4513 the operation of the multihoming shim. 4515 In this approach, the constraint is that Flow Label values being used 4516 as context identifiers cannot be used by other communications that 4517 use non-disjoint locator sets. This means that once that a given 4518 Flow Label value has been assigned to a shim context that has a 4519 certain locator sets associated, the same value cannot be used for 4520 other communications that use an address pair that is contained in 4521 the locator sets of the context. This is a constraint in the 4522 potential Flow Label allocation strategies. 4524 A possible workaround to this constraint is to mark shim packets that 4525 require translation, in order to differentiate them from regular IPv6 4526 packets, using the artificial Next Header values described above. In 4527 this case, the Flow Label values constrained are only those of the 4528 packets that are being translated by the shim. This last approach 4529 would be the preferred approach if the context tag is to be carried 4530 in the Flow Label field. This is not only because it imposes the 4531 minimum constraints to the Flow Label allocation strategies, limiting 4532 the restrictions only to those packets that need to be translated by 4533 the shim, but also because Context Loss detection mechanisms greatly 4534 benefit from the fact that shim data packets are identified as such, 4535 allowing the receiving end to identify if a shim context associated 4536 to a received packet is suppose to exist, as it will be discussed in 4537 the Context Loss detection appendix below. 4539 Appendix F.2.2 Extension Header 4541 Another approach, which is the one selected for this protocol, is to 4542 carry the context tag in a new Extension Header. These context tags 4543 are allocated by the receiving end during the shim6 protocol initial 4544 negotiation, implying that each context will have two context tags, 4545 one for each direction. Data packets will be demultiplexed using the 4546 context tag carried in the Extension Header. This seems a clean 4547 approach since it does not overload existing fields. However, it 4548 introduces additional overhead in the packet due to the additional 4549 header. The additional overhead introduced is 8 octets. However, it 4550 should be noted that the context tag is only required when a locator 4551 other than the one used as ULID is contained in the packet. Packets 4552 where both the source and destination address fields contain the 4553 ULIDs do not require a context tag, since no rewriting is necessary 4554 at the receiver. This approach would reduce the overhead, because 4555 the additional header is only required after a failure. On the other 4556 hand, this approach would cause changes in the available MTU for some 4557 packets, since packets that include the Extension Header will have an 4558 MTU 8 octets shorter. However, path changes through the network can 4559 result in different MTU in any case, thus having a locator change, 4560 which implies a path change, affect the MTU doesn't introduce any new 4561 issues. 4563 Appendix F.3 Context Loss Detection 4565 In this appendix we will present different approaches considered to 4566 detect context loss and potential context recovery strategies. The 4567 scenario being considered is the following: Node A and Node B are 4568 communicating using IPA1 and IPB1. Sometime later, a shim context is 4569 established between them, with IPA1 and IPB1 as ULIDs and 4570 IPA1,...,IPAn and IPB1,...,IPBm as locator set respectively. 4572 It may happen, that later on, one of the hosts, e.g. Host A looses 4573 the shim context. The reason for this can be that Host A has a more 4574 aggressive garbage collection policy than HostB or that an error 4575 occurred in the shim layer at host A resulting in the loss of the 4576 context state. 4578 The mechanisms considered in this appendix are aimed to deal with 4579 this problem. There are essentially two tasks that need to be 4580 performed in order to cope with this problem: first, the context loss 4581 must be detected and second the context needs to be recovered/ 4582 reestablished. 4584 Mechanisms for detecting context. loss 4586 These mechanisms basically consist in that each end of the context 4587 periodically sends a packet containing context-specific information 4588 to the other end. Upon reception of such packets, the receiver 4589 verifies that the required context exists. In case that the context 4590 does not exist, it sends a packet notifying the problem to the 4591 sender. 4593 An obvious alternative for this would be to create a specific context 4594 keepalive exchange, which consists in periodically sending packets 4595 with this purpose. This option was considered and discarded because 4596 it seemed an overkill to define a new packet exchange to deal with 4597 this issue. 4599 An alternative is to piggyback the context loss detection function in 4600 other existent packet exchanges. In particular, both shim control 4601 and data packets can be used for this. 4603 Shim control packets can be trivially used for this, because they 4604 carry context specific information, so that when a node receives one 4605 of such packets, it will verify if the context exists. However, shim 4606 control frequency may not be adequate for context loss detection 4607 since control packet exchanges can be very limited for a session in 4608 certain scenarios. 4610 Data packets, on the other hand, are expected to be exchanged with a 4611 higher frequency but they do not necessarily carry context specific 4612 information. In particular, packets flowing before a locator change 4613 (i.e. packet carrying the ULIDs in the address fields) do not need 4614 context information since they do not need any shim processing. 4615 Packets that carry locators that differ from the ULIDs carry context 4616 information. 4618 However, we need to make a distinction here between the different 4619 approaches considered to carry the context tag, in particular between 4620 those approaches where packets are explicitly marked as shim packets 4621 and those approaches where packets are not marked as such. For 4622 instance, in the case where the context tag is carried in the Flow 4623 Label and packets are not marked as shim packets (i.e. no new Next 4624 Header values are defined for shim), a receiver that has lost the 4625 associated context is not able to detect that the packet is 4626 associated with a missing context. The result is that the packet 4627 will be passed unchanged to the upper layer protocol, which in turn 4628 will probably silently discard it due to a checksum error. The 4629 resulting behavior is that the context loss is undetected. This is 4630 one additional reason to discard an approach that carries the context 4631 tag in the Flow Label field and does not explicitly mark the shim 4632 packets as such. On the other hand, approaches that mark shim data 4633 packets (like the Extension Header or the Flow Label with new Next 4634 Header values approaches) allow the receiver to detect if the context 4635 associated to the received packet is missing. In this case, data 4636 packets also perform the function of a context loss detection 4637 exchange. However, it must be noted that only those packets that 4638 carry a locator that differs form the ULID are marked. This 4639 basically means that context loss will be detected after an outage 4640 has occurred i.e. alternative locators are being used. 4642 Summarizing, the proposed context loss detection mechanisms uses shim 4643 control packets and payload extension headers to detect context loss. 4644 Shim control packets detect context loss during the whole lifetime of 4645 the context, but the expected frequency in some cases is very low. 4646 On the other hand, payload extension headers have a higher expected 4647 frequency in general, but they only detect context loss after an 4648 outage. This behavior implies that it will be common that context 4649 loss is detected after a failure i.e. once that it is actually 4650 needed. Because of that, a mechanism for recovering from context 4651 loss is required if this approach is used. 4653 Overall, the mechanism for detecting lost context would work as 4654 follows: the end that still has the context available sends a message 4655 referring to the context. Upon the reception of such message, the 4656 end that has lost the context identifies the situation and notifies 4657 the context loss event to the other end by sending a packet 4658 containing the lost context information extracted from the received 4659 packet. 4661 One option is to simply send an error message containing the received 4662 packets (or at least as much of the received packet that the MTU 4663 allows to fit in). One of the goals of this notification is to allow 4664 the other end that still retains context state, to reestablish the 4665 lost context. The mechanism to reestablish the loss context consists 4666 in performing the 4-way initial handshake. This is a time consuming 4667 exchange and at this point time may be critical since we are 4668 reestablishing a context that is currently needed (because context 4669 loss detection may occur after a failure). So, another option, which 4670 is the one used in this protocol, is to replace the error message by 4671 a modified R1 message, so that the time required to perform the 4672 context establishment exchange can be reduced. Upon the reception of 4673 this modified R1 message, the end that still has the context state 4674 can finish the context establishment exchange and restore the lost 4675 context. 4677 Appendix F.4 Securing locator sets 4679 The adoption of a protocol like SHIM that allows the binding of a 4680 given ULID with a set of locators opens the doors for different types 4681 of redirection attacks as described in [19]. The goal in terms of 4682 security for the design of the shim protocol is not to introduce any 4683 new vulnerability in the Internet architecture. It is a non-goal to 4684 provide additional protection than the currently available in the 4685 single-homed IPv6 Internet. 4687 Multiple security mechanisms were considered to protect the shim 4688 protocol. In this appendix we will present some of them. 4690 The simplest option to protect the shim protocol was to use cookies 4691 i.e. a randomly generated bit string that is negotiated during the 4692 context establishment phase and then it is included in following 4693 signaling messages. By this mean, it would be possible to verify 4694 that the party that was involved in the initial handshake is the same 4695 party that is introducing new locators. Moreover, before using a new 4696 locator, an exchange is performed through the new locator, verifying 4697 that the party located at the new locator knows the cookie i.e. that 4698 it is the same party that performed the initial handshake. 4700 While this security mechanisms does indeed provide a fair amount of 4701 protection, it does leave the door open for the so-called time 4702 shifted attacks. In these attacks, an attacker that once was on the 4703 path, it discovers the cookie by sniffing any signaling message. 4704 After that, the attacker can leave the path and still perform a 4705 redirection attack, since as he is in possession of the cookie, he 4706 can introduce a new locator in the locator set and he can also 4707 successfully perform the reachability exchange if he is able to 4708 receive packets at the new locator. The difference with the current 4709 single-homed IPv6 situation is that in the current situation the 4710 attacker needs to be on-path during the whole lifetime of the attack, 4711 while in this new situation where only cookie protection if provided, 4712 an attacker that once was on the path can perform attacks after he 4713 has left the on-path location. 4715 Moreover, because the cookie is included in signaling messages, the 4716 attacker can discover the cookie by sniffing any of them, making the 4717 protocol vulnerable during the whole lifetime of the shim context. A 4718 possible approach to increase the security was to use a shared secret 4719 i.e. a bit string that is negotiated during the initial handshake but 4720 that is used as a key to protect following messages. With this 4721 technique, the attacker must be present on the path sniffing packets 4722 during the initial handshake, since it is the only moment where the 4723 shared secret is exchanged. While this improves the security, it is 4724 still vulnerable to time shifted attacks, even though it imposes that 4725 the attacker must be on path at a very specific moment (the 4726 establishment phase) to actually be able to launch the attack. While 4727 this seems to substantially improve the situation, it should be noted 4728 that, depending on protocol details, an attacker may be able to force 4729 the recreation of the initial handshake (for instance by blocking 4730 messages and making the parties think that the context has been 4731 lost), so the resulting situation may not differ that much from the 4732 cookie based approach. 4734 Another option that was discussed during the design of the protocol 4735 was the possibility of using IPsec for protecting the shim protocol. 4736 Now, the problem under consideration in this scenario is how to 4737 securely bind an address that is being used as ULID with a locator 4738 set that can be used to exchange packets. The mechanism provided by 4739 IPsec to securely bind the address used with the cryptographic keys 4740 is the usage of digital certificates. This implies that an IPsec 4741 based solution would require that the generation of digital 4742 certificates that bind the key and the ULID by a common third trusted 4743 party for both parties involved in the communication. Considering 4744 that the scope of application of the shim protocol is global, this 4745 would imply a global public key infrastructure. The major issues 4746 with this approach are the deployment difficulties associated with a 4747 global PKI. 4749 Finally two different technologies were selected to protect the shim 4750 protocol: HBA [7] and CGA [6]. These two approaches provide a 4751 similar level of protection but they provide different functionality 4752 with a different computational cost. 4754 The HBA mechanism relies on the capability of generating all the 4755 addresses of a multihomed host as an unalterable set of intrinsically 4756 bound IPv6 addresses, known as an HBA set. In this approach, 4757 addresses incorporate a cryptographic one-way hash of the prefix-set 4758 available into the interface identifier part. The result is that the 4759 binding between all the available addresses is encoded within the 4760 addresses themselves, providing hijacking protection. Any peer using 4761 the shim protocol node can efficiently verify that the alternative 4762 addresses proposed for continuing the communication are bound to the 4763 initial address through a simple hash calculation. A limitation of 4764 the HBA technique is that once generated the address set is fixed and 4765 cannot be changed without also changing all the addresses of the HBA 4766 set. In other words, the HBA technique does not support dynamic 4767 addition of address to a previously generated HBA set. An advantage 4768 of this approach is that it requires only hash operations to verify a 4769 locator set, imposing very low computational cost to the protocol. 4771 In a CGA based approach the address used as ULID is a CGA that 4772 contains a hash of a public key in its interface identifier. The 4773 result is a secure binding between the ULID and the associated key 4774 pair. This allows each peer to use the corresponding private key to 4775 sign the shim messages that convey locator set information. The 4776 trust chain in this case is the following: the ULID used for the 4777 communication is securely bound to the key pair because it contains 4778 the hash of the public key, and the locator set is bound to the 4779 public key through the signature. The CGA approach then supports 4780 dynamic addition of new locators in the locator set, since in order 4781 to do that, the node only needs to sign the new locator with the 4782 private key associated with the CGA used as ULID. A limitation of 4783 this approach is that it imposes systematic usage of public key 4784 cryptography with its associate computational cost. 4786 Any of these two mechanisms HBA and CGA provide time-shifted attack 4787 protection, since the ULID is securely bound to a locator set that 4788 can only be defined by the owner of the ULID. 4790 So, the design decision adopted was that both mechanisms HBA and CGA 4791 are supported, so that when only stable address sets are required, 4792 the nodes can benefit from the low computational cost offered by HBA 4793 while when dynamic locator sets are required, this can be achieved 4794 through CGAs with an additional cost. Moreover, because HBAs are 4795 defined as a CGA extension, the addresses available in a node can 4796 simultaneously be CGAs and HBAs, allowing the usage of the HBA and 4797 CGA functionality when needed without requiring a change in the 4798 addresses used. 4800 Appendix F.5 ULID-pair context establishment exchange 4802 Two options were considered for the ULID-pair context establishment 4803 exchange: a 2-way handshake and a 4-way handshake. 4805 A key goal for the design of this exchange was that protection 4806 against DoS attacks. The attack under consideration was basically a 4807 situation where an attacker launches a great amount of ULID-pair 4808 establishment request packets, exhausting victim's resources, similar 4809 to TCP SYN flooding attacks. 4811 A 4 way-handshake exchange protects against these attacks because the 4812 receiver does not creates any state associate to a given context 4813 until the reception of the second packet which contains a prior 4814 contact proof in the form of a token. At this point the receiver can 4815 verify that at least the address used by the initiator is at some 4816 extent valid, since the initiator is able to receive packets at this 4817 address. In the worse case, the responder can track down the 4818 attacker using this address. The drawback of this approach is that 4819 it imposes a 4 packet exchange for any context establishment. This 4820 would be a great deal if the shim context needed to be established up 4821 front, before the communication can proceed. However, thanks to 4822 deferred context establishment capability of the shim protocol, this 4823 limitation has a reduced impact in the performance of the protocol. 4824 (It may however have a greater impact in the situation of context 4825 recover as discussed earlier, but in this case, it is possible to 4826 perform optimizations to reduce the number of packets as described 4827 above) 4829 The other option considered was a 2-way handshake with the 4830 possibility to fall back to a 4-way handshake in case of attack. In 4831 this approach, the ULID-pair establishment exchange normally consists 4832 in a 2-packet exchange and it does not verify that the initiator has 4833 performed a prior contact before creating context state. In case 4834 that a DoS attack is detected, the responder falls back to a 4-way 4835 handshake similar to the one described previously in order to prevent 4836 the detected attack to proceed. The main difficulty with this attack 4837 is how to detect that a responder is currently under attack. It 4838 should be noted, that because this is 2-way exchange, it is not 4839 possible to use the number of half open sessions (as in TCP) to 4840 detect an ongoing attack and different heuristics need to be 4841 considered. 4843 The design decision taken was that considering the current impact of 4844 DoS attacks and the low impact of the 4-way exchange in the shim 4845 protocol thanks to the deferred context establishment capability, a 4846 4-way exchange would be adopted for the base protocol. 4848 Appendix F.6 Updating locator sets 4850 There are two possible approaches to the addition and removal of 4851 locators: atomic and differential approaches. The atomic approach 4852 essentially send the complete locators set each time that a variation 4853 in the locator set occurs. The differential approach send the 4854 differences between the existing locator set and the new one. The 4855 atomic approach imposes additional overhead, since all the locator 4856 set has to be exchanged each time while the differential approach 4857 requires re-synchronization of both ends through changes i.e. that 4858 both ends have the same idea about what the current locator set is. 4860 Because of the difficulties imposed by the synchronization 4861 requirement, the atomic approach was selected. 4863 Appendix F.7 State Cleanup 4865 There are essentially two approaches for discarding an existing state 4866 about locators, keys and identifiers of a correspondent node: a 4867 coordinated approach and an unilateral approach. 4869 In the unilateral approach, each node discards the information about 4870 the other node without coordination with the other node based on some 4871 local timers and heuristics. No packet exchange is required for 4872 this. In this case, it would be possible that one of the nodes has 4873 discarded the state while the other node still hasn't. In this case, 4874 a No-Context error message may be required to inform about the 4875 situation and possibly a recovery mechanism is also needed. 4877 A coordinated approach would use an explicit CLOSE mechanism, akin to 4878 the one specified in HIP [25]. If an explicit CLOSE handshake and 4879 associated timer is used, then there would no longer be a need for 4880 the No Context Error message due to a peer having garbage collected 4881 its end of the context. However, there is still potentially a need 4882 to have a No Context Error message in the case of a complete state 4883 loss of the peer (also known as a crash followed by a reboot). Only 4884 if we assume that the reboot takes at least the CLOSE timer, or that 4885 it is ok to not provide complete service until CLOSE timer minutes 4886 after the crash, can we completely do away with the No Context Error 4887 message. 4889 In addition, other aspect that is relevant for this design choice is 4890 the context confusion issue. In particular, using an unilateral 4891 approach to discard context state clearly opens the possibility of 4892 context confusion, where one of the ends unilaterally discards the 4893 context state, while the peer does not. In this case, the end that 4894 has discarded the state can re-use the context tag value used for the 4895 discarded state for a another context, creating a potential context 4896 confusion situation. In order to illustrate the cases where problems 4897 would arise consider the following scenario: 4899 o Hosts A and B establish context 1 using CTA and CTB as context 4900 tags. 4902 o Later on, A discards context 1 and the context tag value CTA 4903 becomes available for reuse. 4905 o However, B still keeps context 1. 4907 This would become a context confusion situation in the following two 4908 cases: 4910 o A new context 2 is established between A and B with a different 4911 ULID pair (or Forked Instance Identifier), and A uses CTA as 4912 context tag, If the locator sets used for both contexts are not 4913 disjoint, we are in a context confusion situation. 4915 o A new context is established between A and C and A uses CTA as 4916 context tag value for this new context. Later on, B sends Payload 4917 extension header and/or control messages containing CTA, which 4918 could be interpreted by A as belonging to context 2 (if no proper 4919 care is taken). Again we are in a context confusion situation. 4921 One could think that using a coordinated approach would eliminate 4922 these context confusion situations, making the protocol much simpler. 4923 However, this is not the case, because even in the case of a 4924 coordinated approach using a CLOSE/CLOSE ACK exchange, there is still 4925 the possibility of a host rebooting without having the time to 4926 perform the CLOSE exchange. So, it is true that the coordinated 4927 approach eliminates the possibility of a context confusion situation 4928 because premature garbage collection, but it does not prevents the 4929 same situations due to a crash and reboot of one of the involved 4930 hosts. The result is that even if we went for a coordinated 4931 approach, we would still need to deal with context confusion and 4932 provide the means to detect and recover from this situations. 4934 19. References 4936 19.1 Normative References 4938 [1] Bradner, S., "Key words for use in RFCs to Indicate Requirement 4939 Levels", BCP 14, RFC 2119, March 1997. 4941 [2] Deering, S. and R. Hinden, "Internet Protocol, Version 6 (IPv6) 4942 Specification", RFC 2460, December 1998. 4944 [3] Narten, T., Nordmark, E., and W. Simpson, "Neighbor Discovery 4945 for IP Version 6 (IPv6)", RFC 2461, December 1998. 4947 [4] Thomson, S. and T. Narten, "IPv6 Stateless Address 4948 Autoconfiguration", RFC 2462, December 1998. 4950 [5] Conta, A. and S. Deering, "Internet Control Message Protocol 4951 (ICMPv6) for the Internet Protocol Version 6 (IPv6) 4952 Specification", RFC 2463, December 1998. 4954 [6] Aura, T., "Cryptographically Generated Addresses (CGA)", 4955 RFC 3972, March 2005. 4957 [7] Bagnulo, M., "Hash Based Addresses (HBA)", 4958 draft-ietf-shim6-hba-01 (work in progress), October 2005. 4960 [8] Arkko, J. and I. Beijnum, "Failure Detection and Locator Pair 4961 Exploration Protocol for IPv6 Multihoming", 4962 draft-ietf-shim6-failure-detection-03 (work in progress), 4963 December 2005. 4965 19.2 Informative References 4967 [9] Gulbrandsen, A., Vixie, P., and L. Esibov, "A DNS RR for 4968 specifying the location of services (DNS SRV)", RFC 2782, 4969 February 2000. 4971 [10] Ferguson, P. and D. Senie, "Network Ingress Filtering: 4972 Defeating Denial of Service Attacks which employ IP Source 4973 Address Spoofing", BCP 38, RFC 2827, May 2000. 4975 [11] Narten, T. and R. Draves, "Privacy Extensions for Stateless 4976 Address Autoconfiguration in IPv6", RFC 3041, January 2001. 4978 [12] Draves, R., "Default Address Selection for Internet Protocol 4979 version 6 (IPv6)", RFC 3484, February 2003. 4981 [13] Bagnulo, M., "Updating RFC 3484 for multihoming support", 4982 draft-bagnulo-ipv6-rfc3484-update-00 (work in progress), 4983 December 2005. 4985 [14] Schulzrinne, H., Casner, S., Frederick, R., and V. Jacobson, 4986 "RTP: A Transport Protocol for Real-Time Applications", STD 64, 4987 RFC 3550, July 2003. 4989 [15] Abley, J., Black, B., and V. Gill, "Goals for IPv6 Site- 4990 Multihoming Architectures", RFC 3582, August 2003. 4992 [16] Rajahalme, J., Conta, A., Carpenter, B., and S. Deering, "IPv6 4993 Flow Label Specification", RFC 3697, March 2004. 4995 [17] Eastlake, D., Schiller, J., and S. Crocker, "Randomness 4996 Requirements for Security", BCP 106, RFC 4086, June 2005. 4998 [18] Hinden, R. and B. Haberman, "Unique Local IPv6 Unicast 4999 Addresses", RFC 4193, October 2005. 5001 [19] Nordmark, E. and T. Li, "Threats Relating to IPv6 Multihoming 5002 Solutions", RFC 4218, October 2005. 5004 [20] Huitema, C., "Ingress filtering compatibility for IPv6 5005 multihomed sites", draft-huitema-shim6-ingress-filtering-00 5006 (work in progress), September 2005. 5008 [21] Bagnulo, M. and E. Nordmark, "SHIM - MIPv6 Interaction", 5009 draft-bagnulo-shim6-mip-00 (work in progress), July 2005. 5011 [22] Nordmark, E., "Shim6 Application Referral Issues", 5012 draft-ietf-shim6-app-refer-00 (work in progress), July 2005. 5014 [23] Abley, J., "Shim6 Applicability Statement", 5015 draft-ietf-shim6-applicability-00 (work in progress), 5016 July 2005. 5018 [24] Huston, G., "Architectural Commentary on Site Multi-homing 5019 using a Level 3 Shim", draft-ietf-shim6-arch-00 (work in 5020 progress), July 2005. 5022 [25] Moskowitz, R., "Host Identity Protocol", draft-ietf-hip-base-05 5023 (work in progress), March 2006. 5025 [26] Eronen, P., "IKEv2 Mobility and Multihoming Protocol (MOBIKE)", 5026 draft-ietf-mobike-protocol-08 (work in progress), 5027 February 2006. 5029 Authors' Addresses 5031 Erik Nordmark 5032 Sun Microsystems 5033 17 Network Circle 5034 Menlo Park, CA 94025 5035 USA 5037 Phone: +1 650 786 2921 5038 Email: erik.nordmark@sun.com 5040 Marcelo Bagnulo 5041 Universidad Carlos III de Madrid 5042 Av. Universidad 30 5043 Leganes, Madrid 28911 5044 SPAIN 5046 Phone: +34 91 6248814 5047 Email: marcelo@it.uc3m.es 5048 URI: http://www.it.uc3m.es 5050 Intellectual Property Statement 5052 The IETF takes no position regarding the validity or scope of any 5053 Intellectual Property Rights or other rights that might be claimed to 5054 pertain to the implementation or use of the technology described in 5055 this document or the extent to which any license under such rights 5056 might or might not be available; nor does it represent that it has 5057 made any independent effort to identify any such rights. Information 5058 on the procedures with respect to rights in RFC documents can be 5059 found in BCP 78 and BCP 79. 5061 Copies of IPR disclosures made to the IETF Secretariat and any 5062 assurances of licenses to be made available, or the result of an 5063 attempt made to obtain a general license or permission for the use of 5064 such proprietary rights by implementers or users of this 5065 specification can be obtained from the IETF on-line IPR repository at 5066 http://www.ietf.org/ipr. 5068 The IETF invites any interested party to bring to its attention any 5069 copyrights, patents or patent applications, or other proprietary 5070 rights that may cover technology that may be required to implement 5071 this standard. Please address the information to the IETF at 5072 ietf-ipr@ietf.org. 5074 Disclaimer of Validity 5076 This document and the information contained herein are provided on an 5077 "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS 5078 OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET 5079 ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, 5080 INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE 5081 INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED 5082 WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. 5084 Copyright Statement 5086 Copyright (C) The Internet Society (2006). This document is subject 5087 to the rights, licenses and restrictions contained in BCP 78, and 5088 except as set forth therein, the authors retain all their rights. 5090 Acknowledgment 5092 Funding for the RFC Editor function is currently provided by the 5093 Internet Society.