📄 node43.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>5.2.0.0.2 Address and Port number management</TITLE><META NAME="description" CONTENT="5.2.0.0.2 Address and Port number management"><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="node44.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node44.html"><LINK REL="previous" HREF="node42.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node42.html"><LINK REL="up" HREF="node41.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node41.html"><LINK REL="next" HREF="node44.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node44.html"></HEAD><BODY ><!--Navigation Panel--><A NAME="tex2html1986" HREF="node44.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node44.html"><IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="file:/usr/share/latex2html/icons/next.png"></A> <A NAME="tex2html1980" HREF="node41.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node41.html"><IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="file:/usr/share/latex2html/icons/up.png"></A> <A NAME="tex2html1974" HREF="node42.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node42.html"><IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="file:/usr/share/latex2html/icons/prev.png"></A> <A NAME="tex2html1982" 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="tex2html1984" 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="tex2html1987" HREF="node44.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node44.html">5.2.0.0.3 Agent management</A><B> Up:</B> <A NAME="tex2html1981" HREF="node41.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node41.html">5.2 Node Methods: Configuring</A><B> Previous:</B> <A NAME="tex2html1975" HREF="node42.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node42.html">5.2.0.0.1 Control functions</A>   <B> <A NAME="tex2html1983" HREF="node1.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node1.html">Contents</A></B>   <B> <A NAME="tex2html1985" 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="SECTION03220020000000000000">5.2.0.0.2 Address and Port number management</A></H4>The procedure <TT>$node id</TT> returns the node number of the node.This number is automatically incremented and assigned to each node atcreation by the class Simulator method, <TT>$ns node</TT>.The class Simulator also stores an instance variable array<A NAME="tex2html11" HREF="footnode.html#foot1614" tppabs="http://www.isi.edu/nsnam/ns/doc/footnode.html#foot1614"><SUP>5.1</SUP></A>, <TT>Node_</TT>, indexed by the node id, and contains a reference to the node with that id.<P>The procedure <TT>$node agent port</TT> returns the handle of theagent at the specified port.If no agent at the specified port number is available, the procedure returnsthe null string.<P>The procedure <TT>alloc-port</TT> returns the next available port number.It uses an instance variable, <TT>np_</TT>,to track the next unallocated port number.<P>The procedures, <TT>add-route</TT> and <TT>add-routes</TT>,are used by unicast routingChapterchap:unicastto add routes to populate the <TT>classifier_</TT>The usage syntax is<TT>$node add-route destination id TclObject</TT>. <TT>TclObject</TT> is the entry of <TT>dmux_</TT>, the port demultiplexerat the node, if the destination id is the same as this node's id,it is often the head of a link to send packets for that destination to,but could also be the the entry for other classifiers or types of classifiers.<P><TT>$node add-routes destination id TclObjects</TT> is used to add multiple routes to the same destination that must be usedsimultaneously in round robin manner to spread the bandwidth used to reachthat destination across all links equally.It is used only if the instance variable <TT>multiPath_</TT> is set to 1,and detailed dynamic routing strategies are in effect,and requires the use of a multiPath classifier.We describe the implementation of the multiPath classifierlater in this chapterSectionsec:node:classifiers;however, we defer the discussion of multipathroutingChapterchap:unicast to the chapter on unicast routing.<P>The dual of []add-routes is []delete-routes.It takes the id, a list of <TT>TclObjects</TT>, and a reference tothe simulator's <TT>nullagent</TT>.It removes the TclObjects in the list from the installed routes in themultipath classifier.If the route entry in the classifier does not point to a multipathclassifier,the routine simply clears the entry from <TT>classifier_</TT>, andinstalls the <TT>nullagent</TT> in its place.<P>Detailed dynamic routing also uses two additional methods:the instance procedure []init-routing sets the instance variable<TT>multiPath_</TT> to be equal to the class variable of the same name.It also adds a reference to the route controller object at that nodein the instance variable, <TT>rtObject_</TT>.The procedure []rtObject? returns the handle for the route object at the node.<P>Finally, the procedure []intf-changed is invoked bythe network dynamics code if a link incident on the nodechanges state. Additional details on how this procedureis used are discussed laterin the chapter on network dynamicsChapterchap:net-dynamics.<P><HR><!--Navigation Panel--><A NAME="tex2html1986" HREF="node44.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node44.html"><IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="file:/usr/share/latex2html/icons/next.png"></A> <A NAME="tex2html1980" HREF="node41.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node41.html"><IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="file:/usr/share/latex2html/icons/up.png"></A> <A NAME="tex2html1974" HREF="node42.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node42.html"><IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="file:/usr/share/latex2html/icons/prev.png"></A> <A NAME="tex2html1982" 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="tex2html1984" 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="tex2html1987" HREF="node44.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node44.html">5.2.0.0.3 Agent management</A><B> Up:</B> <A NAME="tex2html1981" HREF="node41.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node41.html">5.2 Node Methods: Configuring</A><B> Previous:</B> <A NAME="tex2html1975" HREF="node42.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node42.html">5.2.0.0.1 Control functions</A>   <B> <A NAME="tex2html1983" HREF="node1.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node1.html">Contents</A></B>   <B> <A NAME="tex2html1985" 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 + -