1 Introduction

WSNs have rapidly increased in popularity during recent years among research key subjects. WSNs typically include low-cost, battery-powered, and energy-constrained dispersed sensor nodes (SNs), each of which is restrained to limited energy resources, which makes it challenging to replenish after use. Therefore, to extend the lifespan of the entire network, energy-efficient communication strategies with less packet loss amongst SNs are essential. There are several approaches to mitigate energy usage and packet loss amongst ground networks. One of the solutions is the use of UAV, which offers more flexibility and manoeuvrability in data capturing use cases. The UAV can also be employed to offer a reasonably less polluted solution for data gathering from the dispersed ground SNs. It allows the WSN to pass their data through SNs’ representatives on the ground and then forward the buffered data to the UAV with higher percentage of Line of Sight (LoS) connectivity over vertical air-to-Ground communication rather than having plain horizontal on-the-Ground communication with Non-Line of Sight (NLoS) connectivity. Utilising the UAV for data gathering purposes from ground network could also facilitate the data gathering from the distant and isolated areas where the horizontal communication is not viable owing to uneven terrain shape or dense plantations.

UAV movement energy efficiency is also critical in WSN data gathering effort, as improving UAV energy efficiency can directly extend the flight time of the UAV to connect to more WSNs before it needs to be called back to recharge. Therefore, creating an energy-aware UAV path plan that takes into account the communication factors with SNs is essential to enhance the network performance cost.

Three key areas should be taken into account whereas designing a cost-effective UAV-based WSN data gathering model: an energy-efficient ground network architecture, a reliable UAV-Ground communication approach, and a power-efficient UAV path planning model. Each area could be represented by the main factors that can influence the structure of the proposed system.

Based on the conventional UAV-based WSN data gathering arrangement, the UAV path is restrained to limited options for collecting the data once physical topology of each group of ground sensor nodes is set. Setting the gateways to be selected dynamically offers adaptability to the ground network global topology taking the service demands into account. This allows for the groups topologies to be flexibly re-organise through software. The proposed concept of creating what we refer to as a ‘Fuzzy flight Path’ utilizes the capability to software redefine the groups representatives or network topology to align with the network requirements. The concept of adaptability of the UAV path with the ground SNs offers a flexibility for the entire network that ensures an improvement in the energy efficiency of either the UAV or the SNs. Therefore, the timely distribution of the workload of the collected data to a large number of gateways across multiple ground network structures can offer a host of advantages for the entire system. This includes improving the energy efficiency of the ground sensor network and allowing the UAV path design to be selected from multiple routes instead of being limited to one route. This ideology can eliminate the use of a single fixed architecture by distributing the workload of the data across multiple ground network entities, gateways, rather than a single gateway node.

With regard to wireless network energy efficiency and workload fairness in UAV-enabled data gathering use case, employing the recent technologies such as the software-defined network (SDN) and integrating the WSN three core functions, namely ‘leaf function’, ‘router function’, ‘Gateway function’ in the ground network through the softwarization approach to bring the concept of software-defined wireless sensor network (SDWSN) forward can offer a promising solution [1]. Herein, the control plane is separated from the data plane using a central controller such as a cloud computation processor [2]. The control plane transmits the logical operations and all relevant decisions to orchestrate the network structure, whereas the data plane forwards the data packets to an appropriate interface such as a cloud processing centre for computation. The separation of these two planes enables an intelligent routing mechanism and orchestration and re-orchestration (if necessary) of the network topology to support the network energy consumption and enhance UAV path through ground network flexibility.

This paper intends to leverage the SDWSN concept to facilitate a span for UAV path design definition. This necessitates flexible orchestration/re-orchestration of the topology providing flexibility for the network formations. It is worth mentioning that the main evaluation and performance metrics for the proposed approach focus on testing the energy consumption within the ground network and UAV, the packet delivery rate, and the communication time during the orchestration/re-orchestration process.

In the previous work [3], the UAV fuzzy path concept was briefly introduced and a preliminary point-to-point air-to-Ground communication between the UAV and the sensor nodes was initiated. Other previous work [4] focused on the UAV path relaxation concept within the fuzzy route in terms of UAV propulsion energy consumption, and preliminary in-Ground and air-to-Ground communication among the network components were established considering various ground SNs’ distributions and densities. Whereas within [5], the concept of SDN was aligned with the UAV path design to improve the ground network formation by proposing diverse packet frame designs for control and data packets signalling on the UAV-Ground communication. This paper aims to identify a solution for the UAV-aided WSN data gathering model, which considers three crucial areas jointly: ground network structure and re-structure, UAV-Ground communication, and UAV path planning model with utilization of the SDN functionality that can support the orchestration and re-orchestration of the ground network and thus offer the flexibility of the optimal UAV path. The main contributions of this work are summarized as follows:

  • The ‘Fuzzy Travel Route’ concept is defined as the UAV path span that enables the UAV flight path to be elected from a wider range of alternatives rather than being fixed in one defined path. This organisation allows the UAV path to be dynamically adjusted according to the updated ground network topology.

  • Proposing an effective solution for the integration between UAV path design, air-to-Ground connectivity, and ground network communication in a large field.

  • Applying the software-defined wireless sensor network (SDWSN) on the ground network that flexibly supports the movement of the UAV and enhances the energy efficiency of the communication network with latency analytical analysis through network orchestration/re-orchestration.

  • Obtaining an optimal UAV path design within the UAV fuzzy domain based on the updated network formations by defining an optimization problem considering jointly minimizing the UAV propulsion energy usage and ground SNs energy consumption while maximizing the packet delivery to the UAV.

The proposed model enhances the UAV path versus ground network energy efficiency with a higher percentage of served sensor nodes and an improved packet delivery rate to the UAV buffer. The remainder of this paper is structured as follows: Section 2 discusses the state-of-the-art and related work. Section 3 presents the proposed algorithms. Section 4 evaluates the proposed algorithm through extensive simulations. Finally, in Section 5, conclusions of the work and future work suggestions are provided.

2 Related work

Wireless communications via flying unmanned vehicles such as drones has recently gained popularity due to its numerous advantages, including rapid assembling, controllable moving, and offering line-of-sight (LoS) communication with the ground base stations [6]. There are three various use cases for UAV- aided wireless communications including UAV-enabled mobile relaying [7], UAV-enabled base station [8], UAV-enabled data acquisition [9]. One special application for the UAV is through the use of that as a mobile relay. Zeng et al. [10] have proposed UAV-enabled multicasting systems in which a UAV is used to disseminate a common file to a set of ground terminals. The main goal of the research is to minimize the UAV mission completion time, whereas ensuring that each ground terminal can successfully recover the file with a targeting probability. In this study, a set of optimal waypoints for the UAV trajectory is found, and then the instantaneous UAV speed is optimised along with the path connecting these waypoints.

The UAV serves as a flying base station in UAV-based aerial base stations use case, offering a reliable communication particularly in emergency situations to the ground users [11]. Another use case of UAV-based wireless communication is reflected in data acquisition leveraging the UAV from the ground sensor networks. Numerous studies have addressed UAV data collection use cases from a distributed sensor network, where the UAV visits the sensor nodes individually or through the SNs representatives. The aim is to maximize network performance by mitigating the risk of high network latency and packet loss rate to identify the shortest UAV path that can serve the maximum data points within the permissible operational link during a limited flight time. To this end, Karunanithy et al. [12] have utilized UAV as an intelligent data collector for water irrigation applications, where a number of randomly distributed sensor nodes disseminate their data to the UAV based on a suggested UAV-Ground communication structure. To minimize signal attenuation, they propose a communication transaction diagram in which the UAV initiates communication to the corresponding SNs. The key issues in creating a scalable, energy-efficient and delay tolerant UAV-capable WSN data gathering model are the high mobility, frequent movements of the UAV over the ground network and disruptions in the communication network. To overcome this issue, UAV trajectory designing domain has been suggested based on a wide variety of ever-changing methods such as the geometric based path planning [13,14,15] and heuristically trajectory planning [16,17,18].

In keeping with the context of UAV path planning design, optimization solutions are proposed to overcome the mobility and frequent disruptions in the communication network. This includes the optimization of the UAV’s trajectory parameters such as altitude, velocity, and energy usage of the UAV whereas ensuring the reliable communication network. Zeng et al. [18] have suggested a theoretical model for energy efficiency of a fixed wing UAV that relates its propulsion energy consumption with the flying velocity and acceleration. The aim of the paper is to propose an efficient design for enhancing the UAV’s energy efficiency considering general constraints on the UAV movement ensuring maximal communication bit rate. However, integrating the energy efficiency of the ground network with the air-to-Ground scheduling and UAV path planning can offer more realistic outcomes. Herein, it is worth mentioning that other aspects of energy efficiency and scalability of the UAV-aided WSN should be considered to simultaneously curtail the energy consumption of the UAV and WSN in the design. In this regard, Zhan et al. in [9] have focused on the energy efficiency of the ground SNs by developing an optimization problem for SNs’ wake-up schedule and UAV’s trajectory to minimize the energy consumption of all SNs whereas ensuring that a target amount of data is forwarded from each SN to the UAV. The proposed scheme achieved significant energy savings for the SNs as compared with static data collector. Ebrahimi et al. [19] have also outlined the issue of energy-efficient data collection in dense WSNs using minimising the length of UAV flight path and SNs’ transmission power. A data gathering model that takes into account the energy efficiency of UAV and SNs whereas ensuring the maximum transmission rate of communication packets in either ground or air-to-ground communications is missing from all the above references. Moreover, all such heuristic methods share similar characteristics and shortcomings. They can get stuck in local minima, although they offer fast and near-optimal solutions.

One of the key operational processes in WSN is data dissemination and management between ground nodes. Herein, an efficient data routing solution supported by the ground network organization should be presented to manage the resource constraints of the nodes such as computational capabilities and nodes distribution. This highlights the need for an adaptive network structure approach that could follow the demands of UAV-Ground interaction. Due to the considerable flight altitude of the UAV, a direct connection of the UAV to all nodes is not an energy-efficient way of data collection. This problem can be solved by dividing the nodes into clusters/groups so that only the Cluster Head (CH) nodes can communicate with the drone. The clustering process involves two steps: selecting the CHs and constructing the cluster. Several protocols and algorithms have been designed for clustering, serving different purposes based on the network applications requirements, such as reduction the energy consumption in WSN. Sengaliappan et al. [20] have proposed an improved version of the existing general self-organized tree-based energy balance routing protocol [21]. The authors [20] based their work on clustering, assuming that the nodes are randomly distributed in a square field and that only one base station is located far from the area for the root node assignment. The cluster tree network is built, with the base station allocating a root node to each level and broadcasting this selection to all nodes. Although the simulation results show that the protocol performs better than the existing protocol [21] in terms of packet loss, involving the base station in the allocation of the root node in each round could introduce delays in the process.

The clustering criteria for selecting a CH has been of significant importance in formulating a stable and adaptive cluster structure. Herein, the selection criteria for the CHs in UAV-enabled data gathering applications can be based on parameters related to the remaining energy of the nodes, the position density of the nodes, and their distance from the drone path [22,23,24,25,26,27,28,29]. In addition, a clustering model should be based on improving various performance metrics such as increasing cluster size, enhancing WSN functioning time, minimizing data collection time and reducing latency in network-based clustering to deliver real-time data to the drone with less delay. In this regard, Bagga et al. [30] have proposed a cluster-tree based routing protocol for data dissemination to save energy. The criteria for selecting a CH is based on a cluster’s load that can be supported by its CH. In addition, the node energy, the distance to the sink and the degree of the neighbouring nodes are three parameters for cluster selection process in their work. However, selecting a CH from nodes placed around the centre of a grid could limit the role of the head to a small group of nodes. To further emphasize the role of clustering for the energy efficiency of the network, different types of clustering structures and cluster sizes can impact the energy efficiency of the network and thus the communication between the clusters and the UAV. Alagirisamy et al. [22] have utilized unequal cluster sizes in their WSN design to reduce the additional power consumed by the CHs once the data is routed to the sink. The results based on static and mobile sink nodes have indicated that considering unequal cluster sizes in the WSN design significantly extended the network lifetime of SNs. However, this method of clustering SNs can be efficient for the uniform distribution of sensor nodes, making it inapplicable for the random distribution of SNs which is close to an actual application.

As the number of distributed sensor nodes in the field increases, the complexity of the system becomes excessive, reducing data collection fairness between the network components. Herein, ground network management is required wherein the nodes need to be flexible in approaching the various tasks as well as processing the data. Hence, the nodes could be re-programmable when other tasks need to be prioritized during the network operation [31]. The Software-defined networking (SDN) concept has been proposed as another major trend in networking due to its potential in facilitating the network management, increasing network capability, easing virtualization within the network and allowing for innovation through network programmability [32, 33]. SDN has been reflected in several applications such as offloading network computation from UAV-assisted vehicles to perform computationally complex and time-sensitive tasks whereas reducing the risk of higher network latency and packet loss rate [34]. In this regard, Zhang et al. [35] have utilized the SDN concept on the internet of UAVs, where the entire network can “forward looking” the uploaded information to potentially idle nodes to achieve the optimized system performance [35]. In a bid to enable adaptability and flexibility in WSN, the integration of SDN in WSN has been referred to as Software defined wireless sensor network (SDWSN) [31, 36,37,38]. This integration can enhance the management and control of sensor networks taking into account the frequent changes to the network state and functions wherein the sensor functionalities can be adjusted by invoking various programs [39]. Furthermore, the network will be controlled and maintained easily in case of network failure. To examine the realistic communication link prior to the real implementation test, there are several methods to virtualize the network behaviour within the cloud [40]. Herein, the flexible orchestration of such ground WSN plays an important role in monitoring the operation of the physical environment. To a considerable extent, a cloud-based architecture tends to act as a viable solution since it encompasses a multitude of software-based computational capabilities, including virtualization and data management. The key components of cloud architecture are virtualization and softwarization, which contribute to network flexibility and can tackle the issues related to the response to any event. Software-driven virtualization offers a testing ground for conducting and analysing soft-trials of dynamic network scenarios. Such parallel co-simulation running in the cloud can significantly aid in leaning out the network configuration process by means of obviating the hardware requirements (during the testing process). For example, in our previous work [41], the Contiki-Cooja simulator is adopted as a virtualization platform for certain target hardware (Motes such as Texas Instruments CC2538 Evaluation Module). Karegar et al. [42] emphasize the importance of real world implementation for environmental monitoring using Raspberry Pi and Arduino in driving towards a flexible IoT-based sensor network organization. Cloud-based virtualization is adopted to plan and test various WSN orchestration scenarios when an event occurs. Network performance (i.e. packet loss, consumed energy, network downtime, etc.) can be analysed so that the most appropriate orchestration structure can be applied to the physical network [43, 44]. This can support flexible network operation and lessen the impact of network failure [45].

The previous research works mostly focused on the fixed data gathering arrangement in which the UAV path is restrained to limited options for collecting the data once physical topology of each group of ground sensor nodes is set. This restriction results in the fixed UAV path design following the ground network topology set up. Hence, this shortcoming prompted us to look into new path designing algorithms which could facilitate the UAV path design flexibility by adapting to the changeable ground network topologies straight away.

To employ SDWSN concept on the UAV-enabled data gathering, the core idea of the fuzzy path approach is examined in our earlier works [3,4,5]. The proposed approach in this paper is based on a geographic grouping structure with one or more representative nodes that can act as ground data collection points (s). The active collection points are then assigned based on the proposed design of the fitness model. This not only leads to more efficient and smoother UAV travel planning, but it can also aid in the fair routeing of network traffic. The optimal and smooth UAV flight path should be aligned with the updated network structure analysis, which provides fairness for ground network power consumption with minimal communication latency per round.

3 System model

3.1 UAV-based data collection of a distributed SDWSN: system organization and key assumptions

Conventionally, UAV-assisted data collection is based on either direct connection with individual nodes or indirect communication with group representative nodes (are referred to as cluster head). Whereas grouping in this formation allows for more efficient data transmission, it still limits the UAV path for data gathering to the limited options once the actual topology of each group is structured. The main question is, can we relax the UAV route options by allowing the cluster heads to be elected to match the data collection path?

Flight path relaxation allows the UAV to lower its energy expenditure in turning points once the UAV is within the sharp edges. This facilitates the minimum variations in speed and acceleration required at turning points reducing the UAV flight propulsion energy consumption [4]. This method also allows for the dynamic redefining of group topologies via softwarization. In this case, the CHs are software redefined to meet the requirements of the flight route.

The term ‘Fuzzy Travel Route’ is used in this paper to describe the ability to software redefine the network organization to align with the UAV flying optimal route. It is necessary here to clarify exactly what is meant by UAV fuzzy path. Fuzzy travel route concept is defined as a UAV path span that enables the UAV flight path to be chosen from a wider range of alternatives rather than being fixed in one defined path. The choice of the UAV flight’s dynamic parameters such as path shape, flight speed and acceleration variations could provide more options and be designed to maximize the efficiency of travel whereas reducing data loss. This organization allows the UAV path to be dynamically adjusted in accordance with the updated ground network topology. The main contribution of this research is on employing the software defined network orchestration concept applied on ground network and exploring its impact on data collection process’s robustness and evaluating its effect on the UAV’s movement and ground network’s energy efficiency and jointly analysing the UAV path energy consumption and ground network energy expenditure.

The fuzzy route approach is based on the ability of modifying a given node functionality from leaf node role to a gateway one or vice versa. These nodes are known as gateway-capable nodes. Due to the UAV path relaxation arising from a larger fuzzy range, this method can enhance the overall system robustness and efficiency. Herein, the proposed topology structure eases the UAV path by incorporating efficient and optimal route designs within the UAV route fuzzy region and providing the resilience for adaptive gateway election closer to the UAV path. For generality, the proposed model considers the random distribution of ground network, considering both dense and sparse nodes’ distributions over a given testing area. The goal is to identify the model by taking the distribution and density of ground network into account as two key factors (discussed in the following section). According to the proposed model, neighbouring nodes that are within LoS of each other form a WSN group that is controlled by one or more ground representatives acting as cluster head(s).

The design of fuzzy path following with the inserted smooth and optimal paths for each distribution and density scenarios are shown in Fig. 1a–d. The non-uniform path planning method via Bezier curves in sharp edges is one solution for path alignment within fuzzy route to overcome higher energy expenditure in sharp edges (See Fig. 1a–c) [4]. This UAV path design, on the other hand, has variable speed, which causes inflexibility in real-world path planning and leads to UAV energy efficiency degradation. Hence, an example of a relaxed UAV path fitted within a fuzzy flight route using circular arcs/lines geometry is proposed as shown in Fig. 1d [4]. This is demonstrated using two semi-circular routes with constant velocity and two linear and level flight paths with variable velocities. The proposed geometric semi-circular routes provide a better performance in terms of energy efficiency allowing for constant velocity travels for the UAV throughout the curves [4]. The velocity variation relaxation improves the UAV energy consumption for the entire tour and at the same time lower the complexity of the flying path. The detailed explanation on the designed methods of smooth paths is discussed further in our previous work [4]. In this paper, an optimal path design within the fuzzy range is obtained based on solving a proposed cost function for optimization problem.

Fig. 1
figure 1

The design of fuzzy route and smooth path with various distribution of gateway-capable nodes (from a to d from top left to down right, the distribution of gateway-capable nodes increased)

According to the simulation outcomes, using the fuzzy smooth and optimal path not only improves the energy efficiency of the entire tour but also provides the adaptability with the updated ground network formation. This paper also focuses on software defined enabled communication network formation via ground and air-to-Ground connectivity. The proposed model is highly dependent on the percentage of gateway-capable nodes distribution and density. As shown in these figures, the nominated gateways are represented with solid-line circles for each group whereas the remining potential gateways are depicted with dashed-line circles in the network structure. In short, the fuzzy flight route approach presents the potential for relaxing the specified options for the flight tour over a given group without jeopardizing the communication LoS. Depending on the capability of the WSN group members to presume the role of gateway, the more spread out the gateway-capable members, the better the smooth flight space.

3.2 The proposed network communication system

The proposed network communication architecture is based on splitting the entire system into multiple network components: Ground Network, Drone, Cloud stations. Leaf, Router and Gateway roles are three major roles in ground network formation as shown in Fig. 2. A node may be assigned to one or more of these roles. The drone terminal is also a mobile vehicle that collects data from the ground and sends that to the cloud via the Internet for instantaneous orchestration/re-orchestration evaluations and virtualization purposes.

Fig. 2
figure 2

Topological arrangement for WSN data gathering

Mainly, the communication among the UAV and ground in the proposed SDWSN is based on a set of control/sensing data information messages that requires to be passed over the cloud to either get the network configured during a phase called ‘topological pre-orchestration scanning phase’ or gather the sensing data through another phase called ‘data collection post-orchestration phase’. The proposed system model requires another phase called ‘orchestration phase’ to notify the ground network entities about their new roles through the backward communication from the cloud. The communication among the three acting sub-units which involves in these three phases aims at:

  • Collecting the control data by the UAV on available gateways and the relevant nodes that can access them and passing the control data to the Cloud.

  • Cloud level analysis of the collected control data and identifying the elected gateways and related network structure and operational parameters.

  • Passing the outcomes of the analysis from cloud to the ground networks within control data information offering the updated ground networks set up.

  • Collecting the ground sensing data through the data collection post-orchestration phase as a subsequent phase running the UAV movement within the designed updated fuzzy route.

The sequence diagram of the signalling within the control and data flow collection phases is expressed in our previous work [5].

3.3 Various roles in the network system

The designed communication network framework is based on the definition of multiple ground/aerial network roles. This includes leaf nodes, router-capable nodes, gateway-capable nodes, drone level and remote cloud server. Leaf nodes are the lowest functional roles in the network, predefined as prior to the UAV traveling; Leaf nodes are responsible for the data acquisition from connected sensors and passing sensing data and the critical control information to the higher-layer routers or gateways. They are not in direct contact with the UAV during the SDWSN phases. Leaf nodes can also be software redefined to act as fully functioned router nodes or to enable or disable a given query or data processing function.

The router-capable nodes also have the capability to be software defined as the high-layer fully functioned router nodes or reduced-function leaf nodes via the control packets received through the gateway. Once elected as routers, they can transfer information from other leaf nodes to upper-layer routers or active gateways using multi-hop communication protocol. They are presumed not to have direct communication with the UAV. Their roles as routers/leaf nodes are assigned by the UAV in the orchestration phase.

The gateway-capable nodes can be software defined to operate as gateways or dropped to lower-level routers and leaf nodes. Depending on their updated softwarised roles and their distributions in random positions within the ground network, they can present a variety of network topologies such as tree or star ones. They also determine the UAV fuzzy path. Their roles have been notified by the drone during the orchestration phase. Once selected as gateways for a given network of sensors, they are responsible for collecting the data coming from the lower-layer nodes and instantaneously forwarding that to the drone during the data collection phase. The spatial arrangement in a large-scale network distribution may include more than one node defined as a gateway. The presence of multiple gateways on a large-scale network facilitates the prevention of rapid energy draining of gateway-configured nodes and improves reliability by mitigating the risk of the failure of a single gateway. Herein, the flexibility of the network to handle any changes, such as on-going healing in response to a rupture caused by the failure of network components/gateways, can be achieved through the backup/multiple nodes. Also, it can provide a broader range of UAV fuzzy path where the route is dynamically adjusted to benefit either the drone energy efficiency or the ground network’s energy consumption balancing.

The UAV acts as an upper-layer router between the gateways and the cloud server providing access to the remote cloud server to pass the data through upstream control data flow within the pre-orchestration phase or the operational sensing data flow within data collection post-orchestration phase and downstream flow of reconfiguration of ground stations during the orchestration phase. The cloud platform is the central station for processing real-world data passed by drone and virtualising network stations. The decisions for gateway and router elections have also been made in cloud servers using a proposed fitness model. Following the decision, the UAV fuzzy path along with the elected gateways and routers are assigned to each node’s ID in the remote cloud station. Next, through the notification messages, the decisions are returned to the selected routers and gateways as well as their assigned leaf-nodes to structure the ground network. The proposed topological arrangement for a given WSN has been broadly depicted in Fig. 2.

In the proposed topological set-up, we assume that the gateway-capable nodes are spread such that one or more of them are not isolated from the remaining gateway capable nodes (there should not be any isolated gateway-capable node in the ground network).

The distribution of gateway-capable nodes factor \(D\) specifies the percentage of the gateway-capable nodes population out of the total sensor node population. Also, the gateway election factor \({\xi }_{i}\) represents the percentage of the gateway capable nodes population that have been reconfigured as gateways in each configuration election phase. The gateway election factor for each reconfiguration election process is obtained from:

$${\xi }_{i}=\frac{{n}_{i}}{m}$$
(1)

where in \({n}_{i}\) is the number of gateways elected in \(i\) th reconfiguration election process, \(m\) stands for the number of predefined gateway-capable nodes.

The other factor is spread factor which reflects the dispersing aspect of elected gateway nodes within the ground network after each reconfiguration election process. That is obtained from:

$${\sigma \_gc}_{i}=\sqrt{\frac{\sum_{i=1}^{N}{({q}_{0}^{i}-\mu )}^{2}}{N}}$$
(2)

wherein \({\sigma \_gc}_{i}\) is the spread factor after the election process of \(i\) th, \({q}_{0}^{i}\) is the coordinates of elected gateway nodes, \(\mu\) is the average coordinates of elected gateway nodes, \(N\) is the number of gateway nodes.

These three factors are the main parameters in defining the distribution and density of gateway-capable and elected gateway nodes among the total ground network entities.

As shown in Fig. 1a–d, the effect of increasing the percentage of the gateway-capable nodes and spread factor ratio whereas maintaining a constant amount of gateway election factor on the fuzzy path region and hence UAV flying route is demonstrated. Once the percentage of the gateway-capable nodes and the spread factor ratio are limited to the specified threshold of \({D}_{gc}\left(th\right)\) and \({\sigma }_{gc}\left(th\right)\), the UAV path shape loses its fluidity. On the other hand, this can be improved to a more relaxed shape with less sharp edges by utilizing the Bezier curve enhancement concept (according to Fig. 1a–c) [4].

Conversely, once the percentage of the gateway-capable nodes and the spread factor ratio are higher than the given threshold, the UAV fuzzy region is expanded, facilitating more flexibilities for the UAV path definition, and hence the UAV path gets closer to the smooth/optimal path with minimal sharp edges (See Fig. 1d). Hence, the proposed topology organization allows for the UAV’s smooth route capability by minimizing the variations in velocity, acceleration, and length of the path. This approach also provides the flexibility of gateways election closer to the UAV route design [4].

3.4 Energy consumption model for communication network

The proposed cost-effective energy model for evaluating the communication cost in both SDWSN topological scanning pre-orchestration and process data collection post-orchestration phases is represented as below:

$${Cost}_{total}={Cost}_{Ground-network}+ {Cost}_{air-to-Ground}$$
(3)

where in the overall communication cost equals with the aggregation of communication costs of both sensors on the ground and access points ground communication with UAV. The amount of each network components’ power consumption for enabling the ground network communication equals with:

$${P}_{T}={P}_{Tx}+{P}_{Rx}+{P}_{LPM}+{P}_{Idle}$$
(4)

that means the average power consumption of each node is the summation of the average power consumption of node in four modes: Idle mode, Low power mode (LPM), receiving and transmitting modes. The Idle mode (\({P}_{Idle}\)) is activated whenever the node is listening (the time interval that the CPU is non-active prior to the radio transmitter or receiver gets active). LPM mode (\({P}_{LPM}\)) is activated when the sensor node goes to low power mode. Rx mode (\({P}_{Rx}\)) is activated in the radio receive mode and finally Tx mode (\({P}_{Tx}\)) is activated in transmission mode.

Sensor nodes operate in either active mode or sleep mode. The ratio of the time spent in active mode to a total data period is defined as duty cycle. In general, sensors consume energy mainly in data receiving and transmitting, and idle listening when they are in active mode.

The proposed energy model uses the Contiki powertracker to measure the time intervals that each node spends in these four modes [46]. Hence, the overall energy consumption per node can be calculated considering the equivalent consumed energy for these intervals as following:

$$Cost=\sum_{i=1}^{4}{P}_{i}\times {T}_{i}$$
(5)

where in \({P}_{i}\) represents the value of consumed power within each power mode, \({T}_{i}\) is the time spent during a specific mode i. The power calculation analysis has been conducted based on the information explored from CC2538 datasheet for values of current usages, once the module is in active receiving, transmitting, idle and low power modes as shown in Table 1.

Table 1 Power parameters for Cooja mote based on [47]

For enabling the air-to-Ground communication among the UAV and gateway nodes, we use the radio model [48], for modelling the energy consumptions of transmitting and receiving of data for \(b\) bits as shown in below:

$${E}_{t}=\left\{\begin{array}{c}b{E}_{elec}+b{\varepsilon }_{fs}{d}^{2} \,d\le {d}_{0}\\ b{E}_{elec}+b{\varepsilon }_{amp}{d}^{4} \,d>{d}_{0}\end{array}\right.$$
(6)
$${E}_{r}=b{E}_{elec}$$
(7)

\({E}_{elec}\) stands for transmitting circuit loss and \({d}_{0}\) is the threshold distance. \({\varepsilon }_{fs}\) and \({\varepsilon }_{amp}\) are the energy for power amplification in the free space channel model and multipath fading channel model respectively. The number of transmitted/received bits for each node is denoted by \(b\). It is clear from (6) and (7) that the consumed energies for transmitter \({E}_{t}\) and receiver \({E}_{r}\) are highly dependent on received/disseminated bits as \(b\) and the instantaneous distance among the transmitter and receiver as \(d\). The same energy model is implemented in CupCarbon for calculating the energy consumption of air-to-Ground communication. We presume that the transmission distance \(d\) during the communication among the UAV and each gateway is less than the threshold distance \({d}_{0}\), and the free space channel model is adopted accordingly. As discussed in section 4, the overall communication cost in both SDWSN topological pre-orchestration scanning and data collection post-orchestration phases are analyzed based on various distribution and density factors of ground network.

3.5 Fitness election model

The fitness model computation is presumed to be executed in the cloud environment enabling the updated structure of a ground network organization. The suggested parameters in the fitness model election process for the involved potential gateways are briefly expressed as:

3.5.1 Link quality based on radio signal strength intensity (RSSI)

The link quality between a UAV and its neighbour gateways is obtained by using the information of received signal strength indication (RSSI) of received packets. The link quality between UAV and each network component assuming free space path loss, LQ can be expressed as [34]:

$${LQ}_{GWi-UAV}=\left(\sum_{k=1}^{{N}_{rssi}}\frac{{R}_{k}^{2}}{{N}_{rssi}}\right)-{\left(\sum_{k=1}^{{N}_{rssi}}\frac{{R}_{k}}{{N}_{rssi}}\right)}^{2}$$
(8)

Herein, \({N}_{rssi}\) is the total number of RSSI samples received on the UAV from each gateway-capable and \({R}_{k}\) is the \(RSSI\) value of the \(k\)-th sample.

3.5.2 Energy consumption factor per node

The overall energy consumption per node \({cost}_{i}\) is another key factor in election process calculated from (3).

3.5.3 Capacity factor per node

The capacity factor per node \({H}_{i}\) is another parameter in the proposed fitness model definition which is expressed as:

$${H}_{i}=1-\left(\frac{{M}_{i}}{{{Q}_{max}}_{i}}\right)$$
(9)

wherein \({M}_{i}\) is the current number of connected nodes to the gateway node \(i\) th and \({{Q}_{max}}_{i}\) is the maximum capacity of the gateway node \(i\) th. Note that once the number of connected nodes to the gateway equals with the defined maximum capacity, the capacity factor equals with 0. This means that the gateway is connected to its neighbors’ routers and leaf nodes with its full capacity, and it consumes higher energy than other gateways. This implies that this gateway should have a lower preference over the other gateways with higher capacity factor. Thus, the fitness model is defined as following:

$$\begin{aligned} {\text{W}}_{e} {\text{lection}}_{{\text{i}}} & = \upalpha \times {\text{LQ}}^{ - 1}_{{{\text{GWi}} - {\text{UAV}}}} \\ & \quad +\upbeta \times {\text{Cost}}^{ - 1}_{{\text{i}}} +\upzeta \times {\text{H}}_{{\text{i}}} \\ \end{aligned}$$
(10)

wherein \({LQ}_{GWi-UAV}\) is the link quality factor of the gateway-capable node \(i\) th received on the UAV, \({Cost}_{i}\) is the accumulative energy cost of gateway-capable node \(i\) th, Lower the \(LQ\) and \(Cost\) parameters are, the higher likelihood of electing as gateway node, \({H}_{i}\) is the capacity factor of the gateway node \(i\) th. According to the proposed fitness model, the ground network can be structured in favor of the gateway-capable nodes election with better link quality, lower energy consumption and with higher capacities. \(\alpha , \beta\) and ζ denote three weights assigned to the three parameters based on their priorities in the updated network structure. Following the execution of election process computation in the cloud, the gateway-capable node with the higher value of \({W\_election}_{i}\) will be elected as the updated gateway node and those that are not elected as gateways will be dropped down to leaf node functionality. The updated ground network architecture will be organized based on the locations of the current gateway nodes.

3.6 An analytical formulation for UAV path optimization problem

Following with multiple scenarios assumed in the UAV fuzzy range, the output performance of the proposed approach includes the percentage of served sensor nodes, ground network energy consumption, and average UAV energy consumption. It is obvious that there is a trade-off between UAV propulsion energy consumption and ground network energy cost. While a heuristic UAV smooth path design [4] can offer an energy efficient path from the UAV cost point of view, it suggests an energy inefficient data gathering model from ground SNs perspective. The Bezier curve UAV path design [4] although results in UAV energy consumption degradation per mission and lowers the percentage of served sensor nodes, it benefits the ground network formation in terms of energy efficiency. Hence, it is required to define an optimization problem to solve the optimal solution considering jointly minimizing the UAV propulsion energy usage and ground SNs energy consumption while maximizing the packet delivery to the UAV.

To this end, to enhance the packet delivery in the air-to-Ground communication, a statistical model for modelling the communication throughput amongst the UAV and SNs considering LoS communications needs to be developed. The air-to-Ground connectivity model for occasional link blockage due to NLoS links is not presumed in this paper. Hence, the total amount of information bits transferred to the UAV over the duration \(T\) is a function of UAV trajectory expressed as [47]:

$${\overline{R }(q(t))}_{air-to-Ground}=\underset{0}{\overset{T}{\int }}B{{\text{log}}}_{2}\left(1+\frac{{\gamma }_{0}}{{H}^{2}+{\Vert q\left(t\right)\Vert }^{2}}\right)$$
(11)

where \(B\) stands for the channel bandwidth, \({\gamma }_{0}\) is the reference received signal-to-noise ratio (SNR) at \({d}_{0} = 1\mathrm{ m}\). \(H\) is the altitude of the UAV while flying over the ground SNs. Also, the UAV energy consumption for a fixed-wing UAV considering variable velocity \(v\left(t\right)\) and acceleration vectors \(a\left(t\right)\) is expressed in (12) [18]:

$$\begin{aligned} \overline{E}\left( {q\left( t \right)} \right) & = { }\mathop \smallint \limits_{0}^{T} [c_{1} v\left( t \right)^{3} + \frac{{c_{2} }}{v\left( t \right)}\left( {1 + \frac{{a\left( t \right)^{2} - \frac{{\left( {a^{T} \left( t \right)v\left( t \right)} \right)}}{{v\left( t \right)^{2} }}^{2} }}{{g^{2} }}} \right)]dt \\ & \quad + \frac{1}{2}m\left( {v\left( t \right)^{2} - v\left( 0 \right)^{2} } \right) \\ \end{aligned}$$
(12)

in which \({c}_{1}\) and \({c}_{2}\) are two parameters related to the aircraft’s weight, wing, air density, etc., \(g\) is the gravitational acceleration with nominal value \(9.8\,\mathrm{ m}/{{\text{s}}}^{2}\), \(m\) is the mass of the UAV including all its payload. The speed of wind is considered zero.

To define the approximation optimization problem, a cost function of multiple parameters is required to be specified as:

$${Minimise}_{\begin{array}{c}q\left(t\right)\\ s.t. List of Constraints\end{array}}\frac{{\overline{E }(q\left(t\right))}_{UA{V}_{-propulsion}}+ {Cost}_{Total}}{{\overline{R }(q(t))}_{air-to-Ground}}$$
(13)

where \(q\left(t\right)\) is the UAV path design. \({\overline{E }(q\left(t\right))}_{UA{V}_{-propulsion}}\) is the UAV propulsion power consumption obtained from (12), \({\overline{R }(q(t))}_{air-to-Ground}\) is the communication throughput obtained from (11) and \({Cost}_{Total}\) is the ground energy cost emerged from (3). According to our assumptions, \({(Cost}_{Ground-network})\) within (3) is static and not dependant on the location of the UAV, while \({(Cost}_{air-to-Ground})\) is highly dependent on the distance between the UAV and SNs and as a result, the locations of the UAV based on (6). Hence, the impact of the ground SNs energy consumption while communicating with each other \({(Cost}_{Ground-network})\) is disregarded in our optimisation problem formulation by only taking the UAV-Ground communication energy usage \({(Cost}_{air-to-Ground})\) into account.

Identifying the constraints for the optimization problem is dependent on the definition of the approximation for the proposed scenario. The outcome of optimization problem should probably be an optimal and energy efficient UAV path design that adapts to the updated ground network formations supporting the requirement of maximized communication throughput and mitigating the high values of ground energy cost. By discretizing the time horizon \(T\) into \(N + 2\) slots with step size \({\delta }_{t}\), i.e., \(t = n{\delta }_{t}n = 0, 1, \cdot \cdot \cdot , N + 1\), the UAV’s trajectory \(q(t)\) can be well characterized by the discrete-time UAV location \(q\left[n\right]=q(n{\delta }_{t}),\) the velocity\(v\left[n\right]= v(n{\delta }_{t})\), as well as the acceleration\(a\left[n\right]=a(n{\delta }_{t})\).

The constraints that should be satisfied on the UAV path optimization problem are UAV initial/final location and velocity, the minimum/maximum speed and acceleration and minimum throughput requirement on the UAV-Ground connectivity. The list of the constraints in the UAV path optimization problem is expressed in Table 2.

Table 2 The list of constraints in solving optimization problem

Since some of the constraints in this table such as the minimum UAV speed and communication throughput constraints are not convex, solving approximation optimization problem in (13) is a challenging task due to the non-convex problem formulation. There are various mathematical algorithms to search the optimal results for non-convex problems. Herein, a specific mathematical solution for finding the optimal UAV path, velocity and acceleration with maximized communication throughput and minimized ground energy consumption considering the updated network formation is required. Sequential convex approximation (SCA) technique is chosen to solve the optimization problem using slack variables to convert the problem into linear programming which is solvable by CVX MATLAB.

3.7 Ground network latency analytical model

As the ground network can be flexibly structured based on distributed groups/clusters, with each CH communicating with the higher level of the system, i.e., UAV, latency analytical modelling can provide better analysis for network simulation. Herein, the topological pre-orchestration scanning phase entails latency within the pre-configuration round, whereas the orchestration phase entails latency within the election outcome notification round. The exchange of data between the leaf nodes and the gateway nodes can entail propagation and transmission latencies that need to be taken into consideration [49]. When the gateway node forwards the data to the UAV, the latency occurred by the data transmission from the gateway and the propagation latency between the gateway and UAV are part of the latency of the pre-orchestration phase. Finally, the data forwarded from the UAV to the cloud may also entail latency in data transmission of the UAV and propagation latency between the cloud and the UAV. The resulting transmission latency \({L}_{TR}\) and propagation latency \({L}_{Prop}\) are each expressed as:

$${L}_{TR}=\frac{{P}_{length}}{{S}_{rate}}$$
(14)

where in rein \({P}_{length}\) is the length of a packet/message transmitted by a node. Herein, \({P}_{length}\) of a router or gateway node can vary depending on the number of connections. \({S}_{rate}\) is the communication message transmission rate.

$${L}_{Prop}={T}_{received }- {T}_{transmission}$$
(15)

where in \({L}_{Prop}\) is the difference between time stamps of the message receipt (\({T}_{received}\)) of the destination and transmission (\({T}_{transmission}\)) of the source node.

The latency experienced during the pre-orchestration phase is expressed as:

$${L}_{Scanning}= \sum_{n=1}^{N}{L}_{TR(n)}+{L}_{Prop(Gateway-Leaf)}+\sum_{m=1}^{M}{L}_{TR(m)}+{L}_{Prop(UAV-Gateway)}+{L}_{TR(UAV)}+ {L}_{Prop(Cloud-UAV)}$$
(16)

where in \(N\) is the total number of leaf nodes, whereas \(M\) is the total number of gateway nodes. The latency experienced during the notification round for the orchestration phase is expressed as:

$${L}_{Notification}= {L}_{TR(Cloud)}+{T}_{Process(Fitness)}+{L}_{Prop(UAV-Cloud)}+{L}_{TR(UAV)}+{L}_{Prop(Gateway-UAV)}+\sum_{m=1}^{M}{L}_{TR(m)}+ {L}_{Prop(Leaf-Gateway)}$$
(17)

where in \({T}_{Process(Fitness)}\) is considered as a configuration parameter in this work which defines the processing latency caused by running the fitness model for orchestrating the ground network. As the notification of the ground network orchestration takes place, the system can enable the data gathering post-orchestration phase.

It is worth mentioning that the communication latency is supported by the designed packet structure for sensing/control data packets based on our previous work [5]. The latency for data gathering post-orchestration phase is calculated the same as (16) taking the packet length and the number of hops into consideration. Herein, as the structure of the ground network post-orchestration can be based on multi-hop approach, \({L}_{Prop}\) may vary depending on the number of hops that the packet travels from source to destination.

4 Model testing and evaluation

To conduct testing and evaluation for the proposed model, several sequential processes utilizing multiple simulation tools must be followed. As shown in Fig. 3, simulation through each software tool has composed of multiple computations that might get triggered in the event of either a defined component within the same simulation tool or an outputted parameter from other simulation tool. For the proposed model performance analysis in this thesis, four different software tools are used: MATLAB, Contiki-Cooja, CupCarbon, and Mission Planner. For instance, MATLAB output parameters can be applied as inputs for Cooja, CupCarbon and Mission Planner facilitating the network orchestration and smooth path design models at the same time. The outcomes of the proposed ground network softwarization and UAV path design are to enhance ground sensor nodes’ energy consumption, the communication latency, overall packet loss and the UAV energy expenditure during the smooth path design. According to Fig. 3, each software module simulation is based on a sequence of multiple stages per module. The following section contains a detailed description of each task on each sub-module.

Fig. 3
figure 3

Development of software modules for the proposed model

4.1 Development of fuzzy path design

The simulation software used for UAV path design is MATLAB 2020b in which the UAV fuzzy route, UAV relaxed path and the air-to-Ground connectivity window of time for the spatially dispersed sensor nodes are defined [4]. The UAV fuzzy path concept is initially implemented in MATLAB to understand and investigate the impact of data-capturing dependent parameters on the proposed model. MATLAB also generates visual outputs that can be fed into SITL Mission Planner in order to validate the proposed paths. The performances including length of the path, mission time, instantaneous velocity and acceleration of the UAV and UAV energy efficiency are assessed in MATLAB. Within MATLAB, the first simulation module (See Fig. 4) is through the spatial distribution of ground sensor nodes considering two given variants: the distribution of gateway capable nodes and their density spread factor. The outputs of this module can be employed for ground network communication analysis in Contiki-Cooja as the locations of dispersed sensor nodes are transferred one by one from this module of MATLAB to the Cooja network simulator. Then, within the second component of testbed simulation in MATLAB, the UAV fuzzy route and UAV flight relaxed path are designed. Following that, the communication window of connectivity enabling interaction among the UAV and the elected gateways is sketched as part of the third process. The outputs of these two modules (UAV smooth path design and communication window of connectivity design) can support the air-to-Ground communication simulation in CupCarbon. The UAV smooth path design can be validated in Mission Planner based on real world scenario visualization. Finally, the UAV performance evaluation mainly on the UAV energy expenditure, length of the path and velocity of UAV for the proposed smooth path is worked out in [4].

Fig. 4
figure 4

UAV fuzzy range and smooth flight path design on MATLAB

According to Fig. 4, various scenarios of SNs deployment are simulated in MATLAB based on given densities and distributions of sensor nodes and then fuzzy route is aligned based on the predefined locations of gateway-capable and router nodes. As the proposed window of connectivity is expressed on [4], the connectivity window of time is plotted over the UAV relaxed path within the fuzzy route (pink circle). The fuzzy route is identified (the hatched region in Fig. 4) accounting for the average percentage of Gateway-capable nodes distribution and spread factor equal to 20% and between (700 and 850), respectively. The optimal path is also represented in this figure as the pink UAV flying route within the fuzzy hatched range. The connectivity window is identified as the time once the UAV is within the entry and departed points calculated based on a range of UAV’s speeds [4]. Herein, with raising the average UAV’s speed, the average connectivity time is dropped which results in network performance degradation.

4.2 Ground network simulation based on SDWSN strategy

As discussed in the previous section, the network communication model in SDWSN is divided into three main phases: topological scanning pre-orchestration phase via control information messages, orchestration phase via notification messages and data gathering post-orchestration phase via sensing data information messages. To begin with, a test is performed for a network with multiple functionalities (Leaf, router, and gateway) in which the topological structure mode can be dynamically re-configured based on single hop, multi-hop network structures. The ground network is generated in Contiki-Cooja shown in Fig. 5 with all gateway-capable nodes involved in data gathering model (This is represented as the time preceding the network topological orchestration). In this network structure, the ground network consists of star network arrangements prior to orchestration phase. The UAV path design in this phase is obtained from solving an optimization problem for this specified network formation. Following the orchestration phase and passing the control data to the drone, the most appropriate gateways for each group are elected based on fitness model computation and various diverse network architectures such as one/multi-hop data transmission groups are formed (See Fig. 4). This phase can be represented as the data collection phase. The sensing data upstream flow takes place during this phase and the UAV traverses over each elected gateway to gather the accumulated data. Herein, the UAV path in this phase is considered as the proposed optimal paths from solving optimisation problem.

Fig. 5
figure 5

The distribution of network components within the UAV scanning pre- orchestration phase

The simulation goal is to evaluate the residual energy, packet delivery and communication latency performances either during scanning pre-orchestration phase or data gathering post-orchestration phase. A testbed is designed for ground network for various density spread factors \({\sigma }_{gc}\) with expanding the transmission message rate from 1 message per second to \(100\) messages per second. The ground network transmission ranges for all ground network components are set to \(50\) meters. The simulation time is set to \(60\,\mathrm{ s}\) for data transferring and the designed packets frames for the scanning and data gathering phases are presumed based on the packet frame designs suggested in [5]. The simulation parameters are shown in Table 3.

Table 3 Model simulation parameters

The ground network is structured in Contiki-Cooja considering various network formation scenarios depending on the election of gateway nodes out of the predefined gateway-capable nodes process. Herein, as shown in Figs. 5 and 6, two various network formations for pre-orchestration and post-orchestration ground network topologies are assumed to observe the impact of network orchestration on the shape of the UAV path, ground SNs’ energy consumption, communication latency and the percentage of served SNs on the ground. Both architecture designs have two communication transaction message phases within them, which are the data flow orchestration/re-orchestration notification phase and the scanning or data gathering phase. During the data flow orchestration/re-orchestration notification phase, as discussed in our previous work [5], the updated functionality of each node emerging from fitness model decisions are returned to the elected routers and gateways as well as their specified leaf-nodes via the notification messages to orchestrate/re-orchestrate the ground network. In the scanning phase data flow, the packet frames are relayed to the potential gateways and then uploaded to the UAV to provide inputs for fitness model in order to re-define the functionality of the potential nodes, whereas, in the data gathering phase, the sensing packet frames are uploaded to the UAV.

Fig. 6
figure 6

The distribution of network components in Contiki-Cooja network simulator for post-orchestration data gathering phase

In the scanning pre-orchestration process, as shown in Fig. 5, all gateway-capable nodes are involved in data gathering model with the gateway election factor of \(\xi\) =1 which creates the star network structure. Figure 7 upper plot depicts the data flow among the ground network components for a sample network group within this architecture. Whereas based on Fig. 6, only a percentage of gateway-capable nodes are elected as gateways and involved in data gathering model with \(\xi =2/3\); hence, the multi hop based communication is generated to transfer the data from leaf nodes to the elected gateways. The data flow amongst the ground network components for a sample network group in this network architecture is represented in Fig. 7 lower figure. The UAV path designs for both scanning pre-orchestration and post-orchestration phases are drawn based on optimal paths enabling traveling over elected gateways. For each network structure, an optimal relaxed path is obtained based on the proposed cost function for the UAV to pass over the elected gateways to gather the data. Simulation outcomes including the values of received packets per gateway, the communication latency and ground energy consumption are recorded in Contiki-Cooja for each scenario. The ground network energy consumption model, as discussed in previous section, is based on the definition of each SN's cycling time for each state, including TX, RX, Idle, and Low Power. In an attempt to study the current consumption of the Cooja motes, the current profiles of two hops communication among the leaf nodes, routers and gateways are represented in Fig. 8 and 9. The time of active TX, RX, Idle and Low Power states are obtained per cycling time based on the energytrace tool in Cooja network simulator. Also, the values of current consumption per each idle, active, and low power modes are explored from the datasheet of Texas Instrument CC2538 and presumed based on the Table 1. The amount of voltage is considered as \(V=3\,\mathrm{ v}\) for the entire experiment. Figure 8 shows the current profiles for the Leaf and router-L1 nodes taken over \(1\,\mathrm{ s}\). From the plot, it is easy to identify the packet interval of \(1\,\mathrm{ s}\) and to check that the device enters Power-mode in-between packets. First, the leaf node is on low power mode during the specified time cycle, then it changes its mode from low power mode to idle and later to transmission mode in order to initiate transmission (see Fig. 8a). Then, once the whole packet is disseminated during the dissemination time, the module returns to low power mode to save power. Note that the duration in which the leaf node is in dissemination period is highly dependent on the size of designed packets, which equals 830 μs. Figure 8 b has also represented the value of current profile for the router-L1 once it allocates \(16320\) μs of its cycling time for receiving and 4530 μs for dissemination active modes respectively. There is a meaningful time in between receiving and transmitting modes for the sake of switching the transceiver from receiving mode to transmitting one. Note that the receiving time for router L-1 is higher than transmission time based on Cooja simulator due to the responsibility of receiving and relaying the data of several leaf nodes to the router-L2 at the same time.

Fig. 7
figure 7

Data flow amongst the ground network components for scanning pre-orchestration phase (upper figure) and subsequent post-orchestration data gathering phases (lower figure)

Fig. 8
figure 8

Current Consumptions for packet dissemination of each Leaf Node (a) and packet dissemination and receiving of each Router-L1 Node (b) per time cycle

Fig. 9
figure 9

Current Consumption for Packet transmission and receiving of router-L2 node (a) and packet receiving of gateway (b) per time cycle

Figure 9a has also highlighted the current profile for the router-L2 taken over \(1\,\mathrm{ s}\), once it allocates \(5360\) μs of cycling time for receiving and 13,840 μs for dissemination active modes respectively. The dissemination state time in router-L2 is longer than in router-L1 due to additional leaf node connection to the router-L2 in addition to other data relayed to router-L2 to be transferred to the coordinator. Finally, the current profile for the gateway node has been outlined in Fig. 9b, in which the receiver mode is active for 13,840 μs during each cycling time.

Note that the aforementioned outcomes are part of an experiment to measure current profile for a specified two-hop network using the Contiki-Cooja simulator and CC2538 modules. The same experiment is carried out to examine the current consumption for alternative network structures such as star, single-hop network etc. The aggregated power usage is measured for a network of multiple diverse structures based on various distribution of network components such as those in Fig. 6.

The simulation model is defined and analysed based on the obtained optimal UAV path and updated network architecture following the network orchestration phase in Fig. 6, and the simulation outcomes are provided in Figs. 10 and 11.

Fig. 10
figure 10

Packet received in Gateways from Leaf nodes in Ground network communication via Contiki-Cooja network simulator

Fig. 11
figure 11

Energy consumption of ground network in terms of message rate and gateway nodes’ spread factor via Contiki-Cooja network simulator

The simulation time is set to \(60\,\mathrm{ s}\) in Contiki-Cooja, since the average window of connectivity among the UAV and gateways in the air-to-Ground communication is \(60\,\mathrm{ s}\) based on the defined velocity of UAV, and the UAV-Gateways window of communication is presumed to be \(60\,\mathrm{ s}\) for all gateways. Hence, the simulation time for each group is considered \(60\,\mathrm{ s}\) in Contiki-Cooja, which is equivalent to the same period once the UAV is within the communication window of time of a specified gateway. Herein, the ground network communication performances such as accumulated received packets in gateways and the energy consumption of the entire network based on a range of various network sparsity \({\sigma }_{gc}\) and communication message rates are calculated and shown in Figs. 10 and 11. As illustrated in these two figures, whenever network density increases, the ground network packet delivery and energy cost for message transmission from leaf to gateway are degraded due to effect of interference from other group members. Furthermore, it is obvious from these figures that as the message rate increases, the number of received packets in the gateways’ buffers decreases and the energy consumption of ground network increases. The reason for this is that as the message rate increases, so does the cycling time for the ground network components, causing the ground network components to consume more energy whereas delivering fewer packets to the gateways.

4.3 Air-to-ground communication simulation based on SDWSN strategy

CupCarbon network simulator is used for the air-to-Ground communication between elected Gateways and the UAV for the proposed SDWSN communication model. Numerous air-to-Ground data gathering scenarios can be developed in CupCarbon to assess the network performance of SDWSN communication model. The testbed design is based on defining multiple rounds for the UAV-Ground communication phases including scanning pre-orchestration or data gathering post-orchestration phases. Figures 12 and 13 depict these two simulation phases based on the distribution of selected gateways in CupCarbon.

Fig. 12
figure 12

The air-to-Ground Communication among the elected gateways and UAV for scanning pre-orchestration phase in CupCarbon

Fig. 13
figure 13

The air-to-Ground communication simulation for post-orchestration data gathering phase on CupCarbon

In both scenarios, all parameters are assumed to be fixed. The location of gateway nodes in CupCarbon is assumed to be the same as the testbed in the Contiki-Cooja ground network model, facilitating air-to-Ground communication with the drone. Also, the size of data buffered in each elected gateway is determined by the computed communication overhead per gateway in Contiki-Cooja. UAV velocity, length and shape of the path are based on the optimized path designs within the fuzzy route. The air-to-Ground transmission range, as shown in Table 3, is considered up to \(550\,\mathrm{ m}\) in CupCarbon, once the average RSSI is below \(-\hspace{0.17em}80\,\mathrm{ dBm}\). The reason for this is that the communication rate for this transmission range is usually fair [50].

The air-to-Ground connectivity is tested taking the movement of the UAV along the smooth and optimal paths over the defined communication window of time for each elected gateway into account. The UAV has the responsibility to pick the accumulated data from each gateway whereas passing over the communication range of each gateway. The path length equals with the length required by the UAV to pass through all gateways.

The simulation model is defined and analyzed based on the obtained optimal UAV path and updated network architecture for post-orchestration data gathering phase with the same fixed network parameters such as the gateway election factor of \(\xi =2/3\) and the distribution of gateway-capable nodes of \(D=20\mathrm{\%}\) in order to observe the impact of varying the density spread factor parameter on the network performance. The simulation outcomes are provided in Figs. 14, 15 and 16. The performances metrics including the percentage of overall packet delivery from leaf to the UAV, the energy consumption of UAV receiver, and the overall network cost for message transmission from leaf to the UAV are calculated in this section.

Fig. 14
figure 14

The overall packet delivery from leaf to the UAV based on message rate & gateway nodes’ spread factor

Fig. 15
figure 15

The energy consumption of UAV receiver in terms of message rate and gateway nodes’ density based on CupCarbon network simulator

Fig. 16
figure 16

The overall network cost for message transmission from leaf to the UAV based on message rate & gateway nodes’ density achieved from CupCarbon and Contiki-Cooja

Herein, the percentage of overall packets uploaded to the UAV buffer based on various communication message rates and network densities is represented in Fig. 14. As shown in this figure, as the message rate increases from 1 to 5 \({\text{msg}}/{\text{sec}},\) the packet delivery rate on the UAV buffer decreases slightly, whereas once the message rate reaches in between 5 and 10 \({\text{msg}}/{\text{sec}}\), the percentage of received packets on the UAV buffer stabilizes around a fixed value for a specific network density. The reason for this is that at these message rates, the UAV is capable to gather the higher amount of data stored in the gateways’ buffer during each gateway visit at its communication window of time, whereas with increasing the transferring message ratio from 20 \({\text{msg}}/{\text{sec}}\), the ground network performance degrades moderately resulting in a decrease in the overall packet delivery to the UAV. In other words, once the message rate is bounded to lower values, the ground network outperforms the air-to-Ground one in terms of the percentage of uploaded packets via gateways and the UAV, since the air-to-Ground communication has a lower packet delivery rate due to the mobility of the UAV.

With increasing the message rate, the situation is reversed, the percentage of forwarded packets from gateways to the UAV rises whereas the ground network performance gets degraded. Hence, one solution to improve the end-to-end packet delivery performance is to adjust the speed of the drone considering the message rate, whereas the reason why the packet delivery is not raising to the values greater than 62% in this case is highly dependent on this issue. For velocities lower than \(20\,\mathrm{ m}/{\text{s}}\), the UAV is capable to receive the entire buffered data that disseminated by the gateways. Furthermore, as depicted in this figure, whenever network density increases, the ground network packet delivery for the end-to-end message transmission from leaf to the UAV degrades due to effect of interference from other gateways on the UAV receiver.

Other energy-dependent performances including the amount of energy consumed by the UAV receiver and the overall energy consumption for message transmission from the leaf to the UAV are depicted in Figs. 15 and 16. As shown in these two figures, as network density and message rate increase, the UAV energy cost of receiving data packets from elected gateways and consequently the overall network cost of message delivery from leaf to drone increases.

Also, the packet delivery for Ground network (from leaf nodes to gateways), the air-to-Ground network (from gateways to the UAV) and end-to-end network for two different phases (scanning pre-orchestration phase and data gathering post-orchestration phase) based on various network densities (from dense to sparse network) is represented in Fig. 17. Note that for both scanning pre-orchestration and data gathering post-orchestration phases the optimal paths have been obtained. As shown in this figure, the packet delivery for scanning phase (either through ground, air-to-Ground and end-to-end communication) is higher than data gathering phase for various network densities. Moreover, the gateway election factor is set to \(\xi =1\) for scanning phase implying that all gateway-capable nodes contribute to passing the control data to the UAV, whereas the gateway election factor of the data gathering phase is elected as \(\xi =2/3\), meaning that only a portion of gateway-capable nodes contribute to the data gathering process. As a result, packet delivery rate for scanning outperforms data gathering phase.

Fig. 17
figure 17

The packet delivery for Ground network (from leaf nodes to gateways), the air-to-Ground network (from gateways to the UAV) and end-to-end network for two different phases

Finally, the energy consumption for Ground network, the air-to-Ground network and end-to-end network for both the scanning phase prior to network orchestration and the data gathering phase following network orchestration based on various network densities are represented in Fig. 18. It is obvious from this figure that data gathering phase consumes more energy than the scanning phase. Also, during both phases of network scanning and data gathering, the ground network consumes higher energy than the air-to-Ground network communication. One reason for this is that the number of network entities involved in the communication process in the ground network is higher than in the air-to-Ground one. Finally, by looking into the Figs. 17 and 18 at the same time, there is a meaningful energy gap between the overall energy consumption for data gathering and the network scanning phases, and the same gap is noticeable in overall packet delivery rate performance.

Fig. 18
figure 18

The energy consumption for Ground network (from leaf nodes to gateways), the air-to-Ground network (from gateways to the UAV) and end-to-end network for two different phases

The communication latency associated with the phases of pre-orchestration and post-orchestration based on various network densities is represented in Fig. 19. Herein, the output of Contiki Cooja scenarios represented by the time stamps is supported by the proposed latency analytical model wherein the pre-orchestration phase experiences less communication latency due to the packet structure design [5] as well as the type of topology. In summary, the orchestration process through configuring the network roles is an efficient way to improve the network functionality as this process costs less with lower energy consumption and communication latency and at the same time higher packet delivery rates.

Fig. 19
figure 19

The communication latency for message transmission from leaf to the cloud via the UAV based on various network densities

To compare the suggested method with the method in [51], the proposed SDWSN network communication method shows better performance in terms of the rate of successful served sensor nodes following the configurability process. This comparison is based on various network scalability metric in which the proposed SDWSN network communication is compared to successive convex approximation (SCA) method in [51].

The network parameters are set to \(D=20\%\) for the distribution of gateway-capable nodes, \(\xi =2/3\) for the gateway election factor of the data gathering phase following the configurability process, and \({\sigma }_{gc}=350\) for the density spread factor which is in between the dense and sparse networks. According to Fig. 20, with rising the number of dispersed nodes in the field, the number of served sensor nodes in the proposed method gains a larger gap from SCA algorithm. In addition, the complexity of the proposed communication network is exceedingly lower than the SCA algorithm [51] that utilizes complex non-convex/convex optimization algorithms to solve the connection-based UAV trajectory planning problems.

Fig. 20
figure 20

The comparison between the proposed SDWSN data gathering method and SCA algorithm [51] on the percentage of served sensor nodes versus scalability

4.4 Overall modelling discussion

Following the testing of the proposed SDWSN data gathering model in multiple scenarios using the suggested simulation tools, the output performance of the simulation tools, including served sensor nodes, ground network energy consumption, air-to-Ground packet delivery, average UAV energy consumption for scanning pre-orchestration and post-orchestration data gathering phases, and communication latency are recorded to evaluate the proposed model.

There is a trade-off between UAV propulsion energy consumption and ground network energy cost, as shown in Fig. 21. Whereas post-orchestration process design can offer a cost-efficient path for the UAV and serve a higher percentage of ground sensor nodes for data gathering purposes, it suggests an inefficient model for ground sensor nodes, as expressed in Fig. 6, due to multi-hop communication protocols in the ground network structure. In contrast, whereas the pre-orchestration process design consumes a higher amount of UAV battery per mission with lower percentage of served sensor nodes, it offers network orchestration/re-orchestration functionality to the ground network with lower amount of ground energy usage. To justify the existence of multiple gateway-capable nodes in the ground network, whereas deploying multiple gateway-capable nodes may deplete the sensor batteries and reduce the survivability of the ground network, this does not imply that a high percentage of node population should act as gateways at the same time. Based on the proposed model, the distribution of the gateway-capable nodes is bounded to 30% out of the entire network. Moreover, during the softwarization phase, the most effective gateway-capable nodes are elected as gateways which shows that the remaining gateways that are not nominated as gateways could be dropped to lower functionalities (such as leaf nodes) with lower energy expenditure.

Fig. 21
figure 21

The outcomes of multiple scenarios of data gathering model outputted from Cooja, CupCarbon and Mission Planner

The simulation outcomes of both scanning pre-orchestration and post-orchestration data gathering phases mentioned above revealed that orchestration plays an important role in serving more SNs on the ground with higher air-to-Ground packet delivery rates and improving UAV energy efficiency when compared to the situation prior to orchestration.

5 Conclusion and future work

This paper provided the motivational background behind the concept of UAV-based WSN data gathering and UAV’s feasibility to dynamically react to updated ground network. The SDWSN-enabled ground network communication was split into three main phases: the scanning topological pre-orchestration, the orchestration notification phase and sensing data collection post-orchestration phase. During the scanning and notification phases, control information messages were transferred, whereas during the data collection phase, the sensing data information was transferred to the cloud server. As the primary goal of data collection effort is on passing the sensing data information messages, the control information messages have the responsibility to pass the ground network topological orchestration data such as election data from the cloud-level to the ground network and assign the optimal functionalities to each component of the network prior to data gathering. Furthermore, the proposed model offers a flexible span for optimal UAV design paths dependent on the ground network structure.

Employing an efficient orchestration round to the UAV mission can offer benefits for better organization of the ground network. The simulation outcomes indicated that the added round is an efficient round with less consuming energy and high efficiency in data delivery and communication latency that can offer orchestration/re-orchestration functionality to the ground network. For future work, adding the UAV fixed wing to the scenarios of physical WSN ground network would provide the real time communication. Also, securing the data gathering stage by the UAV could benefit from the development of WSN secured clustering approach for data reliability prior to the stage of data gathering. In addition, using artificial intelligence AI-enabled models to predict the re-orchestration of the ground nodes once one or a group of nodes needs to be replaced due to any faulty situation would be useful to investigate as future work.