# JSSTR: A Joint Server Selection and Traffic Routing Algorithm for the Software-Defined Data Center
## 5 Joint Server Selection and Traffic Routing Algorithm  
### Design Principle  
As explained before, the joint server selection and traffic routing problem belongs to the NP-hard problems. Hence, by improving the SFLA, a heuristic algorithm is developed to solve the joint server selection and traffic routing problem. The proposed JSSTR algorithm is designed based on the improved SFLA. Unlike the original SFLA, the improved SFLA contains two kinds of frogs, one population, several groups and several memeplexes. The definitions of the two kinds of frogs, population, group and memeplex are given as follows. * server frog: In the proposed JSTR algorithm, the switch that connects to servers is called the edge switch. Based on that, two kinds of frogs are defined and used in JSTR: server frog and switch frog. A server frog is composed of the user, the destination server and the routing path between that user and server. * switch frog: A switch frog is composed of the user, the corresponding edge switch and the routing path between the user and the edge switch. * population: All server frogs form a population. * group: A group is generated for each edge switch. All server frogs, the destination servers of which connect to the same edge switch, are recorded as a group. * memeplex: All server frogs in a group are divided into several memeplexes. As mentioned in Section 2, two of the main steps of SFLA are shuffling and dividing memeplexes. In the original SFLA algorithm, when dividing frogs into different memeplexes, a performance value of each frog will be calculated. Then all frogs will be divided into several memeplexes one by one in order of decreasing performance value. Note that a user request causes different workloads on the network and server. It mainly uses the bandwidth resource of links, while it uses CPU, memory and disk resource of servers. Therefore, when serving a user request, the changes of the performance value of links and servers are different. Meanwhile, in the joint server selection and traffic routing problem, a server frog is composed of the routing path and server. Hence, in the same group, if a server frog has the best performance value, the routing path and server of that server frog should have the best performance value. Therefore, in this work, in order to more quickly find the server frog that has the best performance value, we designed two kinds of frogs: (1) server frog and (2) switch frog. These two frogs are used in shuffling and dividing the steps of SFLA. Taking advantage of the switch frog, the proposed JSTR method will more quickly find an optimal server frog using the following strategy. When shuffling memeplexes, the switch frogs firstly extracted from the server frogs. Then, the performance value of all switch frogs are calculated. Subsequently, these switch frogs are mixed and re-divided into several memeplexes one by one in order of decreasing performance value. Afterwards, the server and the link between that server and the corresponding edge switch are added to each switch frog in order of decreasing performance value to form the new server frogs. An example of that is given in this paragraph. In Figure 3, assume that four server frogs of Group 2 are server frog 1: u5-sw2-sw3-s5, server frog 2: u5-sw2-sw5-sw3-s6, server frog 3: u5-sw2-sw3-s7, and server frog 4: u5-sw2-sw1-sw4-sw3-s8. According to its definition, the corresponding switch frogsextracted from these four server frogsare switch frog 1: u5-sw2-sw3, switch frog 2: u5-sw2-sw5-sw3, switch frog 3: u5-sw2-sw3 and switch frog 4: u5-sw2-sw1-sw4-sw3. Consider such a scenario: before shuffling and dividing frogs, the server frog 2 has the maximum performance value, while switch frog 1 and switch frog 4 (u5-sw2-sw3) have the maximum performance value and the server s6 and its connected link have the maximum performance value. That scenario is possible because the performance values of links and servers are independent, as discussed above.