How to Start AOMDV Protocol Projects Using NS2
To start Ad hoc On-Demand Multipath Distance Vector (AOMDV) protocol projects using NS2, we can adhere to this stepwise guidance. AOMDV, an enhancement of AODV which offer multiply routing paths for mobile ad hoc networks (MANETs) to make sure that their stability and load distribution and load balancing. Following is a structured guide to get started:
Steps to Start AOMDV Protocol Projects in NS2
- Set Up NS2 Environment
Make sure we have installed and set up NS2 on the system properly.
- Install NS2 (for Ubuntu/Linux):
sudo apt-get update
sudo apt-get install ns2
- Verify Installation:
ns
If effectively installed the NS2 then the NS2 interpreter will occur in (%).
- Check for AOMDV Support
NS2 version 2.35 is directly supports AOMDV since it is protion of their routing protocols.
- Confirm AOMDV is obtainable by verifying the routing agents:
grep -i “AOMDV” ns-2.35/tcl/lib/ns-default.tcl
We are equipped to execute it as AOMDV is listed.
- Write a TCL Script for AOMDV Simulation
Here’s a tcl script illustrates a basic configuration to replicate the AOMDV in NS2.
AOMDV TCL Script Example:
# Initialize the Simulator
set ns [new Simulator]
# Define output files
set tr [open aomdv-output.tr w]
$ns trace-all $tr
set nf [open aomdv-output.nam w]
$ns namtrace-all $nf
# Define topology and nodes
set n(0) [$ns node]
set n(1) [$ns node]
set n(2) [$ns node]
set n(3) [$ns node]
set n(4) [$ns node]
# Define links
$ns duplex-link $n(0) $n(1) 2Mb 10ms DropTail
$ns duplex-link $n(1) $n(2) 2Mb 10ms DropTail
$ns duplex-link $n(2) $n(3) 2Mb 10ms DropTail
$ns duplex-link $n(3) $n(4) 2Mb 10ms DropTail
$ns duplex-link $n(4) $n(0) 2Mb 10ms DropTail
# Enable AOMDV routing protocol
$ns rtproto AOMDV
# Attach Traffic Sources
set udp [new Agent/UDP]
$ns attach-agent $n(0) $udp
set null [new Agent/Null]
$ns attach-agent $n(4) $null
$ns connect $udp $null
# Define CBR Traffic
set cbr [new Application/Traffic/CBR]
$cbr attach-agent $udp
$cbr set packetSize_ 512
$cbr set rate_ 1Mbps
# Start and Stop Traffic
$ns at 0.5 “$cbr start”
$ns at 4.5 “$cbr stop”
# Finish Simulation
$ns at 5.0 “finish”
proc finish {} {
global ns tr nf
$ns flush-trace
close $tr
close $nf
exec nam aomdv-output.nam &
exit 0
}
# Run the Simulation
$ns run
- Run the AOMDV Simulation
- We will need to store the above script like aomdv_simulation.tcl.
- Then, execute the tcl simulation script within NS2:
ns aomdv_simulation.tcl
- Outputs:
- Trace file (aomdv-output.tr): It includes all network events records.
- NAM file (aomdv-output.nam): Envision the packet flow and routing paths to apply nam file.
- Analyze Simulation Results
Metrics to Analyze:
- Packet Delivery Ratio (PDR): Compute the percentage of packets that were received for transmitting the packets.
awk ‘{if($1==”r” && $4==”cbr”) received++} END {print “Packet Delivery Ratio:”, received}’ aomdv-output.tr
- End-to-End Delay: Estimate the average delay which is undergone by packets.
awk ‘{if($1==”r” && $4==”cbr”) {delay[$6]=$2-start[$6]}} END {for (x in delay) sum+=delay[x]; print “Average Delay:”, sum/NR}’ aomdv-output.tr
- Routing Overhead: Assess the volume of routing control packets for routing overhead:
awk ‘{if($1==”s” && ($4==”AOMDV” || $4==”RTR”)) routing++} END {print “Routing Overhead:”, routing}’ aomdv-output.tr
- Enhance Your AOMDV Project
We can prolong the simple simulation of AOMDV using following ways:
- Add Mobility Models:
- Replicate the node movements with the support of Random Waypoint Mobility:
$ns at 0.0 “$n(0) setdest 100 100 10”
$ns at 1.0 “$n(1) setdest 200 200 15”
- Traffic Variations:
- Integrate the TCP traffic or numerous CBR streams variations for more complex scenarios.
- Performance Comparison:
- We equate the performance of AOMDV with AODV and DSR protocols for:
- Routing Overhead
- End-to-End Delay
- Packet Delivery Ratio
- We equate the performance of AOMDV with AODV and DSR protocols for:
- Scalability:
- We will need to replicate the large topologies including ns-random and then estimate the performance of AOMDV since the number of nodes maximizes.
- Fault Tolerance:
- Launch link/node failures for fault tolerance:
$ns rtmodel-at 2.0 down $n(1) $n(2)
$ns rtmodel-at 3.5 up $n(1) $n(2)
- Tools for Result Visualization
- NAM: Apply nam for envisioning the packet transmission and routing decisions.
- AWK scripts: We can obtain and examine the trace file information using AWK scripts.
- Graph Plotting:
- Envision the following metrics with the support of Gnuplot or Matplotlib:
- PDR vs Node Count
- End-to-End Delay vs Traffic Load
- Routing Overhead vs Node Mobility
- Envision the following metrics with the support of Gnuplot or Matplotlib:
Example Project Ideas:
- Performance Analysis of AOMDV under Mobility:
- Examine how node movement impacts the performance of AOMDV.
- Comparison of AOMDV with AODV and DSR:
- We will need to equate the performance of AODMV with PDR’s end-to-end delay, and routing overhead.
- Energy-Efficient AOMDV:
- Fine-tune AOMDV for reducing the power utilization.
- Load Balancing in Multipath Routing:
- Examine how AOMDV delivers the traffic for load balancing through several routing paths.
- Fault Tolerant AOMDV:
- We need to replicate the node/link failures and also estimate the retrieval period of AOMDV.
Above we explained detailed insights about the AOMDV Protocol Projects, which utilized simple simulation mechanisms in NS2 for simulation and analysis, can found. If you need further details related to this topic, we will send it to you.