<?xml version="1.0" encoding="UTF-8"?>
<rfc category="std" docName="draft-pospichal-idr-yang-over-bgp-00" ipr="trust200902" submissionType="IETF" consensus="true" version="3" xml:lang="en" tocInclude="true" tocDepth="3" symRefs="true" sortRefs="true">
  <front>
    <title abbrev="YoBGP">YANG over BGP</title>
    <author initials="Z." surname="Pospichal" fullname="Zbynek Pospichal">
      <organization>Quantcom, a.s.</organization>
      <address>
        <email>zbynek.pospichal@quantcom.cz</email>
      </address>
    </author>
    <date year="2026" month="November" day="1"/>
    <area>Routing</area>
    <workgroup>Inter-Domain Routing</workgroup>
    <keyword>BGP</keyword>
    <keyword>YANG</keyword>
    <keyword>configuration</keyword>
    <abstract>
    <t>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.</t>
    </abstract>
  </front>
  <middle>
  <section anchor="s1">
    <name>Introduction</name>
    <t>The main goal of YoBGP is effortless synchronization of selected configuration settings across a large number of BGP speakers.</t>
    <t>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.</t>
    <t>This document defines YANG over BGP (YoBGP), which extends BGP <xref target="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.</t>
    <t>YoBGP is a transport framework. It is decoupled from the schemas it distributes, such as <xref target="RFC9067"/>, <xref target="RFC8519"/> and the BGP YANG model <xref target="I-D.ietf-idr-bgp-model"/>, and is open to any other YANG module, including vendor-specific ones (Section <xref target="s13" format="counter"/>).</t>
    <section anchor="s1.1">
      <name>Design Goals</name>
      <ul>
        <li>Distribution like routes: objects reach routers through the existing BGP peerings and topology; no per-router login is required.</li>
        <li>Receiver autonomy: each router decides, per peer, object type and object name, what it accepts (Section <xref target="s11" format="counter"/>). The default is deny.</li>
        <li>Persistence: applied objects stay in the configuration when a session goes down; they are removed only by an explicit tombstone (Sections <xref target="s7" format="counter"/> and <xref target="s8" format="counter"/>).</li>
        <li>Deterministic convergence: all speakers settle on the same version of an object regardless of arrival order or propagation path (Section <xref target="s6" format="counter"/>).</li>
        <li>Openness: any YANG module can be distributed, and vendors can add their own data without a new specification (Section <xref target="s13" format="counter"/>).</li>
      </ul>
      </section>
    <section anchor="s1.2">
      <name>Benefits</name>
      <ul>
        <li>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.</li>
        <li>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.</li>
        <li>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.</li>
      </ul>
      </section>
    <section anchor="s1.3">
      <name>Non-Goals</name>
      <ul>
        <li>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 <xref target="s14" format="counter"/>).</li>
        <li>Atomic multi-object commit or rollback orchestration. Each object is versioned and applied individually; dependencies between objects are handled locally by the receiver (Section <xref target="s12" format="counter"/>).</li>
        <li>Origin authentication of objects beyond what the BGP session provides (Section <xref target="s15" format="counter"/>).</li>
      </ul>
      </section>
    <section anchor="s1.4">
      <name>Relationship to Other Mechanisms</name>
      <t>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.</t>
      <t>Routing Policy Distribution (RPD) <xref target="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:</t>
      <ul>
        <li>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.</li>
        <li>Semantics. RPD defines in the BGP specification what a policy can match and what it can do, and encodes it in BGP Wide Community <xref target="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.</li>
        <li>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.</li>
        <li>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.</li>
        <li>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 <xref target="s11" format="counter"/>).</li>
      </ul>
      <t>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.</t>
      <t>YoBGP is also related to Outbound Route Filtering <xref target="RFC5291"/>, which sends a filter to a peer to be applied to what that peer advertises, and to Flow Specification <xref target="RFC8955"/>, which distributes traffic filtering rules. Neither carries configuration objects that the receiver stores.</t>
      <t>Finally, YoBGP complements management protocols such as NETCONF <xref target="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.</t>
      </section>
    <section anchor="s1.5">
      <name>Requirements Language</name>
      <t>The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>", "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL NOT</bcp14>", "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>", "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>", "<bcp14>MAY</bcp14>", and "<bcp14>OPTIONAL</bcp14>" in this document are to be interpreted as described in BCP 14 <xref target="RFC2119"/> <xref target="RFC8174"/> when, and only when, they appear in all capitals, as shown here.</t>
      </section>
    </section>
  <section anchor="s2">
    <name>Terminology</name>
    <ul>
      <li>YoBGP object: an instance of a YANG schema node (typically a list entry), for example one prefix set or one policy definition.</li>
      <li>Object key: the tuple (Object Type, Object Name) carried in the NLRI. It identifies a YoBGP object.</li>
      <li>Version: a 64-bit unsigned integer ordering the successive states of one object (Section <xref target="s6" format="counter"/>).</li>
      <li>Originator: a speaker that places an object into its YoBGP-RIB from its own configuration instead of receiving it from a peer (Section <xref target="s9" format="counter"/>).</li>
      <li>Tombstone: an object with zero fragments (Fragment Count 0). It removes the object from the managed configuration (Section <xref target="s7" format="counter"/>).</li>
      <li>YoBGP-RIB: the volatile store with one entry per object key, holding the current admitted object (Section <xref target="s6.2" format="counter"/>). It corresponds to a RIB.</li>
      <li>YoBGP-CIB: the Configuration Information Base: the objects that YoBGP has applied, which are part of the node's own persistent configuration. It carries no state of its own. It corresponds to a FIB: the YoBGP-RIB holds what is current, the YoBGP-CIB holds what is installed; unlike a FIB, it survives restarts (Sections <xref target="s8" format="counter"/> and <xref target="s12.3" format="counter"/>).</li>
      <li>Active configuration: the configuration currently in effect on the node.</li>
      <li>Applying: handing an object's payload to the node's configuration parser for validation and injection into the active configuration.</li>
    </ul>
    </section>
  <section anchor="s3">
    <name>Overview of Operation</name>
    <t>A YoBGP UPDATE carries exactly one fragment of an object (Section <xref target="s5.4" format="counter"/>). 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):</t>
    <ol>
      <li>The NLRI and the YoBGP attribute are validated (Sections <xref target="s4" format="counter"/> and <xref target="s5" format="counter"/>).</li>
      <li>The import filter of the receiving peer decides whether the object is admitted (Section <xref target="s11" format="counter"/>). An object that is not admitted is discarded; it is neither stored nor propagated.</li>
      <li>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 <xref target="s6" format="counter"/>).</li>
      <li>A new or replaced entry is eligible for propagation to other peers (Section <xref target="s10" format="counter"/>), whether or not it can be applied on this node.</li>
      <li>The entry is checked for dependencies and handed to the configuration parser (Section <xref target="s12" format="counter"/>). On success the object is part of the node's configuration, that is, of the YoBGP-CIB (Section <xref target="s12.3" format="counter"/>). The outcome sets the status of the entry; it does not remove the entry from the YoBGP-RIB.</li>
    </ol>
    </section>
  <section anchor="s4">
    <name>YoBGP-NLRI</name>
    <t>The YoBGP-NLRI is carried in MP_REACH_NLRI and MP_UNREACH_NLRI <xref target="RFC4760"/> under AFI=TBA1 and SAFI=TBA2. The NLRI carries the object key and the number of one fragment of the object (Section <xref target="s5.4" format="counter"/>). Version and content are carried in the YoBGP attribute (Section <xref target="s5" format="counter"/>). As with Flow Specification <xref target="RFC8955"/>, the Length of Next Hop Network Address field in MP_REACH_NLRI <bcp14>MUST</bcp14> be 0 and receivers <bcp14>MUST</bcp14> ignore any next hop.</t>
    <t>An UPDATE for this AFI/SAFI <bcp14>MUST</bcp14> 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 <xref target="s5.2" format="counter"/>).</t>
    <figure>
      <artwork type="ascii-art"><![CDATA[+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|   NLRI Type   |          NLRI Length          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|        Fragment Number        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|       Object Type Length      |     Object Type (variable)    ~
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|       Object Name Length      |     Object Name (variable)    ~
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+]]></artwork>
    </figure>
    <ul>
      <li>NLRI Type (8 bits): 1 = YANG Object. A receiver <bcp14>MUST</bcp14> skip, using NLRI Length, any NLRI of an unknown type and <bcp14>SHOULD</bcp14> log it, as <xref target="RFC7606"/> requires for typed NLRI. This leaves room for future NLRI formats.</li>
      <li>NLRI Length (16 bits): number of octets that follow.</li>
      <li>Fragment Number (16 bits): the number k of the fragment, from 1 to the Fragment Count N, or 0 in a tombstone (Section <xref target="s5.4" format="counter"/>).</li>
      <li>Object Type Length (16 bits) and Object Type: the path of data node names, separated by "/", from the top-level data node to the schema node of the object, as a UTF-8 string. Each name is written as an RFC 7951 member name: it is qualified with its module name at the top-level node and wherever the namespace differs from that of its parent, and unqualified otherwise. The module that defines the object is the module of the last name on the path. Example: "ietf-routing-policy:routing-policy/defined-sets/prefix-sets/prefix-set".</li>
      <li>Object Name Length (16 bits) and Object Name: a UTF-8 string that identifies the instance of the object. It has one segment for each list on the path from the top-level data node to the object, including the object itself if it is a list entry, in path order and separated by "/". A segment holds the key values of that list entry in the order of the list's key statement, each in the canonical form of <xref target="RFC7950"/> and separated by ",". Within a key value, the characters "%", "/" and "," are written as %25, %2F and %2C. An entry named main of a list that is nested in the entry named 192.0.2.1 of another list has the Object Name 192.0.2.1/main. An object that is not a list entry and has no list on its path has an empty Object Name.</li>
    </ul>
    <t>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.</t>
    </section>
  <section anchor="s5">
    <name>YoBGP Attribute</name>
    <section anchor="s5.1">
      <name>Format</name>
      <t>The YoBGP attribute (type code TBA3) is an optional, non-transitive BGP path attribute (cf. <xref target="RFC9552"/>). It <bcp14>MUST</bcp14> be present in every MP_REACH_NLRI UPDATE for this AFI/SAFI.</t>
      <figure>
        <artwork type="ascii-art"><![CDATA[ 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)      ~
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+]]></artwork>
      </figure>
      <ul>
        <li>Version (64 bits): see Section <xref target="s6.1" format="counter"/>. The value 0 is invalid.</li>
        <li>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 <xref target="RFC4456"/>.</li>
        <li>Fragment Count (16 bits): the number N of fragments of the object, or 0 for a tombstone (Section <xref target="s5.4" format="counter"/>).</li>
        <li>Payload: one piece of the serialized object (Section <xref target="s5.4" format="counter"/>). It extends to the end of the attribute. A tombstone has an empty payload, and any octets after the Fragment Count are ignored.</li>
      </ul>
      </section>
    <section anchor="s5.2">
      <name>Error Handling for Malformed Objects</name>
      <t><xref target="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.</t>
      <t>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 <xref target="RFC7606"/>: it is discarded and <bcp14>SHOULD</bcp14> 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 <xref target="s6.4" format="counter"/>), such an advertisement changes nothing. The BGP session is not reset.</t>
      <t>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 <xref target="RFC7606"/>. The speaker <bcp14>SHOULD</bcp14> use the AFI/SAFI disable approach of <xref target="RFC4760"/> and <xref target="RFC7606"/>, that is, ignore all subsequent YoBGP routes received over the session. Session reset is the other approach that <xref target="RFC7606"/> allows, but it is not <bcp14>RECOMMENDED</bcp14> because it also drops every other address family. Objects already applied are not affected by either approach.</t>
      </section>
    <section anchor="s5.3">
      <name>Payload Structure</name>
      <t>The payload, which is the byte string that results from reassembly (Section <xref target="s5.4" format="counter"/>), is JSON text <xref target="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.</t>
      <t>The identity of the object in the payload, that is, the names on the path, including their modules, and the key values, <bcp14>MUST</bcp14> match the Object Type and the Object Name of the NLRI. A mismatch is a configuration payload error (Section <xref target="s12.2" format="counter"/>).</t>
      <t>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 <bcp14>MUST NOT</bcp14> change any other data.</t>
      </section>
    <section anchor="s5.4">
      <name>Transfer of Objects in Fragments</name>
      <t>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.</t>
      <t>The payload of the object is serialized as one byte string with the structure of Section <xref target="s5.3" format="counter"/> 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 <xref target="s4" format="counter"/>). 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.</t>
      <t>A tombstone is a single UPDATE with Fragment Number 0, Fragment Count 0 and an empty payload.</t>
      <t>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 <bcp14>MUST NOT</bcp14> exceed that size. Implementations <bcp14>SHOULD</bcp14> support Extended Message <xref target="RFC8654"/> and <bcp14>SHOULD</bcp14> advertise it, so that fewer fragments are needed. A speaker <bcp14>SHOULD</bcp14> send the fragments in numerical order.</t>
      <t>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.</t>
      <t>Steps 1 and 2 of Section <xref target="s3" format="counter"/> (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 <xref target="s6.3" format="counter"/>) is discarded without being buffered.</t>
      <t>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 <xref target="s3" format="counter"/> 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 <bcp14>SHOULD</bcp14> 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.</t>
      <t>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 <bcp14>MUST</bcp14> 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 <bcp14>SHOULD</bcp14> limit the memory for reassembly per peer (Section <xref target="s15.7" format="counter"/>).</t>
      </section>
    </section>
  <section anchor="s6">
    <name>Object Versioning and the YoBGP-RIB</name>
    <section anchor="s6.1">
      <name>Version</name>
      <t>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 <xref target="RFC1982"/> would not help an originator that restarts with lower Versions either, because it also orders Version 1 before Version 1500. An originator <bcp14>MUST</bcp14> assign strictly increasing versions to successive states of an object (including its tombstone) and <bcp14>MUST NOT</bcp14> advertise two different contents with the same Version and Source Router ID. Implementations <bcp14>SHOULD</bcp14> choose versions that survive a restart of the originator, for example from a persisted counter or from a clock. An originator <bcp14>MUST</bcp14> provide an administrative means to set the version to be used next for an object, to any non-zero value. An originator <bcp14>MAY</bcp14> 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.</t>
      </section>
    <section anchor="s6.2">
      <name>YoBGP-RIB</name>
      <t>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 <xref target="s8" format="counter"/>); what has been applied is part of the node's configuration (the YoBGP-CIB).</t>
      </section>
    <section anchor="s6.3">
      <name>Update Procedure</name>
      <t>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 <xref target="s11" format="counter"/>):</t>
      <ol>
        <li>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 <bcp14>SHOULD</bcp14> log a version conflict and keep the stored entry. If the stored state supersedes the received one, the received object is discarded.</li>
        <li>If the YoBGP-RIB holds no entry for the object key, an entry is created.</li>
        <li>When an entry is created or replaced, it is scheduled for propagation (Section <xref target="s10" format="counter"/>) and for application (Section <xref target="s12" format="counter"/>).</li>
      </ol>
      </section>
    <section anchor="s6.4">
      <name>MP_UNREACH_NLRI</name>
      <t>A speaker <bcp14>MAY</bcp14> 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 <xref target="s7" format="counter"/>).</t>
      </section>
    <section anchor="s6.5">
      <name>Administrative Override at the Receiver</name>
      <t>A speaker <bcp14>MUST</bcp14> 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 <xref target="s15.6" format="counter"/>). 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 <bcp14>MAY</bcp14> offer a configurable limit on how far a received Version may exceed the stored one. Appendix <xref target="appA.3" format="counter"/> shows hypothetical commands.</t>
      </section>
    </section>
  <section anchor="s7">
    <name>Tombstones</name>
    <t>An object is removed from the managed configuration only by a tombstone: a regular advertisement (MP_REACH_NLRI) with Fragment Count 0 (Section <xref target="s5.4" format="counter"/>), 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.</t>
    <ul>
      <li>A tombstone that the import filter admits is stored in the YoBGP-RIB and propagated like any other entry.</li>
      <li>If the import filter admits the tombstone (action permit), the node deletes the object from the active configuration, including an object that was created locally, subject to the dependency rule in Section <xref target="s12.1" format="counter"/>. Under update-only and deny the tombstone is not admitted (Section <xref target="s11.2" format="counter"/>).</li>
      <li>A later advertisement whose state supersedes the tombstone's re-creates the object.</li>
      <li>A tombstone is retained in the YoBGP-RIB for a configurable time, 3600 seconds by default, counted from the moment it became the current entry. When the time expires, the entry is discarded together with the ordering state it carries. A tombstone that is still pending (Section <xref target="s12.1" format="counter"/>) is not aged until it has been applied. Implementations <bcp14>MUST</bcp14> allow the time to be configured and <bcp14>SHOULD</bcp14> allow aging to be disabled.</li>
    </ul>
    <t>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 <xref target="s10.1" format="counter"/>). 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 <xref target="s10.3" format="counter"/>).</t>
    </section>
  <section anchor="s8">
    <name>Persistence</name>
    <t>The YoBGP-CIB is persistent: the objects that YoBGP has applied are stored with the node's persistent configuration and <bcp14>MUST</bcp14> survive a restart of the node. Loss of the BGP session, expiry of the Hold Timer and withdrawal by MP_UNREACH_NLRI <bcp14>MUST NOT</bcp14> 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.</t>
    <t>The YoBGP-RIB is not persistent and <bcp14>SHOULD NOT</bcp14> be written to persistent storage. It is empty after a restart and is filled again by the peers (Section <xref target="s10.3" format="counter"/>). 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 <xref target="s6.3" format="counter"/>).</t>
    <t>An implementation <bcp14>MAY</bcp14> 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 <xref target="s12.1" format="counter"/>. Objects applied before a restart are not tracked by this option, because the YoBGP-RIB is empty after a restart.</t>
    </section>
  <section anchor="s9">
    <name>Originating Objects</name>
    <t>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 <xref target="appA.5" format="counter"/> shows examples.</t>
    <section anchor="s9.1">
      <name>The advertise Statement</name>
      <t>The operator names an object type and an object name pattern, using the pattern syntax of Section <xref target="s11.1" format="counter"/>. 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.</t>
      </section>
    <section anchor="s9.2">
      <name>Scope</name>
      <t>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 <xref target="s10" format="counter"/>. A peer covered by overlapping statements receives the object once.</t>
      </section>
    <section anchor="s9.3">
      <name>Common Rules</name>
      <ul>
        <li>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.</li>
        <li>Payload. The speaker exports the object as YANG data of a module it implements. An object that cannot be expressed in this way <bcp14>MUST NOT</bcp14> be originated.</li>
        <li>Names. An implementation <bcp14>MAY</bcp14> translate object names on export. How it does so is not specified.</li>
        <li>Versions. The speaker assigns a Version as in Section <xref target="s6.1" format="counter"/> whenever the exported data of an object change, and <bcp14>MUST NOT</bcp14> assign a new Version when they do not. The data are compared by value, not by their serialization.</li>
        <li>Deleted objects. When an originated object is deleted from the configuration, the speaker originates a tombstone for it with a higher Version (Section <xref target="s7" format="counter"/>). 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 <xref target="s6.4" format="counter"/>, may be sent).</li>
        <li>Dependencies. The speaker <bcp14>SHOULD</bcp14> originate referenced objects before the objects that reference them (Section <xref target="s12.1" format="counter"/>).</li>
        <li>Restart. Originated entries are rebuilt from the configuration. Versions should survive the restart (Section <xref target="s6.1" format="counter"/>). A clock-based Version gives unchanged objects a new Version after a restart, which is harmless but makes receivers apply them again.</li>
      </ul>
      </section>
    </section>
  <section anchor="s10">
    <name>Transitivity and Propagation</name>
    <section anchor="s10.1">
      <name>Modes</name>
      <t>Support for propagating received objects is <bcp14>OPTIONAL</bcp14>. A speaker that supports it <bcp14>MUST</bcp14> allow configuring it per peer. The default is non-transitive.</t>
      <ul>
        <li>Non-transitive: the speaker <bcp14>MUST NOT</bcp14> advertise received entries to any peer. It <bcp14>MAY</bcp14> advertise objects it originates itself.</li>
        <li>Transitive: the speaker advertises received entries following the normal BGP advertisement rules for the session type, including route reflection <xref target="RFC4456"/>. Loops end by themselves: an entry that returns is a duplicate under Section <xref target="s6.3" format="counter"/> and is not propagated again, so loop prevention by AS_PATH or CLUSTER_LIST is not required, although an implementation may still apply it.</li>
      </ul>
      <t>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.</t>
      <t>A speaker <bcp14>MAY</bcp14> 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.</t>
      <t>Transitive mode needs increased attention. A faulty or compromised speaker in transitive mode reaches every speaker downstream of it. Objects persist (Section <xref target="s8" format="counter"/>), so a faulty object is removed only by a tombstone, and the retention of tombstones is limited (Section <xref target="s7" format="counter"/>). Transitive mode should be enabled only on a small number of well-controlled speakers (Section <xref target="s14" format="counter"/>).</t>
      </section>
    <section anchor="s10.2">
      <name>Outbound Policy</name>
      <t>A speaker that supports transitive mode <bcp14>MUST</bcp14> support outbound filtering. The outbound policy defaults to permit. It matches on the same attributes as the import filter (Section <xref target="s11.1" format="counter"/>) and decides only whether an entry is advertised to a peer.</t>
      </section>
    <section anchor="s10.3">
      <name>Initial Advertisement and Refresh</name>
      <t>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 <xref target="s5.4" format="counter"/>). The same procedure is followed when a ROUTE-REFRESH message <xref target="RFC2918"/> for this AFI/SAFI is received.</t>
      </section>
    </section>
  <section anchor="s11">
    <name>Inbound Object Filtering</name>
    <t>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.</t>
    <section anchor="s11.1">
      <name>Actions and Matching</name>
      <t>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:</t>
      <ul>
        <li>permit: the object is admitted. It may be instantiated if absent, modified if present, and deleted by a tombstone.</li>
        <li>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.</li>
        <li>deny: the object is not admitted.</li>
      </ul>
      <t>The object type is matched against the Object Type of the NLRI. Implementations <bcp14>MUST</bcp14> 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), <bcp14>MUST</bcp14> at minimum cover prefix sets, community sets, AS-path sets, routing policies and access control lists (Appendix <xref target="appA.4" format="counter"/>), and <bcp14>MAY</bcp14> 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 <xref target="s4" format="counter"/>), 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.</t>
      <t>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.</t>
      </section>
    <section anchor="s11.2">
      <name>Effect of Each Action</name>
      <table>
        <name>Effect of each action</name>
        <thead><tr><th>Action</th><th>Object absent in active configuration</th><th>Object exists in active configuration</th><th>Tombstone</th></tr></thead>
        <tbody>
          <tr><td>permit</td><td>instantiate</td><td>overwrite</td><td>delete</td></tr>
          <tr><td>update-only</td><td>rejected</td><td>overwrite</td><td>rejected</td></tr>
          <tr><td>deny</td><td>rejected</td><td>rejected</td><td>rejected</td></tr>
        </tbody>
      </table>
      <t>"Rejected" means the object is discarded on arrival: it is not stored, not propagated and not applied. The speaker <bcp14>SHOULD</bcp14> 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 <xref target="s12" format="counter"/>.</t>
      </section>
    <section anchor="s11.3">
      <name>Default Behavior</name>
      <t>If no rule matches an object, the action is deny (implicit deny). A peer with no import filter therefore has no objects admitted.</t>
      </section>
    <section anchor="s11.4">
      <name>Filter Changes and Refresh</name>
      <t>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.</t>
      <t>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 <xref target="RFC2918"/>. Speakers <bcp14>MUST</bcp14> support Route Refresh for this AFI/SAFI. A speaker <bcp14>MAY</bcp14> 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.</t>
      </section>
    </section>
  <section anchor="s12">
    <name>Applying Objects</name>
    <section anchor="s12.1">
      <name>Dependencies</name>
      <t>Objects can reference other objects (a policy references prefix sets and community sets). A sender <bcp14>SHOULD</bcp14> advertise an object only after the objects it references have been advertised, but delivery order is not guaranteed, so the receiver enforces consistency:</t>
      <ul>
        <li>An admitted object <bcp14>MUST NOT</bcp14> 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 <bcp14>SHOULD</bcp14> be generated, and the speaker <bcp14>MUST</bcp14> retry whenever the active configuration changes.</li>
        <li>A tombstone <bcp14>MUST NOT</bcp14> be applied while another object in the active configuration still references the object to be deleted. It stays pending, a syslog error <bcp14>SHOULD</bcp14> be generated, and it is retried when the references change.</li>
      </ul>
      </section>
    <section anchor="s12.2">
      <name>Configuration Payload Errors</name>
      <t>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 <xref target="s5.3" format="counter"/>), the node:</t>
      <ol>
        <li><bcp14>MUST NOT</bcp14> apply the object and <bcp14>MUST NOT</bcp14> change the active configuration;</li>
        <li><bcp14>MUST NOT</bcp14> reset the BGP session;</li>
        <li>keeps the entry in the YoBGP-RIB with status rejected; the entry remains eligible for propagation (Section <xref target="s10.1" format="counter"/>), because its validity for this node says nothing about other nodes;</li>
        <li><bcp14>SHOULD</bcp14> generate a syslog error containing the sending neighbor, the object key and a description of the error.</li>
      </ol>
      </section>
    <section anchor="s12.3">
      <name>The YoBGP-CIB</name>
      <t>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 <xref target="s11" format="counter"/> and <xref target="s12" format="counter"/>) becomes an object of the YoBGP-CIB. An object deleted by a tombstone, or removed by the purge-on-session-loss option (Section <xref target="s8" format="counter"/>), ceases to be one.</t>
      <t>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 <xref target="s8" format="counter"/>) and the operator can view and change them with the usual configuration tools. An implementation <bcp14>MAY</bcp14> mark such objects to tell them apart from locally created ones; this document does not require it.</t>
      </section>
    </section>
  <section anchor="s13">
    <name>Extensibility</name>
    <t>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 <xref target="s12.2" format="counter"/>).</t>
    <t>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 <xref target="s16" format="counter"/>. Objects with far-reaching effects, such as a new BGP neighbor definition for a route reflector taken from the BGP YANG model <xref target="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.</t>
    </section>
  <section anchor="s14">
    <name>Operational Considerations</name>
    <ul>
      <li>There is no feedback. Implementations <bcp14>SHOULD</bcp14> expose the YoBGP-RIB, with version, source peer and application status for each entry, so operators can compare nodes and find drift.</li>
      <li>Where more than one originator can advertise the same object, operators should coordinate object names, or accept that the highest version wins and that equal versions are settled by Source Router ID.</li>
      <li>Applied objects persist after a controller is decommissioned. Remove them with tombstones.</li>
      <li>An originator that restarts without its Version counter issues Versions that are lower than those the receivers already hold, and the receivers ignore them without any signal. To prevent this, derive Versions from a clock or keep the counter in persistent storage (Section <xref target="s6.1" format="counter"/>). If it happens, raise the version offset or set the Version to be used next on the originator above the highest Version in the network, or discard the entries at the receivers (Section <xref target="s6.1" format="counter"/> and Appendix <xref target="appA.3" format="counter"/>).</li>
      <li>Rejected objects are not retained. After changing a filter, or after creating locally an object that an update-only rule should maintain, request a refresh from the peer (Section <xref target="s11.4" format="counter"/>).</li>
      <li>Tombstones age out (Section <xref target="s7" format="counter"/>). A node that was disconnected for longer than the retention time and still holds an object that has since been deleted can bring it back when it rejoins; such nodes should be checked after long outages.</li>
      <li>Transitive mode needs increased attention (Sections <xref target="s7" format="counter"/> and <xref target="s10.1" format="counter"/>). Enable it only on a small number of well-controlled speakers and keep the default elsewhere.</li>
      <li>Because transitivity is off by default and filters deny by default, a rollout can start with one originator, one peer and a narrow permit rule.</li>
    </ul>
    <t>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.</t>
    </section>
  <section anchor="s15">
    <name>Security Considerations</name>
    <section anchor="s15.1">
      <name>Reduced Attack Surface</name>
      <t>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.</t>
      </section>
    <section anchor="s15.2">
      <name>Inbound Admission Isolation</name>
      <t>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.</t>
      </section>
    <section anchor="s15.3">
      <name>Limits of the Filter</name>
      <t>The filter judges names and types, not content. A peer allowed to update a route policy can change what the policy does. Operators <bcp14>SHOULD</bcp14> 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 <xref target="RFC8341"/>; YoBGP's filter is a separate mechanism and should be aligned with it in deployment.</t>
      </section>
    <section anchor="s15.4">
      <name>Session and Transport Security</name>
      <t>The BGP session is the only security boundary. Deployments <bcp14>SHOULD</bcp14> protect it with TCP-AO <xref target="RFC5925"/> and, for directly connected peers, GTSM <xref target="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.</t>
      </section>
    <section anchor="s15.5">
      <name>Transit Trust</name>
      <t>In transitive mode, intermediate speakers can alter or inject objects, as in any BGP propagation; there is no object-level signature. Transitive mode <bcp14>SHOULD NOT</bcp14> be used across administrative boundaries, and outbound filters <bcp14>SHOULD</bcp14> be used to limit what a speaker passes on. The non-transitive default prevents leaking configuration beyond the intended peers.</t>
      </section>
    <section anchor="s15.6">
      <name>Version Manipulation</name>
      <t>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 <xref target="s6.5" format="counter"/>) 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 <xref target="s15.5" format="counter"/>.</t>
      </section>
    <section anchor="s15.7">
      <name>Resource Exhaustion</name>
      <t>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 <bcp14>SHOULD</bcp14> 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 <bcp14>SHOULD</bcp14> log and stop accepting new entries from that peer; it <bcp14>MAY</bcp14> also reset the session. Reassembly buffers (Section <xref target="s5.4" format="counter"/>) 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.</t>
      </section>
    <section anchor="s15.8">
      <name>Parser Exposure</name>
      <t>Payloads are parsed only for admitted objects, and transit speakers need not parse them at all. Parsers handling YANG JSON from the network <bcp14>SHOULD</bcp14> enforce limits on size and nesting depth and run with minimal privilege.</t>
      </section>
    </section>
  <section anchor="s16">
    <name>IANA Considerations</name>
    <t>This document requests the following. Registration policies are named as in <xref target="RFC8126"/>.</t>
    <ul>
      <li>Address Family Numbers registry: AFI = TBA1 (YoBGP Configuration).</li>
      <li>SAFI Values registry: SAFI = TBA2 (YoBGP Service).</li>
      <li>BGP Path Attributes registry: type code TBA3, YoBGP Attribute (optional, non-transitive).</li>
      <li>New registry "YoBGP NLRI Types": 0 Reserved; 1 YANG Object; 2-239 IETF Review; 240-254 Experimental Use; 255 Reserved.</li>
    </ul>
    <t>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 <xref target="RFC9552"/> is the precedent: it carries data that is not address information under its own AFI and SAFIs.</t>
    </section>
  </middle>
  <back>
    <references>
      <name>References</name>
      <references>
        <name>Normative References</name>
      <reference anchor="RFC2119">
        <front>
          <title>Key words for use in RFCs to Indicate Requirement Levels</title>
          <author initials="S." surname="Bradner" fullname="S. Bradner"/>
          <date month="March" year="1997"/>
        </front>
        <seriesInfo name="BCP" value="14"/>
        <seriesInfo name="RFC" value="2119"/>
        <seriesInfo name="DOI" value="10.17487/RFC2119"/>
      </reference>
      <reference anchor="RFC8174">
        <front>
          <title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
          <author initials="B." surname="Leiba" fullname="B. Leiba"/>
          <date month="May" year="2017"/>
        </front>
        <seriesInfo name="BCP" value="14"/>
        <seriesInfo name="RFC" value="8174"/>
        <seriesInfo name="DOI" value="10.17487/RFC8174"/>
      </reference>
      <reference anchor="RFC2918">
        <front>
          <title>Route Refresh Capability for BGP-4</title>
          <author initials="E." surname="Chen" fullname="E. Chen"/>
          <date month="September" year="2000"/>
        </front>
        <seriesInfo name="RFC" value="2918"/>
        <seriesInfo name="DOI" value="10.17487/RFC2918"/>
      </reference>
      <reference anchor="RFC4271">
        <front>
          <title>A Border Gateway Protocol 4 (BGP-4)</title>
          <author initials="Y." surname="Rekhter" fullname="Y. Rekhter" role="editor"/>
          <author initials="T." surname="Li" fullname="T. Li" role="editor"/>
          <author initials="S." surname="Hares" fullname="S. Hares" role="editor"/>
          <date month="January" year="2006"/>
        </front>
        <seriesInfo name="RFC" value="4271"/>
        <seriesInfo name="DOI" value="10.17487/RFC4271"/>
      </reference>
      <reference anchor="RFC4456">
        <front>
          <title>BGP Route Reflection: An Alternative to Full Mesh Internal BGP (IBGP)</title>
          <author initials="T." surname="Bates" fullname="T. Bates"/>
          <author initials="E." surname="Chen" fullname="E. Chen"/>
          <author initials="R." surname="Chandra" fullname="R. Chandra"/>
          <date month="April" year="2006"/>
        </front>
        <seriesInfo name="RFC" value="4456"/>
        <seriesInfo name="DOI" value="10.17487/RFC4456"/>
      </reference>
      <reference anchor="RFC4760">
        <front>
          <title>Multiprotocol Extensions for BGP-4</title>
          <author initials="T." surname="Bates" fullname="T. Bates"/>
          <author initials="R." surname="Chandra" fullname="R. Chandra"/>
          <author initials="D." surname="Katz" fullname="D. Katz"/>
          <author initials="Y." surname="Rekhter" fullname="Y. Rekhter"/>
          <date month="January" year="2007"/>
        </front>
        <seriesInfo name="RFC" value="4760"/>
        <seriesInfo name="DOI" value="10.17487/RFC4760"/>
      </reference>
      <reference anchor="RFC7606">
        <front>
          <title>Revised Error Handling for BGP UPDATE Messages</title>
          <author initials="E." surname="Chen" fullname="E. Chen" role="editor"/>
          <author initials="J." surname="Scudder" fullname="J. Scudder" role="editor"/>
          <author initials="P." surname="Mohapatra" fullname="P. Mohapatra"/>
          <author initials="K." surname="Patel" fullname="K. Patel"/>
          <date month="August" year="2015"/>
        </front>
        <seriesInfo name="RFC" value="7606"/>
        <seriesInfo name="DOI" value="10.17487/RFC7606"/>
      </reference>
      <reference anchor="RFC7950">
        <front>
          <title>The YANG 1.1 Data Modeling Language</title>
          <author initials="M." surname="Bjorklund" fullname="M. Bjorklund" role="editor"/>
          <date month="August" year="2016"/>
        </front>
        <seriesInfo name="RFC" value="7950"/>
        <seriesInfo name="DOI" value="10.17487/RFC7950"/>
      </reference>
      <reference anchor="RFC7951">
        <front>
          <title>JSON Encoding of Data Modeled with YANG</title>
          <author initials="L." surname="Lhotka" fullname="L. Lhotka"/>
          <date month="August" year="2016"/>
        </front>
        <seriesInfo name="RFC" value="7951"/>
        <seriesInfo name="DOI" value="10.17487/RFC7951"/>
      </reference>
      <reference anchor="RFC8126">
        <front>
          <title>Guidelines for Writing an IANA Considerations Section in RFCs</title>
          <author initials="M." surname="Cotton" fullname="M. Cotton"/>
          <author initials="B." surname="Leiba" fullname="B. Leiba"/>
          <author initials="T." surname="Narten" fullname="T. Narten"/>
          <date month="June" year="2017"/>
        </front>
        <seriesInfo name="BCP" value="26"/>
        <seriesInfo name="RFC" value="8126"/>
        <seriesInfo name="DOI" value="10.17487/RFC8126"/>
      </reference>
      <reference anchor="RFC8654">
        <front>
          <title>Extended Message Support for BGP</title>
          <author initials="R." surname="Bush" fullname="R. Bush"/>
          <author initials="K." surname="Patel" fullname="K. Patel"/>
          <author initials="D." surname="Ward" fullname="D. Ward"/>
          <date month="October" year="2019"/>
        </front>
        <seriesInfo name="RFC" value="8654"/>
        <seriesInfo name="DOI" value="10.17487/RFC8654"/>
      </reference>
      </references>
      <references>
        <name>Informative References</name>
      <reference anchor="I-D.abaris-aicdh">
        <front>
          <title>AI Content Disclosure Header</title>
          <author initials="D." surname="Abaris" fullname="D. Abaris"/>
          <date month="January" day="30" year="2026"/>
        </front>
        <seriesInfo name="Internet-Draft" value="draft-abaris-aicdh-01"/>
      </reference>
      <reference anchor="RFC1982">
        <front>
          <title>Serial Number Arithmetic</title>
          <author initials="R." surname="Elz" fullname="R. Elz"/>
          <author initials="R." surname="Bush" fullname="R. Bush"/>
          <date month="August" year="1996"/>
        </front>
        <seriesInfo name="RFC" value="1982"/>
        <seriesInfo name="DOI" value="10.17487/RFC1982"/>
      </reference>
      <reference anchor="RFC5082">
        <front>
          <title>The Generalized TTL Security Mechanism (GTSM)</title>
          <author initials="V." surname="Gill" fullname="V. Gill"/>
          <author initials="J." surname="Heasley" fullname="J. Heasley"/>
          <author initials="D." surname="Meyer" fullname="D. Meyer"/>
          <author initials="P." surname="Savola" fullname="P. Savola" role="editor"/>
          <author initials="C." surname="Pignataro" fullname="C. Pignataro"/>
          <date month="October" year="2007"/>
        </front>
        <seriesInfo name="RFC" value="5082"/>
        <seriesInfo name="DOI" value="10.17487/RFC5082"/>
      </reference>
      <reference anchor="RFC5291">
        <front>
          <title>Outbound Route Filtering Capability for BGP-4</title>
          <author initials="E." surname="Chen" fullname="E. Chen"/>
          <author initials="Y." surname="Rekhter" fullname="Y. Rekhter"/>
          <date month="August" year="2008"/>
        </front>
        <seriesInfo name="RFC" value="5291"/>
        <seriesInfo name="DOI" value="10.17487/RFC5291"/>
      </reference>
      <reference anchor="RFC5925">
        <front>
          <title>The TCP Authentication Option</title>
          <author initials="J." surname="Touch" fullname="J. Touch"/>
          <author initials="A." surname="Mankin" fullname="A. Mankin"/>
          <author initials="R." surname="Bonica" fullname="R. Bonica"/>
          <date month="June" year="2010"/>
        </front>
        <seriesInfo name="RFC" value="5925"/>
        <seriesInfo name="DOI" value="10.17487/RFC5925"/>
      </reference>
      <reference anchor="RFC6241">
        <front>
          <title>Network Configuration Protocol (NETCONF)</title>
          <author initials="R." surname="Enns" fullname="R. Enns" role="editor"/>
          <author initials="M." surname="Bjorklund" fullname="M. Bjorklund" role="editor"/>
          <author initials="J." surname="Schoenwaelder" fullname="J. Schoenwaelder" role="editor"/>
          <author initials="A." surname="Bierman" fullname="A. Bierman" role="editor"/>
          <date month="June" year="2011"/>
        </front>
        <seriesInfo name="RFC" value="6241"/>
        <seriesInfo name="DOI" value="10.17487/RFC6241"/>
      </reference>
      <reference anchor="RFC8341">
        <front>
          <title>Network Configuration Access Control Model</title>
          <author initials="A." surname="Bierman" fullname="A. Bierman"/>
          <author initials="M." surname="Bjorklund" fullname="M. Bjorklund"/>
          <date month="March" year="2018"/>
        </front>
        <seriesInfo name="STD" value="91"/>
        <seriesInfo name="RFC" value="8341"/>
        <seriesInfo name="DOI" value="10.17487/RFC8341"/>
      </reference>
      <reference anchor="RFC8519">
        <front>
          <title>YANG Data Model for Network Access Control Lists (ACLs)</title>
          <author initials="M." surname="Jethanandani" fullname="M. Jethanandani"/>
          <author initials="S." surname="Agarwal" fullname="S. Agarwal"/>
          <author initials="L." surname="Huang" fullname="L. Huang"/>
          <author initials="D." surname="Blair" fullname="D. Blair"/>
          <date month="March" year="2019"/>
        </front>
        <seriesInfo name="RFC" value="8519"/>
        <seriesInfo name="DOI" value="10.17487/RFC8519"/>
      </reference>
      <reference anchor="RFC8955">
        <front>
          <title>Dissemination of Flow Specification Rules</title>
          <author initials="C." surname="Loibl" fullname="C. Loibl"/>
          <author initials="S." surname="Hares" fullname="S. Hares"/>
          <author initials="R." surname="Raszuk" fullname="R. Raszuk"/>
          <author initials="D." surname="McPherson" fullname="D. McPherson"/>
          <author initials="M." surname="Bacher" fullname="M. Bacher"/>
          <date month="December" year="2020"/>
        </front>
        <seriesInfo name="RFC" value="8955"/>
        <seriesInfo name="DOI" value="10.17487/RFC8955"/>
      </reference>
      <reference anchor="RFC9067">
        <front>
          <title>A YANG Data Model for Routing Policy</title>
          <author initials="Y." surname="Qu" fullname="Y. Qu"/>
          <author initials="J." surname="Tantsura" fullname="J. Tantsura"/>
          <author initials="A." surname="Lindem" fullname="A. Lindem"/>
          <author initials="X." surname="Liu" fullname="X. Liu"/>
          <date month="October" year="2021"/>
        </front>
        <seriesInfo name="RFC" value="9067"/>
        <seriesInfo name="DOI" value="10.17487/RFC9067"/>
      </reference>
      <reference anchor="RFC9552">
        <front>
          <title>Distribution of Link-State and Traffic Engineering Information Using BGP</title>
          <author initials="K." surname="Talaulikar" fullname="K. Talaulikar" role="editor"/>
          <date month="December" year="2023"/>
        </front>
        <seriesInfo name="RFC" value="9552"/>
        <seriesInfo name="DOI" value="10.17487/RFC9552"/>
      </reference>
      <reference anchor="I-D.ietf-idr-bgp-model">
        <front>
          <title>YANG Model for Border Gateway Protocol (BGP-4)</title>
          <author initials="M." surname="Jethanandani" fullname="M. Jethanandani"/>
          <author initials="K." surname="Patel" fullname="K. Patel"/>
          <author initials="S." surname="Hares" fullname="S. Hares"/>
          <author initials="J." surname="Haas" fullname="J. Haas"/>
          <date month="October" year="2026"/>
        </front>
        <seriesInfo name="Internet-Draft" value="draft-ietf-idr-bgp-model-23"/>
      </reference>
      <reference anchor="I-D.ietf-idr-rpd">
        <front>
          <title>BGP Extensions for Routing Policy Distribution (RPD)</title>
          <author initials="Z." surname="Li" fullname="Z. Li"/>
          <author initials="L." surname="Ou" fullname="L. Ou"/>
          <author initials="Y." surname="Luo" fullname="Y. Luo"/>
          <author initials="G." surname="Mishra" fullname="G. Mishra"/>
          <author initials="H." surname="Chen" fullname="H. Chen"/>
          <author initials="H." surname="Wang" fullname="H. Wang"/>
          <date month="March" day="2" year="2026"/>
        </front>
        <seriesInfo name="Internet-Draft" value="draft-ietf-idr-rpd-20"/>
      </reference>
      <reference anchor="I-D.ietf-idr-wide-bgp-communities">
        <front>
          <title>BGP Community Container Attribute</title>
          <author initials="R." surname="Raszuk" fullname="R. Raszuk"/>
          <author initials="J." surname="Haas" fullname="J. Haas"/>
          <author initials="A." surname="Lange" fullname="A. Lange"/>
          <author initials="B." surname="Decraene" fullname="B. Decraene"/>
          <author initials="S." surname="Amante" fullname="S. Amante"/>
          <author initials="P." surname="Jakma" fullname="P. Jakma"/>
          <date month="March" day="17" year="2025"/>
        </front>
        <seriesInfo name="Internet-Draft" value="draft-ietf-idr-wide-bgp-communities-12"/>
      </reference>
      </references>
    </references>
  <section anchor="appA">
    <name>Informative Material</name>
    <section anchor="appA.1">
      <name>Conceptual Cisco IOS XR Style Configuration</name>
      <sourcecode><![CDATA[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
  !
 !
!]]></sourcecode>
      </section>
    <section anchor="appA.2">
      <name>Conceptual Juniper Junos Style Configuration</name>
      <sourcecode><![CDATA[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;
                }
            }
        }
    }
}]]></sourcecode>
      <t>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 <xref target="s11" format="counter"/> 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.</t>
      </section>
    <section anchor="appA.3">
      <name>Conceptual Administrative Commands</name>
      <t>The first block is in the style of IOS XR, the second in the style of Junos. Neither is part of the specification.</t>
      <sourcecode><![CDATA[! 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
  !
 !
!]]></sourcecode>
      <sourcecode><![CDATA[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]]></sourcecode>
      </section>
    <section anchor="appA.4">
      <name>Minimum Object Types</name>
      <t>The minimum object types of Section <xref target="s11.1" format="counter"/> 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 <xref target="RFC9067"/>; access control lists of <xref target="RFC8519"/>; community sets, AS-path sets and extended community sets of the BGP YANG model <xref target="I-D.ietf-idr-bgp-model"/>.</t>
      </section>
    <section anchor="appA.5">
      <name>Conceptual Origination Configuration</name>
      <t>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.</t>
      <sourcecode><![CDATA[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_*
  !
 !
!]]></sourcecode>
      <sourcecode><![CDATA[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_*;
                    }
                }
            }
        }
    }
}]]></sourcecode>
      </section>
    </section>
  <section anchor="sec-open-issues" numbered="false">
    <name>Open Issues</name>
    <t>This section is to be removed before publishing as an RFC.</t>
    <ol>
      <li>Attribute type code; whether a SAFI under an existing AFI is enough instead of a new AFI.</li>
      <li>Positioning relative to RPD <xref target="I-D.ietf-idr-rpd"/> (Section <xref target="s1.4" format="counter"/>) and the current status of that draft, to be checked with the IDR chairs and the authors of that draft.</li>
      <li>Revision numbers and dates of the draft references (RPD, Wide Community, BGP YANG model) to be refreshed when this draft is submitted.</li>
    </ol>
    </section>
  <section anchor="sec-use-of-ai-assistance" numbered="false">
    <name>Use of AI Assistance</name>
    <t>This document was written with the assistance of an AI system. Using the keys of <xref target="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.</t>
    </section>
  </back>
</rfc>
