Search This Blog

Thursday 13 February 2014

How can i create my own packets in aodv ns2 ?


Create your own packet :


           >  In aodv, sometimes we need to get/pass our own information  to neighbors.  Like RouteRequest( RREQ ), RouteReply( RREP ) , we can easily get/pass our own information.

           >  e.g  
                       i)   CH may wants to know the trust value of its neighbors.

                       ii)  Passing Voting information.

           >  We need to modify four files

                        i)   aodv-packet.h , where you will define your own packet structure.

                        ii)  aodv.cc , where you will define your own function. We need two receive function for  receiving request and reply. Also, we need two other functions to send request and reply.

                       iii)  In aodv.h , include the function declaration.     

                       iv)  In ns-2.35/trace/cmu-trace.cc , We need to add tracing information otherwise, we will get a "invalid AODV packet type" error.
             

10 comments:

  1. how to add tracing information of new packet into cmu-trace.cc. Can u give an example.

    ReplyDelete
  2. Give it a try, this is the place where you will add new packets tracing info...
    void
    CMUTrace::format_aodv(Packet *p, int offset)
    {
    }
    hope, it helps. If you really need an example, leav a comment

    ReplyDelete
  3. i added my code in format_aodv but still i get the error format_aodv :invalid packet type.Please give an example how to add a new packet type into aodv.Example if i need to add a voterequest packet into aodv packet what should be done.

    ReplyDelete
    Replies
    1. @mamatha, mail your code to karthicksivakrr@gmail.com, i will try my best...

      Delete
  4. sir i have mailed u the aodv.cc aodv.h, aodv_packet.h and the tcl files. Please check them and suggest me where i should make the changes. your timely help would be very useful for me.

    ReplyDelete
  5. Sir i have made the changes as you have sent but still i am getting the same error format_aodv:invalid aodv packet type.please suggest what should be done.

    ReplyDelete
  6. Sir i have sent my files once again in zip format please check them and suggest the changes.

    ReplyDelete
  7. @mamatha, the code you mailed me, works fine. i am not getting any format_aodv:invalid aodv packet type error. by the way, i mailed you the output.

    ReplyDelete
  8. Hello Sir
    good morning
    thanks for the information here. really helpful

    I wish you can help on how to obtain a source address in aodv under ns2
    I am implementing a route repair strategy and I want that when a node initiates route repair it should send a (unicast) message to the source node.

    how can I can the source address in this case

    thanks in advance

    sincerely
    Nyarkanyuy A. K.

    ReplyDelete
  9. @Nyarkanyuy, most probably fou already found answer for your question. if not, in every function "index" not is accessible(The current node). It may be src or dest or intermediate node. Its all about in which function. In rt_repair func, i don't know index is src or not. In some func, you have parameters itself src and dest. So give it try. I almost forgot to say, i am glad you liked my posts.

    ReplyDelete

Thanks & Regrds,
Karthick SIva