idnits 2.17.1 draft-ietf-shim6-multihome-shim-api-15.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == Line 1247 has weird spacing: '... u_int msg_...' == Line 1248 has weird spacing: '... struct iovec...' == Line 1249 has weird spacing: '... u_int msg_...' == Line 1251 has weird spacing: '... u_int msg_...' -- The document seems to contain a disclaimer for pre-RFC5378 work, and may have content which was first submitted before 10 November 2008. The disclaimer is necessary when there are original authors that you have been unable to contact, or if some do not wish to grant the BCP78 rights to the IETF Trust. If you are able to get all authors (current and original) to grant those rights, you can and should remove the disclaimer; otherwise, the disclaimer is needed and you can ignore this comment. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (October 30, 2010) is 4926 days in the past. Is this intentional? -- Found something which looks like a code comment -- if you have code sections in the document, please surround them with '' and '' lines. Checking references for intended status: Informational ---------------------------------------------------------------------------- -- Looks like a reference, but probably isn't: '0' on line 1012 -- Looks like a reference, but probably isn't: '1' on line 1023 ** Obsolete normative reference: RFC 4423 (Obsoleted by RFC 9063) -- Obsolete informational reference (is this intentional?): RFC 2765 (Obsoleted by RFC 6145) Summary: 1 error (**), 0 flaws (~~), 5 warnings (==), 6 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 SHIM6 Working Group M. Komu 3 Internet-Draft HIIT 4 Intended status: Informational M. Bagnulo 5 Expires: May 3, 2011 UC3M 6 K. Slavov 7 S. Sugimoto, Ed. 8 Ericsson 9 October 30, 2010 11 Socket Application Program Interface (API) for Multihoming Shim 12 draft-ietf-shim6-multihome-shim-api-15 14 Abstract 16 This document specifies sockets API extensions for the multihoming 17 shim layer. The API aims to enable interactions between applications 18 and the multihoming shim layer for advanced locator management, and 19 access to information about failure detection and path exploration. 21 This document is based on an assumption that a multihomed host is 22 equipped with a conceptual sub-layer (hereafter "shim") inside the IP 23 layer that maintains mappings between identifiers and locators. 24 Examples of the shim are SHIM6 and HIP. 26 Status of this Memo 28 This Internet-Draft is submitted in full conformance with the 29 provisions of BCP 78 and BCP 79. 31 Internet-Drafts are working documents of the Internet Engineering 32 Task Force (IETF). Note that other groups may also distribute 33 working documents as Internet-Drafts. The list of current Internet- 34 Drafts is at http://datatracker.ietf.org/drafts/current/. 36 Internet-Drafts are draft documents valid for a maximum of six months 37 and may be updated, replaced, or obsoleted by other documents at any 38 time. It is inappropriate to use Internet-Drafts as reference 39 material or to cite them other than as "work in progress." 41 This Internet-Draft will expire on May 3, 2011. 43 Copyright Notice 45 Copyright (c) 2010 IETF Trust and the persons identified as the 46 document authors. All rights reserved. 48 This document is subject to BCP 78 and the IETF Trust's Legal 49 Provisions Relating to IETF Documents 50 (http://trustee.ietf.org/license-info) in effect on the date of 51 publication of this document. Please review these documents 52 carefully, as they describe your rights and restrictions with respect 53 to this document. Code Components extracted from this document must 54 include Simplified BSD License text as described in Section 4.e of 55 the Trust Legal Provisions and are provided without warranty as 56 described in the Simplified BSD License. 58 This document may contain material from IETF Documents or IETF 59 Contributions published or made publicly available before November 60 10, 2008. The person(s) controlling the copyright in some of this 61 material may not have granted the IETF Trust the right to allow 62 modifications of such material outside the IETF Standards Process. 63 Without obtaining an adequate license from the person(s) controlling 64 the copyright in such materials, this document may not be modified 65 outside the IETF Standards Process, and derivative works of it may 66 not be created outside the IETF Standards Process, except to format 67 it for publication as an RFC or to translate it into languages other 68 than English. 70 Table of Contents 72 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 5 73 2. Requirements Language . . . . . . . . . . . . . . . . . . . . 6 74 3. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 6 75 4. System Overview . . . . . . . . . . . . . . . . . . . . . . . 8 76 5. Requirements . . . . . . . . . . . . . . . . . . . . . . . . . 9 77 6. Socket Options for Multihoming Shim Sub-layer . . . . . . . . 10 78 6.1. SHIM_ASSOCIATED . . . . . . . . . . . . . . . . . . . . . 14 79 6.2. SHIM_DONTSHIM . . . . . . . . . . . . . . . . . . . . . . 15 80 6.3. SHIM_HOT_STANDBY . . . . . . . . . . . . . . . . . . . . 16 81 6.4. SHIM_LOC_LOCAL_PREF . . . . . . . . . . . . . . . . . . . 17 82 6.5. SHIM_LOC_PEER_PREF . . . . . . . . . . . . . . . . . . . 18 83 6.6. SHIM_LOC_LOCAL_RECV . . . . . . . . . . . . . . . . . . . 19 84 6.7. SHIM_LOC_PEER_RECV . . . . . . . . . . . . . . . . . . . 20 85 6.8. SHIM_LOC_LOCAL_SEND . . . . . . . . . . . . . . . . . . . 20 86 6.9. SHIM_LOC_PEER_SEND . . . . . . . . . . . . . . . . . . . 22 87 6.10. SHIM_LOCLIST_LOCAL . . . . . . . . . . . . . . . . . . . 23 88 6.11. SHIM_LOCLIST_PEER . . . . . . . . . . . . . . . . . . . . 25 89 6.12. SHIM_APP_TIMEOUT . . . . . . . . . . . . . . . . . . . . 25 90 6.13. SHIM_PATHEXPLORE . . . . . . . . . . . . . . . . . . . . 26 91 6.14. SHIM_DEFERRED_CONTEXT_SETUP . . . . . . . . . . . . . . . 27 92 6.15. Applicability . . . . . . . . . . . . . . . . . . . . . . 28 93 6.16. Error Handling . . . . . . . . . . . . . . . . . . . . . 28 94 7. Ancillary Data for Multihoming Shim Sub-layer . . . . . . . . 28 95 7.1. Get Locator from Incoming Packet . . . . . . . . . . . . 30 96 7.2. Set Locator for Outgoing Packet . . . . . . . . . . . . . 30 97 7.3. Notification from Application to Multihoming Shim 98 Sub-layer . . . . . . . . . . . . . . . . . . . . . . . . 30 99 7.4. Applicability . . . . . . . . . . . . . . . . . . . . . . 31 100 8. Data Structures . . . . . . . . . . . . . . . . . . . . . . . 31 101 8.1. Placeholder for Locator Information . . . . . . . . . . . 31 102 8.1.1. Handling Locator behind NAT . . . . . . . . . . . . . 33 103 8.2. Path Exploration Parameter . . . . . . . . . . . . . . . 33 104 8.3. Feedback Information . . . . . . . . . . . . . . . . . . 34 105 9. System Requirements . . . . . . . . . . . . . . . . . . . . . 35 106 10. Relation to Existing Sockets API Extensions . . . . . . . . . 35 107 11. Operational Considerations . . . . . . . . . . . . . . . . . . 36 108 11.1. Conflict Resolution . . . . . . . . . . . . . . . . . . . 36 109 11.2. Incompatibility between IPv4 and IPv6 . . . . . . . . . . 37 110 12. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 37 111 13. Protocol Constants and Variables . . . . . . . . . . . . . . . 37 112 14. Security Considerations . . . . . . . . . . . . . . . . . . . 37 113 14.1. Treatment of Unknown Locator . . . . . . . . . . . . . . 37 114 14.1.1. Treatment of Unknown Source Locator . . . . . . . . . 38 115 14.1.2. Treatment of Unknown Destination Locator . . . . . . . 38 116 15. Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 117 15.1. Changes from version 00 to version 01 . . . . . . . . . . 38 118 15.2. Changes from version 01 to version 02 . . . . . . . . . . 39 119 15.3. Changes from version 02 to version 03 . . . . . . . . . . 39 120 15.4. Changes from version 03 to version 04 . . . . . . . . . . 39 121 15.5. Changes from version 04 to version 05 . . . . . . . . . . 39 122 15.6. Changes from version 05 to version 06 . . . . . . . . . . 39 123 15.7. Changes from version 06 to version 07 . . . . . . . . . . 39 124 15.8. Changes from version 07 to version 08 . . . . . . . . . . 39 125 15.9. Changes from version 08 to version 09 . . . . . . . . . . 39 126 15.10. Changes from version 09 to version 10 . . . . . . . . . . 40 127 15.11. Changes from version 10 to version 11 . . . . . . . . . . 40 128 15.12. Changes from version 11 to version 12 . . . . . . . . . . 40 129 15.13. Changes from version 12 to version 13 . . . . . . . . . . 40 130 15.14. Changes from version 13 to version 14 . . . . . . . . . . 40 131 15.15. Changes from version 14 to version 15 . . . . . . . . . . 40 132 16. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 40 133 17. References . . . . . . . . . . . . . . . . . . . . . . . . . . 41 134 17.1. Normative References . . . . . . . . . . . . . . . . . . 41 135 17.2. Informative References . . . . . . . . . . . . . . . . . 41 136 Appendix A. Context Forking . . . . . . . . . . . . . . . . . . . 42 137 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 44 139 1. Introduction 141 This document defines socket API extensions by which upper layer 142 protocols may be informed about and control the way in which a 143 multihoming shim sub-layer in the IP layer manages the dynamic choice 144 of locators. Initially it applies to SHIM6 and HIP, but it is 145 defined generically. 147 The role of the multihoming shim sub-layer (hereafter called "shim 148 sub-layer" in this document) is to avoid impacts to upper layer 149 protocols which may be caused when the endhost changes its attachment 150 point to the Internet, for instance, in the case of rehoming event 151 under the multihomed environment. There is, however, a need for API 152 in the cases where 1) the upper layer protocol is particularly 153 sensitive to impacts, or 2) the upper layer protocol wants to benefit 154 from better knowledge of what is going on underneath. 156 There are various kinds of technologies that aim to solve the same 157 issue, the multihoming issue. Note that there will be conflict when 158 more than one shim sub-layer is active at the same time. The 159 assumption made in this document is that there is only a single shim 160 sub-layer (HIP or SHIM6) activated on the system. 162 In this document, syntax and semantics of the API are given in the 163 same way as in the Posix standard [POSIX]. The API specifies how to 164 use ancillary data (aka cmsg) to access the locator information with 165 recvmsg() and/or sendmsg() I/O calls. The API is described in C 166 language and data types are defined in the Posix format; intN_t means 167 a signed integer of exactly N bits (e.g. int16_t) and uintN_t means 168 an unsigned integer of exactly N bits (e.g. uint32_t). 170 The distinction between "connected" sockets and "unconnected" sockets 171 is important when discussing the applicability of the socket API 172 defined in this document. A connected socket is bound to a given 173 peer, whereas an unconnected socket is not bound to any specific 174 peers. A TCP socket becomes a connected socket when the TCP 175 connection establishment is completed. UDP sockets are unconnected, 176 unless the application uses the connect() system call. 178 The target readers of this document are application programmers who 179 develop application software which may benefit greatly from 180 multihomed environments. In addition, this document aims to provide 181 necessary information for developers of shim protocols to implement 182 API for enabling advanced locator management. 184 2. Requirements Language 186 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 187 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 188 document are to be interpreted as described in [RFC2119]. 190 3. Terminology 192 This section provides terminology used in this document. Basically 193 most of the terms used in this document are taken from the following 194 documents: 196 o SHIM6 Protocol Specification[RFC5533] 197 o HIP Architecture[RFC4423] 198 o Reachability Protocol (REAP)[RFC5534] 200 In this document, the term "IP" refers to both IPv4 and IPv6, unless 201 the protocol version is specifically mentioned. The following are 202 definitions of terms frequently used in this document: 204 o Endpoint identifier (EID) - The identifier used by the application 205 to specify the endpoint of a given communication. Applications 206 may handle EIDs in various ways such as long-lived connections, 207 callbacks, and referrals[I-D.ietf-shim6-app-refer]. 208 * In the case of SHIM6, an identifier called a ULID (Upper Layer 209 Identifier) serves as an EID. A ULID is chosen from locators 210 available on the host. 211 * In the case of HIP, an identifier called a Host Identifier 212 serves as an EID. A Host Identifier is derived from the public 213 key of a given host. For the sake of backward compatibility 214 with the sockets API, the Host Identifier is represented in a 215 form of hash of public key. 216 * Note that the EID appears in the standard socket API as an 217 address, and does not appear in the extensions defined in this 218 document, which only concern locators. 219 o Locator - The IP address actually used to deliver IP packets. 220 Locators are present in the source and destination fields of the 221 IP header of a packet on the wire. Locator discussed in this 222 document could be either an IPv4 address or an IPv6 address. Note 223 that HIP can handle both IPv4 and IPv6 locators, whereas SHIM6 can 224 handle only IPv6 locators. For the HIP case, locator can be a 225 private IPv4 address when the host is behind a NAT. Section 226 Section 8.1.1 gives detailed description about handling of locator 227 behind NAT. 228 * List of locators - A list of locators associated with an EID. 229 There are two lists of locators stored in a given context. One 230 is associated with the local EID and the other is associated 231 with the remote EID. As defined in [RFC5533], the list of 232 locators associated with an EID 'A' is denoted as Ls(A). 233 * Preferred locator - The (source/destination) locator currently 234 used to send packets within a given context. 235 * Unknown locator - Any locator that does not appear in the 236 locator list of the shim context associated with the socket. 237 When there is no shim context associated with the socket, any 238 source and/or destination locator requested by the application 239 is considered to be unknown locator. 240 * Valid locator - A valid locator means that the locator is 241 considered to be valid in the security sense. More 242 specifically, the validity indicates whether the locator is 243 part of a HBA set. 244 * Verified locator - A verified locator means that the locator is 245 considered to be reachable according to the result of REAP 246 return routability check. Note that the verification applies 247 only to peer's locator. 248 o Shim - The conceptual sub-layer inside the IP layer which 249 maintains mappings between EIDs and locators. An EID can be 250 associated with more than one locator at a time when the host is 251 multihomed. The term 'shim' does not refer to a specific protocol 252 but refers to the conceptual sub-layer inside the IP layer. 253 o Identifier/locator adaptation - The adaptation performed at the 254 shim sub-layer which may end up re-writing the source and/or 255 destination addresses of an IP packet. In the outbound packet 256 processing, the EID pair is converted to the associated locator 257 pair. In the inbound packet processing, the locator pair is 258 converted to the EID pair. 259 o Context - The state information shared by a given pair of peers, 260 which stores a binding between the EID and associated locators. 261 Contexts are maintained by the shim sub-layer. 262 o Reachability detection - The procedure to check reachability 263 between a given locator pair. 264 o Path - The sequence of routers that an IP packet goes through to 265 reach the destination. 266 o Path exploration - The procedure to explore available paths for a 267 given set of locator pairs. 268 o Outage - The incident that prevents IP packets to flow from the 269 source locator to the destination locator. When there is an 270 outage, it means that there is no reachability between a given 271 locator pair. The outage may be caused by various reasons, such 272 as shortage of network resources, congestion, and human error 273 (faulty operation). 274 o Working address pair - The address pair is considered to be 275 "working" if the packet can safely travel from the source to the 276 destination where the packet contains the first address from the 277 pair as the source address and the second address from the pair as 278 the destination address. If reachability is confirmed in both 279 directions, the address pair is considered to be working bi- 280 directionally. 281 o Reachability protocol (REAP) - The protocol for detecting failure 282 and exploring reachability in a multihomed environment. REAP is 283 defined in [RFC5534]. 285 4. System Overview 287 Figure 1 illustrates the system overview. The shim sub-layer and 288 REAP component exist inside the IP layer. Applications use the 289 sockets API defined in this document to interface with the shim sub- 290 layer and the transport layer for locator management, failure 291 detection, and path exploration. 293 It may also be possible that the shim sub-layer interacts with the 294 transport layer, however, such an interaction is outside the scope of 295 this document. 297 +------------------------+ 298 | Application | 299 +------------------------+ 300 ^ ^ 301 ~~~~~~~~~~~~~|~Socket Interface|~~~~~~~~~~~~~~ 302 | v 303 +-----------|------------------------------+ 304 | | Transport Layer | 305 +-----------|------------------------------+ 306 ^ | 307 +-------------|-----|-------------------------------------+ 308 | v v | 309 | +-----------------------------+ +----------+ | IP 310 | | Shim |<----->| REAP | | Layer 311 | +-----------------------------+ +----------+ | 312 | ^ ^ | 313 +-----------------------|----------------------|----------+ 314 v v 315 +------------------------------------------+ 316 | Link Layer | 317 +------------------------------------------+ 319 Figure 1: System overview 321 5. Requirements 323 The following is a list of requirements from applications: 324 o Turn on/off shim. An application should be able to request to 325 turn on or turn off the multihoming support by the shim layer: 326 * Apply shim. The application should be able to explicitly 327 request the shim sub-layer to apply multihoming support. 328 * Don't apply shim. The application should be able to request 329 the shim sub-layer not to apply the multihoming support but to 330 apply normal IP processing at the IP layer. 331 * Note that this function is also required by other types of 332 multihoming mechanisms such as SCTP and multipath TCP to avoid 333 potential conflict with the shim sub-layer. 334 o Locator management. 335 * It should be possible to set preferred source and/or 336 destination locator within a given context. 337 * It should be possible to get preferred source and/or 338 destination locator within a given context. 339 * It should be possible to set a list of source and/or 340 destination locators within a given context: Ls(local) and 341 Ls(remote). 342 * It should be possible to get a list of source and/or 343 destination locators within a given context: Ls(local) and 344 Ls(remote). 345 o Notification from applications to the shim sub-layer about the 346 status of the communication. The notification occurs in an event- 347 based manner. Applications and/or upper layer protocols may 348 provide positive feedback or negative feedback to the shim sub- 349 layer. Note that these feedback are mentioned in [RFC5534]: 350 * Applications and/or upper layer protocols (e.g., TCP) may 351 provide positive feedback to the shim sub-layer informing that 352 the communication is going well. 353 * Applications and/or upper layer protocols (e.g., TCP) may 354 provide negative feedback to the shim sub-layer informing that 355 the communication status is not satisfactory. TCP may detect a 356 problem when it does not receive any expected ACK message from 357 the peer. The REAP module may be triggered by these negative 358 feedback and invoke the path exploration procedure. 359 o Feedback from applications to the shim sub-layer. Applications 360 should be able to inform the shim sub-layer of the timeout values 361 for detecting failures, sending keepalives, and starting the 362 exploration procedure. In particular, applications should be able 363 to suppress keepalives. 364 o Hot-standby. Applications may request the shim sub-layer for the 365 hot-standby capability. This means that, alternative paths are 366 known to be working in advance of a failure detection. In such a 367 case, it is possible for the host to immediately replace the 368 current locator pair with an alternative locator pair. 370 o Eagerness for locator exploration. An application should be able 371 to inform the shim sub-layer of how aggressively it wants the REAP 372 mechanism to perform a path exploration (e.g., by specifying the 373 number of concurrent attempts of discovery of working locator 374 pairs) when an outage occurs on the path between the locator pair 375 in use. 376 o Providing locator information to applications. An application 377 should be able to obtain information about the locator pair which 378 was actually used to send or receive the packet. 379 * For inbound traffic, the application may be interested in the 380 locator pair which was actually used to receive the packet. 381 * For outbound traffic, the application may be interested in the 382 locator pair which was actually used to transmit the packet. 383 In this way, applications may have additional control on the 384 locator management. For example, an application becomes able to 385 verify if its preference for locator is actually applied to the 386 flow or not. 387 o Applications should be able to know if the shim-sublayer supports 388 deferred context setup or not. 389 o An application should be able to know if the communication is now 390 being served by the shim sub-layer or not. 391 o An application should be able to use a common interface to access 392 an IPv4 locator and an IPv6 locator. 394 6. Socket Options for Multihoming Shim Sub-layer 396 In this section, socket options that are specific to the shim sub- 397 layer are defined. 399 Table 1 shows a list of the socket options that are specific to the 400 shim sub-layer. All of these socket options are defined at the level 401 SOL_SHIM. When an application uses one of the socket options by 402 getsockopt() or setsockopt(), the second argument must be set as 403 SOL_SHIM. 405 The first column of Table 1 gives the name of the option. The second 406 and third columns indicate whether the option can be handled by the 407 getsockopt() system call and/or by the setsockopt() system call. The 408 fourth column provides a brief description of the socket option. The 409 fifth column shows the type of data structure specified along with 410 the socket option. By default, the data structure type is an 411 integer. 413 +-----------------------------+-----+-----+-----------------+-------+ 414 | optname | get | set | description | dtype | 415 +-----------------------------+-----+-----+-----------------+-------+ 416 | SHIM_ASSOCIATED | o | | Get the | int | 417 | | | | parameter (0 or | | 418 | | | | 1) which | | 419 | | | | indicates | | 420 | | | | whether the | | 421 | | | | socket is | | 422 | | | | associated (1) | | 423 | | | | with any shim | | 424 | | | | context or not | | 425 | | | | (0). | | 426 | SHIM_DONTSHIM | o | o | Get or set the | int | 427 | | | | parameter which | | 428 | | | | indicates | | 429 | | | | whether to | | 430 | | | | employ the | | 431 | | | | multihoming | | 432 | | | | support by the | | 433 | | | | shim sub-layer | | 434 | | | | or not. | | 435 | SHIM_HOT_STANDBY | o | o | Get or set the | int | 436 | | | | parameter to | | 437 | | | | request the | | 438 | | | | shim sub-layer | | 439 | | | | to prepare a | | 440 | | | | hot-standby | | 441 | | | | connection. | | 442 | SHIM_LOC_LOCAL_PREF | o | o | Get or set the | Note | 443 | | | | preferred | 1 | 444 | | | | locator on the | | 445 | | | | local side for | | 446 | | | | the context | | 447 | | | | associated with | | 448 | | | | the socket. | | 449 | SHIM_LOC_PEER_PREF | o | o | Get or set the | Note | 450 | | | | preferred | 1 | 451 | | | | locator on the | | 452 | | | | remote side for | | 453 | | | | the context | | 454 | | | | associated with | | 455 | | | | the socket. | | 456 | SHIM_LOC_LOCAL_RECV | o | o | Request the | int | 457 | | | | shim sub-layer | | 458 | | | | to store the | | 459 | | | | destination | | 460 | | | | locator of the | | 461 | | | | received IP | | 462 | | | | packet in an | | 463 | | | | ancillary data | | 464 | | | | object. | | 465 | SHIM_LOC_PEER_RECV | o | o | Request the | int | 466 | | | | shim sub-layer | | 467 | | | | to store the | | 468 | | | | source locator | | 469 | | | | of the received | | 470 | | | | IP packet in an | | 471 | | | | ancillary data | | 472 | | | | object. | | 473 | SHIM_LOC_LOCAL_SEND | o | o | Get or set the | Note | 474 | | | | source locator | 1 | 475 | | | | of outgoing IP | | 476 | | | | packets. | | 477 | SHIM_LOC_PEER_SEND | o | o | Get or set the | Note | 478 | | | | destination | 1 | 479 | | | | locator of | | 480 | | | | outgoing IP | | 481 | | | | packets. | | 482 | SHIM_LOCLIST_LOCAL | o | o | Get or set the | Note | 483 | | | | list of | 2 | 484 | | | | locators | | 485 | | | | associated with | | 486 | | | | the local EID. | | 487 | SHIM_LOCLIST_PEER | o | o | Get or set the | Note | 488 | | | | list of | 2 | 489 | | | | locators | | 490 | | | | associated with | | 491 | | | | the peer's EID. | | 492 | SHIM_APP_TIMEOUT | o | o | Get or set the | int | 493 | | | | Send Timeout | | 494 | | | | value of the | | 495 | | | | REAP protocol. | | 496 | SHIM_PATHEXPLORE | o | o | Get or set | Note | 497 | | | | parameters for | 3 | 498 | | | | path | | 499 | | | | exploration and | | 500 | | | | failure | | 501 | | | | detection. | | 502 | SHIM_CONTEXT_DEFERRED_SETUP | o | | Get the | int | 503 | | | | parameter which | | 504 | | | | indicates | | 505 | | | | whether | | 506 | | | | deferred | | 507 | | | | context setup | | 508 | | | | is supported or | | 509 | | | | not. | | 510 +-----------------------------+-----+-----+-----------------+-------+ 512 Table 1: Socket options for multihoming shim sub-layer 514 Note 1: Pointer to a shim_locator which is defined in Section 8. 516 Note 2: Pointer to an array of shim_locator. 518 Note 3: Pointer to a shim_pathexplore which is defined in Section 8. 520 Figure 2 illustrates how the shim specific socket options fit into 521 the system model of socket API. The figure shows that the shim sub- 522 layer and the additional protocol components (IPv4 and IPv6) below 523 the shim sub-layer are new to the system model. As previously 524 mentioned, all the shim specific socket options are defined at the 525 SOL_SHIM level. This design choice brings the following advantages: 527 1. The existing sockets API continue to work at the layer above the 528 shim sub-layer. That is, those legacy API handle IP addresses as 529 identifiers. 530 2. With newly defined socket options for the shim sub-layer, the 531 application obtains additional control of locator management. 532 3. The shim specific socket options can be kept independent from 533 address family (IPPROTO_IP or IPPROTO_IPV6) and transport 534 protocol (IPPROTO_TCP or IPPROTO_UDP). 536 s1 s2 s3 s4 537 | | | | 538 +----------------|--|-------|--|----------------+ 539 | +-------+ +-------+ | 540 | IPPROTO_TCP | TCP | | UDP | | 541 | +-------+ +-------+ | 542 | | \ / | | 543 | | ----- | | 544 | | / \ | | 545 | +------+ +------+ | 546 | IPPROTO_IP | IPv4 | | IPv6 | IPPROTO_IPV6 | 547 | +------+ +------+ | 548 | \ / SOL_SOCKET 549 | +--------\-------/--------+ | 550 | SOL_SHIM | shim | | 551 | +--------/-------\--------+ | 552 | / \ | 553 | +------+ +------+ | 554 | | IPv4 | | IPv6 | | 555 | +------+ +------+ | 556 | | | | 557 +------------------|----------|-----------------+ 558 | | 559 IPv4 IPv6 560 Datagram Datagram 562 Figure 2: System model of sockets API with shim sub-layer 564 6.1. SHIM_ASSOCIATED 566 The SHIM_ASSOCIATED option is used to check whether the socket is 567 associated with any shim context or not. 569 This option is meaningful when the locator information of the 570 received IP packet does not tell whether the identifier/locator 571 adaptation is performed or not. Note that the EID pair and the 572 locator pair may be identical in some cases. 574 This option can be specified by getsockopt(). Thus, the option is 575 read-only and the result (0/1/2) is set in the option value (the 576 fourth argument of getsockopt()). 578 When the application specifies the socket option to an unconnected 579 socket, an error code EOPNOTSUPP is returned to the application. 581 The data type of the option value is an integer. The option value 582 indicates the presence of shim context. A return value 1 means that 583 the socket is associated with a shim context at the shim sub-layer. 584 A return value 0 indicates that there is no shim context associated 585 with the socket. A return value 2 means that it is not known whether 586 the socket is associated with a shim context or not, and this must be 587 returned only when the socket is unconnected. In other words, the 588 returned value must be 0 or 1 when the socket is connected. 590 For example, the option can be used by the application as follows: 592 int optval; 593 int optlen = sizeof(optval); 595 getsockopt(fd, SOL_SHIM, SHIM_ASSOCIATED, &optval, &optlen); 597 6.2. SHIM_DONTSHIM 599 The SHIM_DONTSHIM option is used to request the shim layer not to 600 provide the multihoming support for the communication established 601 over the socket. 603 The data type of the option value is an integer, and it takes 0 or 1. 604 An option value 0 means that the shim sub-layer is employed if 605 available. An option value 1 means that the application does not 606 want the shim sub-layer to provide the multihoming support for the 607 communication established over the socket. 609 Default value is set as 0, which means that the shim sub-layer 610 performs identifier/locator adaptation if available. 612 Any attempt to disable the multihoming shim support MUST be made by 613 the application before the socket is connected. If an application 614 makes such an attempt for a connected-socket, an error code 615 EOPNOTSUPP MUST be returned. 617 For example, an application can request the system not to apply the 618 multihoming support as follows: 620 int optval; 622 optval = 1; 624 setsockopt(fd, SOL_SHIM, SHIM_DONTSHIM, &optval, sizeof(optval)); 626 For example, the application can check the option value as follows: 628 int optval; 629 int len; 631 len = sizeof(optval); 633 getsockopt(fd, SOL_SHIM, SHIM_DONTSHIM, &optval, &len); 635 6.3. SHIM_HOT_STANDBY 637 The SHIM_HOT_STANDBY option is used to control the shim sub-layer 638 whether to employ a hot-standby connection for the socket or not. A 639 hot-standby connection is an alternative working locator pair to the 640 current locator pair. This option is effective only when there is a 641 shim context associated with the socket. 643 The data type of the option value is an integer. 645 The option value can be set by setsockopt(). 647 The option value can be read by getsockopt(). 649 By default, the value is set to 0, meaning that hot-standby 650 connection is disabled. 652 When the application specifies the socket option to an unconnected 653 socket, an error code EOPNOTSUPP is returned to the application. 655 When there is no shim context associated with the socket, an error 656 code ENOENT is returned to the application. 658 For example, an application can request establishment of a hot- 659 standby connection by using the socket option as follows: 661 int optval; 663 optval = 1; 665 setsockopt(fd, SOL_SHIM, SHIM_HOT_STANDBY, &optval, 666 sizeof(optval)); 668 For example, an application can get the option value by using the 669 socket option as follows: 671 int optval; 672 int len; 674 len = sizeof(optval); 675 getsockopt(fd, SOL_SHIM, SHIM_HOT_STANDBY, &optval, &len); 677 6.4. SHIM_LOC_LOCAL_PREF 679 The SHIM_LOC_LOCAL_PREF option is used to get or set preference for a 680 source locator for outbound traffic within a given context. This 681 option is effective only when there is a shim context associated with 682 the socket. 684 The preference of a locator is defined by a combination of priority 685 and weight as per DNS SRV[RFC2782]. Note that the SHIM6 base 686 protocol defines preference of locator in the same way. 688 The data type of the option value is a pointer to a locator 689 information data structure which is defined in Section 8. 691 By default, the option value is set to NULL, meaning that the option 692 is disabled. 694 The preferred locator can be set by setsockopt(). The shim sub-layer 695 shall verify requested locator before it updates the preferred 696 locator. 698 An application can get the preferred locator by getsockopt(). 700 An application needs to get or set preference for each address, one 701 by one. 703 When the application specifies the socket option to an unconnected 704 socket, an error code EOPNOTSUPP is returned to the application. 706 When there is no shim context associated with the socket, an error 707 code ENOENT is returned to the application. 709 An error EINVALIDLOCATOR is returned when the validation of the 710 specified locator fails. 712 For example, an application can set the preferred locator by using 713 the socket option as follows. Note that some members of the 714 shim_locator (lc_ifidx and lc_flags) are ignored in the set 715 operation. 717 struct shim_locator lc; 718 struct in6_addr ip6; 720 /* ...set the locator (ip6)... */ 722 memset(&lc, 0, sizeof(shim_locator)); 723 lc.lc_family = AF_INET6; /* IPv6 */ 724 lc.lc_ifidx = 0; 725 lc.lc_flags = 0; 726 lc.lc_prio = 1; 727 lc.lc_weight = 10; 728 memcpy(&lc.lc_addr, &ip6, sizeof(in6_addr)); 730 setsockopt(fd, SOL_SHIM, SHIM_LOC_LOCAL_PREF, &lc, 731 sizeof(optval)); 733 For example, an application can get the preferred locator by using 734 the socket option as follows. 736 struct shim_locator lc; 737 int len; 739 len = sizeof(lc); 741 getsockopt(fd, SOL_SHIM, SHIM_LOC_LOCAL_PREF, &lc, &len); 743 6.5. SHIM_LOC_PEER_PREF 745 The SHIM_LOC_PEER_PREF option is used to get or set preference of a 746 destination locator for outbound traffic within a given context. 747 This option is effective only when there is a shim context associated 748 with the socket. 750 As defined earlier, the preference of a locator is defined by a 751 combination of priority and weight as per DNS SRV[RFC2782]. When 752 there are more than one candidate destination locators, the shim sub- 753 layer makes selection based on the priority and weight specified for 754 each locator. 756 The data type of the option value is a pointer to the locator 757 information data structure which is defined in Section 8. 759 By default, the option value is set to NULL, meaning that the option 760 is disabled. 762 The preferred locator can be set by setsockopt(). The shim sub-layer 763 shall verify requested locator before it updating the preferred 764 locator. 766 An application can get the preferred locator by getsockopt(). 768 When the application specifies the socket option to an unconnected 769 socket, an error code EOPNOTSUPP is returned to the application. 771 When there is no shim context associated with the socket, an error 772 code ENOENT is returned to the application. 774 An error EINVALIDLOCATOR is returned when the validation of the 775 requested locator fails. 777 An error EUNREACHABLELOCATOR is returned when the requested locator 778 is determined to be not reachable according to a reachability check. 780 The usage of the option is same as that of SHIM_LOC_LOCAL_PREF. Note 781 that some members of the shim_locator (lc_ifidx and lc_flags) are 782 ignored in the set operation. 784 6.6. SHIM_LOC_LOCAL_RECV 786 The SHIM_LOC_LOCAL_RECV option can be used to request the shim sub- 787 layer to store the destination locator of the received IP packet in 788 an ancillary data object which can be accessed by recvmsg(). This 789 option is effective only when there is a shim context associated with 790 the socket. 792 The data type of the option value is integer. The option value 793 should be binary (0 or 1). By default, the option value is set to 0, 794 meaning that the option is disabled. 796 An application can set the option value by setsockopt(). 798 An application can get the option value by getsockopt(). 800 See Section 7 for the procedure to access locator information stored 801 in the ancillary data objects. 803 When the application specifies the socket option to an unconnected 804 socket, an error code EOPNOTSUPP is returned to the application. 806 When there is no shim context associated with the socket, an error 807 code ENOENT is returned to the application. 809 For example, an application can request the shim sub-layer to store 810 destination locator by using the socket option as follows. 812 int optval; 814 optval = 1; 816 setsockopt(fd, SOL_SHIM, SHIM_LOC_LOCAL_RECV, &optval, 817 sizeof(optval)); 819 For example, an application can get the option value as follows. 821 int optval; 822 int len; 824 len = sizeof(optval); 826 getsockopt(fd, SOL_SHIM, SHIM_LOC_LOCAL_RECV, &optval, &len); 828 6.7. SHIM_LOC_PEER_RECV 830 The SHIM_LOC_PEER_RECV option is used to request the shim sub-layer 831 to store the source locator of the received IP packet in an ancillary 832 data object which can be accessed by recvmsg(). This option is 833 effective only when there is a shim context associated with the 834 socket. 836 The data type of the option value is integer. The option value 837 should be binary (0 or 1). By default, the option value is set to 0, 838 meaning that the option is disabled. 840 The option value can be set by setsockopt(). 842 The option value can be read by getsockopt(). 844 See Section 7 for the procedure to access locator information stored 845 in the ancillary data objects. 847 When the application specifies the socket option to an unconnected 848 socket, an error code EOPNOTSUPP is returned to the application. 850 When there is no shim context associated with the socket, an error 851 code ENOENT is returned to the application. 853 The usage of the option is same as that of SHIM_LOC_LOCAL_RECV 854 option. 856 6.8. SHIM_LOC_LOCAL_SEND 858 The SHIM_LOC_LOCAL_SEND option is used to request the shim sub-layer 859 to use a specific locator as the source locator for the IP packets to 860 be sent from the socket. This option is effective only when there is 861 a shim context associated with the socket. 863 The data type of option value is pointer to shim_locator data 864 structure. 866 An application can set the local locator by setsockopt() providing a 867 locator which is stored in a shim_locator data structure. When a 868 zero-filled locator is specified, pre-existing setting of local 869 locator is inactivated. 871 An application can get the local locator by getsockopt(). 873 When the application specifies the socket option to an unconnected 874 socket, an error code EOPNOTSUPP is returned to the application. 876 When there is no shim context associated with the socket, an error 877 code ENOENT is returned to the application. 879 An error EINVALIDLOCATOR is returned when an invalid locator is 880 specified. 882 For example, an application can request the shim sub-layer to use a 883 specific local locator by using the socket option as follows. 885 struct shim_locator locator; 886 struct in6_addr ia6; 888 /* an IPv6 address preferred for the source locator is copied 889 to the parameter ia6 */ 891 memset(&locator, 0, sizeof(locator)); 893 /* fill shim_locator data structure */ 894 locator.lc_family = AF_INET6; 895 locator.lc_ifidx = 1; 896 locator.lc_flags = 0; 897 locator.lc_prio = 0; 898 locator.lc_weight = 0; 899 memcpy(&locator.lc_addr, &ia6, sizeof(ia6)); 901 setsockopt(fd, SOL_SHIM, SHIM_LOC_LOCAL_SEND, &locator, 902 sizeof(locator)); 904 For example, an application can get the designated local locator by 905 using the socket option as follows: 907 struct shim_locator locator; 909 memset(&locator, 0, sizeof(locator)); 911 getsockopt(fd, SOL_SHIM, SHIM_LOC_LOCAL_SEND, &locator, 912 sizeof(locator)); 914 /* check locator */ 916 6.9. SHIM_LOC_PEER_SEND 918 The SHIM_LOC_PEER_SEND option is used to request the shim sub-layer 919 to use a specific locator for the destination locator of IP packets 920 to be sent from the socket. This option is effective only when there 921 is a shim context associated with the socket. 923 The data type of the option value is a pointer to shim_locator data 924 structure. 926 An application can set the remote locator by setsockopt() providing a 927 locator which is stored in a shim_locator data structure. When a 928 zero-filled locator is specified, pre-existing setting of remote 929 locator is inactivated. 931 An application can get the specified remote locator by getsockopt(). 933 The difference between the SHIM_LOC_PEER_SEND option and the 934 SHIM_LOC_PEER_PREF option is that the former guarantee the use of 935 requested locator when applicable whereas the latter does not. 937 When the application specifies the socket option to an unconnected 938 socket, an error code EOPNOTSUPP is returned to the application. 940 When there is no shim context associated with the socket, an error 941 code ENOENT is returned to the application. 943 An error EINVALIDLOCATOR is returned when the validation of the 944 requested locator fails. 946 An error EUNVERIFIEDLOCATOR is returned when reachability for the 947 requested locator has not been verified yet. 949 An error EUNREACHABLELOCATOR is returned when the requested locator 950 is determined to be not reachable according to a reachability check. 952 The usage of the option is the same as that of SHIM_LOC_LOCAL_SEND 953 option. 955 6.10. SHIM_LOCLIST_LOCAL 957 The SHIM_LOCLIST_LOCAL option is used to get or set the locator list 958 associated with the local EID of the shim context associated with the 959 socket. This option is effective only when there is a shim context 960 associated with the socket. 962 The data type of the option value is a pointer to the buffer in which 963 a locator list is stored. See Section 8 for the data structure for 964 storing the locator information. By default, the option value is set 965 to NULL, meaning that the option is disabled. 967 An application can get the locator list by getsockopt(). Note that 968 the size of the buffer pointed to by the optval argument should be 969 large enough to store an array of locator information. The number of 970 the locator information is not known beforehand. 972 The local locator list can be set by setsockopt(). The buffer 973 pointed to by the optval argument should contain an array of locator 974 structures. 976 When the application specifies the socket option to an unconnected 977 socket, an error code EOPNOTSUPP is returned to the application. 979 When there is no shim context associated with the socket, an error 980 code ENOENT is returned to the application. 982 An error EINVALIDLOCATOR is returned when the validation of any of 983 the specified locators failed. 985 An error ETOOMANYLOCATORS is returned when the number of locators 986 specified exceeds the limit (SHIM_MAX_LOCATORS), or when the size of 987 the buffer provided by the application is not large enough to store 988 the locator list provided by the shim sub-layer. 990 For example, an application can set a list of locators to be 991 associated with the local EID by using the socket option as follows. 992 Note that IPv4 locator can be handled by HIP and not by SHIM6. 994 struct shim_locator locators[SHIM_MAX_LOCATORS]; 995 struct sockaddr_in *sin; 996 struct sockaddr_in6 *sin6; 998 memset(locators, 0, sizeof(locators)); 1000 ... 1002 /* obtain local IP addresses from local interfaces */ 1004 ... 1006 /* first locator (an IPv6 address) */ 1007 locators[0].lc_family = AF_INET6; 1008 locators[0].lc_ifidx = 0; 1009 locators[0].lc_flags = 0; 1010 locators[0].lc_prio = 1; 1011 locators[0].lc_weight = 0; 1012 memcpy(&locators[0].lc_addr, &sa6->sin6_addr, 1013 sizeof(sa6->sin6_addr)); 1015 ... 1017 /* second locator (an IPv4 address) */ 1018 locators[1].lc_family = AF_INET; 1019 locators[1].lc_ifidx = 0; 1020 locators[1].lc_flags = 0; 1021 locators[1].lc_prio = 0; 1022 locators[1].lc_weight = 0; 1023 memcpy(&locators[1].lc_addr, &sa->sin_addr, 1024 sizeof(sa->sin_addr)); 1026 setsockopt(fd, SOL_SHIM, SHIM_LOCLIST_LOCAL, locators, 1027 sizeof(locators)); 1029 For example, an application can get a list of locators that are 1030 associated with the local EID by using the socket option as follows. 1032 struct shim_locator locators[SHIM_MAX_LOCATORS]; 1034 memset(locators, 0, sizeof(locators)); 1036 getsockopt(fd, SOL_SHIM, SHIM_LOC_LOCAL_RECV, locators, 1037 sizeof(locators)); 1039 /* parse locators */ 1040 ... 1042 6.11. SHIM_LOCLIST_PEER 1044 The SHIM_LOCLIST_PEER option is used to get or set the locator list 1045 associated with the peer EID of the shim context associated with the 1046 socket. This option is effective only when there is a shim context 1047 associated with the socket. 1049 The data type of the option value is a pointer to the buffer where a 1050 locator list is stored. See Section 8 for the data structure for 1051 storing the locator information. By default, the option value is set 1052 to NULL, meaning that the option is disabled. 1054 An application can get the locator list by getsockopt(). Note that 1055 the size of the buffer pointed to by the optval argument should be 1056 large enough to store an array of locator information. The number of 1057 the locator information is not known beforehand. 1059 An application can set the locator list by setsockopt(). The buffer 1060 pointed to by the optval argument should contain an array of locator 1061 list. 1063 When the application specifies the socket option to an unconnected 1064 socket, an error code EOPNOTSUPP is returned to the application. 1066 When there is no shim context associated with the socket, an error 1067 code ENOENT is returned to the application. 1069 An error EINVALIDLOCATOR is returned when the validation of any of 1070 the specified locators failed. 1072 An error EUNVERIFIEDLOCATOR is returned when reachability for the 1073 requested locator has not been verified yet. 1075 An error EUNREACHABLELOCATOR is returned when the requested locator 1076 is determined to be not reachable according to a reachability check. 1078 An error ETOOMANYLOCATORS is returned when the number of locators 1079 specified exceeds the limit (SHIM_MAX_LOCATORS), or when the size of 1080 the buffer provided by the application is not large enough to store 1081 the locator list provided by the shim sub-layer. 1083 The usage of the option is same as that of SHIM_LOCLIST_LOCAL. 1085 6.12. SHIM_APP_TIMEOUT 1087 The SHIM_APP_TIMEOUT option is used to get or set the Send Timeout 1088 value of the REAP protocol[RFC5534]. This option is effective only 1089 when there is a shim context associated with the socket. 1091 The data type of the option value is an integer. The value indicates 1092 the period of timeout in seconds to send a REAP Keepalive message 1093 since the last outbound traffic. By default, the option value is set 1094 to 0, meaning that the option is disabled. When the option is 1095 disabled, the REAP mechanism follows its default value of Send 1096 Timeout value as specified in [RFC5534] 1098 When the application specifies the socket option to an unconnected 1099 socket, an error code EOPNOTSUPP is returned to the application. 1101 When there is no shim context associated with the socket, an error 1102 code ENOENT is returned to the application. 1104 When there is no REAP protocol instance on the system, an error code 1105 EOPNOTSUPP is returned to the application. 1107 For example, an application can set the timeout value by using the 1108 socket option as follows. 1110 int optval; 1112 optval = 15; /* 15 seconds */ 1114 setsockopt(fd, SOL_SHIM, SHIM_APP_TIMEOUT, &optval, 1115 sizeof(optval)); 1117 For example, an application can get the timeout value by using the 1118 socket option as follows. 1120 int optval; 1121 int len; 1123 len = sizeof(optval); 1125 getsockopt(fd, SOL_SHIM, SHIM_APP_TIMEOUT, &optval, &len); 1127 6.13. SHIM_PATHEXPLORE 1129 The application may use this socket option to get or set parameters 1130 concerning path exploration. Path exploration is a procedure to find 1131 an alternative locator pair to the current locator pair. As the REAP 1132 specification defines, a peer may send Probe messages to find an 1133 alternative locator pair. 1135 This option is effective only when there is a shim context associated 1136 with the socket. 1138 The data type of the option value is a pointer to the buffer where a 1139 set of information for path exploration is stored. The data 1140 structure is defined in Section 8. 1142 By default, the option value is set to NULL, meaning that the option 1143 is disabled. 1145 When the application specifies the socket option to an unconnected 1146 socket, an error code EOPNOTSUPP is returned to the application. 1148 When there is no shim context associated with the socket, an error 1149 code ENOENT is returned to the application. 1151 For example, an application can set parameters for path exploration 1152 by using the socket option as follows. 1154 struct shim6_pathexplore pe; 1156 pe.pe_probenum = 4; /* times */ 1157 pe.pe_keepaliveto = 10; /* seconds */ 1158 pe.pe_initprobeto = 500; /* milliseconds */ 1159 pe.pe_reserved = 0; 1161 setsockopt(fd, SOL_SHIM, SHIM_PATHEXPLORE, &pe, sizeof(pe)); 1163 For example, an application can get parameters for path exploration 1164 by using the socket option as follows. 1166 struct shim6_pathexplore pe; 1167 int len; 1169 len = sizeof(pe); 1171 getsockopt(fd, SOL_SHIM, SHIM_PATHEXPLORE, &pe, &len); 1173 6.14. SHIM_DEFERRED_CONTEXT_SETUP 1175 The SHIM_DEFERRED_CONTEXT_SETUP option is used to check whether 1176 deferred context setup is possible or not. Deferred context setup 1177 means that the context is established in parallel with the data 1178 communication. Note that SHIM6 supports deferred context setup and 1179 HIP does not because EIDs in HIP (i.e., Host Identifiers) are non- 1180 routable. 1182 The data type for the option value is an integer. The option value 1183 should be binary (0 or 1). The option value 1 means that the shim 1184 sub-layer supports deferred context setup. 1186 When the application specifies the socket option to an unconnected 1187 socket, an error code EOPNOTSUPP is returned to the application. 1189 For example, an application can check whether deferred context setup 1190 is possible or not as follows: 1192 int optval; 1193 int len; 1195 len = sizeof(optval); 1197 getsockopt(fd, SOL_SHIM, SHIM_DEFERRED_CONTEXT_SETUP, 1198 &optval, &len); 1200 6.15. Applicability 1202 All the socket options defined in this section except for the 1203 SHIM_DONTSHIM option are applicable to applications that use 1204 connected sockets. 1206 All the socket options defined in this section except for the 1207 SHIM_ASSOCIATED, SHIM_DONTSHIM and SHIM_CONTEXT_DEFERRED_SETUP 1208 options are effective only when there is a shim context associated 1209 with the socket. 1211 6.16. Error Handling 1213 If successful, getsockopt() and setsockopt() return 0; otherwise, the 1214 functions return -1 and set errno to indicate an error. 1216 The following are new error values defined for some shim specific 1217 socket options indicating that the getsockopt() or setsockopt() 1218 finished incompletely: 1220 EINVALIDLOCATOR 1221 This indicates that the locator is not part of the HBA 1222 set[RFC5535] within the shim context associated with the socket. 1223 EUNVERIFIEDLOCATOR 1224 This indicates that the reachability of the locator has not been 1225 confirmed. This error is applicable to only peer's locator. 1226 EUNREACHABLELOCATOR 1227 This indicates that the locator is not reachable according to the 1228 result of the reachability check. This error is applicable to 1229 only peer's locator. 1231 7. Ancillary Data for Multihoming Shim Sub-layer 1233 This section provides definitions of ancillary data to be used for 1234 locator management and notification from/to the shim sub-layer to/ 1235 from application. 1237 When the application performs locator management by sendmsg() or 1238 recvmsg(), a member of the msghdr structure (given in Figure 3) 1239 called msg_control holds a pointer to the buffer in which one ore 1240 more shim specific ancillary data objects may be stored. An 1241 ancillary data object can store a single locator. It should be 1242 possible to process the shim specific ancillary data object by the 1243 existing macros defined in the Posix standard and [RFC3542]. 1245 struct msghdr { 1246 caddr_t msg_name; /* optional address */ 1247 u_int msg_namelen; /* size of address */ 1248 struct iovec *msg_iov; /* scatter/gather array */ 1249 u_int msg_iovlen; /* # elements in msg_iov */ 1250 caddr_t msg_control; /* ancillary data, see below */ 1251 u_int msg_controllen; /* ancillary data buffer len */ 1252 int msg_flags; /* flags on received message */ 1253 }; 1255 Figure 3: msghdr structure 1257 In the case of unconnected socket, msg_name stores the socket address 1258 of the peer which should be considered to be an identifier rather 1259 than a locator. SHIM_LOC_PEER_RECV should be used to get the locator 1260 of the peer node. 1262 Table 2 is a list of the shim specific ancillary data which can be 1263 used for locator management by recvmsg() or sendmsg(). In any case, 1264 the value of cmsg_level must be set as SOL_SHIM. 1266 +---------------------+-----------+-----------+-----------------+ 1267 | cmsg_type | sendmsg() | recvmsg() | cmsg_data[] | 1268 +---------------------+-----------+-----------+-----------------+ 1269 | SHIM_LOC_LOCAL_RECV | | o | Note 1 | 1270 | SHIM_LOC_PEER_RECV | | o | Note 1 | 1271 | SHIM_LOC_LOCAL_SEND | o | | Note 1 | 1272 | SHIM_LOC_PEER_SEND | o | | Note 1 | 1273 | SHIM_FEEDBACK | o | | shim_feedback{} | 1274 +---------------------+-----------+-----------+-----------------+ 1276 Table 2: Shim specific ancillary data 1278 Note 1: cmsg_data[] within msg_control includes a single 1279 sockaddr_in{} or sockaddr_in6{} and padding if necessary 1281 7.1. Get Locator from Incoming Packet 1283 An application can get locator information from the received IP 1284 packet by specifying the shim specific socket options for the socket. 1285 When SHIM_LOC_LOCAL_RECV and/or SHIM_LOC_PEER_RECV socket options are 1286 set, the application can retrieve local and/or remote locator from 1287 the ancillary data. 1289 When there is no shim context associated with the socket, the shim 1290 sub-layer MUST return zero-filled locator information to the 1291 application. 1293 7.2. Set Locator for Outgoing Packet 1295 An application can specify the locators to be used for transmitting 1296 an IP packet by sendmsg(). When the ancillary data of cmsg_type 1297 SHIM_LOC_LOCAL_SEND and/or SHIM_LOC_PEER_SEND are specified, the 1298 application can explicitly specify the source and/or the destination 1299 locators to be used for the communication over the socket. If the 1300 specified locator pair is verified, the shim sub-layer overrides the 1301 locator(s) of the outgoing IP packet. Note that the effect is 1302 limited to the datagram transmitted by the sendmsg(). 1304 When there is no shim context associated with the socket, an error 1305 code ENOENT is returned to the application. 1307 An error code EINVALIDLOCATOR is returned when validation of the 1308 specified locator fails. 1310 An error EUNVERIFIEDLOCATOR is returned when reachability for the 1311 requested locator has not been verified yet. The application is 1312 recommended to use another destination locator until the reachability 1313 check for the requested locator is done. 1315 An error EUNREACHABLELOCATOR is returned when the requested locator 1316 is determined to be not reachable according to a reachability check. 1317 The application is recommended to use another destination locator 1318 when receiving the error. 1320 7.3. Notification from Application to Multihoming Shim Sub-layer 1322 An application may provide feedback to the shim sub-layer about the 1323 communication status. Such feedback are useful for the shim sub- 1324 layer to monitor the reachability status of the currently used 1325 locator pair in a given shim context. 1327 The notification can be made by sendmsg() specifying a new ancillary 1328 data called SHIM_FEEDBACK. The ancillary data can be handled by 1329 specifying SHIM_FEEDBACK option in cmsg_type. 1331 When there is no shim context associated with the socket, an error 1332 code ENOENT is returned to the application. 1334 See Section 8.3 for details of the data structure to be used. 1336 It is outside the scope of this document how the shim sub-layer would 1337 react when a feedback is provided by an application. 1339 7.4. Applicability 1341 All the ancillary data for the shim sub-layer is applicable to 1342 connected sockets. 1344 Care is needed when the SHIM_LOC_*_RECV socket option is used for 1345 stream-oriented sockets (e.g., TCP sockets) because there is no one- 1346 to-one mapping between a single send or receive operation and the 1347 data (e.g., a TCP segment) being received. In other words, there is 1348 no gurantee that the locator(s) set in the SHIM_LOC_*_RECV ancillary 1349 data is identical to the locator(s) that appear in the IP packets 1350 received. The shim sub-layer SHOULD provide the latest locator 1351 information to the application in response to the SHIM_LOC_*_RECV 1352 socket option. 1354 8. Data Structures 1356 This section gives data structures for the shim sub-layer. These 1357 data structures are either used as a parameter for setsockopt() or 1358 getsockopt() (as mentioned in Section 6) or as a parameter for 1359 ancillary data to be processed by sendmsg() or recvmsg() (as 1360 mentioned in Section 7). 1362 8.1. Placeholder for Locator Information 1364 As defined in Section 6, the SHIM_LOC_*_PREF, SHIM_LOC_*_SEND, and 1365 SHIM_LOCLIST_* socket options need to handle one or more locator 1366 information. Locator information includes not only the locator 1367 itself but also additional information about the locator which is 1368 useful for locator management. A new data structure is defined to 1369 serve as a placeholder for the locator information. 1371 Figure 4 illustrates the data structure called shim_locator which 1372 stores a locator information. 1374 struct shim_locator { 1375 uint8_t lc_family; /* address family */ 1376 uint8_t lc_proto; /* protocol */ 1377 uint16_t lc_port; /* port number */ 1378 uint16_t lc_prio; /* preference value */ 1379 uint16_t lc_weight; /* weight */ 1380 uint32_t lc_ifidx; /* interface index */ 1381 struct in6_addr lc_addr; /* address */ 1382 uint16_t lc_flags; /* flags */ 1383 }; 1385 Figure 4: shim locator structure 1387 lc_family 1388 Address family of the locator (e.g. AF_INET, AF_INET6). It is 1389 required that the parameter contains non-zero value indicating the 1390 exact address family of the locator. 1391 lc_proto 1392 Internet Protocol number for the protocol which is used to handle 1393 locator behind NAT. Typically, this value is set as UDP (17) when 1394 the locator is a UDP encapsulation interface. 1395 lc_port 1396 Port number which is used for handling locator behind NAT. 1397 lc_prio 1398 The priority of the locator. The range is 0-65535. The lowest 1399 priority value means the highest priority. 1400 lc_weight 1401 The weight value indicates a relative weight for locators with the 1402 same priority value. The range is 0-65535. A locator with higher 1403 weight value is prioritized over the other locators with lower 1404 weight values. 1405 lc_ifidx 1406 Interface index of the network interface to which the locator is 1407 assigned. This field is only used in a read (getsockopt()) 1408 operation. 1409 lc_addr 1410 Contains the locator. In the case where a locator whose size is 1411 smaller than 16 bytes, an encoding rule should be provided for 1412 each locator of a given address family. For instance, in case of 1413 AF_INET (IPv4), the locator should be in the format of an IPv4- 1414 mapped IPv6 address as defined in [RFC4291]. 1415 lc_flags 1416 Each bit of the flags represents a specific characteristics of the 1417 locator. Hash Based Address (HBA) is defined as 0x01. 1418 Cryptographically Generated Address (CGA) is defined as 0x02. 1420 8.1.1. Handling Locator behind NAT 1422 Note that the locator information MAY contain a locator behind a 1423 Network Address Translator (NAT). Such a situation may arise when 1424 the host is behind the NAT and uses a local address as a source 1425 locator to communicate with the peer. Note that a NAT traversal 1426 mechanism for HIP is defined, which allows HIP host to tunnel control 1427 and data traffic over UDP[RFC5770]. Note also that the locator 1428 behind NAT is not necessarily an IPv4 address but it can be an IPv6 1429 address. Below is an example where the application sets a UDP 1430 encapsulation interface as a source locator when sending IP packets. 1432 struct shim_locator locator; 1433 struct in6_addr ia6; 1435 /* copy the private IPv4 address to the ia6 as an IPv4-mapped 1436 IPv6 address */ 1438 memset(&locator, 0, sizeof(locator)); 1440 /* fill shim_locator data structure */ 1441 locator.lc_family = AF_INET; 1442 locator.lc_proto = IPPROTO_UDP; 1443 locator.lc_port = 50500; 1444 locator.lc_flags = 0; 1445 locator.lc_prio = 0; 1446 locator.lc_weight = 0; 1447 locator.lc_ifidx = 3; 1449 memcpy(&locator.lc_addr, &ia6, sizeof(ia6)); 1451 setsockopt(fd, SOL_SHIM, SHIM_LOC_LOCAL_SEND, &locator, 1452 sizeof(locator)); 1454 Figure 5: Handling locator behind NAT 1456 8.2. Path Exploration Parameter 1458 As defined in Section 6, SHIM_PATHEXPLORE allows application to set 1459 or read the parameters for path exploration and failure detection. A 1460 new data structure called shim_pathexplore is defined to store the 1461 necessary parameters. Figure 6 illustrates the data structure. The 1462 data structure can be passed to getsockopt() or setsockopt() as an 1463 argument. 1465 struct shim_pathexplore { 1466 uint8_t pe_probenum; /* # of initial probes */ 1467 uint8_t pe_keepaliveto; /* Keepalive Timeout */ 1468 uint16_t pe_initprobeto; /* Initial Probe Timeout */ 1469 uint32_t pe_reserved; /* reserved */ 1470 }; 1472 Figure 6: path explore structure 1474 pe_probenum 1475 Indicates the number of initial probe messages to be sent. 1476 Default value of this parameter should follow what is specified in 1477 [RFC5534]. 1478 pe_keepaliveto 1479 Indicates timeout value for detecting a failure when the host does 1480 not receive any packets for a certain period of time while there 1481 is outbound traffic. When the timer expires, path exploration 1482 procedure will be carried out by sending a REAP Probe message. 1483 Default value of this parameter should follow what is specified in 1484 [RFC5534]. 1485 pe_initprobeto 1486 Indicates retransmission timer of REAP Probe message in 1487 milliseconds. Note that this timer is applied before exponential 1488 back-off is started. A REAP Probe message for the same locator 1489 pair may be retransmitted. Default value of this parameter should 1490 follow what is specified in [RFC5534]. 1491 pe_reserved 1492 A reserved field for future extension. By default, the field 1493 should be initialized to zero. 1495 8.3. Feedback Information 1497 As mentioned in Section 7.3, applications can inform the shim sub- 1498 layer about the status of unicast reachability of the locator pair 1499 currently in use. The feedback information can be handled by using 1500 ancillary data called SHIM_FEEDBACK. A new data structure named 1501 shim_feedback is illustrated in Figure 7. 1503 struct shim_feedback { 1504 uint8_t fb_direction; /* direction of traffic */ 1505 uint8_t fb_indicator; /* indicator (1-3) */ 1506 uint16_t fb_reserved; /* reserved */ 1507 }; 1509 Figure 7: feedback information structure 1511 direction 1512 Indicates direction of reachability between a locator pair in 1513 question. A value 0 indicates outbound and a value 1 indicates 1514 inbound direction. 1515 indicator 1516 A value indicating the degree of satisfaction of a unidirectional 1517 reachability for a given locator pair. 1518 * 0: Default value. Whenever this value is specified the 1519 feedback information must not be processed by the shim sub- 1520 layer. 1521 * 1: Unable to connect. There is no unidirectional reachability 1522 between the locator pair in question. 1523 * 2: Unsatisfactory. The application is not satisfied with the 1524 unidirectional reachability between the locator pair in 1525 question. 1526 * 3: Satisfactory. There is satisfactory unidirectional 1527 reachability between the locator pair in question. 1528 reserved 1529 Reserved field. Must be ignored by the receiver. 1531 9. System Requirements 1533 As addressed in Section 6, most of the socket options and ancillary 1534 data defined in this document are applicable to connected sockets. 1535 It is assumed that the kernel is capable of maintaining the 1536 association between a connected socket and a shim context. This 1537 requirement is considered to be reasonable because a pair of source 1538 and destination IP addresses is bound to a connected socket. 1540 10. Relation to Existing Sockets API Extensions 1542 This section explains relation between the sockets API defined in 1543 this document and the existing sockets API extensions. 1545 As mentioned in Section 6, the basic assumption is that the existing 1546 sockets API continues to work above the shim sub-layer. This means 1547 that, the existing sockets API deals with identifiers, and the 1548 sockets API defined in this document deals with locators. 1550 SHIM_LOC_LOCAL_SEND and SHIM_LOC_PEER_SEND socket options are 1551 semantically similar to the IPV6_PKTINFO socket API in the sense that 1552 both provide a means for application to set the source IP address of 1553 outbound IP packets. 1555 SHIM_LOC_LOCAL_RECV and SHIM_LOC_PEER_RECV socket options are 1556 semantically similar to the IP_RECVDSTADDR and IPV6_PKTINFO socket 1557 APIs in the sense that both provides a means for application to get 1558 the source and/or destination IP address of inbound IP packets. 1560 getsockname() and getpeername() enable application to get 'name' of 1561 the communication endpoints which is represented by a pair of IP 1562 address and port number assigned to the socket. getsockname() gives 1563 IP address and port number assigned to the socket on the local side, 1564 and getpeername() gives IP address and port number of the peer side. 1566 11. Operational Considerations 1568 This section gives operational considerations of the sockets API 1569 defined in this document. 1571 11.1. Conflict Resolution 1573 There may be a conflicting situation when different applications 1574 specify difference preference for the same shim context. For 1575 instance, application A and B may establish communication with the 1576 same EID pair while both applications have different preference in 1577 their choice of local locator. The notion of context forking in 1578 SHIM6 can resolve the conflicting situation. 1580 Socket options defined in Section 6 may cause conflicting situation 1581 when the target context is shared by multiple applications. In such 1582 a case, the socket handler should inform the shim sub-layer that 1583 context forking is required. In SHIM6, when a context is forked, an 1584 unique identifier called Forked Instance Identifier (FII) is assigned 1585 to the newly forked context. The forked context is then exclusively 1586 associated with the socket through which non-default preference value 1587 was specified. The forked context is maintained by the shim sub- 1588 layer during the lifetime of associated socket instance. When the 1589 socket is closed, the shim sub-layer SHOULD delete associated 1590 context. 1592 When the application specifies SHIM_LOC_*_SEND specifying a different 1593 source or destination locator which does not have the highest 1594 priority and weight specified by the SHIM_LOC_*_PREF, the shim sub- 1595 layer SHOULD supersede the request made by SHIM_LOC_*_SEND over the 1596 preference specified by SHIM_LOC_*_PREF. 1598 When the peer provides preferences of the locators (e.g., a SHIM6 1599 peer may send a locator with a Locator Preferences Option) which 1600 conflict with preference specified by the applications either by 1601 SHIM_LOC_PEER_SEND or SHIM_LOC_PEER_PREF, the shim sub-layer SHOULD 1602 supersede the preference made by the application over the preference 1603 specified by the peer. 1605 11.2. Incompatibility between IPv4 and IPv6 1607 The shim sub-layer performs identifier/locator adaptation. 1608 Therefore, in some cases, the whole IP header can be replaced with 1609 new IP header of a different address family (e.g. conversion from 1610 IPv4 to IPv6 or vice versa). Hence, there is an issue how to make 1611 the conversion with minimum impact. Note that this issue is common 1612 in other protocol conversion techniques 1613 [RFC2765][I-D.ietf-behave-v6v4-xlate]. 1615 As studied in the previous works on protocol 1616 conversion[RFC2765][I-D.ietf-behave-v6v4-xlate], some of the features 1617 (IPv6 routing headers, hop-by-hop extension headers, and destination 1618 headers) from IPv6 are not convertible to IPv4. In addition, notion 1619 of source routing is not exactly the same in IPv4 and IPv6. This 1620 means that an error may occur during the conversion of identifier and 1621 locator. It is outside the scope of this document to describe how 1622 the shim sub-layer should behave in such erroneous cases. 1624 12. IANA Considerations 1626 There is no IANA considerations for the socket options (SHIM_*), the 1627 ancillary data, and the socket level (SOL_SHIM) that are defined in 1628 this document. All the numbers concerned are not under the control 1629 of IETF or IANA but they are platform-specific. 1631 13. Protocol Constants and Variables 1633 This section defines protocol constants and variables. 1634 SHIM_MAX_LOCATORS The maximum number of the locators to be included 1635 in a locator list. The value is set to 32. 1637 14. Security Considerations 1639 This section gives security considerations of the API defined in this 1640 document. 1642 14.1. Treatment of Unknown Locator 1644 When sending IP packets, application may request use of unknown 1645 locator for the source and/or destination locators. Note that 1646 treatment of unknown locator can be a subject of security 1647 considerations because use of invalid source and/or destination 1648 locator may cause redirection attack. 1650 14.1.1. Treatment of Unknown Source Locator 1652 The shim sub-layer checks if the requested locator is available on 1653 any of the local interface. If not, the shim sub-layer MUST reject 1654 the request and return an error message with the EINVALIDLOCATOR code 1655 to the application. If the locator is confirmed to be available, the 1656 shim sub-layer SHOULD initiate the procedure to update the locator 1657 list. 1659 Use of the following socket options and ancillary data may require 1660 treatment of unknown source locator: 1661 o SHIM_LOC_LOCAL_SEND 1662 o SHIM_LOC_LOCAL_PREF 1663 o SHIM_LOCLIST_LOCAL 1665 14.1.2. Treatment of Unknown Destination Locator 1667 If the shim sub-layer turns out to be SHIM6, the SHIM6 layer MUST 1668 reject the request for using an unknown destination locator. 1670 If the shim sub-layer turns out to be HIP, the HIP layer MUST reject 1671 the request for using an unknown destination locator. There is, 1672 however, an exceptional case where the HIP layer SHOULD accept the 1673 request provided that the HIP association is in an UNASSOCIATED 1674 state. Details of locator handling in HIP is described in section 1675 4.6 of [I-D.ietf-hip-native-api]. 1677 Use of the following socket options and ancillary data may require 1678 treatment of unknown destination locator: 1679 o SHIM_LOC_PEER_SEND 1680 o SHIM_LOC_PEER_PREF 1681 o SHIM_LOCLIST_PEER 1683 15. Changes 1685 15.1. Changes from version 00 to version 01 1687 o Define shim_locator{} data type which is a placeholder for 1688 locator. 1689 o Define shim_pathexplore{} data type in which a set of REAP 1690 parameters are stored. 1691 o Remove descriptions about "stickiness" of socket options. 1692 o Deprecate SHIM_IF_RECV and SHIM_IF_SEND socket options. 1693 o Give default value and how to disable given socket option. 1695 15.2. Changes from version 01 to version 02 1697 o Add section describing context forking. 1698 o Rephrase conclusion section. 1699 o Separate normative references from informative references. 1700 o Remove texts from discussion section that are not relevant to the 1701 contents of the document. 1702 o Add section describing change history (this section). 1704 15.3. Changes from version 02 to version 03 1706 o Add an Appendix section describing the issue of context forking. 1708 15.4. Changes from version 03 to version 04 1710 o Updated reference. 1711 o Correct typo and grammatical errors. 1713 15.5. Changes from version 04 to version 05 1715 o Added definition of SHIM_FEEDBACK ancillary data. 1716 o Added an example of code using the SHIM_LOCLIST_LOCAL 1717 o Added SHIM_LOC_LOCAL_SEND and SHIM_LOC_PEER_SEND socket options. 1719 15.6. Changes from version 05 to version 06 1721 o Updated references. 1723 15.7. Changes from version 06 to version 07 1725 o Resolved editorial issues. 1727 15.8. Changes from version 07 to version 08 1729 No changes are made except for updates of the references. 1731 15.9. Changes from version 08 to version 09 1733 o Updated texts for Section 1 and Section 5 according to the 1734 comments provided by Samu Varjonen. 1735 o Made it clear that downgrading the multihoming shim support (i.e., 1736 specifying value 1 with the SHIM_DONTSHIM socket option) is only 1737 allowed before the socket is connected. 1738 o Updated locator information (shim_locator{}) so that it can 1739 contain a locator behind NAT. 1741 15.10. Changes from version 09 to version 10 1743 o Addressed applicability of socket options and ancillary data for 1744 the shim sub-layer. 1745 o Addressed system requirements. 1746 o Removed unnecessary description about deprecated socket option 1747 (SHIM_IF_RECV). 1749 15.11. Changes from version 10 to version 11 1751 o Added short descriptions about connected sockets and unconnected 1752 sockets. 1753 o Relaxed applicability of the socket options. 1754 o Relaxed applicability of the ancillary data. 1755 o Added notification about locator change. 1757 15.12. Changes from version 11 to version 12 1759 o Reflected comments from Brian Karpenter. 1760 o Reflected comments from Michael Scharf. 1762 15.13. Changes from version 12 to version 13 1764 o Reflected comments from Sebastien Barre. 1765 o Removed the description about the notification from the shim sub- 1766 layer to applications. 1767 o Narrowed down the scope of the applicability of the socket options 1768 and the ancillary data. 1770 15.14. Changes from version 13 to version 14 1772 o No change was made. The draft was re-submitted to avoid 1773 expiration. 1775 15.15. Changes from version 14 to version 15 1777 o Addressed the difference between SHIM_LOC_PEER_SEND and 1778 SHIM_LOC_PEER_PREF. 1779 o Made clear distinction between validation of locator and 1780 verification of locator, and introduced two errors: 1781 EUNVERIFIEDLOCATOR and EUNREACHABLELOCATOR. 1782 o Addressed exceptional case for HIP in handling of unknown 1783 destination locator. 1785 16. Acknowledgments 1787 Authors would like to thank Jari Arkko who participated in the 1788 discussion that lead to the first version of this document, and 1789 Tatuya Jinmei who thoroughly reviewed the early version of this draft 1790 and provided detailed comments on sockets API related issues. Thomas 1791 Henderson provided valuable comments especially from HIP 1792 perspectives. 1794 Authors sincerely thank to the following people for their helpful 1795 comments to the document: Samu Varjonen, Dmitriy Kuptsov, Brian 1796 Carpenter, Michael Scharf, and Sebastien Barre 1798 17. References 1800 17.1. Normative References 1802 [POSIX] "IEEE Std. 1003.1-2001 Standard for Information Technology 1803 -- Portable Operating System Interface (POSIX). Open group 1804 Technical Standard: Base Specifications, Issue 6, 1805 http://www.opengroup.org/austin", December 2001. 1807 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1808 Requirement Levels", BCP 14, RFC 2119, March 1997. 1810 [RFC3542] Stevens, W., Thomas, M., Nordmark, E., and T. Jinmei, 1811 "Advanced Sockets Application Program Interface (API) for 1812 IPv6", RFC 3542, May 2003. 1814 [RFC4423] Moskowitz, R. and P. Nikander, "Host Identity Protocol 1815 (HIP) Architecture", RFC 4423, May 2006. 1817 [RFC5533] Nordmark, E. and M. Bagnulo, "Shim6: Level 3 Multihoming 1818 Shim Protocol for IPv6", RFC 5533, June 2009. 1820 [RFC5534] Arkko, J. and I. van Beijnum, "Failure Detection and 1821 Locator Pair Exploration Protocol for IPv6 Multihoming", 1822 RFC 5534, June 2009. 1824 17.2. Informative References 1826 [I-D.ietf-behave-v6v4-xlate] 1827 Li, X., Bao, C., and F. Baker, "IP/ICMP Translation 1828 Algorithm", draft-ietf-behave-v6v4-xlate-23 (work in 1829 progress), September 2010. 1831 [I-D.ietf-hip-native-api] 1832 Komu, M. and T. Henderson, "Basic Socket Interface 1833 Extensions for Host Identity Protocol (HIP)", 1834 draft-ietf-hip-native-api-12 (work in progress), 1835 January 2010. 1837 [I-D.ietf-shim6-app-refer] 1838 Nordmark, E., "Shim6 Application Referral Issues", 1839 draft-ietf-shim6-app-refer-00 (work in progress), 1840 July 2005. 1842 [RFC2765] Nordmark, E., "Stateless IP/ICMP Translation Algorithm 1843 (SIIT)", RFC 2765, February 2000. 1845 [RFC2782] Gulbrandsen, A., Vixie, P., and L. Esibov, "A DNS RR for 1846 specifying the location of services (DNS SRV)", RFC 2782, 1847 February 2000. 1849 [RFC4291] Hinden, R. and S. Deering, "IP Version 6 Addressing 1850 Architecture", RFC 4291, February 2006. 1852 [RFC5535] Bagnulo, M., "Hash-Based Addresses (HBA)", RFC 5535, 1853 June 2009. 1855 [RFC5770] Komu, M., Henderson, T., Tschofenig, H., Melen, J., and A. 1856 Keranen, "Basic Host Identity Protocol (HIP) Extensions 1857 for Traversal of Network Address Translators", RFC 5770, 1858 April 2010. 1860 Appendix A. Context Forking 1862 In this section, an issue concerning context forking and its relation 1863 to the multihoming shim API are discussed. 1865 SHIM6 supports a notion of context forking. A peer may decide to 1866 fork a context for certain reason (e.g. upper layer protocol prefers 1867 to use different locator pair than the one defined in available 1868 context). The procedure of forking context is done similar to the 1869 normal context establishment, performing the 4-way message exchange. 1870 A peer who has decided to fork a context initiates the context 1871 establishment. Hereafter, we call this peer the "initiator". The 1872 peer of the initiator is called the "responder". 1874 Once the forked context is established between the peers, on the 1875 initiator side, it is possible to apply forked context to the packet 1876 flow since the system maintains an association between the forked 1877 context and the socket owned by the application that has requested 1878 the context forking. How this association is maintained is an 1879 implementation specific issue. However, on the responder side, there 1880 is a question how the outbound packet can be multiplexed by the shim 1881 sub-layer because there are more than one SHIM6 contexts that match 1882 with the ULID pair of the packet flow. There is a need to 1883 differentiate packet flows not only by the ULID pairs but by some 1884 other information and associate a given packet flow with a specific 1885 context. 1887 Figure 8 gives an example of a scenario where two communicating peers 1888 fork a context. Initially, there has been a single transaction 1889 between the peers, by the application 1 (App1). Accordingly, another 1890 transaction is started, by application 2 (App2). Both of the 1891 transactions are made based on the same ULID pair. The first context 1892 pair (Ctx1) is established for the transaction of App1. Given the 1893 requests from App2, the shim sub-layer on Peer 1 decides to fork a 1894 context. Accordingly, a forked context (Ctx2) is established between 1895 the peers, which should be exclusively applied to the transaction of 1896 App2. Ideally, multiplexing and demultiplexing of packet flows that 1897 relate to App1 and App2 should be done as illustrated in Figure 8. 1898 However, as mentioned earlier, the responder needs to multiplex 1899 outbound flows of App1 and App2 somehow. Note that if a context 1900 forking occurs on the initiator side, a context forking needs to 1901 occur also on the responder side. 1903 Peer 1 Peer 2 1904 (initiator) (responder) 1906 +----+ +----+ +----+ +----+ 1907 |App1| |App2| |App1| |App2| 1908 +----+ +----+ +----+ +----+ 1909 |^ |^ ^| ^| 1910 v| v| |v |v 1911 -----S1-------------S2----- -----S1-------------S2----- 1912 || || || || 1913 || || || || 1915 Ctx1 Ctx2 Ctx1 Ctx2 1916 ULID: ULID: ULID: ULID: 1917 Loc: Loc: Loc: Loc: 1918 FII: 0 FII: 100 FII: 0 FII: 100 1920 |^ |^ ^| ^| 1921 || || || || 1922 || || || || 1923 \..............||....................../| || 1924 \.............||......................./ || 1925 || || 1926 \|...................................../| 1927 \....................................../ 1929 Figure 8: context forking 1931 Any solution is needed to overcome the problem mentioned above. 1933 Authors' Addresses 1935 Miika Komu 1936 Helsinki Institute for Information Technology 1937 Tammasaarenkatu 3 1938 Helsinki 1939 Finland 1941 Phone: +358503841531 1942 Fax: +35896949768 1943 Email: miika@iki.fi 1944 URI: http://www.hiit.fi/ 1946 Marcelo Bagnulo 1947 Universidad Carlos III de Madrid 1948 Av. Universidad 30 1949 Leganes 28911 1950 SPAIN 1952 Phone: +34 91 6248837 1953 Email: marcelo@it.uc3m.es 1954 URI: http://it.uc3m.es/marcelo 1956 Kristian Slavov 1957 Ericsson Research Nomadiclab 1958 Hirsalantie 11 1959 Jorvas FI-02420 1960 Finland 1962 Phone: +358 9 299 3286 1963 Email: kristian.slavov@ericsson.com 1965 Shinta Sugimoto (editor) 1966 Nippon Ericsson K.K. 1967 Koraku Mori Building 1968 1-4-14, Koraku, Bunkyo-ku 1969 Tokyo 112-0004 1970 Japan 1972 Phone: +81 3 3830 2241 1973 Email: shinta@sfc.wide.ad.jp