<?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-00" 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.
      </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. The fingerprint
                includes the time difference from the last fingerprint change which facilitates
                measurement of flooding behavior across the network.
      </t>
      <t>
                Aged out LSPs are excluded from the fingerprint calculation.
      </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>
    </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-database-checksumming

        augment /rt:routing/rt:control-plane-protocols
                  /rt:control-plane-protocol/isis:isis
                  /isis:database/isis:levels:
          +--rw fingerprint
             +--rw value?         uint64
             +--rw last-update?   uint32
              ]]></artwork>
      </section>
      <section title="YANG Data Model">
        <t>The following is the YANG module:</t>
        <sourcecode name="ietf-isis-database-checksumming@2026-06-26.yang" type="" markers="true">
module ietf-isis-database-checksumming {
  yang-version 1.1;
  namespace "urn:ietf:params:xml:ns:yang:ietf-isis-database-checksumming";
  prefix isis-db-csum;

  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:mpls@ietf.org&gt;

     Author:    Renato Westphal
               &lt;renato@netdef.org&gt;
     Author:    Tony Przygienda
               &lt;mailto:antoni.przygienda@hpe.com&gt;
     Author:    Colby Barth
               &lt;mailto:colby.barth@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-06-26 {
    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";
    }
    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 whose remaining lifetime is
           non-zero. The per-LSP component value is derived from the
           LSP identifier, the LSP checksum, and the LSP 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 for this level's LSDB
           was last updated.";
      }
    }
  }
}
</sourcecode>
      </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="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 normative references -->

        <references title="Informative References">

        </references>
    <!-- end of informative references -->

        <section title="Checksum Reference Algorithm" anchor="csum_algo">
      <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();
        for i in system_id.iter().chain(&[self.lsp_id.pseudonode]) {
            result <<= 8;
            result ^= *i as u64;
        }
        // fragment checksum
        result ^= (self.cksum as u64) << 48;
        // This is equal to the PDU length advertised by the fragment
        result ^= (self.raw.len() as u64) << 32;
        result
    }
<CODE ENDS>
]]></artwork>
      </figure>
    </section>
  </back>
</rfc>
