How to Start Fisheye Protocol Projects Using NS2
To start Fisheye State Routing (FSR) protocol projects in NS2, which is a proactive link-state protocol supports to minimize the overhead by means of transmitting specified routing updates only to neighbouring nodes and only some updates to remote nodes. We can adhere to these detailed steps to get started:
Steps to Start FSR Projects in NS2
- Set Up NS2 Environment
Make sure that we have installed and set up NS2 correctly on the machine.
- Install NS2 (Ubuntu/Linux):
sudo apt-get update
sudo apt-get install ns2
- Verify NS2 Installation:
ns
If effectively installed NS2 then we show the NS2 prompt (%).
- Enable Fisheye State Routing (FSR) in NS2
FSR is obtainable within NS2 by default since one of their routing protocols.
- Confirm FSR have direct support within NS2 by exploring:
grep -i “fisheye” ns-2.35/tcl/lib/ns-default.tcl
We may observe an access for FSR.
- Write a TCL Simulation Script for FSR
Here’s a simple simulation script of FSR using NS2.
FSR TCL Script Example:
# Initialize the Simulator
set ns [new Simulator]
# Define trace and NAM output files
set tr [open fisheye-output.tr w]
$ns trace-all $tr
set nf [open fisheye-output.nam w]
$ns namtrace-all $nf
# Define 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 (Bandwidth, Delay, Queue)
$ns duplex-link $n(0) $n(1) 2Mb 10ms DropTail
$ns duplex-link $n(1) $n(2) 2Mb 15ms DropTail
$ns duplex-link $n(2) $n(3) 2Mb 20ms DropTail
$ns duplex-link $n(3) $n(4) 2Mb 10ms DropTail
$ns duplex-link $n(4) $n(0) 2Mb 15ms DropTail
# Enable Fisheye State Routing (FSR)
$ns rtproto Fisheye
# Traffic Source Configuration (UDP + CBR)
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
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 fisheye-output.nam &
exit 0
}
# Run Simulation
$ns run
- Run the Simulation
- We will need to store the script like fsr_simulation.tcl applying NS2.
- Then, execute the TCL simulation script with NS2:
ns fsr_simulation.tcl
- Outputs:
- NAM file (fisheye-output.nam): It supports to envision the network topology and routing behavior.
- Trace file (fisheye-output.tr): Every network events are recorded by trace file.
- Analyze Simulation Results
Obtain simulation performance parameters from the trace file for estimating the performance of FSR.
- Packet Delivery Ratio (PDR):
Measure the percentage of packets that are effectively received:
awk ‘{if($1==”r” && $4==”cbr”) received++} END {print “PDR:”, received}’ fisheye-output.tr
- End-to-End Delay:
Estimate the average delay for packet delivery:
awk ‘{if($1==”r” && $4==”cbr”) {delay[$6]=$2-start[$6]}} END {for (x in delay) sum+=delay[x]; print “Average Delay:”, sum/NR}’ fisheye-output.tr
- Routing Overhead:
Assess the routing control packets for overhead:
awk ‘{if($1==”s” && $4==”RTR” && $5==”FSR”) count++} END {print “Routing Overhead:”, count}’ fisheye-output.tr
- Enhance Your FSR Project
- Mobility Models:
- Launch Random Waypoint or use other mobility patterns for dynamic node movement:
$ns at 0.0 “$n(0) setdest 50 100 10”
$ns at 1.0 “$n(2) setdest 100 200 15”
- Scalability Analysis:
- Maximize the volume of nodes which has 50-100 nodes approximately and then compute the performance of FSR.
- Traffic Types:
- We can replicate types of TCP traffic or mixed traffic like CBR + FTP.
- Comparison with Other Protocols:
- Equate the performance of FSR with other protocols such as AODV or DSDV metrics like:
- Packet Delivery Ratio
- Routing Overhead
- End-to-End Delay
- Node Failures:
- Replicate the node/link failures for examining the robustness of FSR:
$ns rtmodel-at 2.0 down $n(1) $n(2)
$ns rtmodel-at 4.0 up $n(1) $n(2)
- Tools for Result Visualization
- NAM: Envision the routing behavior and packet flow with the support of NAM.
- AWK Scripts: Describe and examine the trace file in AWK scripts.
- Graph Tools: Make use of visualization tools like Gnuplot or Matplotlib to design:
- Packet Delivery Ratio vs Node Density
- End-to-End Delay vs Traffic Load
- Routing Overhead vs Simulation Time
Example Project Ideas
- Performance Analysis of FSR in MANET:
- Examine how node density and mobility affect the performance of FSR within MANET.
- FSR vs AODV in Mobile Networks:
- We need to equate the routing overhead and delay in diverse mobility circumstances.
- Energy-Efficient FSR:
- Fine-tune FSR protocols for reducing power utilization in the course of routing updates.
- QoS-Aware FSR:
- Execute the traffic prioritization in FSR for real-time information.
Through structured stepwise simulation techniques in NS2, we have effectively replicated and analyzed Fishery Protocol Projects. We will continue to share more innovative insights and concepts as the project evolves.