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 create IDS in MANET in NS2?

Description

In IDS.tcl, data transmission from source to destination is carried out via intermediate nodes. Attacker is configured with property of forwarding only limited number of packets. Data transmission is observed by the common neighbor called guard node that overhears the current transmission and it finds the ratio of number of packets forwarded to the number of packets received. If the ratio is low, then guard node detects the node as attacker node.

Sample Code

#Filename: IDS.tcl

set udp [new Agent/UDP]
$ns attach-agent $node_(0) $udp
set cbr [new Application/Traffic/CBR]
$cbr set packetSize_ 1024
$cbr set interval_ 0.1
$cbr attach-agent $udp
set null [new Agent/Null]
$ns attach-agent $node_(2) $null
$ns connect $udp $null
$ns at $now "$cbr start"
$ns at [expr $now + 5.0] "$cbr stop"

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.5
$cbr attach-agent $udp
set null [new Agent/Null]
$ns attach-agent $node_(3) $null
$ns connect $udp $null
$ns at $now "$cbr start"
$ns at [expr $now + 5.0] "$cbr stop"

 

Screenshots

create IDS in MANET