error while adding a new protocol in ns2

985 views
Skip to first unread message

Vishu Chaudhary

unread,
Sep 17, 2015, 5:38:49 AM9/17/15
to Network Simulator 2 (NS2)
invalid command name "Agent/Security_packet"
    while executing
"Agent/Security_packet instproc recv {from rtt mess originmess hash} {
    $self instvar node_
    puts "node [$node_ id] received packet from \
           ..."
    (file "first.tcl" line 95)

knudfl

unread,
Sep 17, 2015, 7:57:04 AM9/17/15
to Network Simulator 2 (NS2)
Hi .

Security, please read ....
https://groups.google.com/forum/?fromgroups#!searchin/ns-users/security|sort:date/ns-users/7rTy9mErvoY/lmQXWaFAhBYJ
→ → Your error :  »» invalid command name "Agent/Security_packet" «« :
.....  Very simple :  You are using an executable 'ns'  with no "security".
http://www.linuxquestions.org/questions/linux-software-2/ns2-script-issue-4175479297/#7
http://www.linuxquestions.org/questions/tags/security-ns2/

Build example :
$ tar xvf ns-allinone-2.35_gcc482.tar.gz
https
://drive.google.com/file/d/0B7S255p3kFXNSGJCZ2YzUGJDVk0/view?usp=sharing
$ cd ns
-allinone-2.35/
$ patch
-p0 < security_ns235.patch
https
://drive.google.com/file/d/0B7S255p3kFXNZFNxcnppMDN4R2M/view?usp=sharing
$
./install
$ cd ns
-2.35/
$ sudo make install
$ cp ns ns235
-security (This is your backup, and "recognizable security ns")
$ sudo cp ns235
-security /usr/local/bin/
Simulation :
$ cd security
/
$
ns235-security security.tcl : Perfect.
( Or  $ ../ns security.tcl )

-

Nidhi Chhajed

unread,
Oct 17, 2015, 10:59:44 AM10/17/15
to Network Simulator 2 (NS2)
Hii,
After making changes in files in file from the link http://all-time-ns-2.blogspot.in/2010/10/adding-new-routing-protocol-in-ns-2.html, I get an error message while executing make clean command
"nidhi@nidhi-Inspiron-3542:~/ns-allinone-2.35/ns-2.35$ make clean
Makefile:337: *** commands commence before first target.  Stop.
"
what should I do for resolving the problem?
I am attaching Makefile file along with this mail. Please do the needful. Also in which file I have to make changes, in Makefile or in Makefile.in.
In the attached file, I added code
"draodv/draodv_logs.o draodv/draodv.o \
    draodv/draodv_rtable.o draodv/draodv_rqueue.o \"

 in line number 278 & 279.

Thank you
Makefile.in

knudfl

unread,
Oct 17, 2015, 12:01:18 PM10/17/15
to Network Simulator 2 (NS2)
@Nidhi Chhajed ,   Hi.

Makefile.in :  In a section like "OBJ_CC", the lines / objects.o are entered this way :
<TAB>folder/obj-a.o folder/obj-a.o \
<TAB>folder/obj-c.o folder/obj-c.o \

No spaces instead of the <TAB>, no <linefeed> between lines are allowed.
No <TAB> followed by empty space is allowed.
And no <space> after a backslash ( \ ) is allowed.

Your lines 278 - 281 ( with an issue ?) :
<TAB>draodv/draodv_logs.o draodv/draodv.o \
<TAB>draodv/draodv_rtable.o draodv/draodv_rqueue.o \
<TAB>
<TAB>aomdv/aomdv_logs.o aomdv/aomdv.o \
( And there is a "space issue" with lines 304 - 311 )

Must be :
<TAB>draodv/draodv_logs.o draodv/draodv.o \
<TAB>draodv/draodv_rtable.o draodv/draodv_rqueue.o \
<TAB>aomdv/aomdv_logs.o aomdv/aomdv.o \

.....  The edited Makefile.in is attached as Makefile.in-edited.txt .

*********************************************************************************
Your question is actually about the old existing Makefile, not the Makefile.in .

HOWTO 'make clean' :
Run ./install in the top directory, ns-allinone-2.35, and a new Makefile is created in ns-2.35/.
Then you can do $ cd ns-2.35/ && make clean
.... And you can go back to the top directory, ns-allinone-2.35, and run ./install
 
*********************************************************************************
-
Makefile.in-edited.txt

knudfl

unread,
Oct 17, 2015, 12:04:19 PM10/17/15
to Network Simulator 2 (NS2)
@Nidhi Chhajed  : 

Correction :  You may have to delete the faulty Makefile before running ./install

-

Nidhi Chhajed

unread,
Oct 17, 2015, 1:19:14 PM10/17/15
to ns-u...@googlegroups.com
thank you so much sir for your kind help. I have removed space from Makefile and the file become error free.

--
You received this message because you are subscribed to a topic in the Google Groups "Network Simulator 2 (NS2)" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ns-users/meXuj8NSa14/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ns-users+u...@googlegroups.com.
To post to this group, send email to ns-u...@googlegroups.com.
Visit this group at http://groups.google.com/group/ns-users.
For more options, visit https://groups.google.com/d/optout.



--
Description: Description: Description: cid:image001.gif@01CCC3BF.8ADA3D70-

Nidhi Chhajed
Research Scholar

Nidhi Chhajed

unread,
Oct 17, 2015, 11:44:26 PM10/17/15
to ns-u...@googlegroups.com
Hello,
I encountered a new error during ./install mentioned below. What should I do? I have checked draodv.cc file but can't file multiple functions in the file.

Error is:

"
-L/home/nidhi/ns-allinone-2.35/tclcl-1.20 -ltclcl -L/home/nidhi/ns-allinone-2.35/otcl-1.14 -lotcl -L/home/nidhi/ns-allinone-2.35/lib -ltk8.5 -L/home/nidhi/ns-allinone-2.35/lib -ltcl8.5 -lXext -lX11 -lnsl -ldl -lm -lm
draodv/draodv.o: In function `LocalRepairTimer::handle(Event*)':
draodv.cc:(.text+0x0): multiple definition of `LocalRepairTimer::handle(Event*)'
aodv/aodv.o:aodv.cc:(.text+0x0): first defined here
draodv/draodv.o: In function `BroadcastTimer::handle(Event*)':
draodv.cc:(.text+0x3c0): multiple definition of `BroadcastTimer::handle(Event*)'
aodv/aodv.o:aodv.cc:(.text+0x3c0): first defined here
draodv/draodv.o: In function `RouteCacheTimer::handle(Event*)':
draodv.cc:(.text+0x1260): multiple definition of `RouteCacheTimer::handle(Event*)'
aodv/aodv.o:aodv.cc:(.text+0x1260): first defined here
draodv/draodv.o: In function `HelloTimer::handle(Event*)':
draodv.cc:(.text+0x25a0): multiple definition of `HelloTimer::handle(Event*)'
aodv/aodv.o:aodv.cc:(.text+0x25a0): first defined here
draodv/draodv.o: In function `NeighborTimer::handle(Event*)':
draodv.cc:(.text+0x2b70): multiple definition of `NeighborTimer::handle(Event*)'
aodv/aodv.o:aodv.cc:(.text+0x2b70): first defined here
collect2: error: ld returned 1 exit status
make: *** [ns] Error 1

"

Nidhi Chhajed

unread,
Oct 18, 2015, 12:50:54 AM10/18/15
to ns-u...@googlegroups.com
I have rename the functions but now its showing another error as-

"
draodv/draodv.cc:158:1: error: ‘DRAODVBroadcastTimer’ has not been declared
 DRAODVBroadcastTimer::handle(Event*) {
 ^
draodv/draodv.cc: In function ‘void handle(Event*)’:
draodv/draodv.cc:159:3: error: ‘agent’ was not declared in this scope
   agent->id_purge();
   ^
draodv/draodv.cc:160:34: error: invalid use of ‘this’ in non-member function
   Scheduler::instance().schedule(this, &intr, BCAST_ID_SAVE);
                                  ^
draodv/draodv.cc:160:41: error: ‘intr’ was not declared in this scope
   Scheduler::instance().schedule(this, &intr, BCAST_ID_SAVE);
                                         ^
draodv/draodv.cc: At global scope:
draodv/draodv.cc:164:1: error: ‘DRAODVHelloTimer’ has not been declared
 DRAODVHelloTimer::handle(Event*) {
 ^
draodv/draodv.cc: In function ‘void handle(Event*)’:
draodv/draodv.cc:164:1: error: redefinition of ‘void handle(Event*)’
draodv/draodv.cc:158:1: note: ‘void handle(Event*)’ previously defined here
 DRAODVBroadcastTimer::handle(Event*) {
 ^
draodv/draodv.cc:165:4: error: ‘agent’ was not declared in this scope
    agent->sendHello();
    ^
draodv/draodv.cc:169:35: error: invalid use of ‘this’ in non-member function
    Scheduler::instance().schedule(this, &intr, interval);
                                   ^
draodv/draodv.cc:169:42: error: ‘intr’ was not declared in this scope
    Scheduler::instance().schedule(this, &intr, interval);
                                          ^
draodv/draodv.cc: At global scope:
draodv/draodv.cc:173:1: error: ‘DRAODVNeighborTimer’ has not been declared
 DRAODVNeighborTimer::handle(Event*) {
 ^
draodv/draodv.cc: In function ‘void handle(Event*)’:
draodv/draodv.cc:173:1: error: redefinition of ‘void handle(Event*)’
draodv/draodv.cc:158:1: note: ‘void handle(Event*)’ previously defined here
 DRAODVBroadcastTimer::handle(Event*) {
 ^
draodv/draodv.cc:174:3: error: ‘agent’ was not declared in this scope
   agent->nb_purge();
   ^
draodv/draodv.cc:175:34: error: invalid use of ‘this’ in non-member function
   Scheduler::instance().schedule(this, &intr, HELLO_INTERVAL);
                                  ^
draodv/draodv.cc:175:41: error: ‘intr’ was not declared in this scope
   Scheduler::instance().schedule(this, &intr, HELLO_INTERVAL);
                                         ^
draodv/draodv.cc: At global scope:
draodv/draodv.cc:179:1: error: ‘DRAODVRouteCacheTimer’ has not been declared
 DRAODVRouteCacheTimer::handle(Event*) {
 ^
draodv/draodv.cc: In function ‘void handle(Event*)’:
draodv/draodv.cc:179:1: error: redefinition of ‘void handle(Event*)’
draodv/draodv.cc:158:1: note: ‘void handle(Event*)’ previously defined here
 DRAODVBroadcastTimer::handle(Event*) {
 ^
draodv/draodv.cc:180:3: error: ‘agent’ was not declared in this scope
   agent->rt_purge();
   ^
draodv/draodv.cc:182:34: error: invalid use of ‘this’ in non-member function
   Scheduler::instance().schedule(this, &intr, FREQUENCY);
                                  ^
draodv/draodv.cc:182:41: error: ‘intr’ was not declared in this scope
   Scheduler::instance().schedule(this, &intr, FREQUENCY);
                                         ^
draodv/draodv.cc: At global scope:
draodv/draodv.cc:186:1: error: ‘DRAODVLocalRepairTimer’ has not been declared
 DRAODVLocalRepairTimer::handle(Event* p)  {  // SRD: 5/4/99
 ^
draodv/draodv.cc: In function ‘void handle(Event*)’:
draodv/draodv.cc:186:1: error: redefinition of ‘void handle(Event*)’
draodv/draodv.cc:158:1: note: ‘void handle(Event*)’ previously defined here
 DRAODVBroadcastTimer::handle(Event*) {
 ^
draodv/draodv.cc:194:10: error: ‘agent’ was not declared in this scope
     rt = agent->rtable.rt_lookup(ih->daddr());
          ^
In file included from ./draodv/draodv.h:41:0,
                 from draodv/draodv.cc:32:
./draodv/draodv_rtable.h:113:25: error: ‘u_int8_t draodv_rt_entry::rt_flags’ is protected
         u_int8_t        rt_flags;
                         ^
draodv/draodv.cc:196:19: error: within this context
     if (rt && rt->rt_flags != RTF_UP) {
                   ^
make: *** [draodv/draodv.o] Error 1
Ns make failed!

"

Nidhi Chhajed

unread,
Oct 18, 2015, 2:50:01 AM10/18/15
to ns-u...@googlegroups.com
Hello..
I have sort out the problem but while validating ns2 some validations failed. Is it cause some problem in running tcl files.
Problem :

"
validate overall report: some tests failed:
     ./test-all-tcp ./test-all-testReno ./test-all-newreno ./test-all-sack ./test-all-tcpOptions ./test-all-tcpReset ./test-all-testReno-full ./test-all-testReno-bayfull ./test-all-sack-full ./test-all-tcp-init-win ./test-all-tcpVariants ./test-all-LimTransmit ./test-all-aimd ./test-all-rfc793edu ./test-all-rfc2581 ./test-all-rbp ./test-all-tcpLinux ./test-all-frto ./test-all-ecn ./test-all-ecn-ack ./test-all-ecn-full ./test-all-quickstart ./test-all-manual-routing ./test-all-red ./test-all-adaptive-red ./test-all-red-pd ./test-all-rio ./test-all-vq ./test-all-rem ./test-all-gk ./test-all-pi ./test-all-cbq ./test-all-schedule ./test-all-links ./test-all-oddBehaviors
to re-run a specific test, cd tcl/test; ./test-all-TEST-NAME

"

knudfl

unread,
Oct 18, 2015, 1:31:41 PM10/18/15
to Network Simulator 2 (NS2)
@Nidhi Chhajed ,  Hi.

About validate : Don't worry about the failed tests.
The validate result often gets worse when a new protocol is added.
But as long as you can run your special "draodv" simulations, it doesn't matter.
.... Anyway, nothing you can do to improve validate results.

And :  A 64bits OS will usually provide an inadequate result with any default ns2 version.
( Your OS is unknown, I think.)

-

Nidhi Chhajed

unread,
Oct 18, 2015, 10:31:14 PM10/18/15
to ns-u...@googlegroups.com
Hello,
Sorry for not mentioning OS version before. I am using ubuntu 14.04 64 bit OS.
After executing tcl file, I got an error message

"
nidhi@nidhi-Inspiron-3542:~/Desktop/ns2_programs$ ns test_file.tcl
num_nodes is set 2
INITIALIZE THE LIST xListHead
can't read "udp0": no such variable
    while executing
"$cbr0 attach-agent $udp0"
    (file "test_file.tcl" line 84)

"

Also the network animator is not displaying. What to do?

knudfl

unread,
Oct 18, 2015, 10:49:08 PM10/18/15
to Network Simulator 2 (NS2)
@Nidhi Chhajed ,  Hi.

You cannot expect any answers about your unknown protocol (draodv?).
Or your unknown file = "test_file.tcl".

Nam :  The Ubuntu 'nam' packages have been useless since ~Feb 2014.
( There is a bug report.)

A nam package that works :  nam_1.15-10-ubuntu14_amd64.deb
https://drive.google.com/file/d/0B7S255p3kFXNdmxzSmRzaVRWb28/view?usp=sharing

-

Nidhi Chhajed

unread,
Oct 18, 2015, 10:58:50 PM10/18/15
to ns-u...@googlegroups.com
I have installed package attached with this mail. Is there any issue with this package.
Also I am not using new protocol in test_file.tcl. It is a simple file of 2 wireless node, which is also attached along this mail. What should I do to resolve the problem.
nam_1.15-10_i386.deb
test_file.tcl

Nidhi Chhajed

unread,
Oct 18, 2015, 11:51:58 PM10/18/15
to ns-u...@googlegroups.com
Dear sir,
I got the following error while opening file in nam
"You are using the tracefile format older than 1.0a5
which will not allow you to run namgraph
"

Is this error come because of using older version of NSG2. Can I upgrade NSG2?

namgraph error.png

knudfl

unread,
Oct 19, 2015, 3:59:48 AM10/19/15
to Network Simulator 2 (NS2)
@Nidhi Chhajed ,   Hi.

No reason to attach a 4MB package, when you can just tell the file name, nam_1.15-10_i386.deb
If you really have a 64bits OS, then .i386 is the wrong package choice.
Right is nam_1.15-10-ubuntu14_amd64.deb .

-

Nidhi Chhajed

unread,
Oct 19, 2015, 4:07:43 AM10/19/15
to ns-u...@googlegroups.com

Hello sir,
Yes I have 64 bit OS. So I have to reinstall the nam after uninstalling 32 bit nam??

knudfl

unread,
Oct 19, 2015, 4:19:55 AM10/19/15
to Network Simulator 2 (NS2)
@Nidhi Chhajed.

You have literally no nam file to run, if it's the test_file.nam from running test_file.tcl.

A nam animation file must be more than the "head lines".

Please try another NSG2 generated example : aodv-routing.table.tcl  (Attached.)
.. And read the out.nam file : The first 29 lines are the specs / headlines !

-
aodv-routing.table.tcl

knudfl

unread,
Oct 19, 2015, 4:23:04 AM10/19/15
to Network Simulator 2 (NS2)
? »» So I have to reinstall the nam after uninstalling 32 bit nam «« ?

Yes. If you want nam, you will have to install 'nam'.

-

Nidhi Chhajed

unread,
Oct 19, 2015, 5:17:44 AM10/19/15
to ns-u...@googlegroups.com
Thank you sir for your help. I will try to reinstall nam and try to run it again. Right now the example given by you gives output
"ns aodv-routing.table.tcl
num_nodes is set 25
INITIALIZE THE LIST xListHead
channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5,  distCST_ = 550.0
SORTING LISTS ...DONE!
"
but no visualization.

knudfl

unread,
Oct 19, 2015, 7:03:17 AM10/19/15
to Network Simulator 2 (NS2)
» no visualization « :   Then you have no nam installed.
``aodv-routing.table.tcl´´ has a nam exec entry :      exec nam out.nam &
( Lots of other files.tcl have no nam exec line : You will have to run 'nam out.nam'.

You can also build your own nam, with ns-allinone-2.35_gcc482.tar.gz = the Oct 2014 update
https://drive.google.com/file/d/0B7S255p3kFXNSGJCZ2YzUGJDVk0/view?usp=sharing
The old year 2011 " ns-allinone-2.35.tar.gz" can often fail with nam. ( And other things.)

Building nam-1.15 :
tar xvf ns-allinone-2.35_gcc482.tar.gz
cd ns
-allinone-2.35/
./install
cd nam
-1.15/
sudo make install


-

Nidhi Chhajed

unread,
Oct 19, 2015, 7:42:14 AM10/19/15
to ns-u...@googlegroups.com
Thank you sir..
I am using older version thats why this problem occurs. Now I will reinstall the attached version and try to run the files.

Nidhi Chhajed

unread,
Oct 19, 2015, 8:10:08 AM10/19/15
to ns-u...@googlegroups.com
Dear sir,
After installing the version provided by you, it also gives error " nam
Segmentation fault (core dumped)

"


--
You received this message because you are subscribed to the Google Groups "Network Simulator 2 (NS2)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ns-users+u...@googlegroups.com.

To post to this group, send email to ns-u...@googlegroups.com.
Visit this group at http://groups.google.com/group/ns-users.
For more options, visit https://groups.google.com/d/optout.

knudfl

unread,
Oct 19, 2015, 12:44:57 PM10/19/15
to Network Simulator 2 (NS2)
»» " nam
Segmentation fault (core dumped) «« :

That's the Ubuntu 'nam' in /usr/bin/, I guess.

Please try : $ apt-get remove nam
... and then check for nam presence with the command $ which nam

When you are sure that all nam is removed / deleted :
You can reinstall "nam_1.15-10-ubuntu14_amd64.deb".

-

Nidhi Chhajed

unread,
Oct 20, 2015, 9:33:37 AM10/20/15
to ns-u...@googlegroups.com
Respected sir,

When I checked nam, it shows that it is already installed but is unable to locate ns2.
I am trying to uninstall ns2 but not able to do so.
What should I do?
ns not found.png
Screenshot from 2015-10-20 19:02:39.png

Nidhi Chhajed

unread,
Oct 20, 2015, 11:11:06 AM10/20/15
to ns-u...@googlegroups.com
Hello sir,
After installing ns-2 I got the following error-
"
make[1]: Leaving directory `/home/nidhi/Desktop/ns-allinone-2.35/ns-2.35/indep-utils/webtrace-conv/ucb'
 Ns has been installed successfully.
============================================================
* Build nam-1.15
* Modified By Paul Shaiju (Paul S)
* Email-id : pau...@gmail.com
* Website : http://paultsr.in
============================================================
ln: failed to create symbolic link ‘otcl/otcl-1.14’: File exists
ln: failed to create symbolic link ‘tclcl/tclcl-1.20’: File exists
./install: 612: cd: can't cd to ./nam-1.15
./install: 622: ./install: ./configure: not found
Nam configuration failed! Exiting ...
Please check http://www.isi.edu/nsnam/ns/ns-problems.html
for common problems and bug fixes.
"

What can I do to resolve the problem??

knudfl

unread,
Oct 20, 2015, 6:45:15 PM10/20/15
to Network Simulator 2 (NS2)
Please do not show  / attach images with text.
I guess you know how to copy/paste a text to a file.

About removing nam :
`nam-1.15-3´ is the Ubuntu package from Ubuntu you will have to remove :
$ sudo apt-get remove nam

The package nam-1.15-10** you have in Documents : Please install the package.
I guess you never tried to install it, as it would normally update the faulty package installed with apt.

About removing ns-allinone-2** : apt can only remove packages.deb installed with apt.
Removing folders : Delete the folder → → $ rm -r ns-allinone-2.35/
Besides that : You can have as many ns-allinone-2.35 as you want, installed at the same time.
... But do never add any *PATH text to .bashrc. Not required.
How to install ns : $ cd ns-2.35/ && sudo make install
→ 'make install' will install 'ns' to a system PATH.

-

Nidhi Chhajed

unread,
Oct 21, 2015, 1:52:05 AM10/21/15
to ns-u...@googlegroups.com
Thank you sir for your valuable suggestion. I have removed ns2 and reinstalling it with the new one.
The in-build nam folder in ns2.35 64 bit is also nam 1.15 64 bit or not?

--
You received this message because you are subscribed to the Google Groups "Network Simulator 2 (NS2)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ns-users+u...@googlegroups.com.
To post to this group, send email to ns-u...@googlegroups.com.
Visit this group at http://groups.google.com/group/ns-users.
For more options, visit https://groups.google.com/d/optout.

Nidhi Chhajed

unread,
Oct 21, 2015, 2:38:34 AM10/21/15
to ns-u...@googlegroups.com
Sir, I am unable to open .bashrc file
When I run
"sudo gedit .bashrc
[sudo] password for nidhi:

(gedit:27791): Gtk-WARNING **: Calling Inhibit failed: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.SessionManager was not provided by any .service files
"
the above error encountered and a blank document file named as .bashrc opened. What does it mean?

knudfl

unread,
Oct 21, 2015, 5:58:34 AM10/21/15
to Network Simulator 2 (NS2)
How to edit .bashrc :
$ gedit .bashrc
I.e. no sudo commands can be used in /home/. 
( Unless for 'make install', or for copying files to /usr////* ).

Else : $ sudo apt-get update && sudo apt-get install leafpad
( 'leafpad' : The user interface is similar to "notepad", and it aims to be lighter than GEdit.)
→  $ leafpad .bashrc

Else, else : Replace .bashrc with the original one : /home/<name>/.bashrc
Attached : bashrc-Ubuntu1404.txt

-
bashrc-Ubuntu1404.txt

Nidhi Chhajed

unread,
Oct 27, 2015, 2:03:13 AM10/27/15
to ns-u...@googlegroups.com
Hello sir,
I have installed ns2 and nam but after adding new protocol, I am not able to reconfigure ns2. It shows the following error -
"nidhi@nidhi-Inspiron-3542:~/ns-allinone-2.35/ns-2.35$ ./configure
./configure: line 2097: config.log: Permission denied
./configure: line 2107: config.log: Permission denied
"
How to get permission? please let me know.

Nidhi Chhajed

unread,
Oct 27, 2015, 3:15:01 AM10/27/15
to ns-u...@googlegroups.com
Problem resolved Sir..
But after reconfiguration nam has stopped working. Again segmentation fault error occurs :-(. What to do?

knudfl

unread,
Oct 27, 2015, 4:36:08 AM10/27/15
to Network Simulator 2 (NS2)
»» .. after reconfiguration nam has stopped working ««. ? After reconfiguration of what ?

When you start at building a new ns-allinone-2.3x/, the first thing to do is :
Delete the folder  nam-1.1x/.
Then you are not at risk building another faulty nam.

"Segmentation fault" usually only happens when the Ubuntu "nam package" is installed.
( $ sudo apt-get remove nam ).
General nam solution : Use a package from this link,  #2
http://www.linuxquestions.org/questions/linux-newbie-8/ns-stop-couldn't-execute-nam-permission-denied-while-executing-exec-nam-4175524760/#2


-

Nidhi Chhajed

unread,
Oct 27, 2015, 5:50:16 AM10/27/15
to ns-u...@googlegroups.com
After reconfiguration of ns2.35 nam has given segmentation fault error.
I have removed nam using "apt-get remove nam"and also delete nam folder from ns-allinone-2.35.
After doing this I copied nam-1.15 64 bit in the ns-allinone-2.35 folder and reinstall nam by using "sudo apt-get install --reinstall nam libotcl1 libtclcl1". but the error remains same as-
"Reading package lists... Done
Building dependency tree      
Reading state information... Done
The following NEW packages will be installed:
  nam
0 upgraded, 1 newly installed, 2 reinstalled, 0 to remove and 0 not upgraded.
Need to get 0 B/266 kB of archives.
After this operation, 666 kB of additional disk space will be used.
(Reading database ... 292348 files and directories currently installed.)
Preparing to unpack .../libotcl1_1.14+dfsg-3_amd64.deb ...
Unpacking libotcl1:amd64 (1.14+dfsg-3) over (1.14+dfsg-3) ...
Preparing to unpack .../libtclcl1_1.20-7_amd64.deb ...
Unpacking libtclcl1:amd64 (1.20-7) over (1.20-7) ...
Selecting previously unselected package nam.
Preparing to unpack .../archives/nam_1.15-3_amd64.deb ...
Unpacking nam (1.15-3) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Setting up libotcl1:amd64 (1.14+dfsg-3) ...
Setting up libtclcl1:amd64 (1.20-7) ...
Setting up nam (1.15-3) ...
Processing triggers for libc-bin (2.19-0ubuntu6.6) ...
root@nidhi-Inspiron-3542:/home/nidhi/ns-allinone-2.35/nam-1.15# nam
Segmentation fault (core dumped)
"
How do I install nam-1.15 instead of default nam provided ubuntu?
Also the nam folder which I have deleted contains lots of files and folders in it, but the nam folder extracted by me contains only two folders named DEBIAN and usr.
Can you tell me sir that What is the thing missed by me.

--
You received this message because you are subscribed to the Google Groups "Network Simulator 2 (NS2)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ns-users+u...@googlegroups.com.

To post to this group, send email to ns-u...@googlegroups.com.
Visit this group at http://groups.google.com/group/ns-users.
For more options, visit https://groups.google.com/d/optout.

knudfl

unread,
Oct 27, 2015, 7:10:15 AM10/27/15
to Network Simulator 2 (NS2)
»» I copied nam-1.15 64 bit in the ns-allinone-2.35 folder
and reinstall nam by using "sudo apt-get install --reinstall nam libotcl1 libtclcl1". ««
»» After doing this I copied nam-1.15 64 bit in the ns-allinone-2.35 folder ««

Completely wrong !
First thing to do : $ sudo apt-get remove nam libotcl1 libtclcl1
! These Ubuntu packages are corrupt, and should not be used.
Reminder, bug report ``2014-10-03´´, Bug #1376970,
https://bugs.launchpad.net/ubuntu/+source/nam/+bug/1376970
! Never solved !

Please read my above posts :  Use "nam_1.15-10-ubuntu14_amd64.deb"  !
Download the package. Go to the Downloads/ folder.
Click the package, and `nam' will be installed.


-

Nidhi Chhajed

unread,
Oct 27, 2015, 7:14:10 AM10/27/15
to ns-u...@googlegroups.com

Ok sir..I will retry installing nam. I din't know that nam can be installed directly by clicking it.

Nidhi Chhajed

unread,
Oct 27, 2015, 7:21:54 AM10/27/15
to ns-u...@googlegroups.com
Thank you so much sir.. It works perfectly.
Can you please tell me how I can use the new protocol in ns2.

knudfl

unread,
Oct 27, 2015, 7:35:45 AM10/27/15
to Network Simulator 2 (NS2)
»» how I can use the new protocol in ns2 ««.

Is it a default "Security" as from ``security_ns235.patch´´ ? ?
http://www.linuxquestions.org/questions/tags/security-ns2/
https://groups.google.com/forum/?fromgroups#!searchin/ns-users/security|sort:date
My test :
$ ns235-security security.tcl

-
security.tcl

Nidhi Chhajed

unread,
Oct 27, 2015, 7:45:03 AM10/27/15
to ns-u...@googlegroups.com
No sir, It is not default security package. I have to create a new security protocol, thus needed help in patching the files with ns2 and then executing it. But I never use ns2 before so I don't have any idea about it. I have to add a C program file in aodv and make changes in it. What can be the solution?

--
You received this message because you are subscribed to the Google Groups "Network Simulator 2 (NS2)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ns-users+u...@googlegroups.com.
To post to this group, send email to ns-u...@googlegroups.com.
Visit this group at http://groups.google.com/group/ns-users.
For more options, visit https://groups.google.com/d/optout.

knudfl

unread,
Oct 27, 2015, 12:55:46 PM10/27/15
to Network Simulator 2 (NS2)

Nidhi Chhajed

unread,
Oct 28, 2015, 1:19:50 AM10/28/15
to ns-u...@googlegroups.com

Hello sir,
When I used commands for adding new objects according to the instructions given by you as -
"Compiling new objects : cd ns-allinone-2.35/ns-2.35/ && ./configure
&& make clean && make : A new 'ns' will be generated.
"
After executing make command I found the below output-

make[1]: Leaving directory `/home/nidhi/ns-allinone-2.35/ns-2.35/indep-utils/webtrace-conv/ucb'


Does it means that new objects are added successfully?? How can I test?

knudfl

unread,
Oct 28, 2015, 4:32:25 AM10/28/15
to Network Simulator 2 (NS2)
»» Does it means that new objects are added successfully ? «« :
May be. If you added new objects.o to the Makefile.in .

And if you also added the right entries in tcl/lib/<files>, you can write a simulation.tcl, and test it.


-

Nidhi Chhajed

unread,
Oct 28, 2015, 5:11:46 AM10/28/15
to ns-u...@googlegroups.com

Sir i have tested..Ii is added successfully. Thank you. I have to embed RSA code in aodv. Can you help me?? Where the changes should be done?

--

Nidhi Chhajed

unread,
Nov 3, 2015, 9:20:27 AM11/3/15
to ns-u...@googlegroups.com
Hello sir,
How to simulate aodv protocol for calculating throughput, end to end delay, packet delivery ratio? How to calculate size of a packet before transmission / during transmission? Please help.

knudfl

unread,
Nov 3, 2015, 11:03:20 AM11/3/15
to Network Simulator 2 (NS2)
Hi.
»» calculating throughput, end to end delay, packet delivery ratio ««.

You may use an awk or perl script to get the information from the trace file.
"awk#perl#python__scripts-10.2015.tar.gz" : ~185 scripts ....
https://drive.google.com/file/d/0B7S255p3kFXNOUIteTVSWjdzQU0/view?usp=sharing

About "size of a packet" :  That's a fixed setting in the simulation-script.tcl, isn't it ?

Some simulations have an Xgraph output with "calculation plots",
see xgraph_ns2-files-tcl_10.2015.tar.gz
https://drive.google.com/file/d/0B7S255p3kFXNSW1YTjFLLVpOWTg/view?usp=sharing

-

Nidhi Chhajed

unread,
Nov 4, 2015, 7:54:26 AM11/4/15
to ns-u...@googlegroups.com
Hello sir,
I have tried to use aodv.awk given by you..It gives error while executing command
" gawk -f aodv.awk simulate.tr
gawk: aodv.awk:83:
gawk: aodv.awk:83: ^ syntax error
"
but there is nothing in this line.
Sir how can I simulate packet using aodv routing? Please help.

--
You received this message because you are subscribed to the Google Groups "Network Simulator 2 (NS2)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ns-users+u...@googlegroups.com.
To post to this group, send email to ns-u...@googlegroups.com.
Visit this group at http://groups.google.com/group/ns-users.
For more options, visit https://groups.google.com/d/optout.

knudfl

unread,
Nov 4, 2015, 10:56:01 AM11/4/15
to Network Simulator 2 (NS2)
Hi.

"aodv.awk" : The finishing bracket  }  is missing.

The edited ``aodv.awk´´ is attached as aodv.awk.txt

-
aodv.awk.txt

Nidhi Chhajed

unread,
Nov 6, 2015, 3:37:35 AM11/6/15
to ns-u...@googlegroups.com
Hello sir,
Thank you for your kind reply, the code runs perfectly.
Is it compulsory to attach agent in every node?
How can we identify that which agent is to be used? For example whether I use TCP, TCPSink,UDP or NULL or any other agent type while creating a simple 10 wireless node scenario.. How can I define source node and destination node in tcl?

Nidhi Chhajed

unread,
Nov 10, 2015, 12:09:50 AM11/10/15
to ns-u...@googlegroups.com
hello sir,
How can I use .c file methods in aodv protocol. How packets can be encrypted during transmission and decryptedafter reception. Please help if you know. Thank you

Nidhi Chhajed

unread,
Nov 10, 2015, 7:21:13 AM11/10/15
to ns-u...@googlegroups.com
Hello sir,
When I execute the new protocol added by me, I got error as below:

"  (_o14 cmd line 1)
    invoked from within
"_o14 cmd addr"
    invoked from within
"catch "$self cmd $args" ret"
    invoked from within
"if [catch "$self cmd $args" ret] {
set cls [$self info class]
global errorInfo
set savedInfo $errorInfo
error "error when calling class $cls: $args" $..."
    (procedure "_o14" line 2)
    (SplitObject unknown line 2)
    invoked from within
"_o14 addr"
    ("eval" body line 1)
    invoked from within
"eval $node addr $args"
    ("default" arm line 2)
    invoked from within
"switch -exact $routingAgent_ {
DSDV {
set ragent [$self create-dsdv-agent $node]
}
DSR {
$self at 0.0 "$node start-dsr"
}
AODV {
set ragent [$self cre..."
    (procedure "_o3" line 14)
    (Simulator create-wireless-node line 14)
    invoked from within
"_o3 create-wireless-node"
    ("eval" body line 1)
    invoked from within
"eval $self create-wireless-node $args"
    (procedure "_o3" line 23)
    (Simulator node line 23)
    invoked from within
"$ns node"
    invoked from within
"set n0 [$ns node]"
    (file "draodv-routing.table.tcl" line 64)"

What does it mean? Does it mean that the protocol is not added in ns2?

knudfl

unread,
Nov 10, 2015, 11:50:33 AM11/10/15
to Network Simulator 2 (NS2)
Hi .

"draodv-routing.table.tcl" : Please attach the file.

-

Nidhi Chhajed

unread,
Nov 10, 2015, 12:01:15 PM11/10/15
to ns-u...@googlegroups.com
Hello sir,
draodv-routing.table.tcl is same as aodv-routing.table.tcl sent by you. I have only changed protocol name from AODV to DRAODV. Rest all is same. I am attaching draodv-routing.table.tcl with this mail. Please check it.
draodv-routing.table.tcl

knudfl

unread,
Nov 11, 2015, 5:51:27 AM11/11/15
to Network Simulator 2 (NS2)
New protocol : Recompile ns-2.35/ and save the new executable 'ns' as /usr/local/bin/ns-new-name

Your "DRAODV" :
cd ns-2.35/
cp ns
ns-draodv
sudo cp draodv
/usr/local/bin/
Simulation : ns-draodv draodv-routing.table.tcl
... Only in that way you can be sure you are using the right executable 'ns'.
I.e. your errors indicate the use of an 'ns' with no ``droadv´´ compiled into it.
I.e. i.e. I get the same errors : $ ns-orig draodv-routing.table.tcl
.... where 'ns-orig' of course is an 'ns' with no draodv.

-

Nidhi Chhajed

unread,
Nov 17, 2015, 7:45:55 AM11/17/15
to ns-u...@googlegroups.com
hello sir,
FOllowing error has encountered while executing tcl file
"ns: finish: couldn't execute "./xgraph": no such file or directory
    while executing

"exec ./xgraph delay.tr packetdelivery.tr -x "Time" -y "No of Packets" -t "Secure Randomized Routing" -bg white &  "
    (procedure "finish" line 10)
    invoked from within
"finish"
"
When I execute "sudo apt-get install xgraph" it gives
"sudo apt-get install ns2 nam xgraph

Reading package lists... Done
Building dependency tree      
Reading state information... Done
ns2 is already the newest version.
xgraph is already the newest version.
nam is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 73 not upgraded.
"
What can I do for this?

On Wed, Nov 11, 2015 at 4:21 PM, knudfl <knu...@ofir.dk> wrote:
Boxbe This message is eligible for Automatic Cleanup! (knu...@ofir.dk) Add cleanup rule | More info

New protocol : Recompile ns-2.35/ and save the new executable 'ns' as /usr/local/bin/ns-new-name

Your "DRAODV" :
cd ns-2.35/
cp ns
ns-draodv
sudo cp draodv
/usr/local/bin/
Simulation : ns-draodv draodv-routing.table.tcl
... Only in that way you can be sure you are using the right executable 'ns'.
I.e. your errors indicate the use of an 'ns' with no ``droadv´´ compiled into it.
I.e. i.e. I get the same errors : $ ns-orig draodv-routing.table.tcl
.... where 'ns-orig' of course is an 'ns' with no draodv.

-

On Tuesday, November 10, 2015 at 6:01:15 PM UTC+1, Nidhi Chhajed wrote:
Hello sir,
draodv-routing.table.tcl is same as aodv-routing.table.tcl sent by you. I have only changed protocol name from AODV to DRAODV. Rest all is same. I am attaching draodv-routing.table.tcl with this mail. Please check it.

--
You received this message because you are subscribed to the Google Groups "Network Simulator 2 (NS2)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ns-users+u...@googlegroups.com.
To post to this group, send email to ns-u...@googlegroups.com.
Visit this group at http://groups.google.com/group/ns-users.
For more options, visit https://groups.google.com/d/optout.

knudfl

unread,
Nov 17, 2015, 7:50:13 AM11/17/15
to Network Simulator 2 (NS2)
@Nidhi Chhajed ,   Hi.

As you can see the command is not xgraph but ./xgraph.
./xgraph means an xgraph executable in the current directory.

Just edit ./xgraph to xgraph

-

Nidhi Chhajed

unread,
Nov 17, 2015, 7:58:18 AM11/17/15
to ns-u...@googlegroups.com
ok..
thank you sir..

yenework alayu

unread,
Jul 11, 2019, 2:52:27 AM7/11/19
to Network Simulator 2 (NS2)
Dear Nidihi. how you sort out this problem please help me. I encountered this type of problem when I tries to make
raodv/draodv.cc:158:1: error: ‘DRAODVBroadcastTimer’ has not been declared
 DRAODVBroadcastTimer::handle(
Event*) {
 ^
draodv/draodv.cc: In function ‘void handle(Event*)’:
draodv/draodv.cc:159:3: error: ‘agent’ was not declared in this scope
   agent->id_purge();
   ^
draodv/draodv.cc:160:34: error: invalid use of ‘this’ in non-member function
   Scheduler::instance().schedule(this, &intr, BCAST_ID_SAVE);
                                  ^
draodv/draodv.cc:160:41: error: ‘intr’ was not declared in this scope
   Scheduler::instance().schedule(this, &intr, BCAST_ID_SAVE);
                                         ^
draodv/draodv.cc: At global scope:
draodv/draodv.cc:164:1: error: ‘DRAODVHelloTimer’ has not been declared
 DRAODVHelloTimer::handle(Event*) {
 ^
draodv/draodv.cc: In function ‘void handle(Event*)’:
draodv/draodv.cc:164:1: error: redefinition of ‘void handle(Event*)’
draodv/draodv.cc:158:1: note: ‘void handle(Event*)’ previously defined here
 DRAODVBroadcastTimer::handle(Event*) {
 ^
draodv/draodv.cc:165:4: error: ‘agent’ was not declared in this scope
    agent->sendHello();
    ^
draodv/draodv.cc:169:35: error: invalid use of ‘this’ in non-member function
    Scheduler::instance().schedule(this, &intr, interval);
                                   ^
draodv/draodv.cc:169:42: error: ‘intr’ was not declared in this scope
    Scheduler::instance().schedule(this, &intr, interval);
                                          ^
draodv/draodv.cc: At global scope:
draodv/draodv.cc:173:1: error: ‘DRAODVNeighborTimer’ has not been declared
 DRAODVNeighborTimer::handle(Event*) {
 ^
draodv/draodv.cc: In function ‘void handle(Event*)’:
draodv/draodv.cc:173:1: error: redefinition of ‘void handle(Event*)’
draodv/draodv.cc:158:1: note: ‘void handle(Event*)’ previously defined here
 DRAODVBroadcastTimer::handle(Event*) {
 ^
draodv/draodv.cc:174:3: error: ‘agent’ was not declared in this scope
   agent->nb_purge();
   ^
draodv/draodv.cc:175:34: error: invalid use of ‘this’ in non-member function
   Scheduler::instance().schedule(this, &intr, HELLO_INTERVAL);
                                  ^
draodv/draodv.cc:175:41: error: ‘intr’ was not declared in this scope
   Scheduler::instance().schedule(this, &intr, HELLO_INTERVAL);
                                         ^
draodv/draodv.cc: At global scope:
draodv/draodv.cc:179:1: error: ‘DRAODVRouteCacheTimer’ has not been declared
 DRAODVRouteCacheTimer::handle(Event*) {
 ^
draodv/draodv.cc: In function ‘void handle(Event*)’:
draodv/draodv.cc:179:1: error: redefinition of ‘void handle(Event*)’
draodv/draodv.cc:158:1: note: ‘void handle(Event*)’ previously defined here
 DRAODVBroadcastTimer::handle(Event*) {
 ^
draodv/draodv.cc:180:3: error: ‘agent’ was not declared in this scope
   agent->rt_purge();
   ^
draodv/draodv.cc:182:34: error: invalid use of ‘this’ in non-member function
   Scheduler::instance().schedule(this, &intr, FREQUENCY);
                                  ^
draodv/draodv.cc:182:41: error: ‘intr’ was not declared in this scope
   Scheduler::instance().schedule(this, &intr, FREQUENCY);
                                         ^
draodv/draodv.cc: At global scope:
draodv/draodv.cc:186:1: error: ‘DRAODVLocalRepairTimer’ has not been declared
 DRAODVLocalRepairTimer::handle(Event* p)  {  // SRD: 5/4/99
 ^
draodv/draodv.cc: In function ‘void handle(Event*)’:
draodv/draodv.cc:186:1: error: redefinition of ‘void handle(Event*)’
draodv/draodv.cc:158:1: note: ‘void handle(Event*)’ previously defined here
 DRAODVBroadcastTimer::handle(Event*) {
 ^
draodv/draodv.cc:194:10: error: ‘agent’ was not declared in this scope
     rt = agent->rtable.rt_lookup(ih->daddr());
          ^
In file included from ./draodv/draodv.h:41:0,
                 from draodv/draodv.cc:32:
./draodv/draodv_rtable.h:113:25: error: ‘u_int8_t draodv_rt_entry::rt_flags’ is protected
         u_int8_t        rt_flags;
                         ^
draodv/draodv.cc:196:19: error: within this context
     if (rt && rt->rt_flags != RTF_UP) {
                   ^
make: *** [draodv/draodv.o] Error 1
Ns make failed
Reply all
Reply to author
Forward
0 new messages