# QoSComm: A Data Flow Allocation Strategy among SDN-Based Data Centers for IoT Big Data Analytics
## 3 QoS Comm: Design and Implementation
### Path Selection
This set of applications is represented in Equation (9), and their requirements in Equation (10):  
\[A=[\widehat{a_{1}},\widehat{a_{2}},\widehat{a_{3}},\ldots,\widehat{a_{n}}] \tag{9}\]  
\[\widehat{a_{n}}=[D(\widehat{a_{n}}),J(\widehat{a_{n}}),PLR(\widehat{a_{n}}),B( \widehat{a_{n}})] \tag{10}\]  
where:  
\(A\) = _Application set_,  
\(\widehat{a}\) = _Application optimal performance requirements_,  
\(D(\widehat{a_{n}})\) = _Delay application requirement_,  
\(J(\widehat{a_{n}})\) = _Jitter application requirement_,  
\(PLR(\widehat{a_{n}})\) = _Packet loss application requirement_,  
\(B(\widehat{a_{n}})\) = _Bandwidth application requirement_  
In Equations (11)-(13), each metric has a maximum tolerable limit required by the application. In Equation (14), the application requires a minimum bandwidth limit rate. Each network parameter must comply with applications requirements:  
\[p_{n}=[Cost(p_{n}),D(p_{n}),J(p_{n}),PLR(p_{n}),B(p_{n})] \tag{2}\]0 \[p_{n}=[Cost(p_{n}),D(p_{n}),J(p_{n}),PLR(p_{n}),B(p_{n})] \tag{2}\]1 (12) \[p_{n}=[Cost(p_{n}),D(p_{n}),J(p_{n}),PLR(p_{n}),B(p_{n})] \tag{2}\]2 (13) \[p_{n}=[Cost(p_{n}),D(p_{n}),J(p_{n}),PLR(p_{n}),B(p_{n})] \tag{2}\]3  
Considering the set of network parameters for each application requirement, as described in Equations (11)-(14), in order to resolve the multi-objective problem, we used the epsilon-constraint (\(\epsilon\)-constraint) method [26] for path selection and data flow forwarding. We define the following objective function, represented in Equations (15)-(17):  
\[p_{n}=[Cost(p_{n}),D(p_{n}),J(p_{n}),PLR(p_{n}),B(p_{n})] \tag{2}\]4  
\[p_{n}=[Cost(p_{n}),D(p_{n}),J(p_{n}),PLR(p_{n}),B(p_{n})] \tag{2}\]5  
\(s.t:\)  
\[f(x)= \begin{cases}\widehat{D(p_{n})}\leq D(\widehat{a_{n}})\\ \widehat{J(p_{n})}\leq J(\widehat{a_{n}})\\ \underline{PLR(p_{n})}\leq PLR(\widehat{a_{n}})\\ \widehat{B(a_{n})}\leq B(\widehat{p_{n}})\end{cases}  \tag{17}\]  
The goal of the exact epsilon-constraint method is to minimize one objective and to restrict the rest of the objectives to a value of \(\epsilon\). Equations (18) and (19), represents the general function:  
\[min=f_{j}(x) \tag{18}\]\(s.t:\)  
\[f_{i}(x)\leq\epsilon_{i}\;i=1,2,3,\ldots,M,i\
eq j \tag{19}\]  
In our scenario, as it considers an inter-domain data flow forwarding approach that will be used only by the applications that require QoS, the epsilon-restricted multi-objective method was used to get the set of feasible paths, considering application requirements as objectives' restrictions [27; 28]. We propose to use the delay parameter as the most important objective subjecting it to the restrictions of the other objectives (end-to-end jitter, packet loss and available bandwidth). From the set of feasible paths, we minimize the delay to get the optimal path when packet loss, jitter, and available bandwidth are less than or equal to require by the application, as is represented in Equations (20) and (21):  
\[min=\widehat{D(p_{n})} \tag{20}\]  
\(s.t:\)  
\[ \begin{cases}\widehat{J(p_{n})}\leq J(\widehat{a_{n}})\\ \widehat{PLR(p_{n})}\leq\mathit{PLR}(\widehat{a_{n}})\\ \widehat{B(a_{n})}\leq B(\widehat{p_{n}})\end{cases}  \tag{21}\]  
In our model, before submitting a job to compute nodes, in that instant time, QoSComm gets network parameters querying to the SDN controller of each data center and the mathematical process calculates the feasible paths, according to application requirements. In the case of not finding a feasible path, QoSComm requires the SDN controller to forward the data flow using its default method. This process is shown in Figure 2.  
Once QoSComm calculated the feasible paths and obtained the optimal path, its communication process configures and allocates data flow rules in the network switches for the QoS-based optimal path before BDA scheduler dispatch job to compute nodes in distributed data centers. Both operations, practically, do not delay application job submission process to compute nodes.