How to Start DYMO Protocol Projects Using NS2
To start Dynamic MANET On-demand (DYMO) protocol projects in NS2, which is a reactive routing protocol that frequently utilised within Mobile Ad-hoc Networks (MANETs), it is indented for enhancing AODV with delivering the simpler and scalable route discovery. Here’s a structured guide to get started:
Steps to Start DYMO Protocol Projects in NS2
- Set Up NS2 Environment
Make sure that NS2 is properly installed and functioning on the machine.
- Install NS2 (for Ubuntu/Linux):
sudo apt-get update
sudo apt-get install ns2
- Verify NS2 Installation:
ns
If effectively installed NS2 then we can observe the NS2 interpreter (%).
- Add DYMO Support to NS2
The DYMO protocol isn’t portion of standard NS2. We can download and utilise the DYMO patch for allowing DYMO.
Steps to Install DYMO Patch:
- Download DYMO Patch:
- We will need to receive DYMO patches for NS2 from sources such as:
- DYMO for NS2
- Sample patch file as dymo_ns2.patch.
- We will need to receive DYMO patches for NS2 from sources such as:
- Apply DYMO Patch:
- Open NS2 directory:
cd ns-allinone-2.35/ns-2.35
-
- Utilize the patch:
patch -p1 < /path/to/dymo_ns2.patch
- Recompile NS2:
./configure
make
- Verify DYMO Installation: Seek DYMO for confirming the set up within the routing protocols:
grep -i “DYMO” ns-2.35/tcl/lib/ns-default.tcl
- Write a TCL Script for DYMO Simulation
After DYMO installation, we should make a TCL script for replicating DYMO within a MANET scenario.
DYMO TCL Script Example:
# Initialize the simulator
set ns [new Simulator]
# Define trace and NAM output files
set tr [open dymo-output.tr w]
$ns trace-all $tr
set nf [open dymo-output.nam w]
$ns namtrace-all $nf
# Define nodes
set val(nn) 10 ;# Number of nodes
set val(x) 500 ;# X dimension of topology
set val(y) 500 ;# Y dimension of topology
# Define simulation parameters
set val(stop) 20.0 ;# Simulation time
set val(rp) DYMO ;# Routing protocol
# Set up the topology
set topo [new Topography]
$topo load_flatgrid $val(x) $val(y)
# Create and configure nodes
for {set i 0} {$i < $val(nn)} {incr i} {
set node_($i) [$ns node]
$node_($i) random-motion 0
}
# Define node mobility
$ns at 0.0 “$node_(0) setdest 200 200 10”
$ns at 0.0 “$node_(1) setdest 300 400 15”
$ns at 0.0 “$node_(2) setdest 400 300 12”
$ns at 5.0 “$node_(3) setdest 100 100 8”
# Attach Traffic (UDP + CBR)
set udp [new Agent/UDP]
set null [new Agent/Null]
$ns attach-agent $node_(0) $udp
$ns attach-agent $node_(4) $null
$ns connect $udp $null
set cbr [new Application/Traffic/CBR]
$cbr attach-agent $udp
$cbr set packetSize_ 512
$cbr set rate_ 500kb
# Start Traffic
$ns at 0.5 “$cbr start”
$ns at 19.5 “$cbr stop”
# Finish Procedure
$ns at $val(stop) “finish”
proc finish {} {
global ns tr nf
$ns flush-trace
close $tr
close $nf
exec nam dymo-output.nam &
exit 0
}
# Run Simulation
$ns run
- Run the DYMO Simulation
- We can store the tcl simulation script like dymo_simulation.tcl.
- Then, execute the DYMO simulation with NS2:
ns dymo_simulation.tcl
- Outputs:
- NAM File (dymo-output.nam): It helps to envision the simulation.
- Trace File (dymo-output.tr): Make use of trace file to record the packet events for analysis.
- Analyze Simulation Results
Key Metrics to Evaluate:
- Packet Delivery Ratio (PDR): Estimate the percentage of packet that are effectively distributed to the total transmitted packets.
awk ‘{if ($1 == “r” && $4 == “cbr”) rec++} END {print “PDR:”, rec}’ dymo-output.tr
- End-to-End Delay: We will need to compute the average time for data packets:
awk ‘{if ($1 == “r” && $4 == “cbr”) {delay[$6] = $2 – start[$6]}} END {for (i in delay) sum += delay[i]; print “Avg Delay:”, sum/NR}’ dymo-output.tr
- Routing Overhead: Measure the volume of routing control packets such as DYMO RREQ, RREP:
awk ‘{if ($1 == “s” && $4 == “DYMO”) overhead++} END {print “Routing Overhead:”, overhead}’ dymo-output.tr
- Enhance Your DYMO Project
- Larger Topologies:
- For analysing the scalability we can maximize the volume of topologies nodes with the support of random node placement.
- Mobility Models:
- Add Random Waypoint Mobility use other mobility models for dynamic node movement:
$ns at 0.0 “$node_(i) setdest 100 200 10”
- Traffic Patterns:
- Make use of FTP through TCP traffic models for reliable interaction:
set tcp [new Agent/TCP]
$ns attach-agent $node_(0) $tcp
set ftp [new Application/FTP]
$ftp attach-agent $tcp
- Fault Tolerance:
- Launch node or link failures for fault tolerance:
$ns rtmodel-at 5.0 down $node_(2) $node_(3)
$ns rtmodel-at 10.0 up $node_(2) $node_(3)
- Performance Comparison:
- We want to equate the performance of DYMO with other routing protocols such as AODV and DSR.
- Visualization and Plotting
- Envision the node movements and route discovery applying NAM.
- Analyze trace files to utilize AWK scripts.
- With the help of Gnuplot or Matplotlib tools, we can design the graphs:
- Packet Delivery Ratio vs Number of Nodes
- End-to-End Delay vs Mobility
- Routing Overhead vs Traffic Load
Example DYMO Project Ideas:
- DYMO’s energy Efficiency within Wireless Sensor Networks.
- Scalability of DYMO Protocol under large MANET topologies.
- Comparison of DYMO and AODV using MANETs.
- QoS-aware DYMO Protocol for Real-Time Uses.
- Performance Investigation of DYMO in High Mobility.
By using a step-by-step method in NS2, we have successfully performed simulations and analysis for DYMO Protocol projects. Expect more advanced insights and project ideas to be shared later.