# Performance Analysis of Latency-Aware Data Management in Industrial IoT Networks +
## 4 The Data Management Layer
As we have already shown in [17], the proxy selection problem is computationally intractable, since it can be formulated as an integer program. This means that it is impossible to calculate in polynomial time the minimum proxies needed optimally while staying below \(L_{\max}\). Differently from [17], in this case, the formulation of the problem considers the latency of communication \(L_{u,p}\), and not an abstract number of hops. This makes it more realistic for industrial environments, but an even more difficult problem, as it becomes also infeasible to assign the real values to \(L_{u,p}\) of Constraints (3). This is due to the fact that we are not able to know the exact values of the individual transmission latencies \(l_{u,p}\), before they happen. To address this issue, we introduce the ProxySelection+ algorithm (Algorithm 1), which takes into account latencies \(L_{u,p}\), instead of the number of hops. ProxySelection+ is a myopic algorithm, which does not give the optimal solution. The use of simple heuristics like the one in ProxySelection+ shows that the DML is able to outperform the traditional centralized methods, even when adopting simple methods. ProxySelection+ sets the controller \(C\) as the first proxy of the network, and it gradually increases the number of proxies (counter) until it reaches a number with which the average access latency \(\overline{L}\) does not violate the maximum latency threshold \(L_{\max}\). In every iteration (Lines 5-9), the exact selection of the next proxy in the network is performed using a myopic greedy addition (Lines 6-8). Each candidate node is examined, and the one whose addition to the current solution reduces the average access latency the most is added to the incumbent solution. To this end, the latency between a candidate proxy (\(k\) in Line 7) and a consumer (\(u\) in Line 7) is estimated as the length of the shortest path \(\mathbf{D}_{k,u}\) that is connecting them multiplied by the expected latency on each hop (\(l^{(h)}\) in Line 7). \(l^{(h)}\) needs to be initiated through preliminary measurements. This happens through an initialization phase (Line 1) during which the network designer measures different single-hop data transmission latencies within the industrial installation and gathers a sufficiently representative dataset of \(l_{u,v}\) measurements from different pairs of nodes \(u,v\in S\) across the network. By using the mean of measured latencies, we obtain a guarantee on the average mean latency. By using the highest measured value, we obtain a constraint on the average worst-case latency, implementing the guarantee explained in Section 3. The computational complexity of ProxySelection+ is polynomial with a worst case time of \(\mathcal{O}(V^{4})\). However, this worst-case performance is very difficult to experience in practice, since in order to have \(\mathcal{O}(V^{4})\) time, all \(n\) nodes of the network have to be chosen as proxies; something that is highly unlikely. ```
Input :\(S,S_{c},r_{u},L_{\max}\)
1\(l^{(h)}\leftarrow\) assign value through initialization phase at the industrial installation \(\mathbf{D}_{u,v}=\text{Dijkstra}(S,r_{u})\), \(\forall u,v\in S\)[30] \(P=\{C\}\) \(\text{counter}=1\) while\(\text{counter}<n\)and\(\overline{L}>L_{max}\)do for\(i=2:\text{counter}\)do \(p=\operatorname*{arg\,min}_{v\in S}\sum_{u\in S_{c}}\min_{k\in P\cup\{v\}} \frac{l^{(h)}\cdot\mathbf{D}_{k,u}}{m}\) \(P=P\cup\{p\}\) \(\text{counter}++\) Output :\(P\)
```  
**Algorithm 1**ProxySelection+.