Simple Module NA_SinkholeAttack

Package: nesg.netattacks.attacks.controllers.sinkholeAttack
File: src/attacks/controllers/sinkholeAttack/NA_SinkholeAttack.ned

C++ definition

Sinkhole attack controller simple module. Three parameter controls the attack behavior: the attack probability, if the route requested is knowed by the attacker or not and the the sequence number generated.

See also: NA_Attack, NA_AODVUU

Author: Gabriel Maciá Fernández, gmacia@ugr.es

Date: 01/22/2013

NA_SinkholeAttack

Usage diagram:

The following diagram shows usage relationships between types. Unresolved types are missing from the diagram.

Inheritance diagram:

The following diagram shows inheritance relationships for this type. Unresolved types are missing from the diagram.

Extends:

Name Type Description
NA_Attack simple module

Base simple module inherited from all attacks modules. Is in charge of set the schedulling parameters, attack activation or not, and what is the type of the attack.

Used in compound modules:

Name Type Description
NA_AttackerAdhocHost compound module

Attacker wireless ad hoc host. Modificated from WirelessHost module. Redefined from INET framework and used as attacker host.

Parameters:

Name Type Default value Description
attackType string "sinkhole"

String with the type of attack

active bool false

Indicates if this attack is active or not in the node

startTime double 0s

Timestamp to start the attack

endTime double 0s

Time instant at which the attack ends, 0 means that the attack will not end during the simulation.

sinkholeAttackProbability double 0

Probability of answering a RREQ message with a fake route. Range [0,1].

sinkOnlyWhenRouteInTable bool false

TRUE: Send fake answers to RREQ messages only when requested routes are really in routing table of sinkhole node. FALSE: Send fake answers for any RREQ messages arriving at the sinkhole node.

seqnoAdded double uniform(20, 30)

Fake sequence number generated.

numHops int 1

Fake number of hops.

Properties:

Name Value Description
display i=misc/cloud3,red,100;is=l
class NA_SinkholeAttack

Source code:

//
// Sinkhole attack controller simple module. Three parameter controls the attack behavior:
// the attack probability, if the route requested is knowed by the attacker or not and the
// the sequence number generated.
//
// @see NA_Attack, NA_AODVUU
//
// @author Gabriel Maciá Fernández, gmacia@ugr.es
// @date 01/22/2013
simple NA_SinkholeAttack extends NA_Attack
{
    parameters:
        @class(NA_SinkholeAttack);
        @display("i=misc/cloud3,red,100;is=l");

        attackType = "sinkhole";  //Should correspond with the tag located in the hackedModules.ned. e.g. @sinkhole for this attack.       
        double sinkholeAttackProbability = default(0); //Probability of answering a RREQ message with a fake route. Range [0,1].
        bool sinkOnlyWhenRouteInTable = default(false); //TRUE: Send fake answers to RREQ messages only when requested routes are really in routing table of sinkhole node.
														//FALSE: Send fake answers for any RREQ messages arriving at the sinkhole node.

        volatile double seqnoAdded = default(uniform(20, 30)); 	// Fake sequence number generated.
        volatile int numHops = default(1);						// Fake number of hops.
}