 Research
 Open access
 Published:
An adaptive routing strategy in P2Pbased Edge Cloud
Journal of Cloud Computing volumeÂ 13, ArticleÂ number:Â 13 (2024)
Abstract
P2Pbased Edge Cloud (PEC) is widely used in Internet of Things (IoT). Inevitably, the sensor data routing technology has a significant impact on the performance of PEC. Due to its prevalence and complexity, the existing routing technologies in PEC need to be optimized. Specifically, key factors such as overall network traffic, user access latency, and resource utilization of edge nodes should be considered to adapt to the dynamic requirements of user request services and network topology. In order to address the challenges produced by these factors, an adaptive routing in P2Pbased Edge Cloud is proposed, which is named ARPEC. In our approach, a target edge node selection scheme based on message activity and network topology is proposed, aiming to minimize the load on edge node and user access latency. Furthermore, to minimize system overhead, sensor data routing is mapped to minimum cost maximum flow (MCMF) graph. On this basis, a target edge node selection algorithm based on a grey linear regression combination prediction model is designed, and an incremental MCMF algorithm based on belief propagation (BP) is proposed. The evaluation results show that our approach can effectively improve PEC transmission performance and user experience.
Introduction
The vigorous development of IoT and mobile intelligent devices has brought about a trend of data sources shifting from centralized cloud data centers to distributed edge computing networks [1,2,3]. In IoT application scenarios based on centralized cloud computing, the data generated by sensors needs to be transmitted to cloud platform and to be processed by using the cloud computing power. Unfortunately, the massive amount of data transmission will bring a huge burden to the core network, which not only affects the normal operation of the core network, but also brings huge transmission delays and reduces user experience [4,5,6]. As a result, edge computing came into being, and Edge Cloud is one of the main research directions in the field. In Edge Cloud, multiple edge servers (referred to as edge nodes in the paper) are placed closer to users, and users can submits computing tasks to an edge server that is closer to them for computing. Compared with centralized cloud, Edge Cloud meets the requirements of low latency, low consumption and fast response. Therefore, the combination of Edge Cloud and IoT has become a general trend [7,8,9,10].
As is known, P2P architecture, where the neighbor nodes exchange parameters to obtain global information, is one of the mainstream architectures of Edge Cloud. Therefore, we adopt P2P architecture that has no fixed central node and can better and fully utilize the extensive distributed resources of edge nodes. Considering the important impact of sensor data routing technology on edge cloud service quality, such as reducing overall network traffic, reducing user access latency, and improving resource utilization of edge nodes, in the paper, we study an adaptive routing strategy in PEC.
Currently, the challenges in utilizing PEC to process sensor data routing can be mainly divided into two aspects. On the one hand, due to the following factors, such as the diversities of user needs, the temporal differences in service access, and the limited coverage of an individual edge node, if a certain sensor data is cached on an edge node, it often leads to an increase in service latency, and even network congestion and service interruption. On the other hand, due to differences in computing power and dynamic changes in load conditions among edge nodes, some edge nodes may have excessive load, which greatly damages the quality of service. In the paper, we focus on the topic of ARPEC, specifically studying how to reduce data traffic, how to shorten user access latency, and how to improve the utilization of edge nodes in PEC. The contributions of this paper can be summarized as follows.

â€¢ Modeling adaptive routing optimization: We analyze the key goals of solution to routing optimization, and propose a sensor data routing model to reasonably route sensor data to the target edge nodes which provide caching services for the sensor data.

â€¢ Selection scheme for target edge node: We introduce a target edge node selection scheme to enhance user experience, which can adapt to the temporal dynamic characteristics of routing demands, and design a target edge node selection algorithm based on a grey linear regression combination prediction model.

â€¢ Construction and solution of MCMF graph: To improve the overall performance of PEC, we map sensor data routing to MCMF graph from a resource perspective, at the same time, propose an incremental MCMF algorithm based on BP, which reduces computational costs and supports dynamic deployment.
The remainder of this paper is organized as follows. In Related work section, we review the related work on routing strategies. An adaptive routing model in PEC is established in Adaptive routing model Section. In Target edge node section, we propose a target edge node selection scheme based on the relevant characteristics of PEC and IoT, and design a request message processing algorithm. In MCMF graph section, by analyzing the impact of edge node load on service quality, we propose a sensor data routing scheme based on MCMF graph that supports global optimal solution for multiple routing tasks, and design an incremental MCMF algorithm based on BP. We compare the experimental performance and analyze the results in Simulation and performance analysis section. Conclusion section concludes the paper.
Related work
The sensor data routing strategy of edge computing network in IoT is a hot research topic in academic research in recent years. According to the different metrics, it mainly involves two aspects: scheme for selecting target edge node and solution using MCMF model.
Scheme for selecting target edge node
In IoT, the edge nodes store a certain amount of sensor data. The quality of target edge node selection scheme will have a significant impact on system performance. The core of scheme is how to cache sensor data, that is, how to design caching scheme for sensor data.
LCE [11] is an intuitive caching decision scheme where data is cached by all nodes along the way back to the requester; however, it can easily lead to huge data redundancy. LCD [12] and MCD [13] are two approaches that improve the caching diversity. A new copy of the requested data will be cached only at the immediate node of the path in downward direction. The difference between them is that under MCD, the hit node will delete the requested data. However, both were proposed earlier for web caching to reduce cache redundancy. Prob [14] is a probabilistic caching version of LCE. However, the version is not flexible enough to determine whether to cache the arrived data based on a static probability. In short, the above strategies are mainly applied to Information Centric Networks and not specifically targeted at IoT.
Currently, there are some data caching solutions based on IoT. Y. Sellami et al. [15] proposed an architecture for a distributed fog caching solution for ContentCentric Networks. O. Serhane et al. [16] focused on an energyaware caching placement scheme to maximize the energysaving. G. Dhawan et al. [17] considered the tradeoff between node energy, data freshness and cache occupancy, and proposed a candidate node selection for cache placement. N. Baltagiannis et al. [18] incorporated sensor faults and energy consumption in caching decisions. M. Amadeo et al. [19] designed a probabilistic Internetscale caching design for IoT data. S. Tanted et al. [20] discuss the design, implementation and performance of a distributed caching & aggregation mechanism to handle the visualization of sensor data. However, the approaches are more focused on caching techniques for IoTbased compared to giving much attention to the placement and selection of caching nodes.
In summary, it can be seen that the caching schemes of Information Centric Networks have the problems of high pressure on data center transmission and computing, as well as high construction costs; the IoTbased caching schemes are good solutions for the systems that generate a large amount of sensor data flow. However, how to improve resource utilization and computational efficiency, as well as how to reduce user query latency, is still a topic that needs further research. This study extends the existing work by utilizing an adaptive routing optimization model with mechanisms for selecting target edge node to address the limitations of traditional routing models when applied to PEC. It also optimizes the selection scheme for target edge node, resulting in reduced load on edge node and user access latency.
Solution using MCMF model
In many scenarios, a large number of users access edge nodes at different times and locations [21]. Therefore, routing strategy typically cannot be designed for each user, but relies on dynamic changes in user query patterns and spatiotemporal dimensions. In addition, routing service often incurs significant transmission costs, which may lead to service interruption and overall service delay. At present, there are some studies using MCMF model to solve sensor data routing problems.
To minimize average transmission delay or flow cost in data centers, Akbar Majidi et al. [22] formulated this optimization problem as a constrained Markov decision process. By creating multiple paths between the source and destination peers, MaxFlowTCP [23] utilized SDN with traditional TCP to deliver maximum flow throughput in data centers. Through a logically centralized control plane, the processingwhiletransmitting pattern [24] jointly determined the transmission path and placed subtasks adaptive to dynamic topology, and data distributions. To minimize the sum of heterogeneous costs of relay nodes, Y. Sun et al. [25] formulated the NWPTSTP for minimum cost relay node placement. However, the approaches are more focused on providing traffic management in SoftwareDefined Networks environments or in Wireless Sensor Networks, and donâ€™t involve the reoptimization of flow in PEC.
In addition, some studies have concentrated on BPbased MCMF methods [26], which mainly concentrate on how to utilize the parallel transmission of information between nodes in solving combinatorial optimization problems. G. Dhawan et al. [27] applied BP to discover globally optimal routes by performing lowcomplexity computations and exchanging messages with their neighbors. N. Baltagiannis et al. [28] showed how BP can be used to compute the throughputs of different links in the network given their access intensities. Ghafoor et al. [29] applied BP algorithm to compute a final belief about existence of primary user. Kakkasageri et al. [30] proposed multiagent routing scheme for vehicular Ad hoc networks. However, one common challenge is the high timeconsuming of message updates, which often leads to a low sensor data routing efficiency. Thus, there is a need for further research to develop optimized BP algorithm that can effectively minimize system overhead in PEC.
Drawing inspiration from these above researches, we focus on the overall performance of PEC utilizing an adaptive routing optimization model, and demonstrate how leveraging an incremental MCMF algorithm based on BP can reduce computational costs, thereby enhancing efficiency in routing sensor data.
Adaptive routing model
System model
A typical PEC scenario is shown in Fig.Â 1.
PEC consists of sensors, edge nodes, and users. Without affecting routing analysis, the system model omits gateways between sensors and edge nodes, as well as between users and edge nodes. There are two types of messages in PEC: user request and sensor data. Thus, it can be inferred that the overall network traffic arises from the superposition of these two types of messages. Assume that sensor data carries the corresponding information such as sensor identification and timestamp. A sensor transmits data to a directly connected edge node, which stores sensor data in the same size blocks. We refer to the data blocks in edge node as content. If an edge node caches a certain sensor data, then the edge node is referred to as the target edge node related to the sensor. Edge nodes can transmit user requests and sensor data between each other. A user obtains the contents of a target edge node by sending request messages. In Fig.Â 1, \(S=\{{s}_{1},{s}_{2},{s}_{3}\}\), \(EV=\{{\text{e}}{v}_{1},{ev}_{2},\dots ,{ev}_{6}\}\) and \(U=\{{u}_{1},{u}_{2}\}\) denote the sets of sensors, edge nodes and users, respectively. The set of target edge nodes related to s_{1} for the users u_{1} and u_{2} is denoted by \(TE({s}_{1},U)=\{{ev}_{2},{ev}_{5}\}\). A label \(\stackrel{Data}{\to }\) on an edge indicates the routing of sensor data. Meanwhile, a label \(\underset{Request}{\to }\) expresses the routing of user request messages.
With the expansion of the scale of PEC scenarios, this system model exhibits highly dynamic characteristics. First, with the dramatic increase of sensors, the user request services are highly dynamic in temporal. Thus the temporal dynamic of user request services should be considered for routing optimization. Second, it is demonstrated that with the deepening of PEC computing, an unchanged topology in a PEC scenario can no longer meet complex application requirements. So, supporting dynamic deployment of nodes is another factor that cannot be ignored in routing optimization.
Optimization goals
Considering the dynamic requirements of user request services and network topology, the adaptive routing in the paper is defined as how to reasonably route sensor data to the edge nodes for caching in heterogeneous edge node scenarios at each time, that is, how to select the target edge node to achieve the optimal goal.
From the perspective of edge computing service providers and users, the main purpose of selecting target edge node is to reduce the traffic of entire network and the access delay of users, while improving the resource utilization of the edge node. To achieve this goal, the following measures can be taken. Firstly, In order to avoid the surge in the traffic of entire network caused by the propagation of sensor data in PEC, we reduce the number of visits to edge nodes directly connected to sensors. Secondly, we make the content as close to users as possible to reduce usersâ€™ access delay. Thirdly, considering the performance differences of edge nodes, we deploy user request services to edge nodes that minimize the overall computational network scenario overhead as much as possible. Therefore, for selecting target edge node, three optimization goals are defined as follows.

(1) Goal 1: Minimize the load on edge nodes directly connected to sensors
The goal 1 can be calculated as
where T is the running time of the network, req(u,s,t) is the request messages sent by user u to s at time t, dl(s) represents the edge node directly adjacent to s, and sat(r,ev) is a Boolean function to determine whether ev meets the request r. We define load(u,s) as the number of requests that edge node dl(s) satisfies u during time period T. The smaller the value of load(u,s) is, the lower the network traffic is.

(2) Goal 2: Minimize user access latency
The goal 2 can be calculated by the following expression.
We define delay(u,s,ev) as the ratio of the delay of sensor data transmission between user u and the edge node ev that satisfies the user's request after sending a request message to sensor s during time period T, and the delay between user u and the edge node dl(s). The smaller the value of delay(u,s,ev), the closer the edge node that satisfies the user u's request is to u. Therefore, delay(u,s,ev) can be used to indirectly reflect goal 2.

(3) Goal 3: Minimize system overhead
One of the factors affecting system overhead is the resource utilization of edge nodes. To describe the resource utilization of edge node, the weight value of edge node ev, denoted as w(ev), is designed in PEC. w(ev) is inversely proportional to the resource utilization of the edge node. Here, w(ev) is influenced by the factors such as the CPU and disk utilization of edge node, as well as the priority of content requested by user, that is, the higher the utilization of CPU and disk, as well as the priority of the requested content, the lower this value of w(ev) is.
The goal 3 can be formulated as follows.
where \(mW=(w\left({ev}_{1}\right) w\left({ev}_{2}\right)\cdots w({ev}_{n}))\) is a 1*n matrix, given n is the number of edge nodes in the network. \(mD={(delay\left(u,s,e{v}_{1}\right)\cdots delay\left(u,s,{ev}_{n}\right))}{\prime}\) is a n*1 matrix. Taking into account the processing capacity of the edge nodes, cost(u,s) is defined as a numerical value that represents the ratio of the product of the edge node load of the content provider in goal.1 and the delay between u in goal.2 and the edge node ev that satisfies u's request, to the delay between u and the content source provider.
As mentioned above, we construct the following adaptive routing optimization model.
Considering the different processing capabilities of each edge node in the scenario of heterogeneous edge nodes, the target of the model is to solve for the values of the req function and sat function at a certain time, so as to minimize the value of formula 4.
Problem analyses

(1) Selection of target edge node
By observing the goal 1 and the goal 2, we find that req(u,s,t) and req(u,ev,t) are key parameters in the model, which can reduce the overall network traffic and user access latency. Thus, based on the value of the function sat, it can be determined whether the edge node has a message that meets the request. By summing the sat values, the activity of sensor messages at an edge node can be determined. Based on message activity, it is possible to better determine whether each edge node is a target edge node during the period. Therefore, the value of \(\sum_{t\in T}sat(r,ev)\) is a key factor. In addition, in order to minimize user access latency, it is necessary to keep \(\sum_{t\in T}sat(r,ev)\) as small as possible, that is, the number of hops between the target edge node and the user needs to be as small as possible. We proposes a target edge node selection scheme based on message activity and network topology, and implements a target edge node selection algorithm based on a grey linear regression combination prediction model.

(2) MCMF graph
By observing the goal 3, we find that w(ev) is another key parameter in the model. Furthermore, w(ev) can be quantified as the capacity of the path in the network graph. At present, the MCMF problem has been applied to various network routing scenarios and is usually characterized by graph models. By limiting the capacity and cost of paths in the graph, the global optimal solution for multiple routing tasks is sought. We apply it to message routing modeling in multi user, multi sensor, and multi query scenarios. Specifically, the two problems of users' demand for resources and the supply of resources in edge computing networks are transformed into the construction and solution of MCMF graph. In particular, considering the throughput and response delay of user requests in edge computing networks, an incremental MCMF optimization algorithm is implemented.
A MCMF graph for sensor data routing is shown in Fig.Â 2. The nodes marked with dashed circles, such as ev_{2} and ev_{5}, are the target edge nodes of s_{1}. The node \(t{v}_{{s}_{1}}\) is the terminal node associated with s_{1}, which serves as the aggregation node for data from sensor s_{1}. \({tv}_{{s}_{1}}\) is connected to u_{1} and u_{2} by edges, indicating that u_{1} and u_{2} have sent request messages to s_{1}. Sequence \({s}_{1}\to {ev}_{1}\to {ev}_{2}\to {u}_{1}\) and sequence \({s}_{1}\to {ev}_{1}\to {ev}_{3}\to {ev}_{5}\to {ev}_{4}\to {u}_{2}\) represent the two data forwarding paths related to s_{1}, respectively. Each edge is marked with a pair of cost/capacity values, where the cost indicates the cost of forwarding sensor messages through the edge, and the capacity means the ability of the edge to forward sensor messages. Considering that an edge node directly connected to a sensor should receive the sensor data as much as possible, the capacity of the edge is assigned infinity. Similarly, due to the fact that the terminal node directly connected to a user is uniformly added for the convenience of unified processing, the capacity of the edge is also assigned infinity.
Target edge node
Priority of edge node
In the following, based on the scheme of selecting target edge nodes, we first discuss three timerelated metrics: message activity, user request probability, and query distance. And then, the priority is set for each edge node based on these measurements, and the edge node with the highest priority is selected as the target edge node to meet the dynamic changes in user service requests.

(1) Message activity
Since the types and quantities of user requests received by edge node are different, we can determine the activity of message by calculating the number of user requests. Therefore, message activity is defined as the ratio of the number of requests for that message to the total number of requests for all messages. Let r_{s} denote the messages generated by the sensor s. For the edge node ev, act(r_{s},t,ev) denotes the activity of r_{s} at time t. The activity of r_{s} in the edge node ev can be denoted by act(r_{s},ev). Thus, the following equation holds.

(2) User request probability
Considering that a sensor generates new messages every once in a while, users are more inclined to request the latest information. Therefore, the novelty of messages can have an impact on the priority of the edge nodes. We use timestamps to distinguish messages generated by the same sensor at different times. So the larger the timestamp value is, the newer the message is. The probability of any user sending a request message to the edge node ev regarding the message r generated by sensor s at time t is denoted by prob(r_{s},t,ev).

(3) Query distance
In order to reduce latency, sensor messages should be cached as close to the edge node as possible to the user who sends the relevant request message. Therefore, we take the network topology into account when calculating the priorities of edge node. The query distance is denoted by ah(r_{s},t,ev), which is defined as the average number of edge nodes on the relevant paths. Here, the relevant path refers to the path that the message r_{s} generated at time t routes from the current edge node ev to the user node that send the corresponding request message.

(4) Selecting target edge node
Message activity and user request probability are related to the usefulness of the cached sensor data, and query distance is a metric of user access latency. In summary, for the sensor message r_{s} generated at time t, the priority of the edge node ev can be obtained by
Similarly, for the sensor message r_{s}, the priority of the edge node ev can be calculated as
Among them, the coefficient Î±_{ev} denotes an adjustment factor, and its value can be appropriately predicted according to the application scenario. In the paper, we let aâ€‰=â€‰1. Generally speaking, the higher the activity of message is, the higher probability of userâ€™s request is; and the smaller the query distance is, the higher priority of edge nodes.
Prediction of priority
In PEC, sensors constantly generate new data, and users frequently have new requests. Especially when edge nodes receive new requests, the three metric values calculated by using the method in the previous section will have a significant deviation from the subsequent stable values. This results in a significant difference in the priority of edge nodes between the early and the subsequent stable stages. In order to overcome the above impact, this section predicts the priority of edge nodes that receive new requests, so that the nodes can obtain more accurate priorities earlier. Due to the characteristics of grey system, such as no need for a large number of samples, and a good shortterm prediction performance, a grey system prediction model for predicting priority is proposed.
Assume that a user has a request for a new message \({r}_{s}{\prime}\) from sensor s, where \({r}_{s}{\prime}\) is an earlier message than r_{s}. For predicting the priority of ev regarding \({r}_{s}{\prime}\), the priority sequence of ev regarding r_{s} can be quantified as \({mP}^{(0)}=(p\left({r}_{s},{t}_{1},ev\right),p\left({r}_{s},{t}_{2},ev\right),\dots ,p\left({r}_{s},{t}_{n},ev\right))\), and then, the grey system prediction model, which is donoted by p^{(1)}(r_{s},t_{k},ev), is used to estimate the predicted value \(p\left({r}_{s},{t}_{n+1},ev\right)\). The details of modeling can be found as follows.

Step 1. Accumulate the priority sequence \({mP}^{(0)}\) to obtain a new sequence, i.e. \({mP}^{(1)}=({p}^{(1)}\left({r}_{s},{t}_{1},ev\right),{p}^{(1)}\left({r}_{s},{t}_{2},ev\right),\dots ,\left({r}_{s},{t}_{n},ev\right))\). The accumulation formula can be expressed as

Step 2. Generate the adjacent difference sequence \(mZ=(z(1),z(2),\dots ,z(n1))\), where z(k) follows the below expression.

Step 3. Calculate the estimated values of \(\widehat{v}\), \({\widehat{c}}_{1}\), \({\widehat{c}}_{2}\), and \({\widehat{c}}_{3}\) according to the following formulae.
where aver is a function for calculating the average value, \(mC={\left(\begin{array}{ccc}{c}_{1}& {c}_{2}& {c}_{3}\end{array}\right)}^{\mathrm{^{\prime}}}\), and \(mA=\left(\begin{array}{ccc} e^{\hat{v}} & 1 & 1\\ e^{2\hat{v}} & 2 & 1\\ \vdots & \vdots & \vdots\\ e^{n\cdot \hat{v}} & n & 1\end{array}\right)\)Â Â

Step 4. Calculate the estimated value of p,^{(1)}(r_{s}t_{k},ev) by using the following prediction model.

Step 5. Restore the results of step 4.
where \({\widehat{p}}^{\left(0\right)}\left({r}_{s},{t}_{k+1},ev\right)\) is the predicted priority of ev regarding \({r}_{s}{\prime}\).
Algorithm for processing request messages
The priority adjustment of edge node is accompanied by the processing of user request messages by the edge node. According to the discussions of priority predicting, the process of request message processing algorithm based on a grey system prediction model includes the following essential steps. When receiving a user request message, the edge node updates the values of these metrics: message activity, user request probability, and query distance. If the request is a new request, it is necessary to predict the priority of the edge node regarding this request. Finally, the edge node refreshes the user request message and recalculates the priority corresponding to each request. The details can be found in Algorithm 1.
Lines 36 are the setting of measurements and the return of results to users when the edge node detect user request messages; lines 78 are the forwarding of request messages; lines 912 predict the priority of the edge node when dealing with new request messages; The 13th line recalculates the priority of the edge node after changes in these measurements.
In Algorithm 1, the edge node ev maintains operations on its content based on a content block statistics table, which consists of user request messages, sensor data messages, and three metrics related to optimization goals. The statistics table is an important data structure that supports the selection of target nodes. Assume the length of the statistical table is m, and the number of sensors related to the content is l. Let C_{req,s} denote a set of all content blocks with the same sensor identifier s as that of req, where the timestamps in the set are earlier than req. Let C_{req,s}=â€‰n. For the maintenance operation of the statistical table, the time complexity analysis is as follows. There are only two procedures, i.e., as GreyPre and priorityculating, involved in operating the statistical table. GreyPre includes the steps such as traversing C_{req,s}, sorting C_{req,s} in chronological order, and calculating according to formulas (8, 9, 10, 11, 12 and 13). The time complexity of GreyPre is O(nlog_{2}n). Similarly, priorityculating the time complexity of GreyPre is \(\text{O}\left(m+l\cdot n\cdot{log}_2n\right)\). In conclusion, the time complexity of Algorithm 1 is O(mlog_{2}n).
MCMF graph
Construction of MCMF graph
We mainly consider the performance parameters such as reducing network traffic, shortening user access latency, and improving the utilization of edge nodes. This section discusses the question that how to characterize the above parameters from a resource perspective and how to convert them into the assignment problem of graph capacity and cost.
For a given graph Gâ€‰=â€‰(V, DE, CA, CO), among them, V is a node set that represents entities in PEC, including the sensor S, the edge node EV, the user U, and the terminal node TV; DE is a directed edge set, which indicates whether a data forwarding task can be mapped to a corresponding entity; CA denotes a set of capacities on edge, identifying the entityâ€™s supply capacity; CO is a cost set that represents the mapping effect between sensor data forwarding tasks and entities.
Definition 1
For G, \(\exists s\in S\bigwedge {\exists v}_{i},{v}_{j}\in V\bigwedge {(v}_{i},{v}_{j})\in DE\), to analyze the flow in PEC, we let \(out(s,{v}_{i},{v}_{j})\) denote the flow of the edgeâ€‰<â€‰v_{i},v_{j}â€‰>â€‰with respect to s, which can be calculated as follows.

If \({v}_{i}\in EV,(s,{v}_{i})\in DE\), then \(out\left({r}_{s},s,{v}_{i}\right)=0\),

If \({v}_{i},{v}_{j}\in EV\), then \(out\left({r}_{s},{v}_{i},{v}_{j}\right)=1\),

If \({v}_{i}\in EV,{v}_{j}\in U\), then \(out\left({r}_{s},{v}_{i},{v}_{j}\right)=0\),

If \({v}_{i}\in U,{v}_{j}\in TV\), then \(out\left({r}_{s},{v}_{i},{v}_{j}\right)=0\).
Similarly, the flows ofâ€‰<â€‰v_{i},v_{j}â€‰>â€‰and G are expressed as \(out\left({v}_{i},{v}_{j}\right)=\sum_{s\in S}out({r}_{s},{v}_{i},{v}_{j})\) and \(out\left(G\right)=\sum_{{(v}_{i},{v}_{j})\in DE}out({r}_{s},{v}_{i},{v}_{j})\), respectively.
Definition 2
For G, \(\exists s\in S\bigwedge {\exists v}_{i},{v}_{j}\in V\bigwedge {(v}_{i},{v}_{j})\in DE\), the cost of the edgeâ€‰<â€‰v_{i},v_{j}â€‰>â€‰with respect to s, i.e. \(co(s,{v}_{i},{v}_{j})\), can be calculated as follows.

If \({v}_{i}\in EV,<s,{v}_{i}>\in DE\), then \(co\left({r}_{s},s,{v}_{i}\right)=0\),

If \({v}_{i},{v}_{j}\in EV\), then \(co\left(r_s,v_i,v_j\right)=w(v_j)\cdot\frac1{p\left(r_s,ev\right)}\). The cost of forwarding data from v_{i} to v_{j} is related to \(p\left({r}_{s},t,{v}_{j}\right)\) and \(w({v}_{j})\), in the paper, it is specifically expressed as \(w(v_j)\cdot\frac1{p\left(r_s,ev\right)}\),

If \({v}_{i}\in EV,{v}_{j}\in U\), then \(co\left({r}_{s},{v}_{i},{v}_{j}\right)=0\),

If \({v}_{i}\in U,{v}_{j}\in TV\), then \(co\left({r}_{s},{v}_{i},{v}_{j}\right)=0\).
In the same way, \(co\left({v}_{i},{v}_{j}\right)=\sum_{s\in S}co({r}_{s},{v}_{i},{v}_{j})\) and \(co\left(G\right)=\sum_{{(v}_{i},{v}_{j})\in DE}co\left({v}_{i},{v}_{j}\right)\) are the costs ofâ€‰<â€‰v_{i},v_{j}â€‰>â€‰and G.
Definition 3
For G, \({\exists v}_{i},{v}_{j}\in V\bigwedge {(v}_{i},{v}_{j})\in DE\), then \(ca\left({v}_{i},{v}_{j}\right)\) represents the capacity of the edgeâ€‰<â€‰v_{i},v_{j}â€‰>â€‰, which can be obtained by the following expressions.

If \(\exists s\in S\bigwedge {\exists v}_{i}\in EV\bigwedge (s,ev)\in DE\), then \(ca\left(s,{v}_{i}\right)=\infty\),

If \({ev}_{i},e{v}_{j}\in EV\), then \(ca\left({ev}_i,ev_j\right)=min(w({ev}_i)\cdot\sum_{\begin{array}{c}u\in U\\s\in S\end{array}}delay\left(u,s,{ev}_i\right),w({ev}_i)\cdot\sum_{\begin{array}{c}u\in U\\s\in S\end{array}}delay\left(u,s,{ev}_i\right))\),

If \({v}_{i}\in U\bigwedge {v}_{j}\in TV\), then \(ca\left({r}_{s},{v}_{i},{v}_{j}\right)=0\).
Solution of MCMF graph

(1) Formal description of problem solving
In this paper, one of our purposes is improving the overall performance of PEC. So we formulate the MCMF problem for graph G as follows.
As mentioned above, the node that satisfies the condition b(v_{j})â€‰>â€‰0, and b(v_{j})â€‰<â€‰0 is called a source node, and an aggregation node, respectively; the flow that satisfies \({\sum }_{v\in EV}b\left(v\right)=0\) is called a feasible flow. Under the premise of satisfying formulae (14, 15 and 16), we maintain the minimum cost, and iteratively search for the maximum flow until the optimization conditions are met.
In a PEC environment, there will be certain changes in PEC, such as the number of user requests, the access costs, the load capacity of edge nodes and the number of edge nodes. However, the structural changes in the graph associated with PEC are relatively small within every two adjacent time periods. Therefore, we propose an incremental MCMF algorithm based on BP. By caching and reusing the last solution, only local operations are required to obtain the global optimal solution of the graph.

(2) AlgorithmÂ forÂ solvingÂ MCMF graph
BP algorithm is messagetransmission algorithm based on factor graph model. By updating the information of nodes, BP algorithm updates the state of an entire network until the network stabilizes. The efficiency of message transmission plays a crucial role in BP algorithm. This section discusses the incremental MCMF algorithm based on BP, which reduces the network and computational costs and supports dynamic deployment by only sending the changed messages.
In a factor graph, there are two types of nodes: variable node x_{i} and constraint node f(a). Correspondingly, there are two types of messages on undirected edge (i,Î±) at time t, namely message m(i,a,x_{i},t) sent by x_{i} to f(a), and message g(a,i,x_{i},t) sent by f(a) to x_{i}. The message description based on increment is as follows.
where \(k\in N(i)\backslash a\) denotes the set of constraint nodes connected to x_{i} except for f(a), \(j\in N\left(a\right)\backslash i\) denotes the set of variable nodes connected to f(a) except for x_{i}, and let \(\Delta m(i,a,{x}_{i},0)=0,\Delta m(k,i,{x}_{i},0)=m(k,i,{x}_{i},0)\),\(g(a,i,{x}_{j},0)=0\).
For graph G, f denotes its minimum cost flow, and graph Gâ€™â€‰=â€‰(Vâ€™, DEâ€™, CAâ€™, COâ€™) denotes the graph after its local changes. By further optimizing the minimum cost flow f, the incremental minimum cost flow algorithm obtains the minimum cost flow f 'of graph G' according to the factor graph increments and the message increments. The details can be found in Algorithm 2.
Lines 23 generate the factor graphs and the minimum cost flow for the initial graph G; lines 48 detect the state change events, update the graph structure when events occur, and solve the updated graph; lines 1127 are the main body of the incremental minimum cost flow algorithm based on belief propagation, with the main idea of calculating the minimum cost eigenvalues while ensuring the maximum flow constraint; lines 3035 are incremental iteration operations, which specifically include the calculation of the factor graph increments and the message increments.
For BP algorithm, the schedule for updating messages is crucial to its convergence. In Algorithm 2, we address the question of how to schedule messages for asynchronous propagation to attempt to reach convergence. Procedure IncrementalMsgUpdating leverages a scheduling scheme that selects all incremental messages to update at a time. Additionally, an incremental update approach is introduced to accelerate the computation of message in Procedure BasicBPMCF.
Simulation and performance analysis
Experimental settings
PeerSim [31] is an event simulator for largescale distributed systems that supports P2P network architecture. To evaluate the performance of the proposed adaptive routing strategy, we conducted relevant simulation experiments on PeerSim.
The experiment use a cubeconnected cycle graph [32] with 4*2^{4}â€‰=â€‰64 nodes as the network topology structure. Each node in the graph denotes an edge node. Given that each edge node is connected to 10 sensors and 10 users, there are a total of 640 different sensors and 640 different users in the network. Each edge node can provide data generated by the connected sensor nodes to users, and the farthest location for a request message to receive a response is at the edge node connected to the corresponding sensor node.
The experimental parameters are set as follows. The bandwidth and latency between adjacent edge nodes are 1Â Mb/second and 1Â ms, respectively. A sensor generates a new message with a size of 10Â MB every 1Â s. The probability of users requesting different sensor messages is the same. And the probability of users requesting messages generated by the same sensor at different times follows Zipf distribution, where let \(C=\mathrm{1,0.8}\le \alpha \le 1.5\). Each user randomly requests 20 different sensor messages at the rate of 1 request/second. Each edge node caches 2048 sensor messages and can accommodate 500 request messages. In each experiment, we take 5 samples with an interval of 60Â s between each sampling. A total of 10 experiments were conducted, and the results were averaged.
According to the above settings, the total number of user request messages during the 5 sampling periods is tnrâ€‰=â€‰192000.
Performance metrics
By analyzing the formula (1, 2 and 3) involved in the optimization goals of the adaptive routing model, we can conclude that load(u,s) and delay(u,s,ev) are key factors that affect the performance of the system model. To evaluate the performance of different routing schemes, the following two performance evaluation metrics based on load(u,s) and delay(u,s,ev) are considered.

Average access latency, \(adelay=\frac1{tnr}\cdot\sum_{t\in T}delay\left(u,s,ev\right)\), which denotes the average delay spent from an user sending a request to receiving the corresponding sensor message.

Average edge node load, \(aload=\frac1{tnr}\cdot\sum\nolimits_{t\in T}load\left(u,s\right)\), which denotes the average number of times that edge nodes directly connected to sensors provide services to users.
Based on these indicators, we can analyze both the efficiency of caching services provided by target edge nodes in ARPEC and the effectiveness of target edge nodes in alleviating service pressure on edge nodes directly connected to sensors.
Performance testing & analysis

(1) Performance of request message processing algorithm
We adjust Zipf probability parameter Î± of request message to examine the performance trend of the request message processing algorithm. Because LCE, LCD, and Prob0.5 are three typical target node selection strategies that range from simple to complex, we compare the performance of ARPEC with that of LCE, LCD, and Prob0.5. The performance changes are shown in Fig.Â 3.
FigureÂ 3a and b show that there are certain differences of the strategies and ARPEC outperforms these compared strategies in the two metrics. This is because userâ€™s requests for highpriority edge nodes become more frequent as the parameter Î± increases. Due to the lack of sensitivity of LCE, LCD, and Prob0.5 to changes in message activity and user's requests, performance improvement is limited. As message activity increases, sensor messages in edge nodes become more concentrated. By increasing the priority of the corresponding edge nodes, ARPEC can cache sensor messages on the reasonable edge nodes.

(2) Performance of incremental MCMF algorithm
The experimental parameters are set as follows. First, by assigning a value greater than 1 to a, it indicates that users are more concerned about several sensors. On the contrary, the distribution of user requests is relatively uniform. So Î± reflects userâ€™s preference for sensor requests. Without loss of generality, let Î±â€‰=â€‰1. Second, in each sampling period, the number of nodes with changes is less than 12; and the change pattern of nodes follows a uniform distribution. In Fig.Â 4, the trends of the incremental BPbased MCMF algorithm in terms of performance measurements are examined by adjusting the number of changing nodes, and the results are compared with the BasicBPMCF algorithm.
The average access latency difference between the two strategies shown in Fig.Â 4a is not significant, which indicates that the solution results of the two strategies are basically consistent. However, as shown in Fig.Â 4b, the efficiency of the incremental MCMF algorithm has been greatly improved, with an edge node load of approximately 50% of that of BasicBPMCF. This indicates that the incremental MCMF algorithm reduces network costs. This is because the incremental MCMF algorithm saves time in solving the maximum flow. Meanwhile, because the data in the network does not change much, the MCMF in the previous stage may already be very close to the optimal flow in this stage, and only a small amount of incremental information needs to be processed to achieve the optimal feasible flow.
Analysis of ARPEC application scenarios
ARPEC uses a grey model to predict the priority of edge nodes. For cases where priority data samples change rapidly, the sample quality may not be particularly good and the response speed may not meet user requirements. We can improve sample quality by adjusting the length of the priority sequence. However, due to the unpredictable statistical characteristics of the incoming user requests and sensor data, GreyPre may adjust the sample length multiple times and results in higher latency. Therefore, ARPEC is not suitable for applications with significant instantaneous changes in IoT and high requirements for realtime computing.
The requirements for updating node information in ARPEC should be met. Users can set the frequency of updating node information. If the frequency is higher, the number of adjustments to the minimum cost flow will increase. Due to the limited resources of edge nodes, in the worst case, the adjustment of the minimum cost flow still cannot meet the user's requirements for network traffic. So, it is considered that ARPEC cannot provide support for MCMF at the given frequency of updating node information.
Conclusion
In this paper, we propose an adaptive routing strategy in PEC, which can adapt to the temporal dynamic characteristics of routing demands and supports dynamic deployment. In order to improve the user experience and give full play to the overall performance of Edge Cloud, a routing optimization model is described from the perspectives of network traffic, user access delay, and edge node resource utilization. We implement two algorithms, the processing request messages algorithm based on grey prediction model, and the incremental MCMF algorithm based on BP algorithm. The evaluation results show that ARPEC can effectively improve PEC transmission performance and user experience. In the future, our research will focus on the following two aspects: the optimization technology of target node parameters based on machine learning, and the merging and filtering mechanisms to reduce the complexity of solving graph.
Availability of data and materials
Not applicable.
References
Xu XL, Gu J, Yan HZ, Liu WT, Qi LY, Zhou XK (2023) Reputationaware supplier assessment for blockchainenabled supply chain in industry 4.0. IEEE Transact Industr Inform 19(4):5485â€“5494
Wang G, Li C, Huang Y, Wang X, Luo Y (2022) Smart contractbased caching and data transaction optimization in mobile edge computing. Knowl Based Syst. 252:109344
Yan HZ, Bilal M, Xu XL, Vimal S (2022) Edge server deployment for health monitoring with reinforcement learning in internet of medical things. IEEE Transact Comput Soc Syst. https://doi.org/10.1109/TCSS.2022.3161996
Janani T, Brindha M (2022) SEcure Similar Image Matching (SESIM): an improved privacy preserving image retrieval protocol over encrypted cloud database. IEEE Trans Multimedia 24:3794â€“3806
Xu XL, Liu ZJ, Bilal M, Vimal S, Song HB (2023) Computation offloading and service caching for intelligent transportation systems with digital twin. IEEE Trans Intell Transp Syst 23(11):20757â€“20772
Mara GC, Rathod U, Shreyas RRG, et al (2020) CRUPA: collusion resistant user revocable public auditing of shared data in cloud. J Cloud Comput 9(1). https://doi.org/10.1186/s13677020001885
Li Z, Xu XL, Hang T, Xiang HL, Cui Y, Qi LY, Zhou XK (2022) A knowledgedriven anomaly detection framework for social production system. IEEE Transact Comput Soc Syst https://doi.org/10.1109/TCSS.2022.3217790
Zhang Y, Yu H, Zhou W, Man M (2023) Application and research of IoT architecture for EndNetCloud Edge computing. Electronics 12(1):1. https://doi.org/10.3390/electronics12010001
Xu XL, Tang SZ, Qi LY, Zhou XK, Dai F, Dou WC (2023) CNN partitioning and offloading for vehicular Edge networks in Web3. IEEE Commun Mag 61(8):36â€“42
Karagiannis V, Schulte S (2021) edgeRouting: using compute nodes in proximity to route IoT data. IEEE Access 9:105841â€“105858
Dutta N, Patel SK, Faragallah OS, Baz M, Rashed ANZ (2022) Caching scheme for informationcentric networks with balanced content distribution. Int J Commun Syst 7:35
Fan C, Shannigrahi S, Papadopoulos C, Partridge C (2020) Discovering innetwork Caching Policies in NDN Networks from a Measurement Perspective. ICN â€™20: 7th ACM Conference on InformationCentric Networking. pp 106â€“116
Laoutaris N, Che H, Stavrakakis I (2006) The LCD interconnection of LRU caches and its analysis. Performance Evaluation 63(7):609â€“634
Laoutaiis N, Syntila S, Stavrakakis L (2004) Meta algorithms for hierarchical web caches. IEEE International Conference on Performance, Computing, and Communications. pp 445â€“452
Sellami Y, Jaber G, Lounis A (2022) Distributed Fogbased Caching Solution for ContentCentric Networking in IoT. 2022 IEEE 19th Annual Consumer Communications & Networking Conference (CCNC). pp 493â€“494
Serhane O, Yahyaoui K, Nour B, Moungla H (2021) Energyaware Cache Placement Scheme for IoTbased ICN Networks. ICC 2021IEEE International Conference on Communications. pp 1â€“6
Dhawan G, Mazumdar AP, Meena YK (2022) CNCP: A Candidate Node Selection for Cache Placement in ICNIoT. 2022 IEEE 6th Conference on Information and Communication Technology (CICT). pp 1â€“6
Baltagiannis N, Kapetanidou IA, Tsaoussidis V (2023) EFPCaching: Energyaware and Faulttolerant Probabilistic Caching of popular IoT content in ICN. NOMS 2023â€“2023 IEEE/IFIP Network Operations and Management Symposium. pp 1â€“4
Amadeo M, Campolo C, Ruggeri G, Molinaro A (2022) Beyond Edge Caching: freshness and popularity aware IoT data caching via NDN at internetscale. IEEE Trans Green Commun Netw 6(1):352â€“364
Tanted S, Agarwal A, Mitra S, Bahuman C, Ramamritham K (2020) Database and caching support for adaptive visualization of large sensor data. Proceedings of the 7th ACM IKDD CoDS and 25th COMAD. pp 98â€“106
Li Z, Xu XL, Cao XF, Liu WT, Zhang YW, Chen DH, Dai HP (2022) Integrated CNN and federated learning for COVID19 detection on chest xray images. IEEE/ACM Trans Comput Biol Bioinf. https://doi.org/10.1109/TCBB.2022.3184319
Majidi A, Gao X, Zhu S, Jahanbakhsh N, Chen G (2019) Adaptive routing reconfigurations to minimize flow cost in SDNbased data center networks. International Conference on Parallel Processing. pp 1â€“10
Norah SBS, Mohammed JFA (2020) Utilizing SDN to Deliver Maximum TCP Flow for Data Centers. Proceedings of the 3rd International Conference on Information Science and Systems (ICISSâ€™20). pp 181â€“187
Li X, Tang F, Zhu Y, Fu L, Yu J, Chen L, Liu J (2022) Processingwhiletransmitting: costminimized transmission in SDNbased STINs. IEEE/ACM Trans Netw 30(1):243â€“256
Sun Y, Rehfeldt D, Brazil M, Thomas D, Halgamuge S (2020) A physaruminspired algorithm for minimumcost relay node placement in wireless sensor networks. IEEE/ACM Trans Networking 28(2):681â€“694
Palmieri FAN, Pattipati KR, Gennaro GD, Fioretti G, Verolla F, Buonanno A (2022) A unifying view of estimation and control using belief propagation with application to path planning. IEEE Access 10:15193â€“15216
Badiu MA, Saad D, Coon JP (2021) Selforganization scheme for balanced routing in largescale multihop networks. J. Phys A Math Theor 54:045001
Kai CH, Liew SC (2012) Applications of belief propagation in CSMA wireless networks. IEEE/ACM Trans Netw 20(4):1276â€“1289
Ghafoor H, Koo I (2017) Softwaredefined networkingbased cognitive routing protocol for vehicular ad hoc networks. 2017 International Conference on Circuits, System and Simulation (ICCSS). pp 162â€“166
Kakkasageri MS, Sataraddi MJ, Chanal PM, Kori GS (2017) BDI agent based routing scheme in VANETs. 2017 International Conference on Wireless Communications, Signal Processing and Networking (WiSPNET). pp 129â€“133
Xie RC, Wang ZY, Yu FR, Huang T, Liu YJ (2021) A novel identity resolution system design based on DualChord algorithm for industrial Internet of Things. Sci China Inf Sci 64(8):182301
Han ZJ, Fu YY, Du XX (2022) Embedding CubeConnected Cycles into Grid Network for Minimum Wirelength. EEE/WIC/ACM International Conference on Web Intelligence and Intelligent Agent Technology (WIIATâ€™21). pp 461â€“465
Acknowledgements
We sincerely thank the editors and reviewers for their valuable comments on this paper.
Funding
This work was supported by the industrial big data application technology project of excellent scientific and technological innovation teams in universities in Jiangsu Province, China.
Author information
Authors and Affiliations
Contributions
B.D. and JH. C. wrote the main manuscript text and all authors reviewed the manuscript.
Corresponding author
Ethics declarations
Ethics approval and consent to participate
Not applicable.
Competing interests
The authors declare no competing interests.
Additional information
Publisherâ€™s Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.
About this article
Cite this article
Dong, B., Chen, J. An adaptive routing strategy in P2Pbased Edge Cloud. J Cloud Comp 13, 13 (2024). https://doi.org/10.1186/s1367702300581w
Received:
Accepted:
Published:
DOI: https://doi.org/10.1186/s1367702300581w