Network Working Group                                      Pedro Marques
INTERNET DRAFT                                             Nischal Sheth
Expiration Date: December 2003                     Juniper Networks, Inc
                                                           Robert Raszuk
                                                      Cisco Systems, Inc
                                                             Jared Mauch
                                                               NTT/Verio
                                                         Danny McPherson
                                                          Arbor Networks
                                                               June 2003


               Dissemination of flow specification rules

                   draft-marques-idr-flow-spec-00.txt

Status of this Memo

   This document is an Internet-Draft and is in full conformance with
   all provisions of Section 10 of RFC2026.

   Internet-Drafts are working documents of the Internet Engineering
   Task Force (IETF), its areas, and its working groups.  Note that
   other groups may also distribute working documents as Internet-
   Drafts.

   Internet-Drafts are draft documents valid for a maximum of six months
   and may be updated, replaced, or obsoleted by other documents at any
   time.  It is inappropriate to use Internet-Drafts as reference
   material or to cite them other than as ``work in progress.''

   The list of current Internet-Drafts can be accessed at
   http://www.ietf.org/ietf/1id-abstracts.txt

   The list of Internet-Draft Shadow Directories can be accessed at
   http://www.ietf.org/shadow.html.

Abstract

   This document specifies the procedures necessary for the distribution
   of flow specification rules both intra an inter-as. Additionally it
   defines its application for the purpose of traffic filtering in order
   to mitigate (distributed) denial of service attacks.

   The information is carried via the Border Gateway Protocol (BGP),
   thereby reusing protocol algorithms, operational experience and
   administrative processes such as inter-provider peering agreements.




draft-marques-idr-flow-spec-00.txt                              [Page 1]


Internet Draft     draft-marques-idr-flow-spec-00.txt          June 2003


1. Introduction

   For several applications, it may be necessary to exchange control
   information pertaining to aggregated traffic flow definitions which
   cannot be expressed using destination address prefixes only.

   An aggregated traffic flow is considered to be an n-tuple consisting
   on several matching criteria such as source and destination address
   prefixes, IP protocol and transport protocol port numbers.

   The intention of this document is to define a general procedure to
   encode such flow specification rules as a BGP NLRI which can be
   reused for several different control applications. Additionally, we
   define the required mechanisms to utilize this definition to the
   problem of immediate concern to the authors: intra and inter provider
   distribution of traffic filtering rules to filter (Distributed)
   Denial of Service (DoS) attacks.

   The choice of BGP as the carrier of this control information is
   justified by the fact that the key issues in terms of complexity are
   problems which are common to unicast route distribution and have
   already been solved in the current environment.

   From an algorithmic perspective, the main problem that presents
   itself is the distributed loop-free distribution of <key, attribute>
   pairs. The key, in this particular instance, being a flow
   specification.

   From an operational perspective, the utilization of BGP as the
   carrier for this information, allows a network service provider to
   reuse both internal route distribution infrastructure (e.g.: route
   reflector or confederation design) and existing external
   relationships (e.g.: inter-domain BGP sessions to a customer
   network).

   While it is certainly possible to address this problem using other
   mechanisms the authors believe that this solution offers the
   substantial advantage of being an incremental addition to deployed
   mechanisms.












draft-marques-idr-flow-spec-00.txt                              [Page 2]


Internet Draft     draft-marques-idr-flow-spec-00.txt          June 2003


2. Flow specifications

   A flow specification is an n-tuple consisting on several matching
   criteria that can be applied to IP traffic. A given IP packet is said
   to match the defined flow if it matches all the specified criteria.

   A given flow may be associated with a set of attributes, depending on
   the particular application, such attributes may or may not include
   reachability information (i.e. NEXT_HOP). Well-known or AS-specific
   community attributes can be used to encode a set of predeterminate
   actions.

   A particular application is identified by a specific (AFI, SAFI) pair
   and corresponds to a distinct set of RIBs. Those RIBs should be
   treated independently from each other in order to assure non-
   interference between distinct applications.

   BGP itself treats the NLRI as an opaque key to an entry in its
   databases. Entries that are placed in the Loc-RIB are then associated
   with a given set of semantics which is application dependent. This is
   consistent with existing BGP applications. For instance IP unicast
   routing (AFI=1, SAFI=1) and IP multicast reverse-path information
   (AFI=1, SAFI=2) are handled by BGP without any particular semantics
   being associated with them until installed in the Loc-RIB.

   Standard BGP policy mechanisms, such as UPDATE filtering by NLRI
   prefix and community matching, SHOULD apply to the newly defined
   NLRI-type. Network operators can also control propagation of such
   routing updates by enabling or disabling the exchange of a particular
   (AFI, SAFI) pair on a given BGP peering session.


3. Dissemination of Information

   We define a "Flow Specification" NLRI type that may include several
   components such as destination prefix, source prefix, protocol,
   ports, etc. This NLRI is treated as an opaque bit string prefix by
   BGP. Each bit string identifies a key to a database entry which a set
   of attributes can be associated with.

   This NLRI information is encoded using MP_REACH_NLRI and
   MP_UNREACH_NLRI attributes as defined in [BGP-MP]. Whenever the
   corresponding application does not require Next Hop information, this
   shall be encoded as a 0 octet length Next Hop in the MP_REACH_NLRI
   attribute and ignored on receipt.

   The NLRI field of the MP_REACH_NLRI and MP_UNREACH_NLRI is encoded as
   a two byte NLRI length value in octets followed by a variable length



draft-marques-idr-flow-spec-00.txt                              [Page 3]


Internet Draft     draft-marques-idr-flow-spec-00.txt          June 2003


   NLRI value.

      +------------------------------+
      |    NLRI length (2 octets)    |
      +------------------------------+
      |    NLRI value  (variable)    |
      +------------------------------+

   The Flow Specification NLRI-type consists of several optional
   subcomponents. A specific packet is considered to match the flow
   specification when it matches the intersection (AND) of all the
   components present in the specification.

   The following component types are defined:

      Type 1 - Destination Prefix

         Encoding: <type (1 octet), prefix length (1 octet), prefix>

         Defines the destination prefix to match. Prefixes are encoded
         as in BGP UPDATE messages, a length in bits is followed by
         enough octets to contain the prefix information.

      Type 2 - Source Prefix

         Encoding: <type (1 octet), prefix-length (1 octet), prefix>

         Defines the source prefix to match.

      Type 3 - Protocol

         Encoding: <type (1 octet), IP protocol (1 octet)>

         Defines the IP protocol value to match.

      Type 4 - Port

         Encoding: <type (1 octet), TCP/UDP port (2 octets)>

         Defines the TCP/UDP port to match as source OR destination.

      Type 5 - Destination port

         Encoding: <type (1 octet), TCP/UDP port (2 octets)>

         Defines the destination TCP/UDP port to match.

      Type 6 - Source port



draft-marques-idr-flow-spec-00.txt                              [Page 4]


Internet Draft     draft-marques-idr-flow-spec-00.txt          June 2003


         Encoding: <type (1 octet), TCP/UDP port (2 octets)>

         Defines the source TCP/UDP port to match.

      Type 7 - ICMP type

         Encoding: <type (1 octet),  icmp type(1 octet)>

         Defines the source icmp type to match.

      Type 8 - Packet length

         Encoding: <type (1 octet),  IP packet length (2 octets)>

         Match on the total IP packet length (excluding L2 but including
         IP header).

   Flow specification components must follow strict type ordering. A
   given component type may or may not be present in the specification,
   but if present it MUST precede any component of higher numeric type
   value.

   If a given component type within a prefix in unknown, the prefix in
   question cannot be used for traffic filtering purposes by the
   receiver. Since a Flow Specification as the semantics of a logical
   AND of all components, if a component is FALSE by definition it
   cannot be applied. However for the purposes of BGP route propagation
   this prefix should still be transmitted since BGP route distribution
   is independent on NLRI semantics.

   Flow specification components are to be interpreted as a bit match at
   a given packet offset. When more than one component in a flow
   specification tests the same packet offset the behavior is
   undetermined.

   The <type, value> encoding is chosen in order to account for future
   extensibility.

   An example of a Flow Specification encoding for: "all packets to
   10.0.1/24 and TCP port 25".

        destination  proto   port
      +-------------+-----+--------+
      01 18 0a 01 01 03 06 04 00 19

   This constitutes a NLRI with an NLRI length of 10 octets.

   Implementations wishing to exchange flow specification rules MUST use



draft-marques-idr-flow-spec-00.txt                              [Page 5]


Internet Draft     draft-marques-idr-flow-spec-00.txt          June 2003


   BGP's Capability Advertisement facility to exchange the Multiprotocol
   Extension Capability Code (Code 1) as defined in [BGP-MP].  The (AFI,
   SAFI) pair carried in the Multiprotocol Extension capability MUST be
   the same as the one used to identify a particular application that
   uses this NLRI-type.


4. Traffic filtering

   Traffic filtering policies where traditionally considered to be
   relatively static.  The popularity of traffic-based denial of service
   (DoS) attacks, which often requires the network operator to be able
   to use traffic filters for detection and mitigation, brings with it
   requirements that are not fully satisfied by existing tools.

   Several techniques are currently used to control traffic filtering of
   DoS attacks.  Among those, one of the most common is to inject
   unicast route advertisements corresponding to a destination prefix
   being attacked. One variant of this technique marks such route
   advertisements with a community that gets translated into a discard
   next-hop by the receiving router. Other variants, attract traffic to
   a particular node that serves as a deterministic drop point.

   Using unicast routing advertisements to distribute traffic filtering
   information has the advantage of using the existing infrastructure
   and inter-as communication channels. This can allow, for instance,
   for a service provider to accept filtering requests from customers
   for address space they own.

   There are several drawbacks, however. An issue that is immediately
   apparent is the granularity of filtering control: only destination
   prefixes may be specified. Another area of concern is the fact that
   filtering information is intermingled with routing information.

   The mechanism defined in this document is designed to address these
   limitations. We use the flow specification NLRI defined above to
   convey information about traffic filtering rules for traffic that
   should be discarded.

   This mechanism is designed to, primarily, allow an upstream
   autonomous system to perform inbound filtering, in their ingress
   routers of traffic that a given downstream AS wishes to drop.

   In order to achieve that goal, we define an application specific NLRI
   identifier (AFI=1, SAFI=TBD) along with specific sematic rules.  BGP
   routing updates containing this identifier use the flow specification
   NLRI encoding to convey particular aggregated flows that require
   special treatment.



draft-marques-idr-flow-spec-00.txt                              [Page 6]


Internet Draft     draft-marques-idr-flow-spec-00.txt          June 2003


5. Validation procedure

   Flow specifications received from a BGP peer and which are accepted
   in the respective Adj-RIB-In are used as input to the route selection
   process. Although the forwarding attributes of two routes for the
   same Flow Specification prefix may be the same, BGP is still required
   to perform its path selection algorithm in order to select the
   correct set of attributes to advertise.

   The first step of the BGP Route Selection procedure [BGP-BASE]
   (section 9.1.2) is to exclude from the selection procedure routes
   that are considered non-feasible. In the context of IP routing
   information this step is used to validate that the NEXT_HOP attribute
   of a given route is resolvable.

   The concept can be extended, in the case of Flow Specification NLRI,
   to allow other validation procedures.

   A flow specification NLRI SHOULD be validated such that it is
   considered unfeasible if it contains an non-empty AS_PATH and that
   AS_PATH does not match the AS_PATH of the best match unicast route
   that includes the specified destination address prefix.

   The underlying concept is that the neighboring AS that advertises the
   best unicast route for a destination is allowed to advertise flow
   spec information that conveys a less or equally specific destination
   prefix.

   The neighboring AS is the immediate destination of the traffic
   described by the Flow Specification. If it requests these flows to be
   dropped that request can be honored without concern that it
   represents a denial of service in itself. Supposedly, the traffic is
   being dropped by the downstream autonomous-system and there is no
   added value in carrying the traffic to it.

   BGP implementations MUST also enforce that the AS_PATH attribute of a
   route received via eBGP contains the neighboring AS in the left-most
   position of the AS_PATH attribute. While this rule is optional in the
   BGP specification, it becomes necessary to enforce it for security
   reasons.











draft-marques-idr-flow-spec-00.txt                              [Page 7]


Internet Draft     draft-marques-idr-flow-spec-00.txt          June 2003


6. Traffic Filtering Actions

   The default action for a traffic filtering flow specification is to
   discard IP traffic that matches that particular rule.

   In some situations, a network operator may choose, to monitor a
   particular aggregated flow while still forwarding the affected
   packets. This action is specified by tagging the respective flow
   specifications with the well-known community of value TBD.

   Other actions such as rate-limiting or policy-based routing may be
   employed as well, although further discussions of these actions is
   considered beyond the scope of this document.


7. Monitoring

   Traffic filtering applications require monitoring and traffic
   statistics facilities. While this is an implementation specific
   choice, implementations SHOULD provide:

      - A mechanism to log the packet header of filtered traffic,

      - A mechanism to count the number of drops matching a given Flow
        Specification rule.


8. Security considerations

   Inter-provider routing is based on a web of trust. Neighboring
   autonomous-systems are trusted to advertise valid reachability
   information. If this trust model is violated, a neighboring
   autonomous system may cause a denial of service attack by advertising
   reachability information for a given prefix for which it does not
   provide service.

   As long as traffic filtering rules are restricted to match the
   corresponding unicast routing paths for the relevant prefixes, the
   security characteristics of this proposal are equivalent to the
   existing security properties of BGP unicast routing.

   Where it not the case, this would open the door to further denial of
   service attacks.








draft-marques-idr-flow-spec-00.txt                              [Page 8]


Internet Draft     draft-marques-idr-flow-spec-00.txt          June 2003


9. Acknowledgments

   The authors would like to thank Yakov Rekhter, Dennis Ferguson and
   Chris Morrow for their comments.



10. References

   [BGP-BASE] Y. Rekhter, T. Li, S. Hares, "A Border Gateway Protocol 4
   (BGP-4)", draft-ietf-idr-bgp4-20.txt, 03/03

   [BGP-MP] T. Bates, R. Chandra, D. Katz, Y. Rekhter, "Multiprotocol
   Extensions for BGP-4", RFC2858.


11. Authors' Addresses

Pedro Marques
Juniper Networks
1194 N. Mathilda Ave.
Sunnyvale, CA 94089
E-mail: roque@juniper.net

Nischal Sheth
Juniper Networks
1194 N. Mathilda Ave.
Sunnyvale, CA 94089
E-mail: roque@juniper.net

Robert Raszuk
Cisco Systems, Inc.
Al. Jerozolimskie 146C
02-305 Warsaw, Poland
Email: rraszuk@cisco.com

Jared Mauch
NTT/VERIO
8285 Reese Lane
Ann Arbor, MI, 48103-9753
Email: jmauch@verio.net | jared@puck.nether.net

Danny McPherson
Arbor Networks
Email: danny@arbor.net






draft-marques-idr-flow-spec-00.txt                              [Page 9]