📄 node312.html
字号:
<html><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><!--Converted with jLaTeX2HTML 2002 (1.62) JA patch-1.4patched version by: Kenshi Muto, Debian Project.LaTeX2HTML 2002 (1.62),original version by: Nikos Drakos, CBLU, University of Leeds* revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan* with significant contributions from: Jens Lippmann, Marek Rouchal, Martin Wilck and others --><HTML><HEAD><TITLE>26.5.0.0.4 DV Routing</TITLE><META NAME="description" CONTENT="26.5.0.0.4 DV Routing"><META NAME="keywords" CONTENT="everything"><META NAME="resource-type" CONTENT="document"><META NAME="distribution" CONTENT="global"><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"><META NAME="Generator" CONTENT="jLaTeX2HTML v2002 JA patch-1.4"><META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css"><LINK REL="STYLESHEET" HREF="everything.css" tppabs="http://www.isi.edu/nsnam/ns/doc/everything.css"><LINK REL="previous" HREF="node311.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node311.html"><LINK REL="up" HREF="node308.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node308.html"><LINK REL="next" HREF="node313.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node313.html"></HEAD><BODY ><!--Navigation Panel--><A NAME="tex2html6108" HREF="node313.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node313.html"><IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="file:/usr/share/latex2html/icons/next.png"></A> <A NAME="tex2html6102" HREF="node308.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node308.html"><IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="file:/usr/share/latex2html/icons/up.png"></A> <A NAME="tex2html6098" HREF="node311.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node311.html"><IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="file:/usr/share/latex2html/icons/prev.png"></A> <A NAME="tex2html6104" HREF="node1.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node1.html"><IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="file:/usr/share/latex2html/icons/contents.png"></A> <A NAME="tex2html6106" HREF="node590.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node590.html"><IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="file:/usr/share/latex2html/icons/index.png"></A> <BR><B> Next:</B> <A NAME="tex2html6109" HREF="node313.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node313.html">26.6 Unicast routing objects</A><B> Up:</B> <A NAME="tex2html6103" HREF="node308.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node308.html">26.5 Protocol Internals</A><B> Previous:</B> <A NAME="tex2html6099" HREF="node311.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node311.html">26.5.0.0.3 Session Routing</A>   <B> <A NAME="tex2html6105" HREF="node1.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node1.html">Contents</A></B>   <B> <A NAME="tex2html6107" HREF="node590.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node590.html">Index</A></B> <BR><BR><!--End of Navigation Panel--><H4><A NAME="SECTION05150040000000000000">26.5.0.0.4 DV Routing</A></H4>In a dynamic routing strategy, nodes send and receive messages,and compute the routes in the topology based on the messages exchanged.The procedure[]init-all../ns-2/route-proto.tclAgent/rtProto/DV::init-alltakes a list of nodes as the argument;the default is the list of nodes in the topology.At each of the nodes in the argument, the procedure starts thertObject../ns-2/route-proto.tcl and a Agent/rtProto/DV../ns-2/route-proto.tcl agents.It then determines the DV peers for each of the newly created DV agents,and creates the relevant <TT>rtPeer</TT> objects.<P>Theconstructor for the DV agent../ns-2/route-proto.tclAgent/rtProto/DV::initinitializes a number of instance variables;each agent stores an array, indexed by the destination node handle,of the preference and metric, the interface (or link) to the next hop,and the remote peer incident on the interface,for the best route to each destination computed by the agent.The agent creates these instance variables, and thenschedules sending its first update within the first0.5 seconds of simulation start.<P>Each agent stores the list of its peers indexed by the handleof the peer node.Each peer is a separate peer structure that holdsthe address of the peer agent, the metric and preferenceof the route to each destination advertised by that peer.We discuss the rtPeer structure laterwhen discuss the route architecture.The peer structures are initialized by the procedure[]add-peer../ns-2/route-proto.tclAgent/rtProto/DV::add-peerinvoked by []init-all.<P>The routine []send-periodic-update../ns-2/route-proto.tclAgent/rtProto/DV::send-periodic-updateinvokes []send-updates to send the actual updates.It then reschedules sending the next periodic updateafter <TT>advertInterval</TT> jittered slightly to avoidpossible synchronization effects.<P>[]send-updates../ns-2/route-proto.tclAgent/rtProto/DV::send-updateswill send updates to a select set of peers.If any of the routes at that node have changed, or for periodic updates,the procedure will send updates to all peers.Otherwise, if some incident links have just recovered,the procedure will send updates to the adjacent peers on those incidentlinks only.<P>[]send-updates uses the procedure[]send-to-peer../ns-2/route-proto.tclAgent/rtProto/DV::send-to-peerto send the actual updates.This procedure packages the update, taking thesplit-horizon and poison reverse mechanisms into account.It invokes the instproc-like,[]send-update (Note the singular case)../ns-2/rtProto.ccrtProtoDV::commandto send the actual update.The actual route update is stored in the class variable<TT>msg_</TT> indexed by a non-decreasing integer as index.The instproc-like only sends the index to <TT>msg_</TT> to the remote peer.This eliminates the need to convert from OTcl strings to alternate formatsand back.<P>When a peer receives a route update../ns-2/route-proto.tclAgent/rtProto/DV::recv-updateit first checks to determine if the update from differs from the previousones.The agent will compute new routes if the update contains new information.<P><HR><!--Navigation Panel--><A NAME="tex2html6108" HREF="node313.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node313.html"><IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="file:/usr/share/latex2html/icons/next.png"></A> <A NAME="tex2html6102" HREF="node308.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node308.html"><IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="file:/usr/share/latex2html/icons/up.png"></A> <A NAME="tex2html6098" HREF="node311.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node311.html"><IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="file:/usr/share/latex2html/icons/prev.png"></A> <A NAME="tex2html6104" HREF="node1.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node1.html"><IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="file:/usr/share/latex2html/icons/contents.png"></A> <A NAME="tex2html6106" HREF="node590.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node590.html"><IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="file:/usr/share/latex2html/icons/index.png"></A> <BR><B> Next:</B> <A NAME="tex2html6109" HREF="node313.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node313.html">26.6 Unicast routing objects</A><B> Up:</B> <A NAME="tex2html6103" HREF="node308.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node308.html">26.5 Protocol Internals</A><B> Previous:</B> <A NAME="tex2html6099" HREF="node311.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node311.html">26.5.0.0.3 Session Routing</A>   <B> <A NAME="tex2html6105" HREF="node1.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node1.html">Contents</A></B>   <B> <A NAME="tex2html6107" HREF="node590.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node590.html">Index</A></B> <!--End of Navigation Panel--><ADDRESS>2003-09-23</ADDRESS></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -