To simulate Unmanned Aerial Systems (UAS) based Vehicular Ad-Hoc Networks (VANET) projects using NS2 has needs to generate a scenarios in which the UAS (drones) and vehicles interact to permit the optimized networking among the aerial and ground nodes. This kind of simulation design how the UAS can be combined into vehicular networks to enhance network connectivity, data dissemination, and communication efficiency in urban or highway environment. UAS-based VANETs are usually utilized in smart transportation, traffic monitoring, emergency communications, and urban surveillance.phdprime.com will be the ultimate solution for you to get simulation done.
Here’s a step-by-step guide to simulate UAS-based VANET projects using NS2.
Steps to Simulate UAS-Based VANET Projects Using NS2
- Install NS2 and VANET Extensions:
Make sure that NS2 is installed on the system. If you are performing with VANETs, we required to combine a VANET-specific extensions or MOBILITY models that can replicate vehicular movements, like SUMO (Simulation of Urban MObility) for realistic vehicle mobility, or any built-in NS2 mobility models for basic simulations.
- Define the UAS and VANET Network Topology:
In a UAS-based VANET, we will have UAS nodes (drones) flying in the sky and vehicle nodes moving on the ground, forming a communication network.
Here is an instance of how to describe the basic topology for UAS-based VANET:
set ns [new Simulator]
# Create UAV (Unmanned Aerial Vehicle) nodes
set uav1 [$ns node]
set uav2 [$ns node]
# Create vehicle nodes for VANET
set vehicle1 [$ns node]
set vehicle2 [$ns node]
set vehicle3 [$ns node]
# Create roadside unit (RSU) nodes for roadside communication
set rsu1 [$ns node]
# Define links (use wireless links for VANET)
$ns duplex-link $uav1 $rsu1 100Mb 1ms DropTail
$ns duplex-link $vehicle1 $rsu1 10Mb 2ms DropTail
$ns duplex-link $vehicle2 $rsu1 10Mb 2ms DropTail
$ns duplex-link $vehicle3 $rsu1 10Mb 2ms DropTail
$ns duplex-link $uav1 $uav2 100Mb 1ms DropTail
This topology that contain:
- UAVs (uav1, uav2) denote aerial drones.
- Vehicles (vehicle1, vehicle2, vehicle3) forming a VANET.
- Roadside Units (RSUs) performing as communication points among vehicles and UAVs.
- Set Up Mobility Models:
Mobility is vital in VANETs and UAS-based systems. We can weather to utilize random waypoint mobility or import realistic mobility traces for both UAVs and vehicles.
(a) Vehicle Mobility (VANET) Simulation:
NS2 deliver the option to utilize mobility models for vehicular movements. For more realistic vehicle movements, we can incorporate SUMO (Simulation of Urban MObility) with NS2.
Example of setting up random waypoint mobility for vehicles:
# Mobility for vehicle1
$ns at 0.0 “$vehicle1 setdest 500 100 20”
$ns at 5.0 “$vehicle1 setdest 1000 200 25”
# Mobility for vehicle2
$ns at 0.0 “$vehicle2 setdest 600 150 15”
$ns at 5.0 “$vehicle2 setdest 1100 300 30”
# Mobility for vehicle3
$ns at 0.0 “$vehicle3 setdest 700 250 20”
$ns at 5.0 “$vehicle3 setdest 1200 400 35”
In this example, vehicles move among defined destinations at certain speeds.
(b) UAS Mobility (UAV) Simulation:
The mobility of UAVs can be defined using weather random movement or predefined flight paths.
Example of setting up random waypoint mobility for UAVs:
# Mobility for uav1
$ns at 0.0 “$uav1 setdest 800 500 25”
$ns at 5.0 “$uav1 setdest 1000 700 20”
# Mobility for uav2
$ns at 0.0 “$uav2 setdest 900 600 20”
$ns at 5.0 “$uav2 setdest 1100 800 25”
This describes how UAVs move in the air, interacting with both vehicles and RSUs.
- Configure Wireless Communication Protocols:
While both UAVs and vehicles interact wirelessly, set up wireless communication protocols like UDP or TCP for data transmission. AODV (Ad hoc On-Demand Distance Vector) or other VANET routing protocols such as DSR (Dynamic Source Routing) can also be utilized for handling the routes.
Example of setting up UDP communication between a vehicle and a UAV:
# Set up UDP agent on vehicle1 and uav1
set udpVehicle1 [new Agent/UDP]
set udpUav1 [new Agent/UDP]
$ns attach-agent $vehicle1 $udpVehicle1
$ns attach-agent $uav1 $udpUav1
# Connect UDP agents for communication
$ns connect $udpVehicle1 $udpUav1
For routing protocol configuration, you can use AODV as an example:
# Configure routing protocol AODV for VANET
$ns node-config -adhocRouting AODV -llType LL -macType Mac/802_11 \
-ifqType Queue/DropTail/PriQueue -ifqLen 50 \
-antType Antenna/OmniAntenna -propType Propagation/TwoRayGround
- Simulate Data Transmission:
Once the communication protocols are set, replicate data exchange among UAVs, vehicles, and RSUs. This can contain real-time data like video streaming, sensor data transmission, or emergency alerts.
Example of generating CBR (Constant Bit Rate) traffic from a UAV to a vehicle:
# Simulate CBR traffic from uav1 to vehicle1
set cbrTraffic [new Application/Traffic/CBR]
$cbrTraffic set packetSize_ 512
$cbrTraffic set interval_ 0.01 ;# Send a packet every 10ms
$cbrTraffic attach-agent $udpUav1
# Start CBR traffic at 1 second
$ns at 1.0 “$cbrTraffic start”
This sample denotes continuous data transmission from a UAV to a vehicle.
- Simulate Handover Between UAVs and RSUs:
As vehicles move out of the communication range of one UAV, they can switch to another UAV or RSU. we can replicate this handover process.
Example of simulating a handover:
# At 5 seconds, vehicle1 switches to communicate with uav2
$ns at 5.0 “$ns connect $udpVehicle1 $udpUav2”
This illustrates a handover environment in which a vehicle moves from one UAV’s communication range to another’s.
- Implement QoS (Quality of Service) for Real-Time Applications (Optional):
To manage real-time data such as video or sensor data, we can execute QoS to select traffic in the network. This can be completed by using priority queuing or Weighted Fair Queuing (WFQ) at the RSU or UAVs.
Example of applying QoS (priority queueing):
Queue/PriQueue set limit_ 50
$ns duplex-link-op $rsu1 $uav1 queueOption Priority
- Run the Simulation:
Once the network, mobility models, communication protocols, and traffic flows are defined, execute the simulation.
Example of running the simulation:
ns uas_vanet_simulation.tcl
We can envision the simulation using NAM (Network Animator) to track the movements of UAVs and vehicles:
nam uas_vanet_simulation.nam
- Analyse Results:
After the simulation, evaluate the trace files (*.tr) to measure the performance of the UAS-based VANET. Key parameters to evaluate that contain:
- Throughput: Assess the amount of data successfully routed among UAVs and vehicles.
- Latency: Measure the delay in communication among UAVs and vehicles.
- Packet Delivery Ratio (PDR): Estimate the ratio of successfully delivered packets.
- Handover Latency: Assess the time taken to switch among UAVs or from UAV to RSU.
Example of evaluating the trace data using AWK:
awk ‘{if ($1==”r” && $4==”AGT” && $7==”UDP”) print $0}’ uas_vanet_trace.tr
- Advanced Features (Optional):
- Collision Avoidance: Apply the techniques to mimic on how UAVs prevent collisions in the air while interacting with vehicles.
- Dynamic Routing: Execute dynamic routing protocols to manage network topology changes by the way of vehicles and UAVs move.
- Energy Efficiency: Replicate energy-aware routing in UAVs, as battery life is vital in drone operations.
We obtain a fundamental approach that will supports you to understand and gain knowledge about how the Unmanned Aerial Systems (UAS) based Vehicular Ad-Hoc Networks (VANET) project that were simulated and analyse the performance over the network using ns2 tool. Additional specific details will also been provided in upcoming manual.