IDR Working Group H. Wang Internet-Draft Huawei Intended status: Standards Track A. Wang Expires: 25 March 2027 China Telecom S. Zhuang Y. Huang T. Qin Huawei 21 September 2026 Destination-IP-Origin-AS Filter for BGP Flow Specification draft-wang-idr-flowspec-dip-origin-as-filter-14 Abstract This document defines an extension to the Border Gateway Protocol (BGP) Flow Specification (FlowSpec) to enable filtering based on the Origin Autonomous System (AS) of the destination IP address. This extension is particularly useful in mitigating Distributed Denial of Service (DDoS) attacks or optimizing traffic redirection where the target IP addresses are numerous or rapidly changing, but belong to a specific destination Origin AS. Requirements Language The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here. Status of This Memo This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet- Drafts is at https://datatracker.ietf.org/drafts/current/. 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." This Internet-Draft will expire on 25 March 2027. Wang, et al. Expires 25 March 2027 [Page 1] Internet-Draft Destination-IP-Origin-AS Filter September 2026 Copyright Notice Copyright (c) 2026 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 (https://trustee.ietf.org/ license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Revised BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Revised BSD License. Table of Contents 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 2. Definitions and Acronyms . . . . . . . . . . . . . . . . . . 3 3. Flow Specification Encoding for Destination-IP-Origin-AS Filter . . . . . . . . . . . . . . . . . . . . . . . . . 3 3.1. Ordering of Components . . . . . . . . . . . . . . . . . 4 3.2. Operational Procedures and Packet Matching Logic . . . . 4 4. Use Cases . . . . . . . . . . . . . . . . . . . . . . . . . . 5 5. Security Considerations . . . . . . . . . . . . . . . . . . . 6 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 7 7. Contributors . . . . . . . . . . . . . . . . . . . . . . . . 7 8. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 7 9. References . . . . . . . . . . . . . . . . . . . . . . . . . 7 9.1. Normative References . . . . . . . . . . . . . . . . . . 7 9.2. Informative References . . . . . . . . . . . . . . . . . 8 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 8 1. Introduction BGP [RFC4271] Flow Specification (FlowSpec), defined in [RFC8955] and [RFC8956], allows for the dissemination of traffic filtering rules. Current FlowSpec components support filtering by destination prefix, source prefix, and various Layer 4 parameters. In certain DDoS mitigation and traffic engineering scenarios, an operator may need to apply rate-limiting, redirection, or filtering to traffic destined for a particular network (Autonomous System), even when the specific target IP prefixes within that AS are numerous or rapidly changing. Manually updating hundreds of prefix-based FlowSpec rules is inefficient and consumes significant Hardware Forwarding Information Base (FIB) / TCAM resources. This document introduces a new FlowSpec component that allows operators to use the Destination Origin AS as a matching criterion. Wang, et al. Expires 25 March 2027 [Page 2] Internet-Draft Destination-IP-Origin-AS Filter September 2026 2. Definitions and Acronyms * FS: Flow Specification * Destination-IP-Origin-AS: The origin AS number of the destination IP address, determined from the rightmost AS in the AS_PATH attribute of the matching BGP route. 3. Flow Specification Encoding for Destination-IP-Origin-AS Filter This document proposes a new Flow Specification component type that is encoded in the BGP FlowSpec NLRI [RFC8955] [RFC8956]. * Type TBD1 - Destination-IP-Origin-AS Encoding: It contains a set of {operator, value} pairs used to match the Destination-IP-Origin-AS. The operator byte (numeric_op) is encoded as specified in Section 4.2 of [RFC8955]: 0 1 2 3 4 5 6 7 +---+---+---+---+---+---+---+---+ | e | a | len | 0 |lt |gt |eq | +---+---+---+---+---+---+---+---+ Figure 1: Numeric Operator (numeric_op) Where: * e - End-of-list bit. Set in the last {op, value} pair in the list. * a - AND bit. If unset, the previous term is logically ORed with the current one. If set, the operation is a logical AND. It MUST be unset (0) in the Destination-IP-Origin-AS filter. * len - The length of the value field for this operator given as (1 << len). This encodes 1 (len=00), 2 (len=01), 4 (len=10), and 8 (len=11) octets. For 4-byte AS numbers, len MUST be set to 10 (4 octets). * lt, gt, eq - Less than, Greater than, and Equal comparison bits. The value field contains a 4-octet Autonomous System Number encoded in network byte order: Wang, et al. Expires 25 March 2027 [Page 3] Internet-Draft Destination-IP-Origin-AS Filter September 2026 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +---------------------------------------------------------------+ ~ Destination-IP-Origin-AS (4 octets) ~ +---------------------------------------------------------------+ Figure 2: Destination-IP-Origin-AS Value 3.1. Ordering of Components As defined in [RFC8955], a strict ordering of components MUST be followed to ensure a deterministic comparison of FlowSpec NLRIs. The Destination-IP-Origin-AS component (Type TBD1) MUST be ordered after Type 2 (Source Prefix) and before Type 3 (IP Protocol). [Note to IANA: The exact numeric order will depend on the assigned Type value.] 3.2. Operational Procedures and Packet Matching Logic When a BGP speaker receives and installs a FlowSpec route containing the Destination-IP-Origin-AS component, the matching process for a transit data packet MUST proceed as follows: 1. The router extracts the packet's Destination IP address. 2. The router performs a longest-prefix match (LPM) lookup for the Destination IP in its local BGP Loc-RIB / FIB to retrieve the associated active BGP route. 3. The router evaluates the AS_PATH attribute of the retrieved BGP route: * The Origin AS is defined as the rightmost AS number in the AS_SEQUENCE segment of the AS_PATH. * If the AS_PATH ends with an AS_SET or AS_CONFED_SEQUENCE, the match fails unless all ASes in the set match, or the implementation supports evaluating each AS in the AS_SET against the filter. 4. If the evaluated Origin AS matches the criterion in the FlowSpec rule, the packet matches this component. Wang, et al. Expires 25 March 2027 [Page 4] Internet-Draft Destination-IP-Origin-AS Filter September 2026 5. In multi-homing or multipath scenarios where a destination prefix is reachable via paths with different Origin ASes, the match MUST succeed if ANY valid active path to the destination prefix matches the Origin AS defined in the FlowSpec rule. If a receiving BGP speaker cannot support this new component type, it MUST follow the error handling and component skipping procedures defined in [RFC8955] and [RFC8956]. 4. Use Cases This section describes a representative use case for traffic redirection and rate-limiting using the Destination-IP-Origin-AS filter. Consider the topology shown in Figure 3. ISP AS64597 receives traffic from AS64596 (Source IP Prefix 61) destined for AS64598. +---------+ | BGP FS | | Server | +----|----+ | | / / ************/************ IP Prefix 81 * / * IP Prefix 82 IP Prefix 61 * / AS64597 * IP Prefix 83 * / * IP Prefix 84 +-------+ * +---+/ +---+ * +-------+ +AS64596+-------+ R1+---------+ R2|------+AS64598+ +-------+ * +-+-+\ +---+ */ +-------+ * \ |\ / * \ | \ /* IP Prefix 91 * \ | /\* IP Prefix 92 * \ | / \ IP Prefix 93 * \ |/ *\ IP Prefix 94 * \ +-+-+ * \ +-------+ * \-+ R3+------+AS64599+ * +---+ * +-------+ * * ************************* Figure 3: Traffic Redirection Using FlowSpec Wang, et al. Expires 25 March 2027 [Page 5] Internet-Draft Destination-IP-Origin-AS Filter September 2026 Using traditional FlowSpec (RFC 8955), if AS64598 announces dozens or hundreds of individual prefixes (Prefix 81, 82, 83, 84...), AS64597 must inject separate FlowSpec rules for each destination prefix to redirect traffic coming from Source IP Prefix 61 towards Router R3: +--------------+--------------+-------------------------+ | Destination | Source Prefix| Action / Next-hop | | Prefix | | | +--------------+--------------+-------------------------+ | IP Prefix 81 | IP Prefix 61 | Redirect to R3 | | IP Prefix 82 | IP Prefix 61 | Redirect to R3 | | IP Prefix 83 | IP Prefix 61 | Redirect to R3 | | IP Prefix 84 | IP Prefix 61 | Redirect to R3 | | ... | ... | ... | +--------------+--------------+-------------------------+ Figure 4: Traditional Destination Prefix Matching Using the extension defined in this draft, the BGP FlowSpec Server needs to generate only a single FlowSpec rule: +--------------+--------------+--------------------+ | Destination | Source Prefix| Action / Next-hop | | IP Origin AS | | | +--------------+--------------+--------------------+ | 64598 | IP Prefix 61 | R3 | +--------------+--------------+--------------------+ Figure 5: Destination-IP-Origin-AS Matching This significantly reduces BGP NLRI messaging overhead, control plane churn, and hardware FIB/TCAM entry consumption on network elements. 5. Security Considerations This document extends BGP FlowSpec. Security considerations discussed in [RFC8955] and [RFC8956] apply directly. In addition, operators MUST consider the following: * Routing Inconsistency: Packet classification relies on the local BGP RIB state of the forwarding router. If different ingress routers have different active routes (and thus different Origin AS views) for a destination IP, filtering actions may be applied inconsistently. Wang, et al. Expires 25 March 2027 [Page 6] Internet-Draft Destination-IP-Origin-AS Filter September 2026 * BGP Origin Validation: Malicious or misconfigured networks may spoof AS_PATH attributes. Operators SHOULD deploy RPKI-based Route Origin Validation (ROV) [RFC6811] in their networks to ensure that the Origin AS matching is performed against validated BGP routes. * Validation of FlowSpec Routes: BGP FlowSpec routes MUST be validated against origin BGP peers according to the FlowSpec validation rules (Section 6 of [RFC8955]) to prevent cross- administrative-domain traffic hijacking. 6. IANA Considerations IANA is requested to allocate a new component type in the "Flow Spec Component Types" registry defined in [RFC8955]: +-------+-------------------------------+---------------+ | Type | Description | Reference | +-------+-------------------------------+---------------+ | TBD1 | Destination-IP-Origin-AS | This-Draft | +-------+-------------------------------+---------------+ 7. Contributors TBD 8. Acknowledgments The authors would like to acknowledge the review and inputs from Gang Yan, Robert Raszuk, Jeffray Haas, Linda Dunbar, Zhenbin Li, Rainbow Wu, Jie Dong and Ziqing Cao. 9. References 9.1. Normative References [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997, . [RFC4271] Rekhter, Y., Ed., Li, T., Ed., and S. Hares, Ed., "A Border Gateway Protocol 4 (BGP-4)", RFC 4271, DOI 10.17487/RFC4271, January 2006, . Wang, et al. Expires 25 March 2027 [Page 7] Internet-Draft Destination-IP-Origin-AS Filter September 2026 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017, . [RFC8955] Loibl, C., Hares, S., Raszuk, R., McPherson, D., and M. Bacher, "Dissemination of Flow Specification Rules", RFC 8955, DOI 10.17487/RFC8955, December 2020, . [RFC8956] Loibl, C., Ed., Raszuk, R., Ed., and S. Hares, Ed., "Dissemination of Flow Specification Rules for IPv6", RFC 8956, DOI 10.17487/RFC8956, December 2020, . 9.2. Informative References [RFC6811] Mohapatra, P., Scudder, J., Ward, D., Bush, R., and R. Austein, "BGP Prefix Origin Validation", RFC 6811, DOI 10.17487/RFC6811, January 2013, . Authors' Addresses Haibo Wang Huawei 156 Beiqing Road Beijing 100095 P.R. China Email: rainsword.wang@huawei.com Aijun Wang China Telecom Beiqijia Town, Changping District Beijing 102209 P.R. China Email: wangaj3@chinatelecom.cn Shunwan Zhuang Huawei 156 Beiqing Road Beijing 100095 P.R. China Email: zhuangshunwan@huawei.com Wang, et al. Expires 25 March 2027 [Page 8] Internet-Draft Destination-IP-Origin-AS Filter September 2026 Yang Huang Huawei 156 Beiqing Road Beijing 100095 P.R. China Email: yang.huang@huawei.com Tao Qin Huawei 156 Beiqing Road Beijing 100095 P.R. China Email: qintao11@huawei.com Wang, et al. Expires 25 March 2027 [Page 9]