<?xml version="1.0" encoding="UTF-8"?><?rfc linefile="1:/tmp/CGI23151.1"?><?rfc linefile="1:/tmp/CGI23151.1"?><?rfc linefile="1:/tmp/CGI28523.1"?><?rfc linefile="1:/tmp/CGI28523.1"?>
<!-- automatically generated by xml2rfc v1.35 on 2010-07-15T12:23:44Z -->
<!-- automatically generated by xml2rfc v1.35 on 2010-07-15T12:23:44Z -->
<!-- automatically generated by xml2rfc v1.35 on 2010-07-11T05:47:42Z -->
<!-- automatically generated by xml2rfc v1.35 on 2010-07-11T05:47:42Z -->
<?xml-stylesheet type='text/xsl' href='./rfc2629.xslt' ?>

<?rfc toc="yes"?>
<?rfc symrefs="no"?>
<?rfc compact="yes" ?>
<?rfc sortrefs="yes" ?>
<?rfc strict="yes" ?>
<?rfc linkmailto="yes" ?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" >
    
<?xml-stylesheet type='text/xsl' href='./rfc2629.xslt' ?>

<?rfc toc="yes"?>
<?rfc symrefs="yes"?>
<?rfc compact="yes" ?>
<?rfc subcompact="yes" ?>
<?rfc sortrefs="yes" ?>
<rfc ipr="trust200902" docName="draft-kagarigi-ipsecme-ikev2-windowsync-04" category="std">
  <front>
    <title abbrev="IKEv2/IPsec SA Counter synchronization">IKEv2/IPsec SA counter synchronization</title>
    <author initials="G." surname="Kalyani" fullname="Kalyani Garigipati">
      <organization abbrev="Cisco">Cisco Systems, Inc.</organization>
      <address>
        <postal>
          <street>SEZ Unit, Cessna Business Park</street>
          <city>Bangalore</city>
          <region>Karnataka</region>
          <code>560025</code>
          <country>India</country>
        </postal>
        <phone>+91 80 4426 4831</phone>
        <email>kagarigi@cisco.com</email>
      </address>
    </author>
    <date year="2010"/>
    <area>Security Area</area>
    <keyword>Internet-Draft</keyword>
    <abstract>
      <t> IKEv2 and IPsec protocols are widely used for deploying VPN. 
            In order to make such VPN highly available and failure-prone, these VPNs are implemented as IKEv2/IPsec Highly Available (HA) cluster.
            But there are many issues in IKEv2/IPsec HA cluster. The draft  "IPsec Cluster Problem Statement" enumerates all the issues encountered in
            IKEv2/IPsec HA cluster environment.</t>

      <t> This draft proposes an extension to IKEv2 protocol to solve main issues of "IPsec Cluster Problem Statement" in Hot Standby cluster 
            and gives implementation advice for others. The main issues to be solved are: <list style="symbols">  

      <t> IKE Message Id synchronization : This is done by obtaining the message Id values from the peer and updating the 
            values at the newly active cluster member after the failover. </t>

      <t> IPsec SA Counter synchronization : This is done by sending incremented the values of replay counters by the newly active
            cluster member to the peer as expected replay counter value. </t>
     </list>
    </t>

 </abstract>
  </front>
  <middle>
    <!-- ====================================================================== -->
    <section title="Introduction" toc="default">
        <t> IKEv2 is used for deploying IPsec-based VPNs. In order to make such VPN highly available and failure-prone, these VPNs are inplemented as 
              IKEv2/IPsec Highly Available (HA) cluster. But there are many issues in IKEv2/IPsec HA cluster. The draft  "IPsec Cluster Problem Statement"
              enumerates all the issues encountered in IKEv2/IPsec HA cluster. </t>
              
        <t> In case of Hot Standby cluster implementaion of IKEv2/IPsec based VPNs, the IKEv2/IPsec session gets established with the peer and the 
              active member of cluster. After that, the active member syncs/updates the IKE/IPsec SA state to the standby member of the cluster. This 
              primary SA state sync-up is done on SA bring up and/or rekey. Doing SA state synchronization/updation between active and peer member 
              for each IKE and IPsec message standby cluster is very costly, so normally its done periodically. So, when "failover" event happens in the 
              cluster, first "failover' is detected by the standby member and then it becomes active member and it takes considerable time. During the time
              of failover and standby member becoming newly active member, the peer is unaware of failover and keeps sending IKE request and IPsec packets 
              to the cluster which is allowed as per IKEv2 and IPsec windowing feature. Now, newly active member after coming up finds the mismtach in IKE message 
              id's and IPsec replay counters. Please see <xref target="sync_problem"/> for more details. </t>             

        <t> This draft proposes an extension to IKEv2 protocol to solve main issues of IKE message id sync and IPsec SA replay counter sync and gives 
              implementation advice for others. Here is summary of solutions provided in this draft:  </t>

        <t> IKE Message Id synchronization : This is done by obtaining the message Id values from the peer and updating the 
            values at the newly active cluster member after the failover. </t>

       <t> IPsec SA Counter synchronization : This is done by sending incremented values of replay counters by the newly active 
             cluster member to the peer as expected replay counter value. </t>

        <t> Though this draft describes the IKEv2/IPsec SA counter synchronisation in context of hot standby cluster. This solution can be 
             in other scenarios where IKEv2/IPsec SA counters are mis-matched and couner sync is needed.</t>

 </section>

    <section toc= "default" title="Terminology">
      <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT",
        "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in
          <xref target="RFC2119" pageno="false" format="default">RFC 2119</xref>.</t>

         <t> "SA Counter SYNC Request" is the information exchange request defined in this draft to synchronize the 
                 IKEv2/IPsec SA counter information between member of the cluster and the peer. </t>
          
          <t> "SA Counter SYNC Response" is the information exchange response defined in this draft to synchronize 
                 the IKEv2/IPsec SA counter information between member of the cluster and the peer. </t> 

          <t> Below are the terms taken from  <xref target="IPsec Cluster Problem Statement"/> with added information 
                in context of this draft. </t>

          <t> "Hot Standby Cluster", or "HS Cluster" is a cluster where only one of  the members is active at any one time. 
                 This member is also referred  to as the "active", whereas the other(s) are referred to as "standbys".  
                  VRRP ([RFC5798]) is one method of building such a cluster. The goal of Hot Standby Cluster is that it
                  creates illusion of single virtual gateway to the peer(s). </t>  
          
          <t> "Active Member" is the primary member in the Hot Standby cluster. It is responsible for forwarding packets
                for the virtual gateway. </t>
           
          <t> "Standby Member" is the primary backup router. The member takes control i.e. becomes active member after
                 the "failover" event. </t>
           
          <t> "Peer" is the IKEv2/IPsec endpoint which establishes VPN connection with Hot Standby cluster. The Peer 
                 knows Hot Standby Cluster by single cluster's IP address. In case of "failover", the standby member of the
                 cluster becomes active, so the peer normally doesn't notice that "failover" has occured in the cluster. </t>

           <t> The generic term IKEv1/IPsec SA counters is used throughout. By IKEv2 SA counter stands for IKEv2 message ids
                  and IPsec SA counter stands for IPsec SA replay counters which are used to provide optional anti-replay feature. </t>
     </section>

<section  title="Issues solved from IPsec Cluster Problem Statement" toc="default">        
      <t>  IPsec Cluster Problem Statement defines the problems encountered in IPsec Clusters.
      . The problems along with their section names as given in the statement are as follows. 
<list style="symbols">  

    <t>   3.2.  Lots of Long Lived State </t>
     <t>  3.3.  IKE Counters</t>
     <t>  3.4.  Outbound SA Counters</t>
      <t> 3.5.  Inbound SA Counters</t>
     <t>  3.6.  Missing Synch Messages</t>
     <t>  3.7.  Simultaneous use of IKE and IPsec SAs by Different
           Members    <list style="symbols">  
      <t>   3.7.1.  Outbound SAs using counter modes</t>
    </list>
     </t>
    <t>   3.8.  Different IP addresses for IKE and IPsec</t>
     <t>  3.9.  Allocation of SPIs</t>
    </list>
    </t>

   <t> This draft solves the main issues using the protocol extention,
 and provides implementation advice for other issues, given as follows.

<list style="symbols">  

<t>3.2 This section mentions that  there's lots of state that needs to be synchronized. 
If state is not synchronized, it's not really an interesting cluster - failover will be just like a 
reboot, so the issue need not be solved with protocol extensions. </t>

<t>3.3, 3.4,3.5, and 3.6 are solved by this draft. Please see <xref target="sync_problem"/>, 
     for more details. </t>
<t>3.7 is  the problem to be solved while building clusters.  
        However,  the peers should be mandated to accept multiple parallel SAs for 3.7.1 </t>
<t> 3.8 can be solved by using IKEv2 Redirect Mechanism [RFC-5685].</t>
<t>3.9 is the problem about avoiding collision of same SPI's among the cluster members. This 
is outside the scope of the document since this has to be solved within the context of the cluster and
not with the peer.</t>

</list>
</t>

    <t> </t>
    </section>      

<section anchor = "sync_problem" title="IKEv2/IPsec SA Counter Synchronization Problem " toc="default">
      <t>  IKEv2 RFC states that "An IKE endpoint MUST NOT exceed the peer's stated window size for
        transmitted IKE requests".</t>

      <t>As per the protocol, all IKEv2 packets follows request-response paradigm. 
        The initiator of an IKEv2 request MUST retransmit the request, until it has received a response from the peer.
        IKEv2 introduces a windowing mechanism that allows multiple requests to be outstanding at a given point of time, but mandates
        that the sender window does not move until the oldest message sent from one peer to another is acknowledged.
        Loss of even a single packet leads to repeated retransmissions followed by an IKEv2 SA teardown if the retransmissions are unacknowledged.</t>

      <t> IPsec Hot Standby Cluster is required to ensure that in case of failover of active member, the standby member becomes active immediately.
        The standby member is expected to have the exact values of message id fields of active member before failover.
        Even with the best efforts to update the message Id values from active to standby member, the values at standby 
        member can be stale due to following reasons:

        <list style="symbols">         
                  
        <t> Standby member is unaware of the last message that was received and acknowledged by the 
          older active member as failover could have happened before the standby could be updated.</t>
     
         <t> Standby member does not have information about on-going unackowledged requests of active member before the failover event.
              So after failover event when standby member becomes active, it can not re-transmit those requests.</t>
        </list>
         </t>
        <t> </t>
        
      <t> When a standby member takes over as the active member, it would start the message id ranges from previously updated values.
        This would make it reject requests from the peer, since the values would be stale.
        As a sender, the standby member may end up reusing a stale message id which will cause the peer to drop the request.
        Eventually there is a high probability of the IKEv2 and corresponding IPsec SAs getting torn down simply because of a 
        transitory message id mismatch and re-transmission of requests.  This is not a desirable feature of HA. Even after updating 
        standby memeber periodically the cluster can loose IKE and so all IPsec SA due to message id i.e. SA counter mismatch. </t>
        
      
     <t>Similar issue is observed in IPsec counters also if anti-replay protection/ESN is implemented. Even with the best efforts of syncing the ESP and AH SA counter numbers from
active to stand by member , there is a chance that the stand-by member would have stale counter values. The standby member would then send the stale counter numbers.
The peer would reject such packets since in case of anti-replay protection feature, duplicate use of counters are not allowed. In case of IPsec it is ok to skip 
some counter values and start with the highr counter values.</t>
         
<t>Hence a mechanism is required in HA to ensure that the standby member has correct values of message Id values and IPsec counters, 
        so that sessions are not torn down just because of window ranges.</t>   

  </section>
      
    <section title="IKEv2/IPsec SA Counter Synchronization Solution" toc="include">
      <t>After the standby member becomes the active member after failover event in the cluster, the standby member 
        would send an authenticated IKEv2 request to the peer to send its values of SA counters.</t>
        
       <t> The standby member would then update its values of SA counters and then start sending/receiving the requests.</t>   
      
       <t> The peer MUST negotiate its ability to support SA counter synchronization information with active member by sending the 
            SYNC_SA_COUNTER_INFO_SUPPORTED notification in IKE_AUTH exchange. </t>
     
     <figure align="left" >
        <artwork align="left" xml:space="preserve"> 

    Peer                                                Active Member
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
   HDR, SK {IDi, [CERT], [CERTREQ], [IDr], AUTH, 
    N[SYNC_SA_COUNTER_INFO_SUPPORTED], SAi2, TSi, TSr} ----------&gt;
                                
    &lt;---------- HDR, SK {IDr, [CERT+], [CERTREQ+], AUTH, 
                  N[SYNC_SA_COUNTER_INFO_SUPPORTED], SAr2, TSi, TSr} 
        
       </artwork>            
     </figure>
      
         <t> When peer and active member both support SA counter synchronization, the active member MUST sync/update SA counter 
               synchronization capability to the standby member after the establishment of the IKE SA. So that standby member is aware of 
               the capability and can use it when it becomes the active member after failover event.</t>

         <t>  After failover event, when the standby member becomes the active member, it has to request the peer for the SA counters.
                Standby member would initiate the SYNC Request with an INFORMATIONAL exchange containing the notify SYNC_SA_COUNTER_INFO.
                The SYNC_SA_COUNTER_INFO information can be used for update IKEv2 counters i.e. message ids and also IPsec SA replay counters. </t> 

       <t> If there are many IPsec SAs and all IPsec SA counters cannot be synchronized with a single counter sync exchange,
             then another counter sync exchange SHOULD be send for remaining IPsec SAs, but for this exchnage message id would be synced 
             IKE message id after first cpunter sync exchnage NOT zero. </t>

         <t>  The peer will  respond back with the notify SYNC_SA_COUNTER_INFO. The SYNC_SA_COUNTER_INFO request contains 
                NONCE data to avoid DOS attack due to replay of SA counter sync response. The Nonce data send in SYNC_SA_COUNTER_INFO
                response MUST match with nonce data sent by newly-active member in SYNC_SA_COUNTER_INFO request. If nonce data received in 
                SYNC_SA_COUNTER_INFO response does not match with nonce data sent in SYNC_SA_COUNTER_INFO request, the standby i.e. 
                newly-active member MUST discard this SYNC_SA_COUNTER_INFO response, and normal IKEv2 behaviour of re-transmitting the
                request and waiting for genuine reply from the peer SHOULD follow, before tearing down the SA becuase of re-transmits. </t>

<figure align="left" >
        <artwork align="left" xml:space="preserve"> 

   Standby [Newly Active] Member                            Peer
   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
   HDR, SK {N[SYNC_SA_COUNTER_INFO]+} --------&gt;
                                   
             &lt;--------- HDR, SK {N[SYNC_SA_COUNTER_INFO]+}
       
</artwork>              
      </figure>
             
    </section>
    
    <section anchor="sync_payload" title="SA counter synchronization notify and payload types" toc="default">
      
    <t>Below are the new notify and payload types that are defined </t>
       

 <section   toc="include" title="SYNC_SA_COUNTER_INFO_SUPPORTED">   

<t>SYNC_SA_COUNTER_INFO_SUPPORTED:  This notify is included in the IKE_AUTH request by the peer to indicate the 
     support for IKEv2/IPsec SA counter synchronization mechanism described in this document. 
      
      <figure align="left" title="SYNC_SA_COUNTER_INFO_SUPPORTED">
        <artwork align="left" xml:space="preserve"> 

                          1                   2                   3
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    | Next Payload  |C|  RESERVED   |         Payload Length        |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |Protocol ID(=0)| SPI Size (=0) |      Notify Message Type      |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

              </artwork>
      </figure>
      </t>
    
     <t> The 'Next Payload', 'Payload Length', 'Protocol ID', 'SPI Size', and 'Notify Message Type'
           fields are the same as described in Section 3 of <xref target="IKEv2bis"/>.  
            The 'SPI Size' field MUST be set  to 0 to indicate that the SPI is not present in this message.  
            The 'Protocol ID' MUST be set to 0, since the notification is not specific to a particular security association. 
      
            'Payload Length' field is set to the length in octets of the entire payload, including 
             the generic payload header.  The 'Notify Message Type' field is set to indicate the 
            SYNC_SA_COUNTER_INFO_SUPPORTED payload. </t>

    </section>

 <section   toc="include" title="SYNC_SA_COUNTER_INFO">   
      <t> SYNC_SA_COUNTER_INFO :  This payload type is defined to sync the SA counter information among
             newly-active [standby] member and the peer. The SYNC_SA_COUNTER_INFO payload can be used 
             to synchronize IKE SA counter and IPsec SA counters as well. So, multiple payloads of this type can be 
             used in the single exchange where one payload is used to sync the IKE SA counter information, 
             another payload can be used to sync the Child SA [ e.g. ESP, AH etc] information.

     
          
          <figure align="left" title="SYNC_SA_COUNTER_INFO">
            <artwork align="left" xml:space="preserve"> 

         1                   2                   3
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    | Next Payload  |M|  RESERVED   |         Payload Length        |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |Protocol ID    | SPI Size      | # of SPI's    |Counter Size   |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    | 							            |
    ~                                                               ~
    |                                                               | 
    ~                     Nonce Data                                ~
    |                                                               |
    ~                                                               ~
    |                                                               |  
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |             EXPECTED_SEND_REQ_MESSAGE_ID                      |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |             EXPECTED_RECV_REQ_MESSAGE_ID                      |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
    |                            SPI                                |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
    |                                                               |
    ~            Last Counter                                       ~
    |                                                               |     
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
            </artwork>
          </figure>
 It contains the following data.<list style ="symbols" >   
        <t> Protocol ID (1 octet) - Must be 1 for an IKE SA, 2 for AH, or 3 for ESP.


</t>

       <t>SPI Size (1 octet) - Length in octets of the SPI as defined by the
      protocol ID.  It MUST be zero for IKE or four for AH and ESP.


</t>

      <t>  # of SPIs (1 octet) - The number of SPIs contained in this
            payload.  The size of each SPI is defined by the SPI Size field. It MUST be 
          zero if protocol is IKE.


</t>

      <t> Counter Size (1 octet) is  the size of IPsec SA counter in octets. It is 4 if the Extended 
            Sequence Numbers option is not set for the SAs described in this payload, or 8 otherwise.
             It MUST be zero if protocol is IKE.

</t>           

       <t>  Nonce Data (16 octets) - The nonce data MUST be present if protocol  is IKE. The nonce 
              data is used to counter the replay of SYNC_SA_COUNTER_INFO response by the attacker. </t>

      <t> EXPECTED_SEND_REQ_MESSAGE_ID (4 octets) : This MUST be present only if protocol ID is IKE. 
            This field is used by the sender of this notify,  to indicate the message Id it will use in the next request, t
             that it will send to the peer. It MUST be present only in SA counter synchronization response and MUST 
             be ignored in SA counter synchronization request. </t>

       
            
        <t> EXPECTED_RECV_REQ_MESSAGE_ID(4 octets) : This field is used by the sender of this notify,
              to indicate the message Id it can accept in the next request, received from the peer.This data MUST be present
              only in response and MUST be ignored if present in REQUEST.This MUST be present only if protocol ID is IKE.</t>

      <t> SPI (4 octets) is the Security Parameter Index of the outbound SA
      for the sender, or the inbound SA for the receiver. </t>

  <t> Last Counter (4 or 8 octets) is the counter number of the last
      packet sent.  The receiver MUST drop any IPsec packet with replay
      counter lower than this. </t>
 <t> M (More - 1 bit) - This flag MUST be set when there are some IPsec are left to be synced, but can not 
       be send due to packet size or some other limitation. When M bit is zero it, it tell it is last SA counter sync message.</t>
         </list>

        </t>    
</section> 
 </section>

   
    <section title="Details of implementation" toc="include">
      
<t> The message Id used in this exchange MUST be zero so that it is not vaildated
   upon receipt. Message Id zero MUST be permitted only for informational exchange that would have
   NOTIFY of type SYNC_SA_COUNTER_INFO. If any packet uses the message Id Zero,
   without having this Notify along with the Nonce payload, then such packets MUST be discarded upon decryption.
   No other payloads are allowed in this Informational exchange.</t>
       
      <t>    The standby member can initiate the synchronization of IKEv2 Message Id's    <list style="symbols">   
               
       <t>  When it receives the bad IKEv2/IPsec packet. The 'bad" IKEv2/IPsec packet means a packet outside receive window.</t>
        <t> When it has to send an IKEv2/IPsec packet after failover event.</t>
        <t>  It has just got the control from active member and would require to update the values before-hand,
        so that it need not start this exchange at the time of sending/receiving the request.</t> 
      </list>
      </t>
        
 <t>    The standby member can initiate the synchronization of IPsec SA Counters     <list style="symbols">   
               
       <t>  If there is traffic using the IPsec SA in the recent past and there could be stale replay counter at standby member</t>
       </list>
      </t>

      <t> Since there can be many sessions at Standby member, and sending exchanges from all of the
        sessions can cause throttling, the standby member can choose to initiate the exchange when it has to
        send or receive the request. Thus the trigger to initiate this exchange depends on the requirement/discretion
        of the standby member.</t>
      
      <t> The member which has not announced its capability  SYNC_SA_COUNTER_INFO_SUPPORTED
            MUST NOT send/receive  the notify SYNC_SA_COUNTER_INFO. </t>
      
      <t> If a peer gets SYNC_SA_COUNTER_INFO request even though it did not announce its capability in IKE_AUTH exchange,
            then it MUST ignore this message. </t>
                         
    </section> 
   

<section title = "Step-by-Step details" toc="default">
<t>
The step by step details of the synchronisation of IKE message Id  is as follows.

 <list style="symbols">    

<t> Active member and peer device establish the session . They announce the capability to sync the counter info 
by sending   SYNC_SA_COUNTER_INFO_SUPPORTED notify in AUTH Exchange.</t>

<t> Active member dies and Stand-by member takes over. .
 Stand-by Member sends its own idea of the IKE Message ID (its side)  to peer. </t>

<t> The peer will send its EXPECTED_SEND_REQ_MESSAGE_ID  and EXPECTED_RECV_REQ_MESSAGE_ID.
Since the message Id values received are higher than values at the stand-by member , itwould update its local values of message Id's
 with the received values.</t>

 <t>The peer should not wait for pending response  while responding with this message Id values.
 For example if window size is 5 and   peer window is 3-7  and if peer has sent requests 3, 4,5,6,7 and 
but got response only for 4,5,6,7 but not 3 then  it should send the EXPECTED_SEND_REQ_MESSAGE_ID as 
8 and should not wait for response of 3 anymore.</t>

   <t>  The peer should not wait for pending request also. For example if window size is 5 and 
 peer window is 3-7  and if peer has received requests 4,5,6,7 but not 3 then  it should send the
EXPECTED_RECV_REQ_MESSAGE_ID as 8 and should not wait for 3 anymore.</t>

</list>
</t>

<t>
The step by step details of the synchronisation of IPsec SA Counter synchronization  is as follows.

 <list style="symbols">    

<t> Active member and peer device establish the session . They announce the capability to sync the counter info 
by sending   SYNC_SA_COUNTER_INFO_SUPPORTED notify in AUTH Exchange.</t>

<t> Active member dies and Stand-by member takes over.
 Stand-by Member increments its values of Outbound SA Counters for each IPsec SA and sends them to the peer. </t>

<t> The peer will update its Inbound SA Counter corresponding to each IPsec SA  and send its 
Outbound SA Counter value for each IPsec SA on it.</t>

<t> If replay counters were bumped by large amount, we MAY slowly do child sa rekey to reset counter when member is less loaded 
      after failover event. </t>
 
</list>
</t>

</section>

<section anchor="Security" title="Security Considerations" toc="default">

<t>
There can be two types of DOS attacks.

 <list style="symbols">    
   <t>  Replay of Message SYNC Request.
   This can be countered by rate limiting the number of such requests a peer  can receive.
   The rate limiting can be done either by number or the time delay between which Message SYNC request 
can be received or both.These options are configurable. </t>    

   <t> Replay of Message SYNC Response.
   This can be countered by sending the NONCE data along with the SYNC_SA_COUNTER_INFO notify. The same  NONCE 
    data has to be returned in response.  Thus the standby member can accept the reply only for the current request.
   After it receives the response, it MUST not accept the same response again and MUST drop the response.
</t>
   </list>   

</t>  
       </section>
    
  <section title="Interaction with other drafts" toc="default">
<t>
         The primary assumption of IKEv2/IPsec SA Counter Synchronization prososal is IKEv2 SA has been established between 
          active member of Hot Standby Cluster and peer, after that the failover event occurred and now standby member 
          has "become" active. It also assumes the IKEv2 SA state was synced between active and standby member of the 
          Hot Standby Cluster before the failover event.

 <list style="symbols">    
   <t>  Session Resumption. 
          Session resumption assumes that peer i.e. client or initiator detects the need to re-establish the session. In 
          IKEv2/IPsec SA counter cynchronization, standby member which becomes active i.e. gateway or responder
          detects the need to synchronize the SA counter after the failover event. 
          Also in Hot Standby Cluster, peer establishes the IKEv2/IPsec session with single cluster's IP address, so peer normally does
          not detect the event of failover in the cluster until standby member took very long to become active and IKEv2 SA times out via
          liveness check. So, session resumption and SA counter synchronization after failover are mutually exclusive.</t>


   <t> This document describes the operation of tightly coupled clusters, which are the common way of building IPsec clusters.
          In these clusters, all members appear to the peer as one gateway, specifically they share a single IP address.
          High availability can also be provided by loosely coupled clusters (for lack of a better term), which are a group of gateways
          that do not share an IP address and do not synchronize state. 
          In this architecture, the client can use Session Resumption to fail-over from one cluster member to another. Specifically this requires:
       <list style="symbols">    
          <t>Support of session resumption on peers and gateways.</t>
          <t>A common session resumption ticket format on all gateways (not currently standardized).</t>
          <t>Configuration on the peers of the group of gateways that constitute the cluster.</t>
       </list>
    </t>

   <t> Redirect.
         Redirect mechanism for load-balancing can be used during init (IKE_SA_INIT) and auth (IKE_AUTH) and after session 
         establishment. While SA counter sync is used after IKE SA has been established and failover event has occurred.
         So it is mutually exclusive with redirect during init and auth. The redirect after session established is used for timed
         or planned shutdown/maintenance. The failover event can not be detected on active member beforehand and so using 
         redirect after session establishment is not possible in case of failover. So, Redirect and SA counter synchronization 
         after failover are mutually exclusive.
    </t>

   <t> Crash detection. 
         Either SA counter information sync or crash detection approach can be taken by standby member on failover event.
    </t>

 </list>   

</t>  
       </section>

    <section  title="IANA Considerations" toc="default">        
      <t>
        This document  introduces two new IKEv2 Notification Message types as
        described in Section 6.The new Notify Message Types must be assigned values between 16396 and 40959.
   <list style="symbols">    
   <t>  SYNC_SA_COUNTER_INFO_SUPPORTED</t>    
   <t>  SYNC_SA_COUNTER_INFO</t>    
    </list>
    </t>
    </section>  
    
    <section   toc="default" title="Acknowledgements">
      <t>  This draft is the combined effort of IPSECME WG assigned HA Design team which consists of the following members (in alphabetical order)  
             Dacheng Zhang, Min Huang, Raj Singh, Yaron Sheffer and Yoav Nir.
             I would like to thank Pratima Sethi and Frederic Detienne for their valuable reviews and suggestions.  </t>
    </section>    
    
  </middle>  
 
  <!-- ====================================================================== -->
  
  <back>    
<references title="Normative References"> 
          <reference anchor="RFC2119">
        <front>
          <title abbrev="RFC Key Words">Key words for use in RFCs to Indicate Requirement
            Levels</title>
          <author initials="S." surname="Bradner" fullname="Scott Bradner">
            <organization>Harvard University</organization>
            <address>
              <postal>
                <street>1350 Mass. Ave.</street>
                <street>Cambridge</street>
                <street>MA 02138</street>
              </postal>
              <phone>- +1 617 495 3864</phone>
              <email>sob@harvard.edu</email>
            </address>
          </author>
          <date year="1997" month="March"/>
          <area>General</area>
          <keyword>keyword</keyword>
        </front>
        <seriesInfo name="BCP" value="14"/>
        <seriesInfo name="RFC" value="2119"/>
        <format type="TXT" octets="4723" target="ftp://ftp.isi.edu/in-notes/rfc2119.txt"/>
        <format type="HTML" octets="16553"
          target="http://xml.resource.org/public/rfc/html/rfc2119.html"/>
        <format type="XML" octets="5703" target="http://xml.resource.org/public/rfc/xml/rfc2119.xml"
        />
      </reference>
     <reference anchor="IPsec Cluster Problem Statement">
        <front>
          <title>IPsec Cluster Problem Statement</title>
          <author initials="Y." surname="Nir" fullname="Y.Nir">
            <organization/>
          </author>
          <date year="2010" month="July"/>
        </front>
        </reference>
     <reference anchor='IKEv2bis'>
        <front>
          <title>Internet Key Exchange Protocol: IKEv2</title>
          <author initials='C.' surname='Kaufman' fullname='C. Kaufman'>
            <organization>Microsoft</organization></author>
          <author initials='P.' surname='Hoffman' fullname='P. Hoffman'>
            <organization>VPN Consortium</organization></author>
          <author initials='Y.' surname='Nir' fullname='Y. Nir'>
            <organization>Check Point</organization></author>
          <author initials='P.' surname='Eronen' fullname='P. Eronen'>
            <organization>Nokia</organization></author>
          <date year='2010' month='May' />
        </front>
        <seriesInfo name='Internet-Draft' value='draft-ietf-IPsecme-ikev2bis' />
        <format type='TXT'
          target='http://tools.ietf.org/id/draft-ietf-IPsecme-ikev2bis' />
        <format type='HTML'
          target='http://tools.ietf.org/html/draft-ietf-IPsecme-ikev2bis' />
      </reference>
      </references>

<references title="Informative References"> 
    
     <reference anchor='RFC5723'>
        <front>
          <title>IKEv2 Session Resumption</title>
          <author initials='Y.' surname='Sheffer' fullname='Y. Sheffer'>
            <organization>Check Point</organization></author>
          <author initials='H.' surname='Tschofenig' fullname='H. Tschofenig'>
            <organization>Nokia Siemens Networks</organization></author>
          <date year='2010' month='January' />
        </front>
        <seriesInfo name='RFC' value='5723' />
        <format type='TXT' target='http://www.ietf.org/rfc/rfc5723.txt' />
        <format type='HTML' target='http://xml.resource.org/public/rfc/html/rfc5723.html' />
        <format type='XML' target='http://xml.resource.org/public/rfc/xml/rfc5723.xml' />
      </reference>
     <reference anchor='RFC5685'>
        <front>
          <title>Redirect Mechanism for IKEv2</title>
          <author initials='V.' surname='Devarapalli' fullname='V. Devarapalli'>
            <organization>WiChorus</organization></author>
          <author initials='K.' surname='Weniger' fullname='K. Weniger'>
            <organization /></author>
          <date year='2009' month='November' />
        </front>
        <seriesInfo name='RFC' value='5685' />
        <format type='TXT' target='http://www.ietf.org/rfc/rfc5685.txt' />
        <format type='HTML' target='http://xml.resource.org/public/rfc/html/rfc5685.html' />
        <format type='XML' target='http://xml.resource.org/public/rfc/xml/rfc5685.xml' />
      </reference>

     </references>
     <!-- ====================================================================== -->
  </back>
  
 
  
</rfc>





