# WFO: Cloud-Edge Cooperative Data Offloading Strategy Akin to Water Flow
## 4 WFO Design  
### Grouping Nodes  
The primary function of grouping nodes is to increase the number of nodes so that more users can receive data simultaneously. The execution process is as follows. Cloud sorts and numbers the edge nodes in chronological order. Cloud allocates the outgoing bandwidth to the edge nodes. Edge nodes that do not request the bandwidth are mounted on the preceding nodes to form multiple data links. The number of nodes on each link is determined by the tolerance time. In other words, the delay of the data arriving at the last node on each link cannot exceed the maximum tolerable delay. For delay-sensitive data, the larger the delay, the smaller the value of the information [40]. In order to avoid data invalidation, the tolerance delay is set. The setting of the delay tolerance depends on the characteristics of the application and data. Figure 2: WFO sends the parameters generated by the edge nodes to the cloud data center. The strategy will be sent to VMS for execution through a three-step generation strategy: grouping nodes, calculating priority, and data offloading. We assume that there is a group of edge nodes \(\mathcal{N}\) that can be served by a cloud \(C\triangleq(S,\mathcal{B})\). \(S\) and \(\mathcal{B}\) represent the amount of data needed to be offloaded in the cloud and the bandwidth of the cloud, respectively. All edge nodes access the same data on the cloud. We use \(N_{i}(i\in[1,|\mathcal{N}|])\), and \(B_{i,j}(i,j\in[1,|\mathcal{N}|])\) represents the \(i\)th edge node and the bandwidth between the \(i\)th edge node and \(j\)th edge node, respectively. Figure 3 illustrates the execution process of grouping nodes. Assume that the cloud outgoing bandwidth is \(80\ MB/s\). The bandwidth between each node and the cloud is assumed to be \(20\ MB/s\). If there are \(50\) edge nodes requesting data, cloud will number the edge nodes. The cloud serves edge nodes according to the numbering order. According to this hypothesis, only nodes \(N_{1}\), \(N_{2}\), \(N_{3}\), and \(N_{4}\) can request data directly from the cloud. The other nodes have to wait. To improve efficiency, we connect \(N_{5}\) to \(N_{1}\), and \(N_{6}\) to \(N5\). This results in a data forwarding link include edge nodes \(N_{1}\), \(N_{5}\), and \(N_{6}\), as shown in Figure 3. We use \(\mathcal{L}_{k}\) (\(\mathcal{L}_{1}\triangleq N_{1},N_{5},N_{6}\)), which represents the \(k\)th data forwarding link. Therefore, \(N5\) and the subsequent nodes can obtain data through the first four nodes. The number of nodes in each link depends on the delay in data arriving at \(N_{6}\), which means that the delay in data arriving at \(N_{6}\) cannot exceed the tolerable delay. Therefore, the data forwarding link must meet the following conditions:  
\[\sum_{i,j\in\mathbb{C}\cup\mathcal{L}_{k}}\widetilde{\tau}_{i,j}+\sum_{i\in \mathcal{L}_{k}}\widehat{\tau}_{i}\leq\tau^{\prime} \tag{5}\]  
where \(\widetilde{\tau}_{i,j}\) is the transmission delay from the \(i\)th edge node to the \(j\)th edge node. \(\widehat{\tau}_{i}\) is the forwarding delay of the \(i\)th edge node. \(\tau^{\prime}\) is the tolerate delay. The number of nodes in each data link can be determined by Formula (5). We designed Algorithm 1_Grouping nodes_ to generate data forwarding links. The algorithm takes as input of the bandwidth between the \(i\)th and \(j\)th nodes \(B_{i,j}\), the bandwidth between the \(i\)th node and cloud \(B_{i,C}\), the bandwidth of the cloud \(\mathcal{B}\), the forwarding delay \(\widehat{\tau}_{i,j}\), and the tolerance delay \(\tau^{\prime}\). The output shows multiple data forwarding links \(\mathcal{L}_{k}\). The algorithm arranges the nodes by time, similar to the FCFS strategy, and generates an initial queue. We set an intermediate variable \(\gamma\), which represents the number of nodes that get data directly from the cloud. Lines 4-11 are used to calculate the delay that data arrives at the \(j\)th node.