<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?rfc compact="yes"?>
<?rfc toc="yes"?>
<?rfc tocdepth="6"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<rfc ipr="trust200902" category="std" docName="draft-ribiere-savi-prefix-guard-00">

<front>
  <title abbrev="SAVI prefix guard">
        Source Prefix Validation 
  </title>


  
 <author fullname="John Kaippallimalil" initials="J.K."
 surname="Kaippallimalil">
    <organization> Huawei USA</organization>
    <address>
      <postal>
        <street>1700 Alma Dr. Suite 500 </street>
        <city>Plano, TX 75075</city>
        <country>USA</country>
      </postal>
      <email>john.kaippallimalil@huawei.com </email>
    </address>
</author>

  <author fullname="Frank Xia" initials="F.X."
 surname="Xia">
    <organization> Huawei USA</organization>
    <address>
      <postal>
        <street>1700 Alma Dr. Suite 500 </street>
        <city>Plano, TX 75075</city>
        <country>USA</country>
      </postal>
      <email>xiayangsong@huawei.com</email>
    </address>
</author>

<author fullname="Jun bi" initials="J.B."
 surname="Bi">
    <organization> CERNET</organization>
    <address>
      <postal>
        <street>Network Research Center, Tsinghua University </street>
        <city>Beijing,   100084</city>
        <country>China</country>
      </postal>
      <email>junbi@cernet.edu.cn</email>
    </address>
</author>

<author fullname="Vincent Ribiere" role="editor" initials="V.R."
 surname="Ribiere">
    <organization> Cisco Systems</organization>
    <address>
      <postal>
        <street>Village d'Entreprises Green Side -
	  400, Avenue Roumanille </street>
        <city>Biot-Sophia Antipolis - 06410</city>
        <country>France</country>
      </postal>
      <email>ribiere@cisco.com</email>
    </address>
</author>



 <date/>

 <area>Internet Area</area>

 <workgroup>SAVI</workgroup>

 <keyword>Draft</keyword>

<abstract>
<t>This document describes how SAVI concepts can be extended to provide Source Prefix Validation in enterprise and SP scenarios</t>
</abstract>
</front>

<middle>

<section anchor="intro" title="Problem statement">
<t>
There are currently several documents <xref target="I-D.ietf-savi-framework"/>
that describe the different methods by which a switch can discover and record bindings between a node's layer3 address and a binding anchor and use
that binding to perform Source Address Validation.
</t>
<t>
However SAVI existing solutions can not work when addresses can not be learned on the link. This is the case for example in Service Provider environments when prefixes are allocated to CPEs
typically using DHCP prefix delegation. In this case the switch is connected to the home router not to home nodes and the source of the traffic is off-link. 
</t>
<t> Even when addresses can be learned on the link and Savi existing solutions can be used there are limitations:
<list style="symbols">
<t> When the deployment model allows hosts to auto-configure any address  
the Savi device will be learning the addresses without validating them against the prefixes assigned by the router.
</t>
<t>HW resources are limited. In that case it
is very unefficient to have one filter for each host on the link when a single prefix range can be used. </t>
</list>
</t>

 <t>Source Prefix validation (or "Prefix Guard") can be used to overcome the above SAVI limitations. It finds out authorized prefixes and blocks any traffic that would 
be sourced with an address outside this range. 
In order to determine which prefixes should be allowed (and which ones that should be blocked) the switch has several "tools":
<list style="numbers">
 <t>	Snoop prefixes in Router Advertisements </t>
 <t>	Snoop prefixes in DHCP prefix delegation </t>
 <t>	Manual configuration </t>
</list>
</t>
<t>
Whenever a prefix is to be allowed, it will be downloaded to the hardware Filtering Table (FT). Whenever a packet is switched, the hardware will best match the source 
of the packet against this table and drop the packet if no match is found.
This functionality is very close to Source Address Validation as far as filtering out data traffic as well as for discovering prefixes in control traffic. 
</t>
<t> Reverse Path Forwarding as described in <xref target="RFC3704"/> can be used as an alternative to Source Prefix Validation but not in all scenarios.
<list style="symbols">
 <t> RPF operates on a router or a switch with routing capabilities whereas Source Prefix validation can be done on a plain layer2 switch. 
 </t>
 <t> In a shared VLAN model where the Savi switch is not the access switch all CPEs are "seen" on the same interface: RPF will not be able to detect attacks
 where CPE1 is sourcing traffic from an address stolen from CPE2 allocated prefix range. 
 </t>
 </list>
 </t>
<t>
We foresee two deployment scenarios where Source Prefix Validation is useful:
 <list style="symbols">
    <t> Service Provider scenarios where prefixes are assigned through DHCP-PD </t>
    <t> Enterprise scenarios where prefixes are assigned by the local Router though Router Advertisements </t> 
 </list>
  <vspace blankLines="1" />
  The purpose of this document is to describe how Source Prefix Validation can be used in those scenarios.
</t>

</section>

<section anchor="Terminology" title="Terminology">
<t>
<list style="empty">
  <t> Host:   A network device that connects to the service provider
      network through a residential gateway. </t>
  <t> User:   An entity that attaches to the network using one or more
      hosts.  The user is usually the subscriber that owns the CPE-
      Router.</t>
  <t> CPE-Router:  Customer Premise Equipment Router. Gateway device located at the edge of the customer
      network and is an IP router.  For a user within the customer
      network, the CPE-R is a gateway to the service provider network.</t>
  <t> Home Router:  Same as CPE-Router
      network, the CPE-R is a gateway to the service provider network.</t>  
  <t> DHCP:   Dynamic Host Configuration Protocol </t>
  <t> MAC:    Medium Access Control </t>
  <t> RPF:    Reverse Path Forwarding. Ingress Filtering Technique where the
   source address is looked up in the Forwarding Information Base (FIB)
   - and if the packet is received on the interface which would be used
   to forward the traffic to the source of the packet, it passes the
   check.</t>
  <t> SAVI:   Source Address Validation Improvements </t>
  <t> TID:    Transaction Identity </t>
</list>
   More definitions are described in <xref target="I-D.ietf-savi-framework"/>.
</t>

</section>

<section anchor="scenarios" title="Architecture context">

  <section title="Service Provider Scenarios">

    <t>
      This scenario was described originally in <xref target="I-D.kaippallimalil-savi-dhcp-pd"/>. 
      Prefixes are "allocated" to CPEs, typically using DHCP prefix delegation 
	  (as described in <xref target="RFC3633"/>) , but can also be manually 
      provisioned. The SAVI switch is connected to the CPEs not to home nodes; hence Source Address Validation operating at the address level has very limited value. 
      It knows the router addresses, but the nodes that source most of the traffic are the hosts behind the CPEs, and their addresses are assigned using 
	  Stateless Address Autoconfiguration. 
      However, the switch can know (by snooping DHCP prefix delegation traffic or by provisioning) which prefixes were assigned to the CPEs
	  and can bind the prefixes to the anchor. </t>
	<t>  

     It is key to identify the deployment model in order to determine the right binding anchor to be bound with the snooped prefixes.
    </t>
  <section title="SAVI switch is Access Switch">
  <t>
  In this scenario the anchor is the port facing the CPE since the SAVI switch is able to associate each CPE with a different port and installing a [prefix, port] filter
  in the filtering table is sufficient.

    <figure title="Service Provider Network">
      <artwork>

      Customer Network              Service Provider Network
                               
                            
  +---+      +-------+  
  | H |------| CPE-1 |---
  +---+      +-------+   \
  
                          \                    
  +---+      +-------+     \+----------+     +---------+
  | H |------| CPE-2 |------| SAVI     |-----| DHCP    |
  +---+      +-------+      | Switch   |     | Server  |   
                           /+----------+     +---------+              
  +---+      +-------+    /
  | H |------| CPE-3 |---/
  +---+      +-------+      

      </artwork>
    </figure>
 </t>
 </section>
 <section title="SAVI switch is not the Access Switch">
   <t>
  In this scenario the port can not be the anchor because there is a layer 2 device (switch, DSLAM) between the CPE and the layer 3 switch and
all data traffic is coming from this port.
If each CPE is behind a dedicated vlan then the vlan can be used as the anchor and installing a [prefix, vlan, port] filter is sufficient.
However most commonly all CPEs are within the same vlan (shared VLAN model). In this case the MAC address of the CPEs has to be used as an anchor and installing a 
[prefix, vlan, port, mac] filter in the filtering table is required.

    <figure>
      <artwork>

      Customer Network              Service Provider Network
                               
                            
  +---+      +-------+  
  | H |------| CPE-1 |---
  +---+      +-------+   \
                          \                    
  +---+      +-------+     \+----------+     +---------+    +---------+
  | H |------| CPE-2 |------| Access   |-----| SAVI    |----| DHCP    |
  +---+      +-------+      | Switch   |     | Switch  |    | Server  | 
                           /+----------+     +---------+    +---------+           
  +---+      +-------+    /
  | H |------| CPE-3 |---/
  +---+      +-------+      

      </artwork>
    </figure>



      
    </t>
  </section>
  </section>

  <section anchor="Enterprise" title="Enterprise Scenario">
      <t>
      In this scenario, the source of the traffic is on-link, as shown in the figure below:

    <figure>
      <artwork>
                  Enterprise Network                           Internet
                            
                  +------+   
                  | Host |
                  +------+
                      \
                       \                 
           +------+     +--------+        +-------------+
           | Host |-----| Switch |--------|   Router    |----
           +------+    /+--------+        +-------------+
                      /                 
                  +------+   
                  | Host |
                  +------+
                            
      </artwork>
    </figure> 

      The goal is to block traffic sourced from an address within an unknown prefix. There are two situations where this might be useful:

 	The deployment setup makes no or limited usage of DHCP, and in particular allow hosts to auto configure and use global addresses. In this model, a node could 
	allocate itself any address, including non-topologically correct, using a forged prefix. Classical Source Address Validation will learn these addresses via Neighbor Discovery
	"snooping", install them into the Hardware Filtering Table and won't be able to block traffic sourced from these addresses at the switch. The router might be able to do so 
	using Reverse Path Forwarding check, but at the higher cost than the switch. Note that in this scenario a [prefix, vlan] filter is sufficient.
    </t>
    <t>
 	The other scenario where the prefix-guard feature may be useful in an enterprise deployment is when the switch is running out of filtering entries to filter
	 out individual addresses. In that case filtering at the prefix level, while less efficient, has some value. 

      </t>
  </section>
</section>



<section title="Conceptual Data Structures">
<t>

   This section describes a set of conceptual data structures that are
   necessary for this mechanism.
</t>
<t>
   Two key data structures are used to record bindings and their states.
   The Binding State Table (BST) contains enties populated based on
   snooping the RFC3633 or RFC4861 protocol.  The Filtering Table (FT) contains
   bindings used to filter data plane traffic.

</t>

  <section title="Binding State Table (BST)">

  <t>
   This table contains the state of bindings between source IPv6 prefix
   and anchor.  Entries are keyed on anchor and source IPv6 prefix.
   Each entry has length of prefix, lifetime field containing the
   lifetime of the entry, a field recording the state of the binding,
   the default Router interface MAC address and a field for other
   information.

  <figure title="Instance of BST"><artwork>

       +--------+--------+--------+-------+----------+--------+
       | Anchor | Prefix | Length | State | Lifetime | Other  |
       +--------+--------+--------+-------+----------+--------+
       | A      | IP_1   | 56     | Bound |  65535   |        |
       +--------+--------+--------+-------+----------+--------+
       | A      | IP_2   | 56     | Bound |  10000   |        |
       +--------+--------+--------+-------+----------+--------+
       | B      | IP_3   | 60     |_Start |      1   |        |
       +--------+--------+--------+-------+----------+--------+
  </artwork></figure>

  </t>
  </section>

  <section title="Filtering Table (FT)">
  <t>

   This table contains the bindings between anchor and prefix/length,
   keyed on anchor.  This table does not contain any state of the
   binding.  It is used to filter packet.


  <figure title="Instance of FT"><artwork align="left">
       +---------+--------+--------+
       |Anchor   |Prefix  | Length |
       +---------+--------+--------+
       |A        |IP_1    |   56   |
       +---------+--------+--------+
       |A        |IP_2    |   56   |
       +---------+--------+--------+
  </artwork></figure>

  </t>
  </section>

  <section title="Binding State Description">

  <t>
   This section describes the binding states of this mechanism.</t>
   <t>START   A DHCPv6 request with IA_PD is received from customer router.</t>
   <t>BOUND   The prefix is assigned to the customer and bound to the
      anchor.</t>

  <t>Note that states are only needed if the binding is created. The specific procedures to set binding state to BOUND is
     internal to a switch and is not specified further.
  </t>
  </section>
</section>

<section title="Anchor Attributes">
<t>

   This section specifies the anchor attributes involved in this
   mechanism.
</t>
<section title="SAVI-Validation Attribute">
<t>

   The SAVI-Validation attribute should be set if and only if source
   prefix validation must be performed on traffic from this anchor.
</t>
</section>
<section title="SAVI-DHCP Trust Attribute">
<t>

   The SAVI-DHCP Trust attribute must be set if and only if an anchor is
   associated with a trustable DHCP server relay.
</t>
</section> 
</section>


<section title="Recovery scenarios">
    <t>
     <xref target="RFC6620"/> and <xref target="I-D.ietf-savi-dhcp"/>
	 describe scenarios where the SAVI device may not have a node binding and provide
	 mechanisms to recover upon receiving a data packet from an unknown source. 
	 It may also happen that the switch looses the prefix information - the most simple example
	 being if the switch reboots. This will result in data packets being dropped.
    </t>
    <section title="DHCP-PD assigned prefixes">
	<t> 
	The preferred mechanism is a proactive DHCPv6 Bulk Leasequery as described in <xref target="RFC5460"/>.
	In the event of a reboot the SAVI device SHOULD query the DHCP server with a LEASEQUERY message. 
	In return DHCP server will provide the prefix(es) information along with the CPE(s) MAC and port.
    </t>
	<t>
	Alternatively the same mechanism used for individually assigned DHCPv6 addresses COULD be
	used for assigned prefixes as described in <xref target="RFC5007"/>. Upon receiving a data packet for which
	no filter in FT matches a LEASEQUERY message is sent to All_DHCP_Relay_Agents_and_Servers
	multicast address. A query by IPv6 address allows the DHCP server to return the matching prefix information
	along with the CPE MAC and port.
	</t>
	</section>
  	<section title="Router assigned prefixes">
	<t>
	Upon reboot the SAVI device COULD proactively generate a RS message on interfaces facing a router.
	</t>
	</section>  

</section>

</middle>

<back>
<references title='Normative References'>
<?rfc include="reference.RFC.2119"?>
</references>

<references title='Informative References'>
<?rfc include="reference.RFC.2460"?>
<?rfc include="reference.RFC.4861"?>
<?rfc include="reference.RFC.4862"?>
<?rfc include="reference.RFC.3971"?>
<?rfc include="reference.RFC.3972"?>
<?rfc include="reference.RFC.3315"?>
<?rfc include="reference.RFC.3633"?>
<?rfc include="reference.RFC.5460"?>
<?rfc include="reference.RFC.5007"?>
<?rfc include="reference.RFC.6620"?>
<?rfc include="reference.RFC.3704"?>

<?rfc include='reference.I-D.ietf-savi-framework.xml'?>
<?rfc include='reference.I-D.ietf-savi-dhcp.xml'?>
<?rfc include='reference.I-D.kaippallimalil-savi-dhcp-pd.xml'?>
</references>

<section title="Contributors and Acknowledgments">
<t>
Thanks to Eric Levy-Abegnoli for his valuable contributions.
</t>
</section>

</back>

</rfc>
