Loading repository data…
Loading repository data…
Zihao-Felix-Zhou / repository
UavNetSim: A Python-based simulation platform for designing and testing communication protocols and control algorithms in UAV swarm.
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.
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 Zihao Zhou1, Zipeng Dai2, Linyi Huang3, Cui Yang1, Youjun Xiang1, Jie Tang1 and Kai-kit Wong4,5 1 School of Electronic and Information Engineering, South China University of Technology 2 Department of Computer Science and Technology, Beijing Institute of Technology 3 Thrust of ROAS, The Hong Kong University of Science and Technology (Guangzhou) 4 Department of Electrical and Electronic Engineering, University College London 5 Yonsei Frontier Lab, Yonsei University
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.
.
├── 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 Poisson distribution for data packet arrival |
| Transport layer | Automatic repeat request (ARQ) |
| Network layer | Routing protocols: DSDV: Destination-Sequenced Distance-Vector routing GRAd: Gradient Routing in Ad Hoc Networks Greedy forwarding OPAR: Optimized Predictive and Adaptive Routing Q-FANET: Improved Q-learning based Routing Protocol for FANETs QMR: Q-learning based Multi-objective optimization Routing QGeo: Q-learning-based Geographic routing Classical Q-Routing |
| Topology control layer | Random mobility models: 3D Gauss-Markov mobility model3D Random Waypoint mobility model3D Random Walk mobility model Topology control algorithms: Virtual force-based topology control Path planning and obstacle avoidance algorithms: A* 3D path planning |
| Medium access control layer | CSMA/CA: Carrier-Sense Multiple Access with Collision Avoidance Pure ALOHA Time-Division Multiple Access |
Firstly, download this project:
git clone https://github.com/Zihao-Felix-Zhou/UavNetSim-v1.git
Run main.py to start the simulation.
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 need to queue for buffer resources according to the time order of arrival to the drone. We can simulate the queuing delay by this mechanism. Besides, we note that there are two other containers: transmitting_queue and waiting_list, for all the "data packets" and "control packets" generated by the drone itself or received from other drones but need to be further forwarded, the drone will first put them into the transmitting_queue. A function called feed_packet will periodically read the packet at the head of the transmitting_queue every very short time, and let it wait for the buffer resource. It should be noted that the "ACK packet" waits for the buffer resource directly without being put into the transmitting_queue.
After the packet is read, a packet type determination will be performed first. If this packet is a control packet (usually no need to decide the next hop), then it will directly start to wait for the buffer resource. When this packet is a data packet, next hop selection will be executed by the routing protocol, if an appropriate next hop can be found, then this data packet can start waiting for buffer resource, otherwise, this data packet will be put into waiting_list. Once the drone has the relevant routing information, it will take this data packet from "waiting_list" and add it back to transmitting_queue.
When the packet gets the buffer resource, MAC protocol will be performed to contend (or schedule) for the wireless channel. When the packet is successfully received by other drone, packet type determination also needs to be performed. For example, if the received packet is a data packet, an ACK packet is needed to reply after an SIFS time. In addition, if the receiver is the destination of the incoming data packet, some metrics will be recorded (PDR, end-to-end delay, etc.), otherwise, it means that this data packet needs to be further relayed so it will be put into the transmitting_queue of the receiv
| Physical layer | The characteristics in physical layer that taken into account: Line-of-Sight (LoS) channel Probabilistic Line-of-Sight (LoS) channel Packet collisions and signal interference Unicast, multicast and broadcast |