Amazing technological breakthrough possible @S-Logix pro@slogix.in

Office Address

  • #5, First Floor, 4th Street Dr. Subbarayan Nagar Kodambakkam, Chennai-600 024 Landmark : Samiyar Madam
  • pro@slogix.in
  • +91- 81240 01111

Social List

How to launch flooding attack in NS2?

Description

Flooding attack is characterized by sending more data than the available bandwidth. In flooding_attack.tcl, data transmission from source to destination is carried out via intermediate nodes with excessive data. Attacker drains the energy of its neighbors by sending more data than their available bandwidth.

Sample Code

#Filename: flooding_attack.tcl

for {set i 0} {$i < $val(nn)} {incr i} {
set now 1.0
set udp [new Agent/UDP]
$ns attach-agent $node_(2) $udp
set cbr [new Application/Traffic/CBR]
$cbr set packetSize_ 1024
$cbr set interval_ 0.001
$cbr attach-agent $udp
set null [new Agent/Null]
$ns attach-agent $node_($i) $null
$ns connect $udp $null
$ns at $now "$cbr start"
$ns at [expr $now + 2.0] "$cbr stop"
}

Screenshots

Data flow


launch flooding attack in NS2