<?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="sectionshighlighted">apply</a>
      </div>
      <div>
        <a href="page35.xml" class="sections">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>What Can Go Wrong?</h2>
				<p>
				The strategy (called <i>control flooding</i>) just described
				works fine when all routers and links function properly. However, the
				strategy may fail when some links and/or nodes go down, or simply
				<b>change</b> relative to the rest of the network.
				</p>
				<p>
				When something like this happens, how can knowledge of the change be
				propagated among all the nodes of the network?  Every router's LSP
				database will contain an obsolete LSP until routers are informed of
				the change in the network.
				</p>
				<h2>Sequence Numbers</h2>
				<p>
				One solution is to give every LSP a sequence number.
				</p>
				<p>
				If a router receives an LSP with a newer sequence number than that of
				an LSP in its database describing the same link, it will update its
				database with the new LSP.
				</p>
				<p>
				But, there's still a problem. The sequence numbers must be of finite
				length.  So, after a router has been on the network for a sufficient
				amount of time, the number of times it has sent out LSPs (incrementing
				the sequence numbers each time), the current sequence number will
				exceed the maximal number that can be represented.
				</p>
				<p>
				This will cause the number to &quot;wrap around&quot; back to 0 (assuming the
				valid range is a subset of the non-negative integers). As a result,
				new LSPs may have a <b>lower</b> sequence number, and
				will therefore &quot;look&quot; older to routers receiving them.
				</p>
				<p>
				For example, if sequence numbers are 32 bits long, they span the
				interval from 0 to 4,294,967,295 (inclusive). Then, after
				<m:math>
					<m:msup>
						<m:mn>2</m:mn>
						<m:mn>32</m:mn>
					</m:msup>
				</m:math> changes (a number reachable in a large,
				long-lived network), <b>no incoming LSP will ever replace a
				previous one in a router's database</b>.
				</p>
				<h2>Here's The Fix:</h2>
				<p>
				If the <b>difference</b> between the sequence numbers of
				an existing and an incoming LSP is very large, then assume that the
				LSP with the smaller number is actually <b>newer</b>,
				and must take the place of the existing LSP.
				</p>
				<p>
				Thus, the 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:mi>=</m:mi> 
						<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:mi>b</m:mi>
					</m:math>
					and
					<m:math>
						<m:mo>|</m:mo>
							<m:mi>b</m:mi>
							<m:mo>-</m:mo>
							<m:mi>a</m:mi>
						<m:mo>|</m:mo>
						<m:mo>&lt;</m:mo>
						<m:mfenced>
							<m:mi>N</m:mi>
							<m:mo>/</m:mo>
							<m:mn>2</m:mn>
						</m:mfenced>
					</m:math>
					</p>
					<p>
					or
					<m:math>
						<m:mi>a</m:mi>
						<m:mo>&gt;</m:mo>
						<m:mi>b</m:mi>
					</m:math>
					and
					<m:math>
						<m:mo>|</m:mo>
							<m:mi>b</m:mi>
							<m:mo>-</m:mo>
							<m:mi>a</m:mi>
						<m:mo>|</m:mo>
						<m:mo>&gt;</m:mo>
						<m:mfenced>
							<m:mi>N</m:mi>
							<m:mo>/</m:mo>
							<m:mn>2</m:mn>
						</m:mfenced>
					</m:math>
					</p>
					
				</div>
				
					<p><div class="problem"><a name="problem11"/><b>Problem
				11:
			</b><br/>
						
							<p>
								Can
								<m:math>
									<m:mfenced>
										<m:mi>N</m:mi>
										<m:mo>/</m:mo>
										<m:mn>2</m:mn>
									</m:mfenced>
								</m:math>
								in the condition above be replaced with a different
								number?  Such as
								<m:math>
									<m:mfenced>
										<m:mi>N</m:mi>
										<m:mo>/</m:mo>
										<m:mn>4</m:mn>
									</m:mfenced>
								</m:math>, or
								<m:math>
									<m:mfenced>
										<m:mn>3</m:mn>
										<m:mo>⁢</m:mo>
										<m:mi>N</m:mi>
										<m:mo>/</m:mo>
										<m:mn>4</m:mn>
									</m:mfenced>
								</m:math>?
							</p>
						
					</div></p>
				
			</div>
    <div id="nav">
      <a href="page33.xml" class="nav">back</a>
      <a href="page35.xml" class="nav">next</a>
    </div>
    <div class="copyright">
			Copyright 1999
			Rensselaer Polytechnic Institute. All Rights Reserved.
		</div>
  </body>
</html>
