LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 01-23-2014, 01:56 AM   #1
rianariana
LQ Newbie
 
Registered: Nov 2013
Posts: 8

Rep: Reputation: Disabled
OSPF patch for ns-2.35


Can anybody please help me find an OSPF patch file for ns-2.35 kindly?

Regards
Riana
 
Old 01-23-2014, 07:44 AM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,301

Rep: Reputation: 3168Reputation: 3168Reputation: 3168Reputation: 3168Reputation: 3168Reputation: 3168Reputation: 3168Reputation: 3168Reputation: 3168Reputation: 3168Reputation: 3168
Actually quite simple :
1) $ tar xvf ns-allinone-2.35.tar.gz
2) $ cd ns-allinone-2.35/
3) $ ln -s ns-2.35/ ns-2.34
... Then the patch will work, except for one line. (commom/packet.h).
4) $ patch -p0 < 10-ospf4ns2.34-base.patch
http://sourceforge.net/projects/ospf4ns/
5) Replace commom/packet.h with the attached "packet.h" : Edited by hand.
6) export CC=gcc44 CXX=g++44 && ./install
... Or whatever gcc/g++ version 4.4.x you have available.

? Any questions ? Then please specify your OS :
a) $ uname -m
b) Tell the name and version of your OS.
-
Attached Files
File Type: txt packet.h.txt (24.5 KB, 128 views)
 
1 members found this post helpful.
Old 01-23-2014, 10:25 AM   #3
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,301

Rep: Reputation: 3168Reputation: 3168Reputation: 3168Reputation: 3168Reputation: 3168Reputation: 3168Reputation: 3168Reputation: 3168Reputation: 3168Reputation: 3168Reputation: 3168
The OSPF examples ..

http://sourceforge.net/projects/ospf...s/ospf4ns2.34/
>>> 20-ospf4ns2.34-examples.patch

$ cd ns-allinone-2.35/
$ patch -p0 < 20-ospf4ns2.34-examples.patch

Using : $ cd ns-2.35/
# make install

$ cd tcl/ex/ospf/
$ mkdir out_ospf0 out_ospf1 out_ospf2 out_ospf3 out_ospf4 out_ospf5 out_ospf6 out_ospf7 out_ospf8 out_ospf9
$ ns out_ospf0.tcl
... Etc. etc. : All the examples work OK, and will open a 'nam' window.

-

Last edited by knudfl; 01-23-2014 at 10:28 AM.
 
1 members found this post helpful.
Old 01-24-2014, 11:51 PM   #4
rianariana
LQ Newbie
 
Registered: Nov 2013
Posts: 8

Original Poster
Rep: Reputation: Disabled
I've already copied 10-ospf4ns2.34-base.patch to my ns-2.34 directory. But after that I can't install the file or any of the examples. I replaced the old common/packet.h by the new one.

I get the following messages:

l@ubuntu:~/ns-allinone-2.35/ns-2.34$ patch -p0 < 10-ospf4ns2.34-base.patchThe next patch would create the file ns-2.34/classifier/classifier-mtopology.cc,
which already exists! Assume -R? [n] y
patching file ns-2.34/classifier/classifier-mtopology.cc
The next patch would create the file ns-2.34/classifier/classifier-mtopology.h,
which already exists! Assume -R? [n] n
Apply anyway? [n] y
patching file ns-2.34/classifier/classifier-mtopology.h
Hunk #1 FAILED at 1.
1 out of 1 hunk FAILED -- saving rejects to file ns-2.34/classifier/classifier-mtopology.h.rej
can't find file to patch at input line 92
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|--- ns-2.34.old/common/agent.cc 2009-06-14 18:35:45.000000000 +0100
|+++ ns-2.34/common/agent.cc 2010-02-26 23:34:33.161063590 +0000

File to patch:

For installation I get these messages:

l@ubuntu:~/ns-allinone-2.35$ export CC=gcc44 CXX=g++44 && ./install

============================================================
* Build Stanford GraphBase
============================================================
Making sgb
gcc44 -g -I/usr/local/sgb/include test_io.c gb_io.o -o test_io
make: gcc44: Command not found
make: *** [test_io] Error 127
Unable to create sgb library, but it's optional, so continuing...
============================================================
* Build GT-ITM
============================================================
gcc -I../include -L../lib -DFBSD -o ../bin/itm itm.o geog.o ts.o dfs.o -lm -lgb
gcc -I../include -L../lib -DFBSD -o ../bin/sgb2alt sgb2alt.o -lm -lgb
gcc -I../include -L../lib -DFBSD -o ../bin/edriver edriver.o eval.o -lm -lgb
gt-itm has been installed successfully.
gcc -I../include -L../lib -o ../bin/sgb2comns sgb2comns.o -lm -lgb
gcc -I../include -L../lib -o ../bin/sgb2hierns sgb2hierns.o -lm -lgb
gcc -I../include -L../lib -o ../bin/sgb2ns sgb2ns.o -lm -lgb
sgb2ns has been installed successfully.
============================================================
* Build zlib
============================================================
Building static library libz.a version 1.2.3 with gcc44.
Checking for unistd.h... No.
Checking whether to use vs[n]printf() or s[n]printf()... using s[n]printf()
Checking for snprintf() in stdio.h... No.
WARNING: snprintf() not found, falling back to sprintf(). zlib
can build but will be open to possible buffer-overflow security
vulnerabilities.
Checking for return value of sprintf()... No.
WARNING: apparently sprintf() does not return a value. zlib
can build but will be open to possible string-format security
vulnerabilities.
Checking for errno.h... No.
Checking for mmap support... No.
make: Nothing to be done for `all'.
Zlib has been installed successfully.
============================================================
* Build tcl8.5.10
============================================================
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... gcc44
checking whether the C compiler works... no
configure: error: in `/home/amel/ns-allinone-2.35/tcl8.5.10/unix':
configure: error: C compiler cannot create executables
See `config.log' for more details
tcl8.5.10 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.
 
Old 01-25-2014, 07:14 AM   #5
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,301

Rep: Reputation: 3168Reputation: 3168Reputation: 3168Reputation: 3168Reputation: 3168Reputation: 3168Reputation: 3168Reputation: 3168Reputation: 3168Reputation: 3168Reputation: 3168
# 4 .

No reason to try anything at all before you have installed the right compiler.
In later Ubuntu's it is : $ sudo apt-get install g++-4.4

! You were asked to specify your OS. Nothing else.
! So please show the outputs from these commands :
$ uname -m <Enter>
$ cat /etc/issue <Enter>


Quote:
I've already copied 10-ospf4ns2.34-base.patch to my ns-2.34 directory.
... Which is the wrong location for the patch. Read post #2 :
Ref. 2) $ cd ns-allinone-2.35/
Ref. 4) $ patch -p0 < 10-ospf4ns2.34-base.patch
.... which means the patch location must be "ns-allinone-2.35/"
.... So please delete everything, and start from scratch with
a new unpacked ns-allinone-2.35.tar.gz .

With the gcc-4.4 / g++-4.4 compilers, the install command is :
$ export CC=gcc-4.4 CXX=g++-4.4 && ./install

-

Last edited by knudfl; 01-25-2014 at 07:18 AM.
 
Old 01-26-2014, 02:04 PM   #6
rianariana
LQ Newbie
 
Registered: Nov 2013
Posts: 8

Original Poster
Rep: Reputation: Disabled
I am having some problems while installing OSPF and OLSR patches. I thought of undoing everything whatever changes I made according to the errors shown in my terminal and complete whatever I was working on before installing the patches starting from the scratch.

But some of the trace files which worked fine with my awk scripts before, is not showing any output now after I was trying to work with the patches. (though I have deleted the files and directories which was made).

Before this when I did ./validate I had messages like 'all test were passed' but now when I do- ~/ns-allinone-2.35$ ./install it gives-

trace/cmu-trace.cc:57:31: fatal error: um-olsr/OLSR_pkt.h: No such file or directory
#include <um-olsr/OLSR_pkt.h>
^
compilation terminated.
make: *** [trace/cmu-trace.o] Error 1
Ns make failed!

My os is ubuntu 13.10, gcc-4.4 / g++-4.4 is already installed and CC=gcc44 CXX=g++44 was edited by hand from gedit ~/../Makefile.in.

If I bring back the um-olsr/OLSR_pkt.h by doing-

$ cd ns-allinone-2.35/ns-2.35/
$ tar zxvf um-olsr-1.0.tgz
$ ln -s ./um-olsr-1.0 ./olsr
$ patch -p1 < um-olsr/um-olsr_ns-2.35_v1.0.patch (I cannot patch, it shows errors in input line 5 and more...)

$ ./install

I get:

aomdv/aomdv_rqueue.cc:244:13: warning: variable Ďpreví set but not used [-Wunused-but-set-variable]
Packet *p, *prev = 0;
^
make: *** No rule to make target `olsr/OLSR.o', needed by `ns'. Stop.
Ns make failed!
See http://www.isi.edu/nsnam/ns/ns-problems.html for problems

How can I do the compilation properly as before, with or without the OLSR patch? The um-olsr-1.0.tgz link is:
http://sourceforge.net/projects/um-olsr/
Do I edit the part of olsr/OLSR.o (line 9) of the patch by um-olsr/OLSR.o and remove '+' from (Line 9 Col 1)?
And I don't understand why the awk files with the trace files which worked before is not working now?

Last edited by rianariana; 01-26-2014 at 02:21 PM.
 
Old 01-27-2014, 08:35 AM   #7
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,301

Rep: Reputation: 3168Reputation: 3168Reputation: 3168Reputation: 3168Reputation: 3168Reputation: 3168Reputation: 3168Reputation: 3168Reputation: 3168Reputation: 3168Reputation: 3168
# 6 .
Quote:
My os is ubuntu 13.10, gcc-4.4 / g++-4.4 is already installed
and CC=gcc44 CXX=g++44 was edited by hand from gedit ~/../Makefile.in.
Do not edit the Makefile.in, so far concerns the compiler lines.
And the compilers are not gcc44 / g++44 in Ubuntu, but gcc-4.4 / g++-4.4


Quote:
How can I do the compilation properly as before, with or without the OLSR patch ?
... um-olsr-1.0.tgz ...
May be, or may be not the two patches (ospf+olsr) can live together.
A new combined Makefile.in, etc. must be created :
The ospf patching seems to undo some olsr entries / files ?
I will check that later, with Ubuntu 13.10 - 32bits.
Which version is your "13.10" ? 32bits or 64bits ?
( ns2 is for 32bits.)

-

Last edited by knudfl; 01-27-2014 at 08:43 AM.
 
Old 01-27-2014, 02:11 PM   #8
rianariana
LQ Newbie
 
Registered: Nov 2013
Posts: 8

Original Poster
Rep: Reputation: Disabled
My system was originally ubuntu 13.04 later upgraded to 13.10 (64 bits).
Currently I removed the olsr and ospf parts and reinstalled ns-2.35.

Could you please also tell me one thing about a trace:

s 2.840932087 _1_ AGT --- 0 cbr 512 [0 0 0 0] ------- [1:0 2:0 32 0] [0] 0 1
r 2.853216693 _2_ AGT --- 0 cbr 532 [13a 2 1 800] ------- [1:0 2:0 30 2] [0] 1 1

If in the second square bracket 1:0 and 2:0 are the from node and to node respectively, do I assume these are in the 14th and 15th column i.e $14 and $15 respectively?

And if the third square bracket 0 is the tcp/cbr packet sequence, is this the 18th column?

Appreciating ur responses.......
 
  


Reply

Tags
ns2, ospf


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
ospf routing on linux 2.6 beno123 Linux - Networking 2 09-21-2005 01:57 AM
OSPF architecture overview kenneho Programming 1 09-14-2005 11:03 AM
Zebra and OSPF? caps_phisto Linux - Networking 0 12-28-2004 03:08 PM
ospf packet libraries!! shereen Linux - Networking 1 05-09-2004 05:33 PM
OSPF Routing Help cybercop12us Linux - Networking 0 10-09-2001 04:29 AM


All times are GMT -5. The time now is 03:12 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration