⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 node46.html

📁 相关搜索: ns2仿真结果分析 all-awk ns2 ns2 无限网络中awk文件 ... [2.tcl.rar] - 在ns2平台上实现对AODV协议的模拟
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<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.3 Node Configuration Interface</TITLE><META NAME="description" CONTENT="5.3 Node Configuration Interface"><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="node47.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node47.html"><LINK REL="previous" HREF="node41.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node41.html"><LINK REL="up" HREF="node39.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node39.html"><LINK REL="next" HREF="node47.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node47.html"></HEAD><BODY ><!--Navigation Panel--><A NAME="tex2html2026"  HREF="node47.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node47.html"><IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="file:/usr/share/latex2html/icons/next.png"></A> <A NAME="tex2html2020"  HREF="node39.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node39.html"><IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="file:/usr/share/latex2html/icons/up.png"></A> <A NAME="tex2html2014"  HREF="node45.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node45.html"><IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="file:/usr/share/latex2html/icons/prev.png"></A> <A NAME="tex2html2022"  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="tex2html2024"  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="tex2html2027"  HREF="node47.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node47.html">5.4 The Classifier</A><B> Up:</B> <A NAME="tex2html2021"  HREF="node39.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node39.html">5. Nodes and Packet</A><B> Previous:</B> <A NAME="tex2html2015"  HREF="node45.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node45.html">5.2.0.0.4 Tracking Neighbors</A> &nbsp <B>  <A NAME="tex2html2023"  HREF="node1.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node1.html">Contents</A></B>  &nbsp <B>  <A NAME="tex2html2025"  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="SECTION03230000000000000000"></A><A NAME="sec:node:nodeconfig"></A><BR>5.3 Node Configuration Interface</H1><P><!-- MATH $\framebox{  \begin{minipage}{\textwidth}    {\bf NOTE}: This API, especially its internal implementation which    is messy at this point, is still a moving target. It may undergo    significant changes in the near future. However, we will do our    best to maintain the same interface as described in this chapter.    In addition, this API currently does not cover all existing nodes    in the old format, namely, nodes built using inheritance, and    parts of mobile IP. It is principally oriented towards wireless    and satellite simulation.    [Sep 15, 2000; updated June 2001].  \end{minipage}}$ --><P>[]Simulator::node-config accommodates flexible and modularconstruction of different node definitions within the same base Nodeclass.For instance, to create a mobile node capableof wireless communication, one no longer needs a specialized nodecreation command, e.g., []dsdv-create-mobile-node; instead, onechanges default configuration parameters, such as  <PRE>$ns node-config -adhocRouting dsdv</PRE>before actually creating the node with the command: <TT>$ns node</TT>.Together with routing modules, this allowsone to combine ``arbitrary'' routing functionalities within a singlenode without resorting to multiple inheritance and other fancy objectgimmicks. We will describe this in more detail in Section&nbsp;<A HREF="node53.html#sec:node:rtarch" tppabs="http://www.isi.edu/nsnam/ns/doc/node53.html#sec:node:rtarch">5.5</A>.The functions and procedures relevant to the new node APIs may befound in tcl/lib/ns-node.tcl.<P>The node configuration interface consists of two parts. The first part deals with node configuration, while the second partactually creates nodes of the specified type. We have already seen the latter in Section&nbsp;<A HREF="node40.html#sec:node:simulator" tppabs="http://www.isi.edu/nsnam/ns/doc/node40.html#sec:node:simulator">5.1</A>,in this section we will describe the configuration part. <P>Node configuration essentially consists of defining the different nodecharacteristics before creating them. They may consist of the type ofaddressing structure used in the simulation, defining the networkcomponents for mobilenodes, turning on or off the trace options atAgent/Router/MAC levels, selecting the type of adhoc routing protocol forwireless nodes or defining their energy model.<P>As an example, node-configuration for a wireless, mobile node that runs AODV as itsadhoc routing protocol in a hierarchical topology would be as shown below.We decide to turn tracing on at the agent and router level only. Also we assume a topology has been instantiated with "set topo [new Topography]". The node-config command would look like the following:<P><PRE>  \$ns_ node-config -addressType hierarchical \bs                    -adhocRouting AODV \bs                   -llType LL \bs                   -macType Mac/802_11 \bs                    -ifqType Queue/DropTail/PriQueue \bs                   -ifqLen 50 \bs                   -antType Antenna/OmniAntenna \bs                    -propType Propagation/TwoRayGround \bs                   -phyType Phy/WirelessPhy \bs                   -topologyInstance \$topo \bs                   -channel Channel/WirelessChannel \bs                    -agentTrace ON \bs                    -routerTrace ON \bs                   -macTrace OFF \bs                   -movementTrace OFF</PRE><P>The default values for all the above options are NULL except <TT>-addressingType</TT>whose default value is flat. The option <TT>-reset</TT> can be used to reset allnode-config parameters to their default value.<P>Note that the config command can be broken down into separate lines like<PRE>        \$ns_ node-config -addressingType hier        \$ns_ node-config -macTrace ON</PRE>The options that need to be changed may only be called. For example afterconfiguring for AODV mobilenodes as shown above (and after creating AODVmobilenodes), we may configure for AODV base-station nodes in thefollowing way: <PRE>        \$ns_ node-config -wiredRouting ON</PRE>While all other features for base-station nodes and mobilenodes are same,the base-station nodes are capable of wired routing, while mobilenodes arenot. In this way we can change node-configuration only when it is required.<P>All node instances created after a given node-configuration command willhave the same property unless a part or all of the node-config command isexecuted with different parameter values. And all parameter values remainunchanged unless they are expicitly changed. So after creation of the AODVbase-station and mobilenodes, if we want to create simple nodes, we willuse the following node-configuration command:<PRE>        \$ns_ node-config -reset</PRE>This will set all parameter values to their default setting whichbasically defines configuration of a simple node.<P>Currently, this type of node configuration is oriented towards wirelessand satellite nodes.  Table 5.1lists the available optionsfor these kinds of nodes.  The example scripts tcl/ex/simple-wireless.tcl and tcl/ex/sat-mixed.tcl provideusage examples.<P><BR><P></P><DIV ALIGN="CENTER"><A NAME="1743"></A><TABLE><CAPTION><STRONG>Table 5.1:</STRONG>Available options for node configuration (see tcl/lib/ns-lib.tcl).</CAPTION><TR><TD><A NAME="table:nodeconfig"></A><DIV ALIGN="CENTER"><TABLE CELLPADDING=3 BORDER="1"><TR><TD ALIGN="LEFT"><FONT SIZE="-1"><B>option</B> </FONT></TD><TD ALIGN="LEFT"><FONT SIZE="-1"> </FONT><FONT SIZE="-1"><B>available values</B> </FONT></TD><TD ALIGN="LEFT"><FONT SIZE="-1"> </FONT><FONT SIZE="-1"><B>default</B></FONT></TD></TR><TR><TD ALIGN="CENTER" COLSPAN=3><FONT SIZE="-1">  

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -