# QoSComm: A Data Flow Allocation Strategy among SDN-Based Data Centers for IoT Big Data Analytics
## 3 QoS Comm: Design and Implementation
### Path Selection  
Problem Formalization  
In a typical communication network topology, there is \(n\) number of paths for a transmission from the same source and destination (end-to-end path) [25]; this is represented in Equation (1):  
\[P^{s,d}=\{p_{1},p_{2},\ldots p_{n}\} \tag{1}\]  
where:  
\(s\) = Source node,  
\(d\) = Destination node,  
\(P\) = Set of paths from source node \(s\) to destination node \(d\),  
\(p\) = End-to-end path, \(p\in P^{s,d},p_{n}=\{l_{1},l_{2},\ldots l_{n}\}\),  
\(l\) = Network links for each node in the end-to-end path  
Each path has different network parameters' values. These network parameters serve as metrics to get path network conditions. The metrics that are considered for applications that require intensive use of the communications network are delay \((D(p))\), jitter \((J(p))\), packet loss \((PLR(p))\), and transmission speed \((B(p))\); with these parameters, we can provide network QoS. In addition, the cost or distance metric of the link \((Cost(p))\) is considered; these network conditions for each path are represented in Equation (2):  
\[p_{n}=[Cost(p_{n}),D(p_{n}),J(p_{n}),PLR(p_{n}),B(p_{n})] \tag{2}\]  
The default routing algorithm selects network paths taking into account the cost or distance between network nodes, which are the metrics used by the SDN controller to select the shortest route \((\widetilde{p})\). It is represented in Equation (3) as the minimum cost value among the \(n\) possible paths:  
\[\widetilde{p}=[min(Cost(P^{s,d}))] \tag{3}\]  
The traditional routing algorithm does not consider the additional parameters that provide network conditions. For some applications, the set of these parameters should be considered in the path selection process to improve network performance instead of just considering the shortest path (default method). The path with better network conditions \((\widehat{p_{n}})\) is the path with best metric values among all paths as represented in Equation (4):  
\[\widehat{p_{n}}=[\widehat{D}(p_{n}),\widehat{I}(p_{n}),\widehat{PLR}(p_{n}), \widehat{B}(p_{n})] \tag{4}\]  
The shortest path in Equation (3) is not always the path with the best metrics in one or more network parameters. We identified a path with better metrics conditions with a \(\widehat{(})\) symbol. It must have the minimum value of each of the corresponding end-to-end parameters such as delay, jitter, and packet loss among the \(n\) paths, represented in Equations (5)-(7), except the bandwidth, which we defined as the maximum available bandwidth among the \(n\) paths, and is represented in Equation (8). The QoS parameters such as delay and jitter have an additive metric composition rule for the end-to-end path. For the bandwidth parameter, it has a concave metric composition where the end-to-end paths \((p_{n})\) were selected considering the minimum capacity bandwidth of the network links \((l_{n})\) that rules the maximum bandwidth for the corresponding \((p_{n})\). For the scope of our research, we used these criteria for end-to-end path calculation based on QoS constraints:  
\[\widehat{D(p_{n})} =[min(D(P^{s,d}))], \tag{5}\] \[\widehat{(p_{n})} =[min(J(P^{s,d}))],\] (6) \[PL\widehat{R(p_{n})} =[min(PLR(P^{s,d}))], \tag{7}\]\[\widehat{B(p_{n})}=[max(B(P^{s,d}))], \tag{8}\]  
where:  
\(D(p_{n})\) = Path delay,  
\(J(p_{n})\) = Path jitter,  
\(PLR(p_{n})\) = Path packet loss,  
\(B(p_{n})\) = Path available bandwidth  
The network provides the connection service to the set of applications clients, where each application has its network requirements to ensure optimal performance.