--- 1/draft-ietf-idr-flow-spec-06.txt 2009-04-02 02:12:05.000000000 +0200 +++ 2/draft-ietf-idr-flow-spec-07.txt 2009-04-02 02:12:05.000000000 +0200 @@ -1,24 +1,24 @@ IDR Working Group P. Marques Internet-Draft N. Sheth Intended status: Standards Track R. Raszuk -Expires: September 28, 2009 B. Greene +Expires: October 3, 2009 B. Greene Juniper Networks J. Mauch NTT/Verio D. McPherson Arbor Networks - March 27, 2009 + April 1, 2009 Dissemination of flow specification rules - draft-ietf-idr-flow-spec-06 + draft-ietf-idr-flow-spec-07 Status of this Memo This Internet-Draft is submitted to IETF in full conformance with the provisions of BCP 78 and BCP 79. 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. @@ -27,21 +27,21 @@ 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. - This Internet-Draft will expire on September 28, 2009. + This Internet-Draft will expire on October 3, 2009. Copyright Notice Copyright (c) 2009 IETF Trust and the persons identified as the document authors. All rights reserved. This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents in effect on the date of publication of this document (http://trustee.ietf.org/license-info). Please review these documents carefully, as they describe your rights @@ -66,28 +66,28 @@ Table of Contents 1. Definitions of Terms Used in this Memo . . . . . . . . . . . . 4 2. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 4 3. Flow specifications . . . . . . . . . . . . . . . . . . . . . 6 4. Dissemination of Information . . . . . . . . . . . . . . . . . 6 5. Traffic filtering . . . . . . . . . . . . . . . . . . . . . . 12 5.1. Order of traffic filtering rules . . . . . . . . . . . . . 13 6. Validation procedure . . . . . . . . . . . . . . . . . . . . . 14 - 7. Traffic Filtering Actions . . . . . . . . . . . . . . . . . . 15 + 7. Traffic Filtering Actions . . . . . . . . . . . . . . . . . . 16 8. Traffic filtering in RFC2547bis networks . . . . . . . . . . . 17 - 9. Monitoring . . . . . . . . . . . . . . . . . . . . . . . . . . 17 + 9. Monitoring . . . . . . . . . . . . . . . . . . . . . . . . . . 18 10. Security considerations . . . . . . . . . . . . . . . . . . . 18 - 11. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 18 - 12. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 20 - 13. Normative References . . . . . . . . . . . . . . . . . . . . . 20 - Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 21 + 11. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 19 + 12. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 21 + 13. Normative References . . . . . . . . . . . . . . . . . . . . . 21 + Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 22 1. Definitions of Terms Used in this Memo NLRI - Network Layer Reachability Information RIB - Routing Information Base Loc-RIB - Local RIB AS - Autonomous System Number @@ -384,21 +384,23 @@ Match on the total IP packet length (excluding L2 but including IP header). Values are encoded using as 1 or 2 byte quantities. Type 11 - DSCP Encoding: Defines a list of {operation, value} pairs used to match the - 6-bit DSCP field. + 6-bit DSCP field [RFC2474]. Values are encoded using a single + byte, where the two most significant bits are zero and the six + least significant bits contain the DSCP value. Type 12 - Fragment Encoding: Uses bitmask operand format defined above. 0 1 2 3 4 5 6 7 +---+---+---+---+---+---+---+---+ | Reserved |LF |FF |IsF|DF | @@ -534,38 +536,69 @@ 5.1. Order of traffic filtering rules With traffic filtering rules, more than one rule may match a particular traffic flow. Thus it is necessary to define the order at which rules get matched and applied to a particular traffic flow. This ordering function must be such that it must not depend on the arrival order of the flow specifications rules and must be constant in the network. - We choose to order traffic filtering rules such that the order of two - flow specifications is given by the comparison of NLRI key byte - strings as defined by the memcmp() function is the ISO C standard. - For strings of different lenghts, the common prefix is compared. If - equal the shorter string is considered to preceed the longer one. + The relative order of two flow specification rules is determined by + comparing the their respective components. The algorithm starts by + comparing the left-most components of the rules. If the types + differ, the rule with lowest numeric type value has higher precedence + (and thus will match before) the rule that doesn't contain that + component type. If the component types are the same, then a type + specific comparison is performed. - Given the way that flow specifications are encoded this results in a - flow with a less-specific destination IP prefix being considered - less-than (and thus match before) a flow specification with a more- - specific destination IP prefix. + For IP prefix values (IP destination and source prefix) precedence is + given to lowest IP value of the common prefix length; if the common + prefix is equal then the most specific prefix has precedence. - This matches an application model where the user may want to define a - restriction that affects an aggregate of traffic and a subsequent - rule that applies only to a subset of that. + For all other component types, unless otherwise specified, the + comparison is performed by comparing the component data as a binary + string using the the memcmp() function as defined by the ISO C + standard. For strings of different lenghts, the common prefix is + compared. If equal the longest string is considered to have higher + precedence than the shorter one. - A flow-specification without a destination IP prefix is considered to - match after all flow-specifications that contain an IP destination - prefix. + Pseudocode: + + flow_rule_cmp (a, b) + { + comp1 = next_component(a); + comp2 = next_component(b); + while (comp1 || comp2) { + // component_type returns infinity on end-of-list + if (component_type(comp1) < compnent_type(comp2)) { + return A_HAS_PRECEDENCE; + } + if (component_type(comp1) > compnent_type(comp2)) { + return B_HAS_PRECEDENCE; + } + + if (component_type(comp1) == IP_DESTINATION || IP_SOURCE) { + common = MIN(prefix_length(comp1), prefix_length(comp2)); + cmp = prefix_compare(comp1, comp2, common); + // not equal, lowest value has precedence + // equal, longest match has precedence + } else { + common = MIN(component_length(comp1), component_length(comp2)); + cmp = memcmp(data(comp1), data(comp2), common); + // not equal, lowest value has precedence + // equal, longest string has precedence + } + } + + return EQUAL; + } 6. 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. @@ -649,23 +683,23 @@ extended community across the Autonomous system boundary and uses following extended community encoding: The first two octets carry the 2 octet id which can be assigned from a 2 byte AS number. When 4 byte AS number is locally present 2 least significant bytes of such AS number can be used. This value is purely informational and should not be interpreted by the implementation. The remaining 4 octets carry the rate information in IEEE - floating point format , units being bytes per second. A - traffic-rate of 0 should result on all traffic for the - particular flow to be discarded. + floating point [IEEE.754.1985] format , units being bytes per + second. A traffic-rate of 0 should result on all traffic for + the particular flow to be discarded. Traffic-action The traffic-action extended community consists of 6 bytes of which only the 2 least significant bits of the 6th byte (from left to right) are currently defined. 0 1 2 3 4 5 6 7 +---+---+---+---+---+---+---+---+ | reserved | S | T | +---+---+---+---+---+---+---+---+ @@ -675,26 +709,28 @@ of the traffic filter stops when this rule is applied. * Sample (bit 6). Enables traffic sampling and logging for this flow specification. Redirect The redirect extended community allows the traffic to be redirected to a VRF routing instance that list the specified route-target in its import policy. If several local instances match this criteria, the choice between them is a local matter (for example, the instance with the lowest Route Distinguisher - value can be elected). + value can be elected). This extended community uses the same + encoding as the Route Target extended community [RFC4360] Traffic Marking The traffic marking extended community instructs a system to modify the DSCP bits of a transiting IP packet to the corresponding value. This extended community is encoded as a - sequence of 5 zero bytes followed by the DSCP value. + sequence of 5 zero bytes followed by the DSCP value encoded in the + 6 least significant bits of 6th byte. 8. Traffic filtering in RFC2547bis networks Provider-based layer 3 VPN networks, such as the ones using an BGP/ MPLS IP VPN [RFC4364] control plane, have different traffic filtering requirements than internet service providers. In these environments, the VPN customer network often has traffic filtering capabilities towards their external network connections (e.g. firewall facing public network connection). Less common is the @@ -856,26 +891,36 @@ The authors would like to thank Yakov Rekhter, Dennis Ferguson, Chris Morrow, Charlie Kaufman and David Smith for their comments. Chaitanya Kodeboyina helped design the flow validation procedure. Steven Lin and Jim Washburn ironed out all the details necessary to produce a working implementation. 13. Normative References + [IEEE.754.1985] + Institute of Electrical and Electronics Engineers, + "Standard for Binary Floating-Point Arithmetic", + IEEE Standard 754, August 1985. + [RFC0793] Postel, J., "Transmission Control Protocol", STD 7, RFC 793, September 1981. [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997. + [RFC2474] Nichols, K., Blake, S., Baker, F., and D. Black, + "Definition of the Differentiated Services Field (DS + Field) in the IPv4 and IPv6 Headers", RFC 2474, + December 1998. + [RFC4271] Rekhter, Y., Li, T., and S. Hares, "A Border Gateway Protocol 4 (BGP-4)", RFC 4271, January 2006. [RFC4303] Kent, S., "IP Encapsulating Security Payload (ESP)", RFC 4303, December 2005. [RFC4360] Sangli, S., Tappan, D., and Y. Rekhter, "BGP Extended Communities Attribute", RFC 4360, February 2006. [RFC4364] Rosen, E. and Y. Rekhter, "BGP/MPLS IP Virtual Private