<?xml version="1.0" encoding="US-ASCII"?>
<!-- This template is for creating an Internet Draft using xml2rfc,
     which is available here: http://xml.resource.org. -->
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!-- One method to get references from the online citation libraries.
     There has to be one entity for each item to be referenced.
     An alternate method (rfc include) is described in the references. -->

<!ENTITY RFC2119 SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC2865 SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2865.xml">
<!ENTITY RFC2866 SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2866.xml">
<!ENTITY RFC3575 SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.3575.xml">
<!ENTITY RFC3579 SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.3579.xml">
<!ENTITY RFC4849 SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.4849.xml">
<!ENTITY RFC5080 SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5080.xml">
<!ENTITY RFC5226 SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5226.xml">
<!ENTITY RFC7149 SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7149.xml">
<!ENTITY RFC4301 SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.4301.xml">
<!ENTITY RFC6071 SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6071.xml">
<!ENTITY RFC2367 SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2367.xml">
<!ENTITY I-D.ietf-i2nsf-framework SYSTEM "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-i2nsf-framework.xml">
<!ENTITY I-D.ietf-i2nsf-terminology SYSTEM "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-i2nsf-terminology.xml">



]>

<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<!-- used by XSLT processors -->
<!-- For a complete list and description of processing instructions (PIs), please see http://xml.resource.org/authoring/README.html. -->
<!-- Below are generally applicable Processing Instructions (PIs) that most I-Ds might want to use. (Here they are set differently than their defaults in xml2rfc v1.32) -->
<!-- <?rfc strict="yes" ?> -->
<!-- give errors regarding ID-nits and DTD validation -->
<!-- control the table of contents (ToC) -->
<?rfc toc="yes"?>
<!-- generate a ToC -->
<?rfc tocdepth="3"?>
<!-- the number of levels of subsections in ToC. default: 3 -->
<!-- control references -->
<?rfc symrefs="yes"?>
<!-- use symbolic references tags, i.e, [RFC2119] instead of [1] -->
<?rfc sortrefs="yes" ?>
<!-- sort the reference entries alphabetically -->
<!-- control vertical white space
     (using these PIs as follows is recommended by the RFC Editor) -->
<?rfc compact="yes" ?>
<!-- do not start each main section on a new page -->
<?rfc subcompact="no" ?>
<!-- keep one blank line between list items -->
<!-- end of list of popular I-D processing instructions -->
<rfc ipr="trust200902" category="exp" docName="draft-abad-i2nsf-sdn-ipsec-flow-protection-00">
  <!-- category values: std, bcp, info, exp, and historic
     ipr values: full3667, noModification3667, noDerivatives3667
     you can add the attributes updates="NNNN" and obsoletes="NNNN"
     they will automatically be output with "(if approved)" -->

  <!-- ***** FRONT MATTER ***** -->

  <front>
    <!-- The abbreviated title is used in the page header - it is only necessary if the
         full title is longer than 39 characters -->

    <title abbrev="SDN IPsec Flow Protection Services"> Software-Defined Networking (SDN)-based IPsec Flow Protection</title>

    <!-- add 'role="editor"' below for the editors if appropriate -->

    <!-- Another author who claims to be an editor -->

    <author fullname="Rafa Marin-Lopez" initials="R." surname="Marin-Lopez">
      <organization>University of Murcia</organization>
      <address>
        <postal>
          <street>Campus de Espinardo S/N, Faculty of Computer Science</street>
          <!-- Reorder these if your country does things differently -->
          <city>Murcia</city>
          <region></region>
          <code>30100</code>
          <country>Spain</country>
        </postal>
        <phone>+34 868 88 85 01</phone>
        <email>rafa@um.es</email>
        <!-- uri and facsimile elements may also be added -->
      </address>
    </author>
    <author fullname="Gabriel Lopez-Millan" initials="G." surname="Lopez-Millan">
      <organization>University of Murcia</organization>
      <address>
        <postal>
          <street>Campus de Espinardo S/N, Faculty of Computer Science</street>
          <!-- Reorder these if your country does things differently -->
          <city>Murcia</city>
          <region></region>
          <code>30100</code>
          <country>Spain</country>
        </postal>
        <phone>+34 868 88 85 04</phone>
        <email>gabilm@um.es</email>
        <!-- uri and facsimile elements may also be added -->
      </address>
    </author>
    <date month="July" year="2016" />

    <!-- If the month and year are both specified and are the current ones, xml2rfc will fill
         in the current day for you. If only the current year is specified, xml2rfc will fill
     in the current day and month for you. If the year is not the current one, it is
     necessary to specify at least a month (xml2rfc assumes day="1" if not specified for the
     purpose of calculating the expiry date).  With drafts it is normally sufficient to
     specify just the year. -->

    <!-- Meta-data Declarations -->

    <area>General</area>

    <workgroup>I2NSF</workgroup>

    <!-- WG name at the upperleft corner of the doc,
         IETF is fine for individual submissions.
     If this element is not present, the default is "Network Working Group",
         which is used by the RFC Editor as a nod to the history of the IETF. -->

    <keyword>NSF, SDN, IPSec</keyword>

    <!-- Keywords will be incorporated into HTML output
         files in a meta tag but they have no effect on text or nroff
         output. If you submit your draft to the RFC Editor, the
         keywords will be used for the search engine. -->

    <abstract>
        <t>
			This document describes the use case of providing IPsec-based flow protection by means of a Software-Defined Network (SDN) controller and
            raises the requirements to support this service. It considers two main scenarios:
			(i) gateway-to-gateway and (ii) host-to-gateway (Road Warrior). For the gateway-to-gateway scenario, this document describes a mechanism
            to support the distribution of IPsec information to flow-based Network Security Functions (NSFs) that implements IPsec to protect data traffic.
			
            between network resources to protect data traffic with IPsec and IKE, in intra and inter-SDN cases.
            The host-to-gateway case defines a mechanism to distribute IPsec information to the NSF to protect data with IPsec between an end user's device (host) and a
            gateway.
        </t>
    </abstract>
  </front>

  <middle>
  
	<section title="Introduction">
		<t>
			Software-Defined Networking (SDN) is an architecture that enables
			users to directly program, orchestrate, control and manage network
			resources through software. SDN paradigm relocates the control of network
			resources to a dedicated network element, namely SDN controller.
			The SDN controller manages and configures the distributed network resources 
			and provides an abstracted view of the network
			resources to the SDN applications. The SDN application can customize
			and automate the operations (including management) of the abstracted
			network resources in a programmable manner via this interface
			<xref target="RFC7149" /><xref target="ITU-T.Y.3300" />
			<xref target="ONF-SDN-Architecture" /><xref target="ONF-OpenFlow" />.
		</t>
		
        <t>
			Typically, traditional IPsec VPN concentrators and, in general, gateways supporting IKE/IPsec, are configured
            manually. This makes the IPsec security association (SA) management difficult and generates a lack of flexibility,
            specially if the number of security policies and SAs to handle is high. With the grow of SDN-based scenarios
            where network resources are deployed in an autonomous manner, a mechanism to
			manage IPsec SAs according to the SDN architecture becomes more relevant.
			Thus, the SDN-based service described in this document will autonomously deal with
			IPsec-based data protection also in such as an autonomous manner.
		</t>
        
    
        <t> IPsec architecture <xref target="RFC4301" /> defines a clear separation between the processing to provide security services to IP packets and the key management procedures to establish the IPsec security association. In this document, we defined that a service where the key management procedures can be carried by an external entity: the security controller.</t>

		<t> First, this document exposes the requirements to support the protection of
            data flows using IPsec <xref target="RFC4301" />. We consider two cases:
            
            <list style="format %d)">
            
            <t> The network resource (or Network Security Function, NSF) implements the Internet Key Exchange (IKE) protocol and the IPsec databases: the Security Policy Database (SPD), the Security Association Database (SAD) and the Peer Authorization Database (PAD). The controller is in charge of provisioning the NSF with the required information about IKE, the SPD and the PAD. </t>
            
            <t> The NSF only implements the IPsec databases (no IKE implementation). The controller will provide the required parameters to create valid entries in the PAD, the SPD and the SAD in the NSF. Therefore, the NSF will have only support for IPsec while automated key management functionality is moved to the controller.</t>
            
            </list>
        </t>
        
        <t> In both cases, an interface/protocol will be required to carry out this provisioning between the security controller and the NSF. In particular, it is required the provision of SPD and PAD entries and the credentials and information related with the IKE negotiation (case 1); or the required SPD, PAD and SAD entries with information such as keys, cryptographic algorithms, IP addresses, IPsec protocol (AH or ESP), IPsec protocol mode (tunnel or transport), lifetime of the SA, etc (case 2). An example for case 1 using NETFCONF/YANG can be found in <xref target="netconf-vpn" />. A YANG model for IPsec can be found in <xref target="I-D.tran-ipsecme-yang"/>.
		</t>
		
        <t>
            Second, this document considers two scenarios to manage autonomously IPsec SAs:
            gateway-to-gateway and host-to-gateway <xref target="RFC6071" />.
            The gateway-to-gateway scenario shows how flow protection services are useful when data is to be protected
			across gateways in the network. Each gateway will implement a flow-based NSF. The use case described in
            <xref target="gw2gw-onecontroller" /> depicts how these services could be used to protect IP traffic among various geographically
            distributed networks under the domain of the same security controller. A variant of this scenario is also covered in
            <xref target="gw2gw-multicontroller" />, where the NSFs involved are under the control of different security controllers.
		</t>
		
        <t>
            The host-to-gateway scenario described in <xref target="roadwarrior" /> covers the case where one end user belonging to a network
            wants to access securely its network from another external network. In such a case, an IPsec SA needs to be established between the end user's host and the gateway, which is a flow-based NSF. In this document, we describe how the security controller can still configure automatically the IPsec SA in the NSF.
		</t>
	
    </section>
	
	<section title="Requirements Language">
		<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">RFC 2119</xref>.
			When these words appear in lower case, they have their natural language meaning.
		</t>
	</section>

    <section anchor="notation" title="Terminology">
       
        <t>
			This document uses the terminology described in <xref target="RFC7149" />, <xref target="RFC4301" />, <xref target="ITU-T.Y.3300" />,
			<xref target="ONF-SDN-Architecture" />, <xref target="ONF-OpenFlow" />, <xref target="ITU-T.X.1252" />,
			<xref target="ITU-T.X.800" /> and <xref target="I-D.ietf-i2nsf-terminology" />. In addition, the following terms are defined below:
            
            <list style="symbols">
                <t>
					Software-Defined Networking. A set of techniques enabling to
					directly program, orchestrate, control, and manage network
					resources, which facilitates the design, delivery and operation of
					network services in a dynamic and scalable manner <xref target="ITU-T.Y.3300" />.
                </t>
				
                <t>
					Flow/Data Flow. Set of network packets sharing a set of characteristics, for example IP dst/src values or QoS parameters.
                </t>
				
                <!--<t>
                    Network Security Function (NSF). Software that provides a set of
                    security-related services.
                </t>-->
                
                <!-- <t>
                    Flow-based NSF. A NSF that inspects network flows according to a
                    set of policies intended for enforcing security properties.
                    The NSFs considered in this document falls into this classification.
                </t>-->
				
                <t>
					Flow Protection Policy. The set of rules defining the conditions
					under which a data flow MUST be protected with IPsec, and the rules that MUST be applied to the
					specific flow.
				</t>
                
                <t>
                    IKE. Protocol to establish IPsec Security Associations (SAs). It requires information about the required authentication method (i.e. preshared keys), DH groups, modes and algorithms for IKE phase 1, etc.
                </t>
                
                <t>
                    SPD. IPsec Security Policy Database. It includes information about IPsec policies direction (in, out), local and remote addresses, inbound and outboud SAs, etc.
                </t>
                
                <t>
                    SAD. IPsec Security Associations Database. It includes information about IPsec security associations, such as SPI, destination addresses, authentication and encryption algorithms and keys.
                </t>
                
                <t>
                    PAD. Peer Authorization Database. It provides the link between the SPD and a security association management protocol such as IKE or our SDN-based solution.
                </t>

            </list>
        </t>
    </section>
    
    <section anchor="objectives" title="Objectives">
        <t>
            <list style="symbols">
                <t>
                    Flow-based data protection: controller-based flow protection services based on IPsec to allow the protection of specific data flows based on defined security policies.
                </t>
                <t>
                    Establishment and management of IPsec security associations: this service allows the centralized management of IPsec SAs to
                    protect specific data flows.
                </t>
            </list>
        </t>
    </section>
    
    <section anchor="case1" title="Case 1: IKE/IPsec in the NSF">
        
        <t>
            In this case, the security controller is in charge of controlling and applying SPD and PAD entries in the NSF. It also has to apply IKE configuration parameters and derive and deliver IKE credentials (e.g. a pre-shared key) to the NSF for the IKE negotiation. In short, we would call this IKE credential. </t>
        
        <t> With these entries and credentials, the IKE implementation can operate to establish the IPsec SAs. The application (administrator) will send the IPsec requirements and end points information, and the security controller will translate those requirements into SPD entries that will be installed in the NSF. With that information provisioned in the NSF, when the data flow needs to be protected, the NSF can just run IKE to establish the required IPsec SA.
            <xref target="fig:nsf-architecture1" /> shows the different layers and corresponding functionality.
        </t>
        
        <t> Advantages: It is simple because current gateways typically have an IKE/IPsec implementation. </t>
        <t> Disadvantages: IKE implementations need to renegotiate IPsec SAs upon SPD entries changes without restarting IKE daemon.</t>
        
        
        <!-- maximum wide of the figure                                   -->
        <figure align="center" anchor="fig:nsf-architecture1" title="Case 1: IKE/IPsec in the NSF">
            <artwork align="center"><![CDATA[
                +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                |   IPsec Management/Orchestration Application| Client or
                |                I2NSF Client                 | App Gateway
                +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                                        |      Client Facing Interface
                +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    Vendor      |             Application Support             |
    Facing <--->+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Security
    Interface   | IKE Credential and SPD Policies Distribution| Controller
                +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                                        |          NSF Facing Interface
                +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                |                 I2NSF Agent                 |
                +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Network
                |   IKE    |      IPsec(SPD,SAD,PAD)          | Security
                +-------------------------------------------- + Function (NSF)
                |         Data Protection and Forwarding      |
                +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
            ]]></artwork>
        </figure>
        
        
        
        <section anchor="requirements1" title="Requirements">
            <t>
                SDN-based IPsec flow protection services provide dynamic and flexible network
                resource management to protect data flows among network resources and end users.
                In order to support this capability in case 1, the following requirements are to be met:
                
                <list style="symbols">
                    <t>
                        The NSF MUST implement IKE and IPsec databases: SPD, SAD and PAD. It MUST provide an (southbound) interface to provision SPD and PAD entries, IKE Credentials and to monitor the IPsec databases and IKE implementation. Note that SAD entries are created in runtime by IKE.
                    </t>
                    <t>
                        A southbound protocol MUST support sending these SPD and PAD entries, and IKE credentials to the NSF.
                    </t>
                    
                    <t>
                        It requires an (northbound) application interface in the security controller allowing the management of IPsec SAs.
                    </t>
                    <t>
                        In scenarios where multiple controllers are implicated, SDN-based flow protection service may require a mechanism
                        to discover which security controller is managing a specific NSF.
                    </t>
                </list>
                
            </t>
        </section>
        
    </section>

    <section anchor="case2" title="Case 2: IPsec (no IKE) in the NSF">
    <t>
        This section describes the referenced architecture to support SDN-
        based IPsec flow protection where the security controller performs automated key management tasks.
    </t>
    <!-- maximum wide of the figure                                   -->
    <figure align="center" anchor="fig:nsf-architecture2" title="Case 2: IPsec (no IKE) in the NSF">
        <artwork align="center"><![CDATA[
            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
            |   IPsec Management/Orchestration Application| Client or
            |               I2NSF Client                  | App Gateway
            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                                    |   Client Facing Interface
            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Vendor      |             Application Support             |
Facing <--->+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Security
Interface   |         SPD, SAD and PAD Entries Distr.     | Controller
            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
            |       Key Derivation and Distribution       |
            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                                    |   NSF Facing Interface
            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
            |                  I2NSF Agent                | Network
            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Security
            |               IPSec (SPD,SAD,PAD)           | Function (NSF)
            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
            |        Data Protection and Forwarding       |
            +---------------------------------------------+
        ]]></artwork>
    </figure>
    
    <t>
        As shown in <xref target="fig:nsf-architecture2" />, applications for flow protection run on the top of the security controller.
        When an administrator enforces flow protection policies through an application interface,
        the security controller translates those requirements into SPD,PAD and SAD entries
        that will be installed in the NSF.
    </t>
    
    <!--<t>
        According to these policies, when the controller decides that a flow MUST be protected by means of IPsec, it generates the SPD, the PAD
        and SAD entries corresponding to AH and ESP, and inserts the required entries into the corresponding NSF' IPsec databases,
        This enforcement is triggered by the controller based on the Flow Based Policies provided by the administrator.
        
    </t>-->
    <t>Advantages: 1) It allows lighter NSFs (no IKE implementation). 2) IKE does not need to be run in gateway-to-gateway scenario with a single controller (see <xref target="gw2gw-onecontroller" />).
    </t>
    
    <!--<t>Advantages: 1) It allows less complex NSFs (no IKE implementation). 2) IKE does not need to be run in gateway-to-gateway scenario with a single controller (see <xref target="gw2gw-onecontroller" />).
    </t>
     -->
    <t>Disadvantages: The overload of IPsec SA establishment is shifted to the security controller since IKE is not required in the NSF.</t>
    
        <section anchor="requirements2" title="Requirements">
        <t>
            In order to support case 2, the following requirements are to be met:
            <list style="symbols">
                <t>
                    It requires the provision of SPD, PAD and SAD entries into the NSF. A southbound protocol MUST support sending this information to the NSF.
                </t>
                <t>
                    NSF MUST be capable to protect data flows with IPsec, such as the capability
                    to forward data through an IPsec tunnel.
                </t>
                <t>
                    It requires an (northbound) application interface in the security controller allowing the management of IPsec policies.
                </t>
                <t>
                    In scenarios where multiple controllers are implicated, SDN-based flow protection service may require a mechanism
                    to discover which security controller is managing a specific NSF.
                </t>
            </list>
        </t>
        </section>
    
    </section>
    
    
    <section anchor="interfaces" title="Abstract interfaces">
        <t>The cases presented above require an analysis of the communication channel between the IPSec stack and the security controller that is performing the key management operations.</t>
    
        <t>The IETF RFC 2367 (PF_KEYv2) <xref target="RFC2367" /> provides a generic key management API that can be used not only for IPsec but also for other network security services to manage the IPsec SAD. Besides, as an extension to this API, the document <xref target="I-D.pfkey-spd" /> specifies some PF_KEY extensions to maintain the SPD. This API is accessed using sockets.</t>
        
        
        <t>An I2NSF Agent implementation in the NSF can interact with both APIs in a kernel and returns and provides the same information using the NSF Facing Interface. In the following, we show a summary of these messages just to show an example of what may provide the NSF Facing Interface. The details and the accurate information is in RFC 2367 and <xref target="I-D.pfkey-spd" />.</t>
        
        <t> To manage the IPsec SAD we have the following messages in the PF_KEYv2 API:
            <list style="symbols">
                
                <t>The SADB_GETSPI message allows a process to obtain a unique SPI value
                    for given security association type, source address, and destination
                    address.  This message followed by an SADB_UPDATE is one way to
                    create a security association (SADB_ADD is the other method).</t>
                
                <t>The SADB_UPDATE message allows a process to update the information in
                    an existing Security Association.</t>
                
                <t>The SADB_ADD message is nearly identical to the SADB_UPDATE message,
                    except that it does not require a previous call to SADB_GETSPI.</t>
                
                <t> The SADB_DELETE message causes the kernel to delete an IPsec SA from the SAD.</t>
                
                <t>The SADB_GET message allows a process to retrieve a copy of a
                    Security Association from the SAD.</t>
                
                <t>The SADB_ACQUIRE message is typically triggered by an outbound packet
                    that needs security but for which there is no applicable IPsec SA existing in the SAD.</t>
                
                <t>The SADB_REGISTER message allows (a socket) to receive SADB_ACQUIRE messages for
                    the type of IPsec SA.</t>
                
                <t>The SADB_EXPIRE message is issued when soft limit or hard limit (lifetime) of a IPsec SA
                    has expired.</t>
                
                <t>The SADB_FLUSH message causes the kernel to delete all entries in its
                    IPsec SAD.</t>
                
                <t>The SADB_DUMP message causes to dump the operating
                    system's entire IPsec SAD.</t>
                
            </list>
        </t>
        
        <t> Although it is not a standard, KAME IPsec has defined a set of extensions to PF_KEY in order to handle the SPD <xref target="I-D.pfkey-spd" />. The extended API offers the addtional extensions:</t>
        
        <t>
            <list style="symbols">
                
                <t>The SADB_X_SPDSETIDX message allows a process to add only selector
                    of the security policy entry to the SPD.</t>
                
                <t>The SADB_X_SPDUPDATE message replaces the parameters of
                    an existing SPD entry.</t>
                
                <t>The SADB_X_SPDADD is message allows a process to add a new security policy
                    entry to the SPD.</t>
                
                <t> The SADB_X_SPDDELETE message causes the kernel to delete an entry from the SPD.</t>
                
                <t>The SADB_X_SPDDELETE2 message nearly identical to the SADB_X_SPDDELETE
                    message, except that it specifies the policy id.</t>
                
                <t>The SADB_X_SPDGET message is allows a process to retrieve a copy of a security
                    policy entry from the SPD.</t>
                
                <t>The SADB_X_SPDACQUIRE message is triggered by an outbound packet
                    that needs security policy but for which there is no applicable information
                    existing in the SPD.</t>
                
                <t>The SADB_X_SPDEXPIRE message is issued when limit of a security policy (SPD entry)
                    has expired.</t>
                
                <t>The SADB_X_SPDFLUSH message causes the kernel to delete all entries in
                    the IPsec SPD.</t>
                
                <t>The SADB_DUMP causes the kernel to dump all entries in
                    the IPsec SPD.</t>
                
            </list>
        </t>
        
        <t>Regarding PAD management, we have not found any related extension. However, from the abstract data model defined in <xref target="datamodel1 "/> for the PAD an interface could be designed.</t>
        
    </section>

    <section anchor="datamodel1" title="Data model">
    <t>
        These cases assume a data model representing the information to be exchanged between controller and network resource through the southbound interface. As described before this data model has to include the following information <xref target="RFC4301" /> (sketch that needs to be developed):
    </t>
    
    <t>
        Data model for the SDP entries:
        
        <list style="symbols">
            
            <t>
                Name
            </t>
            <t>
                PFP flags
            </t>
            <t>
                Perfect forward secrecy
            </t>
            <t>
                Selector list:
                <list style="selectors">
                    <t>
                        Remote IP addresses(es)
                    </t>
                    <t>
                        Local IP addresses(es)
                    </t>
                    <t>
                        Flow direction
                    </t>
                    <t>
                        Next Layer Protocol
                    </t>
                    <t>
                        Local port
                    </t>
                    <t>
                        Remote port
                    </t>
                    <t>
                        Type code
                    </t>
                </list>
                
            </t>
            <t>
                Processing:
                <list style="processing">
                    <t>
                        Extended sequence number
                    </t>
                    <t>
                        Sequence overflow
                    </t>
                    <t>
                        Fragment checking
                    </t>
                    <t>
                        IP compression
                    </t>
                    <t>
                        DF bit
                    </t>
                    <t>
                        DSCP
                    </t>
                    <t>
                        IPsec protocool (AH/ESP)
                    </t>
                    <t>
                        Algorithms
                    </t>
                    <t>
                        Manual SPI
                    </t>
                    <t>
                        Local tunnel endpoint
                    </t>
                    <t>
                        Remote tunnel endpoint
                    </t>
                    <t>
                        Tunnel options
                    </t>
                    
                </list>
                
            </t>
        </list>
    </t>
    
    <t>
        Data model for the SAD entries:
        <list style="symbols">
            <t>
                SPI
            </t>
            <t>
                Local peer
            </t>
            <t>
                Remote peer
            </t>
            <t>
                SA mode (tunnel or transport)
            </t>
            <t>
                Security protocol
            </t>
            <t>
                Sequence number options
            </t>
            <t>
                Life-time
            </t>
            <t>
                Upper protocol
            </t>
            <t>
                Direction
            </t>
            <t>
                Tunnel source IP address and port
            </t>
            <t>
                Tunnel Destination IP address and port
            </t>
            <t>
                AH parameters
            </t>
            <t>
                ESP parameters
            </t>
            <t>
                IP compression
            </t>
            <t>
                NAT traversal flag
            </t>
            <t>
                Path MTU
            </t>
            <t>
                Anti-replay window
            </t>
        </list>
        
    </t>
    
    <t>
        Data model for the PAD entries:
        
        <list style="symbols">
            <t>Identifies the peers or groups of peers that are authorized
                to communicate with this IPsec entity.</t>
            
            <t>The protocol and method used to authenticate each
                peer.</t>
            
            <t>Authentication data for each peer.</t>
            
            <t>Constraints about the types and values of IDs that can be asserted
                by a peer with regard to child SA creation.</t>
            
            <t>Peer gateway location info (e.g., IP address(es) or DNS names).</t>
        </list>
    </t>
    
    <t>
        Data model for the IKE configuration:
        <list style="symbols">
            <t>
                TBD. (NOTE: It may depend on the IKE version)
            </t>
        </list>
        
    </t>
    </section>



    <section anchor="usecase" title="Use cases examples">
    <t>
        This section explains three use cases as examples for the SDN-based IPsec Flow Protection Service.
    </t>
    
        <section anchor="gw2gw-onecontroller" title="Gateway-to-gateway under the same controller">
        <t> Enterprise A has a headquarter office (HQ) and several branch offices (BO) interconnected through an Internet connection provided by an Internet Service Provider (ISP). This ISP has deployed a SDN-based architecture to provide connectivity to all its clients, including HQ and BOs, so the HQ is provided with a gateway that acts as a router between Internet and each BO's internal network. The gateway implements our Flow-based NSF.
        </t>
        <t>
            Now, Enterprise A requires that certain traffic between the HQ and BOs MUST be protected, for example, with confidentiality
            and integrity. The Enterprise A's administrator has to configure flow protection policies in the ISP's security controller, determining that the traffic among Enterprise A's HQ (HQ A) and each BO MUST be protected.
        </t>
        
        
        <!-- maximum wide of the figure                                   -->
        <figure align="center" anchor="fig:g2gsinglecontroller1" title="Gateway-to-Gateway single controller flow for case 1 .">
            <artwork align="center"><![CDATA[
                +----------------------------------------+
                |             Security Controller        |
                |                                        |
        (1)     |   +--------------+ (2)+--------------+ |
Flow    ----------> |   Translate  |--->| South. Prot. | |
Protect. Pol.   |   |IPsec Policies|    |              | |
                |   +--------------+    +--------------+ |
                |                          |     |       |
                |                          |     |       |
                +--------------------------|-----|-------+
                                           |     |
                                           | (3) |
                 |-------------------------+     +---|
From             V                                   V         To
HQ A +----------------------+         +----------------------+ BO
 --->|    NSF1              |<=======>|   NSF2               |---->
     |IKE/IPsec(SPD/SAD/PAD)|         |IKE/IPsec(SPD/SAD/PAD)|
     +----------------------+  (4)    +----------------------+
            ]]></artwork>
        </figure>
        
        <t>
            <xref target="fig:g2gsinglecontroller1" /> describes the case 1:
        </t>
        <t>
            <list style="numbers">
                <t>
                    The administrator establishes general Flow Protection Policies.
                </t>
                <t>
                    The controller generates IKE credentials and translates the policies into SPD and PAD entries.
                </t>
                <t>
                    The controller looks for the NSFs involved (NSF1 and NSF2) and inserts the SPD and PAD entries in both NSF1 and NSF2.
                </t>
                <t>
                    All packets belonging to the flow that matches the IPsec SPD inserted by the security controller will trigger the IKE negotiation in NSF1 and NSF2 by using the IKE credentials.
                </t>
            </list>
        </t>
        
        
        <t>
            In case 2, Flow Protection Policies defined by the administrator are also translated into IPsec SPD entries and inserted into the corresponding NSFs. Besides, SAD entries will be also defined by the controller and enforced in the NSFs. In this case the execution of IKE is not necessary in the controller, and a Key Derivation function can be used to provide the required cryptographic material for the IPsec SAs. These keys will be also distributed through the southbound interface. Note that it is possible because both NSFs are managed by the same controller.
        </t>
        
        
        
        <!-- maximum wide of the figure                                   -->
        <figure align="center" anchor="fig:g2gsinglecontroller2" title="Gateway-to-Gateway single controller flow for case 2.">
            <artwork align="center"><![CDATA[
                +----------------------------------------+
                |    (1)      Security Controller        |
    Flow Prot. ---------|                                |
    Pol.        |       V                                |
                |   +-------------+(2)+---------------+  |
                |   | Key Deriv. &|-->| South. Prot.  |  |
                |   | Distribution|   |               |  |
                |   +-------------+   +---------------+  |
                |                      |     |           |
                |                      |     |           |
                +----------------------| --- |-----------+
                                       |     |
                                       | (3) |
                |----------------------+     +--|
    From        V                               V           To
    HQ A  +------------------+       +------------------+  BO
  ------->|    NSF1          |<=====>|   NSF2           |------->
          |IPsec(SPD/SAD/PAD)|   4)  |IPsec(SPD/SAD/PAD)|
          +------------------+       +------------------+
            ]]></artwork>
        </figure>
        <t>
            <xref target="fig:g2gsinglecontroller2" /> describes the case 2, when a data packet is sent from HQ A with destination BO :
        </t>
        <t>
            
            <list style="numbers">
                <t>
                    The administrator establishes Flow Protection Policies.
                </t>
                <t>
                    The controller translates these policies into IPsec SPD, PAD and SAD entries.
                </t>
                <t>
                    The controller looks for the NSFs involved and inserts the these entries in both NSF1 and NSF2 IPsec databases.
                </t>
                <t>
                    All packets belonging to the flow are tunneled between NSF1 and NSF2 by using the enforced configuration keys and
                    parameters. No need to run IKE between NSF1 and NSF2.
                </t>
                
            </list>
            
        </t>
        
        
        <t>
            In general (for case 1 and case 2), this system presents various advantages to the ISP: (i) it allows to create a IPsec SA among two NSFs, with only the application of specific security policies at the application layer. Thus, the ISP can manage all security associations in a centralized point and with an abstracted view of the network;
            (ii) All NSFs deployed after the application of the new policies will NOT need to be manually configured,
            thus allowing its deployment in an automated manner.
        </t>
        
        
        </section>
    
    
        <section anchor="gw2gw-multicontroller" title="Gateway-to-gateway under different SDN controllers">
        
        <t>
            Two organizations, Enterprise A and Enterprise B, have its headquarters interconnected through an Internet
            connection provided by different ISPs, called ISP_A and ISP_B. They have deployed a SDN-based architecture
            to provide Internet connectivity to all its clients, so Enterprise A's headquarters is provisioned
            with a gateway deployed by ISP_A and Enterprise B's headquarters is provisioned with a gateway deployed by ISP_B.
        </t>
        <t>
            Now, these organizations require that certain traffic among its headquarters to be protected with confidentiality
            and integrity, so the ISPs have to configure Flow Protection Policies in their security controllers.
            Both administrators define Flow Protection Policies in each Security Controller that will end with the translation into SPD and PAD
            entries and IKE credentials in each NSF so that the specified traffic exchanged among these headquarters will be protected.
        </t>
        
        
        <!-- maximum wide of the figure                                   -->
        <figure align="center" anchor="fig:g2gmulticontroller1" title="Gateway-to-gateway multi controller flow in case 1">
            <artwork align="center"><![CDATA[
                +-------------+                   +-------------+
                |   ISP_A's   |                   |   ISP_B's   |
     Flow Prot. |   Security  |<=================>|   Security <--- Flow Prot.
     Pol.     ---> Controller |        (3)        |  Controller |   Pol.
            (1) |             |                   |             |   (2)
                +-------------+                   +-------------+
                     |                                 |
                     | (4)                         (4) |
    From             V                                 V             To
    HQ A  +----------------------+          +----------------------+ BO
   ------>|    NSF1              |<========>|   NSF2               |------->
          |IKE/IPsec(SPD/SAD/PAD)|          |IKE/IPsec(SPD/SAD/PAD)|
          +----------------------+  (5)     +----------------------+
            ]]></artwork>
        </figure>
        
        <t>
            On the one hand, case 1, <xref target="fig:g2gmulticontroller1" /> describes the data and control plane communications required when a
            data packet is sent from Enterprise A's HQ (HQ A) to destination Enterprise B's HQ (HQ B):
        </t>
        
        <t>
            
            <list style="numbers">
                <t>
                    The administrator A establishes general Flow Protection Policies in ISP_A's Security Controller
                </t>
                <t>
                    The administrator B establishes general Flow Protection Policies in ISP_B's Security Controller
                </t>
                <t>
                    The ISP_A's security controller realizes that protection is between the NSF1 and NSF2, which is under the control of another security controller (ISP_B's security controller), so it starts
                    negotiations with the other controller to agree on the IPsec SPD
                    policies and IKE credentials for their respective NSFs. NOTE: This may require extensions in the East/West interface.
                </t>
                <t>
                    Then, both security controllers enforce the IKE credentials and related parameters and the SPD and PAD entries in their respective NSFs.
                </t>
                <t>
                    All packets belonging to the flow that matches the IPsec SPD inserted by the security controller triggers the IKE negotiation between NSF1 and NSF2 by using the enforced configuration keys and parameters.
                </t>
            </list>
            
        </t>
        
        
        <!-- maximum wide of the figure                                   -->
        <figure align="center" anchor="fig:g2gmulticontroller2" title="Gateway-to-gateway multi controller flow in case 2">
            <artwork align="center"><![CDATA[
                +--------------+                   +--------------+
                |   ISP_A's    |                   |   ISP_B's    |
         Flow. --->                     IKE?       |           <---- Flow
         Prot.  |   Security   |<=================>|   Security   |  Prot.
         Pol.(1)|  Controller  |        (3)        |  Controller  |  Pol. (2)
                |              |                   |              |
                +--------------+                   +--------------+
                        |                               |
                        | (4)                       (4) |
        From            V                               V                To
        HQ A    +------------------+      (5)       +------------------+ HQ B
         ------>|    NSF1          |<==============>|    NSF2          |---->
                |IPsec(SPD/SAD/PAD)|                |IPsec(SPD/SAD/PAD)|
                +------------------+                +------------------+
            ]]></artwork>
        </figure>
        
        <t>
            On the other hand, case 2, <xref target="fig:g2gmulticontroller2" /> describes the data and control plane communications required when a data packet
            is sent from Enterprise A's HQ (HQ A) to destination Enterprise B's HQ (HQ B):
        </t>
        <t>
            <list style="numbers">
                
                
                <t>
                    The administrator A establishes general Flow Protection Policies in ISP_A's Security Controller
                </t>
                <t>
                    The administrator B establishes general Flow Protection Policies in ISP_B's Security Controller
                </t>

                <t>
                    The ISP_A's security controller realizes that traffic between NSF1 and NSF2
                    MUST be protected. Nevertheless, the controller notices that
                    NSF2 is under the control of another security controller, so it starts negotiations
                     with the other controller to agree on the IPsec SPD, PAD, SAD entries that define the IPsec SAs.
                     NOTE: It would worth evaluating IKE as the protocol for the the East/West interface in this case.
                </t>
                <t>
                    Once the controllers have agreed on key material and the details of the IPsec SA, they both enforce this information into their respective NSFs.
                </t>
                <t>
                    Therefore, all packets belonging to the flow are protected between NSF1 and NSF2 by using the enforced configuration keys and
                    parameters.
                </t>
            </list>
        </t>
        <t>
            In general (case 1 and case 2), this system presents various advantages to both ISPs: (i) it allows to create a security association among two network resources across ISPs, from each ISP point of view, only the application of specific Flow Protection Policies  at the application layer is needed, so they can manage all
            security associations in a centralized point and with an abstracted view of the network;
            (ii) All new resources deployed after the application of the new policies will not need to be manually configured,
            thus allowing its deployment in an automated manner.
        </t>
        </section>
    
    
    
        <section anchor="roadwarrior" title="Host-to-gateway">
        <t>
            End user is a member of Enterprise A who needs to connect to the HQ's internal network. Enterprise A has
            deployed a NSF acting as IPsec-based VPN concentrator in its HQ to allow members of the organization
            to connect to the HQ's internal network in a secure manner.
        </t>
        <t>
            Traditionally, VPN concentrators are built as appliances, configured manually to authenticate and establish secure associations
            with incoming end users users, for example, by running IKE to establish an IPsec tunnel. With the SDN-based management of IPsec we can automatize these configurations.
        </t>
        
        <t>
            In case 1, as we can see in <xref target="fig:roadwarrior1" />, the administrator configures a Flow Protection Policy in the security controller (1). The controller generates IKE credentials and translates that into SPD and PAD entries and installs them in the corresponding NSF (2). With those policies and IKE credentials, end user and gateway can negotiate IKE.
            
        </t>
        
        <!-- maximum wide of the figure                                   -->
        <figure align="center" anchor="fig:roadwarrior1" title="Host-to-gateway flow protection in case 1.">
            <artwork align="center"><![CDATA[
                +----------------------------------------+
                |             Security Controller        |
                |                                        |
        (1)     |   +--------------+    +--------------+ |
    Flow ---------->| Translate    |--->| South. Prot. | |
    Protect. Pol.   |IPsec Policies|    |              | |
                |   +--------------+    +--------------+ |
                |                          |             |
                |                     (2)  |             |
                +--------------------------|-------------+
                                           |
                                           V
    +----------+                     +-----------------------+
    | End user |                     |    NSF                | To HQ
    | IKE/IPsec|<===================>| IKE/IPsec(SPD/SAD/PAD)|------->
    +----------+          (3)        +-----------------------+
            ]]></artwork>
        </figure>
        
        <t>
            In case 2, IKE implementation now resides in the security controller, as we can see in <xref target="fig:roadwarrior2" />. Here, the NSF needs to forward IKE packets to the controller. Therefore, the IKE negotiation is performed by the end user
            and the security controller (1), being this fact completely transparent for the end user.
        </t>
        
        <t>
            Once the IKE negotiation has been successfully completed, the IPsec SA is available in the end user and in the security controller.
            The IPsec SA information is to be provisioned into the NSF's SAD, SPD and PAD (2).
            Now the end user and the NSF share key material, thus being able to establish an IPsec tunnel to protect all traffic among them (3).
        </t>
        <t>
            In general, this feature allows the configuration of network resources such as VPN concentrators as a service,
            so these could be deployed and disposed as required by policies, such as network load, in an autonomous manner.
        </t>
        <!-- maximum wide of the figure                                   -->
        <figure align="center" anchor="fig:roadwarrior2" title="Host-to-gateway flow protection in case 2.">
            <artwork align="center"><![CDATA[
                +----------------------------------+
                |       Security Controller        |
                |                                  |
                |  +----------+   +-------------+  |
                |  |  IKE     |-->| South. Prot.|  |
                |  |          |   |             |  |
                |  +----------+   +-------------+  |
                |        ^             |           |
                |        |             |           |
                +--------|-------------|-----------+
                         |             |
                    (1)  |             | (2)
                         |             V
+----------+          +--|----------------+
|          |<------------+                |
| End user |          |  Gateway          |   To HQ
| IKE/IPsec|<========>| IPsec(SPD/SAD/PAD)|------->
+----------+   (3)    +-------------------+
            ]]></artwork>
        </figure>
        
        <t>One of the main problems of this scenario is that the security controller has to implement IKE and negotiate with the end user.
            Additionally, it is still unclear the security implications of performing IKE with a different end point than the NSF. Finally, in
            terms of implementation, the IKE packets should bypass IPsec protection in the NSF and be forwarded to the security controller.</t>
        
        </section>
    
    
    </section>

    <section anchor="security" title="Security Considerations">
        <t>
            TBD.
            <!--This document shares all the security issues of SDN that are
			specified in the "Security Considerations" section of <xref target="ITU-T.Y.3300" /> and <xref target="I-D.dunbar-i2nsf-problem-statement" />.-->
        </t>
    </section>

    <section anchor="ack" title="Acknowledgements">
        <t>
            Authors want to thank Sowmini Varadhan, Linda Dunbar, Carlos J. Bernardos, Alejandro Perez-Mendez and Alejandro Abad-Carrascosa for their valuable comments.
        </t>
    </section>

  </middle>

  <back>
    <references title="Normative References">
        &RFC2119;
        &RFC5226;
    </references>
    <references title="Informative References">
        &RFC7149;
        &RFC2367;
		&RFC4301;
        &RFC6071;
        &I-D.ietf-i2nsf-framework;
        &I-D.ietf-i2nsf-terminology;
        
        <reference anchor="I-D.tran-ipsecme-yang">
            <front>
                <title>Yang Data Model for Internet Protocol Security (IPsec)</title>
                <author initials="K" surname="Tran" fullname="Khanh Tran">
                    <organization/>
                </author>
                <author initials="H" surname="Wang" fullname="Honglei Wang">
                    <organization/>
                </author>
                <author initials="V" surname="Nagaraj" fullname="Vijay Kumar Nagaraj">
                    <organization/>
                </author>
                <author initials="X" surname="Chen" fullname="Xia Chen">
                    <organization/>
                </author>
                
                <date month="June" day="15" year="2015"/>
                <abstract>
                    <t>
                        This document describes a YANG data model for the IPsec(Internet
                        Protocol Security) protocol.  The model covers the IPsec protocol
                        operational state and remote procedural calls.
                    </t>
                </abstract>
            </front>
            <seriesInfo name="Internet-Draft" value="draft-tran-ipsecme-yang-01"/>
            <format type="TXT" target="https://tools.ietf.org/html/draft-tran-ipsecme-yang-01"/>
        </reference>
        
        <reference anchor="ITU-T.Y.3300">
          <front>
            <title>Recommendation ITU-T Y.3300</title>
            <author/>
            <date month="June" year="2014" />
          </front>
        </reference>
		
        <reference anchor="ONF-SDN-Architecture">
          <front>
            <title>SDN Architecture</title>
            <author/>
            <date month="June" year="2014" />
          </front>
        </reference>
		
		<reference anchor="ONF-OpenFlow">
          <front>
            <title>OpenFlow Switch Specification (Version 1.4.0)</title>
            <author>
				<organization>ONF</organization>
			</author>
            <date month="October" year="2013" />
          </front>
        </reference>
		
		<reference anchor="ITU-T.X.1252">
          <front>
            <title>Baseline Identity Management Terms and Definitions</title>
            <author/>
            <date month="April" year="2010" />
          </front>
        </reference>
		
		<reference anchor="ITU-T.X.800">
          <front>
            <title>Security Architecture for Open Systems Interconnection for  CCITT Applications</title>
            <author/>
            <date month="March" year="1991" />
          </front>
        </reference>
        <reference anchor="netconf-vpn">
            <front>
                <title>Tutorial: NETCONF and YANG</title>
                <author>
                    <organization>Stefan Wallin</organization>
                        </author>
                <date month="January" year="2014" />
            </front>
        </reference>
        
        <reference anchor="I-D.jeong-i2nsf-sdn-security-services-05">
            <front>
                <title>Software-Defined Networking Based Security Services using Interface to
                    Network Security Functions</title>
                <author initials="J" surname="Jeong" fullname="J Jeong">
                    <organization>Sungkyunkwan University</organization>
                </author>
                <author initials="H" surname="Kim" fullname="H Kim">
                    <organization>Sungkyunkwan University</organization>
                </author>
                <author initials="J" surname="Park" fullname="P Park">
                    <organization>ETRI</organization>
                </author>
                <author initials="T" surname="Ahn" fullname="T Ahn">
                    <organization>Korea Telecom</organization>
                </author>
                <author initials="S" surname="Lee" fullname="S Lee">
                    <organization>Korea Telecom</organization>
                </author>
                
                <date month="July" day="5" year="2016"/>
            </front>
            <seriesInfo name="Internet-Draft" value="draft-jeong-i2nsf-sdn-security-services-05"/>
            <format type="TXT" target="https://tools.ietf.org/html/draft-jeong-i2nsf-sdn-security-services-05"/>
        </reference>
        
        <reference anchor="I-D.pfkey-spd">
            <front>
                <title>PF_KEY Extensions for IPsec Policy Management in KAME Stack</title>
                <author initials="S" surname="Sakane" fullname="Shoichi Sakane">
                    <organization>KAME Project</organization>
                </author>
                <date month="October" day="12" year="2002"/>
            </front>
            <format type="TXT" target="http://www.kame.net/newsletter/20021210/"/>
        </reference>
        
    </references>
  </back>
</rfc>
