12.07.2015 Views

The ns Manual (formerly ns Notes and Documentation)1 - NM Lab at ...

The ns Manual (formerly ns Notes and Documentation)1 - NM Lab at ...

The ns Manual (formerly ns Notes and Documentation)1 - NM Lab at ...

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Second, when dealing with r<strong>and</strong>omly gener<strong>at</strong>ed topologies, we may want to do layout autom<strong>at</strong>ically. An autom<strong>at</strong>ic graphlayout algorithm has been adapted <strong>and</strong> implemented. <strong>The</strong> basic idea of the algorithm is to model the graph as balls (nodes)connected by springs (links). Balls will repulse each other, while springs pull them together. This system will (hopefully)converge after some number of iter<strong>at</strong>io<strong>ns</strong>. In practice, after a small number of iter<strong>at</strong>io<strong>ns</strong> (te<strong>ns</strong> or hundreds), most smallto medium sized graphs will converge to a visually comprehe<strong>ns</strong>ible structure. Larger graphs may take a combin<strong>at</strong>ion ofautom<strong>at</strong>ic layout <strong>and</strong> h<strong>and</strong> placement to achieve an acceptable layout.<strong>The</strong>re are 3 parameters to tune the autom<strong>at</strong>ic layout process: Ca Attractive force co<strong>ns</strong>tant, which controls springs’s forcebetween balls. Cr Repulsive force co<strong>ns</strong>tant, which controls the repulsive force between balls. Number of iter<strong>at</strong>io<strong>ns</strong> Howmany times to run the autolayout procedure.For small topologies with te<strong>ns</strong> of nodes, using the default parameters (perhaps with 20 to 30 more iter<strong>at</strong>io<strong>ns</strong>) will suffice toproduce a nice layout. But for larger topology, careful parameter tuning is necessary. Following is a empirical method tolayout a 100 node r<strong>and</strong>om tra<strong>ns</strong>it stub topologygener<strong>at</strong>ed by Georgia Tech’s ITM internet topology modeler. First, set Ca <strong>and</strong>Cr to 0.2, do about 30 iter<strong>at</strong>io<strong>ns</strong>, then set Cr to 1.0, Ca to about 0.01, then do about 10 iter<strong>at</strong>io<strong>ns</strong>, then set Ca to 0.5, Cr to 1.0,do about 6 iter<strong>at</strong>io<strong>ns</strong>.Third, there is a x,y coordin<strong>at</strong>e style layout. This was developed for use in displaying a wireless topologies in which permanentlinks don’t exist. Using this style, nodes events are given x <strong>and</strong> y coordin<strong>at</strong>e values indic<strong>at</strong>ing where those nodes should beplaced in a cartesian world.45.7 Anim<strong>at</strong>ion ObjectsNam does anim<strong>at</strong>ion using the following building blocks which are defined below:Node Nodes are cre<strong>at</strong>ed from ’n’ trace event in trace file. It represents a source, host, or router. Nam will skip over anyduplic<strong>at</strong>e definitio<strong>ns</strong> for the same node. A node may have three shapes, (circle, square, <strong>and</strong> hexagon), but once cre<strong>at</strong>edit cannot change its shape. Nodes can change its color during anim<strong>at</strong>ion. Nodes can be labeled.Link Links are cre<strong>at</strong>ed between nodes to form a network topology. Internally nam links are co<strong>ns</strong>ist of 2 simplex links. <strong>The</strong>trace event ’l’ cre<strong>at</strong>es two simplex links <strong>and</strong> does other necessary setup. <strong>The</strong>refore, for a users perspective all links areduplex links. Links can be labeled <strong>and</strong> also can change color during the anim<strong>at</strong>ion. Links cab be labeled as well.Queue Queues need to be co<strong>ns</strong>tructed in nam between two nodes. A nam queue is associ<strong>at</strong>ed to only one edge of a duplexlink. Queues are visualized as stacked packets. Packets are stacked along a line, the angle between the line <strong>and</strong> thehorizontal line can be specified in the queue trace event.Packet Packets are visualized as a block with an arrow. <strong>The</strong> direction of the arrow shows the flow direction of the packet.Queued packets are shown as little squares. A packet may be dropped from a queue or a link. Dropped packets areshown as falling rot<strong>at</strong>ing squares, <strong>and</strong> disappear <strong>at</strong> the end of the screen. Unfortun<strong>at</strong>ely, due to nam’s design droppedpackets are not visible during backward anim<strong>at</strong>ion.Agent Agents are used to separ<strong>at</strong>e protocol st<strong>at</strong>es from nodes. <strong>The</strong>y are always associ<strong>at</strong>ed with nodes. An agent has a name,which is a unique identifier of the agent. It is shown as a square with its name i<strong>ns</strong>ide, <strong>and</strong> is drawn next to its associ<strong>at</strong>ednode.394

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!