📄 components.html
字号:
<html><head><title>Network Components</title></head><body background="parchment.gif" tppabs="http://nile.wpi.edu/NS/Icons/parchment.gif" text="#000000" link="#0000FF"vlink="#000080" alink="#FF0000"><br><center><h2>Network Components</h2></center><br><br><dl><p>This section talks about the NS components, mostly compound networkcomponents. Figure 6 shows a partial OTcl class hierarchy of NS, whichwill help understanding the basic network components. For a completeNS class hierarchy, visit <ahref="javascript:if(confirm('http://www-sop.inria.fr/rodeo/personnel/Antoine.Clerget/ns \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://www-sop.inria.fr/rodeo/personnel/Antoine.Clerget/ns'" tppabs="http://www-sop.inria.fr/rodeo/personnel/Antoine.Clerget/ns"target=_top>http://www-sop.inria.fr/rodeo/personnel/Antoine.Clerget/ns</a>.</p><a name=fig6></a><p align="center"><img src="fig6.gif" tppabs="http://nile.wpi.edu/NS/Figure/fig6.gif"><br><br><b>Figure 6.</b> Class Hierarchy (Partial)</p><p>The root of the hierarchy is the TclObject class that is thesuperclass of all OTcl library objects (scheduler, network components,timers and the other objects including NAM related ones). As anancestor class of TclObject, NsObject class is the superclass of allbasic network component objects that handle packets, which may composecompound network objects such as nodes and links. The basic networkcomponents are further divided into two subclasses, Connector andClassifier, based on the number of the possible output data paths. Thebasic network objects that have only one output data path are underthe Connector class, and switching objects that have possible multipleoutput data paths are under the Classifier class. </p><li><b>Node and Routing</b></li><p>A node is a compound object composed of a node entry object andclassifiers as shown in Figure 7. There are two types of nodes inNS. A unicast node has an address classifier that does unicast routingand a port classifier. A multicast node, in addition, has a classifierthat classify multicast packets from unicast packets and a multicastclassifier that performs multicast routing. </p><p align="center"><img src="fig7.gif" tppabs="http://nile.wpi.edu/NS/Figure/fig7.gif"><br><br><b>Figure 7.</b> Node (Unicast and Multicast)</p><p>In NS, Unicast nodes are the default nodes. To create Multicastnodes the user must explicitly notify in the input OTcl script, rightafter creating a scheduler object, that all the nodes that will becreated are multicast nodes. After specifying the node type, the usercan also select a specific routing protocol other than using a defaultone.</p><ul><li><b>Unicast</b><br></li>- <font color=GREEN><I>$ns</I> rtproto <I>type</I></font><br>- <font color=GREEN><I>type</I></font>: Static, Session, DB, cost, multi-path <br> <li><b>Multicast</b><br></li>- <font color=GREEN><I>$ns</I> multicast</font> (right after <font color=GREEN>set <I>$ns</I> [new Scheduler]</font>)<br> - <font color=GREEN><I>$ns</I> mrtproto <I>type</I></font><br>- <font color=GREEN><I>type</I></font>: CtrMcast, DM, ST, BST</ul><p>For more information about routing, refer to the NS Manuallocated at <a href="javascript:if(confirm('http://www.isi.edu/nsnam/ns/ns-documentation.html \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://www.isi.edu/nsnam/ns/ns-documentation.html'" tppabs="http://www.isi.edu/nsnam/ns/ns-documentation.html"target=_top>http://www.isi.edu/nsnam/ns/ns-documentation.html</a>.The documentation has chapters talk about unicast and multicastrouting.</p> <li><b>Link</b></li><p> A link is another major compound object in NS. When a user createsa link using a <font color=GREEN>duplex-link</font> member function ofa Simulator object, two simplex links in both directions are createdas shown in Figure 8. </p><p align="center"><img src="fig8.gif" tppabs="http://nile.wpi.edu/NS/Figure/fig8.gif"><br><b>Figure 8.</b> Link</p><p>One thing to note is that an output queue of a node is actuallyimplemented as a part of simplex link object. Packets dequeued from aqueue are passed to the Delay object that simulates the link delay,and packets dropped at a queue are sent to a Null Agent and are freedthere. Finally, the TTL object calculates Time To Live parameters foreach packet received and updates the TTL field of the packet. </p><ul><li><b>Tracing</b></li><p>In NS, network activities are traced around simplex links. If thesimulator is directed to trace network activities (specified using<font color=GREEN><I>$ns</I> trace-all <I>file</I></font> or <fontcolor=GREEN><I>$ns</I> namtrace-all <I>file</I></font>), the linkscreated after the command will have the following trace objectsinserted as shown in Figure 9. Users can also specifically create atrace object of type <I>type</I> between the given <I>src</I> and<I>dst</I> nodes using the <font color=GREEN>create-trace {<I>typefile src dst</I>}</font> command.</p></ul><a name=fig9></a><p align="center"><img src="fig9.gif" tppabs="http://nile.wpi.edu/NS/Figure/fig9.gif"><br><b>Figure 9.</b> Inserting Trace Objects</p><ul><p>When each inserted trace object (i.e. EnqT, DeqT, DrpT and RecvT)receives a packet, it writes to the specified trace file withoutconsuming any simulation time, and passes the packet to the nextnetwork object. The trace format will be examined in the GeneralAnalysis Example section. </p><li><b>Queue Monitor</b></li><p>Basically, tracing objects are designed to record packet arrivaltime at which they are located. Although a user gets enoughinformation from the trace, he or she might be interested in what isgoing on inside a specific output queue. For example, a userinterested in RED queue behavior may want to measure the dynamics ofaverage queue size and current queue size of a specific RED queue(i.e. need for queue monitoring). Queue monitoring can be achievedusing queue monitor objects and snoop queue objects as shown in Figure10. </p></ul><p align="center"><img src="fig10.gif" tppabs="http://nile.wpi.edu/NS/Figure/fig10.gif"><br><br><b>Figure 10.</b> Monitoring Queue</p><ul><p>When a packet arrives, a snoop queue object notifies the queuemonitor object of this event. The queue monitor using this informationmonitors the queue. A RED queue monitoring example is shown in the REDQueue Monitor Example section. Note that snoop queue objects can beused in parallel with tracing objects even though it is not shown inthe above figure. </p></ul><li><b>Packet Flow Example</b></li><p>Until now, the two most important network components (node andlink) were examined. Figure 11 shows internals of an examplesimulation network setup and packet flow. The network consist of twonodes (n0 and n1) of which the network addresses are 0 and 1respectively. A TCP agent attached to n0 using port 0 communicateswith a TCP sink object attached to n1 port 0. Finally, an FTPapplication (or traffic source) is attached to the TCP agent, askingto send some amount of data. </p><p align="center"><img src="fig11.gif" tppabs="http://nile.wpi.edu/NS/Figure/fig11.gif"><br><br><b>Figure 11.</b> Packet Flow Example</p><p>Note that the above figure does not show the exact behavior of aFTP over TCP. It only shows the detailed internals of simulationnetwork setup and a packet flow.</p></dl></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -