One document matched: draft-ietf-shim6-multihome-shim-api-05.xml


<?xml version="1.0"?>
<?xml-stylesheet type='text/xsl' href='ref2629.xslt' ?>

<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<rfc category="info" docName="draft-ietf-shim6-multihome-shim-api-05"
     ipr="full3978">
  <?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?> <?rfc
  toc="yes" ?> <?rfc symrefs="yes" ?> <?rfc sortrefs="yes" ?> <?rfc
  iprnotified="no" ?> <?rfc strict="yes" ?>
  <?rfc compact="yes"?>
  <front>
    <title abbrev="Multihoming Shim API">Socket Application Program
    Interface (API) for Multihoming Shim</title>
    
    <author initials='M' surname='Komu' fullname='Miika Komu'>
      <organization abbrev="HIIT">Helsinki Institute for Information
      Technology</organization>
      <address>
	<postal>
	  <street>Tammasaarenkatu 3</street>
	  <city>Helsinki</city>
	  <country>Finland</country>
	</postal>
	<phone>+358503841531</phone>
	<facsimile>+35896949768</facsimile>
	<email>miika@iki.fi</email>
	<uri>http://www.hiit.fi/</uri>
      </address>
    </author>
    
    <author initials='M' surname='Bagnulo' fullname='Marcelo Bagnulo'>
      <organization abbrev="UC3M">Universidad Carlos III de
      Madrid</organization>
      <address>
	<postal>
	  <street>Av. Universidad 30</street>
	  <city>Leganes</city>
	  <code>28911</code>
	  <country>SPAIN</country>
	</postal>
	<phone>+34 91 6248837</phone>
	<email>marcelo@it.uc3m.es</email>
	<uri>http://it.uc3m.es/marcelo</uri>
      </address>
    </author>

    <author initials='K' surname='Slavov' fullname='Kristian Slavov'>
      <organization abbrev="Ericsson">Ericsson Research
      Nomadiclab</organization>
      <address>
	<postal>
	  <street>Hirsalantie 11</street>
	  <city>Jorvas</city>
	  <code>FI-02420</code>
	  <country>Finland</country>
	</postal>
	<phone>+358 9 299 3286</phone>
	<email>kristian.slavov@ericsson.com</email>
      </address>
    </author>

    <author initials='S' surname='Sugimoto' fullname='Shinta Sugimoto'
	    role="editor">
      <organization abbrev="Ericsson"> Nippon Ericsson K.K.</organization>
      <address>
	<postal>
	  <street>Koraku Mori Building</street>
	  <street>1-4-14, Koraku, Bunkyo-ku</street>
	  <city>Tokyo</city>
	  <code>112-0004</code>
	  <country>Japan</country>
	</postal>
	<phone>+81 3 3830 2241</phone>
	<email>shinta.sugimoto@ericsson.com</email>
      </address>
    </author>
    
    <date month="February" day="23" year="2008"/>
    <area>Internet</area>
    <workgroup>SHIM6 Working Group</workgroup>
    <keyword>SHIM6, HIP, identifier/locator split</keyword>
    <abstract>
      
      <t>This document specifies a socket API for the multihoming shim
      layer.  The API aims to enable interactions between the
      applications and the multihoming shim layer for advanced locator
      management and access to information about failure detection and
      path exploration.</t>

      <t>This document is based on an assumption that a multihomed host
      is equipped with a conceptual sublayer (here after "shim")
      inside the IP layer that maintains mappings between identifiers
      and locators.  Examples of the shim are SHIM6 and HIP.</t>

    </abstract>
  </front>
  <middle>
    <!--
	================================================================
	Introduction
	================================================================
    -->
    <section title="Introduction" toc="include">      

      <t>HIP and SHIM6 have a commonality in their protocol design
      separation of identifier and locator (hereafter
      identifier/locator separation).  Both protocols aim to solve
      problems that are specific to multihoming environment in a host
      centric approach.  In these protocols, a sub-layer within the IP
      layer maintains mappings of identifiers and locators.</t>

      <t>The shim layer is useful in a sense that the IP layer can
      maintain the mapping of an identifier to corresponding locators.
      Under a multihomed environment, typically, a host has more than
      one IP address at a time.  During a given transaction, a host
      may be required to switch the IP address used for the
      communication to another IP address to preserve the
      communication.  The protocol stack should take care of isolating the upper layer
      from disruption by the address update.  The shim layer can make this
      locator update transparent to the upper layer protocols.</t>

      <t>In a system which is based on identifier/locator separation,
      upper layer protocols are expected to deal with identifiers for
      establishing and handling the communications.  If an application
      wants to have a multihoming support by the shim layer, the IP
      addresses specified as source and destination addresses must be
      identifiers.  However, this does not necessarily mean that
      applications are prohibited to choose specific locators in its
      communication.  It may be useful for applications, in some
      situation, to specify a preferred locator for the flow.</t>

      <t>This document recommends that the identifier/locator
      adaptation is done only once inside the network stack of a host.
      That is, if multiple shim sublayers exist at the IP layer, any
      one of them should be applied exclusively for a given flow.</t>

      <t>As this document specifies socket API, it is written so that
      the contents are in line with Posix standard <xref
      target="POSIX"/> as much as possible.  The API specified in this
      document defines how to use ancillary data (aka cmsg) to access
      locator information with recvmsg() and/or sendmsg() I/O calls.
      Definition of API is presented in C language and data types
      follow Posix format; intN_t means a singed integer of exactly N
      bits (e.g. int16_t) and uintN_t means an unsigned integer of
      exactly N bits (e.g. uint32_t).</t>

      <t>The target readers of this document are application
      programmers who develop application software which may benefit
      greatly from multihomed environment.  In addition, this document
      should be of interest for the developers of a given shim
      protocol, as the shim layer should provide the interface to the
      application.</t>

    </section>

    <!--
	================================================================
	Terminology
	================================================================
    -->
    <section title="Terminology" toc="include">

      <t>This section provides terminology used in this document.
      Basically most of the terms used in this document are taken from
      the following documents:<vspace blankLines="1"/>

      <list style="symbols">
	<t>SHIM6 Protocol Specification<xref
	target="I-D.ietf-shim6-proto"/></t>
	<t>HIP Architecture<xref target="RFC4423"/></t>
	<t>Reachability Protocol (REAP)<xref
	target="I-D.ietf-shim6-failure-detection"/></t>
      </list>
      <vspace blankLines="1"/>

      In this document, the term "IP" refers to both IPv4 and IPv6,
      unless the protocol version is specifically mentioned.  The
      followings are definitions of the terms that are frequently used
      in this document:<vspace blankLines="1"/>
 
      <list style="symbols">

	<t>Endpoint Identifier (EID) - An identifier used by the
	application to specify the endpoint of a given communication.
	Applications may handle EID in various ways such as
	long-lived connections, callbacks, and referrals<xref
	target="I-D.ietf-shim6-app-refer"/>.

	<list style="symbols">
	  <t>In the case of SHIM6, an identifier called an ULID serves
	  as an EID.  An ULID is chosen from locators available on the
	  host.</t>
	  <t>In the case of HIP, an identifier which specifies
	  communication endpoints is derived from the public key of
	  the host, which is called a Host Identifier.  For the sake
	  of backward compatibility of the socket API, the Host
	  Identifier is represented in a form of hash of public key.
	  </t>
	</list>
	</t>

	<t>Locator - An IP address actually used to deliver IP
	packets.  Locators should be present in the source and
	destination fields of the IP header of a packet on the wire.
	<list style="symbols">
	  <t>List of Locators - A list of locators associated with an
	  EID.  There are two lists of locators stored in a given
	  context, one is associated with the local EID and the other
	  is associated with the remote EID.  As defined in <xref
	  target="I-D.ietf-shim6-proto"/>, the list of locators
	  associated with an EID 'A' can be denoted as Ls(A).</t>
	  <t>Preferred Locator - The (source/destination) locator
	  currently used to send packets within a given context.  As
	  defined in <xref target="I-D.ietf-shim6-proto"/>, the
	  preferred locator of a host 'A' is denoted as Lp(A).</t>
	</list>
	</t>

	<t>Shim - A conceptual (sub-)layer inside the IP Layer which
	maintains mappings of EIDs and locators.  An EID can be
	associated with more than one locators at a time when the host
	is multihomed.  The term 'shim' does not refer to a specific
	protocol but refers to the conceptual sublayer inside the IP
	layer.</t>

	<t>identifier/locator adaptation - An adaptation performed at
	the shim layer between EIDs and locators within a given
	context.  The adaptation may end up re-writing the source and
	destination addresses of the IP packet.  In the outbound
	packet processing, the EID pair is converted to the associated
	locator pair, while the locator pair is converted to the EID
	pair in the inbound packet processing.</t>

	<t>Context - State information shared by a given pair of
	peers, which stores a binding between the EIDs and associated
	locators.  The context is maintained at the shim layer.</t>

	<t>Reachability Detection - A procedure to check reachability
	between a given locator pair.</t>

	<t>Path - A sequence of routers that an IP packet goes through
	to reach the destination.</t>

	<t>Path Exploration - A procedure to explore available paths
	for a given set of locator pairs.</t>

	<t>Outage - An incident that prevents IP packets to flow from
	the source locator to the destination locator.  When there is
	an outage, it means that there is no reachability between a
	given locator pair.  The outage can be caused by various
	reasons, such as shortage of network resources, congestion,
	and human error (faulty operation).</t>

	<t>Working Address Pair - An address pair is said to be
	working if the packet containing the first address from the
	pair as source address and the second address from the pair as
	destination address can safely travel from the source to the
	destination.  If the reachability is confirmed in both
	directions, the address pairs is said to be bi-directional.
	Otherwise, it's unidirectional.</t>

	<t>Reachability Protocol (REAP) - A protocol for detecting
	failure and exploring reachability in a multihomed
	environment.  REAP is defined in <xref
	target="I-D.ietf-shim6-failure-detection"/>.</t>

      </list>
      </t>
    </section>
    <!--
	================================================================
	System Overview
	================================================================
    -->
    <section title="System Overview" anchor="sec-system-overview"
	     toc="include">
      
      <t><xref target="fig-system-overview"/> illustrates the system
      overview.  The shim layer and REAP component exist inside the IP
      layer.  Applications can use the socket API defined in this
      document to interface the shim layer and transport layer for
      locator management and failure detection and path
      exploration.</t>

      <t>It is also possible that the shim layer interacts with
      transport layers, but the interactions are outside the scope of
      this document.</t>
      
      <figure anchor="fig-system-overview" title="System overview">
	<artwork><![CDATA[

                     +------------------------+
                     |       Application      |
                     +------------------------+
                        ^                 ^ 
           ~~~~~~~~~~~~~|~Socket Interface|~~~~~~~~~~~~~~
                        |                 v
            +-----------|------------------------------+
            |           |  Transport Layer             |
            +-----------|------------------------------+
                  ^     |
    +-------------|-----|-------------------------------------+
    |             v     v                                     |
    |   +-----------------------------+       +----------+    |  IP 
    |   |            Shim             |<----->|   REAP   |    | Layer
    |   +-----------------------------+       +----------+    |
    |                       ^                      ^          |
    +-----------------------|----------------------|----------+
                            v                      v
            +------------------------------------------+
            |                Link Layer                |
            +------------------------------------------+ 

	    ]]></artwork>
      </figure>
      

    </section>
    <!--
	================================================================
	Requirements
	================================================================
    -->
    <section title="Requirements" anchor="sec-requirements" toc="include">
      
      <t>The following is the list of requirements from the
      application perspective:
      <!-- 
	   <t>These requirements are mainly identified during the
	   discussions on SHIM6 WG mailing list.  Some requirements
	   are derived from the REAP specification<xref
	   target="I-D.ietf-shim6-failure-detection"/>.<vspace
	   blankLines="1"/>
      -->
      <!--
	  Marcelo's email which was sent on the SHIM6 mailing list:
	  http://www.ops.ietf.org/lists/shim6/msg01191.html
      -->
      
      <list style="symbols">

	<t>Locator management.  The shim layer selects a pair of
	locators for sending IP packets within a given context.  The
	selection is made by taking miscellaneous conditions into
	account such as reachability of the path, application's
	preference, and characteristics of path.  From the
	application's perspective:

	<list style="symbols">
	  <t>It should be possible to obtain the lists of locators of
	  a given context: Ls(local) and Ls(remote).</t>
	  <t>It should be possible to obtain the preferred locators of
	  a given context: Lp(local) and Lp(remote).</t>
	</list>
	</t>

	<t>Notification from the application to the shim layer about
	the status of the communication.  Note that the notification
	is made in an event based manner.  There are mainly two
	aspects of the feedback that application or upper layer
	protocol may provide for the shim layer, positive and negative
	feedbacks [NOTE: These feedbacks are mentioned in <xref
	target="I-D.ietf-shim6-failure-detection"/>]:
	
	<list style="symbols">
	  <t>Positive feedback could be given by the application or
	  upper layer protocol (e.g. TCP) to the shim layer informing
	  that the communication is going well.</t>

	  <t>Negative feedback could be given by the application or
	  upper layer protocol (e.g. TCP) to the shim layer informing
	  that the communication status is not satisfactory.  TCP
	  could detect a problem when it does not receive expected ACK
	  from the peer.  ICMP error messages delivered to the upper
	  layer protocol could be a clue for application to detect
	  potential problems.  REAP module may be triggered by these
	  negative feedbacks and invoke procedure of path
	  exploration.</t>
	</list>
	</t>

	<t>Feedback from application to shim layer.  The application
	should be able to inform the shim layer of the timeout values
	for detecting failures, for sending keepalives, for starting
	the exploration procedure.  In particular, the application
	should be able to suppress the keepalives.
	</t>

	<t>Hot-standby.  The application may request the shim layer
	for hot-standby capabilities.  In this case, alternative paths
	are known to be working before a failure is detected.  Hence
	it is possible for the host to immediately replace the current
	locator pair with an alternative locator pair.  Hot-standby
	may allow applications to achieve better failover.
	</t>

	<t>Eagerness of locator exploration.  The application should
	be able to inform the shim layer how aggressive it wants REAP
	mechanism to perform path exploration (e.g. specifying the
	number of concurrent attempts of discovering working locator
	pair) when an outage occurs on the path between the currently
	selected locator pair.</t>
	
	<t>Providing locator information to application.  The
	application should be able to obtain information about the
	locator pair which was actually used to send or receive the
	packet.
	<list style="symbols">
	  <t>For inbound traffic, the application may be interested in
	  the locator pair which was actually used to receive the
	  packet.
	  </t>
	  <t>For outbound traffic, the application may be interested
	  in the locator pair which was actually used to transmit the
	  packet.</t>
	</list>
	In this way, the application may have additional control on
	the locator management.  For example, the application can
	verify if its preference of locator is actually applied to the
	flow or not.
	</t>

	<t>The application should be able to specify if it wants to
	defer the context setup or if it wants context establishment
	to be started immediately in case there is no available
	context.  With deferred context setup, there should be no
	additional delay imposed by context establishment in
	initiation of communication.</t>

	<!-- turn on/off shim -->
	<t>Turn on/off shim.  The application should be able to
	request to turn on/off the multihoming support by the shim
	layer:
	<list style="symbols">
	  <t>Apply shim.  The application should be able to explicitly
	  request the shim layer to apply multihoming support.</t>

	  <t>Don't apply shim.  The application should be able to
	  request the shim layer not to apply the multihoming support
	  but to apply normal IP processing at the IP layer.</t>
	</list>
	</t>

	<t>The application should be able to know if the communication
	is now served by the shim layer or not.</t>

	<t>The application should be able to access locator
	information regardless of its address family.  In other words,
	no matter whether the target locator is IPv4 or IPv6, the
	application should be able to use common interface to access
	the locator information.</t>

      </list>	
    </t>

    </section>

    <!--
	===================================================================
	Socket options for multihomed shim layer
	===================================================================
    -->
    <section title="Socket Options for Multihoming Shim Layer"
	     anchor="sec-shim-socket-options" toc="include">

      <t>In this section, socket options that are specific to multihomed
      shim are defined.</t>

      <t><xref target="tab-shim-socket-options"/> provides a list of
      the socket options that are specific to multihoming shim layer.
      These socket options can be used by either getsockopt() or
      setsockopt() system call for a given socket.  All of these
      socket options are defined at level SOL_SHIM.</t>

      <t>The first column of <xref target="tab-shim-socket-options"/>
      gives the name of the option.  The second and third columns
      indicate whether the option can be handled by getsockopt()
      and/or setsockopt(), respectively.  The fourth column provides a
      brief description of the socket option.  The fifth column shows
      the type of data structure specified along with the socket
      option.  By default, the data structure type is an integer.</t>

      <texttable anchor="tab-shim-socket-options"
		 title="Socket options for multihoming shim">
 
	<ttcol align='left'>optname</ttcol>
	<ttcol align='left'>get</ttcol>
	<ttcol align='left'>set</ttcol>
	<ttcol align='left'>description</ttcol>
	<ttcol align='left'>dtype</ttcol>

	<c>SHIM_ASSOCIATED</c>
	<c>o</c>
	<c></c>
	<c>Check if the socket is associated with any shim context or
	not.</c>
	<c>int</c>

	<c>SHIM_DONTSHIM</c>
	<c>o</c>
	<c>o</c>
	<c>Request the shim layer not to apply any multihoming support
	for the communication.</c>
	<c>int</c>

	<c>SHIM_HOT_STANDBY</c>
	<c>o</c>
	<c>o</c>
	<c>Request the shim layer to prepare a hot-standby connection
	(in addition to the current path).</c>
	<c>int</c>

	<c>SHIM_LOC_LOCAL_PREF</c>
	<c>o</c>
	<c>o</c>
	<c>Get or set the preferred locator on the local side for the
	context associated with the socket.</c>
	<c>*1</c>

	<c>SHIM_LOC_PEER_PREF</c>
	<c>o</c>
	<c>o</c>
	<c>Get or set the preferred locator on the remote side for the
	context associated with the socket.</c>
	<c>*1</c>

	<c>SHIM_LOC_LOCAL_RECV</c>
	<c>o</c>
	<c>o</c>
	<c>Request for the destination locator of the received IP
	packet.</c>
	<c>int</c>

	<c>SHIM_LOC_PEER_RECV</c>
	<c>o</c>
	<c>o</c>
	<c>Request for the source locator of the received IP
	packet.</c>
	<c>int</c>

	<c>SHIM_LOC_LOCAL_SEND</c>
	<c>o</c>
	<c>o</c>
	<c>Request use of specific locator as source locator of
	outgoing IP packets.</c>
	<c>*2</c>

	<c>SHIM_LOC_PEER_SEND</c>
	<c>o</c>
	<c>o</c>
	<c>Request use of specific locator as destination locator of
	outgoing IP packets.</c>
	<c>*2</c>

	<c>SHIM_LOCLIST_LOCAL</c>
	<c>o</c>
	<c>o</c>
	<c>Get or set a list of locators associated with the local
	EID.</c>
	<c>*3</c>
	
	<c>SHIM_LOCLIST_PEER</c>
	<c>o</c>
	<c>o</c>
	<c>Get or set a list of locators associated with the peer's
	EID.</c>
	<c>*3</c>
	
	<c>SHIM_APP_TIMEOUT</c>
	<c>o</c>
	<c>o</c>
	<c>Inform the shim layer of a timeout value for detecting
	failure.</c>
	<c>int</c>

	<c>SHIM_PATHEXPLORE</c>
	<c>o</c>
	<c>o</c>
	<!-- marcelo: not sure what this means... is the number of
	     alternative paths to be explored, how many times each
	     path will be tried i.e. how many probe packets per
	     alternative path are to be send? -->
	<c>Specify behavior of path exploration and failure
	detection.</c>
	<c>*4</c>

	<c>SHIM_CONTEXT_DEFERRED_SETUP</c>
	<c>o</c>
	<c>o</c>
	<c>Specify if the context setup can be deferred or not.</c>
	<c>int</c>

      </texttable>
      
      <t>*1: Pointer to a shim_locator which is defined in <xref
      target="sec-data-structures"/>.</t>

      <t>*2: Pointer to shim_locator data structure.</t>

      <t>*3: Pointer to an array of shim_locator.</t>

      <t>*4: Pointer to a shim_pathexplore which is defined in <xref
      target="sec-data-structures"/>.</t>

      <t><xref target="fig-socket-api-model"/> illustrates how the
      shim specific socket options fit into the system model of socket
      API.  In the figure, it can be seen that the shim layer and the
      additional protocol components (IPv4 and IPv6) below the shim
      layer are new to the system model.  As previously mentioned, all
      the shim specific socket options are defined at SOL_SHIM level.
      This design choice brings the following advantages:<vspace
      blankLines="1"/>

      <list style="numbers">
	<t>It is assured that the existing socket API continue to work
	at the layer above the shim layer.  That is, those legacy API
	deal with 'identifier' aspect of the IP addresses.</t>
	<t>With newly defined socket options for the shim layer, the
	application obtains additional control on locator
	management.</t>
	<t>The shim specific socket options are not specific to any
	address family (IPPROTO_IP or IPPROTO_IPV6) or any transport
	protocol (IPPROTO_TCP or IPPROTO_UDP).</t>
      </list>

      </t>

      <figure anchor="fig-socket-api-model"
	      title="System model of socket API with shim layer">
	<artwork><![CDATA[
	
                         s1 s2      s3 s4
                          |  |       |  |
         +----------------|--|-------|--|----------------+
         |             +-------+   +-------+             |
         | IPPROTO_TCP |  TCP  |   |  UDP  |             |
         |             +-------+   +-------+             |
         |                |   \     /   |                |
         |                |    -----    |                | 
         |                |   /     \   |                |
         |              +------+   +------+              |
         |   IPPROTO_IP | IPv4 |   | IPv6 | IPPROTO_IPV6 |
         |              +------+   +------+              |
         |                  \         /             SOL_SOCKET
         |          +--------\-------/--------+          |
         | SOL_SHIM |          shim           |          |
         |          +--------/-------\--------+          |
         |                  /         \                  |
         |              +------+   +------+              |
         |              | IPv4 |   | IPv6 |              |
         |              +------+   +------+              |
         |                  |          |                 |
         +------------------|----------|-----------------+
                            |          |
                          IPv4       IPv6
                        Datagram   Datagram

	 ]]></artwork>
      </figure>

      <section title="SHIM_ASSOCIATED"> 

	<t>The SHIM_ASSOCIATED option can be used to check whether the
	socket is associated with any shim context or not.</t>

	<t>This option is particularly meaningful in a case where the
	locator information of the received IP packet does not tell
	whether the identifier/locator adaptation is performed or not.
	Note that the EID pair and locator pair may be identical in
	some case.</t>

	<t>This option can be specified by getsockopt().  Thus, the
	option is read-only and the result (0 or 1) is set in the
	option value (the fourth argument of getsockopt()).</t>

	<t>Data type of the option value is integer.  The option value
	indicates presence of shim context.  A returned value 1 means
	that the socket is associated with a certain shim context at
	the shim layer, while a return value 0 indicates that there is
	no context associated with the socket.</t>

	<t>For example, the option can be used by the application as
	follows:</t>

	<figure>
	  <artwork><![CDATA[
    int optval;
    int optlen = sizeof(optval);

    getsockopt(fd, SOL_SHIM, SHIM_ASSOCIATED, &optval, &optlen);
	  ]]></artwork>
	</figure>

      </section>

      <section title="SHIM_DONTSHIM">

	<t>The SHIM_DONTSHIM option can be used to request the shim
	layer to not apply the multihoming support for the
	communication established over the socket.</t>

	<t>Data type of the option value is integer.  The option value
	indicates whether the multihoming shim support is deprecated
	or not.  The option value is binary (0 or 1).  By default, the
	value is set to 0, meaning that the shim layer applies
	identifier/locator adaptation for the communication.  In order
	to disable the socket option, the application should call
	setsockopt() with optval set as 0.</t>

	<t>For example, the option can be disabled by the application
	as follows.</t>

	<figure>
	  <artwork><![CDATA[
    int optval;

    optval = 0;

    setsockopt(fd, SOL_SHIM, SHIM_DONTSHIM, &optval, sizeof(optval));
    ]]></artwork>
	</figure>

	<t>For example, the option value can be checked by the
	application as follows.</t>

	<figure>
	  <artwork><![CDATA[
    int optval;
    int len;

    len = sizeof(optval);

    getsockopt(fd, SOL_SHIM, SHIM_DONTSHIM, &optval, &len);
    ]]></artwork>
	</figure>

      </section>

      <section title="SHIM_HOT_STANDBY">

	<t>The SHIM_HOT_STANDBY option can be used to check if the
	shim layer uses hot-standby connection or not for the
	communication established over the socket.  Hot-standby
	connection is another working locator pair than the current
	locator pair.  Hence this option is effective only when there
	is a shim context associated with the socket.</t>

	<t>Data type of the option value is integer.</t>

	<t>The option value can be set by setsockopt().</t>

	<t>The option value can be read by getsockopt().</t>

	<t>By default, the value is set to 0, meaning that hot-standby
	connection is disabled.</t>

	<t>For example, the option can be activated by the application
	as follows.</t>

	<figure>
	  <artwork><![CDATA[
    int optval;

    optval = 1;

    setsockopt(fd, SOL_SHIM, SHIM_HOT_STANDBY, &optval,
               sizeof(optval));
    ]]></artwork>
	</figure>

	<t>For example, the option value can be checked by the
	application as follows.</t>

	<figure>
	  <artwork><![CDATA[
    int optval;
    int len;

    len = sizeof(optval);

    getsockopt(fd, SOL_SHIM, SHIM_HOT_STANDBY, &optval, &len);
    ]]></artwork>
	</figure>

      </section>

      <section title="SHIM_PATHEXPLORE">

	<t>This option can be used to specify behavior of path
	exploration to be carried out.  Path exploration is a
	procedure to find an alternative locator pair when the host
	finds any problem with current locator pair.  A message used
	for finding an alternative locator pair is called a Probe
	message and it is sent per locator pair.  Default value is
	defined for Initial Probe Timeout (0.5 seconds) and Initial
	Probe (4 times) in the REAP specification.</t>

	<t>The option is effective only when there is a shim context
	associated with the socket.</t>

	<t>Data type of the option value is a pointer to the buffer
	where a set of information for path exploration is stored.
	The data structure is defined in <xref
	target="sec-data-structures"/>.</t>

	<t>By default, the option value is set as NULL, meaning that
	the option is disabled.</t>

	<t>An error ENOENT will be returned when there is no context
	associated with the socket.</t>

	<t>For example, the parameters for the path exploration can be
	set as follows.</t>

	<figure>
	  <artwork><![CDATA[
    struct shim6_pathexplore pe;

    pe.pe_probenum = 4;        /* times */
    pe.pe_keepaliveto = 10;    /* seconds */
    pe.pe_initprobeto = 500;   /* milliseconds */
    pe.pe_reserved = 0;

    setsockopt(fd, SOL_SHIM, SHIM_PATHEXPLORE, &pe, sizeof(pe));
    ]]></artwork>
	</figure>

	<t>For example, the parameters for the path exploration can be
	read as follows.</t>

	<figure>
	  <artwork><![CDATA[
    struct shim6_pathexplore pe;
    int len;

    len = sizeof(pe);

    getsockopt(fd, SOL_SHIM, SHIM_PATHEXPLORE, &pe, &len);
    ]]></artwork>
	</figure>

      </section>

      <section title="SHIM_LOC_LOCAL_PREF">
	
	<t>The SHIM_LOC_LOCAL_PREF option can be used to read or set
	preferred locator on local side within a given context.  Hence
	this option is effective only when there is a shim context
	associated with the socket.</t>

	<t>Data type of the option value is a pointer to the specific
	data structure which stores the locator information.  The data
	structure is defined in <xref
	target="sec-data-structures"/>.</t>

	<t>By default, the option value is set as NULL, meaning that
	the option is disabled.</t>

	<t>The preferred locator can be set by setsockopt().
	Verification of the locator shall be done by the shim layer
	before updating the preferred locator.</t>

	<t>The preferred locator can be read by getsockopt().</t>

	<t>An error ENOENT will be returned when there is no context
	associated with the socket.</t>

	<t>An error EINVALIDLOCATOR will be returned when the
	validation of the specified locator failed.</t>

	<t>For example, a preferred locator can be set as follows.  It
	should be noted that some members of the shim_locator
	(lc_ifidx and lc_flags) are ignored in the write
	operation.</t>

	<figure>
	  <artwork><![CDATA[
    struct shim_locator lc;
    struct in6_addr ip6;

    /* ...set the locator (ip6)... */

    bzero(&lc, sizeof(shim_locator));
    lc.lc_family = AF_INET6;  /* IPv6 */
    lc.lc_ifidx = 0;
    lc.lc_flags = 0;
    lc.lc_preference = 255;
    memcpy(lc.lc_addr, &ip6, sizeof(in6_addr)); 

    setsockopt(fd, SOL_SHIM, SHIM_LOC_LOCAL_PREF, &lc,
               sizeof(optval));
    ]]></artwork>
	</figure>

	<t>For example, the preferred locator of the context can be
	read by application as follows.</t>

	<figure>
	  <artwork><![CDATA[
    struct shim_locator lc;
    int len;

    len = sizeof(lc);

    getsockopt(fd, SOL_SHIM, SHIM_LOC_LOCAL_PREF, &lc, &len);
    ]]></artwork>
	</figure>

      </section>

      <section title="SHIM_LOC_PEER_PREF">

	<t>The SHIM_LOC_PEER_PREF option can be used to read or set
	preferred locator on peer side within a given context.  Hence
	this option is effective only when there is a shim context
	associated with the socket.</t>

	<t>Data type of the option value is a pointer to the specific
	data structure which stores the locator information.  The data
	structure is defined in <xref
	target="sec-data-structures"/>.</t>

	<t>By default, the option value is set as NULL, meaning that
	the option is disabled.</t>

	<t>The preferred locator can be set by setsockopt().
	Necessary verification of the locator shall be done by the
	shim layer before updating the preferred locator.</t>

	<t>The preferred locator can be read by getsockopt().</t>

	<t>An error ENOENT will be returned when there is no context
	associated with the socket.</t>

	<t>An error EINVALIDLOCATOR will be returned when the
	validation of the specified locator failed.</t>

	<t>For example, a preferred locator can be set as follows.  It
	should be noted that some members of the shim_locator
	(lc_ifidx and lc_flags) are ignored in the write
	operation.</t>

	<t>The usage of the option is same as that of
	SHIM_LOC_LOCAL_PREF.</t>

      </section>

      <section title="SHIM_LOC_LOCAL_RECV">

	<t>The SHIM_LOC_LOCAL_RECV option can be used to request the
	shim layer to store the destination locator of the received IP
	packet in an ancillary data object which can be accessed by
	recvmsg().  Hence this option is effective only when there is
	a shim context associated with the socket.</t>

	<t>Data type of the option value is integer. The option value
	should be binary (0 or 1).  By default, the option value is
	set to 0, meaning that the option is disabled.</t>

	<t>The option value can be set by setsockopt().</t>

	<t>The option value can be read by getsockopt().</t>

	<t>See <xref target="sec-access-to-locinfo"/> for the
	procedure to access locator information stored in the
	ancillary data objects.</t>

	<t>An error ENOENT will be returned when there is no context
	associated with the socket.</t>
	
	<t>For example, the option can be activated by the application
	as follows:</t>

	<figure>
	  <artwork><![CDATA[
    int optval;

    optval = 1;

    setsockopt(fd, SOL_SHIM, SHIM_LOC_LOCAL_RECV, &optval,
               sizeof(optval));
    ]]></artwork>
	</figure>

	<t>For example, the option value can be checked by the
	application as follows:</t>

	<figure>
	  <artwork><![CDATA[
    int optval;
    int len;

    len = sizeof(optval);

    getsockopt(fd, SOL_SHIM, SHIM_LOC_LOCAL_RECV, &optval, &len);
    ]]></artwork>
	</figure>

      </section>

      <section title="SHIM_LOC_PEER_RECV">

	<t>The SHIM_LOC_PEER_RECV option can be used to request the
	shim layer to store the source locator of the received IP
	packet in an ancillary data object which can be accessed by
	recvmsg().  Hence this option is effective only when there is
	a shim context associated with the socket.</t>

	<t>Data type of the option value is integer. The option value
	should be binary (0 or 1).  By default, the option value is
	set to 0, meaning that the option is disabled.</t>

	<t>The option value can be set by setsockopt().</t>

	<t>The option value can be read by getsockopt().</t>

	<t>See <xref target="sec-access-to-locinfo"/> for the
	procedure to access locator information stored in the
	ancillary data objects.</t>

	<t>An error ENOENT will be returned when there is no context
	associated with the socket.</t>

	<t>The usage of the option is same as that of
	SHIM_LOC_LOCAL_RECV option.</t>

      </section>

      <section title="SHIM_LOC_LOCAL_SEND">

	<t>The SHIM_LOC_LOCAL_SEND option can be used to request the
	shim layer to use specific locator for the source locator of
	IP packets to be sent from the socket.  Hence this option is
	effective only when there is a shim context associated with
	the socket.</t>

	<t>Data type of option value is pointer to shim_locator data
	structure.</t>

	<t>The local locator can be specified by setsockopt()
	providing a valid locator which is stored in a shim_locator
	data structure.  When a zero-filled locator is specified,
	pre-existing setting of local locator is deactivated.</t>

	<t>The local locator specified can be obtained by
	getsockopt().  The locator can be obtained from the option
	value.</t>

	<t>An error ENOENT will be returned when there is no context
	associated with the socket.</t>

	<t>An error EINVALIDLOCATOR when invalid locator is
	specified.</t>

	<t>For example, a preferred local locator can be specified as
	follows.</t>

	<figure>
	  <artwork><![CDATA[
    struct shim_locator locator;
    struct in6_addr ia6;

    /* an IPv6 address preferred for the source locator is copied
       to the parameter ia6 */

    memset(&locator, 0, sizeof(locator));

    /* fill shim_locator data structure */
    locator.lc_family = AF_INET6;
    locator.lc_ifidx = 1;
    locator.lc_flags = 0;
    locator.lc_preference = 0;
    memcpy(&locator.lc_addr, &ia6, sizeof(ia6));

    setsockopt(fd, SOL_SHIM, SHIM_LOC_LOCAL_SEND, &locator,
               sizeof(locator));
    ]]></artwork>
	</figure>

	<t>For example, a preferred local locator can be read as
	follows.</t>

	<figure>
	  <artwork><![CDATA[
    struct shim_locator locator;

    memset(&locator, 0, sizeof(locator));

    getsockopt(fd, SOL_SHIM, SHIM_LOC_LOCAL_SEND, &locator,
               sizeof(locator));

    /* check locator */
    ]]></artwork>
	</figure>

      </section>

      <section title="SHIM_LOC_PEER_SEND">

	<t>The SHIM_LOC_PEER_SEND option can be used to request the
	shim layer to use specific locator for the destination locator
	of IP packets to be sent from the socket.  Hence this option
	is effective only when there is a shim context associated with
	the socket.</t>

	<t>Data type of option value is pointer to shim_locator data
	structure.</t>

	<t>The remote locator can be specified by setsockopt()
	providing a valid locator which is stored in a shim_locator
	data structure.  When a zero-filled locator is specified,
	pre-existing setting of remote locator is deactivated.</t>

	<t>The remote locator specified can be obtained by
	getsockopt().  The locator can be obtained from the option
	value.</t>

	<t>An error ENOENT will be returned when there is no context
	associated with the socket.</t>

	<t>An error EINVALIDLOCATOR when invalid locator is
	specified.</t>

	<t>The usage of the option is as the same as that of
	SHIM_LOC_LOCAL_SEND option.</t>

      </section>

      <section title="SHIM_LOCLIST_LOCAL">

	<t>The SHIM_LOCLIST_LOCAL option can be used to read or set
	the locator list associated with the local EID of the shim
	context associated with the socket.  Hence this option is
	effective only when there is a shim context associated with
	the socket.</t>

	<t>Data type of option value is pointer to the buffer where a
	locator list is stored.  See <xref
	target="sec-data-structures"/> for the data structure for
	storing the locator information.  By default, the option value
	is set as NULL, meaning that the option is disabled.</t>

	<t>The locator list can be read by getsockopt().  Note that
	the size of the buffer pointed by optval argument should be
	large enough to store an array of locator information.  The
	number of the locator information is not known beforehand.</t>

	<t>The locator list can be set by setsockopt().  The buffer
	pointed by optval argument should contain an array of locator
	list.</t>

	<t>An error ENOENT will be returned when there is no context
	associated with the socket.</t>

	<t>An error EINVALIDLOCATOR will be returned when the
	validation of the specified locator failed.</t>

	<!-- xxx do we need more error code? -->

	<t>For example, a list of locators to be associated with the
	local EID can be specified as follows:</t>

	<figure>
	  <artwork><![CDATA[
    struct shim_locator locators[SHIM_MAX_LOCATORS];
    struct sockaddr_in *sin;
    struct sockaddr_in6 *sin6;

    memset(locators, 0, sizeof(locators));

    ...

    /* obtain local IP addresses from local interfaces */

    ...

    /* first locator (an IPv6 address) */
    locators[0].lc_family = AF_INET6;
    locators[0].lc_ifidx = 0;
    locators[0].lc_flags = 0;
    locators[0].lc_preference = 1;
    memcpy(&locators[0].lc_addr, &sa6->sin6_addr,
           sizeof(sa6->sin6_addr));

    ...

    /* second locator (an IPv4 address) */
    locators[1].lc_family = AF_INET;
    locators[1].lc_ifidx = 0;
    locators[1].lc_flags = 0;
    locators[1].lc_preference = 0;
    memcpy(&locators[1].lc_addr, &sa->sin_addr, sizeof(sa->sin_addr));

    setsockopt(fd, SOL_SHIM, SHIM_LOCLIST_LOCAL, locators,
               sizeof(locators));
	       ]]></artwork>
	</figure>

	<t>For example, a list of locators that are associated with the
	local EID can be obtained as follows:</t>

	<figure>
	  <artwork><![CDATA[
    struct shim_locator locators[SHIM_MAX_LOCATORS];

    memset(locators, 0, sizeof(locators));

    getsockopt(fd, SOL_SHIM, SHIM_LOC_LOCAL_RECV, locators,
               sizeof(locators));

    /* parse locators */
    ...

    ]]></artwork>
	</figure>

      </section>

      <section title="SHIM_LOCLIST_PEER">

	<t>The SHIM_LOCLIST_PEER option can be used to read or set the
	locator list associated with the peer EID of the shim context
	associated with the socket.  Hence this option is effective
	only when there is a shim context associated with the
	socket.</t>

	<t>Data type of option value is pointer to the buffer where a
	locator list is stored.  See <xref
	target="sec-data-structures"/> for the data structure for
	storing the locator information.  By default, the option value
	is set as NULL, meaning that the option is disabled.</t>

	<t>The locator list can be read by getsockopt().  Note that
	the size of the buffer pointed by optval argument should be
	large enough to store an array of locator information.  The
	number of the locator information is not known beforehand.</t>

	<t>The locator list can be set by setsockopt().  The buffer
	pointed by optval argument should contain an array of locator
	list.</t>

	<t>An error ENOENT will be returned when there is no context
	associated with the socket.</t>

	<t>An error EINVALIDLOCATOR will be returned when the
	validation of the specified locator failed.</t>

	<!-- xxx do we need more error code? -->

	<t>The usage of the option is same as that of
	SHIM_LOCLIST_LOCAL.</t>

      </section>

      <section title="SHIM_APP_TIMEOUT">

	<t>The SHIM_APP_TIMEOUT option indicates timeout value for
	application to detect failure.  Hence this option is effective
	only when there is a shim context associated with the
	socket.</t>

	<t>Data type of the option value is integer.  The value
	indicates the period of timeout in seconds to send a REAP
	Keepalive message since the last outbound traffic.  By
	default, the option value is set as 0, meaning that the option
	is disabled.  When the option is disabled, the REAP mechanism
	follows its default value of Send Timeout value as specified
	in <xref target="I-D.ietf-shim6-failure-detection"/></t>

	<t>If the timeout value specified is longer than the Send
	Timeout configured in the REAP component, the REAP Keepalive
	message should be suppressed.</t>

	<t>An error ENOENT will be returned when there is no context
	associated with the socket.</t>

	<t>For example, a specific timeout value can be configured by
	the application as follows:</t>

	<figure>
	  <artwork><![CDATA[
    int optval;

    optval = 15; /* 15 seconds */

    setsockopt(fd, SOL_SHIM, SHIM_APP_TIMEOUT, &optval,
               sizeof(optval));
    ]]></artwork>
	</figure>

	<t>For example, the option value namely the period of timeout
	can be checked by the application as follows:</t>

	<figure>
	  <artwork><![CDATA[
    int optval;
    int len;

    len = sizeof(optval);

    getsockopt(fd, SOL_SHIM, SHIM_APP_TIMEOUT, &optval, &len);
    ]]></artwork>
	</figure>

      </section>

      <section title="SHIM_DEFERRED_CONTEXT_SETUP">

	<t>The SHIM_DEFERRED_CONTEXT_SETUP option indicates how
	initiation of context setup is made in terms of timing (before
	or after) the initial communication flow.  Deferred context
	means that the establishment of context does not put
	additional delay for an initial transaction.</t>

	<t>Data type for the option value is integer.  The option
	value should binary (0 or 1).  By default, the value is set as
	1, meaning that the context setup is deferred.  In order to
	disable the option, the application should call setsockopt()
	with option value set as 0.</t>
	
	<t>However, it should be noted that in some case, deferred
	context setup is not possible; given EID is non-routable
	address and there is no way to transmit any IP packet unless
	there is a context providing the locators.  In such case,
	context should be established prior to the communication.</t>

	<t>For example, the option can be disabled by the application
	as follows:</t>

	<figure>
	  <artwork><![CDATA[
    int optval;

    optval = 0;

    setsockopt(fd, SOL_SHIM, SHIM_DEFERRED_CONTEXT_SETUP,
               &optval, sizeof(optval));
	       ]]></artwork>
	</figure>

	<t>For example, the option value can be checked by the
	application as follows:</t>

	<figure>
	  <artwork><![CDATA[
    int optval;
    int len;

    len = sizeof(optval);

    getsockopt(fd, SOL_SHIM, SHIM_DEFERRED_CONTEXT_SETUP,
               &optval, &len);
	       ]]></artwork>
	</figure>

      </section>

      <section title="Error Handling">

	<t>If successful, getsockopt() and setsockopt() return 0;
	otherwise, the functions return -1 and set errno to indicate
	error.</t>

	<t>The followings are errno codes newly defined for some shim
	specific socket options indicating that the getsockopt() or
	setsockopt() finished incompletely:<vspace blankLines="1"/>

	<list style="hanging">

	  <t hangText="EINVALIDLOCATOR"><vspace blankLines="0"/>This
	  indicates that at least one of the necessary validations
	  inside the shim layer for the specified locator has failed.
	  In case of SHIM6, there are two kinds of verifications
	  required for security reasons prior to sending an IP packet
	  to the peer's new locator; one is return routability (check
	  if the peer is actually willing to receive data with the
	  specified locator) and the other is verifications based on
	  given crypto identifier mechanisms <xref target="RFC3972"/>,
	  <xref target="I-D.ietf-shim6-hba"/>.</t>

	</list>

	</t>
      </section>

    </section>

    <section title="Ancillary Data for Multihoming Shim"
	     anchor="sec-access-to-locinfo" toc="include">

      <t>In this section, definition and usage of the ancillary data
      which is specific to multihoming shim are provided.</t>

      <t>As defined in Posix standard, sendmsg() and recvmsg() take
      msghdr structure as its argument and they can additionally
      handle control information along with data.  <xref
      target="fig-msghdr"/> shows the msghdr structure which is
      defined in <sys/socket.h>.  msg_control member holds a
      pointer to the buffer where the shim specific ancillary data
      objects can be stored in addition to other ancillary data
      objects.</t>
      
      <figure anchor="fig-msghdr" title="msghdr structure">
	<artwork><![CDATA[
     struct msghdr {
             caddr_t msg_name;       /* optional address */
             u_int   msg_namelen;    /* size of address */
             struct  iovec *msg_iov; /* scatter/gather array */
             u_int   msg_iovlen;     /* # elements in msg_iov */
             caddr_t msg_control;    /* ancillary data, see below */
             u_int   msg_controllen; /* ancillary data buffer len */
             int     msg_flags;      /* flags on received message */
     };
    ]]></artwork>
      </figure>

      <t>The buffer pointed from the msg_control member of the msghdr
      structure may contain a locator information which is a single
      locator and it should be possible to process them with the
      existing macros defined in Posix and <xref target='RFC3542'/>.
      Each cmsghdr{} should be followed by data which stores a single
      locator.</t>

      <t>In case of non-connected socket, msg_name member stores the
      socket address of the peer which should be considered as an
      identifier rather than a locator. The locator of the peer node
      should be retrieved by SHIM_LOC_PEER_RECV as specified
      below.</t>

      <t><xref target="tab-shim-ancillary-data"/> is a list of the
      shim specific ancillary data which can be used for recvmsg() or
      sendmsg().  In any case, SOL_SHIM must be set as cmsg_level.</t>
      
      <texttable anchor="tab-shim-ancillary-data"
		 title="Shim specific ancillary data">

	<ttcol align='left'>cmsg_type</ttcol>
	<ttcol align='left'>sendmsg()</ttcol>
	<ttcol align='left'>recvmsg()</ttcol>
	<ttcol align='left'>cmsg_data[]</ttcol>

	<c>SHIM_LOC_LOCAL_RECV</c>
	<c></c>
	<c>o</c>
	<c>*1</c>

	<c>SHIM_LOC_PEER_RECV</c>
	<c></c>
	<c>o</c>
	<c>*1</c>

	<c>SHIM_LOC_LOCAL_SEND</c>
	<c>o</c>
	<c></c>
	<c>*1</c>

	<c>SHIM_LOC_PEER_SEND</c>
	<c>o</c>
	<c></c>
	<c>*1</c>

	<c>SHIM_FEEDBACK</c>
	<c>o</c>
	<c></c>
	<c>shim_feedback{}</c>
	
      </texttable>

      <t>*1: cmsg_data[] should include padding (if necessary) and a
      single sockaddr_in{}/sockaddr_in6{}.</t>
      
      <t>It should be noted that the above ancillary data can only be
      handled in UDP and raw sockets, not in TCP sockets because there
      is no one-to-one mapping of send/receive operations and the TCP
      segments being transmitted/received.</t>

      <section title="Get Locator Information from Incoming Packet">

	<t>Application can get locator information from the received
	IP packet by specifying the shim specific socket options for
	the socket.  When SHIM_LOC_LOCAL_RECV and/or
	SHIM_LOC_PEER_RECV socket options are set, the application can
	retrieve local and/or remote locator from the ancillary
	data.</t>

      </section>
      
      <section title="Specify Locator Information for Outgoing Packet">

	<t>Application can specify the locators to be used for
	transmitting an IP packet by sendmsg().  When ancillary data
	of cmsg_type SHIM_LOC_LOCAL_SEND and/or SHIM_LOC_PEER_SEND are
	specified, the application can explicitly specify source
	and/or destination locators to be used for the communication
	over the socket.</t>

	<t>In addition, the application can specify the outgoing
	interface by SHIM_IF_SEND ancillary data.  The ancillary data
	should contain the interface identifier of the physical
	interface over which the application expects the packet to be
	transmitted.</t>
	
	<t>Note that the effect is limited to the datagram transmitted
	by the sendmsg().</t>

	<t>If the specified locator pair seems to be valid, the shim
	layer overrides the locator of the IP packet as requested.</t>

	<t>An error EINVALIDLOCATOR will be returned when validation
	of the specified locator failed.</t>

      </section>

      <section title="Notification from Application to Multihoming Shim"
	       anchor="sec-feedback" toc="include">

	<t>Application may provide feedback to the shim layer about
	the communication status.  Such feedback is particularly
	useful for the shim layer in the absence of REAP mechanism to
	monitor the reachability status of currently used locator pair
	in a given shim context.</t>

	<t>The notification can be made by sendmsg() specifying a new
	ancillary data called SHIM_FEEDBACK.  The ancillary data can
	be handled by specifying SHIM_FEEDBACK option in
	cmsg_type.</t>

	<t>An error ENOENT will be returned when there is no context
	associated with the socket.</t>

	<t>See <xref target="sec-feedback-info"/> for details of the
	data structure to be used.  Note that this specification does
	not specify the exact behavior of the shim layer when a
	feedback information is given by an application.</t>
	  
      </section>

    </section>
      
    <section title="Data Structures"
	     anchor="sec-data-structures" toc="include">

      <t>In this section, data structures specifically defined for the
      multihoming shim layer are introduced.  Those data structure are
      either used as a parameter for setsockopt()/getsockopt() (as
      mentioned in <xref target="sec-shim-socket-options"/>) or a
      parameter for ancillary data to be processed by
      sendmsg()/recvmsg() (as mentioned in <xref
      target="sec-access-to-locinfo"/>).</t>

      <!--
	  Note: maybe we can define getlocatorinfo() system call which
	  returns chain of locator information associated with a given
	  identifier.  For instance: getlocatorinfo(const struct
	  sockaddr *sa_id, const struct addrinfo *hints, struct
	  addrinfo **result);
      -->

      <section title="Placeholder for Locator Information">
	
	<t>As defined in <xref target="sec-shim-socket-options"/>, the
	SHIM_LOC_LOCAL_PREF, SHIM_LOC_PEER_PREF, SHIM_LOCLIST_LOCAL,
	and SHIM_LOCLIST_PEER socket options need to handle one or
	more locator information.  Locator information includes not
	only the locator itself but also additional information about
	the locator which is useful for locator management.  A new
	data structure is defined to serve as a placeholder for the
	locator information.</t>

	<t><xref target="fig-shim-locator"/> illustrates the data
	structure called shim_locator which stores a locator
	information.

	<figure anchor="fig-shim-locator" title="shim locator structure">
	  <artwork><![CDATA[
     struct shim_locator {
             uint8_t   lc_family;     /* address family */
             uint8_t   lc_ifidx;      /* interface index */
             uint8_t   lc_flags;      /* flags */
             uint8_t   lc_preference; /* preference value */
             uint8_t   lc_addr[16];   /* address data */
     };
     ]]></artwork>
	</figure>

	<list style="hanging">
	  <t hangText="lc_family"><vspace blankLines="0"/>Address
	  family of the locator (e.g. AF_INET, AF_INET6).  It is
	  required that the parameter contains non-zero value
	  indicating the exact address family of the locator.</t>
	  <t hangText="lc_ifidx"><vspace blankLines="0"/>Interface
	  index of the network interface to which the locator is
	  assigned.  This field should be valid only in read
	  (getsockopt()) operation.</t>
	  <t hangText="lc_flags"><vspace blankLines="0"/>Each bit of
	  the flags represents a specific characteristics of the
	  locator.  HBA is defined as 0x01.  CGA is defined as 0x02.
	  The other bits are TBD.</t>
	  <t hangText="lc_preference"><vspace
	  blankLines="0"/>Indicates preference of the locator.  The
	  preference is represented by integer.</t>
	  <t hangText="lc_addr"><vspace blankLines="0"/>Contains the
	  locator.  For the cases where a locator whose size is
	  smaller than 16 bytes, encoding rule should be provided for
	  each locator of a given address family.  For instance, in
	  case of AF_INET (IPv4), the first 4 bytes of lc_addr should
	  contain the IPv4 address.</t>
	</list>
	</t>
      </section>

      <section title="Path Exploration Parameter">

	<t>As defined in <xref target="sec-shim-socket-options"/>,
	SHIM_PATHEXPLORE allows application to set or read the
	parameters for path exploration and failure detection.  A new
	data structure called shim_pathexplore is defined to store the
	necessary parameters.  <xref target="fig-path-explore"/>
	illustrates the data structure.  The data structure can be
	used by getsockopt() or setsockopt() as an argument.

	<figure anchor="fig-path-explore" title="path explore structure">
	  <artwork><![CDATA[
     struct shim_pathexplore {
             uint8_t   pe_probenum;      /* # of initial probe */
             uint8_t   pe_keepaliveto;   /* Keepalive Timeout */
             uint16_t  pe_initprobeto;   /* Initial Probe Timeout */
             uint32_t  pe_reserved;      /* reserved */
     };
     ]]></artwork>
	</figure>

	<list style="hanging">
	  <t hangText="pe_probenum">
	    <vspace blankLines="0"/>
	    Indicates the number of initial probe messages to be sent.
	    Default value of this parameter should follow what is
	    specified in <xref
	    target="I-D.ietf-shim6-failure-detection"/>.
	  </t>
	  <t hangText="pe_keepaliveto">
	    <vspace blankLines="0"/>
	    Indicates timeout value for detecting a failure when the
	    host does not receive any packets for a certain period of
	    time while there is outbound traffic.  When the timer
	    expires, path exploration procedure will be carried out by
	    sending a REAP Probe message.  Default value of this
	    parameter should follow what is specified in <xref
	    target="I-D.ietf-shim6-failure-detection"/>.
	  </t>
	  <t hangText="pe_initprobeto">
	    <vspace blankLines="0"/>
	    Indicates retransmission timer of REAP Probe message in
	    milliseconds.  Note that this timer is applied before
	    exponential back-off is started.  A REAP Probe message for
	    the same locator pair may be retransmitted.  Default value
	    of this parameter should follow what is specified in <xref
	    target="I-D.ietf-shim6-failure-detection"/>.
	  </t>
	  <t hangText="pe_reserved">
	    <vspace blankLines="0"/>
	    A reserved field for future extension.  By default, the
	    field should be initialized with zero.
	  </t>
	</list>
	</t>
	
      </section>

      <section title="Feedback Information" anchor="sec-feedback-info">
	
	<t>As mentioned in <xref target="sec-feedback"/>, applications
	can inform the shim layer about the status of unicast
	reachability of the locator pair currently in use.  The
	feedback information can be handled by using ancillary data
	called SHIM_FEEDBACK.  A new data structure named
	shim_feedback is illustrated in <xref
	target="fig-feedback-info"/>).

	<figure anchor="fig-feedback-info"
		title="feedback information structure">
	  <artwork><![CDATA[
     struct shim_feedback {
             uint8_t   fb_direction;    /* direction of traffic */
             uint8_t   fb_indicator;    /* indicator (1-3) */
             uint16_t  fb_reserved;     /* reserved */
     };
     ]]></artwork>
	</figure>

	<list style="hanging">
	  <t hangText="direction">
	    <vspace blankLines="0"/>
	    Indicates direction of reachability between a locator pair
	    in question.  A value 0 indicates outbound and a value 1
	    indicates inbound.
	  </t>
	  <t hangText="indicator">
	    <vspace blankLines="0"/>
	    A value indicating the degree of satisfaction of a
	    unidirectional reachability for a given locator pair.
	  
	    <list style="symbols">
	      <t>0: Default value.  Whenever this value is specified
	      the feedback information must not be processed by the
	      shim layer.</t>

	      <t>1: Unable to connect.  There is no unidirectional
	      reachability between the locator pair in question.</t>
	      
	      <t>2: Unsatisfactory.  The application is not satisfied
	      with the unidirectional reachability between the locator
	      pair in question.</t>
	      
	      <t>3: Satisfactory.  There is satisfactory
	      unidirectional reachability between the locator pair in
	      question.</t>
	    </list>
	  </t>
	  
	  <t hangText="reserved">
	    <vspace blankLines="0"/>
	    Reserved field.  Must be ignored by the receiver.
	  </t>
	</list>

	</t>

      </section>

    </section>
    
    <section title="Implications for Existing Socket API Extensions"
	     anchor="sec-implications-for-legacyapi"
	     toc="include">

      <t>Some of the socket options defined in this document have some
      overlapping with existing socket API and care should be made for
      the usage not to confuse the features.</t>

      <t>The socket options for requesting specific locators to be
      used for a given transaction (SHIM_LOC_LOCAL_PREF and
      SHIM_LOC_PEER_PREF) are semantically similar to the existing
      socket API (IPV6_PKTINFO).  The socket options for obtaining the
      locator information from the received IP packet
      (SHIM_LOC_LOCAL_RECV and SHIM_LOC_PEER_RECV) are semantically
      similar to the existing socket API (IP_RECVDSTADDR and
      IPV6_PKTINFO).</t>

      <t>In IPv4, application can obtain the destination IP address of
      the received IP packet (IP_RECVDSTADDR).  If the shim layer
      performs identifier/locator adaptation for the received packet,
      the destination EID should be stored in the ancillary data
      (IP_RECVDSTADDR).</t>

      <t>In IPv6, <xref target="RFC3542"/> defines that IPV6_PKTINFO
      can be used to specify source IPv6 address and the outgoing
      interface for outgoing packets, and retrieve destination IPv6
      address and receiving interface for incoming packets.  This
      information is stored in ancillary data being IPV6_PKTINFO
      specified as cmsg_type.  Existing socket API should continue to
      work above the shim layer, that is, the IP addresses handled in
      IPV6_PKTINFO should be EIDs, not the locators.</t>

      <t>Baseline is that the above existing socket API
      (IP_RECVDSTADDR and IPV6_PKTINFO) is assumed to work above the
      multihoming shim layer.  In other words, the IP addresses those
      socket options deal with are EIDs rather than locators.</t>

    </section>

    <section title="Resolving Conflicts with Preference Values">

      <t>Since the multihoming shim API allows application to specify
      preference value for the context which is associated with the
      socket instance, there may be a conflict with preference values
      specified by different applications.  For instance, application
      A and B may establish communication over the same EID pair while
      each application have different preference in their choice of
      local locator.</t>

      <t>SHIM6 supports a notion of forking context in which a context
      is split when there is a conflict with preference values
      specified by multiple applications.  Thus, context forking can
      simply resolve the conflicting situation which may be caused by
      the use of socket options for multihoming shim layer.</t>

      <section title="Implicit Forking">

	<t>Socket options defined in <xref
	target="sec-shim-socket-options"/> may cause conflicting
	situation when the target context is shared by multiple
	applications.  In such case, socket handler and the
	multihoming shim layer should react as follows; socket handler
	should inform the shim layer that context forking is required.
	In SHIM6, when a context is forked, an unique identifier
	called Forked Instance Identifier (FII) is assigned to the
	newly forked context.  The forked context is then exclusively
	associated with the socket through which non-default
	preference value was specified.  The forked context is
	maintained by the multihoming shim layer during the lifetime
	of associated socket instance.  When the socket is closed, the
	multihoming shim layer SHOULD delete associated context.  In
	this way, garbage collection can be carried out to cleanup
	unused forked contexts.  Upon garbage collection, every forked
	context SHOULD be checked if there is no socket (process)
	associated with the context.  If there is none, the forked
	context should be deleted.  When a forked context is torn
	down, SHIM6 should notify the peer about the deletion of
	forked context.</t>

	<t>As opposed to socket options, context forking MUST NOT be
	triggered by any use of ancillary data that are specific to
	multihoming shim defined in <xref
	target="sec-access-to-locinfo"/>.</t>
	
      </section>
      
      <!--
	  <section title="Explicit Forking">
	  
	  <t>There is another approach to support context forking by
	  multihoming shim API.  In this approach, it is assumed that
	  shim-aware application can make distinction of each shim
	  context that has the same EID pair and specify which context
	  to be used for its communication.</t>
	  
	  <t>Socket option SHIM_TBD1 can be used by application to
	  request the multihoming shim layer to fork a context.  If the
	  context is successfully forked by the shim, the FII assigned
	  for the forked context is returned to the application.  The
	  application can request the multihoming shim layer to apply
	  specific context to its communication either by socket option
	  or ancillary data specifying SHIM_TBD2 socket option along
	  with FII value.</t>
	  
	  <t>NOTE: If we decide to go with explicit forking, we probably
	  need to define comprehensive set of socket options that allow
	  application to specify adaptation of forked context to the
	  flow over a given socket.  It seems to me that there are lots
	  of things to do to support explicit model.</t>
	  
	  </section>
      -->

    </section>

    <section title="Discussion" anchor="sec-discussion" toc="include">

      <t>In this section, open issues are introduced.</t>
      
      <!--
	  <section title="Issues with a Context Shared by Applications">
	  
	  <t>A context is by definition, system-wide.  This means that a
	  context could be shared by applications whose communications
	  are using the same EID pair.</t>
	  
	  <t>When a context is shared by applications, there may be some
	  problems when the shim layer needs to handle feedbacks from
	  the multiple applications.  As mentioned in <xref
	  target="sec-access-to-locinfo"/>, an application may provide
	  the shim layer feedback about timeout values from its own
	  settings.  This implies that there is potentially a race
	  condition at the shim layer.</t>
	  
	  <t>First of all, the socket options must be used with a proper
	  privilege.  Feedback from the application which is run under a
	  root privilege must always override the feedback provided by
	  application which is run under normal user privilege.</t>
	  
	  <t>For other cases, one could rely on a kind of heuristics of
	  the configuration.  For instance, prioritizing feedback with
	  higher demand (e.g. timeout value 300 seconds are more
	  demanding then timeout value 600 seconds) may make sense in
	  some cases.  However, it is still an open issue what kind of
	  timer value could be handled in this way.</t>
	  
	  <t>Further discussions are needed how the shim layer can
	  accommodate feedbacks from multiple applications within a same
	  context.</t>
	  
	  </section>
      -->

      <!--
      <section title="Issues with Shim Unaware Application">
      
	<t>In multihomed environment where either of the peers or both
	of the peers have multiple locators, there are some issues
	with shim unaware application which uses legacy socket
	API.</t>
      
	<section title="Initial Contact with Multiple Locator Pairs">
	
	  <t>In a connection oriented communication, the connect()
	  system call is used to make the initial contact to the peer,
	  which typically requires IP address and port number to
	  specify the endpoint.  Hence, name-to-address resolution
	  should be performed prior to connect().  The application
	  needs to resolve the FQDN of the peer to an IP address by
	  any available name-to-address conversion method.</t>

	  <t>In typical case, the application receives information
	  from the resolver.  If the application ends up with
	  receiving multiple IP addresses to reach the peer, it should
	  iterate through each destination address one-by-one.  It
	  should be noted that the host may also have multiple source
	  addresses.</t>

	  <t>The different resulting address pairs may have different
	  reachability status so, in order to find a working address
	  pair, it may be required to explore all the available
	  address pairs (as opposed to explore all available
	  destination addresses).</t>
	
	  <t>In normal case, the application issues a connect() by
	  specifying the resolved IP address of the peer.  If the
	  connect() fails, it iterates through the available IP
	  addresses one by one sequentially until working pair is
	  found.  Another approach is to initiate concurrent connect()
	  with every locator of the peer.  connect() can also be
	  called in a sequence which would probably require more time
	  to find the working pair.</t>
	
	  <t>There is a case where involvement of the shim layer is
	  expected for handling initial contact.  In such case,
	  behavior of the shim layer will depend on presence of the
	  required context.  This case occurs when there exists a
	  context for the EID specified in connect(), the initial
	  contact can be made in accordance with the context
	  information.  Otherwise, the shim layer should invoke
	  context establishment with the peer EID specified in the
	  argument for connect().</t>

	  <t>Additional efforts would be required in a case where the
	  peer cannot be reachable through the EID (for example, EID
	  is non-routable or non-IP reachable) but it can be reached
	  through alternative locator.  In particular, the shim layer
	  should somehow discover the alternate locator for the EID to
	  establish context.  <xref target="I-D.nordmark-shim6-esd"/>
	  addresses the possible approach to perform reverse DNS
	  lookup from EID to FQDN, then perform forward lookup again
	  to find the full-set of locators and EID.</t>

	  <t>In HIP, resolving HITs to IP addresses using DNS is not
	  feasible because HITs do not contain any hierarchical
	  information.  To mitigate this problem, there are a few
	  alternatives.  Firstly, resolver library on end-host can be
	  modified to provide HIT-to-IP mappings for HIP software
	  module.  Secondly, a distributed hash table (DHT) service
	  can be used for storing and looking up the mappings because
	  it supports non-hierarchical identifiers, such as HITs <xref
	  target="RFC4423"/>.  Thirdly, it is possible to
	  use IP addresses in legacy applications as described in
	  <xref target="I-D.henderson-hip-applications"/>.</t>

	</section>
      </section>
      -->

      <section title="Naming at Socket Layer">

	<t>getsockname() and getpeername() system calls are used to
	obtain the 'name' of endpoint which is actually a pair of IP
	address and port number assigned to a given socket.
	getsockname() is used when an application wants to obtain the
	local IP address and port number assigned for a given socket
	instance.  getpeername() is used when an application wants to
	obtain the remote IP address and port number.</t>

	<t>The above is based on a traditional system model of the
	socket API where an IP address is expected to play both the
	role of identifier and the role of locator.</t>

	<t>In a system model where a shim layer exists inside the IP
	layer, both getsockname() and getpeername() deal with
	identifiers, namely EIDs.  In this sense, the shim layer
	serves to (1) hide locators and (2) provide access to the
	identifier for the application over the legacy socket
	APIs.</t>

      </section>

      <section title="Additional Requirements from Application">

	<t>At the moment, it is not certain if following requirements
	are common in all the multihomed environments (SHIM6 and HIP).
	These are mainly identified during discussions made on SHIM6
	WG mailing list.
	
	<list style="symbols">
	  <t>The application should be able to set preferences for the
	  locators, local and remote one and also to the preferences
	  of the local locators that will be passed to the peer.</t>
	</list>
	</t>

      </section>

      <section title="Issues of Header Conversion among Different Address Family">
	
	<t>The shim layer performs identifier/locator adaptation.
	Therefore, in some case, the whole IP header can be replaced
	with new IP header of a different address family
	(e.g. conversion from IPv4 to IPv6 or vice versa).  Hence,
	there is an issue how to make the conversion with minimum
	impact.  Note that this issue is common in other protocol
	conversion such as SIIT<xref target="RFC2765"/>.</t>

	<t>As addressed in SIIT specification, some of the features
	(IPv6 routing headers, hop-by-hop extension headers, or
	destination headers) from IPv6 are not convertible to IPv4.
	In addition, notion of source routing is not exactly the same
	in IPv4 and IPv6.  Hence, there is certain limitation in
	protocol conversion between IPv4 and IPv6.</t>

	<t>The question is how should the shim layer behave when it is
	face with limitation problem of protocol conversion. Should we
	introduce new error something like ENOSUITABLELOCATOR ?</t>

      </section>

      <section title="Handling of Unknown Locator Provided by Application">

	<t>There might be a case where application provides the shim
	layer new locator with the SHIM_LOC_*_PREF socket options or
	SHIM_LOC_*_SEND ancillary data.  Then there is a question how
	should the shim layer treat the new locator informed by the
	application.</t>

	<t>In principle, locator information are exchanged by the shim
	protocol.  However, there might be a case where application
	acquires information about the locator and prefers to use it
	for its communication.</t>

      </section>

    </section>

    <!--
	================================================================
	Changes
	================================================================
    -->
    <section title="Changes" toc="default">
      <section title="Changes from version 00 to version 01">
	<t>The followings are changes from version 00 to version 01:
	<list style="symbols">
	  <t>Define shim_locator{} data type which is a placeholder for
	  locator.</t>
	  <t>Define shim_pathexplore{} data type in which a set of
	  REAP parameters are stored.</t>
	  <t>Remove descriptions about "stickiness" of socket options.</t>
	  <t>Deprecate SHIM_IF_RECV and SHIM_IF_SEND socket options.</t>
	  <t>Give default value and how to disable given socket
	  option.</t>
	</list>
	</t>
      </section>
      <section title="Changes from version 01 to version 02">
	<t>The followings are changes from version 01 to version 02:
	<list style="symbols">
	  <t>Add section describing context forking.</t>
	  <t>Rephrase conclusion section.</t>
	  <t>Separate normative references from informative
	  references.</t>
	  <t>Remove texts from discussion section that are not
	  relevant to the contents of the document.</t>
	  <t>Add section describing change history (this section).</t>
	</list>
	</t>
      </section>
      <section title="Changes from version 02 to version 03">
	<t>The followings are changes from version 02 to version 03:
	<list style="symbols">
	  <t>Add an Appendix section describing the issue of context
	  forking.</t>
	</list>
	</t>
      </section>

      <section title="Changes from version 03 to version 04">
	<t>The followings are changes from version 03 to version 04:
	<list style="symbols">
	  <t>Updated reference.</t>
	  <t>Correct typo and grammatical errors.</t>
	</list>
	</t>
      </section>

      <section title="Changes from version 04 to version 05">
	<t>The followings are changes from version 04 to version 05:
	<list style="symbols">
	  <t>Added definition of SHIM_FEEDBACK ancillary data.</t>
	  <t>Added an example of code using the SHIM_LOCLIST_LOCAL</t>
	  <t>Added SHIM_LOC_LOCAL_SEND and SHIM_LOC_PEER_SEND socket
	  options.</t>
	</list>
	</t>
      </section>

    </section>

    <!--
	================================================================
	IANA Consideration
	================================================================
    -->
    <section title="IANA Considerations" toc="default">
      <t>This document contains no IANA consideration.</t>
    </section>

    <!--
	================================================================
	Security Consideration
	================================================================
    -->
    <section title="Security Considerations" toc="default">

      <t>This document does not specify any security mechanism for the
      shim layer.  Fundamentally, the shim layer has a potential to
      impose security threats, as it changes the source and/or
      destination IP addresses of the IP packet being sent or
      received.  Therefore, the basic assumption is that the security
      mechanism defined in each protocol of the shim layer is strictly
      applied.</t>

      <!-- should we mention about privilege ? -->

      <!-- marcelo: perhaps we should talk about what happens when the
           app includes a new locator in the locator set... whether
           this would be possible or not...  -->
      <!-- shinta: i've put the above issue in discussion section -->

    </section>
    <!--
	================================================================
	Conclusion
	================================================================
    -->
    <section title="Conclusion" toc="default">

      <t>In this document, the Application Program Interface (API) for
      multihoming shim layer is specified.  The socket API allows
      applications to have additional control of the locator
      management and interface to the REAP mechanism inside the
      multihoming shim layer.</t>

      <t>Socket options for multihoming shim layer can be used by
      getsockopt() and/or setsockopt() system calls.  Besides,
      applications can use some ancillary data that are specific to
      multihoming shim layer to get locator from received packet or to
      set locator for outgoing packet.</t>

      <t>From an architectural point of view, the socket API provides
      extends the existing socket API framework in the face of
      ID/Locator separation.  With regard to API that relate to IP
      address management, it is assured that existing socket API
      continue to work above the shim layer dealing with identifiers,
      while multihoming shim API deals with locators.</t>

    </section>
    <!--
	================================================================
	Acknowledgment
	================================================================
    -->
    <section title ="Acknowledgments" toc="include">

      <t>Authors would like to thank Jari Arkko who participated in
      the discussion that lead to the first version of this document,
      and Tatuya Jinmei who thoroughly reviewed the early version of
      this draft and provided detailed comments on socket API related
      issues.  Thomas Henderson provided valuable comments especially
      from HIP perspectives.</t>

    </section>
  </middle>
  <back>
    <!--
	================================================================
	References
	================================================================
    -->
    <references title="Normative References">

      <reference anchor='I-D.ietf-shim6-proto'>
	<front>
	  <title>Level 3 multihoming shim protocol</title>
	  
	  <author initials='M' surname='Bagnulo' fullname='Marcelo Bagnulo'>
	    <organization />
	  </author>
	  
	  <author initials='E' surname='Nordmark' fullname='Erik Nordmark'>
	    <organization />
	  </author>
	  
	  <date month='October' year='2007' />
	  
	</front>
	
	<seriesInfo name='Internet-Draft' value='draft-ietf-shim6-proto-09' />
	<format type='TXT'
		target='http://www.ietf.org/internet-drafts/draft-ietf-shim6-proto-09.txt' />
      </reference>
      
      <reference anchor='RFC4423'>

	<front>
	  <title>Host Identity Protocol (HIP) Architecture</title>
	  <author initials='R.' surname='Moskowitz' fullname='R. Moskowitz'>
	  <organization /></author>
	  <author initials='P.' surname='Nikander' fullname='P. Nikander'>
	  <organization /></author>
	  <date year='2006' month='May' />
	</front>
	
	<seriesInfo name='RFC' value='4423' />
	<format type='TXT' octets='61049' target='ftp://ftp.isi.edu/in-notes/rfc4423.txt' />
      </reference>
      
<!--
      <reference anchor='RFC3493'>
	
	<front>
	  <title>Basic Socket Interface Extensions for IPv6</title>
	  <author initials='R.' surname='Gilligan' fullname='R. Gilligan'>
	  <organization /></author>
	  <author initials='S.' surname='Thomson' fullname='S. Thomson'>
	  <organization /></author>
	  <author initials='J.' surname='Bound' fullname='J. Bound'>
	  <organization /></author>
	  <author initials='J.' surname='McCann' fullname='J. McCann'>
	  <organization /></author>
	  <author initials='W.' surname='Stevens' fullname='W. Stevens'>
	  <organization /></author>
	<date year='2003' month='February' /></front>
	
	<seriesInfo name='RFC' value='3493' />
	<format type='TXT' octets='82570'
		target='ftp://ftp.isi.edu/in-notes/rfc3493.txt' />
      </reference>
-->

      <reference anchor='RFC3542'>

	<front>
	  <title>Advanced Sockets Application Program Interface (API)
	  for IPv6</title>
	  <author initials='W.' surname='Stevens' fullname='W. Stevens'>
	  <organization /></author>
	  <author initials='M.' surname='Thomas' fullname='M. Thomas'>
	  <organization /></author>
	  <author initials='E.' surname='Nordmark' fullname='E. Nordmark'>
	  <organization /></author>
	  <author initials='T.' surname='Jinmei' fullname='T. Jinmei'>
	  <organization /></author>
	<date year='2003' month='May' /></front>
	
	<seriesInfo name='RFC' value='3542' />
	<format type='TXT' octets='173028'
		target='ftp://ftp.isi.edu/in-notes/rfc3542.txt' />
      </reference>
      
      <reference anchor='I-D.ietf-shim6-failure-detection'>
	<front>
	  <title>Failure Detection and Locator Pair Exploration Protocol for IPv6  Multihoming</title>
	  
	  <author initials='J' surname='Arkko' fullname='Jari Arkko'>
	    <organization />
	  </author>
	  
	  <author initials='I' surname='Beijnum' fullname='Iljitsch van Beijnum'>
	    <organization />
	  </author>
	  
	  <date month='January' day='23' year='2008' />
	  
	</front>
	
	<seriesInfo name='Internet-Draft' value='draft-ietf-shim6-failure-detection-10' />
	<format type='TXT'
		target='http://www.ietf.org/internet-drafts/draft-ietf-shim6-failure-detection-10.txt' />
	<format type='PDF'
		target='http://www.ietf.org/internet-drafts/draft-ietf-shim6-failure-detection-10.pdf' />
      </reference>
      
      <reference anchor='POSIX'>
	<front>
	  <title>IEEE Std. 1003.1-2001 Standard for Information
	  Technology -- Portable Operating System Interface
	  (POSIX). Open group Technical Standard: Base Specifications,
	  Issue 6, http://www.opengroup.org/austin</title>
	  <author initials='' surname=''
		  fullname='IEEE Standard'>
	    <organization />
	  </author>
	  <date month='December' day='1' year='2001' />
	</front>
	<format type='TXT'
		target='http://www.opengroup.org/austin' />
      </reference>

      <!--
	  <reference anchor='I-D.henderson-hip-applications'>
	  <front>
	  <title>Using HIP with Legacy Applications</title>
	  <author initials='T' surname='Henderson' fullname='Tom Henderson'>
	  <organization />
	  </author>
	  <author initials='P' surname='Nikander' fullname='Pekka Nikander'>
	  <organization />
	  </author>
	  <date month='May' day='17' year='2006' />
	  </front>
	  <seriesInfo name='Internet-Draft'
	  value='draft-henderson-hip-applications-03' />
	  <format type='TXT'
	  target='http://www.ietf.org/internet-drafts/draft-henderson-hip-applications-03.txt' />
	  </reference>
      -->

    </references>

    <references title="Informative References">

      <reference anchor='I-D.ietf-shim6-app-refer'>
	<front>
	  <title>Shim6 Application Referral Issues</title>
	  <author initials='E' surname='Nordmark' fullname='Erik Nordmark'>
	    <organization />
	  </author>
	  <date month='July' day='5' year='2005' />
	</front>
	<seriesInfo name='Internet-Draft' value='draft-ietf-shim6-app-refer-00' />
	<format type='TXT'
		target='http://www.ietf.org/internet-drafts/draft-ietf-shim6-app-refer-00.txt' />
      </reference>

      <!--
	  <reference anchor='I-D.nordmark-shim6-esd'>
	  <front>
	  <title>Extended Shim6 Design for ID/loc split and Traffic
	  Engineering</title>
	  <author initials='E' surname='Nordmark' fullname='Erik Nordmark'>
	  <organization />
	  </author>
	  <date month='February' day='26' year='2006'/>
	  </front>
	  <seriesInfo name='Internet-Draft' value='draft-nordmark-shim6-esd-00' />
	  <format type='TXT'
	  target='http://www.ietf.org/internet-drafts/draft-nordmark-shim6-esd-00.txt' />
	  </reference>
      -->

      <reference anchor='RFC3972'>
	<front>
	  <title>Cryptographically Generated Addresses (CGA)</title>
	  <author initials='T.' surname='Aura' fullname='T. Aura'>
	  <organization /></author>
	<date year='2005' day='11' month='March' /></front>
	
	<seriesInfo name='RFC' value='3972' />
	<format type='TXT' octets='51473'
		target='ftp://ftp.isi.edu/in-notes/rfc3972.txt' />
      </reference>
      
      <reference anchor='I-D.ietf-shim6-hba'>
	<front>
	  <title>Hash Based Addresses (HBA)</title>
	  <author initials='M' surname='Bagnulo' fullname='Marcelo Bagnulo'>
	    <organization />
	  </author>
	  <date month='December' day='22' year='2007' />
	</front>
	<seriesInfo name='Internet-Draft' value='draft-ietf-shim6-hba-05' />
	<format type='TXT'
		target='http://www.ietf.org/internet-drafts/draft-ietf-shim6-hba-05.txt' />
      </reference>
      
      <reference anchor='RFC2765'>
	<front>
	  <title abbrev='SIIT'>Stateless IP/ICMP Translation Algorithm (SIIT)</title>
	  <author initials='E.' surname='Nordmark' fullname='Erik Nordmark'>
	  <organization /></author>
	  <date year='2000' month='February' />
	</front>
	  
	<seriesInfo name='RFC' value='2765' />
	<format type='TXT' octets='59465' target='ftp://ftp.isi.edu/in-notes/rfc2765.txt' />

      </reference>
      
    </references>

    <section title="Context Forking">

      <t>In this section, an issue concerning context forking and its
      relation to the multihoming shim API are discussed.</t>
      
      <t>SHIM6 supports a notion of context forking.  A peer may
      decide to fork a context for certain reason (e.g. upper layer
      protocol prefers to use different locator pair than the one
      defined in available context).  The procedure of forking context
      is done similar to the normal context establishment, performing
      the 4-way message exchange.  A peer who has decided to fork a
      context initiates the context establishment.  Hereafter, we call
      this peer initiator.</t>

      <t>Once the forked context is established between the peers, on
      the initiator side, it is possible to apply forked context to
      the packet flow since the system maintains an association
      between the forked context and the socket owned by the
      application that has requested the context forking.  How this
      association is maintained is implementation specific issue.
      However, on the responder side, there is a question on how the
      outbound packet can be multiplexed by the shim layer.  Since
      there are more than one SHIM6 contexts that match with the ULID
      pair of the packet flow.  There is a need to differentiate
      packet flows not only by the ULID pairs but some other
      information and associate a given packet flow with specific
      context.</t>
      
      <t><xref target="fig-context-forking"/> gives an example of a
      scenario where two communicating peers fork a context.
      Initially, there has been a single transaction between the
      peers, by the application 1 (App1).  Accordingly, another
      transaction is started, by application 2 (App2).  Both of the
      transactions are made based the same ULID pair.  The first
      context pair (Ctx1) is established for the transaction of App1.
      Given the requests from App2, the shim layer on Peer 1 decides
      to fork a context.  Accordingly, a forked context (Ctx2) is
      established between the peers, which should be exclusively
      applied to the transaction of App2.  Ideally, multiplexing and
      demultiplexing of packet flows that relate to App1 and App2
      should be done as illustrated in <xref
      target="fig-context-forking"/>.  However, as mentioned earlier,
      on the responder side, there is a problem with multiplexing the
      outbound packet flows of App1 and App2.

      <figure anchor="fig-context-forking" title="context forking">
	<artwork><![CDATA[
           Peer 1                                     Peer 2   
         (initiator)                                (responder)

    +----+         +----+                      +----+         +----+
    |App1|         |App2|                      |App1|         |App2|
    +----+         +----+                      +----+         +----+
      |^             |^                          ^|             ^|
      v|             v|                          |v             |v
 -----S1-------------S2-----                -----S1-------------S2-----
      ||             ||                          ||             ||
      ||             ||                          ||             ||

     Ctx1           Ctx2                        Ctx1           Ctx2
 ULID:<A1,B1>   ULID:<A1,B1>                ULID:<B1,A1>    ULID:<B1,A1>
 Loc: <A1,B2>   Loc: <A1,B3>                Loc: <B2,A1>    Loc: <B3,A1> 
 FII: 0         FII: 100                    FII: 0          FII: 100
 
      |^             |^                          ^|             ^|
      ||             ||                          ||             ||
      ||             ||                          ||             ||
      \..............||........................../|             ||
       \.............||.........................../             ||
                     ||                                         ||
                     \|........................................./|
                      \........................................../
       ]]></artwork>
      </figure>
      </t>

      <t>To overcome the problem mentioned above, there are some
      solutions.</t>
      
      <t>One viable approach is to let the system implicitly maintain
      an association between the socket and the associated context by
      keeping the record of inbound packet processing.  That is, the
      system stores the information about the context on which the
      inbound packet flow was demultiplexed.  The information
      comprises the ULID pair and FII of the context and is stored in
      the socket instance.  Later, the system can use the information
      to identify the associated context in outbound packet
      processing.  This approach should be feasible as far as there is
      bi-directional user traffic.</t>

      <t>Another viable approach is to extend SHIM6 protocol by adding
      capability of exchanging additional information to identify the
      packet flow from others which needs to be handled by a newly
      forked context.  The information exchange can be done during the
      context establishment.  The initiator appends 5 tuple of the
      packet flow to be handled by the newly forked context.  Note
      that the additional information provided by the 5 tuple are
      source and destination port numbers and upper layer protocol.
      The information is later used by the shim layer to multiplex the
      outbound packet flow on the responder side.</t>

      <t>The socket options for multihoming shim can be used by the
      application to trigger the context forking in implicit manner.
      The peer becomes an initiator in the establishment of the forked
      context.  Once the forked context is established between the
      peers, application on each end can influence the preference on
      context by utilizing the multihoming shim API.</t>

    </section>

  </back>
</rfc>

PAFTECH AB 2003-20262026-04-24 01:20:19