Optimizing FANET Lifetime for 5G Softwarized Network Provisioning

Recently, Flying Ad Hoc Networks (FANET) have been proposed to empower 5G networks to support complex missions and provide ubiquitous connectivity to heterogeneous devices. However, it is needed to cope with the limited UAV capabilities (e.g., limited available energy to supply engines and computing elements, limited computing capabilities), as well as with the need to provide network and application services as foreseen in highly dynamic and time varying 5G ecosystems. This paper presents for the first time a comprehensive framework that integrates a FANET with a 5G network, with the aim of providing services that can be even chained with each other. This model is comprehensive in the sense that it takes into account physical constraints of the devices, as well as features and requirements of traffic flows. For this framework, the paper proposes a mathematical optimization model, allowing Virtual Function (VF) placement and chaining, aimed at minimizing energy consumption and service unsatisfaction probabilities of the FANET as a whole without employing heuristics for the solution of the problem. Two placement strategies named MLP and WMP are introduced and compared with the standard placement strategy named NoShP. An extensive numerical analysis shows that MLP and WMP allow us to well catch network dynamics and to reduce the number of virtual functions needed while decreasing the power consumption, so increasing UAV flight time and network lifetime.

coordination, and the increased communication range can be supported using drones' swarms. This makes these networks of paramount importance when ordinary communication infrastructure is not available, for example in case of catastrophic situations [3], [4], [5] or in remote areas not connected with the structured Internet [6], [7]. Indeed a rapidly deployable and highly flexible infrastructure can be set up by means of designing a robust communication architecture and protocol set to follow highly dynamic network variations. The use of multi-UAV systems offers also a great advantage in terms of scalability, as it allows us to cope with the need for providing resources in networks of increasing size [8]. To deal with this call for scalability, in a multi-UAV system some UAVs can also rely on a ground base and/or satellite so leading to a variable topology, not only a star one, but a meshed one. However, the realization of a reliable multi-UAV system implies solving a number of design issues which transversely involve both hardware and software aspects. On the one hand, indeed, devices should be equipped with expensive and complex hardware to communicate among themselves and with a ground base or satellite. On the other hand, concerning software features, critical aspects are related to the capability to support dynamic and time-variant topological and environmental conditions associated to the high speed of devices, node movements and terrain structures. In addition, it should be considered that UAVs might not keep their communications links always on because they are battery-powered, and network lifetime should be increased as much as possible.
At the same time, the new generation of communication networks (5G), by employing various changes in network architecture and new technologies, is emerging to enable key performance indicators (KPI) in terms of high capacity, enhanced data rate, very low latency, and flexible and scalable networking to allow users to receive an acceptable level of Quality of Experience (QoE) for new vertical applications [9], [10].
FANETs are considered as a valid tool to empower the 5G network architecture [11], [12], [13] because, in spite of the structural limited capabilities of the devices (e.g., limited available energy to supply engines and computing elements and limited computing capabilities), employment of multiple small UAVs can allow accomplishing complex mission tasks. In particular, in the perspective of a 5G infrastructure, UAVs can provide ubiquitous connectivity and computation for different device types also located remotely, for example in rural areas, in the framework of agricultural applications [7]. Specifically, integration of UAVs into a macro-cell network is This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ drawing novel interest in the view of supplementing terrestrial cellular networks. In integrating FANETs into the 5G architecture, the limited capabilities of the hardware/software UAV resources should be exploited in the best way, while coping simultaneously with management and coordination aspects and supporting services to 5G users.
In this paper, we present a comprehensive resource management framework for placement of service chains. It is based on a mathematical optimization model that allows us to represent a complex dynamic and totally distributed scenario, where FANETs are integrated into the 5G ecosystem with the aim of providing services in terms of virtual network and application functions, in the sequel referred to as Virtual Functions (VF), running inside the FANET UAVs and organized as service chains. In doing this, we take into account not only the service requirements, but also the hardware device limitations in terms of scarceness of energy to supply UAV engines and computing elements. Regarding this second term, we highlight the consumption due to keep active the computing element, if needed, the consumption to keep alive VFs running to support even a single flow, and the additional amount of energy consumed to support other flows that can share the same function. Thus, the main contributions in this paper are the following: • Present a system architecture based on the use of FANETs to provide remote areas with a 5G softwarized network where running service chains of VFs with strict requirements in terms of maximum tolerated delays. • Propose a mathematical optimization model, allowing VF placement and chaining, aimed at minimizing the energy consumption and the no-service and partial-service probabilities of the FANET as a whole, without employing heuristics for the solution of the problem. The proposed model takes into account the processing capabilities available on board each UAV, and the transmission rate of the communications links between UAVs. • Introduce two VF placement strategies, named MemoryLess Placement (MLP) and With-Memory Placement (WMP), the former aimed at saving more energy, the latter at minimizing flow re-routing after each FANET modification event. • Propose an extensive numerical analysis to compare MLP and WMP with a standard strategy, referred to as No-Share Placement (NoShP), which does not share VFs among different flows and does not take into account the packet-rate and bit-rate input/output modifications caused by each VF. The rest of this paper is organized as follows. In Section II we discuss some related work in the field. In Section III we describe the system and in Section IV we model it. In Section V the problem is formulated. Then, in Section VI we present a numerical analysis also comparing the performance of our solution with a standard approach. Finally, in Section VII conclusions and some considerations on the future work are presented.
Depending on the specific application scenario, various communication architectures can be considered. Indeed, due to the rapid variations in network topology and the corresponding associated routing protocol issues coming from this dynamicity, network updates should be sophisticated enough to cope with this flexibility. Also the use of a peer-to-peer network topology is needed to support collaborative coordination among peers, so as to provide services and functions to be delivered to on-demand users and devices on the ground. This way, FANETs can be seen as providers of services and/or slices for 5G networks. In [2], authors Khan et al. illustrate different UAV architectures, each one characterized by different peculiarities in terms of tradeoff between simplicity, vulnerability, maximum network size to be supported, and robustness.
When a FANET is employed for collaborative purposes, the design objective is to support cooperative communications among multi-UAVs. Due to the devices' mobility in time, collaborative scheduling calls also for an efficient setup of routing protocols (e.g., static, proactive, reactive, hybrid, geographic/position-based or hierarchical routing protocols), as addressed for example in [2], [14]. Similarly, in [27], due to network variations and local topology changes during UAVs' aerial fleet flight, the focus of Han et al. is put specifically on solving the problem of multipath routing transmission in terms of multipath establishment and maintenance. Also in [28], Rosati et al. deal with the issue of maintaining communication links between the UAVs by also providing a comparison between two different routing algorithms for ad-hoc networks, such as the optimized link-state routing (OLSR) and the predictive OLSR (P-OLSR), which exploit GPS information available at drones. Authors Zheng et al. in [29] move in the direction of considering simultaneously routing and medium access control issues to improve the communication performance of FANETs.
The problem of employing UAVs for expanding and complementing existing cellular infrastructures according to a 5G perspective was considered in [30], [31], [32], [33], [34], [35], [36]. However, in [33] Mozaffari et al. use UAVs as flying base stations to provide a wireless backbone and give coverage to a remote area. The perspective is only mathematical, in the view of providing a tractable analytical framework for the coverage and rate analysis. Also in [30], [31], [32], the main focus was on optimizing connectivity, and solving coexistence issues in case of underlying Device-to-Device (D2D) communication links, while also compensating cell overload and outage in cellular networks. A slightly different perspective is considered by Mozaffari et al. in [37] where the UAVs are considered as aerial base stations to collect data from the terrestrial Internet of Things (IoT) or to provide connectivity to IoT devices, for example in power plants, as proposed by Faraci et al. in [38]. In [37] the authors Mozaffari et al. specifically present a framework for joint optimization of UAVs positioning in a 3D scenario and to perform controlled device-UAV association, as well as power control in uplink to minimize the total power consumption. In [41] the authors Mohamed et al. propose the idea of implementing a UAVFog for rapid replacement of connection between the IoT network and the previously available fog platforms, while taking into account provision of different low-latency services to support IoT applications at certain areas.
In [39] authors present a framework for managing and orchestrating UAVs' services in MEC NFV environments. The framework is aimed at joining MEC-NFV management and UAV Traffic Management. The proposed system is modeled using an Integer Linear Programming (ILP) approach to minimize deployment costs while satisfying QoS requirements. Similarly, in [40] the problem of supporting low latency service deployment over a network with dynamic topologies complemented by means of mobile nodes (e.g., robots, drones) is discussed. The VNF placement problem is presented and dealt with as a cost-minimizing problem. In addition, a heuristic is proposed to solve the problem. Also a heuristic is proposed to solve the problem. However, only recently few papers have appeared that address the problem of processing complex computational tasks with the help of drones to assist specific missions. In this case some complex tasks, for example, cannot be offloaded to the edge and cloud infrastructure. This could happen because some missions can be executed in remote areas where there is lack of reliable access to the edge or cloud resources, while requiring processing of some tasks with urgency.
In this view, it has been recently proposed to exploit light-weight drone facilities, by providing virtualized computing capabilities made available by single-board computers as proposed by Alharthi et al. in [42] and Faraci et al. in [6]. Similarly, this was also discussed by Rametta and Schembra in [43] for supporting video monitoring applications in wide rural areas, not covered by Internet access.
According to a NFV perspective, a flexible and dynamic connectivity backbone can be provided by a set of drones. The main issue is, thus, associated to the realization of appropriate service chains which allow execution of complex network and application functions, by exploiting a combination of simpler virtual functions; in this way the Orchestrator has to decide the backbone UAVs where running the virtual functions, and assign the corresponding resources to be allocated. The problem of virtual function allocation and service chaining has been addressed significantly in the context of traditional wired networks. In [44], Yi et al. discuss NFV with a focus on avoiding network ossification and difficulty in network management and service provisioning. Accordingly, by means of NFV, it is possible to decouple network functions from the dedicated hardware and providing improved flexibility in service provisioning. In [44] and references therein, the problem of optimal network function allocation is addressed by way of mathematical frameworks based on ILP or Mixed ILP (MILP) [45], [46] with the aim of minimizing the OPerating EXpense (OPEX) and maximizing network utilization. Also in [46], an ILP problem is formulated and solved by Riggio et al. for optimal VNF placement solution under radio resource constraints. In [47], [48] similar problems are addressed by Luizelli et al. and Gupta et al., but as separate problems with a specific focus either on bandwidth minimization or reduction in end-to-end delay and resource waste.
However, relevant scalability issues arise in these solutions and too long convergence time is experienced in [49] by Pham et al., especially upon scaling to large network size which makes these mechanisms potentially unsuitable to real settings. One of the main common problems is that, in order to solve the mathematical framework, usually heuristic solutions are resorted [45], [46] because of their relevant convenience in terms of execution times, as well as for the good degree of approximation to mathematical solutions. In [50] the two opposite targets of minimizing the maximum network link utilization while considering a reduced number of CPUs for VNF instantiation was addressed by Addis et al. The two problems were considered separately and then prioritized. Other works focused on the joint solution of the problem in the context of both physical and Virtual Network Functions (VNFs), like in [51] by Moens and Turck Other approaches, e.g., [52] by Khebbache et al., used multi-stage graphs but had limitations in the practical solution of the problem to only few VNFs per service chain.
The service-chaining problem has been considered as an NP-hard evolution of the problem of VNF placement. This implies not only deciding where to place appropriate functions into network nodes, but also suitably taking into account physical features of nodes storing these functions and steering traffic through these placed functions.
There are a lot of deterministic and heuristic methods proposed to solve the service-chaining problem. However, due to the increasing size of networks, heuristic methods are so far the most accepted approaches, because they make solution of the service-chaining problem reasonable in scenarios where deterministic solutions are unfeasible [45]. For example, in [49] a heuristic service chaining approach which can be solved within polynomial time is presented by Pham et al. Some of these heuristics however focus on solution of partial problems, such as energy consumption reduction or reliability increase only, e.g., as proposed by Fan et al. in [53].
In [51] a hybrid problem where part of the services may be provided by dedicated physical hardware and another part by exploiting virtualized service instances is presented. This exhibits great advantages in terms of service deployment costs and resource utilization, although tested in small networks. In [54] Eramo et al. and in [55] Scheid et al. proposed other approaches based on network function migration and automated service chaining construction.
However, none of the above solutions deals with the joint problem of providing an exact and solvable mathematical framework for network function provisioning and service chaining, while taking into account both the physical features of the UAVs like residual energy, weight, CPU and memory, storage features, or the possibility to have constraints in the framework in terms of delay on chains, as well as requirements in terms of energy consumption reduction, load balancing, packet loss probability minimization and failure probability reduction in service-chains placement.
The framework proposed in this paper is able to provide both a mathematical, completely-deterministic and flexible solution, without using any heuristic. It can be implemented in real scenarios where UAVs need to leave the network for recharging purposes but service provisioning should be still guaranteed. In Table I we report a summary of what has been discussed in this section.

III. SYSTEM DESCRIPTION
Let us consider a fleet of UAVs organized as a FANET (see Fig. 1). This fleet provides a 5G softwarized network on demand to users and devices on the ground in a remote geographic area (see [56]). In the following, for the sake of simplicity, we will assume that all the UAVs are in each other coverage range, that is, each UAV is reachable from any other UAV of the FANET through a single-hop communication. However, extension to the more general case of multi-hop communication between UAVs in the same FANET is straightforward.
The wireless channel between each 2-uple of UAVs s and s is characterized by its transmission rate,T ss , that depends on many external factors, as the encoding technique, the bandwidth allocated to the channel, the distance between the UAVs, the transmit power, the average power of the channel noise, and the mutual interference, according to a specific channel model whose definition is out of the scope of this paper. An interested reader can find details regarding models of UAV wireless channels in [57], [58].
Each UAV of the FANET, as depicted in Fig. 2, is equipped with a Computing Element (CE) that is able to work as a NFV Infrastructure Point-of-Presence (NFVI-PoP), where not only network functions, but also application functions, can be run as Virtualized Functions (VF). VFs are used as building blocks of Service Chains (SC) to realize Network Services (NS) and Application Services (AS). For this reason, each CE has to be deployed with a resource virtualization environment (e.g., a hypervisor to run virtual machines or a docker/container engine to run Linux containers or dockers), and an SDN switch (e.g., an open virtual switch) to chain local VFs with each other and with VFs running on other UAVs.
Placement of VFs and their chaining must be done taking into account the service requirements the network has to guarantee to its users, and some constraints imposed by the FANET infrastructure, in terms of CE computing power and transmission rate of wireless links among UAVs. As shown in Fig. 2, the battery installed on board the UAV is used to supply the UAV engines, the CE and the Transmitter/Receiver (TX/RX) module. Given the computing features of the CE, we cannot neglect the amount of energy it consumes, which is comparable with the one consumed by the engines [6], [7], [59]. Therefore, the presence of a switched-on CE installed on board the UAV and the execution of some VFs have a cost in terms of battery power consumption because this causes a reduction in the flight duration. Specifically, when the battery charge of a UAV is below a given threshold, the UAV has to temporarily leave the FANET to go to the nearest Charging Station. During this period, this UAV is unavailable, and the FANET has to be reconfigured placing the VFs that were running in that UAV in the remaining UAVs. As a consequence of it, we have an increase in the power consumption of the remaining active UAVs, and therefore a reduction in their flight duration, and a decrease of performance provided to the user flows. In some cases, it could happen that, if the number of flying UAVs is not sufficient, the FANET is not even able to provide users with all the required service chains.
For this reason, maximizing the UAV flight duration is a crucial feature in service provisioning. This is done minimizing both energy consumption of UAVs when they are working in the FANET and their outage service period for recharging.
In order to minimize the duration of this last period, we consider that enough backup batteries are available at the Charging Station, and a sufficient number of electrical plugs are installed there. This way, upon landing, the UAVs always find an available battery to substitute the discharged one to takeoff immediately in order to reach again the FANET. So, their outage service period consists only in the time to reach the Charging Station, substitute the battery (assuming that there is an automatic system requiring no human intervention [60]), and the time to join again the FANET.
On the other side, minimizing energy consumption during service provision is a crucial issue to maximize FANET performance. Optimization of this task is the main goal of this paper. It is entrusted to a central entity called FANET Orchestrator that runs in one of the UAVs belonging to the FANET, playing the role of FANET Coordinator. At the FANET set up or after each critical event (e.g., when the FANET Coordinator leaves the FANET to go to the Charging Station), this role is transferred to another UAV. Policy definition for assignment of this role is out of the scope of this paper.
The FANET Orchestrator function is run in the Management VF together with the local SDN Switches and an SDN Controller, the latter with the role of controlling the SDN Switch of all the FANET UAVs. Note that the Management VF is always running in each flying UAV to mantain the SDN Switch active. In addition, in the FANET Coordinator, the same VF assumes the roles of FANET Orchestrator and SDN Controller. This VF is switched off only when the UAV leaves the FANET to reach the Charging Station.
We can assume that execution of the FANET Orchestrator function does not influence power consumption of the Management VF because this function is run on a larger time scale (dozen of minutes) than the time scale of network packet management. Moreover, consider that, although each optimization run does not require too much time to be executed, it is possible to run it offline on an external data center and save results in a table to be retrieved instantaneously when needed by UAVs. The same holds for the SDN Controller, whose action is required only during FANET placement reconfiguration. For this reason, in the estimation of the energy consumption of the Management VF, we will neglect the contribution of the two above functions, and only consider the local SDN Switch, which is present in all the active UAVs in the FANET.
The VF placement and chaining strategy will be applied each time the FANET conditions change. This occurs for one of the following reasons: 1) the FANET topology is changed because of unavailability of one or more UAVs, or in case a new UAV enters the FANET after battery replacement; 2) the input traffic has considerably changed; 3) new service chains are requested to the FANET, either using the same VFs, or requiring the activation of some new VFs. Therefore, in the following, we will focus on the procedure run at the beginning of a time period immediately after a change in FANET conditions. In this period, the FANET is required to provide a given number of services (either NSs or ASs), each implemented as a chain of VFs.
Let each SC be composed of an arbitrary ordered sequence of VFs. Fig. 3 shows an example of SCs; the same example will be considered in the use case presented in Section VI. We will represent the aggregation of flows requiring the same SC as a single flow. It is the superposition of many flows generated by different devices and having different destinations, but all requiring the same SC. As shown in Fig. 3, each VF can belong to more than one SC (e.g., the VF 1 belongs to the first and the third service chains). This way, each VF instance is used by one or shared by more flows. Each flow is characterized by its mean bit rate and its mean packet rate, respectively indicated as λ Fig. 3. As compared to other papers proposed in the literature, in this paper we consider the more general case where, as shown in Fig. 3, VFs can modify flow rates because of their specific peculiarities; accordingly, we assume that the output packet rate and/or the output bit rate can be different from the input ones. For example, a Firewall, which can discard packets according to the implemented rules, modifies the packet rate by decreasing it, or an Encrypter can maintain the packet rate constant, but increases the bit rate by introducing some redundancy.
The CE of each UAV is shared by all the VF instances that run on it. We will assume that sharing is obtained by fairly dividing the whole computing power of the CPU of a CE in a number of slices equal to the number of running VF instances. No priority among slices is considered in this paper, but extension to introduce some prioritization is trivial. To achieve isolation among different instances running on the same CE, as shown in Fig. 4, one first-in-first-out (FIFO) queue is associated with each VF instance to enqueue packets that cannot be served immediately when they arrive to the CE. Specifically, Fig. 4 represents the case of three VFs running in the same UAV, sharing the CPU capacityC s .
In the following sections, we will model the FANET described so far in order to decide the optimum placement that minimizes an objective function weighing the overall power consumption of the FANET and a cost contribution capturing situations when the FANET is not able to provide the required services. Besides, in order to consider a set of constraints accounting for the physical limitations of the FANET components (e.g., the CPU computation power of the CE installed on board each UAV and the maximum transmission capacity of the wireless links connecting UAVs), we will add a Quality of Service (QoS) constraint regarding the maximum end-to-end delay for each service chain.
Two placement strategies will be considered in our framework: MemoryLess Placement (MLP) and With-Memory Placement (WMP). They are run by the FANET Coordinator at each FANET modification event, i.e., when a UAV leaves the FANET to change its battery, or when a UAV comes back to the FANET after battery replacement.
The MLP strategy is memoryless because, when placement optimization is run, it does not consider the previous position of VFs on UAVs before the FANET modification event.
The WMP strategy, on the other hand, when placement optimization is run, starts from the placement before the FANET modification event, and decides the new placement optimizing the same objective function used by MLP, but with some additional constraints imposed to maintain as much as possible the previous placement of VFs. More specifically, when a UAV leaves the FANET, optimization is applied to decide placement of the only VFs that were running on that UAV. Instead, when a UAV comes back to the FANET, the WMP strategy calculates the optimal placement of the VFs that were placed on that UAV only, when all the UAVs were available in the FANET.
The above two strategies will be described in details in Algorithms 1 and 2, in Section V-C4. Let us note that, since WMP adds some constraints to the problem formulated for MLP, it obtains a worse objective function, but with the advantage of reducing flow re-routing after each FANET modification event.

IV. SYSTEM MODEL
We model a FANET as a graph G = (V, E), in which: • V is the set of UAVs available in the FANET; let s ∈ V be the generic UAV; • E is the set of point-to-point wireless transmission links connecting UAVs; let l ss ∈ E be the generic link between UAV s and UAVs. Also, we define: • K as the number of SCs to be provided by the FANET; let k be the generic SC; • F as the set of available VFs; let f ∈ F be the generic VF; • f k as the VF f in the service chain k; • L k as the number of VFs that constitute the k-th service chain. In order to capture the behavior of VFs that modify the packet rate and the bit rate of the input flows, we define: k : the input packet rate and the input bit rate of the aggregated flow using the service chain k; if we indicate the mean packet size as Ω, we have: (1) j k : the mean value of the ratio between the output packet rate and the input packet rate of the j-th VF in the SC k. Note that γ (P ) j k can assume any positive value. For example, a Firewall is characterized by γ (P ) j k < 1 because it reduces the packet rate, a Traffic Monitor has γ (P ) j k = 1 because it does neither add nor discard any packet, while a Multicast Packet Replicator is characterized by γ j k : the mean value of the ratio between the output flow bit rate and the input flow bit rate of the j-th VF in the SC k. Note that the values of γ (B ) j k and γ (P ) j k can be different from each other. For example, for a VF that adds some redundancy to each packet, the bit rate is increased whilst the packet rate remains unchanged. 1 The generic flow that enters the SC k with an input bit rate λ (B ) k and an input packet rate λ (P ) k , at the input of the i-th VF of the same chain has a bit rate given by: and a packet rate given by: Our goal is to formulate a problem to decide the VF placement minimizing the total power consumption. In particular, we consider the total power consumption as composed of the following elements: s , the power consumption of the UAV s necessary to supply its engines; this represents the cost of having a UAV available in the FANET, but inactive, i.e., not participating in service provisioning; • p (CE ) s , the power consumption to keep a CE active in the UAV s (without any running VM, and therefore any VF); • p (VM ) fs , the power that the VM hosting the instance of the VF f deployed and running on the UAV s consumes to be active, not considering flow processing; • P (PR) i k s , the power consumed by the i-th VF of the SC k for packet processing; it depends on the energy needed by the same VF to process one packet, e i k s as follows: where λ is the input packet rate of the considered VF; • P (TX ) ss , the power consumed by the UAV s to transmit to the UAVs. In case that s =s, it follows that P we have explicitly expressed the dependence on the position j in the chain k of the referred VF, actually they depend on the kind of VF, whatever its position in the SC. For this reason, in the use case illustrated in Section VI, they will be provided as a function of the VF f, ∀f ∈ F , rather than of its position in a specific chain. The same will be done for the variables P (PR) i k s , representing the power consumed by the i-th VF of the SC k for packet processing, and e (P ) i k s , representing the same VF to process one packet. In Section VI, they will be indicated as P Each queue associated with a VF instance (see Fig. 4) is modeled as a M/M/1 system, which is a single-server queueing system with Poisson-distributed arrivals and exponentiallydistributed packet service times. The mean arrival packet rate to the i-th VF of the SC k running on the UAV s, here indicated as ψ (P ) i k s , is the sum of the packet rate of all the flows using that VF. Since that VF can belong to other SCs besides the k-th one, if we indicate the generic SC using that VF as h and the position of that VF on the SC h as G i k h , the aggregated packet rate entering that VF is: where x (G i k h )s is a Boolean variable indicating whether the VF that is in position G i k h in the chain h is deployed in the UAV s or not. It will be formally defined in Section V-A, specifically in (8).
Let μ i k s be the service rate of that queue, that is, the number of packets that the i-th VF of the chain k is able to process in the time unit in the UAV s. If we indicate the number of elementary operations required to process one packet by this VF instance as σ i k s , the number of VF instances running in the same UAV s as N (VF ) s , and the whole CPU computation capacity of the same UAV (i.e., the number of elementary operations that the CE CPU is able to compute in the time unit) asC s , the service rate μ i k s can be calculated as follows: According to the M/M/1 queueing theory, the average response time or sojourn time (i.e., total time a packet spends in the M/M/1 queueing system) is: A summary of used notations is presented in Table II.

V. PROBLEM FORMULATION
In this section, we provide a mathematical formulation of the considered system and propose a VF placement and chaining model aimed at minimizing the power consumption of the FANET as a whole. The main notation used in this section is listed in Table III.

A. Variables
Let x i k s and w f k s be two Boolean variables defined as: if the VF f of the service chain k is assigned to the UAV s 0 otherwise (9) It is evident that, if the VFf in the chaink is in positioñ i , the following equality applies: xĩk s = wfk s , ∀s.
• the number of VF instances running on the UAV s: In order to represent if the UAV s is used to provide at least one SC, we define the variable z s as follows: Similarly, we introduce z fs to represent whether the UAV s is used to run the VF f for at least one SC or not: Moreover, we define the variable y k to represent, in the objective function that will be described in (22), which VFs are more convenient to place in case some SCs cannot be accommodated due to insufficient resources (i.e., when too many UAVs have temporarily left the FANET for battery replacement). More specifically, the variable y k is a Boolean variable indicating whether the chain k has been placed in the FANET or not, that is: 1 if the chain k has been placed 0 otherwise.
Finally, it is necessary to introduce an additional variable useful for model resolution: in order to describe the case in which the VF f is shared by at least two SCs on the UAV s , we define the Boolean variable y fs as follows:

B. Objective Function
The objective function allows us to minimize a penalty, due to the overall power consumption, and to maximize a gain, due to the overall packet rate that is served for the flows whose requirements are satisfied. Therefore, the objective function depends on two main terms: the penalty (or power consumption) and the gain (or users' satisfaction). More specifically, in order to maximize the aforementioned gain term, it will be considered with a negative sign in the objective function to minimize.
The first term of the objective function, that is the overall power consumption, is composed by the contribution of the UAVs' engines, the one for maintaining the CE, including the TX/RX Module and the Resource Virtualization Environment in active state, the one to maintain the instances of VF containers (e.g., VMs, Dockers or LXCs) switched on, and the one to transmit data flows on the wireless links. We now present each of these components in detail.
The overall power consumption of the UAVs' engines is equal to the sum of the powers used by the engines of all the UAVs that are active in the FANET, namely: The overall power consumption for maintaining the CE, including the TX/RX Module and the Resource Virtualization Environment in active state is equal to the sum of the powers consumed to keep active the CE of each used UAV: The overall power consumption to maintain the VF containers switched on, not including their load by traffic flows (this will be considered in the next item), is given by the sum of the powers consumed to maintain the VF containers switched on for each running VF in each used UAV (for at least one SC): The overall power consumption to manage traffic can be expressed as the sum of all the powers P (PR) i k s for the packet processing, as defined in (4), consumed by all the VFs of all the SCs that have been allocated to all the UAVs of the FANET. It can be derived as follows: The overall power consumption for transmission on links between UAVs is calculated as the sum of the powers consumed by each UAV s to send bits to the following UAVs: Note that with the expression "the following UAV" we mean the UAV where the VF after the i-th one is placed. Moreover, if s =s, it follows that e (B ) ss = 0. The second term of the objective function is the gain achieved by serving "Satisfied Flows" (SF), i.e., flows whose SC is placed. This gain is proportional to the packet rate of SFs as follows: that is the sum of the input packet rates of the chains that have been placed. The whole objective function, weighing the overall power consumption in the FANET and the gain for satisfied flows, is: where α P and α G are timely-chosen constants to provide more or less importance to the first or the other term.
Finally, the optimization problem is formulated as follows:

C. Constraints
In order to meet our objective, some constraints need to be satisfied. The first set of constraints, described in Section V-C1, are associated to the model variables. Two more constraints are described in Section V-C2, and regard limitations to the underlying FANET infrastructure. The constraint described in Section V-C3 specifies, at the application layer, an upper bound on the end-to-end delay for each chain. Finally, the last four constraints, defined in Section V-C4, are introduced as additional constraints specific for the two proposed placement strategies named WML and WMP.
1) Constraints Associated to the Model Variables: in the event that a UAVs is not available (because it has temporarily left the FANET to replace its battery), the Boolean variable defined by (12), associated to such a UAVs and representing whether it is used for placement or not, must be equal to zero: whereS represents the set of unavailable UAVs. From constraint (24) we also obtain N (VF ) s = 0, that is equivalent to w f ks = 0, ∀k , ∀f k , and x i ks = 0, ∀k , ∀i k , namely, all the variables related to the UAVs are null. Furthermore, let us consider, for any UAV s, for any chain k and for any function f, the Boolean variable z s . It is easy to prove that the definition in (12) is equivalent to the following constraints: Indeed, as stated by (25), if at least one function is assigned to the UAV s, that is, if at least one w f k s equals 1, then z s = 1 as well (the UAV s is used for placement); on the contrary, if no function is assigned to the UAV s, that is, if any w f k s equals 0 (and therefore their sum, N (VF ) s , is zero), then z s = 0, as established by (26).
Likewise, we have two more constraints regarding the Boolean variable z fs representing whether the UAV s is used to run the VF f or not: Constraints (27) and (28) jointly are equivalent to the definition (13) since, if at least a function f is assigned to the UAV s (that is, if at least a w f k s = 1), then z fs = 1 and, on the contrary, if the sum of all w f k s is zero, then z fs = 0.
Another constraint related to the model variables regards the condition that each VF instance belonging to a placed chain (for which y k = 1) is assigned to one UAV, otherwise, if a chain is not placed (y k = 0), none of its VF instances has to be allocated to any UAV: ∀s∈V x i k s = y k ∀k = 1, . . . , K , ∀i k = 1, . . . , L k . (29) In other words, the number of UAVs to which the i-th VF of the SC k must be assigned, is equal to the Boolean variable y k (that is 1 if the SC k has been placed, 0 otherwise).
The last constraint associated to the model variables is referred to the Boolean variable y fs defined in (15), representing whether the VF f is shared by at least two SCs on the UAV s or not. It is easy to prove that the definition (15) is equivalent to the following constraints:  (30), if the function f is not shared on the UAV s (that is N (SC ) fs equals 0 or 1), then y fs = 0; on the contrary, if the number of SCs that share the same VF in the same UAV is grater than or equal to 2, then y fs = 1, as stated by (31).
Note that, if all the functions appear in at most two different SCs, constraint (31) can be replaced by: 2) Constraints Associated to the Infrastructure Limitations: the first constraint regarding the FANET infrastructure limitations imposes that the aggregate bit rate on each output link of a UAV s towards each other UAVs is limited by the link transmission rate,T ss : ≤T ss ∀s, ∀s. (32) Note that, since the x i k s x (i+1) ks product is not null, the above capacity constraint applies only to UAVs s ands that are subsequent for the chain k (the UAV s where the i-th VF is placed and the UAVs where the (i + 1)-th VF is placed). If two UAVs s ands are not directly connected with a single-hop link, we setT ss = 0. However, this case is not considered in this paper.
The second infrastructure-related constraint imposes that the utilization coefficient of all the queues is less than 1, that is: In addition, let us note that constraint (33) guarantees that the overall computation load required by the VF instances placed on the UAV s is not higher than its computation capacity,C s , also representing the maximum flow packet rate that the UAV s can tolerate: 3) Constraints Associated to the Application Layer: the only constraint specified at the application layer imposes that the service response time, defined as the mean end-to-end delay for each chain k, is not higher than a given threshold, D k , representing the maximum tolerable delay for that chain: (35) where d ss is the propagation delay on the link l ss , while r i k s is the average response time of the i-th VF in the chain k, defined as in (7).

4) Constraints for MPL and WMP Strategies:
in Section III, two VNF placement strategies have been introduced to be applied in the proposed framework: the MLP and the WMP. To better understand how these two strategies work and their differences, they are illustrated in Algorithms 1 and 2, respectively, for the FANET modification event that occurs at the generic time t.
More in details, two types of events can occur during a FANET mission: a UAVs leaves the FANET (event E L s ) or a UAVs returns active in the FANET (event E R s ). This information (i.e., the UAVs that causes the event and the type of event) represents the Input of Algorithm 1. Depending of the type of event (line 1), if the event E L s occurs, the index s belongs to the setS of the unavailable UAVs (lines 2-3) and, hence, the variable zs defined in (12) is set to 0, as established by constraint (24); otherwise, if the event is E R s , the indexs not belongs to the setS (lines [4][5], and the variable zs could assume any value. Due to the fact that the MLP strategy performs a memoryless placement not considering the previous position of VFs on UAVs, we set both z (t) fs and y (t) fs equal to 0, ∀f ∈ F and ∀s ∈ V (lines 6-7), in order to remove the optimal placement derived at the time t−1. The new matrices created in this way are respectively saved inẐ (t) andŶ (t) . These two matrices are used to save the new optimal placement at time t derived as the solution of the optimization problem, and in particular minimizing the objective function Θ subject to constraints (24)- (35), given as Data of the Algorithm 1 (line 8). At the end (line 9), the MLP Algorithm returns the optimal placement solution that has to be used by UAVs composing the FANET until the next FANET modification event.
Referring to Algorithm 2, applied when the WMP stategy is used, also in this case the UAVs causing the event and the type of event (either E L s or E R s ) are provided as Input of the Algorithm 2. In addition, due to the fact that optimization is applied to decide the placement of the only VFs that were running on that UAVs, while the allocation of all the other  VFs remains unchanged with respect to the previous placement, also the z (t−1) fs and y (t−1) fs , ∀f ∈ F and ∀s ∈ V , are needed as Input. Furthermore, when the UAVs comes back to the FANET, the WMP strategy tries to place inside it the same VFs of the placement in which all the UAVs were active. This placement, represented by the matrixZ (1) , is given as Input as well.
As for Algorithm 1, according to the type of event (line 1), if the event is E L s thens ∈S and, hence, we set zs equal to 0 (lines 2-3); otherwise,s / ∈S if the event is E R s (lines [4][5]. In this last case, as said before, the WMP tries to place in the UAVs the same VFs of the optimal placement with all the N UAVs active. For this reason, for each function i ∈ F , the algorithm checks ifZ (1) (i,s) is equal to 1, meaning that the i-th function could be placed in the UAVs now (lines 6-7). To this purpose, we set both z (t−1) is and y (t−1) is equal to 0 ∀s ∈ V to force the algorithm to replace only these functions (lines [8][9].
To solve the optimization problem using WMP strategy, it is necessary to introduce two more constraints for each possible type of event. When the UAVs leaves the FANET, we define: In (36),S is the set of unavailable UAVs (note thats ∈S ) whileẐ is the set of ordered pairs (function, UAV) which had been associated in the previous optimal placement. Likewise, in (37), we definê Y Instead, when a UAVs comes back to the FANET after battery substitution, we define:   19: fs = 1} is the set of the VFs allocated on UAVs at the first placement (that is, wheñ S = ∅).
All that said, returning to the description of the Algorithm 2, we consider two matrices,Ẑ (t) andŶ (t) , used to save the new VFs placement at time (t). Depending on the type of event (line 14), the VFs placement is derived minimizing the objective function Θ subject to: • constraints (24) At the end (line 19), the WMP Algorithm returns the optimal placement solution that has to be used by UAVs composing the FANET until the next event.

VI. NUMERICAL RESULTS
In this section, we will consider a use case to evaluate the performance of the proposed solution. More specifically, in Section VI-A we describe the use case setup. Then, in Section VI-B, we discuss about model complexity and resolution times. Section VI-C presents an extensive simulation campaign to discuss about the impact of some system parameters on the performance of the FANET and the Quality of Service (QoS) provided to its users, and to compare the proposed framework with a standard solution that is taken as reference to demonstrate the achieved gain. Finally, Section VI-D compares MLP and WMP to evaluate performance worsening occurring

A. Use Case Setup
In this section, we describe the scenario we consider as use case for performance evaluation. The main parameters are summarized in Table IV. Let us consider a FANET of |V | = 5 UAVs that has to provide devices on ground with K = 5 SCs, with length L k = 3, ∀k ∈ [1, K ]. The required SCs are described in Fig. 3. They chain the following |F | = 8 VFs: f , characterizing each function f ∈ F were estimated on a deployment at the UniCT 5G&B Lab. They are listed in Tables IV and V, respectively. As we can see in Table V, for example the function f 1 halves both packet rate and bit rate, being a firewall, while f 6 increases the bit rate only, performing enrichment of video flow packets. In the same testbed we have also measured the mean packet size, Ω = 0.95375 kbyte.
In order to reproduce a use case as much closer to the reality as possible, we considered that each VF has different implementations. Specifically, as listed in Table VI, all VFs have two implementations, here referred to as Big Instances and Small Instances. Moreover, VFs f 4 , f 5 and f 6 have an additional extra-light implementation, named Tiny Instance. These implementations provide the same service, but differ from  All UAVs are equipped with the same CE that is able to execute 8.32 gigaFLOPS/s. Concerning power consumption for engines, we consider four small equal quadcopters consuming a power of 67 W, and one low-power UAV, specifically a balloon, referred to as s 4 , consuming only 8 W, only to maintain its position. The values of power consumption to maintain the VMs hosting the VFs switched on are listed in Table VII, while the energy needed to process a packet for the VMs hosting the VF f in the UAV s, i.e., e (P ) fs , can be derived from the VF instance complexities σ fs listed in Table VII considering that each floating point operation consumes 132 nJ to be executed in the considered CE.
Concerning the wireless links between UAVs, considering that all UAVs are not too far away from each other and are all in Line Of Sight (LOS), we assume the same average transmission rate of 1 Gbit/s, equal for each link, an average power consumption for transmission of 6W and a negligible propagation delay.
Finally, we consider that all the chains have the same requirements in terms of maximum tolerable delay, equal to 1 ms [61], referred to the end-to-end delay in the FANET, as expressed by (35). The two weights of the objective function Θ are set as α P = 0.5 for the power consumption contribution and α G = 0.1 for the "Satisfied Flows" gain contribution.
Numerical results are evaluated by a MATLAB-based eventdriven simulator that is able to reproduce the flight duration of the UAVs, considering the power consumption due to all the terms specified in Section V-B, the battery capacity, B, mounted on board the UAVs, and the time, t BR needed for each UAV to reach the Charging Station, replace its empty battery with a charged one, and come back to the FANET. These two last parameters have been varied in the simulation campaign.
The simulator, at each event of UAV landing and UAV rejoining the FANET, accesses a database to retrieve the results of the optimization model to find the optimal placement. This database, for both cases of WMP and MLP strategies, was filled offline by running the optimization model described so far. Performance of the optimization model will be described in Section VI-B.

B. Model Evaluation
The proposed model represents a nonlinear multi-objective optimization problem; indeed the model involves more than one objective function which must be minimized. We used the weighted sum method that combines and converts all the objective functions into a single-objective composite function using the weighted sum (see [62], [63] and [64]). Furthermore, since some of the terms of the objective function are nonlinear and the feasible region is determined by some nonlinear constraints, we are dealing with a nonlinear programming problem in which the variables are Boolean.
We solved the problem using CP Optimizer, the CPLEX Constraint Programming solver, which rapidly solves a large range of problems traversing and systematically exploring the decision tree for feasible and efficient solutions (through domain reduction) [65]. The CPLEX solver presolves the input model before search, modifying the model to improve it so that it can be solved more efficiently. Indeed, CP Optimizer automatically removes redundant constraints, reformulates the model to use constraints that are more efficiently propagated and identifies conflicting constraints (if any).
We obtained solutions using the CPLEX Solver on a laptop with an HP 255.5 computer, 5 compute cores 2C+3G, 2.60 GHz, RAM: 8 GB. For the placement of the SCs described in Fig. 3, the MLP Model previously described was repeatedly executed for each configuration representing each FANET modification event or change of network topology. We observe that the number of variables is constant for each configuration (this allows us to better manage the CPLEX call for each different configuration): the problem has 440 variables. Instead, the number of constraints constituting the model decreases in the events when some UAVs are not available in the FANET (constraint (24) prevents their use). Therefore, the model is constituted by 950 constrains for each configuration with only one UAV available, 949 constrains for each configuration with two UAVs available, 948 for three UAVs available, 947 for each configuration with four UAVs available and 948 constrains for the configuration with all the UAVs available. The values reported in Fig. 5 refer to the configurations which have been divided according to the number of active UAVs to be used for placement (ranging between 1 and 5), More specifically, Fig. 5 represents the averages of total memory usage, required computation time and number of feasible solutions found for all configurations with 1, 2, 3, 4 or 5 UAVs available for placement, respectively.
By paying particular attention to the computational time required to perform the model and to compute the solutions of each configuration, we note that it belongs to the interval [0.31, 40.32]s, the arithmetic mean of the time spent to solve is 20.5s; therefore the solutions, although calculated offline, are obtained in a fairly short time.

C. Comparison With a Standard Placement Technique
As already pointed out in Sections I and II, the main novelties introduced in this paper, as compared with the previous literature, regard both the system, i.e., a FANET to provide ground devices with a softwarized network equipped with edge computing facilities, and the placement strategy, which is able to minimize power consumption and maximize the total packet rate managed by the FANET. Starting from the consideration that, at the best of our knowledge, there is no previous work with both these objectives, here we compare the MLP strategy proposed in this paper with a standard placement model that we will name No-share placement (NoShP). It is memoryless as MLP, but does not share VFs among different flows and does not take into account the packet-rate and bit-rate input/output ratios γ (P ) f and γ (B ) f . Therefore, referring to Fig. 3, it tries to deploy fifteen instances of the VFs needed to create the five required chains, all with γ First, we will analyze how the FANET behavior is influenced by its main parameters, i.e., the round-trip time needed by a UAV to replace the battery, t BR , and the battery capacity, B.
Figs. 6, 7, 8, and 9 are correlated to each other. In all these figures, we can observe two different behaviors, one for low values of t BR and one for high values of it; the boundary between the two intervals depends on the battery capacity B. In the left interval, the average number of VF instances deployed on the same UAV increases with t BR (see Fig. 6) because the same VFs have to be placed on less UAVs while the number of active UAVs decreases, as we can note in Fig. 7. For this   reason, as shown in Fig. 8, the average power consumption of each active UAV increases and, consequently, the average UAV flight time, shown in Fig. 9, decreases. Instead, in the right interval of these figures, which is characterized by a FANET with a too low number of active UAVs, as shown in Fig. 7, active UAVs are in saturation, and the average number of deployed VFs decreases because the few active UAVs are no longer sufficient to accommodate all the chains, and therefore, some VFs are not deployed. For the same reason, the average power consumption slowly decreases until becoming almost constant, as evident in Fig. 8. This occurs because, on average, for very high round-trip times to/from the Charging Station, the lower power consumption for a UAV when it is active in the FANET (which is decreased because some SCs are not deployed for lack of FANET resources) is compensated by the increment of power consumption needed to reach the farther Charging Station. The same behavior influences, of course, the average flight time.
As far as the comparison between the two placement models, MLP and NoShP, the four above figures demonstrate the gain achieved with the proposed framework. More specifically, Fig. 6 confirms that NoShP imposes a higher number of VFs to be deployed on each UAV for any value of the battery replacing time, t BR . This causes that the right interval (the interval characterized by UAV saturation) is larger than in the case of MLP.
Also, we can observe that, in the left interval of Figs. 8, 9 and 7, NoShP has a higher average power consumption and, consequently, a lower average flight time and a lower number of active UAVs. On the contrary, in the right interval of the above figures, we have an inversion of the two curves for each case of B (it is more evident for B = 40 Wh) with respect to the left interval. This occurs because, in this case, due to the higher level of network saturation related to the longer battery replacing time, the "Satisfied Flows" gain contribution becomes dominant over the power consumption in the objective function. Therefore, the optimization process privileges the placement of the SCs that allow to maximize the served packet rate over the one that allows more energy saving. This is the reason why the WMP strategy shows an average power consumption higher than NoShP (see Fig. 8). This causes a consequent lower number of UAVs available (see Fig. 8) because we have only those that are able to maximize the number of satisfied flows. As observed so far, the average number of VFs that are deployed on each active UAV, shown in Fig. 6, remains higher for NoShP because this strategy, not sharing VFs among different flows, is forced to maintain a higher number of VFs to serve the same flows, but this is critical in saturation conditions. Consequently, fewer chains are placed with NoShP, and therefore fewer VF instances are run, with a consequent reduction of power consumption.
In order to further analyze how the placement optimization model works, in Fig. 10 we show the average value of the objective function for both MLP and NoShP. This function has been measured for each number of active UAVs because both the terms in (22), i.e., power consumption and gain achieved by serving SFs, depend on it. In the overall figure (without considering the magnified part of it), we can appreciate how much the objective function is dominated by the gain achieved by serving satisfied flows, G SF , when not all the chains are placed (mainly during periods in which only one UAV is active in the FANET). The high values characterizing the objective function in this case demonstrate how much bad is considered it by the FANET Orchestrator. On the contrary, when at least two UAVs are active in the FANET, the FANET Orchestrator almost always is able to place all the chains, so achieving very low values of the objective function. In all these cases, the second term of the objective function is maximum and equal for all of them, and therefore all values are below −8000. Comparison between these cases, only dependent on the first part of the objective function (i.e., the part that considers power consumption), is shown in the magnified part of the figure. In this subfigure, not only we can observe that, as expected, the minimum value of the objective function improves (i.e., decreases) with the number of active UAVs, but also it is better (i.e., lower) when the MLP strategy is applied.
Finally, Figs. 11, 12 and 13 present a comparison of MLP with NoShP in terms of the main performance parameters, i.e., the average delay, the packet loss rate and the service  unsatisfaction probabilities. More specifically, the service unsatisfaction probability is expressed in terms of no-service probability and partial-service probability, respectively which are defined as follows: where T TOT is the duration of a simulation run, T NS is the sum of the time duration when no SCs have been deployed in the FANET, so no flows have been served, and T PS is the sum of the time duration when not all the required SCs have been deployed.
Observe that all the above mentioned "quantitative" metrics give an indication of the service continuity which represents a "qualitative" performance metric and expresses how well our design is able to satisfy service requests and support users everytime, in a continuous and uninterrupted way. The impact of these parameters associated to service continuity for ground devices strongly depends on the vertical application and possible alternative solutions that can be implemented. For example, if a vertical application is not able to tolerate packet loss, an alternative solution may consist in setting up a backup connection to a remote cloud, for example via a satellite link. However, this solution can result very expensive and could not guarantee the required delay performance. So it is a matter of identifying a design trade-off.
The non-monotonic behavior of the average delay, shown in Fig. 11, is motivated by the same reasoning discussed so far, with an inversion in the right part of the curves. Instead, the other performance parameters get monotonically worsen when t BR increases and B decreases since these conditions increase UAV saturation. In the left part of the average delay curves, the proposed framework coincides with the NoShP, since the number of active UAVs is sufficient to provide the required resources in both the cases. In the middle part, the proposed framework performs better (i.e., presents a lower average delay), while in the right part the average delay measured with the NoShP strategy looks better. Nevertheless, let us notice that the advantage of NoShP in terms of average delay in the right part of Fig. 11 is only ostensible because the achieved values of the average delay remain thoroughly  below the imposed constraint of 1 ms for both the strategies. Nevertheless, MLP achieves better performance in terms of packet loss ratio and, more important, it presents a better service continuity having lower no-service and partial-service probabilities (Figs. 12 and 13). In other words, the presented results show that MLP outperforms NoShP while respecting delay constraints.

D. Memoryless vs. With-Memory Placement
In the previous section, we have evaluated performance of the MLP strategy, which has been defined with the only target of optimizing performance at each event that modifies the number of active UAVs in the FANET. However, given that it does not take care of the position of VFs immediately before each placement optimization, VFs can be moved from one UAV to another one at each optimization action, with the possibility of re-routing of a high number of flows at each event. This is the reason why we have also introduced the WMP strategy, for its peculiarity of maintaining memory of the previous VF allocation in the FANET.
The main differences between MLP and WMP are evident in terms of average power consumption, as shown in  Fig. 14, because optimization with WMP is worse. Also in this case, we can notice different behaviors. After an interval where the two strategies perform in a similar way, there is an interval where MLP saves a lot of power. Then, there is an interval where WMP consumes less power; this is because there are less active UAVs (see Fig. 15) to support the same number of VFs, but the overall power consumption due to the UAV engines is less. Finally, in the last interval on the right, the FANET is stressed almost at the same way, independently of the used strategy (although this is still not visible for the two curves in red, calculated for B = 80 Wh), tending to the same average number of active UAVs in the FANET, so presenting the same number of running VFs on each UAV (see Fig. 16), and the same average power consumption.
Consequently, the overall behavior of the FANET is worse with WMP, both in terms of packet loss ratio, shown in Fig. 17, and service unsatisfaction probabilities and average delay, shown in Figs. 18 and 19, respectively.
However, as desired, we obtain a reduction of the flow rerouting rate, as shown in Fig. 20, and this reduction is higher  when the FANET is stressed, i.e., for higher values of the round-trip time needed to replace the battery, t BR , and for lower values of the battery capacity, B. Nevertheless, let us consider that the final choice between MLP and WMP depends on the specific application scenario. Indeed, as known, flow re-routing can cause an abrupt variation of delay for some packets and, as a consequence, possible packet disordering [54], [67]. Moreover, for networks that are based on the SDN paradigm [68], like the FANET considered in this paper, each flow re-routing is realized by a communication between the SDN Controller running in the FANET Coordinator and the SDN Switches running in the Management VF inside each UAV. This causes a transmission overhead and an additional delay that can violate the delay requirement imposed by the delay threshold described in (35). Evaluation of this impact on performance perceived by the end users, also taking into account the sensitivity of specific vertical applications to possible delay violations that can occur in the timescale of FANET event modifications, is out of scope of this paper. Summarizing, if the above issues caused by rerouting may be a problem for the considered scenario, WMP would be preferred. Otherwise, the strategy that presents better performance is definitely MLP.

VII. CONCLUSION
In this paper we have proposed to employ FANETs to extend the capabilities of 5G networks so densifying and augmenting network coverage in remote areas or where communication infrastructures are not available. This empowering of the 5G architecture to support complex tasks and allow exploitation of network and application functions made available from the FANET UAVs is implemented through a service chaining mechanism. To take into account the limited energy and computation capabilities of the UAVs, as well as the application constraints in terms of delay and network availability, we have developed a complete and comprehensive optimization framework which does not use heuristics for the solution and takes into account physical constraints of the UAVs, as well as traffic flow features and requirements. We have compared different placement models with and without memory, illustrating the benefits of a memoryless solution in terms of reduction in the number of virtual functions, decreasing in power consumption, improvement in network lifetime and reduction of service unsatisfaction probabilities. In future research it would be interesting to measure how the MLP and WMP strategies, compared with the NoShP standard strategy, affect the end user on the ground that is consuming the services through the VFs of the SCs placed on UAVs in the FANET, also analyzing the impact of re-routing, mainly evident with MLP, and the implication of some measured KPIs (round-trip time needed by a UAV to replace the battery, and the battery capacity).