LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to add Multiple protocol patches for ns2 2.35 in same directory ? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-add-multiple-protocol-patches-for-ns2-2-35-in-same-directory-4175627845/)

aroneasadas 04-17-2018 08:37 AM

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?

knudfl 04-17-2018 09:19 AM

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*' }

-

aroneasadas 04-17-2018 10:19 AM

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?

knudfl 04-17-2018 10:58 AM

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".

-

aroneasadas 04-17-2018 11:33 AM

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!


knudfl 04-17-2018 03:03 PM

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!

-

aroneasadas 04-18-2018 02:19 AM

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 ?

knudfl 04-18-2018 06:44 AM

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

-

aroneasadas 04-18-2018 06:47 AM

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 ???

knudfl 04-18-2018 07:28 AM

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'.

-

aroneasadas 04-18-2018 07:40 AM

Thank you for your help,can i get get some cbrp specific examples?

knudfl 04-18-2018 11:44 AM

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

-

aroneasadas 04-18-2018 09:04 PM

Code:

ns: finish: couldn't execute "nam": no such file or directory
now i am missing the nam, installing nam solve the problems?

knudfl 04-19-2018 05:55 AM

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


-

aroneasadas 04-19-2018 06:17 AM

Thank you for your help :)


All times are GMT -5. The time now is 12:55 PM.