LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 02-23-2024, 12:57 PM   #1
nahid91
LQ Newbie
 
Registered: Oct 2023
Posts: 4

Rep: Reputation: 0
NS2


how to patch the zrp-ns235.patch and the ns2 security_ns235.patch so that i can use zrp with encyption
 
Old 02-23-2024, 02:37 PM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by nahid91 View Post
how to patch the zrp-ns235.patch and the ns2 security_ns235.patch so that i can use zrp with encyption
Essentially a duplicate of your other thread:
https://www.linuxquestions.org/quest...ol-4175733095/

At some point, you're going to have to do research on your own for your own homework. We aren't going to type up step-by-step instructions for you or look up things and give you links. There are several threads on this very site that answer this, along with many on any search-engine for "ns2.35 zrp encryption patch". Start there.
 
Old 02-23-2024, 03:21 PM   #3
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
The ns2 "Security" is not a genuine encryption, but is a very simple code.
security_ns235.patch
https://drive.google.com/file/d/0B7S...ew?usp=sharing

Patching an ns-2.35 which is already patched with zrp :
Code:
cd ns-allinone-2.35/
patch -p0 < security_ns235.patch
.... There is one file to edit: common/packet.h → Edit to
Code:
   203	static const packet_t PT_ZRP = 73; // [CHANGE-2(for_ZRP-AGENT) : Lines#2]
   204	
   205	static const packet_t PT_SECURITY_PACKET = 74;
   206		
   207	        // insert new packet types here
   208	static packet_t       PT_NTYPE = 75; // This MUST be the LAST one
For encryption, suggest code like "aodv + SSL" → saodv-with-ssl_ns235.diff
https://drive.google.com/file/d/1GCg...usp=drive_link
.... which is this in aodv.cc: +#include <openssl/aes.h> +#include <openssl/ec.h>
and Makefile.in (line 23) + -lcrypto @LIBS@ -lssl @LIBS@
? Might work with ZRP? zrp.cc ?
INFO http://www.linuxquestions.org/questi...67#post5305067 etc. posts https://www.linuxquestions.org/quest...raries-530848/

-

Last edited by knudfl; 02-23-2024 at 03:37 PM.
 
Old 02-24-2024, 12:23 AM   #4
nahid91
LQ Newbie
 
Registered: Oct 2023
Posts: 4

Original Poster
Rep: Reputation: 0
@knudfl so I tried to patch an ns-2.35 which is already patched with zrp as you have mentioned above and while running the
Code:
patch -p0 < security_ns235.patch
it shows me this error:
Code:
nahid@nahid-ROG-Strix-G614JU-G614JU:~/ns-allinone-2.35$ patch -p0 < security_ns235.patch
patching file ns-2.35/common/packet.h
Hunk #1 FAILED at 198.
Hunk #2 FAILED at 325.
2 out of 2 hunks FAILED -- saving rejects to file ns-2.35/common/packet.h.rej
patching file ns-2.35/Makefile.in
Reversed (or previously applied) patch detected!  Assume -R? [n] R
Apply anyway? [n] R
Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file ns-2.35/Makefile.in.rej
The next patch would create the file ns-2.35/README-Security,
which already exists!  Assume -R? [n] R
Apply anyway? [n] R
Skipping patch.
1 out of 1 hunk ignored
The next patch would create the file ns-2.35/security/security.cc,
which already exists!  Assume -R? [n] R
Apply anyway? [n] R
Skipping patch.
1 out of 1 hunk ignored
The next patch would create the file ns-2.35/security/security.h,
which already exists!  Assume -R? [n] R
Apply anyway? [n] R
Skipping patch.
1 out of 1 hunk ignored
The next patch would create the file ns-2.35/security/security.tcl,
which already exists!  Assume -R? [n] R
Apply anyway? [n] R
Skipping patch.
1 out of 1 hunk ignored
patching file ns-2.35/tcl/lib/ns-default.tcl
Hunk #1 succeeded at 1596 (offset 6 lines).
patching file ns-2.35/tcl/lib/ns-packet.tcl
Reversed (or previously applied) patch detected!  Assume -R? [n] R
Apply anyway? [n] R
Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file ns-2.35/tcl/lib/ns-packet.tcl.rej
i edited the packet.h file as you have stated. I am not sure why is it showing failed. I have tried multiple times it shows the same
 
Old 02-24-2024, 04:04 AM   #5
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 #4

The zrp + security sequence ....

Code:
tar xvf ns-allinone-2.35_gcc5.tar.gz
https://drive.google.com/file/d/0B7S...FDb7ul0VFk6FZQ
cd ns-allinone-2.35/
patch -p0 < zrp-ns235.patch
patch -p0 < security_ns235.patch
export CC=gcc-4.8 CXX=g++-4.8 && ./install
cd ns-2.35/
cp ns ns235-zrp+security
sudo cp ns235-zrp+security /usr/local/bin/
The packet.h.rej and the "patch.log" https://drive.google.com/drive/folde...usp=drive_link

Sorry, you will also have to add
Code:
		name_[PT_SECURITY_PACKET]= "Security_packet";
... to line ~333 in packet.h, see packet.h.rej
(So no real errors during patching but the 2 edits in common/packet.h)

Alternatively, you can setup a new ns-allinone-2.35/ in a new folder in /home/name/ns2/, and use the new patch zrp+security_ns235.patch
https://docs.google.com/document/d/1...usp=share_link
i.e. you can have as many ns-allinone-2.xx as you want installed at the same time.

The example zrp_guindy-Security.tcl (+ mobility31) is also included in https://drive.google.com/drive/folde...usp=drive_link
My test
Code:
$ ns235-zrp+security zrp_guindy-Security.tcl
num_nodes is set 31
.
INITIALIZE THE LIST xListHead
Starting Simulation...
Message sent itisalongmessageIcansend with hashing 541705348
Message sent Itisashotermessage with hashing 9128228
Message sent test3 with hashing 406
channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5,  distCST_ = 550.0
SORTING LISTS ...DONE!
Message sent test4 with hashing 486
data intergity ensured
node 1 received packet from  4 with trip-time 341.2 ms - contend: whvw6 - decrypted test3 -hash: 406
data intergity ensured
node 4 received packet from  1 with trip-time 500.5 ms - contend: Lwlvdvkrwhuphvvdjh - decrypted Itisashotermessage -hash: 9128228
node 4 received packet from  1 with trip-time 484.1 ms - contend: Message_Accepted - decrypted _ -hash: 0
node 1 received packet from  4 with trip-time 514.5 ms - contend: Message_Accepted - decrypted _ -hash: 0
data intergity ensured
node 5 received packet from  0 with trip-time 661.7 ms - contend: lwlvdorqjphvvdjhLfdqvhqg - decrypted itisalongmessageIcansend -hash: 541705348
data intergity ensured
node 0 received packet from  5 with trip-time 844.6 ms - contend: whvw7 - decrypted test4 -hash: 486
node 0 received packet from  5 with trip-time 947.8 ms - contend: Message_Accepted - decrypted _ -hash: 0
node 5 received packet from  0 with trip-time 917.9 ms - contend: Message_Accepted - decrypted _ -hash: 0
Security-ex-6_2024.tar.xz
https://drive.google.com/file/d/1Kai...ew?usp=sharing

-

Last edited by knudfl; 02-24-2024 at 09:13 AM.
 
Old 03-06-2024, 02:03 AM   #6
WinnifredNitzsche
LQ Newbie
 
Registered: Jan 2024
Posts: 1

Rep: Reputation: 0
Thank you for the link.
 
  


Reply

Tags
ns2, zrp



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
want to install ns2.29.3 along with mannasim patch for ns2.29 jeevanpinto Linux - Software 4 10-02-2013 12:09 AM
Differences between LEACH results on ns2.1b5 and ns2.35 deepa_2111 Linux - Software 15 05-16-2013 05:53 PM
Code of GPSR for ns2.33 or ns2.35 monikagoyal Linux - Software 31 04-26-2013 12:13 PM
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 - Networking

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