# Dynamic Traffic Scheduling and Congestion Control across Data Centers Based on SDN
## 3 The Design and Implementation of DSCSD
### Congestion Control with Multilevel Feedback Queue  
As part of DSCSD, dynamic traffic scheduling has an obvious effect on the classification and diversion of flow. However, when malicious flows exist, congestion also might occur in the shortest path link due to the long-term occupation of limited link resources and the burst of network instantaneous traffic. The algorithm of congestion control with multilevel feedback queues not only provides a queuing service for congested flows, but also settles the problem of vicious prolonged occupation. The specific description is shown as follows. In the initial phase of the scheme, we define two multilevel feedback queues to store the flows waiting to be scheduled. One is the multilevel feedback queue of low priority and the other is the multilevel feedback queue of high priority. Then, in each feedback queue, we define three sub-queues, and give the highest priority to flow waiting queue 1, the second highest priority to flow waiting queue 2, and the lowest priority to flow waiting queue 3. As is shown in Figure 3, the transmission time of these flow waiting queues are different after being scheduled. Sub-queue 1 has the time t, sub-queue 2 has the time 2t that is twice the time of sub-queue 1, and sub-queue 3 has the time 3t that is triple the time of sub-queue 1. For the pseudo codes of the algorithm, see Algorithm 1. ```
0:\(G\): topology of data center network; \(F_{active}\): set of active flows; \(F_{suspend}\): set of suspended flows; \(F_{tnew}\): a new flow; \(F_{first}\): a flow from the first of the \(F_{suspend}\). Output: {!e-state, e.path>}: scheduling state and path selection of each flow in G. When a new flow arrives
1 if (e.path = IDLEPATH) then
2 if (e.path = IDLEPATH) then
3\(F_{suspend}\)\(\leftarrow\)\(F_{suspend}\);
4
5 while\(F_{suspend}\)\(\leftarrow\)\(F_{suspend}\)\(+\)\(F_{tnew}\);
5 while\(\left(F_{suspend}\
eq\varnothing\right)\)do
6 if (e.path = IDLEPATH) then
7 if (e.path = IDLEPATH) then
8 if (e.path = IDLEPATH) then
9 if (e.path = IDLEPATH) then
10 if (e.path = IDLEPATH) then
11\(F_{suspend}\)\(\leftarrow\)\(F_{suspend}\);
12\(F_{suspend}\)\(\leftarrow\)\(F_{suspend}\);
13\(F_{suspend}\)\(\leftarrow\

## 4 Experiment Results and Performance Analysis

The SDN controller selected in our scheme is a free open source Floodlight that runs in the eclipse environment on the Ubuntu system. The virtual switch uses open source Open vSwitch 2.3.0. The virtual network was created by Mininet in Ubuntu 14.04. We implemented DSCSD on top of the Floodlight v1.2 controller in our simulation experiments. Floodlight is a free source, and modules can be randomly added and deleted, so that it provides much more convenience for our test. In our experimental setup, the virtual switch was created by Open vSwitch. The Floodlight was chosen as the SDN controller. We added two modules named initflowtable and trafficmanage on Floodlight. The module initflowable was used to initialize the variable with a value and install some flow tables of preprocessing. The main function of our scheme was the module trafficmanage that could monitor the Packet-in messages and the Flow-removed messages of the OpenFlow protocol and recode the installed flow tables as well as link information including congestion and bandwidth. When a new flow arrives or a flow needs to be scheduled, the module trafficmanage can achieve accurate and real-time detection and control. As shown in Figure 4, we used several virtual hosts to simulate three data centers; h1 and h2 were the servers of two individual data centers; c1, c2, c3, c4, and c5 were collectively used as another data center. Certainly, we should assign virtual IP addresses and MAC addresses for them. We also used the flows from any one of h1 and h2 to any one of c1, c2, c3, c4, and c5 to simulate the interconnected flows among the data centers. In accordance with the system model in Figure 2, the path (S1, S4, S5) was the shortest path leaving (S1, S2, S3, S4) the second shortest.