LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 09-30-2014, 06:28 AM   #1
huangguanglun
LQ Newbie
 
Registered: Sep 2014
Posts: 10

Rep: Reputation: Disabled
how to add a simple protocol into ns2.34?


Hi,everybody, i want to add a new protocol into ns2.34, but i don't know the mechanism of this process, can anyone give me some booklet about it?? thank you!!
 
Old 09-30-2014, 07:57 AM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2020 CentOS6.10 CentOS7.7 + 50+ other Linux OS, for test only.
Posts: 17,402

Rep: Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611
No books, I think.

The most common way is, example :
$ cd ns-allinone-2.34/
$ patch -p0 < [new-protocol]_ns234.patch

.. Or, if you have a "patch package" that contains a folder 'ns-2.34':
.. And, it is again an example :
$ tar xvf [new-protocol]_ns234.tar.gz
$ export CC=gcc-4.4 CXX=g++-4.4 && install

Example protocols, see post #3 here, and how to search those at LQ :
http://www.linuxquestions.org/questi...s2-4175479853/

If you have made up your own changes to some files.cc, .h in ns-2.34:
$ cd ns-allinone-2.34/ns-2.34/ && make clean
$ cd ../ && export CC=gcc-4.4 CXX=g++-4.4 && install (example.)

-
 
Old 09-30-2014, 09:55 AM   #3
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2020 CentOS6.10 CentOS7.7 + 50+ other Linux OS, for test only.
Posts: 17,402

Rep: Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611
How to add a simple protocol in ns2.34

An example is in the ns2 documentation / tutorial :
http://www.isi.edu/nsnam/ns/tutorial/nsnew.html
→ → Clarifying the text about `Makefile´ ...
( It should actually be the Makefile.in ) :
Ns-2.34 : The additional lines are added after line 231 ...
<TAB>common/sessionhelper.o queue/delaymodel.o \
<TAB>mcast/srm-ssm.o mcast/srm-topo.o \
<TAB>ping/ping.o \
<TAB>$(LIB_DIR)int.Vec.o $(LIB_DIR)int.RVec.o \
<TAB>$(LIB_DIR)dmalloc_support.o \
... where "ping/" is a new folder with ping.cc .

* New objects can often be added to the end of section OBJ_CC,
Makefile.in, after line 330, like ..
<TAB/apps/pbc.o \
<TAB>new-folder/new.o \
<TAB>@V_STLOBJ@


The complete tutorial http://www.isi.edu/nsnam/ns/tutorial/
( The tutorial is old :
Hence the missing directory names in the Makefile* text.)
Ns2 documentation http://www.isi.edu/nsnam/ns/doc/index.html

* Another good example http://elmurod.net/en/index.php/archives/157


-

Last edited by knudfl; 09-30-2014 at 10:13 AM.
 
  


Reply

Tags
ns2


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
ns2 Simple MAC protocol modification for adding primary users in cognitive radio MahmoudAlaa Programming 9 07-23-2014 03:00 AM
I add new protocol in ns-2 name "Multi-Level feedback Congestion Control Protocol" bhavinsorathiya Linux - Software 6 02-15-2014 10:06 AM
I add new protocol in ns-2 name "binary marking congestion protocol(bmcc )" bhavinsorathiya Linux - Software 10 01-16-2014 08:18 AM
i am using ubuntu as os. for NS2 to implement a routing protocol in ns2. sujovasu Programming 1 07-27-2010 01:44 AM
weight throwing protocol using ns2 code,diffusion based protocol using ns2 code rajrupa Linux - Networking 1 05-27-2010 03:39 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

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