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
1
vote
1 answer

Execution of simulation of scripts in ns2

i have installed ns2 and tcl on my desktop (fedora).When i try to run a simulation on nam1.14 it shows "could'nt execute ns :no such file or directory".When i try to run the tcl script it shows "bash:ns: command not found".Why is this happening? i…
Shashank
  • 11
  • 1
1
vote
1 answer

av_open_input_file returns -2 but file exists (libav in NS2)

I try to make a simulation in NS2 in which i read in .wav files, encodes into gsm and send them over the network. I already managed to make an application that reads in .wav, encodes into gsm and stores on the hard drive (tested, works fine). Now…
florencka
  • 61
  • 7
1
vote
1 answer

GUI programs in tcl. how to compile it in ns2?

When I tried to compile a program taken from internet proc demo {} { canvas .c -bg white frame .f button .f.c -text Clear -command {.c delete all} button .f.co -text Complete -command {showComplete .c} button .f.tr…
charu
  • 13
  • 2
1
vote
0 answers

NS2: Packets won't forward data

I modified the M-DART tcl file in NS2 to run multi-channels instead of single channel. I already assigned the sending and receiving nodes but the packets did not forwarded to the destination node. The only action is send, receive and dropping…
Emyr
  • 45
  • 5
1
vote
0 answers

NS 2: Skipping duplicate node

I modified the M-DART tcl files and when I run NS2 animation, it pops out this: Skipping duplicate node (1), etc... The modified script: ########################################### # Define…
Emyr
  • 45
  • 5
1
vote
1 answer

NS 2.35 segmentation fault (core dumped) when running MDART protocol

When I run MDART routing protocol tcl script in NS 2.35, it says: When configured, ns found the right version of tclsh in /usr/bin/tclsh8.6 but it doesn't seem to be there anymore, so ns will fall back on running the first tclsh in your path. The…
Emyr
  • 45
  • 5
1
vote
1 answer

Modififed MDART TCL does not recognize variable

I tried modifying M-DART TCL file from single channel to multi-channel while making sure DHT is still functioning and not applying multi-path protocol. The error that I get is as below: When configured, ns found the right version of tclsh in…
Emyr
  • 45
  • 5
1
vote
2 answers

Sconfig 0.00000 tap: on snoop: rts? on errs? on

I am working on a project in Mobile Ad Hoc Network(MANET) ,using ns.35 and when executing this code using DSR # Define options set val(chan) Channel/WirelessChannel ;# channel type set val(prop) Propagation/TwoRayGround ;#…
sally
  • 21
  • 2
1
vote
0 answers

Nodes with different energies

I am working on my project. It is about detection of selfish nodes depending on the energy of the node. Here I have 20 nodes of the same energy, then I added 5 more but with different energies. The program shows that output (as listed at the end of…
sally
  • 21
  • 2
1
vote
1 answer

Debugging symbols present, but eclipse does not associate them with source code

I am working on modifying a rather large program (NS2 network simulator), and it would be nice to be able to debug it with Eclipse. I configured the makefiles ( add -g to CFLAGS ) to make gcc generate the debugging symbols, and they are indeed…
Dmitri
  • 1,338
  • 1
  • 12
  • 24
1
vote
0 answers

Accessing NS2 packet header to get received data in a wireless network

I have an encryption protocol implemented in NS2 (Elliptic curve to be exact). I built a wireless network in TCL. The cc code encrypts the message that it got from the TCL then stores the encrypted data in a packet header and sends it to another…
1
vote
0 answers

Traffic steering NS2 LEACH protocol

I need to ask questions about LEACH If anyone can help please let me know. "I'm using LEACH script that generated by mannaaim." Q1: I need to know how is the cluster membership in LEACH? In other words, How can I know which nodes are belonging in…
1
vote
2 answers

NS2: How to set queue-limit for a node

I'm trying to simulate this network with NS2: and I have built the network like this #Create six nodes set n0 [$ns node] set n1 [$ns node] set n2 [$ns node] set n3 [$ns node] set n4 [$ns node] set n5 [$ns node] set recvr_delay1 [new…
Amin Bashiri
  • 198
  • 1
  • 2
  • 16
1
vote
0 answers

How to use the residual energy values inside the TCL script using NS2?

I am working on k-means algorithm and I need to elect CHs duo to the residual energy values. Is there such a way to extract the residual energy values while executing the TCL script, and simultaneously use these values while running the TCL script?…
1
vote
1 answer

Get code for Opportunistic routing in ns2

I want to simulate opportunistic routing protocol in ns2 . Does anyone know where can I get the code or atleast some reference to write code. I searched it but didn't find anything
joedenly
  • 383
  • 2
  • 5
  • 14