Sybil Attack In NS2  

 

Definition of Sybil attack:

  • A Sybil attack is in which a malicious node in the network, illegitimately claims to have multiple identities on a single physical device.
  • If an entity on a network does not have physical knowledge of the other entities, it will perceive them purely as informational abstractions called identities

 

Types of Sybil attack in Manet:

  • Simultaneous Sybil attack
  • join and leave Sybil attack

 

Malicious applications of Sybil attack:

  • Data aggregation
  • Routing
  • Distributed storage
  • Fair resource allocation
  • Tampering with voting and reputation systems etc.

 

Architecture of Sybil attack in Manet:

 

 

 

Detection mechanisms involved in Manet:

  • request threshold validation mechanism
  • trusted certification
  • hashing function
  • incentive-based detection
  • location/position verification
  • random key predistribution
  • RSSI-based scheme etc.

 

Sample code for Sybil attack:

This is the sample code of Sybil attack.

#create lists which contains the claimed and estimated positions of sybil nodes

#set claimed {(,) (,)}

#set estimated {(,) (,)}

#create neighbour list of all sybil nodes – 2d array

set neighbour_sybil [ list {12 5 15 18 17} {14 20 5 12} {5 19} {5 12} {19 5 20} {5 15 8 19} {19 5 8} {20 5 19} {5 12 15} ]

#Display neighbour list of all sybil nodes

for {set i 0} {$i < [llength $neighbour_sybil]} {incr i}  {

set l($i) [lindex $neighbour_sybil $i]

puts “Neighbour list of [lindex $mylist_sybil $i] is $l($i)”

}

 

#malicious node detection

proc detect {mylist} {

set length [llength $mylist]

for {set i 0} {$i < 21} {incr i} {

set count($i) 0

}

for {set j 0} {$j < 9} {incr j} {

set l($j) [lindex $mylist $j]

for {set i 0} {$i < [llength $l($j)]} {incr i} {

set m($i) [lindex $l($j) $i]

set count($m($i)) [expr {$count($m($i))+1} ]

}

}

for {set i 0} {$i < 21} {incr i} {

puts “Suspicion factor of $i is $count($i)”

}

puts “Maximum suspicion factor is for node 5”

puts “Node 5 is the malicious node”}

detect $neighbour_sybil

 

# Provide initial location of mobilenodes

$node_(0) set X_ -89.0

$node_(0) set Y_ 977.0

$node_(0) set Z_ 0.0

$ns at 0.0 “$node_(0) label RSU0”

 

$node_(1) set X_ 541.0

$node_(1) set Y_ 494.0

$node_(1) set Z_ 0.0

 

$node_(2) set X_ 86.0

$node_(2) set Y_ 620.0

$node_(2) set Z_ 0.0

 

$node_(17) set X_ 554.0

$node_(17) set Y_ 385.0

$node_(17) set Z_ 0.0

 

$node_(4) set X_ 365.0

$node_(4) set Y_ 727.0

$node_(4) set Z_ 0.0

 

$node_(18) set X_ 699.0

$node_(18) set Y_ 494.0

$node_(18) set Z_ 0.0

 

$node_(19) set X_ 498.0

$node_(19) set Y_ 840.0

$node_(19) set Z_ 0.0

 

$node_(20) set X_ -36.0

$node_(20) set Y_ 727.0

$node_(20) set Z_ 0.0

 

$node_(3) set X_ 1165.0

$node_(3) set Y_ 601.0

$node_(3) set Z_ 0.0

$ns at 0.0 “$node_(3) label RSU3”

 

$node_(5) set X_ 269.0

$node_(5) set Y_ 620.0

$node_(5) set Z_ 0.0

 

$node_(6) set X_ 148.0

$node_(6) set Y_ 494.0

$node_(6) set Z_ 0.0

 

$node_(7) set X_ 86.0

$node_(7) set Y_ 840.0

$node_(7) set Z_ 0.0

 

$node_(8) set X_ 723.0

$node_(8) set Y_ 727.0

$node_(8) set Z_ 0.0

 

$node_(10) set X_ 704.0

$node_(10) set Y_ 620.0

$node_(10) set Z_ 0.0

 

$node_(11) set X_ 292.0

$node_(11) set Y_ 839.0

$node_(11) set Z_ 0.0

 

$node_(12) set X_ 310.0

$node_(12) set Y_ 494.0

$node_(12) set Z_ 0.0

 

$node_(13) set X_ 156.0

$node_(13) set Y_ 727.0

$node_(13) set Z_ 0.0

 

$node_(14) set X_ -36.0

$node_(14) set Y_ 620.0

$node_(14) set Z_ 0.0

 

$node_(15) set X_ 582.0

$node_(15) set Y_ 620.0

$node_(15) set Z_ 0.0

 

$node_(16) set X_ 439.0

$node_(16) set Y_ 620.0

$node_(16) set Z_ 0.0