rfc-9234

Route Leak Prevention and Detection Using Roles in UPDATE and OPEN Messages

A. Azimov, E. Bogomazov, R. Bush, K. Patel, K. Sriram
date2022-05 streamIETF areartg wgidr statusPROPOSED STANDARD pages12 canonicalhttps://www.rfc-editor.org/rfc/rfc9234 doi10.17487/RFC9234
Route leaks are the propagation of BGP prefixes that violate assumptions of BGP topology relationships, e.g., announcing a route learned from one transit provider to another transit provider or a lateral (i.e., non-transit) peer or announcing a route learned from one lateral peer to another lateral peer or a transit provider. These are usually the result of misconfigured or absent BGP route filtering or lack of coordination between autonomous systems (ASes). Existing approaches to leak prevention rely on marking routes by operator configuration, with no check that the configuration corresponds to that of the External BGP (eBGP) neighbor, or enforcement of the two eBGP speakers agreeing on the peering relationship. This document enhances the BGP OPEN message to establish an agreement of the peering relationship on each eBGP session between autonomous systems in order to enforce appropriate configuration on both sides. Propagated routes are then marked according to the agreed relationship, allowing both prevention and detection of route leaks.

Extracted elements (28)

design-rationale §1

BGP Role negotiation was designed as an in-band replacement for purely operator-driven, configuration-based route leak prevention, which had no mechanism to verify that both eBGP speakers agreed on the peering relationship. By encoding the role in OPEN messages, both sides must concur.

bgp, routing

design-rationale §8

Strict mode (requiring the peer to also send a BGP Role Capability) is deliberately not the default; making strict mode default could cause eBGP sessions to fail after software updates against non-compliant peers. Implementations defaulting to strict mode are strongly discouraged.

bgp, routing

design-rationale §5

The OTC Attribute value is set identically whether applied at the egress of the remote AS or at the ingress of the local AS, so if the remote AS is non-compliant the local AS compensates without disagreement. This makes the scheme robust and benefits early adopters before universal deployment.

bgp, routing

interoperability-note §6

In AS migration scenarios (RFC 7705) where a router may represent multiple ASes, OTC Attribute procedures remain valid because the egress procedures attach the OTC value equal to the ASN the router is currently representing, preserving correctness regardless of migration state.

bgp, routing

interoperability-note §5

The BGP Role negotiation and OTC Attribute procedures are NOT RECOMMENDED between ASes within an AS Confederation (RFC 5065). If an OTC Attribute exits the Confederation, its value MUST equal the AS Confederation Identifier, not any Member-AS Number.

bgp, routing

interoperability-note §5

Use of BGP Roles and OTC Attributes in networks with private AS numbers behind an Internet-facing ASN (e.g., data-center BGP per RFC 7938) is permitted, but on egress from the Internet-facing AS the OTC Attribute MUST NOT contain any value other than the Internet-facing ASN.

bgp, routing

normative-requirement §3.1 MUST NOT

Customer and Peer roles MUST NOT propagate routes learned from Providers, Peers, or RSes to other Providers, Peers, or RSes. Only routes from Customers or locally originated routes MAY be propagated upward or laterally.

bgp, routing

normative-requirement §4.2 SHOULD

For backward compatibility, if the BGP Role Capability is sent but none is received, the BGP speaker SHOULD ignore the absence and proceed with session establishment using the locally configured role.

bgp, routing

normative-requirement §5 MUST

If a route is received from a Provider, Peer, or RS and the OTC Attribute is not present, it MUST be added with a value equal to the AS number of the remote AS (ingress procedure).

bgp, routing

normative-requirement §5 MUST

If a route with the OTC Attribute is received from a Customer or RS-Client, it MUST be considered ineligible (route leak detected). If received from a Peer with an OTC value not equal to the Peer's AS number, it also MUST be considered ineligible.

bgp, routing, security

normative-requirement §4.2 MUST

If both peers advertise BGP Role Capabilities, the roles MUST correspond to one of the allowed pairs in Table 2 (Provider/Customer, RS/RS-Client, Peer/Peer). If they do not correspond, the speaker MUST reject the connection using the Role Mismatch Notification (code 2, subcode 11).

bgp, routing

normative-requirement §4.1 MUST

If the BGP Role is locally configured, the eBGP speaker MUST advertise the BGP Role Capability in the BGP OPEN message, and MUST NOT advertise multiple versions of the BGP Role Capability.

bgp, routing

normative-requirement §4.2 MUST

In strict mode, if the BGP Role Capability is sent but none is received from the remote AS, the connection MUST be rejected using the Role Mismatch Notification (code 2, subcode 11).

bgp, routing

normative-requirement §5 MUST

Once the OTC Attribute has been set, it MUST be preserved unchanged, including within an AS Confederation.

bgp, routing

normative-requirement §6 MUST NOT

Roles MUST NOT be configured on an eBGP session with a Complex peering relationship. If multiple eBGP sessions can segregate the Complex relationship into normal peering relationships, BGP Roles SHOULD be used on each resulting session.

bgp, routing

normative-requirement §5 REQUIRED

The OTC Attribute is considered malformed if its length value is not 4. An UPDATE message with a malformed OTC Attribute SHALL be handled using the 'treat-as-withdraw' approach per RFC 7606.

bgp, routing

normative-requirement §5 MUST NOT

The OTC ingress and egress procedures apply ONLY to AFI 1 (IPv4) and AFI 2 (IPv6) with SAFI 1 (unicast), and MUST NOT be applied to other address families by default. The operator MUST NOT have the ability to modify these procedures.

bgp, routing

normative-requirement §5 MUST

When advertising a route to a Customer, Peer, or RS-Client and the OTC Attribute is absent, an OTC Attribute MUST be added with a value equal to the local AS number (egress procedure). If a route already contains the OTC Attribute, it MUST NOT be propagated to Providers, Peers, or RSes.

bgp, routing

protocol-element §4.1

BGP Role Capability (Capability Code 9) is a new BGP capability advertised in OPEN messages. It has a Length of 1 octet and a Value field encoding the speaker's role (0=Provider, 1=RS, 2=RS-Client, 3=Customer, 4=Peer, 5-255=Unassigned).

bgp, routing

protocol-element §5

The Only to Customer (OTC) Attribute is an optional transitive BGP Path Attribute with Type Code 35 and a fixed length of 4 octets. Its value is an AS number indicating the AS at which the route was last propagated laterally or upward, enforcing downstream-only propagation thereafter.

bgp, routing

registry §7

IANA created the 'BGP Role Value' subregistry within the 'Capability Codes' registry, with values 0–4 assigned (Provider, RS, RS-Client, Customer, Peer) and values 5–255 unassigned. Future assignments require IETF Review.

bgp, registry, routing

registry §7

IANA registered a new BGP Path Attribute named 'Only to Customer (OTC)' with Type Code 35 in the 'BGP Path Attributes' registry.

bgp, registry, routing

registry §7

IANA registered BGP Capability Code 9 as 'BGP Role' in the 'Capability Codes' registry. IANA also registered OPEN Message Error subcode 11 as 'Role Mismatch' in the 'OPEN Message Error subcodes' registry, and marked subcodes 8–10 as Deprecated.

bgp, registry, routing

security-consideration §8

Adding an OTC Attribute on a Customer-to-Provider advertisement will cause the route to be considered ineligible by the Provider and its upstream peers, limiting propagation unpredictably. This could be exploited as a denial-of-reachability attack.

bgp, security, routing

security-consideration §8

An on-path attacker can remove or modify the OTC Attribute to circumvent route leak detection, then re-advertise a leaked route upward. This threat is inherent to BGP attribute manipulation and is not addressed by this specification (BGPsec only protects AS_PATH).

bgp, security, routing

security-consideration §8

Misconfiguration of BGP Role can affect prefix propagation: assigning Provider/Peer Role to a downstream link limits advertisements in that direction, while assigning Customer Role to an upstream provider may cause route leaks to other Providers or Peers. Role negotiation makes such misconfigurations unlikely but not impossible.

bgp, security, routing

state-machine §4.2

BGP Role negotiation during OPEN: if both peers send Role Capability, roles are checked against Table 2 allowed pairs — match leads to session establishment; mismatch triggers Role Mismatch Notification and session rejection. If only one peer sends Role Capability, default mode proceeds; strict mode rejects.

bgp, routing

wire-format §4.1

The BGP Role Capability encodes as: Code=9, Length=1 (octet), Value=integer from 0–4 (Provider/RS/RS-Client/Customer/Peer). Multiple BGP Role Capabilities with differing values in the same OPEN message are an error.

bgp, routing