In a network, promiscuous mode allows a network device to intercept and read each network packet that arrives in its entirety. This mode of operation is sometimes given to a network snoop server that captures and saves all packets for analysis (for example, for monitoring network usage). Its often used to
monitor network activity
Files to be changed
1. ~ns-2.34/aodv/aodv.h
2. ~ns-2.34/aodv/aodv.cc
3. ~ns-2.34/lib/tcl/ns-mobilenode.tcl
1. Make AODV agent a child class of Tap (you should have a member function tap), and define the Mac variable
1: #include <mac.h>
2: class AODV: public Tap, public Agent {
3: public:
4: void tap(const Packet *p);
5: ......
6: protected:
7: Mac *mac_;
8: ......
9: }
2. Modify aodv/aodv.cc
Define TCL command "install-tap" and implement AODV::tap()
1: int AODV::command(int argc, const char*const* argv) {
2:
3: ......
4:
5: else if(argc == 3) {
6:
7: ......
8:
9: else if (strcmp(argv[1], "install-tap") == 0) {
10: mac_ = (Mac*)TclObject::lookup(argv[2]);
11: if (mac_ == 0) return TCL_ERROR;
12: mac_->installTap(this);
13: return TCL_OK;
14: }
15:
16: }
17: return Agent::command(argc, argv);
18:
19:
20: }
21:
22: void AODV::tap(const Packet *p) {
23: //put your code here
24: fprintf(stdout,"Node in Promiscuous Mode");
25: }
26:
3. Modify tcl/lib/ns-mobilenode.tcl
1: Node/MobileNode instproc add-target { agent port } {
2: $self instvar dmux_ imep_ toraDebug_ mac_
3: ......
4: # Special processing for AODV
5: set aodvonly [string first "AODV" [$agent info class]]
6: if {$aodvonly != -1 } {
7: $agent if-queue [$self set ifq_(0)] ; # ifq between LL and MAC
8: $agent install-tap $mac_(0)
9: ......
10: }
Hi all,
ReplyDeleteit's work, but I just got RREQ Only, please help me how to get a RREP...
best regard
khozaimi
can u please tell me that how will it work i have done the same changes in the code but its not working.its urgent please
Deletecheck your code a gain. mine is similar to above ..
Deletei have done what ever the changes u have said but some errors are getting while i was running tcl script.
ReplyDeletecant read mac(0):no such variable and some errors like that
it is mac_(0) and not mac(0)
ReplyDeleteya that only i am getting errors...........
DeleteSir can u please send me the file of those three which u have.......please sir its little bit urgent..my email id is sridhar585sri@gmail.com
Deletehey sridhar,
Deletethe error given is $mac(0), you need to change it to mac_(0). thats what i mentioned inmy previosu comment.
i have to do it again to get all the files.
to see the results, you can use AODV protocol of any TCL file and get the results....
sir i have chenged what ever the changes u hav said but it is getting still errors..
DeleteHello all,,..
ReplyDeleteplease help me, how to calculate buffer size in aodv.cc file??
Thank you.
Best regard
Ach. Khozaimi
how can i use the command "install-tap" under tcl?
ReplyDeleteI also need to know that how can i call install-tap command under tcl
ReplyDeleteplease help me, how to calculate lamda and mu in queue on protocol aodv and see it in the trace file??
ReplyDeletemy contact : h.naanani@gmail.com
hello sir i am final year student i want to modify the aodv protocol can u just help me for that
ReplyDeleteI have a simple question:
ReplyDeleteTo write the needed code to simulate a special scenario, is it enough to learn how to write tcl files with ns2 commands? That means we don't need to enter into the header files and C++/C files of NS2, right?
hello
ReplyDeleteplease can you help me with a code in tap to get number of packet drop, send, and modifier by node. thanks
hello please help me with a code that read or listn black hole attack promiscously in ns2
ReplyDelete