How can i monitor my neighbor nodes in aodv
(Promiscuous mode in aodv) <<In the previous post?
> Using tap function we can monitor the neighbor nodes transmission.
> If a node forwards a packet then tap function will be called for all of its neighbors. Using this functionality we can easily find out packet drop.
> tap function can be found in mac.h, dsragent.h, dsragent.cc.
Steps :
> We need to modify 3 files
i) aodv.h
ii) aodv.cc
iii) ns-mobilenode.tcl ( can be found under ns-2.35/tcl/lib )
> In aodv.h
i) Include the header file
#include <mac.h>
ii)
/*
The Routing Agent
*/
class AODV: public Tap, public Agent
{
.......
public:
........
void tap(const Packet *p);
........
protected:
Mac *mac_;
.........
}
> In aodv.cc,
int AODV::command(int argc, const char* const * argv )
{
.......
elseif( argc==3 ) {
........
else if (strcmp(argv[1], "install-tap") == 0)
{
mac_ = (Mac*)TclObject::lookup(argv[2]);
if (mac_ == 0)
return TCL_ERROR;
mac_->installTap(this);
return TCL_OK;
}
}
return Agent::command(argc, argv);
}
void AODV::tap(const Packet *p)
{
// Write your own code here
}
> In ns-mobilenode.tcl,
Node/MobileNode instproc add-target { agent port }
{
$self instvar dmux_ imep_ toraDebug_ mac_
.........
# Special processing for AODV
set aodvonly [string first "AODV" [$agent info class]]
if {$aodvonly != -1 }
{
$agent if-queue [$self set ifq_(0)] ;# ifq between LL and MAC
$agent install-tap $mac_(0)
}
.........
}
Possible Questions
Sir,what code have to write in void AODV::tap(const Packet *p) to monitor two nodes by one node?
Solution
It depends.first of all, if you want to monitor another node then it should be in your transmission range. if you only want a node to monitor every other node, then you should write code like that using node id(i.e index)
// let's say you are counting the no of packets dropped by node 2, which lies transmission range of node 10. For that, you need to modify two function i) forward fn ii) tap fn. In forward fn, node 10 should increase the count on node 2 by 1. In tap fn, node 10 should decrease the count on node 2 by one.
If tap fn called then no drop, else the drop count will be one. like this, you need to develop your code to monitor your neighbor nodes.
Possible Question
how to find malicious node in a network
there are several ways to find a malicious node in a network. The popular one is based on trust value. Using trust also, we have several way. For more info study ieee, acm.
Possible Question
After all node set as promiscuous mode, node 1 wants to monitor its neighbor nodes {2,3,4} whether they are forwarding its (node1)packets or not. For this, how to write code in tap( ) function?
Solution there are many ways , we can do that. Here is a way, in forward function, before forwarding, say node 2 forwards, node 1 should increase the count of no of packets fwded by node 2 and in tab fun node 1 should decrease the count of no of packets fwded by node 2. If the count greater than zero or some threshold, you may want to include something for congestion then pkt drop happened. hope it helps.
Questions
Want to know neighbor list of every node.
In AODV, by sending hello messages every node updates its neighbour list. Start with sending hello messages.
Question
how can a neighbor node can monitor a node that either it is sending the data packet to its next intermediate node in the route or to the destination.for this how the "tap" function should be implemented or what sort of changes should be done in this function to monitor the neighboring nodes.remember that this work is going on in AODV.kindly help us in this matter.thanks.
Solution it follows the route. In general, if a node has dest node as neighbour node then it directly forwards the packet, otherwise it uses the intermediate node. Implementation of tab function is based on what you want by monitoring. In general, for packet drop calc you can inc the count in forward fun and decrease it in tab. Hope this helps. If you need more about tab fun do some digging in the code.
No comments:
Post a Comment