Skip to main content

MALICIOUS NODE IN AODV PROTOCOL

 A node is called as malicious when it will simply drop the router packets DROP_RTR_ROUTE_LOOP. For adding a malicious node to AODV protocol, we have to modify following files; 

  • aodv.h
  • aodv.cc
Changes in aodv.h file

We have to declare a variable as shown below in the protected scope in the class AODV of aodv.h file


bool malicious;

Changes in aodv.cc file

The changes that have to make  in .cc file is given below;

Step 1: Initialize the malicious variable with a value "false". Declare it inside the constructor as shown below
AODV::AODV(nsaddr_t id):Agent(PT_AODV)...
{
.......
malicious = false;
}

Step 2: Add the following statement to the aodv.cc file in the "if(argc==2)" statement.

if(strcmp(argv[1], "malicious") == 0) {
    malicious = true;
   return TCL_OK;
}

Step 3: Implement the behavior of the malicious node by setting the following code in the rt_resolve(Packet *p) function. The malicious node will simply drop the packet as indicated below.

if(malicious==true)
{
drop(p,DROP_RTR_ROUTE_LOOP);
}



Once done, recompile ns2 as given below;

Open Terminal -> Go to ~ns-2.35/ directory and type the command make to compile
cd /home/user/ns-allinone-2.35/ns-2.35/  [its vary with your directory path]
make

Once the compilation is done, Check the malicious behavior using the Tcl Script by setting any one   node as malicious node. The command to set the malicious node is
$ns at 0.0 "[$n2 set ragent_] malicious"

The variable referred for node2 is n2 (set n2 [$ns node])

Comments

Popular posts from this blog

Link State Routing Protocol

Link state routing is a method in which each router shares its neighborhood’s knowledge with every other router on the internetwork. In this algorithm, each router in the network understands the network topology and then makes a routing table depending on this topology. Each router will share data about its connection to its neighbor, who will, consecutively, reproduce the data to its neighbors, etc. This appears just before all routers have constructed a topology of the network. In LSP, each node transmits its IP address and the MAC to its neighbor with its signature. Neighbors determine the signature and maintain a record of the combining IP address and the MAC. The Neighbor Lookup Protocol (NLP) of LSP derives and maintains the MAC and IP address of every network frame accepted by a node. The extracted data can support the mapping of MACs and IP addresses. The link-state flooding algorithm prevents the general issues of broadcast in the existence of loops by having every node mainta

Windows 11

Windows has always existed to be a stage for the world’s innovation. It’s been the backbone of global businesses and where scrappy startups became household names. The web was born and grew up on Windows. It’s the place where many of us wrote our first email, played our first PC game and wrote our first line of code. Windows is the place people go to create, to connect, to learn and to achieve – a platform over a billion people today rely on. The responsibility of designing for that many people is one we don’t take lightly. The past 18 months brought an incredible shift in how we used our PCs; we went from fitting the PC into our lives to trying to fit our whole lives into the PC. Our devices weren’t just where we went for meetings, classes and to get things done, but where we came to play games with friends, binge watch our favorite shows and, perhaps most meaningfully, connect with one another. In the process we found ourselves recreating the office banter, the hallway chatter, worko

Matter: A next generation home standard

The smart home is evolving. To date, if you've wanted to get into developing a smart home, you've had to deal with the multitude of smart home ecosystems, and making sure that each device you buy is compatible. That, however, may soon change — thanks to new smart home standard called Matter. Matter isn't available just yet, but when it is finally released, it could completely change how you buy smart home products, for the better. All of the best smart home devices could soon support the standard, helping them all work together nicely, and ensuring that no matter what products you buy, you'll be able to use them. Matter is basically the name of a new smart home connectivity standard . But this standard is a little unlike others. That's because of the fact that it's being developed by the Connectivity Standards Alliance, which counts hundreds of companies as members. That includes the likes of Google, Alexa, and Apple. So, whether you prefer to use Google Assista