LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-01-2014, 01:33 PM   #1
ss1990
LQ Newbie
 
Registered: Jan 2014
Posts: 11

Rep: Reputation: Disabled
Unhappy Cannot install TENS1.2 in NS2.35


Hey,

I've been trying to find a way to install a directional antenna in NS2.35. I tried to install TENS by downloading the changes for ns2.1b9a from http://www.cse.iitk.ac.in/users/braman/tens/ and I change the path and package versions in the Makefile. after that I followed the instructions given in the web site. But its not working.
Is there any other changes to do(to files in TENS) before installing TENS 1.2 in NS2.35

any help will be greatfull....
 
Old 04-01-2014, 04:07 PM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Welcome to LQ.

NS-2 Directional Antenna : The code is available for ns-2.33 :
http://www.linuxquestions.org/questi...ntenna-833449/
.. The original links are down.
My backup, dir-antenna_ns233-files.tar.gz can be downloaded from ..
https://drive.google.com/file/d/0B7S...it?usp=sharing

Using : $ cd ns-allinone-2.33/ns-2.33/
$ patch -p1 < dir-antenna.patch
$ patch -p1 < multi-if.patch
$ cd ../ && export CC=gcc41 CXX=g++41 && ./install

*** Note : The { gcc41 / g++41 } compilers :
Versions are available for all new 32bits (i686) Ubuntu's.
? Which is yours ? Please show the replies from these commands :
a) $ uname -m
b) $ cat /etc/issue

Note 2 : The simulation ( sample_long.tcl = Dir-antenna-test.tcl )
.. fails with "Floating point exception" on the (3) Linux OS's ,
that I have tested with the patches :
I guess you can edit the tcl file (antenna files?) to a usable result.

Note 3 : You can have as many ns-allinone-2.xx as you want,
installed at the same time.
But do not add any *PATH text to .bashrc : Not required.


-

Last edited by knudfl; 04-01-2014 at 04:11 PM.
 
1 members found this post helpful.
Old 04-02-2014, 03:50 AM   #3
ss1990
LQ Newbie
 
Registered: Jan 2014
Posts: 11

Original Poster
Rep: Reputation: Disabled
Thank you for your reply, these are the results from commands,
x86_64
Ubuntu 12.04.3 LTS \n \l

I installed the ns2.33 as well and I use the patch, but since I already add the path of ns2.35 to bashrc file when I tried to run the simulation, I geuss it ran through ns2.35 instead of ns2.33. can you please tell me how to run the simulation using ns2.33.

I'm tring to use the directional antenna with OLSR protocol, but in the simulation file it says that all other wireless protocol don't work. Is it possible to use this directional antenna to support OLSR protocol???
 
Old 04-02-2014, 04:20 AM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
# 3 .

Using multiple 'ns' : You already have one 'ns' (from ns235),
so please use a copy with a different name :
$ cd ns-allinone-2.33/ns-2.33/
$ cp ns ns-dir-antenna
$ sudo cp ns-dir-antenna /usr/local/bin/
... Run the simulation with : 1)
$ export NS_ANTENNA_FILE=./antenna.txt (or wherever you have a copy of {antenna.txt antenna1.txt}).
2) $ ns-dir-antenna Dir-antenna-test.tcl

Using "Directional-Antenna" and OLSR in the same ns-allinone-2.33 :
Might be possible. Some patches will work together. Some will conflict.
But no reason to think about that until you've got a working DirectAntenna simulation.


Quote:
but since I already add the path of ns2.35 to .bashrc
You are not supposed to add anything to .bashrc .
Would have been useful 15 years ago, if you used the University Computer,
and had no write permissions to /usr/local/bin/.
The right install in ns-2.35/ is done with $ sudo make install
* So you can easily delete what you added to .bashrc.
! The executable 'ns' is hard coded to know the location of it's libraries.
So adding some path text makes no sense at all.

-

Last edited by knudfl; 04-02-2014 at 04:22 AM.
 
1 members found this post helpful.
Old 04-02-2014, 05:56 AM   #5
ss1990
LQ Newbie
 
Registered: Jan 2014
Posts: 11

Original Poster
Rep: Reputation: Disabled
thank you very much!!! now the simulation is working. but when I tried to run a another simulation in ns2.33 (an example in ns2.33/tcl/ex) i got this error.

sudee@sudee:~$ ns2 simple-wireless.tcl
num_nodes is set 2
can't read "numifs": no such variable
while executing
"subst $[subst $var]"
(procedure "_o3" line 5)
(SplitObject set line 5)
invoked from within
"$ns set numifs"
(procedure "_o14" line 6)
(Node/MobileNode add-interface line 6)
invoked from within
"$node add-interface $chan $propInstance_ $llType_ $macType_ $ifqType_ $ifqlen_ $phyType_ $antType_ $topoInstance_ $inerrProc_ $outerrProc_ $FECProc_"
(procedure "_o3" line 77)
(Simulator create-wireless-node line 77)
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"
("for" body line 2)
invoked from within
"for {set i 0} {$i < $val(nn) } {incr i} {
set node_($i) [$ns_ node]
$node_($i) random-motion 0 ;# disable random motion
}"
(file "simple-wireless.tcl" line 93)

I got same kind of errors when I tried to run few other simulations as well.. can you please help me for this as well...
as I said earlier my project is to evaluate the performance of OLSR using directional antennas. Can you recomend any good books or other publications regarding the programming side, If you can it would be greatfull...

Last edited by ss1990; 04-02-2014 at 06:17 AM.
 
Old 04-02-2014, 07:57 AM   #6
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
# 5 .

Not unusual : Some of the extra protocols that you can add to ns2
.. will prevent the default simulations from working.

The solution is simple :
Keep a none patched 'ns-orig' executable in /usr/local/bin/.
The version isn't important. Nearly all examples in tcl/ex are ancient.
And the most of them can be used with $ ns_any-name_orig file.tcl

-
 
Old 04-02-2014, 08:26 AM   #7
ss1990
LQ Newbie
 
Registered: Jan 2014
Posts: 11

Original Poster
Rep: Reputation: Disabled
Is there anyway to use both OLSR and Directional antenna in one ns??? because I need both of them for my project.
 
Old 04-02-2014, 08:41 AM   #8
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
# 7 .

See post #4 :
".. no reason to think about that until you've got a working DirectAntenna simulation."

Have you got some perfect results with the "Direct Antenna simulation" ? ?
 
Old 04-02-2014, 09:10 AM   #9
ss1990
LQ Newbie
 
Registered: Jan 2014
Posts: 11

Original Poster
Rep: Reputation: Disabled
yes I got a perfect result from it... when I tried installing OLSR first and then directional antenna, only the OLSR works and I got the same kind of error for the direct antenna simulation. Is there any solution for it, because my whole project depends on it.
 
Old 04-02-2014, 09:37 AM   #10
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
# 9 .
Quote:
yes I got a perfect result from it...
OK, please show.
Code:
[knudfl@localhost ns-2.33]$ ns Dir-antenna-test.tcl 
num_nodes is set 6
INITIALIZE THE LIST xListHead
Starting Simulation...
channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5,  distCST_ = 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.0
SORTING LISTS ...DONE!
Floating point exception
And what's the size of the file "simple.tr" ?

-
 
Old 04-02-2014, 10:03 AM   #11
ss1990
LQ Newbie
 
Registered: Jan 2014
Posts: 11

Original Poster
Rep: Reputation: Disabled
this is the result,

Code:
sudee@sudee:~/ns-allinone-2.33/ns-2.33$ ns-dir-antenna Dir-antenna-test.tcl
num_nodes is set 6
INITIALIZE THE LIST xListHead
Starting Simulation...
channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5,  distCST_ = 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.0
SORTING LISTS ...DONE!
NS EXITING...
and the size of simple.tr is 13.5mb
 
Old 04-02-2014, 10:11 AM   #12
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
# 9 .
Status report : These are the files that get changed with the patches ...

### um-olsr_ns-2.33_v1.0.patch
Makefile.in
common/packet.h
queue/priqueue.cc
trace/cmu-trace.cc
trace/cmu-trace.h
tcl/lib/ns-agent.tcl
tcl/lib/ns-default.tcl
tcl/lib/ns-lib.tcl
tcl/lib/ns-packet.tcl

### dir.antenna.patch
Makefile.in
mobile/dir-antenna.cc
mobile/dir-antenna.h
tcl/lib/ns-default.tcl

### multi-if.patch
aodv/aodv.cc
aodv/aodv.h
aodv/aodv_rtable.h
tcl/lib/ns-lib.tcl
tcl/lib/ns-mobilenode.tcl

.... So the exercise is to write the changes together.
* The current 3 patches :
Files with the same name may be overridden by the next patch.

-

Last edited by knudfl; 04-02-2014 at 10:12 AM.
 
Old 04-03-2014, 07:43 AM   #13
ss1990
LQ Newbie
 
Registered: Jan 2014
Posts: 11

Original Poster
Rep: Reputation: Disabled
since I first installed the directional patch and then OLSR patch, I tried to install the directional patch again in a fresh install of ns2.33. But when I do that I get this error every time..
Quote:
* Build tcl8.4.18
============================================================
rm -f *.a *.o libtcl* core errs *~ \#* TAGS *.E a.out \
errors tclsh tcltest lib.exp Tcl
cd dltest ; make clean
make[1]: Entering directory `/home/sudee/ns-allinone-2.33/tcl8.4.18/unix/dltest'
rm -f *.o config.cache config.log config.status
rm -f lib.exp ../dltest.marker
rm -f *.so
make[1]: Leaving directory `/home/sudee/ns-allinone-2.33/tcl8.4.18/unix/dltest'
rm -rf Makefile config.status config.cache config.log tclConfig.sh \
SCRPtcl.* prototype *.plist Tcl.framework
cd dltest ; make distclean
make[1]: Entering directory `/home/sudee/ns-allinone-2.33/tcl8.4.18/unix/dltest'
rm -f *.o config.cache config.log config.status
rm -f lib.exp ../dltest.marker
rm -f *.so
rm -f Makefile
make[1]: Leaving directory `/home/sudee/ns-allinone-2.33/tcl8.4.18/unix/dltest'
configure: WARNING: unrecognized options: --enable-gcc
checking whether to use symlinks for manpages... no
checking whether to compress the manpages... no
checking whether to add a package name suffix for the manpages... no
checking for gcc... gcc41
checking whether the C compiler works... no
configure: error: in `/home/sudee/ns-allinone-2.33/tcl8.4.18/unix':
configure: error: C compiler cannot create executables
See `config.log' for more details
tcl8.4.18 configuration failed! Exiting ...
Tcl is not part of the ns project. Please see www.Scriptics.com
to see if they have a fix for your platform.
I did the same steps again and again but I'm getting this error everytime. Do you know whats the problem. I have the files from a fresh ns2.33 and the changed files from OLSR patch, since I cann't install the directional patch, can u give me the changed files from the directional antenna patch..
 
Old 04-03-2014, 09:53 AM   #14
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
# 13 .
Quote:
checking for gcc... gcc41
checking whether the C compiler works... no
The build example in post #2 is for a 32bits Ubuntu,
where you can install the gcc41 / g++41 packages.
* You can of course not use gcc41, when it isn't present / isn't installed.

So please describe how you installed {ns-2.33 + "direct-antenna"}
.. and got that perfect result shown in post #11.

-
 
Old 04-03-2014, 11:09 AM   #15
ss1990
LQ Newbie
 
Registered: Jan 2014
Posts: 11

Original Poster
Rep: Reputation: Disabled
I used following commands to install ns2.33 & directional patch

Code:
ns2.33 :
sudo apt-get install g++-4.4
$ cd ns-allinone-2.33/ && export CC=gcc-4.4 CXX=g++-4.4 && ./install

directional patch
$ cd ns-allinone-2.33/ns-2.33/
$ patch -p1 < dir-antenna.patch
$ patch -p1 < multi-if.patch
$ cd ../ && export CC=gcc41 CXX=g++41 && ./install
 
1 members found this post helpful.
  


Reply

Tags
directional-antenna, ns2, tens



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
want to install ns2.29.3 along with mannasim patch for ns2.29 jeevanpinto Linux - Software 4 10-02-2013 12:09 AM
how to install both ns2.28 and ns2.34 versions on ubuntu 10.04? popoaung Linux - Software 3 06-10-2013 04:52 PM
install NS2.31 saif_ict Programming 18 03-04-2012 09:33 AM
How can I install NS2 ? hoang_it Linux - Software 19 10-14-2009 06:02 AM
could not install ns2 salady86 Linux - Software 1 03-16-2008 07:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:42 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration