# Cluster-Based Control Plane Messages Management in Software-Defined Flying Ad-Hoc Network
## 3 Cluster-Based Control Message Management for FANET
### Network and System Model
Each location \(L_{i,t}\) is a 3-uple of geographical coordinates \((x_{i},y_{i},z_{i})\) in a 3D space, since UAVs fly in a 3D space. On the other hand, the location of the \(DN\) is assumed to be known a priori by each node \(v_{i}\), since it is a static node. Each UAV \(v_{i}\) flies with a given speed \(s_{i}\) ranging between a minimum (\(s_{min}\)) and a maximum (\(s_{max}\)) speed limit towards a trajectory \(traj_{i}\). The trajectory \(traj_{i}\) is defined as an ordered sequence of locations that a given UAV \(v_{i}\) flies between two pairs of location, which is denoted as \(traj_{i}=\{L_{i,0},L_{i,1},...,L_{i,t}\ \}\), indicating that a given UAV \(v_{i}\) arrives at location \(L_{i,t}\) at timestamp \(t\). Each UAVs \(v_{i}\) flies according to the trajectories defined by the Paparazzi Mobility Model (PPRZM) [30], because PPRZM enables UAVs to adapt its trajectory for any mission based on different possible UAV movements [31]. Particularly, PPRZM is a stochastic mobility model based on autopilot software for UAV [32], which considers five possible trajectories (\(traj_{i}\)): Stay-At (i.e., UAV flies in a circle), Way-point (i.e., UAV flies following a straight line to a destination position), Eight (i.e., UAV trajectory has the 8 form around two fixed positions), Scan (i.e., UAV flies performs a scan in an area defined by two points along the round trip trajectories); and Oval (UAV trajectory has an oval form) [11]. Each movement defines a set of pointsfor the UAV flies in straight trajectory \(traj_{i}\) between two points (current and destination position) with a given speed \(s_{i}\). Each UAV \(v_{i}\) has a battery with initial energy (\(E_{v_{i}}(0)\)), and it spends energy to transmit a packet (\(E_{tx}\)), to receive a packet (\(E_{rx}\)), to retrieve data (\(e_{frame}\)), and to fly with a given speed \(s_{i}\) (\(E_{fly}(d,s_{i})\)). Each UAV \(v_{i}\) is able to measure the current energy (\(E_{v_{i}}(t)\)) at any time, and thus it can compute the remaining energy ratio (\(E_{ratio_{v_{i}}}(t)\in[0,1]\)) as follows:  
\[E_{ratio_{v_{i}}}(t)=\frac{E_{v_{i}}(t)}{E_{v_{i}}(0)} \tag{1}\]  
\(E_{fly}\) is the energy consumed in a straight flight to move a distance \(d\) at a given speed \(s_{i}\). \(E_{fly}\) can be computed as the integral of the power \(P(s_{i})\) in function of \(s_{i}\) along the time [33]:  
\[E_{fly}(d,s_{i})=\int_{t=0}^{t=d/s_{i}}P(s_{i})dt=P(s_{i})\frac{d}{s_{i}} \tag{2}\]  
The energy required to transmit (\(E_{tx}\)) and to receive (\(E_{rx}\)) a packet depends on the transmission power (\(P_{tx}\)). The energy consumed by the UAV \(v_{i}\) to transmit a packet of length \(n\) bits over the wireless link with a bit rate equal to \(r\) bps in time \(T\) is computed as [34]:  
\[E_{tx}=\left(P_{ct}+\frac{P_{tx}}{e_{pa}}\right)T=\left(P_{ct}+\frac{P_{tx}}{e _{pa}}\right)\frac{n}{r} \tag{3}\]  
where \(P_{ct}\) is the power required to run the transmitting circuit, and \(e_{pa}\) is the efficiency of the power amplifier. The energy consumed by the UAV \(v_{i}\) to receive a packet \(E_{rx}\) is computed based on Equation (4) [34]. The power required to run the receiving circuit is denoted as \(P_{cr}\). \[E_{rx}=\frac{P_{cr}}{r}n \tag{4}\]  
It should be highlighted that UAV movements require much more energy than for packet transmissions. In our scenario, we consider a battery replacement location \(L(X_{r},Y_{r},Z_{r})\) that a given UAV \(v_{i}\) could fly to replace/recharge the battery, and then return to the monitoring environment, as introduced by [PERSON] et al. [11]. Figure 1 shows the control message flow in the control plane of the SDN-FANET architecture. The whole FANET is managed by a central controlling entity, known as Controller Node (\(CN\subset V\)). Controller (\(CN\)) is responsible for all management functions via the Global Manager and Global Controller.