<?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">



]>

<?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-sdnrg-sdn-ipsec-flow-protection-01">
  <!-- 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="Alejandro Abad-Carrascosa" initials="A." surname="Abad-Carrascosa">
      <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>
        <email>alejandroprimitivo.abad@um.es</email>
        <!-- uri and facsimile elements may also be added -->
      </address>
    </author>
    <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="October" year="2015" />

    <!-- 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>SDNRG</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</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 for providing IPsec 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 bootstrapping of key material
			between network resources to protect data traffic with IPsec and IKE, both in intra and inter-SDN cases.
            The host-to-gateway case defines a mechanism to bootstrap key material to protect data with IPsec between an end user's device 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>
			First, this document exposes the requirements to support the protection of
            data flows using IPsec <xref target="RFC4301" />. We consider two cases: 1) Where the network resource implements the IKE protocol, the IPsec Security Policy Database (SPD) and the Security Association Database (SAD), and the SDN controller is in charge of provisioning with required information both IKE and the SPD in the network resource; 2) Where the SDN controller handles the IPsec SPD and takes the role of an Internet Key Exchange (IKE) entity in the IPsec architecture. In this sense, it will provision the required parameters to create valid entries in the Security Association Database (SAD), which we assumed to be
            in the data plane. Therefore, the data plane will have only support for IPsec while SPD and IKE functionality is moved to the control plane.
            In both cases, to carry out this provisioning, an interface/protocol will be required between the SDN controller and the data plane to send: the policies to be applied in the SPD and the credentials for the IKE negotiation (case 1); or the required IPsec
            SA parameters 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.wang-ipsecme-ipsec-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. More precisely, 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 SDN controller. A variant of this scenario is also covered in <xref target="gw2gw-multicontroller" />,
            where the network devices are under different SDN 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. In this document, we describe how the SDN controller can still configure automatically the IPsec SA in the gateway but after an IKE negotiation.
		</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" />, and
			<xref target="ITU-T.X.800" />.
			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 Resources: Network devices that can perform packet
					forwarding in a network system.  The network resources include
					network switch, router, gateway, VPN concentrators, and similar
					devices. This document makes no difference if these network devices
					are physical or virtual.
				</t>
				<t>
					Flow Protection Policy: The set of rules defining the conditions
					under which a data flow MUST be protected, 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>

            </list>
        </t>
    </section>
    
    <section anchor="objectives" title="Objectives">
        <t>
            <list style="symbols">
                <t>
                    Flow-based data protection: SDN-based flow protection services based on IPsec to allow the protection of specific data flows based on defined security policies.
                </t>
                <t>
                    Bootstrapping security associations: SDN-based flow protection allow the centralized bootstrapping of IKE credentials (case 1) and IPsec key material for AH and ESP (case 2)
                    to eventually protect specific data flows among network resources and end users.
                </t>
            </list>
        </t>
    </section>
	
	<section anchor="case1" title="Case 1: IKE/IPsec in the network resource">
        
        <t>
            In this case, the SDN controller is in charge of controlling and applying SPD entries in the network resource. It also has to derive and deliver IKE credentials (for example a pre-shared key) to the network resource for the IKE authentication. With these policies and credentials, the IKE implementation runs to build the IPsec SAs. The application (administrator) will send the IPsec requirements and end points information, and the SDN controller will translate those requirements into SPD Policies that will be installed in the network resource. With that information, the network resources can just run IKE to establish the IPsec SA. <xref target="fig:sdn-architecture1" /> shows the different layers and corresponding functionality.
        </t>
        
        <t> Advantages: It is simple since network resources typically have and IKE/IPsec implementations. </t>
        <t> Disadvantages: 1) IKE implementations needs to renegotiate IPsec SAs upon SPD entries changes without restarting IKE daemon. 2) Data plane more complex. </t>
            
        
        <!-- maximum wide of the figure                                   -->
        <figure align="center" anchor="fig:sdn-architecture1" title="Case 1) High-level Architecture for SDN-based IPsec Flow Protection Services">
            <artwork align="center"><![CDATA[
                +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                |             Security Application            | Application
                |   (e.g., IKE/SPD Management/Orchestration)  | Layer
                +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                                        |
                +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                |             Application Support             |
                +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ SDN Controller
                | IKE Credential and SPD Policies Distribution| Layer
                +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                                        |
                +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                |               Control Support               |
                +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Network
                |   IKEv2  |           IPsec(SPD)             | Resource
                +-------------------------------------------- + Layer
                |  IPsec (SAD) 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 network resource MUST implement IKE, IPsec, SPD and the SADs. It MUST provide an (southbound) interface to configure SPD policies and IKE credentials.
                    </t>
                    <t>
                        A southbound protocol MUST support sending these SPD Policies and IKE Credentials to the network resource.
                    </t>
                    
                    <t>
                        It requires an (northbound) application interface in the SDN 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 SDN controller is controlling a specific network resource.
                    </t>
                </list>
            </t>
        </section>


        
    </section>

    <section anchor="case2" title="Case 2: IKE and SPD in the SDN Controller">
        <t>
		   This section describes the referenced architecture to support SDN-
		   based IPsec flow protection where the SDN controller owns the SPD and the IKE implementation.
		</t>
<!-- maximum wide of the figure                                   -->
<figure align="center" anchor="fig:sdn-architecture2" title="Case 2) SDN Controller holds the SPD and has IKE implementation">
<artwork align="center"><![CDATA[
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |             Security Application            | Application
   |  (e.g., IKE/SDP Management/Orchestration)   | Layer
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                          |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |             Application Support             |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ SDN
   |     IKEv2   |       IPsec (SPD)             | Controller
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Layer
   |       Key Derivation and Distribution       |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                          |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |               Control Support               | Network
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Resource
   | IPsec (SAD)  Data Protection and Forwarding | Layer
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   
]]></artwork>
</figure>



		<t>
		   As shown in <xref target="fig:sdn-architecture2" />, applications for flow protection run on the top of the SDN controller
		   <xref target="ITU-T.Y.3300" /><xref target="ONF-SDN-Architecture" />.
		   When an administrator enforces flow protection policies through an application interface, the SDN controller inserts the
		   corresponding flow protection policies into its Security Policy Database (SPD) to meet such flow protection policies in an autonomous manner.
		</t>
		<t>
		   According to these policies, when the controller decides that a flow MUST be protected by means of IPsec, it inserts a new flow entry
		   into the corresponding network resources' flow tables, along with an entry in the Security Associations Database (SAD)
		   including all IPsec parameters needed to protect the flow (keys, ESP or AH, transport or tunnel, ...).
           This enforcement MAY be triggered by the network resource when it does not know how to handle the IP packet. Basically, it forwards the IP packet to the controller so that it can take a decision based on the SPD.
		   This allow network resources to protect data flows based in rules dynamically enforced by the SDN controller.
        </t>
        
        <t>Advantages: 1) There is clear separation of data plane (IPsec protection per flow) and control plane (IKE and SPD policies). Hence, it allows less complex data planes. 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: 1) The overload of IKE negotiation is shifted to the SDN controller. 2) IPSec SPD and SAD management need to be decoupled, changing the traditional paradigm defined in IPsec where SPD and SAD are placed in the network resource</t>
        
        <section anchor="requirements2" title="Requirements">
            <t>
                In order to support this capability in case 2, the following requirements are to be met:
                <list style="symbols">
                    <t>
                        It requires the provision of flow entries in network resources. Flow entries
                        may need to include fields such as AH or ESP parameters, tunnel or transport mode and
                        crypto material to process an IP packet with IPsec (in the end, the Security Association Database (SADs) is managed by the
                        network resource). In the same way a southbound protocol MUST support sending this information to the network resource.
                    </t>
                    <t>
                        Network resources 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 SDN 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 SDN controller is managing a specific network resource.
                    </t>
                </list>
            </t>
        </section>

    </section>

    <section anchor="i2nsf-rel" title="Relationship with I2NSF">
        
        <t>According to <xref target="I-D.dunbar-i2nsf-problem-statement" /> a Network Security Function (NSF) is a function that ensures "integrity, confidentiality and availability of network communications" among other aspects. As such, the network resource we describe in this document can be considered as a NSF with IPsec support. Additionally, the SDN controller can be considered as a Security controller. In <xref target="I-D.merged-i2nsf-framework-02" /> a framework for Interface to Network Security Functions is described.  Three  possible interfaces are described: Client Facing (service layer) Interface; NSF Facing (capability) Interface and Vendor Facing Interface.</t>
                
        <t> <xref target="fig:nsf-architecture1" /> and <xref target="fig:nsf-architecture2" /> describe the mapping with our use case. In the right side of the figure each entity follows the same terminology than <xref target="I-D.merged-i2nsf-framework-02" />.
            
            <figure align="center" anchor="fig:nsf-architecture1" title="Case 1) Mapping with I2NSF Framework">
                <artwork align="center"><![CDATA[
                    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                    |             Security Application            |  Client or
                    |   (e.g., IKE/SPD Management/Orchestration)  |  App Gateway
                    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                                            |   Client Facing (service layer) Interface
                    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
        Vendor      |             Application Support             |
        Facing <--->+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Security
        Interface   | IKE Credential and SPD Policies Distribution| Controller
                    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                                            |   NSF Facing (capability) Interface
                    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                    |               Control Support               |
                    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Network
                    |   IKEv2  |           IPsec(SPD)             | Security
                    +-------------------------------------------- + Function (NSF)
                    |  IPsec (SAD) Data Protection and Forwarding |
                    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                ]]></artwork>
            </figure>
            
            
            <figure align="center" anchor="fig:nsf-architecture2" title="Case 2) Mapping with I2NSF Framework">
                <artwork align="center"><![CDATA[
                    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                    |             Security Application            |  Client or
                    |   (e.g., IKE/SPD Management/Orchestration)  |  App Gateway
                    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                                            |   Client Facing (service layer) Interface
                    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
        Vendor      |             Application Support             |
        Facing <--->+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Security
        Interface   | IKEv2   |       IPsec (SPD)                 | Controller
                    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                    |       Key Derivation and Distribution       |
                    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                                            |   NSF Facing (capability) Interface
                    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                    |               Control Support               | Network
                    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Security
                    | IPsec (SAD) Data Protection and Forwarding  | Function (NSF)
                    +---------------------------------------------+
                ]]></artwork>
            </figure>

            NOTE: We believe these use cases can be considered as additional uses cases to the work proposed in <xref target="I-D.jeong-i2nsf-sdn-security-services-03" /> though we have found some differences between the mapping to I2NSF we show in this document and that reference. That is something that we will have to analyze in the future.</t>
    </section>


	<section anchor="usecase" title="Scenarios">
		<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 Provicer (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.
            </t>
            <t>
                Now, Enterprise A requires that all traffic between the HQ and BOs MUST be protected, for example, with confidentiality
                and integrity. The Entrepise A's administrator has to configure flow protection policies in the ISP's SDN controller, determining that all traffic among Enterprise A's HQ (HQ A) and each BO MUST be protected. Let us assume, for example, with an IPsec ESP tunnel.
            </t>
            
            
            <t>
                On the one hand, in case 1, these policies are translated into IPsec SPD entries and the SDN controller enforces these entries in the network resources.
            </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[
                    +----------------------------------------+
                    |             SDN Controller             |
                    |                                        |
                 (1)|   +--------------+ (2)+--------------+ |
        Flow ---------->| Translate    |--->| South. Prot. | |
        Protect. Pol.   |IPsec Policies|    |              | |
                    |   +--------------+    +--------------+ |
                    |                          |     |       |
                    |                          |     |       |
                    +--------------------------|-----|-------+
                                               |     |
                                               | (3) |
                    |--------------------------+     +---|
        From        V                                    V           To
        HQ A  +------------------+              +------------------+ BO
       ------>|    GW1           |=============>|   GW2            |------->
              |IKE/IPsec(SPD/SAD)|              |IKE/IPsec(SPD/SAD)|
              +------------------+      (4)     +------------------+
                ]]></artwork>
            </figure>
            
            <t>
                <xref target="fig:g2gsinglecontroller1" /> describes the data and control communication planes in case 1, when a data packet
                is sent from HQ A with destination BO :
            </t>
            <t>
                <list style="numbers">
                    <t>
                        The administrator establishes a general Flow Protection Policies.
                    </t>
                    <t>
                        The SDN controller translates into IPsec Policies entries.
                    </t>
                    <t>
                        The SDN Controller looks for the network resources involved (GW1 and GW2) and inserts the IPsec SPD entries in both GW1 and GW2 IPsec SPDs and keys and configuration information related with IKE.
                    </t>
                    <t>
                        All packets belonging to the flow that matches the IPsec SDP inserted by the SDN controller triggers the IKE negotiation in GW1 and GW2 by using the enforced configuration keys and parameters.
                    </t>
                </list>
            </t>
            
            
            <t>
                On the other hand, in case 2, these Flow Protection Policies defined by the administrator are translated into IPsec SPD entries and inserted into the SDN controller that represents the IPsec SPD.
			</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[
                 +----------------------------------------+
                 |    (0)      SDN Controller             |
     Flow Prot. ---------|                                |
     Pol.        |       V                                |
                 |   +-------+       +----------------+   |
             ------->| IPSec |------>|  South. Prot.  |   |
             |   |   | (SPD) |       |                |   |
             |   |   +-------+  (2)  +----------------+   |
             |   |                    |     |             |
             |   |                    |     |             |
         (1) |   +------------------- | --- | ------------+
             |                        |     |
             |                        | (3) |
             |   |--------------------+     +---|
     From    |   V                              V       To
     HQ A  +----------+                   +----------+   BO
   ------->|    GW1   |==================>|   GW2    |------->
           |IPsec(SAD)|                   |IPsec(SAD)|
           +----------+      (4)          +----------+
]]></artwork>
</figure>
        <t>
            Assuming that configuration step has happened (0), <xref target="fig:g2gsinglecontroller2" /> describes the data and control communication planes in case 2, when a data packet is sent from HQ A with destination BO :
        </t>
        <t>
            <list style="numbers">
                <t>
                    When the data packet arrives for first time to the gateway in HQ A (GW1), it sends the packet to the SDN Controller.
                </t>
                <t>
                    The SDN Controller looks for security policies in its SPD table and decides that the flow MUST be protected, for example, with IPsec ESP in tunnel mode.
                </t>
                <t>
                    The SDN controller derives keys for the IPsec tunnel and enforces them, along with other information required,
                    such as IPsec mode (ESP or AH), into both gateways' IPsec
                    Security Association Database (SAD).
                </t>
                <t>
                    All packets belonging to the flow are tunneled between GW1 and GW2 by using the enforced configuration keys and
                    parameters. No need to run IKE between GW1 and GW2.
                </t>
            </list>
        </t>


            <t>
                In general (for case 1 and case2), this system presents various advantages to the ISP: (i) it allows to create a security association among two network resources,
                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 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="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 all traffic among its headquarters to be protected with confidentiality
				and integrity, so the ISPs have to configure Flow Protection Policies in their SDN Controllers.
				Those policies are translated into flow protection policy rules into the SDN Controller's of each ISP,
				so all traffic exchanged among these headquarters will be protected, for example, by means of an IPsec ESP tunnel.
			</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. |     SDN     |<=================>|     SDN     |
     Protect. ---> Controller |        (2)        |  Controller |
            (1) |             |                   |             |
                +-------------+                   +-------------+
                       |                                 |
                       | (3)                         (3) |
        From           V                                 V           To
        HQ A  +------------------+              +------------------+ BO
       ------>|    GW1           |=============>|   GW2            |------->
              |IKE/IPsec(SPD/SAD)|              |IKE/IPsec(SPD/SAD)|
              +------------------+      (4)     +------------------+
]]></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 establishes a general Flow Protection Policies, which the SDN controller translates into IPsec Policies.
                    </t>
                    <t>
                        The ISP_A's SDN Controller realizes that traffic between GW1 and GW2
                        MUST be protected. Nevertheless, the controller notices that
                        GW2 is under the control of another SDN controller, so it starts
                        negotiations with the other controller to agree on the IPsec SPD
                        policies and IKE credentials for their respective gateway NOTE: This may require extensions in the East/West interface.
                    </t>
                    <t>
                       Then, both SDN controllers enforce the IKE credentials and related parameters and the IPsec SPD Policies entries in their respective gateways.
                    </t>
                    <t>
                        All packets belonging to the flow that matches the IPsec SDP inserted by the SDN controller triggers the IKE negotiation GW1 and GW2 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. --->
    Prot.  |     SDN      |<=================>|     SDN      |
    Pol.(0)|  Controller  |        (2)        |  Controller  |
           |IKE/IPsec(SPD)|                   |IKE/IPsec(SPD)|
           +--------------+                   +--------------+
                A   |                               |
            (1) |   | (3)                       (3) |
      From      |   V                               V          To
      HQ A    +-----------+      (4)            +-----------+  HQ B
    --------->|    GW1    |====================>|    GW2    |------->
              |IPsec (SAD)|                     |IPsec (SAD)|
              +-----------+                     +-----------+
]]></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>
						When the data packet arrives for first time to the gateway in Enterprise A's headquarters (GW1), 
						it sends the packet to its SDN Controller.
					</t>
					<t>
						The ISP_A's SDN Controller looks for security policies in its SPD table and decides that the flow between GW1 and GW2
						MUST be protected, for example, with IPsec ESP in tunnel mode. Nevertheless, the controller notices that GW2 is under the control
						of another SDN controller, so it starts negotiations with the other controller in order to generate key
                        material. This could be performed by running IKEv2 (NOTE:more discussion is required).
					</t>
					<t>
						Once the controllers have generated shared key material, both enforce these keys into their respective gateways'
						Security Association Databases (SAD) along with the IPsec mode and other parameters that may be required.
					</t>
					<t>
						Therefore, all packets belonging to the flow are protected between GW1 and GW2 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>
				Alice is a member of Enterprise A who needs to connect to the HQ's internal network. Enterprise A has
				deployed a IPsec-based VPN concentrator in its HQ to allow members of the organization, like Alice,
				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 users, for example, by running IKEv2 to establish an IPsec tunnel. With the  SDN-base management of IPsec protection service we can automate these configuration.
            </t>
            
            <t>
                In case 1, as we can see in <xref target="fig:roadwarrior2" />, the administrator configures a Flow Protection Policy in the SDN controller (1). The SDN controller translates that into IPsec Policies and installs those SPD entries and IKE credentials in the corresponding gateway (VPN concentrator) (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[
                    +----------------------------------------+
                    |             SDN Controller             |
                    |                                        |
                 (1)|   +--------------+    +--------------+ |
        Flow ---------->| Translate    |--->| South. Prot. | |
        Protect. Pol.   |IPsec Policies|    |              | |
                    |   +--------------+    +--------------+ |
                    |                          |             |
                    |                     (2)  |             |
                    +--------------------------|-------------+
                                       |-------+
                                       V
  +----------+                     +-------------------+
  | End user |                     |    Gateway        |   To
  | (Alice)  |                     |  (VPN conc.)      |   HQ
  | IKE/IPsec|====================>| IKE/IPsec(SPD/SAD)|------->
  +----------+          (3)        +-------------------+
]]></artwork>
</figure>
            
            
            
                
            <t>
                In case 2, the role of running IKEv2 now resides in the SDN control plane (i.e. the SDN controller), as we can see in <xref target="fig:roadwarrior2" />. Here, the gateway forwards IKE packets to the controller. Therefore, the IKEv2 negotiation is performed by the end user
				and the SDN controller (1), being this fact completely transparent for the end user.
			</t>
			<t>
				Once the IKEv2 negotiation has been successfully completed, new key material is available in the end user and in the SDN controller.
				This key material, along with other parameters like the IPsec mode, are to be provisioned into the gateway's SAD (2).
				Now the end user and the gateway 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 in case 2.">
<artwork align="center"><![CDATA[
                               +----------------------------------+
                               |       SDN Controller             |
                               |                                  |
                               |  +----------+   +-------------+  |
                               |  |  IKE     |-->| South. Prot.|  |
                               |  |IPsec(SPD)|   |             |  |
                               |  +----------    +-------------+  |
                               |       A             |            |
                               |       |             |            |
                               +------ | ----------- | -----------+
                                       |             |
                                   (1) |        |----- (2)
                                       |        V
  +----------+          (1)        +---|-----------+
  |          |<------------------------|           |
  | End user |                     |    Gateway    |   To
  | (Alice)  |                     |  (VPN conc.)  |   HQ
  | IKE/IPsec|====================>|  IPsec(SAD)   |------->
  +----------+          (3)        +---------------+
]]></artwork>
</figure>

		</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 Carlos J. Bernardos and Alejandro Perez-Mendez for their valuable comments.
        </t>
    </section>

  </middle>

  <back>
    <references title="Normative References">
        &RFC2119;
        &RFC5226;
    </references>
    <references title="Informative References">
        &RFC7149;
		&RFC4301;
        &RFC6071;
		<reference anchor="I-D.dunbar-i2nsf-problem-statement">
			<front>
				<title>Interface to Network Security Functions (I2NSF) Problem Statement</title>
				<author initials="L" surname="Dunbar" fullname="Linda Dunbar">
				<organization/>
				</author>
				<author initials="M" surname="Zarny" fullname="Myo Zarny">
				<organization/>
				</author>
				<author initials="C" surname="Jacquenet" fullname="Christian Jacquenet">
				<organization/>
				</author>
				<author initials="M" surname="Boucadair" fullname="Mohamed Boucadair">
				<organization/>
				</author>
				<author initials="S" surname="Chakrabarty" fullname="Shaibal Chakrabarty">
				<organization/>
				</author>
				<date month="May" day="28" year="2015"/>
				<abstract>
					<t>
						This document describes the motivation and the problem statement for Interface to Network Security Functions (I2NSF).
					</t>
				</abstract>
			</front>
			<seriesInfo name="Internet-Draft" value="draft-dunbar-i2nsf-problem-statement-05"/>
			<format type="TXT" target="http://www.ietf.org/internet-drafts/draft-dunbar-i2nsf-problem-statement-05.txt"/>
		</reference>
        
        <reference anchor="I-D.wang-ipsecme-ipsec-yang">
            <front>
                <title>Yang Data Model for IPsec</title>
                <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-wang-ipsecme-ipsec-yang-00"/>
            <format type="TXT" target="https://tools.ietf.org/html/draft-wang-ipsecme-ipsec-yang-00"/>
        </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.merged-i2nsf-framework-02">
            <front>
                <title>Framework for Interface to Network Security Functions</title>
                <author initials="E" surname="Lopez" fullname="Edward Lopez">
                    <organization>Fortinet</organization>
                </author>
                <author initials="D" surname="Lopez" fullname="Diego Lopez">
                    <organization>Telefonica</organization>
                </author>
                <author initials="X" surname="Zhuang" fullname="XiaoJun Zhuang">
                    <organization>China Mobile</organization>
                </author>
                <author initials="L" surname="Dunbar" fullname="Linda Dunbar">
                    <organization>Huawei</organization>
                </author>
                <author initials="J" surname="Parrott" fullname="Joe Parrot">
                    <organization>BT</organization>
                </author>
                
                <author initials="R" surname="Krishnan" fullname="Ramki Krishnan">
                    <organization>Dell</organization>
                </author>
                <author initials="SR" surname="Durbha" fullname="Seetharama Rao Durbha">
                    <organization>CableLabs</organization>
                </author>

                
                <date month="June" day="8" year="2015"/>
            </front>
            <seriesInfo name="Internet-Draft" value="draft-merged-i2nsf-framework-02.txt"/>
            <format type="TXT" target="https://tools.ietf.org/html/draft-merged-i2nsf-framework-02"/>
        </reference>
        
        <reference anchor="I-D.jeong-i2nsf-sdn-security-services-03">
            <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="J" surname="Park" fullname="P Park">
                    <organization>ETRI</organization>
                </author>
                
                <date month="October" day="9" year="2015"/>
            </front>
            <seriesInfo name="Internet-Draft" value="draft-jeong-i2nsf-sdn-security-services-03"/>
            <format type="TXT" target="https://tools.ietf.org/html/draft-jeong-i2nsf-sdn-security-services-03"/>
        </reference>
        
        
    </references>
  </back>
</rfc>
