How to Create Sybil Attack in VANET using NS2


A Mobile Ad hoc Network (MANET) comprises of mobile nodes that moves independently in an open environment. Communication between the nodes in a MANET is enabled with the aid of intermediate routers. The nature of MANET such as open medium, dynamic network topology, lack of centralized monitoring, and lack of clear defense mechanisms makes it vulnerable to several routing attacks. In MANET routing, there is a high probability for intermediate nodes to be malicious that might be a threat to the security. Sybil is the dangerous attack in ad hoc network in which the malicious node pretends like multiple vehicle and launches other attacks in the network. In sybil_attack.tcl, node 8 is configured as attacker vehicle and it pretends like multiple vehicle and send multiple messages to RSU.

#Filename: sybil_attack.tcl

set attacker 8

for { set k 0 } { $k < 5} { incr k } {
set udp1 [new Agent/UDP]
$ns_ attach-agent $node_($attacker) $udp1
set cbr1 [new Application/Traffic/CBR]
$cbr1 set packetSize_ 512
$cbr1 set interval_ 0.5
$cbr1 attach-agent $udp1
set null1 [new Agent/Null]
$ns_ attach-agent $node_($rsu) $null1
$ns_ connect $udp1 $null1
$ns_ at [expr $now ] "$cbr1 start"
$ns_ at [expr $now + 1.0] "$cbr1 stop"
$ns_ at $now "$ns_ trace-annotate \"Attacker Pretends like multiple vehicle and
send message to RSU\""