How to Start Vertical Handover Projects Using NS2
To start Vertical Handover projects using Network Simulator 2 (NS2), we’ll need to replicate the mobile device’s seamless transition among diverse kinds of networks such as WiFi to LTE, or WiFi to 5G. In heterogeneous networks (HetNets), vertical handover is a key module and it is very helpful to learn the mobility, Quality of Service (QoS), and decision-making mechanisms. Below is general simulation process to get started with Vertical Handover projects using NS2.
Steps to Start Vertical Handover Projects in NS2
- Set Up NS2 for Vertical Handover
- Install NS2:
- Initially, we should download the NS2 on the system.
- Set up it on a Linux system or Windows to utilise Cygwin.
- Confirm the installation including a simple Tcl script.
- Patch NS2 for Vertical Handover:
- While NS2 doesn’t directly vertical handovers support, but we can utilise a patch or change the source code containing vertical handover functionality. Patches like MobiWan, NIST Mobility, or custom extensions are generally utilised for vertical handover.
- Verify Support for Wireless Networks:
- Make sure that NS2 offers both wireless networks such as WiFi, LTE and mobility models.
- Understand Vertical Handover Requirements
- Handover Triggers:
- QoS requirements (latency, throughput).
- Network congestion.
- Signal strength degradation.
- Decision Parameters:
- Network load.
- Energy utilization.
- Received Signal Strength Indicator (RSSI).
- Bandwidth.
- Performance Metrics:
- QoS metrics.
- Packet loss.
- Handover delay.
- Throughput.
- Define the Network Topology
Vertical handover needs minimum two network types like WiFi and LTE to create the network topology. Describe a Tcl script for replicating these networks.
Example: Basic Heterogeneous Network
# Create a simulator instance
set ns [new Simulator]
# Define trace and NAM files
set tracefile [open out.tr w]
set namfile [open out.nam w]
$ns trace-all $tracefile
$ns namtrace-all $namfile
# Define nodes
set mobileNode [$ns node]
set wifiAP [$ns node]
set lteBS [$ns node]
# Set up mobility
$ns at 0.0 “$mobileNode setdest 100 100 10”
$ns at 10.0 “$mobileNode setdest 200 200 20”
# Define wireless network (WiFi)
$ns add-wireless-channel $wifiAP 2.4GHz 100m
# Define cellular network (LTE)
$ns add-wireless-channel $lteBS 1.8GHz 300m
# Add mobility model
$mobileNode set X_ 0
$mobileNode set Y_ 0
$mobileNode set Z_ 0
# Handover decision based on signal strength
proc handover {node fromNet toNet} {
global ns
set strength [$node get-signal-strength $fromNet]
if {$strength < -80} {
$ns disconnect $node $fromNet
$ns connect $node $toNet
}
}
# Simulate traffic
set tcp [new Agent/TCP]
$ns attach-agent $mobileNode $tcp
set sink [new Agent/TCPSink]
$ns attach-agent $lteBS $sink
$ns connect $tcp $sink
# Traffic generation
set ftp [new Application/FTP]
$ftp attach-agent $tcp
$ns at 1.0 “$ftp start”
$ns at 20.0 “$ftp stop”
# End simulation
$ns at 30.0 “finish”
proc finish {} {
global ns tracefile namfile
$ns flush-trace
close $tracefile
close $namfile
exec nam out.nam &
exit 0
}
# Run simulation
$ns run
- Implement Handover Logic
Vertical handovers needs custom handover logic for:
- Monitoring Signal Strength:
- Execute the functions for estimating RSSI from varioius networks.
- Triggering Handover:
- Describe conditions to launch handover such as low signal strength.
- Decision Algorithms:
- Integrate the handover decision mechanisms according to the bandwidth or QoS.
Example C++ Function for Signal Strength
Fine-tune ns-default.tcl or inscribe custom C++ code:
double Node::getSignalStrength(NetworkType netType) {
if (netType == WIFI) {
return this->wifiSignalStrength;
} else if (netType == LTE) {
return this->lteSignalStrength;
}
return -1;
}
- Simulate Traffic
We need to incorporate the application-level traffic like TCP, UDP among the nodes for measuring the influence over the performance of handover.
Example Traffic Configuration:
# UDP traffic
set udp [new Agent/UDP]
$ns attach-agent $mobileNode $udp
set null [new Agent/Null]
$ns attach-agent $lteBS $null
$ns connect $udp $null
set cbr [new Application/Traffic/CBR]
$cbr set packetSize_ 512
$cbr set interval_ 0.1
$cbr attach-agent $udp
$ns at 0.1 “$cbr start”
- Run the Simulation
- We need to store the Tcl script like vertical_handover.tcl.
- Run the simulation script:
ns vertical_handover.tcl
- Envision the network in NAM:
nam out.nam
- Analyze the Results
- Trace File Analysis:
- Examine the trace file as out.tr for metrics such as handover events, packet loss, and delay.
- Metrics to Evaluate:
- Handover Latency: Measure the duration to change networks.
- Packet Delivery Ratio: Compute the volume of packets that are effectively transmitted.
- Throughput: During and after handover, we estimate the rate of data.
Example AWK Script for Handover Analysis:
awk ‘{
if ($1 == “r” && $4 == “tcp”) {
sum += $6
}
} END {
print “Throughput during handover:”, sum / 1000, “kbps”
}’ out.tr
- Extend the Project
- QoS-Aware Handover:
- We need to execute the handover mechanisms for deliberating the metrics like latency, bandwidth, and jitter.
- Mobility Models:
- Mimic dynamic scenarios to utilise mobility models such as Random Waypoint.
- Energy Efficiency:
- Integrate the energy utilization parameters for mobile devices.
- Handover Prediction:
- Make use of handover predictive algorithms for minimizing handover latency.
Example Use Cases
- WiFi-LTE Handover:
- Replicate the handover among a WiFi hotspot and LTE base station.
- Vehicle-to-Everything (V2X):
- Mimic seamless handovers for vehicular interaction.
- 5G-WiFi Offloading:
- Focus on traffic offloading in 5G networks for minimizing congestion.
Through this manual, we had successfully modeled and executed the Vertical Handover projects in NS2 environment by utilising these steps. You can also tailor the simulation for specific research objectives and scenarios. If you have any query on this topic, please feel free to ask!