<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [ 
<!ENTITY RFC2119 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC3392 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3392.xml">
<!ENTITY RFC4271 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4271.xml">
<!ENTITY RFC5292 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5292.xml">
<!ENTITY I-D.ietf-idr-error-handling SYSTEM 
  "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.draft-ietf-idr-error-handling.xml">
]>

<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
 <?rfc toc="yes" ?>
 <?rfc symrefs="yes" ?>
 <?rfc sortrefs="yes"?> 
 <?rfc compact="yes" ?>
 <?rfc subcompact="no" ?>  
 <?rfc iprnotified="no" ?>
  <?rfc strict="no" ?>

<rfc category="std" docName="draft-ietf-idr-aspath-orf-11.txt" ipr="trust200902">

<front>
<title abbrev="I2NSF Gap analysis">Analysis of Existing work for I2NSF</title>
	  <author fullname="Susan Hares" initials="S" surname="Hares">
      <organization>Huawei</organization>
      <address>
        <postal> 
          <street>7453 Hickory Hill</street>
          <!-- Reorder these if your country does things differently -->
          <city>Saline</city>
          <region>MI</region>
          <code>48176</code>
          <country>USA</country>
        </postal>
        <email>shares@ndzh.com</email>
      </address>
    </author>
	 <author fullname="Keyur Patel" initials="K" surname="Patel">
      <organization>Cisco</organization>
      <address>
	    <postal> 
		<street> </street>
		<city>Milipitas</city>
		<region>CA</region>
		<code>95035</code> 
		</postal>
        <email>keyupate@cisco.com</email>
      </address>
    </author>
<date year="2016" />
   <area>Routing Area</area>
   <workgroup>IDR</workgroup>
    <keyword>RFC</keyword>
     <keyword>Request for Comments</keyword>
     <keyword>I-D</keyword>
     <keyword>Internet-Draft</keyword>
     <keyword>aspath</keyword>
	 <keyword>ORF </keyword>
<abstract>
	 <t>This document defines a new Outbound Router Filter type for BGP,
   termed "Aspath Outbound Route Filter", that can be used to perform 
   aspath based route filtering. This ORF-type supports aspath based 
   route filtering as well as regular expression based matching, for 
   address groups.
   </t>
</abstract>
</front>
<middle>
<section title="Introduction">
<t>
   The Cooperative Outbound Route Filtering Capability defined in 
   <xref target="RFC5292"></xref> provides a mechanism for a BGP speaker
   to send to its BGP peer a set of Outbound Route Filters (ORFs) that
   can be used by its peer to filter its outbound routing updates to the speaker.
</t>
<t>
   This documents defines a new ORF-type for BGP, termed "ASpath
   Outbound Route Filter (ASpath ORF)", that can be used to
   perform AS Path based route filtering. The ASpath ORF supports AS path 
   route filtering as well as the regular expression based matching for
   address groups.
</t>
</section>
<section title="ASpath ORF-Type">
<t> 
 The ASpath ORF-Type allows one to express ORFs in terms of
   regular expression and AS path numbers. That is, it provides AS path 
   based route filtering, including regular expression based matching.
</t>
<t>
 Conceptually an ASpath ORF entry consists of the fields
   &lt;Sequence, Match, Length, Aspath&gt;.
</t>
<t>
<list>
<t>
The "Sequence" field is a number that specifies the relative ordering
of the entry.
</t>
<t>
The "Match" field specifies whether this entry is "PERMIT" (value 0),
or "DENY" (value 1).
</t>
<t>
The "Length" field indicates the length of AS path regular expression
   string.
</t>
<t>
   The "aspath" field contains an AS path regular expression of an 
   address group.
</t>
<t>
   The field "Sequence" is an unsigned 32 bit value. The field "Length"
   is an unsigned 16 bit value. The field "aspath" is a variable length 
   hexadecimal string. The field "aspath" will be followed by enough 
   trailing bits to make end of field fall on an octet boundary. Note 
   that the value of trailing bits is irrelevant.
  </t>
 </list>
 </t>
</section>
<section title="ASpath ORF encoding">
<t>
The value of the ORF-Type for the ASpath ORF-Type is &lt;TBD&gt;.
</t>
<t>
 An ASpath ORF entry is encoded as follows. The "Match" field
   of the entry is encoded in the "Match" field of the common part
   <xref target="RFC5292"></xref>, and the remaining fields of the entry is encoded in the
   "Type specific part" as follows:
<figure>
<artwork>

     +--------------------------------+
     |   Sequence (4 octets)          |
     +--------------------------------+    
     |   Length   (2 octet)           |
     +--------------------------------+     
     |   Aspath   ( variable length)  |
     +--------------------------------+
</artwork>
</figure>
</t>
<t> Note the aspath is a variable length hexadecimal string
whose length is defined by Length field.  </t>
</section>
<section title="Capability Specification for Cooperative route filtering with ASpath">
<t>
   As specified in Cooperative Route Filter<xref target="RFC5292"></xref>, 
   a BGP speaker that is willing to receive ORF entries from its peer,
   or a BGP speaker that would like to send ORF entries to its peer
   advertises this to the peer by using the Cooperative Route Filtering
   Capability uses a new BGP capability <xref target="RFC3392"></xref> 
   defined as follows:
</t>
<t>
<list> 
<t>Capability code: 3</t>
<t>Capability length: variable</t>
<t>Capability value: one or more of the following entries:</t>
</list>
</t>
<t>
<figure>
<artwork>
   +--------------------------------------------------+
   | Address Family Identifier (2 octets)             |
   +--------------------------------------------------+
   | Reserved (1 octet)                               |
   +--------------------------------------------------+
   | Subsequent Address Family Identifier (1 octet)   |
   +--------------------------------------------------+
   | Number of ORFs (1 octet)                         |
   +--------------------------------------------------+
   | ORF Type (1 octet)                               |
   +--------------------------------------------------+
   | Send/Receive (1 octet)                           |
   +--------------------------------------------------+
   | ...                                              |
   +--------------------------------------------------+
   | ORF Type (1 octet)                               |
   +--------------------------------------------------+
   | Send/Receive (1 octet)                           |
   +--------------------------------------------------+

            Fig 4. Capability encoding

</artwork>
</figure>
</t>
<t>The use and meaning of these fields are as follows:
</t>
<t><list>
<t>Address Family Identifier (AFI)
<list>
<t>
This field carries the identity of the address family for
the Network Layer protocol associated with the Network Address that follows.  
</t>
</list>
</t> 
<t> Subsequent Address Family Identifier (SAFI):
<list>
<t>This field provides additional information about the type of
the Network Layer Reachability Information carried in the attribute.
</t>
</list>
</t>
<t>Number of ORF Types
<list>
<t> This field contains the number of Filter Types to be listed in
the following fields.
</t>
</list>
</t>
<t>ORF Type
<list>
<t>This field contains the value of an ORF Type.
</t>
</list>
</t>
<t>Send/Receive
<list>
<t>This field indicates whether the sender is (a) willing to
receive ORF entries from its peer (value 1), (b) would like to
send ORF entries to its peer (value 2), or (c) both (value 3)
for the ORF Type that follows.
</t>
<t>	In the upper bits of the Send/Receive byte the top three
bits have the following encoding:  [FFFKKKSR]
where bit 0 is the left most bit.
</t>
<t>where:
<list>
<t>S = Send ORF for ASpath
</t>
<t>R = Receive ORF for ASpath
</t>
<t>KKK = a 3 bit field reserved for future expansion of 
regular expression differences in ORF.
</t>
<t>FFF = 3 bits.  
<list> 
<t> Bit 0 is the left most bit, and indicates anchoring status. 
<list>
<t>Bit 0 = 0 - implies full length regular express (regex), that is 
 implicit anchoring of ASPath as in "^ASPath$"
 <list>
 <t>anchoring--non-anchoring</t>
 <t>^X  -------->  X .* </t>
 <t>^X$ -------->  X</t>
 <t>X -----------> .* X .*</t>
 </list>
 </t>
 <t>Bit 0 = 1 - implies partial aspath regex, 
 regex may or may not have anchors</t>
</list>
</t>
<t> Bit 1 is the middle bit, and it is the "." wildcard operator.
[Collating Element]
<list> 
<t>Bit 1 = 0 -- indicates traditional application of "." as wildcard, ie: "." matches
any single character of the set [0-9 ]. </t>
<t>Bit 1 = 1 -- indicates "." matches an AS-path token/term, 
regex "." == traditional regex "[0-9]+"</t>
</list>
</t>
<t> Bit 2 is the right most bit, and indicates the "[]" operator where:
<list>
<t>Bit 2 = 0 - indicates not supported</t>
<t>Bit 2 = 1 - indicates support, e.g. [0-9]</t>
</list>
</t>
</list>
</t>
</list>
</t>
</list>
</t>
</list>
</t>
</section>
<section title="ASpath ORF Matching">
<t>
   In addition to the general matching rules defined in <xref target="RFC5292"></xref>,
   several ASpath ORF specific matching rules are defined as follows.
</t>
<t>
   It is possible that the speaker would have more than one ASpath
   ORF entry that matches the route. In that case the "first-match" rule
   applies. That is, the ORF entry with the smallest sequence number 
   among all the matching ORF entries) is considered as the sole match,
   and it would determine whether the route should be advertised.
</t>
<t>
   If any speaker does not support capabilities specified by the
   receiver but still decide to establish the connection, the
   receiver is expected to translate the AS path regular 
   expressions to the its (receiver's) interpretation of regular
   expressions as indicated in the capability announcement.
</t>
</section>
<section title="Error handling">
<t>
ORFs provide information that guides future sending, but any malformed
ORF is simply missed filtering information.  If ASpath ORF is malformed, 
the attribute shall simply be discarded. 
</t>
</section>
<section title="Security Considerations">
<t>This extension to BGP does not change the underlying security issues.
</t>
</section>
<section title="Acknowledgements">
<t>   We express our thanks to Andrew Partan, Avneesh Sachdev, Alec Peterson,
   Enke Chen, John Heasley, Dorian Kim and Bruce Cole for their
   comments.
</t>
</section>
<section anchor="IANA" title="IANA Considerations">
      <t>No IANA exist for this document. </t>
    </section>
 <section title="Security Considerations">
 <t> No security considerations are involved with 
   a gap analysis.</t>
</section>
</middle>
<back>
   <references title="Normative References">
      &RFC2119;
	  &RFC3392;
	  &RFC4271;
	  &RFC5292;
    </references>
</back>
</rfc>