SkillAgentSearch skills...

UavNetSim

UavNetSim: A Python-based simulation platform for designing and testing communication protocols and control algorithms in UAV swarm.

Install / Use

/learn @Zihao-Felix-Zhou/UavNetSim

README

<div align="center"> <img src="https://github.com/Zihao-Felix-Zhou/UavNetSim-v1/blob/master/img/logo.png" width="650px"> </div> <div align="center"> <h1>UavNetSim: A Python based Simulation Platform for UAV Communication Networks</h1> <img src="https://img.shields.io/badge/Github-%40Zihao--Felix--Zhou-blue" height="20"> <img src="https://img.shields.io/badge/License-MIT-brightgreen" height="20"> <img src="https://img.shields.io/badge/Version-V1.0-orange" height="20"> <img src="https://img.shields.io/badge/Contributions-Welcome-yellowgreen" height="20"> <a href="https://hellogithub.com/repository/Zihao-Felix-Zhou/UavNetSim-v1" target="_blank"><img src="https://abroad.hellogithub.com/v1/widgets/recommend.svg?rid=51f926ec044046afb3ed23a912421445&claim_uid=yc7sS80jimthluU&theme=small" alt="Featured|HelloGitHub" /></a> <h3>Make simulation more friendly to novices! </h3> </div>

Read this in other language: 中文

This Python-based simulation platform provides a realistic and comprehensive modeling of various components in UAV networks, including the network layer, MAC layer, physical layer, as well as UAV mobility and energy models. Moreover, the platform is highly extensible, allowing users to customize and develop their own protocols to suit diverse application requirements. <br>

This repository corresponds to our following paper. In addition, we have also updated many new modules and baselines at present.

UavNetSim-v1: A Python-based Simulation Platform for UAV Communication Networks <br> Zihao Zhou<sup>1</sup>, Zipeng Dai<sup>2</sup>, Linyi Huang<sup>3</sup>, Cui Yang<sup>1</sup>, Youjun Xiang<sup>1</sup>, Jie Tang<sup>1</sup> and Kai-kit Wong<sup>4,5</sup> <br> <sup>1</sup> School of Electronic and Information Engineering, South China University of Technology <br> <sup>2</sup> Department of Computer Science and Technology, Beijing Institute of Technology <br> <sup>3</sup> Thrust of ROAS, The Hong Kong University of Science and Technology (Guangzhou) <br> <sup>4</sup> Department of Electrical and Electronic Engineering, University College London <br> <sup>5</sup> Yonsei Frontier Lab, Yonsei University

<div align="center"> <img src="https://github.com/Zihao-Felix-Zhou/UavNetSim-v1/blob/master/img/Schematic_of_uav_swarms.png" width="1000px"> </div>

Requirements

  • matplotlib==3.10.1
  • numpy==2.2.4
  • openpyxl==3.1.5
  • Pillow==11.2.1
  • scikit_opt==0.6.6
  • simpy==4.1.1

Features

Before you start your simulation journey, we recommend that you read this section first, in which some features of this platform are mentioned so that you can decide if this platform meets your development or research needs.

  • Python-based (this simulation platform is developed based on SimPy library in Python);
  • More suitable for the development and verification of routing protocols, MAC protocols, and motion control algorithms (e.g., topology control, trajectory optimization). In the future, we hope to improve the platform to support more kinds of algorithms and protocols at different layers;
  • Support reinforcement learning (RL) and other AI-based algorithms;
  • Easy to extend (1. modular programming is used, and users can easily add their own designed modules; 2. different application scenarios are possible, e.g., flying ad-hoc networks (FANETs), UAV-assisted data collection, air-ground integrated network);
  • Good visulization, this platform can provide the visualization of UAV flight trajectory and packet forwarding path, which facilitates intuitive analysis of the behavior of protocols;
  • If you are engaged in UAV-assisted wireless communication systems and want to consider more cross-layer metrics (e.g., end-to-end delay, packet delivery ratio (PDR), throughput), then this platform is for you

Project structure

.
├── README.md
├── allocation
│   ├── central_controller.py
│   └── channel_assignment.py
├── energy
│   └── energy_model.py
├── entities
│   ├── drone.py
│   ├── obstacle.py
│   └── packet.py
├── mac
│   ├── csma_ca.py
│   └── pure_aloha.py
├── mobility
│   ├── gauss_markov_3d.py
│   ├── random_walk_3d.py
│   ├── random_waypoint_3d.py
│   └── start_coords.py
├── path_planning
│   ├── astar
│   │   └── astar.py
├── phy
│   ├── channel.py
│   ├── large_scale_fading.py
│   └── phy.py
├── routing
│   ├── dsdv
│   │   ├── dsdv.py
│   │   ├── dsdv_packet.py
│   │   └── dsdv_routing_table.py
│   ├── grad
│   │   └── ...
│   ├── greedy
│   │   └── ...
│   ├── opar
│   │   └── ...
│   └── q_routing
│       └── ...
├── simulator
│   ├── metrics.py
│   └── simulator.py
├── topology
│   └── virtual_force
│       ├── vf_motion_control.py
│       ├── vf_neighbor_table.py
│       └── vf_packet.py
├── utils
│   ├── config.py
│   ├── ieee_802_11.py
│   └── util_function.py
├── visualization
│   ├── static_drawing.py
│   └── visualizer.py
└── main.py

The entry point of this project is the main.py file, we can even run it directly with one click to get a sneak peek, however, we recommend that you first read this section to understand the modular composition of this simulation platform and the corresponding function.

  • allocation: this package includes modules for various resource allocation algorithms, e.g., sub-channel assignment schemes. Power allocation can be implemented as future work.
  • energy: this package includes the drone's energy model, covering both flight and communication-related energy consumption.
  • entities: it encompasses all modules corresponding to the primary entities involved in the simulation.
  • mac: it includes the implementations of different medium access control protocols.
  • mobility: it contains different 3-D mobility models of drones.
  • path_planning: this package includes modules for different 3D path planning algorithms (e.g., A*) for drone.
  • phy: it mainly includes the modeling of wireless channels in the physical layer, and the definition of unicast, broadcast, and multicast.
  • routing: it includes implementations of various routing protocols.
  • simulator: it comprises all the classes necessary for conducting the simulation and evaluating network performance metrics.
  • topology: this package includes modules for various topology control algorithms for UAV swarm.
  • utils: it contains the key configuration parameters and some useful functions.
  • visualization: it can provide visualization of the distribution of drones, flight trajectory and the packet forwarding paths.

| Layer | Currently implemented protocols, algorithms or models | | --- | --- | | Application layer | Uniform distribution for data packet arrival <br> Poisson distribution for data packet arrival | | Transport layer | Automatic repeat request (ARQ) | | Network layer | Routing protocols: <br> <ul><li>DSDV: Destination-Sequenced Distance-Vector routing</li> <li>GRAd: Gradient Routing in Ad Hoc Networks</li> <li>Greedy forwarding</li> <li>OPAR: Optimized Predictive and Adaptive Routing</li> <li>Q-FANET: Improved Q-learning based Routing Protocol for FANETs</li> <li>QMR: Q-learning based Multi-objective optimization Routing</li> <li>QGeo: Q-learning-based Geographic routing</li> <li>Classical Q-Routing</li></ul>| | Topology control layer | Random mobility models: <br> <ul><li>3D Gauss-Markov mobility model</li><li>3D Random Waypoint mobility model</li><li>3D Random Walk mobility model</li></ul> Topology control algorithms: <br> <ul><li>Virtual force-based topology control</li></ul> Path planning and obstacle avoidance algorithms: <br> <ul><li>A* 3D path planning</li></ul>| | Medium access control layer |<ul><li>CSMA/CA: Carrier-Sense Multiple Access with Collision Avoidance</li> <li>Pure ALOHA</li> <li>Time-Division Multiple Access</li> </ul>| | Physical layer | The characteristics in physical layer that taken into account: <br> <ul><li>Line-of-Sight (LoS) channel</li> <li>Probabilistic Line-of-Sight (LoS) channel</li> <li>Packet collisions and signal interference</li> <li>Unicast, multicast and broadcast</li></ul> |

Installation and usage

Firstly, download this project:

git clone https://github.com/Zihao-Felix-Zhou/UavNetSim-v1.git

Run main.py to start the simulation.

Core logic

The following figure shows the main procedure of packet transmissions in UavNetSim. "Drone's buffer" is a resource in SimPy whose capacity is one, which means that the drone can send at most one packet at a time. If there are many packets that need to be transmitted, they

Related Skills

View on GitHub
GitHub Stars308
CategoryDevelopment
Updated2d ago
Forks47

Languages

Python

Security Score

100/100

Audited on Mar 26, 2026

No findings