# SDN-Based Routing Framework for Elephant and Mice Flows Using Unsupervised Machine Learning
## 3 Proposed Methodology
### SDN-Based Application Architecture  
The conceptual graph shown in Figure 2 displays the proposed framework for elephant and mice flow identification and selection of the best paths to route them. The processes of the framework are based on specifying the appropriate parameters and integrating the unsupervised ML and the SDN environment. The proposed framework contains four blocks, which are clarified into four categories: (i) the data center network (DCN) topology, which is responsible for the deployment of the proposed DCN topologies; (ii) the SDN controller, which is the block that facilitates the communication between the blocks (i) and (iii) by using an OpenFlow protocol as a southbound interface and RESTfull API as a northbound interface; (iii) the external application, which is the block that implements the proposed flow routing mechanism; and (iv) traffic analysis, which is responsible for storing flows and their paths and visualizing the record.  
Figure 1: Proposed Methodology.  
In this study, the Mininet emulator [33, 34] was used to implement the proposed method. The SDN was deployed utilizing the SDN-Ryu controller [35]. The SDN application was designed for flow routing optimization that depends on a statistical analysis of network performance. The characterization of the flows based on the network performance metrics was achieved by employing unsupervised ML.  
Principal component analysis (PCA) is a linear technique that was used in the proposed framework to reduce the dimensionality of the dataset employed. By converting correlated features to uncorrelated features, the dataset is reduced from a high-dimensional space to a low-dimensional space. To cluster the flows based on their own features of network performance, K-means was used as a second unsupervised ML technique. Afterward, flow identification is executed as a second stage of the proposed application. This stage consists of the process that is responsible for determining the type of flows (elephant or mice) based on the thresholds of the pre-defined parameters (flow duration, packet count, and average packet size) and a sampling operation to obtain representative flows for each cluster. The procedure is applied to each cluster that has resulted from the clustering operation.  
The final stage includes selection of the best path for each type of flow. By using a developed routing algorithm, the best path selection is achieved for each representative flow. The developed algorithm was built based on two algorithms, which are the shortest-path Dijkstra algorithm [36] and the widest-path Dijkstra algorithm [37]. They were chosen to find the links that fulfill the conditions related to the types of flow previously identified.  
The developed Dijkstra algorithms were employed to find the paths with appropriate bandwidth and latency. The last part of the proposed design is the traffic analysis. In this part, the flows with their paths are stored and visualized.  
The next section covers the implementation of the proposed framework by running a group of proposed algorithms.