If you need to generate a patch file for a set of file(s) residing in a
directory structure or just for one file, then you can use "diff"
command. You can find a very nice article in Linux Magazine named "What's the diff?". Basically, this command finds out the difference between two files.
If you want to generate a patch for a directory structure:
For more details please go to http://docs.moodle.org/dev/How_to_create_a_patch
If you want to generate a patch for a directory structure:
diff -rau "old_dir" "modified_dir" > "patch_file"In case of two file, ignoring -r would be enough.
r: recursive
a: treat all files as text.
u: Output NUM (default 3) lines of unified context.
For more details please go to http://docs.moodle.org/dev/How_to_create_a_patch
sir how to check the ns2 version in ubuntu 12.04..I actually installed ns2.35 intially and using gcc4.4(cant able to installed gcc4.3)..but i need bgp protocol,but its interfaced in ns2.34..i tried to install ns2.34 but its getting error
ReplyDeleteWhile installing ns-2.34 i am getting this error..please help me out..
ReplyDeleteIn file included from /home/yashwanth/ns-allinone-2.34/tk8.4.18/unix/../generic/tkInt.h:21:0,
from /home/yashwanth/ns-allinone-2.34/tk8.4.18/unix/../generic/tk3d.h:18,
from /home/yashwanth/ns-allinone-2.34/tk8.4.18/unix/../generic/tk3d.c:16:
/home/yashwanth/ns-allinone-2.34/tk8.4.18/unix/../generic/tk.h:81:23: fatal error: X11/Xlib.h: No such file or directory
compilation terminated.
make: *** [tk3d.o] Error 1
tk8.4.18 make failed! Exiting ...
HOW TO INSTALL DTN PATCH IN NS2.34 SIR??
ReplyDeleteHello Sir,
ReplyDeleteCan you please help us to provide steps to install leach protocol which is available as patch for ns2.34 but i need to install it in ns2.35.
I am facing more errors while installing it in ubuntu 12.04 in ns2.35
Thank you!!!
Hi,
DeleteI can help if you provide the error details.
I want to apply Blackholeaodv on wsn and security for it..plz help...
ReplyDeletewhich version should i use with which patch?
Mannasim or NRLsensorsim.?
Reply soon..
Hi,
DeleteBlackholeAODV is available online. I have not worked in Mannasim and NRLsensorsim, so I don't know about it.
Have u worked With WIRELESS SENSOR NETWORKS???
DeleteHi,
DeleteI have worked a bit in WSN.
hi,
ReplyDeletecan you please tell me how to include clustering patches for ns2.34?
Hi,
DeleteCan give more details about your requirement?
hi,
DeleteThank you for replying.My project is, efficiently deploying clusters and selecting cluster-head based on energy and hence save energy in a WSN. As and when the nodes die due to low energy, the topology changes hence change the cluster-head.
Hi,
DeleteI think you can try LEACH and PEGASIS.
Sir,
DeletePlease send me the patch for PEGASIS.I am stuck in project and also the tcl file for leach i am not getting after adding the patch of LEACH
Sir How to install nrlsensorsim in ns-2.34???
ReplyDeletesir,
ReplyDeletei want the patch files for implementation of wormhole attack in AODV. Can you help me with the wormhole attack.. I have already implemented AODV
Hi,
DeleteHow can I help you?
hello sir.
ReplyDeletei have installed ns2.35 in fedora-16. i have downloaded leach.tcl(filename "leach-sims" ) algorithm code from "www.verysource.com" . but i am not getting how to patch those files. please help me out . my project deadline is nearing. . please provide some guidelines and useful links
Hi,
ReplyDeleteSCTP is built-in protocol in NS-2.
hi ramakrishna
ReplyDeletei need a tcl script of black hole attack implemented on ZRP Protocol.
hello sir
ReplyDeletei have installed ns2.34 and i have fallowed your steps. i have editted Makefile and Makefile.in and then i have ./configure.... configure was successful.. but while using "make clean" i am getting following error
make: ***No rule to make target 'clean' stop
and while using "make depend" commond
make: ***No rule to make target 'depend'.stop
please help me out sir... i am new to this linux
... reply as soon as possible
- i run patch file following:
ReplyDeleteroot@ubuntu:~/ns-allinone-2.34/ns-2.34# patch -p1 <mptcp.patch.20100810
patching file Makefile.in
patching file tcp/mptcp.cc
patching file tcp/mptcp-full.cc
patching file tcp/mptcp-full.h
patching file tcp/mptcp.h
patching file tcp/tcp.h
patching file trace/trace.cc3
- After runed patch file, i continue run mptcp-sample.tcl
and result showed below:
root@ubuntu:~/ns-allinone-2.34/ns-2.34# ns mptcp-sample.tcl
invalid command name "Agent/TCP/FullTcp/Sack/Multipath"
while executing
"Agent/TCP/FullTcp/Sack/Multipath create _o292 "
invoked from within
"catch "$className create $o $args" msg"
invoked from within
"if [catch "$className create $o $args" msg] {
if [string match "__FAILED_SHADOW_OBJECT_" $msg] {
delete $o
return ""
}
global errorInfo
error "class $..."
(procedure "new" line 3)
invoked from within
"new Agent/TCP/FullTcp/Sack/Multipath"
invoked from within
"set tcp0 [new Agent/TCP/FullTcp/Sack/Multipath]"
(file "mptcp-sample.tcl" line 98)
root@ubuntu:~/ns-allinone-2.34/ns-2.34#
-------
Help me to solve it, please!
Hi,
DeleteFollow the steps:
./configure
make clean
make
sudo make install
Dear Ramakrishna M.
Deletei try to excute list commands
./configure
make clean
make
sudo make install
----
after i installed ns-2.34 again but stiil show error below:
root@ubuntu:~# ns mptcp-sample.tcl
invalid command name "Agent/TCP/FullTcp/Sack/Multipath"
while executing
"Agent/TCP/FullTcp/Sack/Multipath create _o292 "
invoked from within
"catch "$className create $o $args" msg"
invoked from within
"if [catch "$className create $o $args" msg] {
if [string match "__FAILED_SHADOW_OBJECT_" $msg] {
delete $o
return ""
}
global errorInfo
error "class $..."
(procedure "new" line 3)
invoked from within
"new Agent/TCP/FullTcp/Sack/Multipath"
invoked from within
"set tcp0 [new Agent/TCP/FullTcp/Sack/Multipath]"
(file "mptcp-sample.tcl" line 98)
---------
- in file mptcp-sample.tcl has been lack function library?
- in folder ns-2.34 i copied all file in folder multipath-tcp into /ns-allinone-2.34/ns-2.34 and after i tried ns2 again but not excute command: "ns mptcp-sample.tcl" still appear errors above.
regards.
Hi, was this problem solved? If yes, how? Thank you.
Deletethanks so much, i excuted "ns mptcp-sample.tcl" successfully.
ReplyDeleteagain thanks, good health for you.
i have the same problem. Could you tell me how to execute mptcp-sample.tcl.
DeleteThanks a lot
hello Sir , i am new to this blog and ns2 as well...i have compared all tcp variants as tahoe,reno,newreno for wired network through simulation...now in next phase i need to compare tcp reno with reno based on RTT for hetrogeneous network...So while referring to all related documents i came to one conclusion that i will need to modify existing tcp reno protol..and to best of my knowledge now i have made some changes in existing files as ns-default.tcl,tcp.h,tcp,cc,tcp-reno.cc according to suggested algorithm....
DeleteNow what should be my next step to make those changes and to recompile it in ns2
plz help me..
Thanks and regargs
Hello,
ReplyDeleteI have seen a lot of problems solved in this blog, i hope you will help me as well, I am working on mSCTP handovers and after much study i found that i can simulate it in ns2, however ns2 provides SCTP module but it does not provide mSCTP module. can you please help me out in this regard like how to simulate mSCTP in ns2 for handovers?
i will be really very thankful to you
Regards
Hi,
DeleteWhat is mSCTP? You can simulate only if you have that module or else you need to those feature in SCTP and use.
Hello,
ReplyDeleteMy project is to compare multicast protocol like PUMA, ODMRP in ns2 for vehicular simulation but only AODV, DSR and DSDV protocols are available in ns-2.34. Can you help me out how to add those protocols in NS2
Hi,
ReplyDeleteI have added LEACH protocole with NS2.34 but i have this error, please help me:
trace/cmu-trace.cc: In member function ‘void CMUTrace::nam_format(Packet*, int)’:
trace/cmu-trace.cc:1120:9: attention : variable ‘distance’ set but not used [-Wunused-but-set-variable]
trace/cmu-trace.cc: In member function ‘void CMUTrace::format_rca(Packet*, int)’:
trace/cmu-trace.cc:1530:14: erreur: invalid conversion from ‘const char*’ to ‘char’ [-fpermissive]
trace/cmu-trace.cc:1533:14: erreur: invalid conversion from ‘const char*’ to ‘char’ [-fpermissive]
trace/cmu-trace.cc:1536:14: erreur: invalid conversion from ‘const char*’ to ‘char’ [-fpermissive]
make: *** [trace/cmu-trace.o] Erreur 1
the function in the .cc file is :
#ifdef MIT_uAMPS
void CMUTrace::format_rca(Packet *p, int offset)
{
struct hdr_rca *rca_hdr = HDR_RCA(p);
char op = type_;
switch (rca_hdr -> msg_type())
{
case ADV:
op = ADV_CHAR;
break;
case REQ:
op = REQ_CHAR;
break;
case DATA:
op = DATA_CHAR;
break;
default:
//printf("format_rca: Warning, unknown meta-data type %dn",rca_hdr->msg_type());
op = (char) type_;
break;
}
sprintf(pt_ -> buffer() + offset, "------- [%c %d %d %d] ",
op,
rca_hdr->rca_src(),
rca_hdr->rca_link_dst(),
rca_hdr->rca_mac_dst()
);
return;
}
#endif
please tell me what i have to do
hi
ReplyDeletecan you tell me about cellular simulation on ns-2 how it is done?
how can i make center base station through which other nodes can communicate with each another
Dear Sir..
ReplyDeleteI want to add TDMA patch in my ns 2.34 version.?
I have ns2.29 tdma patch but is it support to ns 2.34?
Please give me installation commands for the install tdma patch.
Thank You Sir..........!
hi
ReplyDeletei want to implement wormhole attack in NS2. i changed some file in mac.such
ll.h, ll.cc, arp.cc.
i find this mudule from internet.
i want to add 5 wormhole node in simulation. how can don it???????
thanks
hi sir....
ReplyDeleteI want to implement LEACH in NS2.34.And I want to run LEACH protocol in NS2.Can u tell me how to run LEACH and calculate residual energy for sensor nodes in NS2.34.Please give me step by step commands for LEACH implementation.And also want to get LEACH Energy calculation tcl code.Thanks alot sir.
Hello Sir,
ReplyDeleteI am trying to implement blackhole attck in zrp. But for this I should not change its header. But zrp is implemented having a single header file (.h file).
So I have to modify it. But if I keep the methods and classes using packet header same i.e if I do not change them then it gives multiple definition error. And if I change them then no longer they will be the ZRP packet. so other zrp nodes will not accept the packets.
So please help me to implement blackhole attack in ZRP.
Thanks
Hi,
DeleteBlackhole attack implementation is available, use the same procedure for ZRP too. It will work.
Sir please can you give me the link for it.
DeleteI am using zrp file given in this link http://magnet.daiict.ac.in/magnet_members/MTech/2007/PatelBrijesh/Simulation.html#Sec_3.1
this is not having separate zrp_packet.h file.
Also I am using the below link for blackhole implementation.
http://www.btechnos.com/2012/05/blackhole-attack-in-mobile-adhoc.html
Please guide me.
Thanks
Hi,
DeleteThe packet.h implementation might be included in zrp.cc.
Sir I am working on olsr protocol.I have install olsr patch and olsr is working properly than I have done some modification in olsr protocol to implement wormhole attack and created a new protocol olsrw.But sir i am not able to run both protocols simultaneously.They are compile properly but packets are not displaying in NAM file...
ReplyDeleteSir give some suggestions......
Thank You sir
Hi,
DeleteThe nam will not work for patched protocol most of the time.
Good day sir.
ReplyDeleteI'm trying to reproduce the results of the PUMA protocol implementation that comes included with ns2.35. As you may know is a Multicast protocol for ad hoc network.
So far the tcl results give me results that don't actually reproduce the behavior of the original protocol, so I'm stuck right now in this.
If there's a tcl file that you have used to run this protocol or any advice on its configuration this would be really helpful for my research.
Thank you very much in advance,
Aldo
Hi,
DeleteTCL will be in PUMA patch itself.
This comment has been removed by the author.
DeleteThank you very much for your prompt answer sir. Let me detail a little bit more the barrier that I found about the protocol:
ReplyDeleteIn the original Puma behavior only the receivers would join the multicast group and then the elected core (among the receivers) will generate Multicast Announcement to form the mesh of the network that will contain other receivers and the intermediate nodes that connect these receivers with the elected core. Also, these multicast announcement are supposed to create connectivity lists (routing information) in each node of the network even though they don't belong to the mesh and with this information a sender won't need to join the mesh, it would just send the data packet to the parent node (next hop) that sent the multicast announcement to it. And the packet will travel so, until reaches one mesh member and then it would be propagated through the mesh. So this behavior is expected from the implementation in ns2.35 of the puma protocol but analyzing (and running) the tcl file that comes with the puma patch I noticed two things:
1.- If the senders DON'T join explicitly the mcast group, the other nodes won't forward their packets.
2.- There's no mesh formation since the nodes that don't join the mesh explicitly don't even forward the multicast announcements generated by the receivers.
Any comment about this situation would be really helpful.
Thanks in advance.
Hi,
DeleteI have not worked much in PUMA. Sorry, my helpless situation.
hi,
ReplyDeletei installed ns2.34 and i got error as command not found. similar command is nc
how to rectify it...pls give solution
Hi,
DeleteUpdate environment variables and restart.
hello Sir , i am new to this blog and ns2 as well...i have compared all tcp variants as tahoe,reno,newreno for wired network through simulation...now in next phase i need to compare tcp reno with reno based on RTT for hetrogeneous network...So while referring to all related documents i came to one conclusion that i will need to modify existing tcp reno protol..and to best of my knowledge now i have made some changes in existing files as ns-default.tcl,tcp.h,tcp,cc,tcp-reno.cc according to suggested algorithm....
ReplyDeleteafter modification i executed following commands...
sudo make clean
sudo make depend
sudo make
it was not showing any errors...but wen i tried running my tcl file i m getting same output..
what should i do now???
plz help me..
Thanks and regargs
hi
ReplyDeleteCan you suggest me measures to minimise e2edelay in aodv protocol?
i tried by varying rxthresh but didnt worked out well.
thanks
HI,
DeleteYou can reduce no. of hops or increase range.
Sir,
ReplyDeleteI want to add multicast routing protocols (MAODV,ODMRP) in NS2.35. Kindly help to find the patches for those protocols.
HI,
DeleteSearch online.
or
Put query in http://transinntech.wordpress.com/, they will implement and give you.
Hello Sir,
ReplyDeleteHow can i simulate the Sybil, hello flooding , sinkhole attacks.Whether can i make algorithm in C++ or in TCL? can u pls provide sample coding? sir
Hi,
DeleteI dont have the sample code.
You need implement it in C++.
hi sir how can i install cluster patch in ns2
ReplyDeleteHello can any one help me to achieve the results of Energy Consumption by running the LEACH Protocol on 100 Nodes and with different values of N i.e N=3, 5, 7, 9 and the Packet Size should be = 0.
ReplyDeleteI need these results as soon as possible. I have a problem in my LEACH protocol as it is now not running and i have my presentation this week. I just require the results. Who ever is currently able to run LEACH please do help me.
hello sir,
ReplyDeleteI m working on ns2.34 and I want to patch it in the same. I have successfully patched all the files but after that i applied the following commands and following error
./configure
make distclean
./configure
make
./configure
In file included from trace/cmu-trace.cc:56:0:
./aodv-uu/ns/aodv-uu.h:79:26: fatal error: packet_queue.h: No such file or directory
compilation terminated.
make: *** [trace/cmu-trace.o] Error 1
Ns make failed!
Hi,
ReplyDeletePlease check the header file declaration.
Hello sir,
ReplyDeleteI'm doing my project in load balancing in content delivery networks in ns2 2.34.. I tried to patch a file "ns2_cdn_extension" of version ns2 2.33..
While trying to patch the following occured
[root@localhost ~]# cd Desktop
[root@localhost Desktop]# cd ns-allinone-2.34
[root@localhost ns-allinone-2.34]# cd ns-2.34
[root@localhost ns-2.34]# make clean
make: *** No rule to make target `Makefile.in', needed by `Makefile'. Stop.
[root@localhost ns-2.34]# patch -p1 < ns2_cdn_extension.patch
patching file ns-2.33/cdn/cdnagents.cc
patching file ns-2.33/cdn/cdnagents.h
patching file ns-2.33/cdn/cdnclient.cc
patching file ns-2.33/cdn/cdnclient.h
patching file ns-2.33/cdn/cdn_hdr.h
patching file ns-2.33/cdn/cdnserver.cc
patching file ns-2.33/cdn/cdnserver.h
patching file ns-2.33/cdn/hd_queue.cc
patching file ns-2.33/cdn/hd_queue.h
patching file ns-2.33/cdn/httpdata.h
can't find file to patch at input line 3811
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -rupN ns-2 orig/ns-2.33/common/packet.h ns-allinone-2.33/ns-2.33/common/packet.h
|--- ns-2 orig/ns-2.33/common/packet.h 2008-04-01 04:00:25.000000000 +0200
|+++ ns-allinone-2.33/ns-2.33/common/packet.h 2010-05-13 13:16:53.000000000 +0200
--------------------------
File to patch:
It is asking for a file to patch.. i dont know which file to patch..
Moreover i couldnt run the "make clean" command in the begining
[root@localhost ns-2.34]# make clean
make: *** No rule to make target `Makefile.in', needed by `Makefile'. Stop.
Can u help me please..? Waiting for your valuable reply.....
Hi,
DeleteYou can not patch ns2.33 in ns2.34. due to changes in line number in the files.
hi pls help me im trying to patch EURANE+LTE patch in ns2 pls give me any suggestions
ReplyDeleteim doing my project in ns2.32 by using vmware workstation
Deletecan we patch EURANE+LTE in ns2.32 or should we use anyother
sir i need your help please mail me
Deletechandanasree2@gmail.com
Hello Sir,
ReplyDeleteI want to simulate Location Aided Routing Protocol over NS2.35 in FANET(flying adhoc network). So, i need LAR tcl file and also how to patch this file on nS2.35. Please give response regarding this.
I am getting this error while running ZRP protocol in NS2. How to remove this?
ReplyDeleteinvalid command name "Agent/ZRP"
while executing
"Agent/ZRP set radius_1 "
(file "zrp.tcl" line 27)
Network Simulator - 2: Generating Patch For Ns-2 >>>>> Download Now
ReplyDelete>>>>> Download Full
Network Simulator - 2: Generating Patch For Ns-2 >>>>> Download LINK
>>>>> Download Now
Network Simulator - 2: Generating Patch For Ns-2 >>>>> Download Full
>>>>> Download LINK GJ