📄 node287.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.1 The Interface to the Simulation Operator (The API)</TITLE><META NAME="description" CONTENT="26.1 The Interface to the Simulation Operator (The API)"><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="next" HREF="node290.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node290.html"><LINK REL="previous" HREF="node286.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node286.html"><LINK REL="up" HREF="node286.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node286.html"><LINK REL="next" HREF="node288.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node288.html"></HEAD><BODY ><!--Navigation Panel--><A NAME="tex2html5744" HREF="node288.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node288.html"><IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="file:/usr/share/latex2html/icons/next.png"></A> <A NAME="tex2html5738" HREF="node286.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node286.html"><IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="file:/usr/share/latex2html/icons/up.png"></A> <A NAME="tex2html5732" HREF="node286.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node286.html"><IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="file:/usr/share/latex2html/icons/prev.png"></A> <A NAME="tex2html5740" 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="tex2html5742" 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="tex2html5745" HREF="node288.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node288.html">26.1.0.0.1 Preference Assignment and</A><B> Up:</B> <A NAME="tex2html5739" HREF="node286.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node286.html">26. Unicast Routing</A><B> Previous:</B> <A NAME="tex2html5733" HREF="node286.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node286.html">26. Unicast Routing</A>   <B> <A NAME="tex2html5741" HREF="node1.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node1.html">Contents</A></B>   <B> <A NAME="tex2html5743" HREF="node590.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node590.html">Index</A></B> <BR><BR><!--End of Navigation Panel--><H1><A NAME="SECTION05110000000000000000"></A><A NAME="sec:API"></A><BR>26.1 The Interface to the Simulation Operator (The API)</H1><P>The user level simulation script requires one command:to specify the unicast routing strategy or protocols for the simulation.A routing strategy is a general mechanism by which will compute routes for the simulation.There are four routing strategies in :Static, Session, Dynamic and Manual.Conversely, a routing protocol is a realization of a specific algorithm.Currently, Static and Session routing usetheDijkstra's all-pairs SPF algorithm ../ns-2/route.ccRouteLogic::compute_routes;one type of dynamic routing strategy is currently implemented: theDistributed Bellman-Ford algorithm ../ns-2/route-proto.tclAgent/rtProto/DV::compute_routes.In , we blur the distinction between strategy and protocol forstatic and session routing, considering them simply as protocols<A NAME="tex2html54" HREF="footnode.html#foot11460" tppabs="http://www.isi.edu/nsnam/ns/doc/footnode.html#foot11460"><SUP>26.1</SUP></A>.<P>[]rtproto../ns-2/route-proto.tclSimulator::rtprotois the instance procedure in the Simulator../ns-2/ns-lib.tclthat specifies the unicast routing protocol to be used in the simulation.It takes multiple arguments, the first of which is mandatory;this first argument identifies the routing protocol to be used.Subsequent arguments specify the nodesthat will run the instance of this protocol.The default is to run the same routing protocolon all the nodes in the topology.As an example, the following commands illustrate the use of the[]rtproto command.<PRE> $ns rtproto Static # Enable static route strategy for the simulation; $ns rtproto Session # Enable session routing for this simulation; $ns rtproto DV $n1 $n2 $n3 # Run DV agents on nodes $n1, $n2, and $n3; $ns rtproto LS $n1 $n2 # Run link state routing on specified nodes;</PRE>If a simulation script does not specify any []rtproto command,then will run Static routing on all the nodes in the topology.<P>Multiple []rtproto lines for the same or different routing protocols can occur in a simulation script.However, a simulation cannot use bothcentralized routing mechanisms such as static or session routing and detailed dynamic routing protocols such as DV.<P>In dynamic routing, each node can be running more than one routing protocol.In such situations, more than one routing protocol can have a route to thesame destination.Therefore, each protocol affixes a preference value to each of its routes.These values are non-negative integers in the range 0...255.The lower the value, the more preferred the route.When multiple routing protocol agents have a route to the same destination,the most preferred route is chosen andinstalled in the node's forwarding tables.If more than one agent has the most preferred routes,the ones with the lowest metric is chosen.We call the least cost route from the most preferred protocol the``candidate'' route.If there are multiple candidate routes from the same or different protocols,then, currently,one of the agent's routes is randomly chosen<A NAME="tex2html55" HREF="footnode.html#foot11098" tppabs="http://www.isi.edu/nsnam/ns/doc/footnode.html#foot11098"><SUP>26.2</SUP></A>.<P><BR><HR><!--Table of Child-Links--><A NAME="CHILD_LINKS"><STRONG>Subsections</STRONG></A><UL><LI><UL><LI><UL><LI><A NAME="tex2html5746" HREF="node288.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node288.html">26.1.0.0.1 Preference Assignment and Control</A><LI><A NAME="tex2html5747" HREF="node289.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node289.html">26.1.0.0.2 Link Cost Assignment and Control</A></UL></UL></UL><!--End of Table of Child-Links--><HR><!--Navigation Panel--><A NAME="tex2html5744" HREF="node288.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node288.html"><IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="file:/usr/share/latex2html/icons/next.png"></A> <A NAME="tex2html5738" HREF="node286.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node286.html"><IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="file:/usr/share/latex2html/icons/up.png"></A> <A NAME="tex2html5732" HREF="node286.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node286.html"><IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="file:/usr/share/latex2html/icons/prev.png"></A> <A NAME="tex2html5740" 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="tex2html5742" 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="tex2html5745" HREF="node288.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node288.html">26.1.0.0.1 Preference Assignment and</A><B> Up:</B> <A NAME="tex2html5739" HREF="node286.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node286.html">26. Unicast Routing</A><B> Previous:</B> <A NAME="tex2html5733" HREF="node286.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node286.html">26. Unicast Routing</A>   <B> <A NAME="tex2html5741" HREF="node1.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node1.html">Contents</A></B>   <B> <A NAME="tex2html5743" 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 + -