| Internet-Draft | Source-IP-Origin-AS Filter | September 2026 |
| Wang, et al. | Expires 25 March 2027 | [Page] |
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 source IP address. This extension is particularly useful in mitigating Distributed Denial of Service (DDoS) attacks where the source IP addresses are dynamic or numerous but belong to a specific source AS.¶
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.¶
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.¶
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.¶
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 scenarios, an operator may need to apply rate-limiting, redirection, or filtering to traffic sourced from a particular network (Autonomous System), even when the specific source IP prefixes within that AS are numerous or rapidly changing. Manually updating hundreds of prefix-based FlowSpec rules is inefficient and consumes excessive Hardware Forwarding Information Base (FIB) / TCAM resources. This document introduces a new FlowSpec component that allows operators to use the Source Origin AS as a matching criterion.¶
This document proposes a new Flow Specification component type that is encoded in the BGP FlowSpec NLRI [RFC8955] [RFC8956].¶
Type TBD1 - Source-IP-Origin-AS¶
Encoding: <type (1 octet), [op, value]+>¶
It contains a set of {operator, value} pairs used to match the Source-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 |
+---+---+---+---+---+---+---+---+
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 Source-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:¶
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 +---------------------------------------------------------------+ ~ Source-IP-Origin-AS (4 octets) ~ +---------------------------------------------------------------+
As defined in [RFC8955], a strict ordering of components MUST be followed to ensure a deterministic comparison of FlowSpec NLRIs.¶
The Source-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.]¶
When a BGP speaker receives and installs a FlowSpec route containing the Source-IP-Origin-AS component, the matching process for a transit data packet MUST proceed as follows:¶
The router extracts the packet's Source IP address.¶
The router performs a longest-prefix match (LPM) lookup for the Source IP in its local BGP Loc-RIB / FIB to retrieve the associated active BGP route.¶
The router evaluates the AS_PATH attribute of the retrieved BGP route:¶
If the evaluated Origin AS matches the criterion in the FlowSpec rule, the packet matches this component.¶
In multi-homing or multipath scenarios where a source prefix is reachable via paths with different Origin ASes, the match MUST succeed if ANY valid active path for the source 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 Section 10 of [RFC8955] and [RFC8956].¶
This section describes how to use this function in a simple scenario. Consider the topology shown in Figure 3. Router R2 in AS64597 receives traffic originating from AS64598 destined for IP Prefix 61. The operator wants to redirect all traffic originating from AS64598 towards Router R3 before forwarding it to IP Prefix 61.¶
+---------+
| 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+
* +---+ * +-------+
* *
*************************
Using the traditional method, ISP AS64597 must inject multiple "Destination Prefix + Source Prefix" FlowSpec rules into Router R2:¶
+--------------+--------------+-------------------------+ | Destination | Source Prefix| Action / Next-hop | | Prefix | | | +--------------+--------------+-------------------------+ | IP Prefix 61 | IP Prefix 81 | Redirect to R3 | | IP Prefix 61 | IP Prefix 82 | Redirect to R3 | | IP Prefix 61 | IP Prefix 83 | Redirect to R3 | | IP Prefix 61 | IP Prefix 84 | Redirect to R3 | | ... | ... | ... | +--------------+--------------+-------------------------+
Using the method defined in this draft, ISP AS64597 needs to inject only a single "Destination Prefix + Source IP Origin AS" FlowSpec rule:¶
+--------------+--------------+-------------------------+ | Destination | Source IP | Action / Next-hop | | Prefix | Origin AS | | +--------------+--------------+-------------------------+ | IP Prefix 61 | AS64598 | Redirect to R3 | +--------------+--------------+-------------------------+
This method saves significant TCAM space on network elements, reduces BGP UPDATE messaging load on the control plane, and simplifies operational management when a source AS advertises numerous dynamic prefixes.¶
In addition to the security considerations in [RFC8955] and [RFC8956], operators MUST be aware of the following:¶
Routing Inconsistency: Packet classification relies on the local BGP RIB state of the forwarding router. If different ingress routers have different active BGP routes (and thus different Origin AS views) for a given source IP, filtering or redirection actions may be applied inconsistently.¶
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 Source Origin AS matching is performed against validated BGP routes.¶
Validation of FlowSpec Routes: BGP FlowSpec routes MUST be validated against originating BGP peers according to the FlowSpec validation rules (Section 6 of [RFC8955]) to prevent cross-administrative-domain traffic hijacking.¶
IANA is requested to allocate a new component type in the "Flow Spec Component Types" registry defined in [RFC8955]:¶
+-------+-------------------------------+---------------+ | Type | Description | Reference | +-------+-------------------------------+---------------+ | TBD1 | Source-IP-Origin-AS | This-Draft | +-------+-------------------------------+---------------+¶
TBD¶
TBD¶