LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 07-30-2015, 10:16 PM   #1
shelja.fet@mriu.edu.in
Member
 
Registered: Jan 2014
Location: INDIA
Posts: 31

Rep: Reputation: 0
Can modified patch of OLSR developed on NS-2.29 , successfully run on NS-2.35?


Hi All,

I have patch of OLSR protocol, which has been modified and successfully run on NS-2.29. So, what changes are required in which files to successfully run the same modified patch on NS-2.35.

Thanks

Last edited by shelja.fet@mriu.edu.in; 07-30-2015 at 10:17 PM.
 
Old 07-31-2015, 04:49 AM   #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
If your question is about plain UM-OLSR for ns-2.35 :

The latest build example is here , 'May 07, 2015; 9:50pm' :
http://network-simulator-ns-2.7690.n...13.html#a30020
( Ref. http://network-simulator-ns-2.7690.n...olsr&sort=date )

And post #19 here :
http://www.linuxquestions.org/questi...224/page2.html

Other OLSR info :
. http://network-simulator-ns-2.7690.n...olsr&sort=date
. http://www.linuxquestions.org/questions/tags/olsr/


-

Last edited by knudfl; 07-31-2015 at 04:51 AM.
 
1 members found this post helpful.
Old 08-05-2015, 10:35 AM   #3
shelja.fet@mriu.edu.in
Member
 
Registered: Jan 2014
Location: INDIA
Posts: 31

Original Poster
Rep: Reputation: 0
Thanks Knudfl, for providing valuable links.

I have already patched and installed "um-olsr-1.0.tgz" on ns-2.35, ubuntu 12.04 and able to successfully simulate it. I, have another patch of "um-olsr", in which some changes have been made in algorithm of the protocol but it's implemented on ns-2.29. Now, i want to run the same modified patch on ns-2.35, but trying to find out, what changes are to be made, in which files to make it working on ns-2.35.

I want to keep both olsr patches in the same ns-2.35 folder.
Initially, i copied the modified code of um-olsr for version ns-2.29 in the folder ns-2.35 but unsuccessful in running the command:
Code:
s@s-Vostro-1440:~/experiment/ns-allinone-2.35/ns-2.35$ tar zxvf new-olsr.tgz
so, i manually placed the folder containing all relevant files in ns-2.35 and named that folder "new-olsr".
after that i tried to patch but getting errors.
Code:
s@s-Vostro-1440:~/experiment/ns-allinone-2.35/ns-2.35$ patch -p1<new-olsr/um-olsr_ns-2.35_v0.8.8.patch
patching file Makefile.in
Hunk #1 FAILED at 250.
1 out of 1 hunk FAILED -- saving rejects to file Makefile.in.rej
patching file common/packet.h
Hunk #1 FAILED at 166.
Hunk #2 FAILED at 263.
2 out of 2 hunks FAILED -- saving rejects to file common/packet.h.rej
patching file queue/priqueue.cc
Hunk #1 FAILED at 90.
1 out of 1 hunk FAILED -- saving rejects to file queue/priqueue.cc.rej
patching file tcl/lib/ns-agent.tcl
Hunk #1 succeeded at 204 with fuzz 2 (offset 12 lines).
patching file tcl/lib/ns-default.tcl
Hunk #1 FAILED at 1369.
1 out of 1 hunk FAILED -- saving rejects to file tcl/lib/ns-default.tcl.rej
patching file tcl/lib/ns-lib.tcl.........
Please suggest, what changes have to be done, in which files... so that modified code of um-olsr, implemented on one version-ns-2.29 can be successfully patched, installed and run on ns-2.35.

Last edited by shelja.fet@mriu.edu.in; 08-05-2015 at 10:38 AM.
 
Old 08-05-2015, 10:46 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
Re #3.

Please read the files ...
ns-2.35/Makefile.in.rej
ns-2.35/common/packet.h.rej
ns-2.35/queue/priqueue.cc.rej
ns-2.35/ns-default.tcl.rej
.... and compare with the files to be used :
Makefile.in, packet.h, priqueue.cc, ns-default.tcl
... to check if there really are any differences / issues.

-
 
Old 08-05-2015, 10:54 AM   #5
shelja.fet@mriu.edu.in
Member
 
Registered: Jan 2014
Location: INDIA
Posts: 31

Original Poster
Rep: Reputation: 0
Thanks,

ok, will check and revert back to you,in case of any doubt.
 
Old 08-16-2015, 11:32 AM   #6
shelja.fet@mriu.edu.in
Member
 
Registered: Jan 2014
Location: INDIA
Posts: 31

Original Poster
Rep: Reputation: 0
Quote:
Please read the files ...
ns-2.35/Makefile.in.rej
ns-2.35/common/packet.h.rej
ns-2.35/queue/priqueue.cc.rej
ns-2.35/ns-default.tcl.rej
.... and compare with the files to be used :
Makefile.in, packet.h, priqueue.cc, ns-default.tcl
... to check if there really are any differences / issues.
Rejections files as a resultant of patching, contain some statements from the files
Makefile.in, packet.h, priqueue.cc, ns-default.tcl...
Not getting what is to be done exactly.
The modified code of OLSR is successfully implemented on ns-2.29. I have UM-OLSR running on NS-2.35, UBUNTU 12.04. Now, i am planning to have lower version ns-2.29.3 on the same machine to run that modified patch of OLSR on my machine. So, please reply if two different versions of ns namely ns-2.29 and ns-2.35 can reside and work simultaneously on the same machine.

Last edited by shelja.fet@mriu.edu.in; 08-16-2015 at 11:35 AM.
 
Old 08-16-2015, 12:30 PM   #7
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
Re #6.

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

Simply copy all the "ns-<any-name>" to /usr/local/bin/.

Like :
$ sudo cp ns229-olsr /usr/local/bin/
$ sudo cp ns229-olsr-modified /usr/local/bin/
$ sudo cp ns235-olsr /usr/local/bin/
See http://network-simulator-ns-2.7690.n...13.html#a30015


-
 
Old 08-30-2015, 02:40 AM   #8
shelja.fet@mriu.edu.in
Member
 
Registered: Jan 2014
Location: INDIA
Posts: 31

Original Poster
Rep: Reputation: 0
OTCL File make error in installing ns-2.29.3 on Ubuntu 12.04

hi,

I am getting the following make error upon running $./install command in ns-allinone-2.29 on ubuntu 12.04. I have already running installation of ns-2.35 on the same machine.
Code:
//Error on running $./install in ns-allinone-2.29 directory

config.status: creating Makefile
rm -f libotcl.so otcl.o so_locations
gcc -c -g -O2 -DNDEBUG -DUSE_SHM -fpic -I. -I/home/s/ns-allinone-2.29/include -I/home/s/ns-allinone-2.29/include -I/home/s/ns-allinone-2.29/include -I/include  otcl.c
ld -shared -o libotcl.so otcl.o
otcl.o: In function `OTclDispatch':
/home/s/ns-allinone-2.29/otcl-1.11/otcl.c:495: undefined reference to `__stack_chk_fail_local'
otcl.o: In function `Otcl_Init':
/home/s/ns-allinone-2.29/otcl-1.11/otcl.c:2284: undefined reference to `__stack_chk_fail_local'
ld: libotcl.so: hidden symbol `__stack_chk_fail_local' isn't defined
ld: final link failed: Bad value
make: *** [libotcl.so] Error 1
otcl-1.11 make failed! Exiting ...
for this error, already replaced
Code:
SHLIB_LD="ld -shared"
with
Code:
  SHLIB_LD="gcc -shared"
under the folder otcl-1.11/configure.in

Please Suggest....
 
Old 08-30-2015, 03:28 AM   #9
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
Re #8.

'ns-allinone-2.29.3' : This version is an update to use gcc-4.1.2, no later gcc, please.

The build command is $ export CC=gcc41 CXX=g++41 && ./install

? Which version of Ubuntu are you using ? ?
a) Please show the reply from the command $ uname -m
b) $ cat /etc/issue

... When your OS has been specified, you can get links to the compilers.


-
 
Old 08-31-2015, 12:02 PM   #10
shelja.fet@mriu.edu.in
Member
 
Registered: Jan 2014
Location: INDIA
Posts: 31

Original Poster
Rep: Reputation: 0
Installed NS-2.29.3 on UBUNTU 12.04, some tests failed in $ ./validate

Re #9.

Thanks Knudfl for your response, I am using UBUNTU-12.04.
Code:
s@s-Vostro-1440:~$ uname -m 
i686 
s@s-Vostro-1440:~$ cat /etc/issue 
Ubuntu 12.04.2 LTS \n \l
I have downloaded "gcc41-compat" and "g++41-compat".
After that i successfully executed:
Code:
$ sudo dpkg -i gcc41-compat-4.1.2.ubu1204_i386.deb
$ sudo dpkg -i g++41-compat-4.1.2_i386.deb
$ which gcc41
$ /usr/gcc41/bin/gcc41
$ cd ns-allinone-2.29/ && export CC=gcc41 CXX=g++41
./ Install is successful in ns-allinone-2.29 with the following message:
Code:
//successful ./install in ns-allinone-2.29 directory
$ ./install

Please put /home/s/ns-allinone-2.29/bin:/home/s/ns-allinone-2.29/tcl8.4.11/unix:/home/s/ns-allinone-2.29/tk8.4.11/unix
into your PATH environment; so that you'll be able to run itm/tclsh/wish/xgraph.

IMPORTANT NOTICES:

(1) You MUST put /home/s/ns-allinone-2.29/otcl-1.11, /home/s/ns-allinone-2.29/lib, 
    into your LD_LIBRARY_PATH environment variable.
    If it complains about X libraries, add path to your X libraries 
    into LD_LIBRARY_PATH.
    If you are using csh, you can set it like:
		setenv LD_LIBRARY_PATH <paths>
    If you are using sh, you can set it like:
		export LD_LIBRARY_PATH=<paths>

(2) You MUST put /home/s/ns-allinone-2.29/tcl8.4.11/library into your TCL_LIBRARY environmental
    variable. Otherwise ns/nam will complain during startup.

(3) [OPTIONAL] To save disk space, you can now delete directories tcl8.4.11 
    and tk8.4.11. They are now installed under /home/s/ns-allinone-2.29/{bin,include,lib}

After these steps, you can now run the ns validation suite with
cd ns-2.29; ./validate

For trouble shooting, please first read ns problems page 
http://www.isi.edu/nsnam/ns/ns-problems.html. Also search the ns mailing list archive
for related posts.
but without adding any path information, ./validate is not successful in ./ns-2.29, some tests failed
Code:
//After running validate in ns-2.29
Test output agrees with reference output
All test output agrees with reference output.
Mon Aug 31 14:47:08 IST 2015
These messages are NOT errors and can be ignored:
    warning: using backward compatibility mode
    This test is not implemented in backward compatibility mode


validate overall report: some tests failed:
     ./test-all-session ./test-all-red
to re-run a specific test, cd tcl/test; ./test-all-TEST-NAME
Notice that some tests in webcache will fail on freebsd when -O is turned on.
This is due to some event reordering, which will disappear when -g is turned on.
I already have working installation of NS-2.35 on the same machine on same OS-UBUNTU-12.04.should I add paths as mentioned as a result of ./install command in ns-allinone-2.29?? as previously you have mentioned in post #7
Quote:
Re #6.

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

Simply copy all the "ns-<any-name>" to /usr/local/bin/.
but when i installed NS-2.35 for the first time i have added path information and used $ sudo gedit bash.bashrc and set path information for PATH=$PATH:<....>, LD_LIBRARY_PATH=$LD_LIBRARY_PATH:<....>-for otcl1.14 file and TCL_LIBRARY=$TCL_LIBRARY:<....>-for tcl8.5.10.

Now what should i do? I want to keep both running installations of ns-2.35 and ns-2.29 on ubuntu 12.04.
Should i remove path information from ns-2.35? or what is to be done to successfuly validate ns-2.29??

please suggest....

Thanks & Regards

Last edited by shelja.fet@mriu.edu.in; 08-31-2015 at 12:03 PM.
 
Old 08-31-2015, 12:48 PM   #11
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
Re #10.
Quote:
when I installed NS-2.35 for the first time,
I have added path information and used $ sudo gedit bash.bashrc
Just delete the entries you have made to .bashrc .
.. Or replace the file bashrc with the original one :
https://groups.google.com/forum/?fro...E/OVrwQLKwVlMJ >>> 30 Mar 2015.
Besides that : Do not use sudo for any ns2 commands.
'sudo' is for administrative tasks outside /home/ only.
Like copying ns-** to /usr/local/bin/.

* Note :
* The executable 'ns' or "ns-<any-name>" is hard coded to know the location of it`s libraries:
* ns-allinone-2.35/{ lib/*/*, bin/tcsh8* }.
* The old year ~1999 text ....
* "" Please put .... ,, IMPORTANT NOTICES: You MUST put .. ""
* ... was meant only for a "University Computer" : You had no write permissions to /usr/local/.


Quote:
validate overall report: some tests failed:
./test-all-session ./test-all-red
That's an exceptional good result.
Please remember that the original ns-2.29 was tested with CentOS4, 10 years ago !
A dozen of failed group tests is quite common with a modern OS, some ns2 versions.


-
 
Old 09-01-2015, 12:15 PM   #12
shelja.fet@mriu.edu.in
Member
 
Registered: Jan 2014
Location: INDIA
Posts: 31

Original Poster
Rep: Reputation: 0
Re #11.

@Knudfl, Hi
Thanks for your time amd useful information.

I have used sudo outside /home/ only.
Quote:
Just delete the entries you have made to .bashrc .
.. Or replace the file bashrc with the original one :
https://groups.google.com/forum/?fro...E/OVrwQLKwVlMJ >>> 30 Mar 2015.
Besides that : Do not use sudo for any ns2 commands.
'sudo' is for administrative tasks outside /home/ only.
Like copying ns-** to /usr/local/bin/.
From the link you have mentioned in your post #11 , I have got the original bashrc-Ubuntu1404.txt file for UBUNTU14.04, but I am using UBUNTU 12.04 so, same file is to be used for Ubuntu 12.04?

As per your first suggestion
Quote:
Just delete the entries you have made to .bashrc
I have deleted the following lines from ~/.bashrc:
Code:
 s@s-Vostro-1440:~$ gedit ~/.bashrc
Quote:
export PATH=$PATH:/home/s/ns-allinone-2.35/bin:/home/s/ns-allinone-2.35/tcl8.5.10/unix:/home/s/ns-allinone-2.35/tk8.5.10/unix
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/s/ns-allinone-2.35/otcl-1.14:/home/s/ns-allinone-2.35/lib
export TCL_LIBRARY=$TCL_LIBRARY:/home/s/ns-allinone-2.35/tcl8.5.10/library
As per your suggestion to similar thread, then I run
Quote:
$ cd ns-allinone-2.34/ns-2.34/ && sudo make install
Code:
s@s-Vostro-1440:~/OLSR/ns-allinone-2.35/ns-2.35$ ns
The program 'ns' is currently not installed.  You can install it by typing:
sudo apt-get install ns2
s@s-Vostro-1440:~/OLSR/ns-allinone-2.35/ns-2.35$ sudo make install
[sudo] password for s: 
for d in /usr/local/man/man1; do \
		if [ ! -d $d ]; then \
			mkdir -p $d ;\
		fi;\
	done
/usr/bin/install -c -m 755 ns /usr/local/bin
/usr/bin/install -c -m 644 ns.1 /usr/local/man/man1
s@s-Vostro-1440:~/OLSR/ns-allinone-2.35/ns-2.35$ ns
application-specific initialization failed: Can't find a usable init.tcl in the following directories: 
    :/home/s/ns-allinone-2.35/tcl8.5.10/library /home/s/ns-allinone-2.35/lib/tcl8.5 /usr/local/lib/tcl8.5 /usr/lib/tcl8.5 /usr/local/library /usr/library /usr/tcl8.5.10/library /tcl8.5.10/library


This probably means that Tcl wasn't installed properly.


s@s-Vostro-1440:~/ns-allinone-2.29$ ns
application-specific initialization failed: Can't find a usable init.tcl in the following directories: 
    :/home/s/ns-allinone-2.35/tcl8.5.10/library /home/s/ns-allinone-2.35/lib/tcl8.5 /usr/local/lib/tcl8.5 /usr/lib/tcl8.5 /usr/local/library /usr/library /usr/tcl8.5.10/library /tcl8.5.10/library


This probably means that Tcl wasn't installed properly.
Is it going right way?

Last edited by shelja.fet@mriu.edu.in; 09-01-2015 at 12:18 PM.
 
Old 09-01-2015, 03:49 PM   #13
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
Re #12.

'.bashrc', Ubuntu 12.04 : A little different (The 1404 version is probably an update.)
The original "bashrc-Ubuntu1204.txt" is here ...
https://drive.google.com/file/d/0B7S...ew?usp=sharing


Quote:
Can't find a usable init.tcl in the following directories: ....
? May be you moved the directory "ns-allinone-2.35/" away from the build location ?
'ns-allinone-2.xx' must be built in /home/<name>/<ns2>/ . (! Not the Desktop/.)
And if you move it to another location :
A copy of ns-allinone-2.xx/{lib/, bin/} must be present in the build location.

Besides that : Do not use plain 'ns' in a command. See post #7 :
$ cd ns-allinone-2.3x/ns-2.3x/ && sudo cp ns ns23x-olsr
$ sudo cp ns23x-olsr /usr/local/bin/
.. And for ns235 do the simulation like $ ns235-olsr ddebbie90-scenario.tcl
.. Etc. etc. from the examples : umolsr-examples-04.04.2015.tar.gz
https://drive.google.com/file/d/0B7S...ew?usp=sharing


-

Last edited by knudfl; 09-01-2015 at 03:51 PM.
 
Old 09-02-2015, 12:41 PM   #14
shelja.fet@mriu.edu.in
Member
 
Registered: Jan 2014
Location: INDIA
Posts: 31

Original Poster
Rep: Reputation: 0
Re #13.

Hi Knudfl,

Thank you very much for your kind cooperation.

Quote:
? May be you moved the directory "ns-allinone-2.35/" away from the build location ?
'ns-allinone-2.xx' must be built in /home/<name>/<ns2>/ . (! Not the Desktop/.)
No, I have not moved any NS installation on the desktop. Both ns-allinone-2.35 and ns-allinone-2.29 resides in /home/anyName/ns-allinone-2.x.x/.

I have just replaced the .bashrc file with yours in post # 13: "bashrc-Ubuntu1204.txt" and both ns-2.35 and ns-2.29 are running successfuly.

Moreover, as per your suggestion I have created copies of executable ns with different names in /usr/local/bin/. Now, I am able to successfuly run commands:
Quote:
$ns or $ns235-olsr or $ns229
Now, I have to patch and configure modified-olsr patch to already running installation of ns-2.29. So, as per your replies to similar threads, is it necessary to again run ./install in ns-allinone-2.29 directory after patching and configuring the protocol??

Thanks & Regards

Last edited by shelja.fet@mriu.edu.in; 09-02-2015 at 12:44 PM.
 
Old 09-02-2015, 01:39 PM   #15
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
Re #14.
Quote:
Is it necessary to again run ./install in ns-allinone-2.29
.. after patching and configuring the protocol ? ?
Would not be $ ./install, but $ export CC=gcc41 CXX=g++41 && ./install
Or in ns-2.29/ :
$ export CC=gcc41 CXX=g++41 && ./configure && make clean && make


But why not set up a new ns-allinone-2.29.3 in a new directory,
then you still have the original.

-
 
  


Reply

Tags
ns2, olsr



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
OLSR patch sukrutha Linux - Newbie 24 05-03-2016 05:51 AM
OLSR patch in ns-2.34 kostaskar Linux - Newbie 6 08-30-2014 02:07 AM
Combine um-olsr patch and Directional antenna patch ws19561986 Linux - Newbie 1 04-17-2014 12:18 PM
Does olsr protocol can run successfully on ubuntu 12.04 shelja.fet@mriu.edu.in Linux - Newbie 20 02-16-2014 01:33 PM
OLSR patch sukrutha Linux - Newbie 2 08-21-2011 07:51 AM

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

All times are GMT -5. The time now is 02:45 PM.

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