<?xml version='1.0' encoding='utf-8'?>
<!-- This template is for creating an Internet Draft using xml2rfc,
    which is available here: http://xml.resource.org. -->
<!DOCTYPE rfc SYSTEM "rfc2629-xhtml.ent">
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<!-- used by XSLT processors -->
<!-- For a complete list and description of processing instructions (PIs), 
    please see http://xml.resource.org/authoring/README.html. -->
<!-- Below are generally applicable Processing Instructions (PIs) that most I-Ds might want to use.
    (Here they are set differently than their defaults in xml2rfc v1.32) -->
<?rfc strict="yes" ?>
<!-- give errors regarding ID-nits and DTD validation -->
<!-- control the table of contents (ToC) -->
<?rfc toc="yes"?>
<!-- generate a ToC -->
<?rfc tocdepth="4"?>
<!-- the number of levels of subsections in ToC. default: 3 -->
<!-- control references -->
<?rfc symrefs="yes"?>
<!-- use symbolic references tags, i.e, [RFC2119] instead of [1] -->
<?rfc sortrefs="yes" ?>
<!-- sort the reference entries alphabetically -->
<!-- control vertical white space 
    (using these PIs as follows is recommended by the RFC Editor) -->
<?rfc compact="yes" ?>
<!-- do not start each main section on a new page -->
<?rfc subcompact="no" ?>
<!-- keep one blank line between list items -->
<!-- end of list of popular I-D processing instructions -->
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" category="exp" docName="draft-chen-lsr-dynamic-flooding-algorithm-01" ipr="trust200902" obsoletes="" updates="" submissionType="IETF" xml:lang="en" tocInclude="true" tocDepth="4" symRefs="true" sortRefs="true" version="3">
  <!-- xml2rfc v2v3 conversion 2.40.1 -->
  <!-- category values: std, bcp, info, exp, and historic
    ipr values: trust200902, noModificationTrust200902, noDerivativesTrust200902,
       or pre5378Trust200902
    you can add the attributes updates="NNNN" and obsoletes="NNNN" 
    they will automatically be output with "(if approved)" -->

<!-- ***** FRONT MATTER ***** -->

<front>
    <!-- The abbreviated title is used in the page header - it is only necessary if the 
       full title is longer than 39 characters -->

  <title abbrev="Dynamic Flooding Algorithm">
    An Algorithm for Computing Dynamic Flooding Topologies
    </title>
    <seriesInfo name="Internet-Draft" value="draft-chen-lsr-dynamic-flooding-algorithm-01"/>
    <!-- add 'role="editor"' below for the editors if appropriate -->

  <!-- Another author who claims to be an editor -->

   <author fullname="Sarah Chen" initials="S." surname="Chen">
      <organization>Arista Networks</organization>
      <address>
        <postal>
          <street>5453 Great America Parkway</street>
          <!-- Reorder these if your country does things differently -->

        <city>Santa Clara</city>
          <region>California</region>
          <code>95054</code>
          <country>USA</country>
        </postal>
        <phone/>
        <email>sarahchen@arista.com</email>
      </address>
    </author>
    <author fullname="Tony Li" initials="T." surname="Li">
      <organization>Juniper Networks</organization>
      <address>
        <postal>
          <street>1133 Innovation Way</street>
          <!-- Reorder these if your country does things differently -->

        <city>Sunnyvale</city>
          <region>California</region>
          <code>94089</code>
          <country>USA</country>
        </postal>
        <phone/>
        <email>tony.li@tony.li</email>
        <!-- uri and facsimile elements may also be added -->
    </address>
    </author>
    <date year="2025"/>
    <!-- If the month and year are both specified and are the current ones, xml2rfc will fill 
       in the current day for you. If only the current year is specified, xml2rfc will fill 
       in the current day and month for you. If the year is not the current one, it is 
       necessary to specify at least a month (xml2rfc assumes day="1" if not specified for the 
       purpose of calculating the expiry date).  With drafts it is normally sufficient to 
       specify just the year. -->

  <!-- Meta-data Declarations -->

  <area>Routing</area>
    <workgroup>Internet Engineering Task Force</workgroup>
    <!-- WG name at the upperleft corner of the doc,
       IETF is fine for individual submissions.  
       If this element is not present, the default is "Network Working Group",
       which is used by the RFC Editor as a nod to the history of the IETF. -->

  <keyword>datacenter IGP routing flooding dense graph topology</keyword>
    <!-- Keywords will be incorporated into HTML output
       files in a meta tag but they have no effect on text or nroff
       output. If you submit your draft to the RFC Editor, the
       keywords will be used for the search engine. -->

    <abstract>
      <t>
	Link-state routing protocols suffer from excessive flooding in
	dense network topologies. Dynamic flooding <xref
	target="I-D.ietf-lsr-dynamic-flooding" format="default"/>
	alleviates the problem by decoupling the flooding topology from
	the physical topology. Link-state protocol updates are flooded
	only on the sparse flooding topology while data traffic is still
	forwarded on the physical topology.
      </t>
      <t>
	This document describes an algorithm to obtain a sparse subgraph
	from a dense graph. The resulting subgraph has certain desirable
	properties and can be used as a flooding topology in dynamic
	flooding.
      </t>
      <t>
	This document discloses the algorithm that we have developed in
	order to make it easier for other developers to implement
	similar algorithms. We do not claim that our algorithm is
	optimal, rather it is a pragmatic effort and we expect that
	further research and refinement can improve the results.
      </t>
      <t>
	We are not proposing that this algorithm be standardized, nor
	that the working group use this as a basis for further
	standardization work, however we have no objections if the
	working group chooses to do so.
      </t>
    </abstract>
  </front>
  <middle>
    <section numbered="true" toc="default">
      <name>Introduction</name>
      <t>
	In <xref target="I-D.ietf-lsr-dynamic-flooding" format="default"/>, dynamic
	flooding is proposed to reduce the flooding of link-state
	protocol packets in the network. The basic idea is to find a
	sparse flooding topology from the physical topology and flood
	link-state protocol data units (LSPDUs or LSPs) only on the
	flooding topology. The flooding topology should have the
	following properties: 
      </t>
      <ol spacing="normal" type="1">
        <li>
	  It should include all nodes in the area. This ensures that
	  LSPs can reach all nodes.
	</li>
        <li>
	  It should be biconnected if possible. This ensures that the
	  LSP delivery is resilient to a single node or link failure.
	</li>
        <li>
	  It has a limited diameter. Being a subgraph, the flooding
	  topology often has a larger diameter than the physical
	  topology. A larger diameter indicates a longer convergence
	  time. The tradeoff between flooding reduction and
	  convergence should be considered during the flooding
	  topology computation.
	</li>
        <li>
	  It has a balanced degree of distribution. The degree of a
	  node on the flooding topology indicates its burden in
	  flooding LSPs. It is desirable to balance this burden across
	  multiple nodes. Hence, the degree of each node should also
	  be considered during flooding topology computation.
	</li>
      </ol>
      <t>
	With the above properties in mind, we propose an iterative algorithm
	to compute the flooding topology.
      </t>
    </section>
    <section numbered="true" toc="default">
      <name>Problem Statement</name>
      <t>
	We model the physical topology as an undirected graph. Each system or
	pseudonode in the area is represented by a node in the graph. An edge
	connects two nodes who advertise each other as neighbors. Given the
	set of the nodes and the set of edges, we propose an algorithm to
	compute a biconnected (if possible) subgraph that covers all
	nodes. The subgraph is computed with consideration of diameter and
	node degree.
      </t>
    </section>
    <section numbered="true" toc="default">
      <name>Algorithm Outline</name>
      <t>
	A simple cycle that covers all nodes is a biconnected subgraph
	with balanced node degrees. While it has some desirable
	properties, a simple cycle is not suitable as a flooding
	topology at large scale. With N nodes in the area, a link-state
	update has to take N/2 hops to reach all nodes. The undue
	propagation delay causes a long convergence time.
      </t>
      <t>
	The proposed algorithm constructs a subgraph composed of small
	overlapping cycles. The base graph is denoted by G(V, E), where
	V is the set of all reachable nodes in this area, and E is the
	set of edges. The subgraph to be computed is denoted by G'({},
	{}), which starts with an empty set of nodes and an empty set of
	edges.
      </t>
      <ol spacing="normal" type="1">
        <li>
	  Select a subset of nodes V(0) from V and a subset of edges
	  E(0) from E to form an initial cycle. This cycle is added to
	  the subgraph: G'(V(0), E(0)).
	</li>
        <li>
	  Select a subset of nodes V(i) and a subset of edges E(i),
	  that are not included in the current subgraph. That is, V(i)
	  is selected from V - V(0) - ... - V(i-1) and E(i) is selected
	  from E - E(0) - ... - E(i-1). These nodes and the edges are
	  selected to form an arc path whose two endpoints are
	  included in the current subgraph. This arc path is added to
	  the subgraph: G'( V(0) + V(1) + ... + V(i), E(0) + E(1) + ... +
	  E(i) ). 
	</li>
        <li>
	  Repeat step 2 until all nodes are included in the subgraph
	  G'.
	</li>
      </ol>
      <t>
	The subgraph constructed by this algorithm has the following
	properties:
      </t>
      <ol spacing="normal" type="1">
        <li>
	  It covers all nodes in the area.
	</li>
        <li>
	  It is biconnected. This can be easily proven by
	  induction. Specifically, the initial cycle is
	  biconnected. Adding an arc path, whose two endpoints differ,
	  to a biconnected subgraph maintains the biconnectivity of
	  the subgraph.
	</li>
        <li>
	  It has a limited diameter. By selecting small cycles, the
	  subgraph will have a smaller diameter. More specifically,
	  the implementation can pick endpoints of each arc path to
	  reduce the diameter of the subgraph.  The degree of a node
	  in the subgraph is determined by the number of arc paths it
	  is on. By carefully selecting the arc endpoints, we may
	  balance the node degrees.
	</li>
      </ol>
      <t>
	Together with the encoding scheme in <xref
	target="I-D.ietf-lsr-dynamic-flooding" format="default"/>,
	this algorithm can be used to implement centralized dynamic
	flooding. The area leader can build the base graph from its
	link-state database (LSDB), apply this algorithm to compute
	the flooding topology, and then encode it into the Dynamic
	Flooding Path TLVs specified in <xref
	target="I-D.ietf-lsr-dynamic-flooding" format="default"/>. In
	a topology change event, the area leader can repeat the above
	process and send out the new flooding topology.
      </t>
    </section>
    <section numbered="true" toc="default">
      <name>Algorithm Details</name>
      <t>
	The outlined algorithm allows for different approaches to find the
	initial cycle and subsequent arc paths. We do not intend to find the
	theoretically optimal solution. Our aim is to find a practical
	approach that works for any connected base graph, and is also easy to
	implement.
      </t>
      <section numbered="true" toc="default">
        <name>Initial Cycle Setup</name>
        <t>
	  The initial cycle forms a base of the subgraph
	  computation. Intuitively, we would like to place the initial
	  cycle around the centroid of the base graph, and gradually
	  expand it outwards. Complicated graph analysis can help, but
	  is not desired.
        </t>
        <t>
	  We propose to select a starting node and then search a path
	  that ends at this node. We suggest selecting the node with the
	  highest degree as the starting node. The degree of each node
	  can be easily determined when the base graph is constructed
	  from the LSDB. Starting from this node, we perform a
	  depth-first search (DFS) for a limited number of steps, and
	  then a breadth-first search (BFS) to find the shortest path
	  back to the starting node. The restriction of the DFS depths
	  and the use of BFS effectively help limit the diameter of the
	  initial cycle. Below is a summary of the procedure. We omit
	  the details of the well-known DFS and BFS algorithms.
        </t>
        <ol spacing="normal" type="1">
          <li>
	    Let V(0) = [] be the list of nodes on the initial cycle.
	  </li>
          <li>
	    Find the starting node, denoted by n0. V(0) = [n0].
	  </li>
          <li>
	    Perform DFS starting from n0 until either the first leaf
	    is reached or the depth exceeds a preset limit. The
	    visited nodes are denoted by n1, n2, ..., ni, where i &lt;
	    DFS depth limit, and added to the list V(0) in order.
	  </li>
          <li>
	    Mark nodes in V(0) as visited to avoid BFS visiting these
	    nodes. Then perform BFS to find the shortest path from ni
	    to n0. Append nodes on the shortest path to V(0). Since
	    this is a cycle, node n0 appears twice in V(0): the first
	    and the last places. 
	  </li>
        </ol>
        <t>
	  Note that since DFS and BFS do not process a node more than
	  once, we are ensured to obtain a cycle (if one exists) from
	  the above procedure.
        </t>
      </section>
      <section numbered="true" toc="default">
        <name>Arc Path Selection</name>
        <t>
	  After obtaining an initial cycle, we recursively add arc paths
	  to the subgraph until all nodes are included. Each arc path's
	  two endpoints are chosen from the current subgraph. This
	  ensures that the resulting subgraph remains biconnected. To
	  limit the diameter of the resulting subgraph, we select an arc
	  path with limited length and attach it closer to the initial
	  cycle.
        </t>
        <t>
	  In each iteration, we have a starting subgraph, which includes
	  the initial cycle and the arc paths obtained in earlier
	  iterations. We first select a node from the starting subgraph,
	  that has at least one neighbor that is not in the starting
	  subgraph. To balance the degree distribution, we prefer to
	  select a node that has the least degree in the starting
	  subgraph. Meanwhile, we intend to place the new arc path
	  closer to the initial cycle, which will help reduce the
	  diameter of the resulting subgraph. As the number of
	  iterations increases, it becomes hard to find such nodes that
	  meet both conditions. A tradeoff between the node degree and
	  the node distance to the initial cycle has to be made.
        </t>
        <t>
	  Starting from the selected node, we perform a DFS for a
	  limited number of steps in the base graph to include nodes and
	  edges that do not belong to the starting subgraph. Then BFS is
	  performed to find the shortest path back to any node in the
	  starting subgraph except the starting node of this
	  iteration. The resulting path is combined with the starting
	  subgraph to generate a new subgraph, which serves as the
	  starting subgraph in the next iteration. The iteration is
	  repeated until all nodes in the base graph are included in the
	  subgraph.
        </t>
        <t>
	  The procedure in each iteration is very similar to the one
	  used to find the initial cycle, except that the two endpoints
	  of the new path do not match: 
        </t>
        <ol group="arcpathsteps" spacing="normal" type="1">
          <li>
	    Let V(i) = [] be the list of nodes found in the i-th
	    iteration. The starting subgraph includes nodes in V(0) +
	    ... + V(i-1), and edges between each pair of adjacent
	    nodes in each node list V(j). 
	  </li>
          <li>
	    Select a starting node n0 for this iteration from the
	    starting subgraph. V(i) = [n0].
	  </li>
          <li>
	    Mark all nodes in V(0) + ... + V(i-1) as visited. Then
	    perform DFS from n0 until either the first leaf is reached
	    or the depth exceeds a preset limit. Nodes visited in this
	    iteration are denoted by n1, n2, ..., ni in order, and
	    appended to the list V(i).
	  </li>
          <li>
	    Mark all nodes in V(0) + ... + V(i-1) + V(i) as
	    visited. Then perform BFS to find the shortest path from
	    ni to any node in V(0) + ... V(i-1) - [n0], where n0 is
	    the starting node in this iteration. If a path is found,
	    append its nodes to V(i) and repeat the iteration from
	    step 1.
	  </li>
        </ol>
        <t>
	  By correctly marking the visited nodes before DFS and BFS,
	  we ensure that the obtained arc path (if it exists) has
	  two endpoints and only these two points on the starting
	  subgraph.
        </t>
      </section>
      <section numbered="true" toc="default">
        <name>Exceptions</name>
        <t>
	  If the base graph is biconnected, there exists a simple cycle
	  between any two nodes. We are thus ensured to find one arc
	  path in each iteration and the algorithm described above will
	  yield a biconnected subgraph that covers all nodes in the base
	  graph. Otherwise, however, we may not be able to find an arc
	  path with both endpoints belonging to the starting subgraph in
	  that iteration. When this happens, we know that the edge
	  between the last node found by DFS and its parent is a cut
	  edge in the base graph.  For connectivity, this edge must be
	  included in the resulting subgraph. Hence, when step 4 (the
	  BFS stage in earlier procedures) fails, we should amend it
	  with the following: 
        </t>
        <ol group="arcpathsteps" spacing="normal" type="1">
          <li>
	    If BFS does not find a shortest path from ni, and V(i)
	    contains only two nodes, i.e., the cut edge case, then go
	    back to step 1 to continue the iteration.
	  </li>
          <li>
	    If BFS does not find a shortest path from ni, and V(i)
	    contains more than two nodes, then remove the last node
	    from V(i), and go back to step 4.
	  </li>
        </ol>
        <t>
	  Similarly, we might face the same problem when selecting the
	  initial cycle. We can apply step 6 until we find a
	  cycle. However, if we happen to find a cut edge, we can change
	  the first neighbor of the starting node that is visited by the
	  DFS and repeat the procedure. If all edges connecting to the
	  starting node are cut edges, we can change the starting
	  node. If an initial cycle is not found after all the above
	  efforts, indicating that the base graph does not have a cycle,
	  then we will return the base graph as the result. 
        </t>
      </section>
      <section numbered="true" toc="default">
        <name>LANs</name>
        <t>
	  We model a pseudonode as a node in the base graph. The
	  proposed algorithm can be applied as-is.  There are,
	  however, possible optimizations for the multi-access LAN
	  case. First, a pseudonode is not required to be on the
	  flooding topology. The algorithm can thus be terminated as
	  soon as all real nodes are included in the subgraph. Second,
	  if a pseudonode is included on the flooding topology, all
	  nodes connecting to this LAN will have to flood their LSPs
	  to this LAN (see <xref
	  target="I-D.ietf-lsr-dynamic-flooding" format="default"/>
	  Section 6.6). Hence, if a pseudonode is included in the
	  subgraph, then it will automatically provide
	  uni-connectivity to all its neighbors that are not yet
	  included. The algorithm can take advantage of this LAN
	  property to reduce the edges in the subgraph.
        </t>
      </section>
    </section>
    <section numbered="true" toc="default">
      <name>Example</name>
      <t>
	The proposed algorithm can be applied to any connected base
	graph. For ease of explanation, we consider a complete graph of
	10 nodes and 45 edges. To limit the diameter of the resulting
	subgraph, we pre-set the maximum steps in the DFS to 3.
      </t>
      <ol spacing="normal" type="1">
        <li>
	  Let ni, i = 0, 1, ... 9, denote nodes in the base graph.
	</li>
        <li>
          <t>
	    Find an initial cycle. 
          </t>
          <ol spacing="normal" type="a">
            <li>
	      Without loss of generality, we select node n0 as the
	      starting point.
	    </li>
            <li>
	      Perform DFS from n0 for 3 steps. We obtain a path n0 -
	      n1 - n2 - n3.
	    </li>
            <li>
	      Perform BFS from n3 to n0. Since this is a complete
	      graph, where every node is directly connected to any
	      other node, the shortest path is only one hop away.
	    </li>
            <li>
	      The initial cycle is  found n0 - n1 - n2 - n3 - n0.
	    </li>
          </ol>
        </li>
        <li>
          <t>
	    Find the first arc path.
          </t>
          <ol spacing="normal" type="a">
            <li>
	      Select a node on the initial cycle, say n0.
	    </li>
            <li>
	      Perform DFS from n0 for 3 steps. We obtain a path n0 -
	      n4 - n5 - n6.
	    </li>
            <li>
	      Perform BFS from n6 to any node on the initial cycle
	      except n0, i.e., {n1, n2, n3}. These three nodes have
	      the same degree. We may select any one of them as the
	      endpoint. Suppose that n1 is selected. 
	    </li>
            <li>
	      The first arc path is found n0 - n4 - n5 - n6 - n1.
	    </li>
          </ol>
        </li>
        <li>
          <t>
	    Find the second arc path.
          </t>
          <ol spacing="normal" type="a">
            <li>
	      When selecting the starting node for this path, we may
	      consider the current node degree as well as the node
	      distance to n0 (the starting point of the initial
	      cycle). We notice that both n0 and n1 have a degree of 3
	      while other nodes have a degree of 2. Nodes n1, n3, n4
	      are the closest to n0. We select a node with a lower
	      degree and closer to n0. Suppose n3 is selected.
	    </li>
            <li>
	      Perform DFS from n3 for 3 steps. We obtain a path n3 -
	      n7 -n8 - n9.
	    </li>
            <li>
	      Perform BFS from n9 to any node except n3. Using the
	      same criteria in a. to select the endpoint, we select
	      n4.
	    </li>
            <li>
	      The second arc path is found n3 - n7 -n8 - n9 - n4.
	    </li>
          </ol>
        </li>
        <li>
	  The subgraph has included all nodes. The iteration ends.
	</li>
      </ol>
      <t>
	The subgraph found by the proposed algorithm can be represented
	by three paths: 
      </t>
      <ul empty="true" spacing="normal">
        <li>
	  n0 - n1 - n2 - n3 - n0
	</li>
        <li>
	  n0 - n4 - n5 - n6 - n1
	</li>
        <li>
	  n3 - n7 -n8 - n9 - n4
	</li>
      </ul>
      <t>
	The subgraph has 12 edges, significantly reduced from 45 in the
	base graph. The highest node degree is 3 and the lowest node
	degree is 2. The diameter of the subgraph is 4, increased, as
	expected, from that of the base graph. 
      </t>
    </section>
    <section anchor="Security" numbered="true" toc="default">
      <name>Security Considerations</name>
      <t>
	This document introduces no new security issues. Security
	issues within dynamic flooding are already discussed in <xref
	target="I-D.ietf-lsr-dynamic-flooding" format="default"/>.
      </t>
    </section>
  </middle>
  <!--  *****BACK MATTER ***** -->

<back>
    <!-- References split into informative and normative -->

  <!-- There are 2 ways to insert reference entries from the citation libraries:
       1. define an ENTITY at the top, and use "ampersand character"RFC2629; here (as shown)
       2. simply use a PI "less than character"?rfc include="reference.RFC.2119.xml"?> here
       (for I-Ds: include="reference.I-D.narten-iana-considerations-rfc2434bis.xml")

Both are cited textually in the same manner: by using xref elements.
If you use the PI option, xml2rfc will, by default, try to find included files in the same
directory as the including file. You can also define the XML_LIBRARY environment variable
with a value containing a set of directories to search.  These can be either in the local
filing system or remote ones accessed by http (http://domain/dir/... ).-->

  <references>
      <name>Informative References</name>
      <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml3/reference.I-D.draft-ietf-lsr-dynamic-flooding-04.xml"/>
    </references>
  </back>
</rfc>
