📄 node173.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>16.1.1 Mobilenode: creating wireless topology</TITLE><META NAME="description" CONTENT="16.1.1 Mobilenode: creating wireless topology"><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="node174.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node174.html"><LINK REL="previous" HREF="node172.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node172.html"><LINK REL="up" HREF="node172.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node172.html"><LINK REL="next" HREF="node174.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node174.html"></HEAD><BODY ><!--Navigation Panel--><A NAME="tex2html3958" HREF="node174.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node174.html"><IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="file:/usr/share/latex2html/icons/next.png"></A> <A NAME="tex2html3952" HREF="node172.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node172.html"><IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="file:/usr/share/latex2html/icons/up.png"></A> <A NAME="tex2html3946" HREF="node172.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node172.html"><IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="file:/usr/share/latex2html/icons/prev.png"></A> <A NAME="tex2html3954" 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="tex2html3956" 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="tex2html3959" HREF="node174.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node174.html">16.1.2 Creating Node movements</A><B> Up:</B> <A NAME="tex2html3953" HREF="node172.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node172.html">16.1 The basic wireless</A><B> Previous:</B> <A NAME="tex2html3947" HREF="node172.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node172.html">16.1 The basic wireless</A>   <B> <A NAME="tex2html3955" HREF="node1.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node1.html">Contents</A></B>   <B> <A NAME="tex2html3957" HREF="node590.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node590.html">Index</A></B> <BR><BR><!--End of Navigation Panel--><H2><A NAME="SECTION031311000000000000000"></A><A NAME="sec:mobilenode-creation"></A><BR>16.1.1 Mobilenode: creating wireless topology</H2><P><TT>MobileNode</TT> is the basic <TT>Node</TT> object with addedfunctionalities like movement, ability to transmit and receive on achannel that allows it to be used to create mobile, wireless simulationenvironments. The class MobileNode is derived from the base class Node.<TT>MobileNode</TT> is a split object. The mobility features including nodemovement, periodic position updates, maintaining topology boundary etc areimplemented in C++ while plumbing of network components within<TT>MobileNode</TT> itself (like classifiers, dmux , LL, Mac, Channel etc)have been implemented in Otcl. The functions and procedures described inthis subsection can be found in mobilenode.{cc,h},tcl/lib/ns-mobilenode.tcl, tcl/mobility/dsdv.tcl,tcl/mobility/dsr.tcl, tcl/mobility/tora.tcl. Example scriptscan be found intcl/ex/wireless-test.tcl and tcl/ex/wireless.tcl. While thefirst example uses a small topology of 3 nodes, the second example runsover a topology of 50 nodes. These scripts can be run simply by typing<P><PRE>$ns tcl/ex/wireless.tcl (or /wireless-test.tcl)</PRE> <P>The four ad-hoc routing protocols that are currently supported are Destination Sequence Distance Vector (DSDV), Dynamic Source Routing(DSR), Temporally ordered Routing Algorithm (TORA) and Adhoc On-demandDistance Vector (AODV). The primitive to create a mobilenode is described below. Please note that the old APIs for creating a mobilenode depended on which routing protocol was used, like <PRE> set mnode [$opt(rp)-create-mobile-node $id]</PRE> where <PRE> $opt(rp)</PRE> defines "dsdv", "aodv", "tora" or "dsr" and id is the index for the mobilenode. But the old API's use is being deprecated and the new API is described as follows:.<P><PRE>$ns_ node-config -adhocRouting $opt(adhocRouting) -llType $opt(ll) -macType $opt(mac) -ifqType $opt(ifq) -ifqLen $opt(ifqlen) -antType $opt(ant) -propInstance [new $opt(prop)] -phyType $opt(netif) -channel [new $opt(chan)] -topoInstance $topo -wiredRouting OFF -agentTrace ON -routerTrace OFF -macTrace OFF</PRE> <P>The above API configures for a mobilenode with all the given values of adhoc-routing protocol, network stack, channel,topography, propagation model, with wired routing turned on or off (required for wired-cum-wireless scenarios) and tracing turned on or off at different levels (router, mac, agent). Incase hierarchical addressing is being used, the hier address of the node needs to be passed as well. For more info about this command (part of new node APIs) see chapter titled "Restructuring ns node and new Node APIs" in ns Notes and Documentation.<P>Next actually create the mobilenodes as follows:<PRE>for { set j 0 } { $j \< $opt(nn)} {incr j} { set node_($j) [ $ns_ node ] $node_($i) random-motion 0 ;# disable random motion}</PRE> <P>The above procedure creates a mobilenode (split)object, creates an adhoc-routing routing agent as specified, creates the network stack consisting of a link layer, interface queue, mac layer, and a network interface with an antenna, uses the defined propagation model, interconnects these components and connects the stack to the channel. The mobilenode now looks like the schematic in Figure <A HREF="node173.html#fig:mobilenode-dsdv" tppabs="http://www.isi.edu/nsnam/ns/doc/node173.html#fig:mobilenode-dsdv">16.1</A>. <DIV ALIGN="CENTER"><A NAME="fig:mobilenode-dsdv"></A><A NAME="6758"></A><TABLE><CAPTION ALIGN="BOTTOM"><STRONG>Figure:</STRONG>Schematic of a mobilenode under the CMU monarch's wireless extensions to </CAPTION><TR><TD><DIV ALIGN="CENTER">dsdv</DIV></TD></TR></TABLE></DIV><P>The mobilenode structure used for DSR routing is slightly different fromthe mobilenode described above. The class SRNode is derived from classMobileNode. SRNode doesnot use address demux or classifiers and allpackets received by the node are handed dow n to the DSR routing agent by default. The DSR routing agent eitherreceives pkts for itself by handing it over to the port dmux or forwardspkts as per source routes in the pkt hdr or sends out route requests androute replies for fresh packets. Details on DSR routing agent may be found in section <A HREF="node181.html#sec:dsr" tppabs="http://www.isi.edu/nsnam/ns/doc/node181.html#sec:dsr">16.1.5</A>. The schematicmodel for a SRNode is shown in Figure <A HREF="node173.html#fig:mobilenode-dsr" tppabs="http://www.isi.edu/nsnam/ns/doc/node173.html#fig:mobilenode-dsr">16.2</A>. <DIV ALIGN="CENTER"><A NAME="fig:mobilenode-dsr"></A><A NAME="6765"></A><TABLE><CAPTION ALIGN="BOTTOM"><STRONG>Figure:</STRONG>Schematic of a SRNode under the CMU monarch's wireless extensions to </CAPTION><TR><TD><DIV ALIGN="CENTER">dsr</DIV></TD></TR></TABLE></DIV><P><HR><!--Navigation Panel--><A NAME="tex2html3958" HREF="node174.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node174.html"><IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="file:/usr/share/latex2html/icons/next.png"></A> <A NAME="tex2html3952" HREF="node172.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node172.html"><IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="file:/usr/share/latex2html/icons/up.png"></A> <A NAME="tex2html3946" HREF="node172.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node172.html"><IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="file:/usr/share/latex2html/icons/prev.png"></A> <A NAME="tex2html3954" 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="tex2html3956" 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="tex2html3959" HREF="node174.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node174.html">16.1.2 Creating Node movements</A><B> Up:</B> <A NAME="tex2html3953" HREF="node172.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node172.html">16.1 The basic wireless</A><B> Previous:</B> <A NAME="tex2html3947" HREF="node172.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node172.html">16.1 The basic wireless</A>   <B> <A NAME="tex2html3955" HREF="node1.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node1.html">Contents</A></B>   <B> <A NAME="tex2html3957" 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 + -