Questions tagged [ns2]

Network Simulator version 2, more popularly known as ns-2, is an open source event driven network simulator. With ns-2 one can simulate a wide range of network environments in wired, wireless or even in mixed mode. Major networking standards, including Ethernet, WLAN, satellite networks, Bluetooth, and so on, are supported by ns-2.

Overview:

ns-2 is written in C++ and OTcl. An overview of its architecture can be found in NS by Example. To simulate a problem one has to write a TCL script, which is executed by the ns interpreter. After successful execution, a trace file is obtained, which can be processed to evaluate different network parameters.

Installation:

ns-2 can be installed both on Linux or Windows. However, for Windows you would be required to install Cygwin first. Details about installation can be found in The Network Simulator: Building Ns.

Useful links:

641 questions
0
votes
1 answer

how to access current queue size in NS2

i have simulated a 2 node tcp based communication with duplex link and queue in NS2 using TCL script. And i want to access the current queue size during communication of the nodes. so how can i access the current queue size and assign it into…
0
votes
1 answer

C++ undefined reference in ns2

Am modifying aodv protocol of ns2 in c++. Am getting error when i call a function rft_add. I will put the files here. Declaration file: aodv_rftable.h class aodv_rft_entry { friend class aodv_rftable; friend class AODV; …
-1
votes
1 answer

HOw to calculate the throughput from a trace file

for this command $ grep ^r lab3.tr | grep "2 6" -c | awk "{s+=$6}END{print s}" I am getting this error awk: line 1: syntax error at or near } and what does "h" stand for in the following line of trace file h 0.106 1 7 cbr 100 ------- 1 1.0 5.0 6 6
-1
votes
1 answer

I need some solution please

I am getting the following error message: Warning: Environment variable SUMO_HOME is not set, using built in type maps. Warning: Environment variable SUMO_HOME is not set, schema resolution will use slow website lookups. Error: unable to open file…
Jon Sid
  • 11
-1
votes
1 answer

How can I source a tcl file?

I created a tcl file in a directory and I want to source another tcl file located not in a same directory. The first file is in the /home/ubuntu/ns/ns-allinone-2.35/ns-2.35, the second one is in the…
-1
votes
1 answer

Can't run dymoum test_2n.tcl file on ns-2.35 in ubuntu14.04

After successfully applied /home/uday/ns-allinone-2.35/ns-2.35/DYMO-03-all__ns235.patch When i tried to run the following dymoum/ns/test/test_2n.tcl code it gives error and i can't solve that error .I tried my best but i failed ...Kindly anyone look…
-1
votes
1 answer

In NS-3, How to do you assign node id and how to retrive/display them in the terminal?

I want to display 20 nodes with its unique id. I have created 20 nodes using for loop with the following command. NodeContainer c; c.Create (20); int j; for(j = 0; j < 20; j++) { m.Install (c.Get(j)); } std::count << "Node Id: %d" << ???…
-1
votes
1 answer

writing proc avg in tcl script in NS2

I want to calculate avg of { energy_level ,number of nodes & traffic's data on nodes } by one mobile sink in the network with 5 static nodes. I have to calculate this avg with proc in tcl script code not with awk code. Please help me
m.h
  • 15
  • 8
-1
votes
1 answer

ns2 DSR.tcl code is not running giving some error

when i want to implemented file .tcl in ns2 appear an error, i couldn't solve this . i use ns2 version 2.34 in ubuntu 15. Please if anyone can help me to solve the error and run the .tcl code. my code is [code] set val(chan) …
badhan
  • 13
  • 1
-1
votes
1 answer

Failure when checking tcl

I am using ubuntu 14.04 and after adding some files for the integration of evalvid 2.7 and ns-2.35, i enter ./configure again from this directory: /home/user_name/Documents/ns-allinone-2.35/ns-2.35 I got this error: checking Tcl http.tcl…
jjfotso
  • 3
  • 1
-1
votes
1 answer

How to edit capacity or queue of wireless node in NS2?

I need to monitor packets dropping in ns2, but I can't figure out how to edit wireless node capacity. In wired simulations, we can set the capacity as follows: $ns_ queue-limit $n(0) $n(1) 5 #num of packets. but it doesn't work in wireless…
Eibo
  • 245
  • 2
  • 14
-1
votes
1 answer

How to pass by reference to function that won't accept new arguments?

I need to modify a parameter named test inside process_data and switch cases outside that function depending on test value. I couldn't pass it by reference using upvar because the process_data represent a static function for processing received…
Eibo
  • 245
  • 2
  • 14
-1
votes
1 answer

accessing a variable in another program (c++)

I am working on ns2.35 but i want to access a variable from a program connector.cc #include "packet.h" #include "connector.h" int attacker = 0; static class ConnectorClass : public TclClass { to aodv.cc #include extern int…
-1
votes
1 answer

ns modification and compiling error

i am working on ns-allinone-2.35 . and i modified the aodv protocol that located on /ns-allinone-2.35/ns-2.35/aodv folder. i do make clean , then make, every thing is ok. but i notice that no changing in the result. and i notice that if i change all…
-1
votes
1 answer

The network animator malfunctioning

I'm working on project called heterogeneous resource allocation using Network simulator 2.35...and i'm new to this simulator,the coding part is alright but i'm really troubled as i'm not getting to observe all the transmission of nodes properly as…