<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE rfc SYSTEM "rfc2629-xhtml.ent">
<!-- This template is for creating an Internet Draft using xml2rfc,
    which is available here: http://xml.resource.org. -->
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<?rfc strict="yes" ?>
<?rfc toc="yes"?>
<?rfc tocdepth="4"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes" ?>
<?rfc compact="yes" ?>
<?rfc subcompact="no" ?>
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" category="std" docName="draft-westphal-lsr-isis-database-checksumming-03" ipr="trust200902" obsoletes="" updates="" submissionType="IETF" xml:lang="en" tocInclude="true" tocDepth="3" symRefs="true" sortRefs="true" version="3">
  <!-- ***** FRONT MATTER ***** -->

    <front>
    <title>IS-IS Database Fingerprinting</title>
    <author initials="R." surname="Westphal" fullname="Renato Westphal">
      <organization>NetDEF</organization>
      <address>
        <email>renato@netdef.org</email>
      </address>
    </author>
    <author initials="T." surname="Przygienda" fullname="Tony Przygienda">
      <organization>HPE Juniper Networking</organization>
      <address>
        <email>antoni.przygienda@hpe.com</email>
      </address>
    </author>
    <date/>
    <abstract>
      <t>
                In large IS-IS networks it is useful to quickly verify whether the link-state
                databases on all routers have synchronized properly and to derive a rough metric
                of flooding diffusion behavior. This document proposes a lightweight database
                fingerprinting mechanism for IS-IS along with YANG model extensions providing
                easy access to such information. For fast verification against a peer, an
                optional TLV carrying the database fingerprint is defined for inclusion in
                IIH and CSNP PDUs.
      </t>
    </abstract>
  </front>
  <middle>
    <section title="Introduction" anchor="intro">
      <t>
                In large IS-IS networks in stable state it is useful to observe
                whether all databases have synchronized properly and derive the delays involved
                in the propagation of information across the network.
      </t>
      <t>
                This document defines a database fingerprinting mechanism that allows for quick
                validation of database synchronization across all nodes. A node implementing this
                specification computes a fingerprint over all fragments per level. Alongside the
                fingerprint itself, the node reports the time elapsed since the fingerprint value
                last changed, i.e. since the most recent recomputation that produced a value
                differing from the previous one. This facilitates measurement of flooding
                behavior across the network.
      </t>
      <t>
                The fingerprint includes all LSP fragments held in the level's LSDB,
                including purged LSPs retained for ZeroAgeLifetime
                <xref target="ISO10589"/>. For an LSP whose Remaining Lifetime is zero,
                the checksum and length inputs to its fingerprint component
                <bcp14>MUST</bcp14> both be treated as zero; the LSP ID and sequence
                number remain included. A purge contributes to the fingerprint until it
                is removed from the LSDB. This normalization applies only to fingerprint
                computation and does not change the LSP's on-wire fields. Local
                placeholders that do not represent an LSP, such as entries created to
                request a missing LSP in response to an SNP, <bcp14>MUST NOT</bcp14>
                contribute to the fingerprint. An actual LSP is not excluded merely
                because its checksum or length is zero.
      </t>
      <t>
                A reference checksum algorithm for a fragment is given in <xref target="csum_algo"/>. The overall fingerprint
                is the XOR of all fragment checksums.
      </t>
      <t>
                The fingerprint <bcp14>MUST</bcp14> be updated when an LSP is added,
                removed, or changes in a way that changes its contribution. In particular,
                expiry or purging replaces the previous contribution with the normalized
                purge contribution; removal after ZeroAgeLifetime removes that contribution.
                A placeholder becoming an LSP, or an LSP becoming a placeholder, likewise
                requires the corresponding contribution to be added or removed. Changes to
                the LSP ID, sequence number, checksum, length, or purge state can affect the
                contribution, but ordinary remaining lifetime countdown does not.
      </t>
      <t>
                Implementations that maintain the fingerprint incrementally, rather than
                walking the database, need some care here: by the time such an event is
                observed, the fields of the LSP have usually already changed, so the value
                that has to be XORed out is no longer derivable from the LSP. The
                straightforward implementation caches each LSP's last folded contribution
                alongside the LSP and, on any change, XORs out the cached value and XORs
                in the newly computed one, replacing the cache. On removal, only the cached
                contribution is XORed out. Recomputing the contribution from the changed
                LSP and XORing that out instead silently corrupts the fingerprint, and the
                error persists until the next full walk.
      </t>
    </section>
    <section title="Requirements Language" anchor="reqlang">
      <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 title="IS-IS Database Fingerprint TLV" anchor="fp_tlv">
      <t>
                To allow routers to rapidly detect link-state database synchronization
                differences directly with neighbors without waiting for or exchanging full
                CSNPs, this document defines an optional top-level IS-IS TLV: the Database
                Fingerprint TLV.
      </t>
      <t>
                The Database Fingerprint TLV <bcp14>MAY</bcp14> be included in the following
                PDU types:
      </t>
      <ul>
        <li>Level 1 LAN IS-to-IS Hello PDU <xref target="ISO10589"/></li>
        <li>Level 2 LAN IS-to-IS Hello PDU <xref target="ISO10589"/></li>
        <li>Point-to-Point IS-to-IS Hello PDU <xref target="ISO10589"/></li>
        <li>Complete Sequence Numbers PDU (CSNP) <xref target="ISO10589"/></li>
      </ul>
      <t>
                The format of the Database Fingerprint TLV is shown in <xref target="fp_tlv_fig"/>.
      </t>
      <figure anchor="fp_tlv_fig">
        <name>Database Fingerprint TLV Format</name>
        <artwork align="left" name="" type="" alt=""><![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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|  Type (TBA)   | Length (10/14)|     Level     |   Reserved    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                     Database Fingerprint                      |
|                           (64 bits)                           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|              Last Update (optional, 32 bits)                  |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
      </figure>
      <dl newline="false" spacing="normal">
        <dt>Type:</dt>
        <dd>TBA (1 octet), to be allocated by IANA from the "IS-IS Top-Level TLV Codepoints" registry.</dd>
        <dt>Length:</dt>
        <dd>
                    10 or 14 octets. The Length field indicates whether the optional Last Update
                    field is present: 10 octets indicates only the Level, Reserved, and Database
                    Fingerprint fields are present; 14 octets indicates the optional 4-octet (32-bit)
                    Last Update field is also present.
                </dd>
        <dt>Level:</dt>
        <dd>
                    1 octet indicating the IS-IS level for the fingerprint: 1 for Level 1,
                    or 2 for Level 2. Values other than 1 and 2 are reserved and <bcp14>MUST</bcp14>
                    be ignored on receipt. In LAN Hello PDUs, the Level field <bcp14>MUST</bcp14>
                    match the level of the LAN Hello PDU. In Point-to-Point Hello PDUs, a router
                    <bcp14>MAY</bcp14> include up to two instances of this TLV (one for Level 1
                    and one for Level 2).
                </dd>
        <dt>Reserved:</dt>
        <dd>1 octet. <bcp14>MUST</bcp14> be set to 0 on transmission and ignored on receipt.</dd>
        <dt>Database Fingerprint:</dt>
        <dd>64-bit (8 octets) fingerprint for the specified level in network byte order, computed as defined in this document.</dd>
        <dt>Last Update:</dt>
        <dd>
                    Optional 32-bit (4 octets) unsigned integer in network byte order indicating
                    the time elapsed, in seconds, since the fingerprint value for this level's
                    LSDB was last changed for any reason. This provides the in-band equivalent of the YANG
                    <tt>last-update</tt> leaf. Its presence is indicated by the TLV Length being
                    set to 14.
                </dd>
      </dl>
      <t>
                When a router receives an IS-IS Hello PDU containing a Database Fingerprint TLV
                for a given level, it <bcp14>MAY</bcp14> compare the received fingerprint value
                against its locally computed fingerprint for that level. If the fingerprints
                match, the link-state databases for that level can be considered as synchronized
                for operational purposes but
                the match SHOULD NOT be used to shortcut any of the normal IS-IS synchronization
                procedures.
                If the fingerprints differ, normal IS-IS database synchronization procedures
                (e.g., CSNP and PSNP exchanges) MUST continue to apply as specified in <xref target="ISO10589"/>.
      </t>
    </section>
    <section title="Yang Extensions for Database Fingerprint">
      <section title="Tree for the YANG Data Model">
        <t>This document uses the graphical representation of data models per <xref target="RFC8340"/>.</t>
        <t>The following shows the tree diagram of the module:</t>
        <artwork align="left" name="" type="" alt=""><![CDATA[
      module: ietf-isis-db-fingerprint

        augment /rt:routing/rt:control-plane-protocols
                  /rt:control-plane-protocol/isis:isis
                  /isis:database/isis:levels:
          +--ro fingerprint
             +--ro value?         uint64
             +--ro last-update?   uint32
              ]]></artwork>
      </section>
      <section title="YANG Data Model">
        <t>
            The module augments the IS-IS YANG data model <xref target="RFC9130"/>, which in
            turn builds on the routing management model <xref target="RFC8349"/>. The
            fingerprint state is added under the IS-IS LSDB, which is defined as operational
            state, and therefore all nodes defined by this augmentation are operational state
            as well.
        </t>
        <t>The following is the YANG module:</t>
        <sourcecode name="ietf-isis-db-fingerprint@2026-10-13.yang" type="" markers="true">
module ietf-isis-db-fingerprint {
  yang-version 1.1;
  namespace "urn:ietf:params:xml:ns:yang:ietf-isis-db-fingerprint";
  prefix isis-db-fp;

  import ietf-routing {
    prefix rt;
    reference
      "RFC 8349: A YANG Data Model for Routing
       Management (NMDA Version)";
  }
  import ietf-isis {
    prefix isis;
    reference
      "RFC 9130: YANG Data Model for the IS-IS Protocol";
  }

  organization
    "IETF LSR - LSR Working Group";
  contact
    "WG Web:   &lt;https://datatracker.ietf.org/wg/lsr&gt;
     WG List:  &lt;mailto:lsr@ietf.org&gt;

     Author:    Renato Westphal
               &lt;renato@netdef.org&gt;
     Author:    Tony Przygienda
               &lt;mailto:antoni.przygienda@hpe.com&gt;
    ";
  description
    "The YANG module augments the base IS-IS YANG data model with
     operational state related to IS-IS LSDB fingerprinting.

     Copyright (c) 2026 IETF Trust and the persons identified as
     authors of the code.  All rights reserved.

     Redistribution and use in source and binary forms, with or
     without modification, is permitted pursuant to, and subject to
     the license terms contained in, the Revised BSD License set
     forth in Section 4.c of the IETF Trust's Legal Provisions
     Relating to IETF Documents
     (https://trustee.ietf.org/license-info).

     This version of this YANG module is part of RFC XXXX
     (https://www.rfc-editor.org/info/rfcXXXX); see the RFC itself
     for full legal notices.

     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 (RFC 2119) (RFC 8174) when, and only when,
     they appear in all capitals, as shown here.";
  reference
    "RFC XXXX: IS-IS Database Fingerprinting";

  revision 2026-10-13 {
    description
      "Initial Version";
    reference
      "RFC XXXX: IS-IS Database Fingerprinting";
  }

  /* LSDB fingerprint */

  augment "/rt:routing/rt:control-plane-protocols/"
        + "rt:control-plane-protocol/isis:isis/isis:database/"
        + "isis:levels" {
    when "derived-from-or-self(../../../rt:type, 'isis:isis')" {
      description
        "This augment ISIS routing protocol when used";
    }
    description
      "Augments the IS-IS LSDB with the per-level database
       fingerprint.";
    container fingerprint {
      description
        "Information about the LSDB fingerprint for this level.";
      leaf value {
        type uint64;
        description
          "A 64-bit fingerprint derived from the set of LSPs at this
           level.

           The fingerprint is computed by XOR-combining a per-LSP
           component value for each LSP in the level's LSDB,
           including purges retained during ZeroAgeLifetime. Local
           placeholders that do not represent an LSP MUST NOT
           contribute. For an LSP whose Remaining Lifetime is zero,
           the checksum and length inputs MUST be treated as zero
           for this calculation; this does not change the on-wire
           LSP. An actual LSP is not excluded merely because its
           checksum or length is zero.
           The per-LSP component value is derived from the LSP
           identifier, sequence number, checksum, and length, as
           specified in Appendix A of RFC XXXX.

           The fingerprint is intended for detecting potential LSDB
           synchronization differences. Different values indicate
           different LSDB contents; identical values do not guarantee
           equivalence due to possible collisions.";
      }
      leaf last-update {
        type uint32;
        units "seconds";
        description
          "Time elapsed since the fingerprint value for this level's
           LSDB last changed.

           The fingerprint is recomputed whenever the contents of the
           level's LSDB change. This leaf is reset to zero only when
           such a recomputation yields a value that differs from the
           previously computed one. A recomputation that yields the
           same value does not reset this leaf.";
      }
    }
  }
}
</sourcecode>
      </section>
    </section>
    <section title="Operational Considerations" anchor="operations">
      <t>
                The database fingerprint mechanism and the reported elapsed time
                (<tt>last-update</tt>) are intended to observe general database synchronization
                and propagation delays across the network in stable state. Measurement of
                flooding diffusion or synchronization events at sub-second granularity
                (under 1 second) is not intended by this specification.
      </t>
      <t>
                A node holding an older copy of an otherwise unchanged LSP has a
                synchronization difference. The LSP checksum of <xref target="ISO10589"/>
                is computed from the LSP ID field onwards and therefore already covers
                the Sequence Number, and the algorithm in <xref target="csum_algo"/>
                additionally folds the sequence number in explicitly, so that the
                contribution does not depend on checksum coverage alone. A periodic LSP
                refresh consequently changes its contribution even when its content is
                unchanged, although fingerprint collisions remain possible. The reported
                <tt>last-update</tt> is the time since the fingerprint value last changed,
                including changes caused by refreshes or purges, and in a large network it will
                rarely grow large.
      </t>
      <t>
                The database fingerprint mechanism assumes that nodes within the same flooding
                domain synchronize identical sets of Link State PDUs (LSPs). If LSP flooding
                is filtered or constrained for any reason (for example, due to policy-based
                flooding filters, mesh groups, or topology reduction mechanisms), the link-state
                databases on nodes separated by such filtering will not contain the same set
                of LSPs.
      </t>
      <t>
                Consequently, the computed fingerprint values will not be the same on both
                sides of the filtering boundary. Operators and network management systems
                must take any intentional flooding asymmetry or filtering into account when
                comparing database fingerprints between nodes, as a mismatch under these
                conditions does not indicate a protocol failure or synchronization defect.
      </t>
    </section>
    <section title="IANA Considerations" anchor="iana">
      <section title="IS-IS Top-Level TLV Codepoints Registry">
        <t>
                    This document requests that IANA allocate a new codepoint from the
                    "IS-IS Top-Level TLV Codepoints" registry:
        </t>
        <artwork align="left" name="" type="" alt=""><![CDATA[
   Value:     TBA
   Name:      Database Fingerprint
   IIH:       Y
   LSP:       N
   SNP:       Y
   Purge:     N
   Reference: RFC XXXX
]]></artwork>
      </section>
      <section title="IETF XML Registry">
        <t>
                    This document requests the registration of one URI in the "IETF XML Registry"
                    <xref target="RFC3688"/>. Following the format in <xref target="RFC3688"/>, the
                    following registration is requested:
        </t>
        <artwork align="left" name="" type="" alt=""><![CDATA[
   URI: urn:ietf:params:xml:ns:yang:ietf-isis-db-fingerprint
   Registrant Contact: The IESG.
   XML: N/A, the requested URI is an XML namespace.
]]></artwork>
      </section>
      <section title="YANG Module Names Registry">
        <t>
                    This document requests the registration of one YANG module in the "YANG Module
                    Names" registry <xref target="RFC6020"/>:
        </t>
        <artwork align="left" name="" type="" alt=""><![CDATA[
   Name:      ietf-isis-db-fingerprint
   Namespace: urn:ietf:params:xml:ns:yang:ietf-isis-db-fingerprint
   Prefix:    isis-db-fp
   Reference: RFC XXXX
]]></artwork>
      </section>
    </section>
    <section title="Security Considerations" anchor="security">
      <t>
                The fingerprint mechanism defined in this document is purely informational and
                does not influence protocol behavior. It does not introduce new attack vectors
                beyond those inherent in IS-IS itself. The fingerprint value is derived from
                information already present in the LSDB and does not leak additional data.
      </t>
    </section>
    <section title="Acknowledgments">
      <t>TBD</t>
    </section>
  </middle>
  <back>
    <references title="Normative References">
      <reference anchor="RFC2119" target="https://www.rfc-editor.org/info/rfc2119" xml:base="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml">
        <front>
          <title>Key words for use in RFCs to Indicate Requirement Levels</title>
          <author fullname="S. Bradner" initials="S." surname="Bradner"/>
          <date month="March" year="1997"/>
          <abstract>
            <t>In many standards track documents several words are used to signify the requirements in the specification. These words are often capitalized. This document defines these words as they should be interpreted in IETF documents. This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.</t>
          </abstract>
        </front>
        <seriesInfo name="BCP" value="14"/>
        <seriesInfo name="RFC" value="2119"/>
        <seriesInfo name="DOI" value="10.17487/RFC2119"/>
      </reference>
      <reference anchor="RFC3688" target="https://www.rfc-editor.org/info/rfc3688" xml:base="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.3688.xml">
        <front>
          <title>The IETF XML Registry</title>
          <author fullname="M. Mealling" initials="M." surname="Mealling"/>
          <date month="January" year="2004"/>
          <abstract>
            <t>This document describes an IANA maintained registry for IETF standards which use Extensible Markup Language (XML) related items such as Namespaces, Document Type Declarations (DTDs), Schemas, and Resource Description Framework (RDF) Schemas.</t>
          </abstract>
        </front>
        <seriesInfo name="BCP" value="81"/>
        <seriesInfo name="RFC" value="3688"/>
        <seriesInfo name="DOI" value="10.17487/RFC3688"/>
      </reference>
      <reference anchor="RFC6020" target="https://www.rfc-editor.org/info/rfc6020" xml:base="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.6020.xml">
        <front>
          <title>YANG - A Data Modeling Language for the Network Configuration Protocol (NETCONF)</title>
          <author fullname="M. Bjorklund" initials="M." role="editor" surname="Bjorklund"/>
          <date month="October" year="2010"/>
          <abstract>
            <t>YANG is a data modeling language used to model configuration and state data manipulated by the Network Configuration Protocol (NETCONF), NETCONF remote procedure calls, and NETCONF notifications. [STANDARDS-TRACK]</t>
          </abstract>
        </front>
        <seriesInfo name="RFC" value="6020"/>
        <seriesInfo name="DOI" value="10.17487/RFC6020"/>
      </reference>
      <reference anchor="RFC8174" target="https://www.rfc-editor.org/info/rfc8174" xml:base="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml">
        <front>
          <title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
          <author fullname="B. Leiba" initials="B." surname="Leiba"/>
          <date month="May" year="2017"/>
          <abstract>
            <t>RFC 2119 specifies common key words that may be used in protocol specifications. This document aims to reduce the ambiguity by clarifying that only UPPERCASE usage of the key words have the defined special meanings.</t>
          </abstract>
        </front>
        <seriesInfo name="BCP" value="14"/>
        <seriesInfo name="RFC" value="8174"/>
        <seriesInfo name="DOI" value="10.17487/RFC8174"/>
      </reference>
      <reference anchor="RFC8349" target="https://www.rfc-editor.org/info/rfc8349" xml:base="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8349.xml">
        <front>
          <title>A YANG Data Model for Routing Management (NMDA Version)</title>
          <author fullname="L. Lhotka" initials="L." surname="Lhotka"/>
          <author fullname="A. Lindem" initials="A." surname="Lindem"/>
          <author fullname="Y. Qu" initials="Y." surname="Qu"/>
          <date month="March" year="2018"/>
          <abstract>
            <t>This document specifies three YANG modules and one submodule. Together, they form the core routing data model that serves as a framework for configuring and managing a routing subsystem. It is expected that these modules will be augmented by additional YANG modules defining data models for control-plane protocols, route filters, and other functions. The core routing data model provides common building blocks for such extensions -- routes, Routing Information Bases (RIBs), and control-plane protocols.</t>
            <t>The YANG modules in this document conform to the Network Management Datastore Architecture (NMDA). This document obsoletes RFC 8022.</t>
          </abstract>
        </front>
        <seriesInfo name="RFC" value="8349"/>
        <seriesInfo name="DOI" value="10.17487/RFC8349"/>
      </reference>
      <reference anchor="RFC9130" target="https://www.rfc-editor.org/info/rfc9130" xml:base="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9130.xml">
        <front>
          <title>YANG Data Model for the IS-IS Protocol</title>
          <author fullname="S. Litkowski" initials="S." role="editor" surname="Litkowski"/>
          <author fullname="D. Yeung" initials="D." surname="Yeung"/>
          <author fullname="A. Lindem" initials="A." surname="Lindem"/>
          <author fullname="J. Zhang" initials="J." surname="Zhang"/>
          <author fullname="L. Lhotka" initials="L." surname="Lhotka"/>
          <date month="October" year="2022"/>
          <abstract>
            <t>This document defines a YANG data model that can be used to configure and manage the IS-IS protocol on network elements.</t>
          </abstract>
        </front>
        <seriesInfo name="RFC" value="9130"/>
        <seriesInfo name="DOI" value="10.17487/RFC9130"/>
      </reference>
      <reference anchor="ISO10589">
        <front>
          <title>Intermediate system to Intermediate system intra-domain
                        routeing information exchange protocol for use in conjunction with
                        the protocol for providing the connectionless-mode Network Service
                        (ISO 8473)
          </title>
          <author>
            <organization abbrev="ISO">International Organization for Standardization</organization>
          </author>
          <date month="Nov" year="2002"/>
        </front>
        <seriesInfo name="ISO/IEC" value="10589:2002, Second Edition"/>
      </reference>
    </references>
    <!-- end of normative references -->

        <references title="Informative References">
      <reference anchor="RFC8340" target="https://www.rfc-editor.org/info/rfc8340" xml:base="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8340.xml">
        <front>
          <title>YANG Tree Diagrams</title>
          <author fullname="M. Bjorklund" initials="M." surname="Bjorklund"/>
          <author fullname="L. Berger" initials="L." role="editor" surname="Berger"/>
          <date month="March" year="2018"/>
          <abstract>
            <t>This document captures the current syntax used in YANG module tree diagrams. The purpose of this document is to provide a single location for this definition. This syntax may be updated from time to time based on the evolution of the YANG language.</t>
          </abstract>
        </front>
        <seriesInfo name="BCP" value="215"/>
        <seriesInfo name="RFC" value="8340"/>
        <seriesInfo name="DOI" value="10.17487/RFC8340"/>
      </reference>
    </references>
    <!-- end of informative references -->

        <section title="Checksum Reference Algorithm" anchor="csum_algo">
      <t>
                The following component algorithm is applied to actual LSDB LSPs, not
                local placeholders. In this example, <tt>is_purge()</tt> indicates that
                the LSP's Remaining Lifetime is zero, and <tt>raw.len()</tt> is its PDU
                length. The checksum and length are normalized only as inputs to this
                calculation for such an LSP.
      </t>
      <figure>
        <artwork align="center" name="" type="" alt=""><![CDATA[
<CODE BEGINS>
    pub(crate) fn lsdb_fingerprint_component(&self) -> u64 {
        let mut result: u64 = 0;
        let system_id: &[u8] = self.lsp_id.system_id.as_ref();
        // The LSP ID (system ID + pseudonode ID + fragment number)
        // MUST be folded in full. Omitting the fragment number byte
        // would make every fragment of a given system/pseudonode
        // contribute the same value here, leaving the checksum and
        // length fields below as the only differentiators between
        // fragments; two fragments whose checksum and length happen
        // to agree (or whose combined XOR happens to cancel across
        // the LSDB) would then be indistinguishable to the
        // fingerprint, silently defeating its purpose.
        for i in system_id
            .iter()
            .chain(&[self.lsp_id.pseudonode, self.lsp_id.fragment])
        {
            result <<= 8;
            result ^= *i as u64;
        }
        if !self.is_purge() {
            // Fragment checksum and advertised PDU length.
            result ^= (self.cksum as u64) << 48;
            result ^= (self.raw.len() as u64) << 32;
        }
        // Fold the sequence number in explicitly, including for purges.
        result ^= self.seqno as u64;
        result
    }
<CODE ENDS>
]]></artwork>
      </figure>
    </section>
  </back>
</rfc>
