<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6017937802609628380</id><updated>2015-08-27T07:43:11.672-07:00</updated><category term="Ns2"/><category term="fedora 16"/><category term="ns2 example"/><title type='text'>NS2</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://ns2-code.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6017937802609628380/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://ns2-code.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Venkateshwaran Murugan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-xG_OIzZo3G0/AAAAAAAAAAI/AAAAAAAAAlI/zwtFaoMX8mU/s512-c/photo.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>2</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6017937802609628380.post-2011120734026912217</id><published>2015-08-25T07:22:00.003-07:00</published><updated>2015-08-25T07:24:06.139-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Ns2"/><category scheme="http://www.blogger.com/atom/ns#" term="ns2 example"/><title type='text'>NS2 Simple Simulation Example </title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;This section shows a simple NS simulation script and explains what each line does. Example 3 is an OTcl script that creates the simple network configuration and runs the simulation scenario. To run this simulation, copy the below code and save as&quot;&lt;a href=&quot;http://nile.wpi.edu/NS/Example/ns-simple.tcl&quot;&gt;ns-simple.tcl&lt;/a&gt;&quot; and type &quot;&lt;span style=&quot;color: green;&quot;&gt;ns ns-simple.tcl&lt;/span&gt;&quot; at your shell prompt.&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://3.bp.blogspot.com/-yiccAiookIU/Vdx6ZhZRyhI/AAAAAAAAAng/5DY5kbGClAE/s1600/fig4.gif&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;309&quot; src=&quot;http://3.bp.blogspot.com/-yiccAiookIU/Vdx6ZhZRyhI/AAAAAAAAAng/5DY5kbGClAE/s320/fig4.gif&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style=&quot;white-space: pre-wrap; word-wrap: break-word;&quot;&gt;#Create a simulator object&lt;br /&gt;set ns [new Simulator]&lt;br /&gt;&lt;br /&gt;#Define different colors for data flows (for NAM)&lt;br /&gt;$ns color 1 Blue&lt;br /&gt;$ns color 2 Red&lt;br /&gt;&lt;br /&gt;#Open the NAM trace file&lt;br /&gt;set nf [open out.nam w]&lt;br /&gt;$ns namtrace-all $nf&lt;br /&gt;&lt;br /&gt;#Define a &#39;finish&#39; procedure&lt;br /&gt;proc finish {} {&lt;br /&gt;        global ns nf&lt;br /&gt;        $ns flush-trace&lt;br /&gt;        #Close the NAM trace file&lt;br /&gt;        close $nf&lt;br /&gt;        #Execute NAM on the trace file&lt;br /&gt;        exec nam out.nam &amp;amp;&lt;br /&gt;        exit 0&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;#Create four nodes&lt;br /&gt;set n0 [$ns node]&lt;br /&gt;set n1 [$ns node]&lt;br /&gt;set n2 [$ns node]&lt;br /&gt;set n3 [$ns node]&lt;br /&gt;&lt;br /&gt;#Create links between the nodes&lt;br /&gt;$ns duplex-link $n0 $n2 2Mb 10ms DropTail&lt;br /&gt;$ns duplex-link $n1 $n2 2Mb 10ms DropTail&lt;br /&gt;$ns duplex-link $n2 $n3 1.7Mb 20ms DropTail&lt;br /&gt;&lt;br /&gt;#Set Queue Size of link (n2-n3) to 10&lt;br /&gt;$ns queue-limit $n2 $n3 10&lt;br /&gt;&lt;br /&gt;#Give node position (for NAM)&lt;br /&gt;$ns duplex-link-op $n0 $n2 orient right-down&lt;br /&gt;$ns duplex-link-op $n1 $n2 orient right-up&lt;br /&gt;$ns duplex-link-op $n2 $n3 orient right&lt;br /&gt;&lt;br /&gt;#Monitor the queue for link (n2-n3). (for NAM)&lt;br /&gt;$ns duplex-link-op $n2 $n3 queuePos 0.5&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;#Setup a TCP connection&lt;br /&gt;set tcp [new Agent/TCP]&lt;br /&gt;$tcp set class_ 2&lt;br /&gt;$ns attach-agent $n0 $tcp&lt;br /&gt;set sink [new Agent/TCPSink]&lt;br /&gt;$ns attach-agent $n3 $sink&lt;br /&gt;$ns connect $tcp $sink&lt;br /&gt;$tcp set fid_ 1&lt;br /&gt;&lt;br /&gt;#Setup a FTP over TCP connection&lt;br /&gt;set ftp [new Application/FTP]&lt;br /&gt;$ftp attach-agent $tcp&lt;br /&gt;$ftp set type_ FTP&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;#Setup a UDP connection&lt;br /&gt;set udp [new Agent/UDP]&lt;br /&gt;$ns attach-agent $n1 $udp&lt;br /&gt;set null [new Agent/Null]&lt;br /&gt;$ns attach-agent $n3 $null&lt;br /&gt;$ns connect $udp $null&lt;br /&gt;$udp set fid_ 2&lt;br /&gt;&lt;br /&gt;#Setup a CBR over UDP connection&lt;br /&gt;set cbr [new Application/Traffic/CBR]&lt;br /&gt;$cbr attach-agent $udp&lt;br /&gt;$cbr set type_ CBR&lt;br /&gt;$cbr set packet_size_ 1000&lt;br /&gt;$cbr set rate_ 1mb&lt;br /&gt;$cbr set random_ false&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;#Schedule events for the CBR and FTP agents&lt;br /&gt;$ns at 0.1 &quot;$cbr start&quot;&lt;br /&gt;$ns at 1.0 &quot;$ftp start&quot;&lt;br /&gt;$ns at 4.0 &quot;$ftp stop&quot;&lt;br /&gt;$ns at 4.5 &quot;$cbr stop&quot;&lt;br /&gt;&lt;br /&gt;#Detach tcp and sink agents (not really necessary)&lt;br /&gt;$ns at 4.5 &quot;$ns detach-agent $n0 $tcp ; $ns detach-agent $n3 $sink&quot;&lt;br /&gt;&lt;br /&gt;#Call the finish procedure after 5 seconds of simulation time&lt;br /&gt;$ns at 5.0 &quot;finish&quot;&lt;br /&gt;&lt;br /&gt;#Print CBR packet size and interval&lt;br /&gt;puts &quot;CBR packet size = [$cbr set packet_size_]&quot;&lt;br /&gt;puts &quot;CBR interval = [$cbr set interval_]&quot;&lt;br /&gt;&lt;br /&gt;#Run the simulation&lt;br /&gt;$ns run&lt;br /&gt;&lt;/pre&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This network consists of 4 nodes (n0, n1, n2, n3) as shown in above figure. The duplex links between n0 and n2, and n1 and n2 have 2 Mbps of bandwidth and 10 ms of delay. The duplex link between n2 and n3 has 1.7 Mbps of bandwidth and 20 ms of delay. Each node uses a DropTail queue, of which the maximum size is 10. A &quot;tcp&quot; agent is attached to n0, and a connection is established to a tcp &quot;sink&quot; agent attached to n3. As default, the maximum size of a packet that a &quot;tcp&quot; agent can generate is 1KByte. A tcp &quot;sink&quot; agent generates and sends ACK packets to the sender (tcp agent) and frees the received packets. A &quot;udp&quot; agent that is attached to n1 is connected to a &quot;null&quot; agent attached to n3. A &quot;null&quot; agent just frees the packets received. A &quot;ftp&quot; and a &quot;cbr&quot; traffic generator are attached to &quot;tcp&quot; and &quot;udp&quot; agents respectively, and the &quot;cbr&quot; is configured to generate 1 KByte packets at the rate of 1 Mbps. The &quot;cbr&quot; is set to start at 0.1 sec and stop at 4.5 sec, and &quot;ftp&quot; is set to start at 1.0 sec and stop at 4.0 sec&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The following is the explanation of the script above. In general, an NS script starts with making a Simulator object instance.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;color: green;&quot;&gt;set&amp;nbsp;&lt;i&gt;ns&lt;/i&gt;&amp;nbsp;[new Simulator]&lt;/span&gt;: generates an NS simulator object instance, and assigns it to variable&amp;nbsp;&lt;i&gt;ns&lt;/i&gt;&amp;nbsp;(italics is used for variables and values in this section). What this line does is the following:&lt;br /&gt;&amp;nbsp;&lt;/li&gt;&lt;ul&gt;&lt;li&gt;Initialize the packet format (ignore this for now)&lt;/li&gt;&lt;li&gt;Create a scheduler (default is calendar scheduler)&lt;/li&gt;&lt;li&gt;Select the default address format (ignore this for now)&lt;br /&gt;&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;The &quot;Simulator&quot; object has member functions that do the following:&lt;br /&gt;&amp;nbsp;&lt;ul&gt;&lt;li&gt;Create compound objects such as nodes and links (described later)&lt;/li&gt;&lt;li&gt;Connect network component objects created (ex. attach-agent)&lt;/li&gt;&lt;li&gt;Set network component parameters (mostly for compound objects)&lt;/li&gt;&lt;li&gt;Create connections between agents (ex. make connection between a &quot;tcp&quot; and &quot;sink&quot;)&lt;/li&gt;&lt;li&gt;Specify NAM display options&lt;/li&gt;&lt;li&gt;Etc.&lt;br /&gt;&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;Most of member functions are for simulation setup (referred to as plumbing functions in the Overview section) and scheduling, however some of them are for the NAM display. The &quot;Simulator&quot; object member function implementations are located in the &quot;&lt;span style=&quot;color: red;&quot;&gt;ns-2/tcl/lib/ns-lib.tcl&lt;/span&gt;&quot; file.&lt;br /&gt;&amp;nbsp; &lt;li&gt;&lt;span style=&quot;color: green;&quot;&gt;&lt;i&gt;$ns&lt;/i&gt;&amp;nbsp;color&amp;nbsp;&lt;i&gt;fid color&lt;/i&gt;&lt;/span&gt;: is to set color of the packets for a flow specified by the flow id (fid). This member function of &quot;Simulator&quot; object is for the NAM display, and has no effect on the actual simulation.&lt;br /&gt;&amp;nbsp;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;color: green;&quot;&gt;&lt;i&gt;$ns&lt;/i&gt;&amp;nbsp;namtrace-all&amp;nbsp;&lt;i&gt;file-descriptor&lt;/i&gt;&lt;/span&gt;: This member function tells the simulator to record simulation traces in NAM input format. It also gives the file name that the trace will be written to later by the command&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;&lt;i&gt;$ns&lt;/i&gt;&amp;nbsp;flush-trace&lt;/span&gt;. Similarly, the member function&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;trace-all&lt;/span&gt;&amp;nbsp;is for recording the simulation trace in a general format.&lt;br /&gt;&amp;nbsp;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;color: green;&quot;&gt;proc&amp;nbsp;&lt;i&gt;finish&lt;/i&gt;&amp;nbsp;{}&lt;/span&gt;: is called after this simulation is over by the command&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;&lt;i&gt;$ns&lt;/i&gt;&amp;nbsp;at 5.0 &quot;&lt;i&gt;finish&lt;/i&gt;&quot;&lt;/span&gt;. In this function, post-simulation processes are specified.&lt;br /&gt;&amp;nbsp;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;color: green;&quot;&gt;set&amp;nbsp;&lt;i&gt;n0&lt;/i&gt;&amp;nbsp;[&lt;i&gt;$ns&lt;/i&gt;&amp;nbsp;node]&lt;/span&gt;: The member function&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;node&lt;/span&gt;&amp;nbsp;creates a node. A node in NS is compound object made of address and port classifiers (described in a later section). Users can create a node by separately creating an address and a port classifier objects and connecting them together. However, this member function of Simulator object makes the job easier. To see how a node is created, look at the files: &quot;&lt;span style=&quot;color: red;&quot;&gt;ns-2/tcl/libs/ns-lib.tcl&lt;/span&gt;&quot; and &quot;&lt;span style=&quot;color: red;&quot;&gt;ns-2/tcl/libs/ns-node.tcl&lt;/span&gt;&quot;.&lt;br /&gt;&amp;nbsp;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;color: green;&quot;&gt;&lt;i&gt;$ns&lt;/i&gt;&amp;nbsp;duplex-link&amp;nbsp;&lt;i&gt;node1 node2 bandwidth delay queue-type&lt;/i&gt;&lt;/span&gt;: creates two simplex links of specified bandwidth and delay, and connects the two specified nodes. In NS, the output queue of a node is implemented as a part of a link, therefore users should specify the queue-type when creating links. In the above simulation script, DropTail queue is used. If the reader wants to use a RED queue, simply replace the word DropTail with RED. The NS implementation of a link is shown in a later section. Like a node, a link is a compound object, and users can create its sub-objects and connect them and the nodes. Link source codes can be found in &quot;&lt;span style=&quot;color: red;&quot;&gt;ns-2/tcl/libs/ns-lib.tcl&lt;/span&gt;&quot; and &quot;&lt;span style=&quot;color: red;&quot;&gt;ns-2/tcl/libs/ns-link.tcl&lt;/span&gt;&quot; files. One thing to note is that you can insert error modules in a link component to simulate a lossy link (actually users can make and insert any network objects). Refer to the NS documentation to find out how to do this.&lt;br /&gt;&amp;nbsp;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;color: green;&quot;&gt;&lt;i&gt;$ns&lt;/i&gt;&amp;nbsp;queue-limit&amp;nbsp;&lt;i&gt;node1 node2 number&lt;/i&gt;&lt;/span&gt;: This line sets the queue limit of the two simplex links that connect node1 and node2 to the number specified. At this point, the authors do not know how many of these kinds of member functions of Simulator objects are available and what they are. Please take a look at &quot;&lt;span style=&quot;color: red;&quot;&gt;ns-2/tcl/libs/ns-lib.tcl&lt;/span&gt;&quot; and &quot;&lt;span style=&quot;color: red;&quot;&gt;ns-2/tcl/libs/ns-link.tcl&lt;/span&gt;&quot;, or NS documentation for more information.&lt;br /&gt;&amp;nbsp;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;color: green;&quot;&gt;&lt;i&gt;$ns&lt;/i&gt;&amp;nbsp;duplex-link-op&amp;nbsp;&lt;i&gt;node1 node2 ...&lt;/i&gt;&lt;/span&gt;: The next couple of lines are used for the NAM display. To see the effects of these lines, users can comment these lines out and try the simulation.&lt;/li&gt;&lt;/ul&gt;Now that the basic network setup is done, the next thing to do is to setup traffic agents such as TCP and UDP, traffic sources such as FTP and CBR, and attach them to nodes and agents respectively.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;color: green;&quot;&gt;set&amp;nbsp;&lt;i&gt;tcp&lt;/i&gt;&amp;nbsp;[new&amp;nbsp;&lt;i&gt;Agent/TCP&lt;/i&gt;]&lt;/span&gt;: This line shows how to create a TCP agent. But in general, users can create any agent or traffic sources in this way. Agents and traffic sources are in fact basic objects (not compound objects), mostly implemented in C++ and linked to OTcl. Therefore, there are no specific Simulator object member functions that create these object instances. To create agents or traffic sources, a user should know the class names these objects (Agent/TCP, Agnet/TCPSink, Application/FTP and so on). This information can be found in the NS documentation or partly in this documentation. But one shortcut is to look at the &quot;&lt;span style=&quot;color: red;&quot;&gt;ns-2/tcl/libs/ns-default.tcl&lt;/span&gt;&quot; file. This file contains the default configurable parameter value settings for available network objects. Therefore, it works as a good indicator of what kind of network objects are available in NS and what are the configurable parameters.&lt;br /&gt;&amp;nbsp;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;color: green;&quot;&gt;&lt;i&gt;$ns&lt;/i&gt;&amp;nbsp;attach-agent&amp;nbsp;&lt;i&gt;node agent&lt;/i&gt;&lt;/span&gt;: The&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;attach-agent&lt;/span&gt;&amp;nbsp;member function attaches an agent object created to a node object. Actually, what this function does is call the&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;attach&lt;/span&gt;&amp;nbsp;member function of specified node, which attaches the given agent to itself. Therefore, a user can do the same thing by, for example,&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;$n0 attach $tcp&lt;/span&gt;. Similarly, each agent object has a member function&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;attach-agent&lt;/span&gt;&amp;nbsp;that attaches a traffic source object to itself.&lt;br /&gt;&amp;nbsp;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;color: green;&quot;&gt;&lt;i&gt;$ns&lt;/i&gt;&amp;nbsp;connect&amp;nbsp;&lt;i&gt;agent1 agent2&lt;/i&gt;&lt;/span&gt;: After two agents that will communicate with each other are created, the next thing is to establish a logical network connection between them. This line establishes a network connection by setting the destination address to each others&#39; network and port address pair.&lt;/li&gt;&lt;/ul&gt;Assuming that all the network configuration is done, the next thing to do is write a simulation scenario (i.e. simulation scheduling). The Simulator object has many scheduling member functions. However, the one that is mostly used is the following:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;color: green;&quot;&gt;&lt;i&gt;$ns&lt;/i&gt;&amp;nbsp;at&amp;nbsp;&lt;i&gt;time &quot;string&quot;&lt;/i&gt;&lt;/span&gt;: This member function of a Simulator object makes the scheduler (scheduler_ is the variable that points the scheduler object created by [new Scheduler] command at the beginning of the script) to schedule the execution of the specified string at given simulation time. For example,&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;&lt;i&gt;$ns&lt;/i&gt;&amp;nbsp;at&amp;nbsp;&lt;i&gt;0.1 &quot;$cbr start&quot;&lt;/i&gt;&lt;/span&gt;&amp;nbsp;will make the scheduler call a&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;start&lt;/span&gt;&amp;nbsp;member function of the CBR traffic source object, which starts the CBR to transmit data. In NS, usually a traffic source does not transmit actual data, but it notifies the underlying agent that it has some amount of data to transmit, and the agent, just knowing how much of the data to transfer, creates packets and sends them.&lt;/li&gt;&lt;/ul&gt;After all network configuration, scheduling and post-simulation procedure specifications are done, the only thing left is to run the simulation. This is done by&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;&lt;i&gt;$ns&lt;/i&gt;&amp;nbsp;run&lt;/span&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ns2-code.blogspot.com/feeds/2011120734026912217/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ns2-code.blogspot.com/2015/08/ns2-simple-simulation-example.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6017937802609628380/posts/default/2011120734026912217'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6017937802609628380/posts/default/2011120734026912217'/><link rel='alternate' type='text/html' href='http://ns2-code.blogspot.com/2015/08/ns2-simple-simulation-example.html' title='NS2 Simple Simulation Example '/><author><name>Venkateshwaran Murugan</name><uri>https://plus.google.com/116936154309042194491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-xG_OIzZo3G0/AAAAAAAAAAI/AAAAAAAAAlI/zwtFaoMX8mU/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-yiccAiookIU/Vdx6ZhZRyhI/AAAAAAAAAng/5DY5kbGClAE/s72-c/fig4.gif" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6017937802609628380.post-7453739108735182519</id><published>2012-02-29T19:16:00.001-08:00</published><updated>2015-08-25T07:33:01.686-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="fedora 16"/><category scheme="http://www.blogger.com/atom/ns#" term="Ns2"/><title type='text'>Ns2-installation process in fedora-16</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;b&gt;Step:1&lt;/b&gt; &amp;nbsp;&amp;nbsp; open terminal as admin.&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; # su&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; It will ask password. &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;Pre-Installation: Before NS2 installation some packages must be&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; installed. Required packages are:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;b&gt;yum install gcc tcl-devel libX11-devel libXt-devel autoconf &lt;/b&gt;automake libXmu-devel&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Step : 2&lt;/b&gt; Uncompress the ns2 use GUI or Terminal &lt;br /&gt;&amp;gt; &lt;b&gt;tar zxvf ns-allinone-2.34.tar.gz&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;/b&gt;&lt;b&gt;&amp;gt; cd /home/username/Desktop/ns-allinone-2.34&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;/b&gt;&lt;b&gt;&amp;gt; ./install (execute the script)&lt;/b&gt;&lt;br /&gt;&amp;gt; If the installation fails in the middle, then try to install the linux packages that are missing&lt;br /&gt;&amp;gt; Once the installation succeeded, then a set of path information will be provided by the NS2 &lt;br /&gt;&amp;gt; Set the path in the /root/.bash_profile&lt;br /&gt;(vi /root/.bash_profile)&lt;br /&gt;or&lt;br /&gt;If you are a user home//.bash_profile &lt;br /&gt;&lt;b&gt;vi /home/username/.bash_profile&lt;/b&gt;&lt;br /&gt;# User specific aliases and functions&lt;br /&gt;# LD_LIBRARY_PATH&lt;br /&gt;OTCL_LIB=/home/username/Desktop/Study/ns-allinone-2.34/otcl-1.13&lt;br /&gt;NS2_LIB=/home/username/Desktop/Study/ns-allinone-2.34/lib&lt;br /&gt;export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OTCL_LIB:$NS2_LIB&lt;br /&gt;# TCL_LIBRARY&lt;br /&gt;TCL_LIB=/home/username/Desktop/Study/ns-allinone-2.34/tcl8.4.18/library&lt;br /&gt;USR_LIB=/usr/lib&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Step : 3 &lt;/b&gt;export TCL_LIBRARY=$TCL_LIB:$USR_LIB&lt;br /&gt;# PATH&lt;br /&gt;XGRAPH=/home/username/Desktop/Study/ns-allinone-2.34/bin:/home/username/Desktop/Study/ns-allinone-2.34/tcl8.4.18/unix:/home/username/Desktop/Study/ns-allinone-2.34/tk8.4.14/unix&lt;br /&gt;NS=/home/username/Desktop/Study/ns-allinone-2.34/ns-2.34/&lt;br /&gt;NAM=/home/username/Desktop/Study/ns-allinone-2.34/nam-1.14/&lt;br /&gt;PATH=$PATH:$XGRAPH:$NS:$NAM&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Step 4 :&lt;/b&gt;&amp;gt; go to the terminal and try ns or nam&lt;br /&gt;&amp;gt; for running the examples comes along with the distribution of NS2&lt;br /&gt;cd ns-allinone-2.34/ns-2.34/tcl/ex&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Step 5 :&lt;/b&gt;After these steps, you can now run the ns validation suite with&lt;br /&gt;cd ns-2.34;&lt;b&gt; ./validate&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ns2-code.blogspot.com/feeds/7453739108735182519/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ns2-code.blogspot.com/2012/02/ns2-instaiiation-process-in-fedora-16.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6017937802609628380/posts/default/7453739108735182519'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6017937802609628380/posts/default/7453739108735182519'/><link rel='alternate' type='text/html' href='http://ns2-code.blogspot.com/2012/02/ns2-instaiiation-process-in-fedora-16.html' title='Ns2-installation process in fedora-16'/><author><name>Venkateshwaran Murugan</name><uri>https://plus.google.com/116936154309042194491</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-xG_OIzZo3G0/AAAAAAAAAAI/AAAAAAAAAlI/zwtFaoMX8mU/s512-c/photo.jpg'/></author><thr:total>1</thr:total></entry></feed>