<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="../../xslt/mathml.xsl"?><html xmlns="http://www.w3.org/1999/xhtml" xmlns:m="http://www.w3.org/1998/Math/MathML">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>Graph Theory: Networking</title>
    <link rel="stylesheet" href="../../css/style_mozilla.css" type="text/css" media="screen"/>
  </head>
  <body>
    <div id="logobarleft">
      <a href="http://links.math.rpi.edu/">
        <img src="../../css/titlebar_left.gif" alt="Project Links Logo"/>
      </a>
    </div>
    <div id="logobarright">
      <img src="../../css/titlebar_right.jpg" alt="Artwork"/>
    </div>
    <div id="titlebar">Graph Theory: Networking</div>
    <div id="breadcrumbbar">
			Home &gt; Graph Theory: Networking
					&gt; The Internet
					&gt; Link-State Routing</div>
    <div id="sidebar">
      <div class="toolmenu1">
        <a href="banana.html" class="toolmenu1">Crib Sheet</a>
      </div>
      <br/>
      <div class="toolmenu2">
        <a href="banana.html" class="toolmenu2">Library</a>
      </div>
      <br/>
      <div class="toolmenu3">
        <a href="banana.html" class="toolmenu3">Help</a>
      </div>
      <br/>
      <div class="toolmenu4">
        <a href="banana.html" class="toolmenu4">Map</a>
      </div>
      <br/>
      <div class="toolmenu5">
        <a href="problemlist.xml" class="toolmenu5">Problem List</a>
      </div>
      <br/>
      <div class="toolmenu5">
        <a href="../index.html" class="toolmenu5">Module Home</a>
      </div>
      <br/>
      <div class="toolmenu6">
        <a href="http://links.math.rpi.edu/" class="toolmenu6">Links Home</a>
      </div>
      <br/>
      <br/>
      <div class="toc_topic">
        <a class="toc_link" href="page1.xml">Introduction</a>
      </div>
      <div class="toc_topic">
        <a class="toc_link" href="page2.xml">Objectives</a>
      </div>
      <div class="toc_topic">
        <a class="toc_link" href="page3.xml">Prerequisites</a>
      </div>
      <div class="toc_topic">
        <a class="toc_link" href="">Foundations</a>
      </div>
      <div class="toc_subtopic">
        <a class="toc_link" href="page4.xml">Directed Graphs</a>
      </div>
      <div class="toc_subtopic">
        <a class="toc_link" href="page6.xml">Definitions</a>
      </div>
      <div class="toc_subtopic">
        <a class="toc_link" href="page9.xml">Shortest Paths</a>
      </div>
      <div class="toc_topic">
        <a class="toc_link" href="">Shortest-Path Algorithms</a>
      </div>
      <div class="toc_subtopic">
        <a class="toc_link" href="page11.xml">Problem Variations</a>
      </div>
      <div class="toc_subtopic">
        <a class="toc_link" href="page13.xml">Dijkstra's Algorithm</a>
      </div>
      <div class="toc_subtopic">
        <a class="toc_link" href="page16.xml">Bellman-Ford Algorithm</a>
      </div>
      <div class="toc_topic">
        <a class="toc_link" href="">Routing</a>
      </div>
      <div class="toc_subtopic">
        <a class="toc_link" href="page19.xml">Overview</a>
      </div>
      <div class="toc_subtopic">
        <a class="toc_link" href="page21.xml">Designing A Routing Protocol</a>
      </div>
      <div class="toc_topic">
        <a class="toc_link" href="">Telephone Networks</a>
      </div>
      <div class="toc_subtopic">
        <a class="toc_link" href="page23.xml">Overview</a>
      </div>
      <div class="toc_subtopic">
        <a class="toc_link" href="page25.xml">Routing Strategies</a>
      </div>
      <div class="toc_subtopic">
        <a class="toc_link" href="page26.xml">Costs</a>
      </div>
      <div class="toc_subtopic">
        <a class="toc_link" href="page27.xml">DNHR</a>
      </div>
      <div class="toc_topic">
        <a class="toc_link" href="">The Internet</a>
      </div>
      <div class="toc_subtopic">
        <a class="toc_link" href="page29.xml">Overview</a>
      </div>
      <div class="toc_subtopic">
        <a class="toc_link" href="page30.xml">Distance-Vector Routing</a>
      </div>
      <div class="toc_subtopic">
        <a class="toc_link" href="page33.xml">Link-State Routing</a>
      </div>
      <div class="toc_subtopic">
        <a class="toc_link" href="page37.xml">What's Next?</a>
      </div>
    </div>
    <div id="sectionbar">
      <div id="spacerright" class="spacerright">-</div>
      <div>
        <a href="page33.xml" class="sections">concepts</a>
      </div>
      <div>
        <a href="" class="sectionsgrayed">discover</a>
      </div>
      <div>
        <a href="page34.xml" class="sections">apply</a>
      </div>
      <div>
        <a href="page35.xml" class="sectionshighlighted">collaborate</a>
      </div>
      <div>
        <a href="" class="sectionsgrayed">practice</a>
      </div>
      <div id="spacerleft" class="spacerleft">-</div>
    </div>
    <div id="content"><h1>Link-State Routing</h1>
				<h2>Initial Sequence Numbers</h2>
				<p>
				The sequence-number strategy outlined on the previous page works well,
				except in a special situation:
				</p>
				<div class="box">
					
					<p>
					If a router restarts after a failure, what should the
					<b>initial</b> sequence number be for the LSPs it begins
					sending?
					</p>
					
				</div>
				<p>
				A restarted router will not remember the LSPs it sent in the past.  If
				an initial sequence number is incorrectly selected, it may send out
				new LSPs which will be ignored.
				</p>
				<p>
					For example, if a router
					<m:math>
						<m:mi>x</m:mi>
					</m:math>
					has in its database an LSP from router
					<m:math>
						<m:mi>y</m:mi>
					</m:math>
					with sequence number 10, and
					<m:math>
						<m:mi>y</m:mi>
					</m:math>,
					after a restart, chooses 0 as its initial sequence number,
					<m:math>
						<m:mi>x</m:mi>
					</m:math>
					will ignore new LSPs sent by
					<m:math>
						<m:mi>y</m:mi>
					</m:math>.
				</p>
				<h2>A Solution</h2>
				<p>
				A solution to this problem is called the <i>lollipop sequence
				space</i>.  The idea of this method is for a router to use, upon
				restart, a sequence number that is different from any sequence number
				that router could have used in the past.
				</p>
				<p>
				In this scheme, the sequence numbers used by routers are either
				negative, zero, or positive.  Upon a router's restart, it begins
				assigning the smallest possible <b>negative</b> sequence
				number to the LSPs it sends out. If
				<m:math><m:mi>N</m:mi></m:math>
				is the size of the range, this number will be
				<m:math>
					<m:mo>-</m:mo>
					<m:mi>N</m:mi>
					<m:mo>/</m:mo>
					<m:mn>2</m:mn>
				</m:math>
				(and the largest possible sequence number will be
				<m:math>
					<m:mi>N</m:mi>
					<m:mo>/</m:mo>
					<m:mn>2</m:mn>
					<m:mo>-</m:mo>
					<m:mn>1</m:mn>
				</m:math>).
				Subsequent LSPs are numbered
				<m:math>
					<m:mo>-</m:mo>
					<m:mfrac>
						<m:mi>N</m:mi>
						<m:mn>2</m:mn>
					</m:mfrac>
					<m:mo>+</m:mo>
					<m:mn>1</m:mn>
					<m:mo>,</m:mo>
					<m:mo>-</m:mo>
					<m:mfrac>
						<m:mi>N</m:mi>
						<m:mn>2</m:mn>
					</m:mfrac>
					<m:mo>+</m:mo>
					<m:mn>2</m:mn>
				</m:math>,
				and so on.
				</p>
				
				<p>
				When the sequence number becomes positive, the subsequent numbers
				&quot;wrap around&quot; in the &quot;circular&quot; part of the sequence space (as we saw
				on <a href="linkstate_apply.html">the previous
				page</a>).
				</p>
				
				<p>
				The new rule for comparing the &quot;age&quot; of LSPs is:
				</p>
				
				<div class="box">
					
					<p>
					If all LSP sequence numbers are in an interval of length
					<m:math><m:mi>N</m:mi></m:math>(
					<m:math>
						<m:mi>N</m:mi>
						<m:mo>=</m:mo>
						<m:msup>
							<m:mn>2</m:mn>
							<m:mn>32</m:mn>
						</m:msup>
					</m:math>
					in our example above), then the LSP with sequence number
					<m:math><m:mi>a</m:mi></m:math>
					is <b>older</b> than the LSP with sequence number
					<m:math><m:mi>b</m:mi></m:math>
					</p>
					<p>
					if
					<m:math>
						<m:mi>a</m:mi><m:mo>&lt;</m:mo><m:mn>0</m:mn>
					</m:math>
					and
					<m:math>
						<m:mi>a</m:mi><m:mo>&lt;</m:mo><m:mi>b</m:mi>
					</m:math>
					or
					<m:math>
						<m:mi>a</m:mi><m:mo>≥</m:mo><m:mn>0</m:mn>
					</m:math>,
					<m:math>
						<m:mi>a</m:mi><m:mo>&lt;</m:mo><m:mi>b</m:mi>
					</m:math>,
					and
					<m:math>
						<m:mfenced>
							<m:mrow>
							<m:mi>b</m:mi>
							<m:mo>-</m:mo>
							<m:mi>a</m:mi>
							</m:mrow>
						</m:mfenced>
						<m:mo>&gt;</m:mo>
						<m:mfrac>
							<m:mi>N</m:mi>
							<m:mn>4</m:mn>
						</m:mfrac>
					</m:math>
					</p>
					<p>
					or
					<m:math>
						<m:mi>a</m:mi>
						<m:mo>&gt;</m:mo>
						<m:mi>b</m:mi>
						<m:mo>≥</m:mo>
						<m:mn>0</m:mn>
					</m:math>,
					</p>
					<p>
					and
					<m:math>
						<m:mfenced>
							<m:mrow>
							<m:mi>a</m:mi>
							<m:mo>-</m:mo>
							<m:mi>b</m:mi>
							</m:mrow>
						</m:mfenced>
						<m:mo>&gt;</m:mo>
						<m:mfrac>
							<m:mi>N</m:mi>
							<m:mn>4</m:mn>
						</m:mfrac>
					</m:math>
					</p>
					
				</div>
			</div>
    <div id="nav">
      <a href="page34.xml" class="nav">back</a>
      <a href="page36.xml" class="nav">next</a>
    </div>
    <div class="copyright">
			Copyright 1999
			Rensselaer Polytechnic Institute. All Rights Reserved.
		</div>
  </body>
</html>
