Internet-Draft YoBGP November 2026
Pospichal Expires 5 May 2027 [Page]
Workgroup:
Inter-Domain Routing
Published:
Intended Status:
Standards Track
Expires:
Author:
Z. Pospichal
Quantcom, a.s.

YANG over BGP

Abstract

This document defines YANG over BGP (YoBGP), an extension of BGP for distributing network configuration objects (for example routing policies, prefix sets, community sets, and access control lists) modeled in YANG. Objects are carried in a dedicated Address Family (AFI/SAFI) and spread between routers the way routes do: they are advertised to peers, carry a version, are filtered on receipt, and are optionally re-advertised. Received objects are subject to a per-peer inbound filtering framework, persist in the receiving node's configuration independently of the state of the BGP session, and are removed only by an explicit, versioned tombstone. Its goal is effortless synchronization of selected configuration settings across a large number of BGP speakers. The framework is schema-agnostic: any YANG module, including vendor-specific ones, can be distributed.

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 5 May 2027.

▲

Table of Contents

1. Introduction

The main goal of YoBGP is effortless synchronization of selected configuration settings across a large number of BGP speakers.

Operators of large networks need selected configuration objects (routing policies, prefix sets, community sets, AS-path sets, access control lists) to be identical on many routers. This is usually achieved with automation engines (Ansible, NETCONF clients, SSH scripting) that open an administrative session to every router. Such engines hold credentials with elevated privileges for the whole fleet, and managing that access is itself an operational and security burden.

This document defines YANG over BGP (YoBGP), which extends BGP [RFC4271] with a new address family for distributing configuration objects modeled in YANG. A YoBGP object is distributed the way a route is: it is originated by one or more routers, optionally propagated through the BGP topology (including through route reflectors), and received by routers that decide locally, per peer, whether and how to apply it. No management session and no additional credentials are introduced; the existing BGP peering is the only channel.

YoBGP is a transport framework. It is decoupled from the schemas it distributes, such as [RFC9067], [RFC8519] and the BGP YANG model [I-D.ietf-idr-bgp-model], and is open to any other YANG module, including vendor-specific ones (Section 13).

1.1. Design Goals

  • Distribution like routes: objects reach routers through the existing BGP peerings and topology; no per-router login is required.
  • Receiver autonomy: each router decides, per peer, object type and object name, what it accepts (Section 11). The default is deny.
  • Persistence: applied objects stay in the configuration when a session goes down; they are removed only by an explicit tombstone (Sections 7 and 8).
  • Deterministic convergence: all speakers settle on the same version of an object regardless of arrival order or propagation path (Section 6).
  • Openness: any YANG module can be distributed, and vendors can add their own data without a new specification (Section 13).

1.2. Benefits

  • Independent implementability. YoBGP builds only on published specifications: BGP and its multiprotocol extensions, and YANG with its JSON encoding. It does not wait for the standardization of anything else, and an implementer can support any YANG module it already has. Mechanisms that define policy semantics inside BGP need new BGP elements whenever the policy language grows; YoBGP does not.
  • Diversity. YoBGP prescribes no single data model and ties a network neither to the schema of one vendor nor to the schema of one standards body. Any YANG module can be distributed, including vendor-specific ones, so a multi-vendor network can use the models its platforms support, and models can evolve without changes to this document.
  • Fewer configuration errors. An object is defined once, as YANG data, and each router maps it to its own configuration. This reduces the errors that come from rendering the same object in different syntaxes for different platforms, and removes the need to maintain one template per platform.

1.3. Non-Goals

  • Feedback to the originator. As with routes, the originator does not learn whether, or when, an object was applied. Monitoring is done out of band (Section 14).
  • Atomic multi-object commit or rollback orchestration. Each object is versioned and applied individually; dependencies between objects are handled locally by the receiver (Section 12).
  • Origin authentication of objects beyond what the BGP session provides (Section 15).

1.4. Relationship to Other Mechanisms

YoBGP distributes configuration objects that routers keep. It is not the first use of BGP to carry policy-related or filter-like information, and this section states how it differs from the closest mechanisms.

Routing Policy Distribution (RPD) [I-D.ietf-idr-rpd] also uses a new AFI/SAFI to deliver routing policy from a controller, normally through a route reflector, to routers. The two solve different problems:

  • Purpose. RPD distributes dynamic policies that adjust traffic by changing or suppressing the IP routes a router sends to its peers, for example by changing the MED, adding to the AS_PATH, or not advertising a route. YoBGP distributes the stable objects that a router's configuration refers to: prefix sets, community sets, AS-path sets, access control lists, and the routing policies themselves.
  • Semantics. RPD defines in the BGP specification what a policy can match and what it can do, and encodes it in BGP Wide Community [I-D.ietf-idr-wide-bgp-communities], a separate draft that has not been published as an RFC. Each new match condition or action needs a new element defined for BGP. YoBGP defines no policy semantics. The meaning of an object comes from its YANG module, so new kinds of objects need no change to this document.
  • Lifecycle. RPD policies are held as BGP routes for as long as the controller's session lets them be, helped by graceful restart. YoBGP objects are configuration: they persist independently of any session, carry versions, and are removed only by an explicit tombstone.
  • Where applied. A router applies RPD policies after its other policies, as a separate source of policy. YoBGP objects become part of the router's own configuration, where its other configuration can refer to them.
  • Admission. RPD relies on the trust placed in the controller's BGP session. YoBGP adds a per-peer import filter that decides, by object type and name, what a peer may create, modify or delete (Section 11).

The two mechanisms can coexist. A deployment can use YoBGP to keep stable sets and policies identical on all routers and RPD for short-lived traffic adjustments. YoBGP does not replace RPD and does not carry the dynamic policy actions that RPD defines. RPD in turn does not provide persistent, versioned, schema-driven objects.

YoBGP is also related to Outbound Route Filtering [RFC5291], which sends a filter to a peer to be applied to what that peer advertises, and to Flow Specification [RFC8955], which distributes traffic filtering rules. Neither carries configuration objects that the receiver stores.

Finally, YoBGP complements management protocols such as NETCONF [RFC6241] and does not replace them. It suits objects that must be identical on many routers and be distributed along the BGP topology without a management session to each router. It is not a general management interface.

1.5. 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.

2. Terminology

3. Overview of Operation

A YoBGP UPDATE carries exactly one fragment of an object (Section 5.4). A receiving speaker validates and filters each fragment (steps 1 and 2), reassembles the object, and then processes the complete object as it would process a route (steps 3 to 5):

  1. The NLRI and the YoBGP attribute are validated (Sections 4 and 5).
  2. The import filter of the receiving peer decides whether the object is admitted (Section 11). An object that is not admitted is discarded; it is neither stored nor propagated.
  3. An admitted object is compared by version with the current entry for the same object key in the YoBGP-RIB; a newer version replaces the entry (Section 6).
  4. A new or replaced entry is eligible for propagation to other peers (Section 10), whether or not it can be applied on this node.
  5. The entry is checked for dependencies and handed to the configuration parser (Section 12). On success the object is part of the node's configuration, that is, of the YoBGP-CIB (Section 12.3). The outcome sets the status of the entry; it does not remove the entry from the YoBGP-RIB.

4. YoBGP-NLRI

The YoBGP-NLRI is carried in MP_REACH_NLRI and MP_UNREACH_NLRI [RFC4760] under AFI=TBA1 and SAFI=TBA2. The NLRI carries the object key and the number of one fragment of the object (Section 5.4). Version and content are carried in the YoBGP attribute (Section 5). As with Flow Specification [RFC8955], the Length of Next Hop Network Address field in MP_REACH_NLRI MUST be 0 and receivers MUST ignore any next hop.

An UPDATE for this AFI/SAFI MUST carry exactly one NLRI in MP_REACH_NLRI, because the path attributes that follow describe that one fragment. An UPDATE with more than one NLRI is handled as an attribute error (Section 5.2).

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|   NLRI Type   |          NLRI Length          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|        Fragment Number        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|       Object Type Length      |     Object Type (variable)    ~
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|       Object Name Length      |     Object Name (variable)    ~
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 1

The key is built entirely from identifiers in clear text, so a speaker can filter, store and propagate an object without parsing its payload, and can name an unsupported module in a log message.

5. YoBGP Attribute

5.1. Format

The YoBGP attribute (type code TBA3) is an optional, non-transitive BGP path attribute (cf. [RFC9552]). It MUST be present in every MP_REACH_NLRI UPDATE for this AFI/SAFI.

 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                      Version (octets 0-3)                     |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                      Version (octets 4-7)                     |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                        Source Router ID                       |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|         Fragment Count        |       Payload (variable)      ~
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 2
  • Version (64 bits): see Section 6.1. The value 0 is invalid.
  • Source Router ID (32 bits): the BGP Identifier of the speaker that originated this version. It is copied unchanged when the object is propagated and is not the ORIGINATOR_ID attribute of [RFC4456].
  • Fragment Count (16 bits): the number N of fragments of the object, or 0 for a tombstone (Section 5.4).
  • Payload: one piece of the serialized object (Section 5.4). It extends to the end of the attribute. A tombstone has an empty payload, and any octets after the Fragment Count are ignored.

5.2. Error Handling for Malformed Objects

[RFC7606] requires a document that defines new BGP elements to say what is an error and how it is handled. For YoBGP the treatment depends on whether the NLRI field of MP_REACH_NLRI can still be parsed.

Treat-as-withdraw. The NLRI field can be parsed, but the YoBGP attribute is missing or malformed (wrong attribute flags, an invalid Version, an attribute shorter than its fixed part of 14 octets, a Fragment Number greater than the Fragment Count, a Fragment Number 0 with a Fragment Count other than 0 or the reverse, or a fragment with an empty payload), the UPDATE carries more than one NLRI, or the inner fields of an NLRI are inconsistent with its NLRI Length. The advertisement is handled as treat-as-withdraw [RFC7606]: it is discarded and SHOULD be logged with the neighbor address and, if known, the object key. Because a withdrawal has no effect on stored state or on the active configuration (Section 6.4), such an advertisement changes nothing. The BGP session is not reset.

NLRI field cannot be parsed. An NLRI Length exceeds the data that remains in MP_REACH_NLRI, or the Length of Next Hop Network Address is not 0. The NLRI field cannot then be located reliably, and treat-as-withdraw cannot be used [RFC7606]. The speaker SHOULD use the AFI/SAFI disable approach of [RFC4760] and [RFC7606], that is, ignore all subsequent YoBGP routes received over the session. Session reset is the other approach that [RFC7606] allows, but it is not RECOMMENDED because it also drops every other address family. Objects already applied are not affected by either approach.

5.3. Payload Structure

The payload, which is the byte string that results from reassembly (Section 5.4), is JSON text [RFC7951] in UTF-8. It is a complete data tree that contains exactly one object. It consists of the top-level data node named by the first component of the Object Type and, below it, the chain of descendants on the path to the object. Each list on the path appears with exactly one entry, which holds its keys. The object itself appears with its complete content. The payload contains nothing else.

The identity of the object in the payload, that is, the names on the path, including their modules, and the key values, MUST match the Object Type and the Object Name of the NLRI. A mismatch is a configuration payload error (Section 12.2).

When the object is applied, the receiver replaces the object in its configuration with the one in the payload as a whole, and creates the ancestors on the path if they do not exist. It MUST NOT change any other data.

5.4. Transfer of Objects in Fragments

Every object is transferred in the same way, as a sequence of N fragments. N is 1 for an object that fits in one UPDATE, larger for a bigger object, and 0 for a tombstone. There is no separate encoding for small and large objects.

The payload of the object is serialized as one byte string with the structure of Section 5.3 and cut into N pieces of any sizes that fit the peer. Each fragment is one UPDATE. Its NLRI is the object key together with the Fragment Number k, from 1 to N (Section 4). Its attribute has the Version and the Source Router ID of the object, the Fragment Count N and, as its payload, piece k. All fragments of an object carry the same Version, Source Router ID and Fragment Count.

A tombstone is a single UPDATE with Fragment Number 0, Fragment Count 0 and an empty payload.

Fragmentation applies to each hop separately. A speaker that advertises an object to a peer cuts it for that peer into as many fragments as the maximum BGP message size negotiated with that peer requires, and fragment boundaries are not preserved from one hop to the next. An UPDATE MUST NOT exceed that size. Implementations SHOULD support Extended Message [RFC8654] and SHOULD advertise it, so that fewer fragments are needed. A speaker SHOULD send the fragments in numerical order.

The receiver reassembles every object before it enters the YoBGP-RIB. Fragments are not entries of the YoBGP-RIB. For each object it receives, the receiver keeps a reassembly buffer for the session on which the fragments arrive, and never combines fragments received from different peers, because their boundaries can differ.

Steps 1 and 2 of Section 3 (validation and import filter) are applied to each fragment as it arrives, using the object key and the Fragment Count, and before any memory is allocated for reassembly, so that a rejected object is never buffered. A state that does not supersede the entry of the object in the YoBGP-RIB (Section 6.3) is discarded without being buffered.

When the buffer holds, for every number from 1 to N, a fragment with the same Version, Source Router ID and Fragment Count, the receiver concatenates the pieces in the order of their numbers, takes the result as the payload of the object, and handles the object from step 3 of Section 3 as if it had been received in one UPDATE. The buffer is then released. A tombstone is complete on arrival. Fragments that carry the same Version and Source Router ID but disagree in Fragment Count are discarded together with the buffered fragments of that Version, and the event SHOULD be logged. Until an object is complete, nothing of it is in the YoBGP-RIB and the state that was there before remains in effect.

A new version of an object can have fewer or more fragments than the previous one, for example 2 fragments after a version that had 3. Fragments of different states are never combined, because reassembly requires the same Version, Source Router ID and Fragment Count. The receiver MUST discard the reassembly state of an object, so that no orphaned fragment of a lower state remains for its object key, when it receives a newer state of that object from the same peer, when an entry that supersedes the buffered state is installed in the YoBGP-RIB, whichever peer it came from, when the session is lost, and when the limit on memory for reassembly is reached. Late fragments of a lower state are discarded on arrival, as described above. A speaker SHOULD limit the memory for reassembly per peer (Section 15.7).

6. Object Versioning and the YoBGP-RIB

6.1. Version

Version is a 64-bit unsigned integer, scoped to one object key. Zero is invalid. Versions are compared as plain unsigned integers; no wraparound arithmetic is used. A 64-bit Version does not wrap in practice: one new Version per microsecond would take more than half a million years to exhaust it. Serial number arithmetic [RFC1982] would not help an originator that restarts with lower Versions either, because it also orders Version 1 before Version 1500. An originator MUST assign strictly increasing versions to successive states of an object (including its tombstone) and MUST NOT advertise two different contents with the same Version and Source Router ID. Implementations SHOULD choose versions that survive a restart of the originator, for example from a persisted counter or from a clock. An originator MUST provide an administrative means to set the version to be used next for an object, to any non-zero value. An originator MAY also provide an administrative setting, a version offset, that adds a configured constant to every Version it assigns. It lets an originator that has lost its Version counter resume above the Versions already in the network. The constant should only be raised, because lowering it can make new Versions lower than those already issued.

6.2. YoBGP-RIB

Each speaker keeps one YoBGP-RIB. It holds at most one entry per object key, the current entry, independent of which peer supplied it and of the state of that peer's session. An entry records the Version, Source Router ID, Payload, the peer from which it was received (or local, for an originated object), and its application status (applied, pending, rejected, or, in no-apply mode, not applied). Tombstones are entries too. The YoBGP-RIB is volatile (Section 8); what has been applied is part of the node's configuration (the YoBGP-CIB).

6.3. Update Procedure

State S1 of an object supersedes state S2 if S1 has a higher Version, or the same Version and a lower Source Router ID. This order is the same on every speaker. The BGP decision process is not used for this AFI/SAFI. For a valid received object that the import filter admits (Section 11):

  1. If the YoBGP-RIB holds an entry for the object key: if the received state supersedes the stored one, the entry is replaced. If both states are the same (same Version and Source Router ID), the received object is a duplicate and is discarded; if its content differs from the stored content, the speaker SHOULD log a version conflict and keep the stored entry. If the stored state supersedes the received one, the received object is discarded.
  2. If the YoBGP-RIB holds no entry for the object key, an entry is created.
  3. When an entry is created or replaced, it is scheduled for propagation (Section 10) and for application (Section 12).

6.4. MP_UNREACH_NLRI

A speaker MAY send MP_UNREACH_NLRI for this AFI/SAFI, for example when its outbound policy changes. Receiving it has no effect on the YoBGP-RIB or on the active configuration. Deleting an object is expressed only by a tombstone (Section 7).

6.5. Administrative Override at the Receiver

A speaker MUST provide an administrative means to discard the YoBGP-RIB entry of an object, or to set the Version of that entry, so that an erroneously high version can be corrected (Section 15.6). Discarding the entry does not remove the applied object from the active configuration; it removes only the ordering state, so that the next received state of the object is accepted whatever its Version. A speaker MAY offer a configurable limit on how far a received Version may exceed the stored one. Appendix A.3 shows hypothetical commands.

7. Tombstones

An object is removed from the managed configuration only by a tombstone: a regular advertisement (MP_REACH_NLRI) with Fragment Count 0 (Section 5.4), the same object key, and a Version higher than that of the state being removed. A tombstone is ordered by Version like any other state, so a delayed older advertisement cannot bring a deleted object back while the tombstone is retained, and a late tombstone can never delete a newer object.

Tombstones exist only in the YoBGP-RIB, which is volatile, so a restart discards them. Two things can follow from the expiry or loss of a tombstone. A node that was disconnected for longer than the retention time misses the deletion and keeps the object until it receives a tombstone again or an operator removes it. In transitive mode, a node that still holds an older state of the object can advertise it to peers that no longer hold the tombstone, and so bring the object back. A non-transitive node does not advertise received entries, so this cannot spread from it. Transitive mode therefore needs increased attention (Section 10.1). The retention time should exceed the longest outage after which a node can be expected to rejoin. Peers that still retain the tombstone advertise it when the session is established (Section 10.3).

8. Persistence

The YoBGP-CIB is persistent: the objects that YoBGP has applied are stored with the node's persistent configuration and MUST survive a restart of the node. Loss of the BGP session, expiry of the Hold Timer and withdrawal by MP_UNREACH_NLRI MUST NOT remove objects from the YoBGP-CIB or from the active configuration. This is a deliberate difference from the treatment of ordinary routes, which are removed with the session.

The YoBGP-RIB is not persistent and SHOULD NOT be written to persistent storage. It is empty after a restart and is filled again by the peers (Section 10.3). Entries remain in the YoBGP-RIB when a session is lost, until the router restarts, so that the speaker can still advertise them to other peers. After a restart the ordering of states is rebuilt from the peers: the first state received for an object is accepted, and later states supersede it as usual (Section 6.3).

An implementation MAY provide, per peer, a purge-on-session-loss option, disabled by default. When enabled, on loss of the session the entries received from that peer are removed from the YoBGP-RIB, and the objects that those entries applied are removed from the node's configuration, as if by tombstone and subject to Section 12.1. Objects applied before a restart are not tracked by this option, because the YoBGP-RIB is empty after a restart.

9. Originating Objects

A speaker originates an object when it places the object into its YoBGP-RIB from its own configuration instead of receiving it from a peer. Origination is configured with an advertise statement, modeled on the way routes are originated. Appendix A.5 shows examples.

9.1. The advertise Statement

The operator names an object type and an object name pattern, using the pattern syntax of Section 11.1. Naming one object exactly is a pattern without a wildcard, and "*" covers all objects of the type. The speaker originates every object of that type whose name matches and that is found in its configuration, and follows later additions, changes and removals automatically.

9.2. Scope

A statement configured for the address family applies to all peers. A statement configured for one peer applies only to that peer. An originated object is advertised to the peers that the statements cover, subject to the mode and outbound policy of Section 10. A peer covered by overlapping statements receives the object once.

9.3. Common Rules

  • Origin. An originated entry carries the speaker's own BGP Identifier as Source Router ID, unless another value is configured, and is marked in the YoBGP-RIB as local. Originated entries are not subject to the import filter.
  • Payload. The speaker exports the object as YANG data of a module it implements. An object that cannot be expressed in this way MUST NOT be originated.
  • Names. An implementation MAY translate object names on export. How it does so is not specified.
  • Versions. The speaker assigns a Version as in Section 6.1 whenever the exported data of an object change, and MUST NOT assign a new Version when they do not. The data are compared by value, not by their serialization.
  • Deleted objects. When an originated object is deleted from the configuration, the speaker originates a tombstone for it with a higher Version (Section 7). Removing the advertise statement, or an object ceasing to match it, only stops the origination: nothing is deleted at the receivers, and the entry is removed from the YoBGP-RIB of the originator (MP_UNREACH_NLRI, Section 6.4, may be sent).
  • Dependencies. The speaker SHOULD originate referenced objects before the objects that reference them (Section 12.1).
  • Restart. Originated entries are rebuilt from the configuration. Versions should survive the restart (Section 6.1). A clock-based Version gives unchanged objects a new Version after a restart, which is harmless but makes receivers apply them again.

10. Transitivity and Propagation

10.1. Modes

Support for propagating received objects is OPTIONAL. A speaker that supports it MUST allow configuring it per peer. The default is non-transitive.

  • Non-transitive: the speaker MUST NOT advertise received entries to any peer. It MAY advertise objects it originates itself.
  • Transitive: the speaker advertises received entries following the normal BGP advertisement rules for the session type, including route reflection [RFC4456]. Loops end by themselves: an entry that returns is a duplicate under Section 6.3 and is not propagated again, so loop prevention by AS_PATH or CLUSTER_LIST is not required, although an implementation may still apply it.

Only entries admitted into the YoBGP-RIB are propagated; an object rejected by the import filter is not. An admitted entry that cannot be applied on this node (status pending or rejected) is still propagated, because its applicability here says nothing about other nodes.

A speaker MAY offer a no-apply mode, per AFI/SAFI, in which entries are admitted, stored and propagated but never handed to the configuration parser. It lets a route reflector reflect objects without applying them. In no-apply mode update-only is treated as permit.

Transitive mode needs increased attention. A faulty or compromised speaker in transitive mode reaches every speaker downstream of it. Objects persist (Section 8), so a faulty object is removed only by a tombstone, and the retention of tombstones is limited (Section 7). Transitive mode should be enabled only on a small number of well-controlled speakers (Section 14).

10.2. Outbound Policy

A speaker that supports transitive mode MUST support outbound filtering. The outbound policy defaults to permit. It matches on the same attributes as the import filter (Section 11.1) and decides only whether an entry is advertised to a peer.

10.3. Initial Advertisement and Refresh

When a session for this AFI/SAFI is established, the speaker advertises all entries of its YoBGP-RIB that its mode and outbound policy allow, retained tombstones included, each object as fragments (Section 5.4). The same procedure is followed when a ROUTE-REFRESH message [RFC2918] for this AFI/SAFI is received.

11. Inbound Object Filtering

Every peer has an import filter that decides which received objects are admitted into the YoBGP-RIB, and thereby applied to the active configuration. It works as inbound policy does for routes: it is evaluated on arrival, before the YoBGP-RIB is updated, and an object it does not admit is discarded. The filter uses the object key and the Fragment Count (0 marks a tombstone), so it does not require parsing the payload.

11.1. Actions and Matching

A filter is an ordered list of rules and can be defined once and applied to several peers. A rule matches on an object type and one or more object name patterns, and has one of three actions:

  • permit: the object is admitted. It may be instantiated if absent, modified if present, and deleted by a tombstone.
  • update-only: the object is admitted only if it already exists in the active configuration under the same name and type (whether created locally or by YoBGP), and only if the received state is not a tombstone. Existence is checked when the object arrives.
  • deny: the object is not admitted.

The object type is matched against the Object Type of the NLRI. Implementations MUST allow naming the object types of the models they support in their native terminology (for example prefix-list, community-list, as-path-list, route-policy, access-list), MUST at minimum cover prefix sets, community sets, AS-path sets, routing policies and access control lists (Appendix A.4), and MAY support a catch-all token "any". An object name pattern is matched against the whole Object Name as it is encoded in the NLRI (Section 4), case-sensitively, so a "/" inside a key value is matched as %2F. The character "*" matches any sequence of characters, including none, and the character "?" matches exactly one character. Both also match the separators "/" and ",", and a %-escape counts as three characters. No other wildcard is defined, and there is no escape for "*" or "?". For example, "CUST_A_*" matches every name that begins with CUST_A_, "*-V6" every name that ends in -V6, "*XYZ*" every name that contains XYZ, "SRV-???-IN" every name that consists of SRV-, exactly three characters and -IN, and "*" every name. Rules are evaluated in configured order and the first matching rule applies.

Because the first match wins, a filter can be structured. It can hold any number of rules for each object type, and a narrow rule (a deny for legacy names, an update-only for one critical policy) placed before a broader permit makes an exception to it. Different peers can use different filters, for example one controller that may create and delete objects and another that may only modify what already exists.

11.2. Effect of Each Action

Table 1: Effect of each action
Action Object absent in active configuration Object exists in active configuration Tombstone
permit instantiate overwrite delete
update-only rejected overwrite rejected
deny rejected rejected rejected

"Rejected" means the object is discarded on arrival: it is not stored, not propagated and not applied. The speaker SHOULD log a rejection by update-only with the neighbor address, the object key and the reason. "Instantiate", "overwrite" and "delete" describe an admitted object, which is stored, propagated and applied subject to Section 12.

11.3. Default Behavior

If no rule matches an object, the action is deny (implicit deny). A peer with no import filter therefore has no objects admitted.

11.4. Filter Changes and Refresh

A change of an import filter affects objects received afterwards. It does not remove entries from the YoBGP-RIB or objects from the active configuration: changing a filter never deletes anything that was admitted or applied.

Rejected objects are not retained. After a filter has been changed, or after an object has been created locally that an update-only rule is meant to maintain, the speaker requests the objects again with a ROUTE-REFRESH message [RFC2918]. Speakers MUST support Route Refresh for this AFI/SAFI. A speaker MAY instead keep unfiltered copies of received objects, comparable to soft reconfiguration inbound, and re-evaluate them locally; such copies are not part of the YoBGP-RIB and are neither propagated nor applied. They also allow an operator to inspect what a peer has sent before the import filter, which helps when looking for a problem.

12. Applying Objects

12.1. Dependencies

Objects can reference other objects (a policy references prefix sets and community sets). A sender SHOULD advertise an object only after the objects it references have been advertised, but delivery order is not guaranteed, so the receiver enforces consistency:

  • An admitted object MUST NOT be applied while an object it references does not exist in the active configuration. It stays in the YoBGP-RIB with status pending, a syslog warning SHOULD be generated, and the speaker MUST retry whenever the active configuration changes.
  • A tombstone MUST NOT be applied while another object in the active configuration still references the object to be deleted. It stays pending, a syslog error SHOULD be generated, and it is retried when the references change.

12.2. Configuration Payload Errors

If an admitted payload has unsupported attributes, unrecognized conditions, an unknown module, syntax errors, or an identity that does not match the object key (Section 5.3), the node:

  1. MUST NOT apply the object and MUST NOT change the active configuration;
  2. MUST NOT reset the BGP session;
  3. keeps the entry in the YoBGP-RIB with status rejected; the entry remains eligible for propagation (Section 10.1), because its validity for this node says nothing about other nodes;
  4. SHOULD generate a syslog error containing the sending neighbor, the object key and a description of the error.

12.3. The YoBGP-CIB

The YoBGP-CIB is the set of objects that YoBGP has applied to the node's configuration. It is a thin, logical layer between the YoBGP-RIB and the configuration, like the FIB between the RIB and the forwarding plane in ordinary routing. An entry of the YoBGP-RIB that the import filter admits and that is applied successfully (Sections 11 and 12) becomes an object of the YoBGP-CIB. An object deleted by a tombstone, or removed by the purge-on-session-loss option (Section 8), ceases to be one.

The YoBGP-CIB has no state of its own, and in particular no version or ordering information, which lives in the YoBGP-RIB. Its objects are ordinary configuration: they are stored with the node's persistent configuration (Section 8) and the operator can view and change them with the usual configuration tools. An implementation MAY mark such objects to tell them apart from locally created ones; this document does not require it.

13. Extensibility

YoBGP distributes any YANG data that can be named by an Object Type. A vendor or operator can distribute data from its own module simply by naming it in the Object Type; no registration is needed. A speaker that meets an unsupported module stores, and in transitive mode propagates, the object, and treats it as a payload error when it would otherwise apply it (Section 12.2).

New kinds of objects need no extension of the protocol, because they are YANG data. New NLRI types are registered in the registry of Section 16. Objects with far-reaching effects, such as a new BGP neighbor definition for a route reflector taken from the BGP YANG model [I-D.ietf-idr-bgp-model], need no special mechanism. They are distributed as any other object and, being subject to implicit deny, are applied only where an operator permits them explicitly.

14. Operational Considerations

One possible deployment uses a single server that originates the objects. The server peers with the route reflectors or route servers, where transitive mode is enabled with great care, and from there the objects reach all other routers, which keep the default non-transitive mode. In specific cases transitive mode can also be enabled on a speaker that serves customers, to distribute objects to the customer-edge devices of large customers.

15. Security Considerations

15.1. Reduced Attack Surface

YoBGP runs inside an existing BGP session. No automation engine holds credentials for the fleet, no management interface is opened, and the router accepts no inbound configuration connection beyond its BGP peering.

15.2. Inbound Admission Isolation

The import filter limits what each peer can do, independently of session type: permit, update-only and deny, evaluated with an implicit deny. An operator can restrict a peer to modifying pre-existing objects only, which prevents it from injecting new ones.

15.3. Limits of the Filter

The filter judges names and types, not content. A peer allowed to update a route policy can change what the policy does. Operators SHOULD grant permit or update-only only to peers they trust to that degree, narrowly by name pattern. Permitting object types that create BGP sessions or change routing policy deserves particular care. Access to the same YANG data through NETCONF is governed by [RFC8341]; YoBGP's filter is a separate mechanism and should be aligned with it in deployment.

15.4. Session and Transport Security

The BGP session is the only security boundary. Deployments SHOULD protect it with TCP-AO [RFC5925] and, for directly connected peers, GTSM [RFC5082]. This document does not depend on a particular transport; further improvements in the security of BGP sessions, which can be expected, benefit YoBGP directly.

15.5. Transit Trust

In transitive mode, intermediate speakers can alter or inject objects, as in any BGP propagation; there is no object-level signature. Transitive mode SHOULD NOT be used across administrative boundaries, and outbound filters SHOULD be used to limit what a speaker passes on. The non-transitive default prevents leaking configuration beyond the intended peers.

15.6. Version Manipulation

A peer permitted to supply an object can send a very high Version, after which lower versions from the legitimate originator are discarded. The administrative override (Section 6.5) restores control, and the optional limit on version jumps can prevent the situation. Equal-version conflicts are settled by Source Router ID, which is not authenticated; see Section 15.5.

15.7. Resource Exhaustion

A peer can fill the YoBGP-RIB with entries that the import filter admits. Because rejected objects are not stored, the implicit deny already limits this to what the operator has permitted. Implementations SHOULD nevertheless support a configurable limit on the number of entries per peer, comparable to a maximum-prefix limit; retained tombstones count toward it until they expire. On reaching the limit the speaker SHOULD log and stop accepting new entries from that peer; it MAY also reset the session. Reassembly buffers (Section 5.4) need a similar limit. A peer cannot make a speaker allocate memory for an object that the import filter rejects, because the filter is applied before a reassembly buffer is created. Memory is allocated as fragments arrive and not in advance from the Fragment Count, which is not trusted.

15.8. Parser Exposure

Payloads are parsed only for admitted objects, and transit speakers need not parse them at all. Parsers handling YANG JSON from the network SHOULD enforce limits on size and nesting depth and run with minimal privilege.

16. IANA Considerations

This document requests the following. Registration policies are named as in [RFC8126].

The AFI/SAFI pair is requested as a new pair, and not as a SAFI under AFI 1 or 2, because configuration objects are not addresses and tying the service to an IP address family would be arbitrary. The BGP-LS service [RFC9552] is the precedent: it carries data that is not address information under its own AFI and SAFIs.

17. References

17.1. Normative References

[RFC2119]
Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, , <https://www.rfc-editor.org/rfc/rfc2119>.
[RFC2918]
Chen, E., "Route Refresh Capability for BGP-4", RFC 2918, DOI 10.17487/RFC2918, , <https://www.rfc-editor.org/rfc/rfc2918>.
[RFC4271]
Rekhter, Y., Ed., Li, T., Ed., and S. Hares, Ed., "A Border Gateway Protocol 4 (BGP-4)", RFC 4271, DOI 10.17487/RFC4271, , <https://www.rfc-editor.org/rfc/rfc4271>.
[RFC4456]
Bates, T., Chen, E., and R. Chandra, "BGP Route Reflection: An Alternative to Full Mesh Internal BGP (IBGP)", RFC 4456, DOI 10.17487/RFC4456, , <https://www.rfc-editor.org/rfc/rfc4456>.
[RFC4760]
Bates, T., Chandra, R., Katz, D., and Y. Rekhter, "Multiprotocol Extensions for BGP-4", RFC 4760, DOI 10.17487/RFC4760, , <https://www.rfc-editor.org/rfc/rfc4760>.
[RFC7606]
Chen, E., Ed., Scudder, J., Ed., Mohapatra, P., and K. Patel, "Revised Error Handling for BGP UPDATE Messages", RFC 7606, DOI 10.17487/RFC7606, , <https://www.rfc-editor.org/rfc/rfc7606>.
[RFC7950]
Bjorklund, M., Ed., "The YANG 1.1 Data Modeling Language", RFC 7950, DOI 10.17487/RFC7950, , <https://www.rfc-editor.org/rfc/rfc7950>.
[RFC7951]
Lhotka, L., "JSON Encoding of Data Modeled with YANG", RFC 7951, DOI 10.17487/RFC7951, , <https://www.rfc-editor.org/rfc/rfc7951>.
[RFC8126]
Cotton, M., Leiba, B., and T. Narten, "Guidelines for Writing an IANA Considerations Section in RFCs", BCP 26, RFC 8126, DOI 10.17487/RFC8126, , <https://www.rfc-editor.org/rfc/rfc8126>.
[RFC8174]
Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, , <https://www.rfc-editor.org/rfc/rfc8174>.
[RFC8654]
Bush, R., Patel, K., and D. Ward, "Extended Message Support for BGP", RFC 8654, DOI 10.17487/RFC8654, , <https://www.rfc-editor.org/rfc/rfc8654>.

17.2. Informative References

[I-D.abaris-aicdh]
Abaris, D., "AI Content Disclosure Header", Work in Progress, Internet-Draft, draft-abaris-aicdh-01, , <https://datatracker.ietf.org/doc/html/draft-abaris-aicdh-01>.
[I-D.ietf-idr-bgp-model]
Jethanandani, M., Patel, K., Hares, S., and J. Haas, "YANG Model for Border Gateway Protocol (BGP-4)", Work in Progress, Internet-Draft, draft-ietf-idr-bgp-model-23, , <https://datatracker.ietf.org/doc/html/draft-ietf-idr-bgp-model-23>.
[I-D.ietf-idr-rpd]
Li, Z., Ou, L., Luo, Y., Mishra, G., Chen, H., and H. Wang, "BGP Extensions for Routing Policy Distribution (RPD)", Work in Progress, Internet-Draft, draft-ietf-idr-rpd-20, , <https://datatracker.ietf.org/doc/html/draft-ietf-idr-rpd-20>.
[I-D.ietf-idr-wide-bgp-communities]
Raszuk, R., Haas, J., Lange, A., Decraene, B., Amante, S., and P. Jakma, "BGP Community Container Attribute", Work in Progress, Internet-Draft, draft-ietf-idr-wide-bgp-communities-12, , <https://datatracker.ietf.org/doc/html/draft-ietf-idr-wide-bgp-communities-12>.
[RFC1982]
Elz, R. and R. Bush, "Serial Number Arithmetic", RFC 1982, DOI 10.17487/RFC1982, , <https://www.rfc-editor.org/rfc/rfc1982>.
[RFC5082]
Gill, V., Heasley, J., Meyer, D., Savola, P., Ed., and C. Pignataro, "The Generalized TTL Security Mechanism (GTSM)", RFC 5082, DOI 10.17487/RFC5082, , <https://www.rfc-editor.org/rfc/rfc5082>.
[RFC5291]
Chen, E. and Y. Rekhter, "Outbound Route Filtering Capability for BGP-4", RFC 5291, DOI 10.17487/RFC5291, , <https://www.rfc-editor.org/rfc/rfc5291>.
[RFC5925]
Touch, J., Mankin, A., and R. Bonica, "The TCP Authentication Option", RFC 5925, DOI 10.17487/RFC5925, , <https://www.rfc-editor.org/rfc/rfc5925>.
[RFC6241]
Enns, R., Ed., Bjorklund, M., Ed., Schoenwaelder, J., Ed., and A. Bierman, Ed., "Network Configuration Protocol (NETCONF)", RFC 6241, DOI 10.17487/RFC6241, , <https://www.rfc-editor.org/rfc/rfc6241>.
[RFC8341]
Bierman, A. and M. Bjorklund, "Network Configuration Access Control Model", STD 91, RFC 8341, DOI 10.17487/RFC8341, , <https://www.rfc-editor.org/rfc/rfc8341>.
[RFC8519]
Jethanandani, M., Agarwal, S., Huang, L., and D. Blair, "YANG Data Model for Network Access Control Lists (ACLs)", RFC 8519, DOI 10.17487/RFC8519, , <https://www.rfc-editor.org/rfc/rfc8519>.
[RFC8955]
Loibl, C., Hares, S., Raszuk, R., McPherson, D., and M. Bacher, "Dissemination of Flow Specification Rules", RFC 8955, DOI 10.17487/RFC8955, , <https://www.rfc-editor.org/rfc/rfc8955>.
[RFC9067]
Qu, Y., Tantsura, J., Lindem, A., and X. Liu, "A YANG Data Model for Routing Policy", RFC 9067, DOI 10.17487/RFC9067, , <https://www.rfc-editor.org/rfc/rfc9067>.
[RFC9552]
Talaulikar, K., Ed., "Distribution of Link-State and Traffic Engineering Information Using BGP", RFC 9552, DOI 10.17487/RFC9552, , <https://www.rfc-editor.org/rfc/rfc9552>.

Appendix A. Informative Material

A.1. Conceptual Cisco IOS XR Style Configuration

yobgp-filter CONTROLLER_A_IN
 ! First matching rule wins; narrow rules go before broad ones.
 10 deny prefix-list CUST_A_LEGACY_*
 20 permit prefix-list CUST_A_* CUST_B_*
 30 permit community-list CUST_*
 40 update-only as-path-list TRANSIT_ASNS_*
 50 permit route-policy CUST_*_IN CUST_*_OUT
 60 update-only route-policy GLOBAL_TRANSIT_POLICY
 70 permit access-list EDGE_PROTECT_*
 ! Anything else: implicit deny.
!
yobgp-filter CONTROLLER_B_IN
 ! This controller may only modify what already exists.
 10 update-only prefix-list *
 20 update-only community-list *
!
router bgp 65000
 neighbor 192.0.2.1
  address-family yobgp
   import-filter CONTROLLER_A_IN
  !
 !
 neighbor 192.0.2.2
  address-family yobgp
   import-filter CONTROLLER_B_IN
  !
 !
!

A.2. Conceptual Juniper Junos Style Configuration

policy-options {
    yobgp-filter CONTROLLER_A_IN {
        /* First matching term wins. */
        term legacy-block {
            from {
                object-type prefix-list;
                name CUST_A_LEGACY_*;
            }
            then deny;
        }
        term customer-sets {
            from {
                object-type prefix-list;
                name [ CUST_A_* CUST_B_* ];
            }
            then permit;
        }
        term transit-asns {
            from {
                object-type as-path;
                name TRANSIT_ASNS_*;
            }
            then update-only;
        }
        term main-policy {
            from {
                object-type policy-statement;
                name GLOBAL_TRANSIT_POLICY;
            }
            then update-only;
        }
        /* Anything else: implicit deny. */
    }
}
protocols {
    bgp {
        group YO-BGP-PEERS {
            neighbor 192.0.2.1 {
                family yobgp {
                    import-filter CONTROLLER_A_IN;
                }
            }
        }
    }
}

The two examples use different native terms for the same object types (route-policy and policy-statement, as-path-list and as-path). The syntax is illustrative only and is not part of the specification; Section 11 defines the semantics. Both show a filter as a structured, reusable policy: ordered rules over several object types, a narrow deny before a broad permit, update-only rules for critical objects, and different filters for different peers.

A.3. Conceptual Administrative Commands

The first block is in the style of IOS XR, the second in the style of Junos. Neither is part of the specification.

! Receiver: discard the YoBGP-RIB entry of one object. The
! applied object stays.
clear yobgp prefix-list CUST_A_PL1

! Receiver: set the version of the stored entry of an object.
yobgp set-version prefix-list CUST_A_PL1 1000

! Originator: version to be used for the next change.
yobgp set-next-version prefix-list CUST_A_PL1 1000

router bgp 65000
 address-family yobgp
  ! Originator: add a constant to every Version it assigns.
  adjust-version 1500
 !
 neighbor 192.0.2.1
  address-family yobgp
   ! Receiver: limit how far a received version may exceed the
   ! stored one.
   version-jump-limit 100000
  !
 !
!
user@router> clear yobgp prefix-list CUST_A_PL1

user@router> request yobgp set-version prefix-list CUST_A_PL1
             1000

user@router> request yobgp set-next-version prefix-list
             CUST_A_PL1 1000

[edit protocols bgp]
user@router# set family yobgp adjust-version 1500

[edit protocols bgp group YO-BGP-PEERS neighbor 192.0.2.1]
user@router# set family yobgp version-jump-limit 100000

A.4. Minimum Object Types

The minimum object types of Section 11.1 correspond to the following YANG nodes. This mapping is informative and the paths must be checked against the published modules: prefix sets, neighbor sets, tag sets and policy definitions of [RFC9067]; access control lists of [RFC8519]; community sets, AS-path sets and extended community sets of the BGP YANG model [I-D.ietf-idr-bgp-model].

A.5. Conceptual Origination Configuration

The first block is in the style of IOS XR, the second in the style of Junos. Neither is part of the specification. The advertise statement names an object type and a name pattern. It can be configured for all peers or for one peer.

router bgp 65000
 address-family yobgp
  ! For all peers:
  advertise route-policy GLOBAL_TRANSIT_POLICY
  advertise community-list *
  advertise as-path-list TRANSIT_ASNS_*
 !
 neighbor 192.0.2.1
  address-family yobgp
   ! Only for this peer:
   advertise prefix-list CUST_A_*
  !
 !
!
protocols {
    bgp {
        family yobgp {
            advertise {
                policy-statement GLOBAL_TRANSIT_POLICY;
                community *;
                as-path TRANSIT_ASNS_*;
            }
        }
        group YO-BGP-PEERS {
            neighbor 192.0.2.1 {
                family yobgp {
                    advertise {
                        prefix-list CUST_A_*;
                    }
                }
            }
        }
    }
}

Open Issues

This section is to be removed before publishing as an RFC.

  1. Attribute type code; whether a SAFI under an existing AFI is enough instead of a new AFI.
  2. Positioning relative to RPD [I-D.ietf-idr-rpd] (Section 1.4) and the current status of that draft, to be checked with the IDR chairs and the authors of that draft.
  3. Revision numbers and dates of the draft references (RPD, Wide Community, BGP YANG model) to be refreshed when this draft is submitted.

Use of AI Assistance

This document was written with the assistance of an AI system. Using the keys of [I-D.abaris-aicdh]: mode is ai-originated, because the text of this version was generated by the AI from the design decisions of the author and from an earlier draft supplied by the author, and then revised repeatedly at the author's direction; model is Claude, with several versions used and not recorded; provider is Anthropic; and reviewed-by is the author. The design is the author's. The AI also proposed details of the text and of the protocol, which the author reviewed, changed or accepted, and the author is responsible for the whole document.

Author's Address

Zbynek Pospichal
Quantcom, a.s.