Optimizing Data Center Dynamic network traffic allocation by improved genetic algorithm

Source: Internet
Author: User

Background knowledge

Often for large data center networks (Networks, or DCN), each server is used very differently, and the average usage is almost nonexistent, and most of the situation is that 70% of usage and traffic requirements are concentrated on a small subset of servers, This is also the problem of building a cloud computing hub through a LAN network.

Is the hotspot used by data center servers in most cases:

Can be seen, in fact, most of the resources are relatively vacant, so to make the data center has a higher computational efficiency, it is conceivable that the other relatively vacant servers to use or their network traffic as far as possible to allocate to higher-use servers.

The standard for measuring the efficiency and optimization of a data center is primarily the network throughput per unit of time (throughput). So what can you do to improve your network throughput and improve the efficiency of your data center?

method to improve the comparison of a

Add wireless network, most of the current data center is the use of wired network LAN mode, in the original wired network to add a wireless network, can be used to alleviate the data transmission server imbalance caused by the transmission delay, data congestion and other problems. You can also minimize the reliance of the wired network on the Stand (Rack).

Improved two

On the basis of improving one, because the wireless network is required network IP address allocation, and the number of IP addresses is limited, so how to dynamically allocate IP address is a need to solve the problem, and the improvement of two is mainly through the improvement of genetic algorithm, the current most suitable IP allocation method, This makes the overall network throughput the most.

Introduction to Genetic algorithms

Genetic algorithm is to imitate the nature of the biological reproduction process, the whole process as a three parts:

1. Selection: Select individual

2. Crossover: Cross-breeding

3. Mutation: Mutation

In short, is the repeated calculation of the above three steps, select a fitness calculation function, when the fitness to achieve optimal, is the optimal state of the algorithm. The specific introduction of the online there are many, I mainly talk about some of the characteristics of the algorithm and how to improve it can be very good for the dynamic network.

Algorithm features

1. The algorithm is similar to neural network algorithms, which are unsupervised or semi-supervised algorithms, so it is possible to have different results in the process of calculation, even if the input data is the same.

2. The algorithm takes into account a number of variations, so even if there is a characteristic of 1, it does not prevent it from becoming a more realistic simulation algorithm.

Algorithm improvements

In the dynamic network, the analogy of the biological reproduction process, there are several concepts: server, server group, data center. Each server group is composed of several servers, so we analogy to biological reproduction, can equate the server with a DNA, a server group is equivalent to an individual person, and the data center is an overall environment.

And when we are in a wireless network, we can regroup different servers into a server group, analogous to a new individual being spawned. That is, through the crossover can be bred out of a new generation, the new generation by a number of new "individual" composition.

The generation generated by each iteration needs to calculate his fitness condition to determine whether it is the optimal state. In fact, the problem of how IP is distributed in the wireless network.

The reference [1] can be viewed in detail on the basis of some inherent conditions of the limited network and the limitations of the wireless network to derive the display of fitness computational functions and iterative processes.

Code explanation

First, write a class to generate analog numbers, mainly random numbers to derive the network usage of the simulated data center, assuming a total of 8 times 8, 64 server groups (Rack), each Rack can use up to 20 servers simultaneously, More than 15 are used to indicate that the rack is a high-utilization node.

Two simulations of the situation

One is the extreme situation is that 95% of the usage is on 10 hot rack, the other is closer to the normal situation, 70% of the utilization rate is on 20 hot rack.

Situation One:

/* Generate matrix of M1, 95% channels from racks*/void simulation::generatem1 (int i) {int m1[8][8]={0};int X_sum=0;sran D ((unsigned) time (NULL)), for (int j=0;j<10;j++) {int select = rand ()%64;int M,n;m=floor ((Double) (select)/8); n= Select%8;int channel = rand ()%5;int x=16+channel;if (m1[m][n]==0) {m1[m][n]=x;x_sum + = X;}} int Total=ceil (double) x_sum/0.95), int rest=total-x_sum;int count_rest=rest;while (count_rest!=0) {int r=rand ()%64; int M,n;m=floor ((double) (r)/8); N=r%8;if (m1[m][n]==0) {m1[m][n]=1;--count_rest;}} char* filepath= "M1_.txt";//cout<<filepath<<endl;ofstream Outfile;outfile.open (Filepath,ios::app); if ( !outfile) {cerr<< "Open error!" <<endl;exit (1);} outfile<<endl;for (int p=0;p<8;p++) {for (int q=0;q<8;q++) {outfile<<m1[p][q]<< "";} Outfile<<endl;} Outfile.close (); ga* ga=new GA (M1); Ga->select (ga->parent); Ga->crossover (ga->pairs); Ga->mutation ( Ga->children); while (Ga->check (ga->parent) ==0) {Ga->select (GA->parent); Ga->crossover (ga->pairs); ga->mutation (Ga->children);} Outputmutation_probability=ga->mutaion_probability;fitness1 +=ga->max_fitness;generation_count_1 +=ga- >gen;delete GA;}


         case two:

/* Generate Matric of M2, 70% chanels from racks*/void simulation::generatem2 (int i) {int m1[8][8]={0};int X_sum=0;srand ((unsigned) time (NULL)), for (int j=0;j<20;j++) {int select = rand ()%64;int M,n;m=floor ((Double) (select)/8); N=select %8;int channel = rand ()%5;int x=16+channel;if (m1[m][n]==0) {m1[m][n]=x;x_sum + = X;}} int Total=ceil (double) x_sum/0.75), int rest=total-x_sum;int count_rest=rest;while (count_rest>0) {int R=rand ()%64 ; int M,n;m=floor ((double) (r)/8); N=r%8;int channel = rand ()%5+1;if (m1[m][n]==0) {m1[m][n]=channel;count_rest-=c Hannel;}} char* filepath= "M2_.txt";//cout<<filepath<<endl;ofstream Outfile;outfile.open (Filepath,ios::app); if ( !outfile) {cerr<< "Open error!" <<endl;exit (1);} outfile<<endl;for (int p=0;p<8;p++) {for (int q=0;q<8;q++) {outfile<<m1[p][q]<< "";} Outfile<<endl;} Outfile.close (); ga* ga=new GA (M1); Ga->select (ga->parent); Ga->crossover (ga->pairs); Ga->mutation ( Ga->children); while (ga->cHeck (ga->parent) ==0) {ga->select (ga->parent); Ga->crossover (ga->pairs); Ga->mutation (ga-> children);} Output Mutation_probability=ga->mutaion_probability;fitness2 +=ga->max_fitness;generation_count_2 +=ga- >gen;delete GA;}

An improved genetic algorithm

1. constructor: Initialize the data

2. ga::select (Generation Generate): A random 221 pair of all individuals in each Generation, get a lot of

3. Ga::crossover (vector<pair> pairs): For all pairs, a single point of intersection, generating a number of individuals, all of the individual to form a descendant

4. ga::mutation (Generation Children): mutation of each individual of a descendant is the change in the weight (individual) of the server in each weight according to a specific probability

5. Ga::check (Generation Generate): Calculates their fitness for each individual in a newly generated descendant, selects the largest one, as a follow-up to continue to generate the next generation of judging criteria

6. ga::fitness (Individual individual): A method for calculating the fitness of each individual

The implementation can be downloaded in the download to see, I will not all post out.

Resources

[1] "Dynamic scheduling for Wireless Data Center Networks" Yong Cui, Member, IEEE, Hongyi Wang, Xiuzhen Cheng, Senior Member , IEEE, Dan Li, Member, IEEE, and Antti Yla¨-ja¨a¨ski

Resources download

Implementing code Downloads

Reprint Please specify the Source: http://blog.csdn.net/luoyun614/article/details/42610561

Optimizing Data Center Dynamic network traffic allocation by improved genetic algorithm

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.