, ,

Promiscuous Mode in AODV (ns 2.34)

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: }

17 comments:

  1. Hi all,

    it's work, but I just got RREQ Only, please help me how to get a RREP...


    best regard
    khozaimi

    ReplyDelete
    Replies
    1. 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

      Delete
    2. check your code a gain. mine is similar to above ..

      Delete
  2. i have done what ever the changes u have said but some errors are getting while i was running tcl script.
    cant read mac(0):no such variable and some errors like that

    ReplyDelete
  3. Replies
    1. ya that only i am getting errors...........

      Delete
    2. Sir 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

      Delete
    3. hey sridhar,
      the 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....

      Delete
    4. sir i have chenged what ever the changes u hav said but it is getting still errors..

      Delete
  4. Hello all,,..

    please help me, how to calculate buffer size in aodv.cc file??

    Thank you.

    Best regard
    Ach. Khozaimi

    ReplyDelete
  5. how can i use the command "install-tap" under tcl?

    ReplyDelete
  6. I also need to know that how can i call install-tap command under tcl

    ReplyDelete
  7. please help me, how to calculate lamda and mu in queue on protocol aodv and see it in the trace file??
    my contact : h.naanani@gmail.com

    ReplyDelete
  8. hello sir i am final year student i want to modify the aodv protocol can u just help me for that

    ReplyDelete
  9. I have a simple question:
    To 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?

    ReplyDelete
  10. hello
    please can you help me with a code in tap to get number of packet drop, send, and modifier by node. thanks

    ReplyDelete
  11. hello please help me with a code that read or listn black hole attack promiscously in ns2

    ReplyDelete