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-17-2018, 08:37 AM   #1
aroneasadas
LQ Newbie
 
Registered: Mar 2018
Posts: 12

Rep: Reputation: Disabled
How to add Multiple protocol patches for ns2 2.35 in same directory ?


I want more protocols than the default protocols provided in ns2.Already patch ns2 2.35 with olsr protocol now i want to patch ns2 with ZRP,CBRP protocols

How to add new protocols to the existing ones ?
Do i have to patch the ns2 individually for every patch?
 
Old 04-17-2018, 09:19 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
Why do you want all the extra protocols in the same ns-2.35/ ?
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.

Some extra protocols will conflict.
OLSR + ZRP + CBRP might be possible.

P.S. :
You can find the current patches with multiple extra protocols here
https://drive.google.com/drive/folde...00?usp=sharing

And https://drive.google.com/file/d/12OS...ew?usp=sharing
→ /usr/local/bin/{ 92 executable 'ns*' }

-

Last edited by knudfl; 04-17-2018 at 09:29 AM.
 
1 members found this post helpful.
Old 04-17-2018, 10:19 AM   #3
aroneasadas
LQ Newbie
 
Registered: Mar 2018
Posts: 12

Original Poster
Rep: Reputation: Disabled
Why do you want all the extra protocols in the same ns-2.35/ ?

I want to compare their performance for a certain scenario

You can have as many ns-allinone-2.xx as you want, installed at the same time.

Does that mean i can install two ns2 2.35 in different directories with different patches ?

if it so , then how i give the terminal command to execute the tcl files?

just typing ns filename.tcl would be enough?
 
Old 04-17-2018, 10:58 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

As you can see from https://drive.google.com/file/d/12OS...ew?usp=sharing
... I currently have ~90 different ns-allinone-2.xx in use, mostly 64bit.
( When ns2 was used most a few years ago I had ~200 32bits installs.)
( Space used for every "cleaned ns-allinone-2" is about 10MB.)
https://drive.google.com/file/d/1g33...ew?usp=sharing

So you can easily have a few. ... Example
Code:
/home/name/ns2/cbrp/ns-allinone-2.35/
/home/name/ns2/olsr/ns-allinone-2.35/
/home/name/ns2/zrp/ns-allinone-2.35/
If you want to simulate with "multiple protocol node-config":
... I can create a patch with the extra protocols, if no conflicts.
Example: "zrp+cbrp_for-OLSR-patched_ns235.patch".

-

Last edited by knudfl; 04-17-2018 at 11:03 AM.
 
2 members found this post helpful.
Old 04-17-2018, 11:33 AM   #5
aroneasadas
LQ Newbie
 
Registered: Mar 2018
Posts: 12

Original Poster
Rep: Reputation: Disabled
Space used for every "cleaned ns-allinone-2" is about 10MB. that's a good idea

ns2 is a 32 bit software right ? then how can you use 64 bit installs?


when i try to patch ns2 2.35 (after clean install of ns2 2.35 ubuntu mate 16.04 64 bits)for cbrp protocol

i use the CBRP+LTE_ns235.patch

and followed these commands


cd /home/arone/programs/ns-allinone-2.35

i already copy patch to ns-allinone-2.35

patch -p0 < CBRP+LTE_ns235.patch

then

sudo ./install

but it gives the errors like this in terminal. what should i do ?? what's the mistake i made ?

Code:
In file included from cbrp/cbrpagent.h:27:0,
                 from cbrp/cbrpagent.cc:9:
cbrp/ntable.h:89:30: error: expected ‘)’ before ‘*’ token
     NeighborTable(CBRP_Agent *a_);
                              ^
cbrp/ntable.h:141:5: error: ‘NeighborTableCContentionHandler’ does not name a type
     NeighborTableCContentionHandler *c_contention_handler;
     ^
cbrp/ntable.h:150:5: error: ‘CBRP_Agent’ does not name a type
     CBRP_Agent *a;
     ^
cbrp/ntable.h:166:45: error: expected ‘)’ before ‘*’ token
     NeighborTablePeriodicHandler(CBRP_Agent *a_, NeighborTable *t_);
                                             ^
cbrp/ntable.h:172:5: error: ‘CBRP_Agent’ does not name a type
     CBRP_Agent *a;
     ^
cbrp/ntable.h:179:44: error: expected ‘)’ before ‘*’ token
     NeighborTableTimeoutHandler(CBRP_Agent *a_, NeighborTable *t_); 
                                            ^
cbrp/ntable.h:184:5: error: ‘CBRP_Agent’ does not name a type
     CBRP_Agent *a;
     ^
cbrp/ntable.h:190:47: error: expected ‘)’ before ‘*’ token
     NeighborTableCFormationHandler(CBRP_Agent *a_, NeighborTable *t_);
                                               ^
cbrp/ntable.h:195:5: error: ‘CBRP_Agent’ does not name a type
     CBRP_Agent *a;
     ^
cbrp/ntable.h:201:48: error: expected ‘)’ before ‘*’ token
     NeighborTableCContentionHandler(CBRP_Agent *a_, NeighborTable *t_);
                                                ^
cbrp/ntable.h:206:5: error: ‘CBRP_Agent’ does not name a type
     CBRP_Agent *a;
     ^
cbrp/cbrpagent.cc: In constructor ‘CBRP_Agent::CBRP_Agent()’:
cbrp/cbrpagent.cc:296:34: error: no matching function for call to ‘NeighborTable::NeighborTable(CBRP_Agent*)’
   ntable = new NeighborTable(this);
                                  ^
In file included from cbrp/cbrpagent.h:27:0,
                 from cbrp/cbrpagent.cc:9:
cbrp/ntable.h:79:7: note: candidate: NeighborTable::NeighborTable()
 class NeighborTable {
       ^
cbrp/ntable.h:79:7: note:   candidate expects 0 arguments, 1 provided
cbrp/ntable.h:79:7: note: candidate: NeighborTable::NeighborTable(const NeighborTable&)
cbrp/ntable.h:79:7: note:   no known conversion for argument 1 from ‘CBRP_Agent*’ to ‘const NeighborTable&’
cbrp/cbrpagent.cc: In member function ‘virtual void CBRP_SendBufferTimer::expire(Event*)’:
cbrp/cbrpagent.cc:436:57: error: cast from ‘Event*’ to ‘int’ loses precision [-fpermissive]
   resched(BUFFER_CHECK + BUFFER_CHECK * (double) ((int) e>>5 & 0xff) / 256.0);
                                                         ^
cbrp/cbrpagent.cc: In member function ‘void CBRP_Agent::handlePktWithoutSR(CBRP_Packet&, bool)’:
cbrp/cbrpagent.cc:653:13: warning: unused variable ‘cbrph’ [-Wunused-variable]
   hdr_cbrp *cbrph =  HDR_CBRP(p.pkt);
             ^
cbrp/cbrpagent.cc: In member function ‘int CBRP_Agent::handleRREP(CBRP_Packet&)’:
cbrp/cbrpagent.cc:875:25: error: ‘CBRP_XmitFailureCallback’ was not declared in this scope
   cmnh->xmit_failure_ = CBRP_XmitFailureCallback;
                         ^
cbrp/cbrpagent.cc: In member function ‘int CBRP_Agent::UnicastRREQ(CBRP_Packet&, nsaddr_t)’:
cbrp/cbrpagent.cc:1375:25: error: ‘CBRP_XmitFailureCallback’ was not declared in this scope
   cmnh->xmit_failure_ = CBRP_XmitFailureCallback;
                         ^
cbrp/cbrpagent.cc: In member function ‘void CBRP_Agent::sendOutPacketWithRoute(CBRP_Packet&, bool, Time)’:
cbrp/cbrpagent.cc:1572:25: error: ‘CBRP_XmitFailureCallback’ was not declared in this scope
   cmnh->xmit_failure_ = CBRP_XmitFailureCallback;
                         ^
Makefile:93: recipe for target 'cbrp/cbrpagent.o' failed
make: *** [cbrp/cbrpagent.o] Error 1
Ns make failed!

Last edited by aroneasadas; 04-17-2018 at 09:27 PM.
 
Old 04-17-2018, 03:03 PM   #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
Re #5. Please put the error output in code Tags :
[code]code text[/code]
→ The 'Edit' button in post #5.

ns2 : Most protocols can run with a 64bits OS.
A few of the older protocols can only use a 32bits OS.
Not all simulations can run with a 64bits OS: A 32bits executable ns* is required.
But usually no problem, as the 32bits application packages can be installed to the 64bits OS https://drive.google.com/drive/folde...FE?usp=sharing

About the CBRP errors : The old cbrp code must be compiled with g++34.
Code:
tar xvf ns-allinone-2.35_gcc5.tar.gz
https://drive.google.com/file/d/0B7S...ew?usp=sharing
cd ns-allinone-2.35/
patch -p0 < CBRP+LTE_ns235.patch
https://drive.google.com/file/d/0B7S...ew?usp=sharing
./install
                       // Stops with error in ns-2.35/cbrp/*
cd ns-2.35/    
                       // Edit the Makefile line 37 to CPP    = g++34
make
                       // Stops with errors. Edit the Makefile to g++
make

cp ns ns235-cbrp-lte
sudo cp ns235-cbrp-lte /usr/local/bin/
Links to gcc34, g++34 (gcc-3.4.6) : When you specify your Ubuntu 16.04:
Is the OS 32 or 64bits ?

Note : It's './install', not 'sudo ./install' → sudo will change the permissions!

-

Last edited by knudfl; 04-17-2018 at 03:05 PM.
 
1 members found this post helpful.
Old 04-18-2018, 02:19 AM   #7
aroneasadas
LQ Newbie
 
Registered: Mar 2018
Posts: 12

Original Poster
Rep: Reputation: Disabled
Links to gcc34, g++34 (gcc-3.4.6) : is the links are missing ??

when i install the old gcc does it cause conflicts with other software ?
 
Old 04-18-2018, 06:44 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
Re #7.

You will get link information when you tell if your Ubuntu 16.04 is 32 or 64bits (i386 or amd64).

This command will reply with i686 or x86_64 :
$ uname -m

You can have as many gcc versions as you want installed at the same time.

Default Ubuntu 16.04 gcc / g++ :
g++ (=g++-5.4.0), g++-4.7, g++-4.8, g++-4.9

-
 
1 members found this post helpful.
Old 04-18-2018, 06:47 AM   #9
aroneasadas
LQ Newbie
 
Registered: Mar 2018
Posts: 12

Original Poster
Rep: Reputation: Disabled
i already mention its 64 bit , when i edited post #5 i also included it

i use ubuntu 16.04 64 bit version

cp ns ns235-cbrp-lte
sudo cp ns235-cbrp-lte /usr/local/bin/

above two steps are necessary ?

// Stops with errors. Edit the Makefile to g++
make

after make command do i have to type ./install again ?? or cbrp already installed ???

Last edited by aroneasadas; 04-18-2018 at 07:10 AM.
 
Old 04-18-2018, 07:28 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
Re #9. See #6.

The text says
./install
$ cd ns-2.35/
.... edit Makefile
$ make
.... edit Makefile
$ make


Quote:
or cbrp already installed ???
Nothing gets installed.
That's what you do with $ sudo cp ns235-cbrp-lte /usr/local/bin/

"./install" is the build command.
Meant to take care of all ./configure and 'make'.

-
 
1 members found this post helpful.
Old 04-18-2018, 07:40 AM   #11
aroneasadas
LQ Newbie
 
Registered: Mar 2018
Posts: 12

Original Poster
Rep: Reputation: Disabled
Thank you for your help,can i get get some cbrp specific examples?
 
Old 04-18-2018, 11:44 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
Links, gcc34 and g++34
compat-gcc34-3.4.6-ubuntu1204-1_amd64.deb ( Ubuntu 12* ... 17* - 64 )
https://drive.google.com/file/d/0B7S...ew?usp=sharing
compat-gcc-34-c++_3.4.6-20_amd64.deb ( All 64bit Ubuntu versions )
https://drive.google.com/file/d/0B7S...ew?usp=sharing

Download, and install :
Code:
cd Downloads/
sudo gdebi compat-gcc34-3.4.6-ubuntu1204-1_amd64.deb
sudo gdebi compat-gcc-34-c++_3.4.6-20_amd64.deb
All ~3000 simulation examples https://drive.google.com/drive/folde...Ws?usp=sharing

cbrp-examples-2.tar.gz
https://drive.google.com/file/d/1Bs7...ew?usp=sharing

-
 
1 members found this post helpful.
Old 04-18-2018, 09:04 PM   #13
aroneasadas
LQ Newbie
 
Registered: Mar 2018
Posts: 12

Original Poster
Rep: Reputation: Disabled
Code:
ns: finish: couldn't execute "nam": no such file or directory
now i am missing the nam, installing nam solve the problems?
 
Old 04-19-2018, 05:55 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
Re #13.

Install a NAM package for your OS
https://www.linuxquestions.org/quest...-4175524760/#2
. https://drive.google.com/file/d/0B7S...ew?usp=sharing

Download, and install ...
sudo gdebi Downloads/nam_1.15-10-ubuntu14_amd64.deb


-

Last edited by knudfl; 04-19-2018 at 05:58 AM.
 
1 members found this post helpful.
Old 04-19-2018, 06:17 AM   #15
aroneasadas
LQ Newbie
 
Registered: Mar 2018
Posts: 12

Original Poster
Rep: Reputation: Disabled
Thank you for your help
 
  


Reply

Tags
ns2, ns2 ns-allinone, protocol-ns2, zrp+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
hi. i want to add a new protocol in ns2.35 .i have problem with tclscript nertila Linux - Newbie 5 05-17-2017 12:11 PM
how to add mac protocol to ns2 ? Nesrine Linux - Newbie 1 04-10-2017 06:26 AM
Hello, How to add some fields in HELLO list in AODV protocol in NS2? jayashreemanoharan Linux - Newbie 1 10-26-2014 12:32 PM
how to add a simple protocol into ns2.34? huangguanglun Ubuntu 2 09-30-2014 09:55 AM

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

All times are GMT -5. The time now is 04:29 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