Amazing technological breakthrough possible @S-Logix

Office Address

  • 2nd Floor, #7a, High School Road, Secretariat Colony Ambattur, Chennai-600053 (Landmark: SRM School) Tamil Nadu, India
  • +91- 81240 01111

Social List

How to launch flooding attack in NS2?


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"


Data flow

launch flooding attack in NS2