Smooth Transition Process of Sleep Mechanism Based on SDN Framework

. Green network uses sleep mechanism for energy-saving design, achieving sleep mechanism needs to consider that the mechanism may cause data loss, network performance degradation and other situations. In the traditional network, sleep mechanism requires protocol and equipment support, it is complex and low economic benefit. Due to the use of hierarchical and centralized control, software-defined network(SDN) can easily achieve a variety of network applications. The paper realizes the smooth transition process of sleep mechanism of link based on SDN framework. The results show that the design ensures the performance and normal operation of the network while realizing dormancy.


Introduction
With continuous development of the network, more and more network equipment access to the network, resulting in a huge energy consumption [1] , more and more attention has been paid to green network, and that how to reduce energy consumption is also an important consideration in network design. At present, the management of energy in the network is divided into two categories: sleep mechanism(SM) and link rate adaptive mechanism(LRAM) [2] . SM leaves the low load in sleep mode, so that energy consumption of them can be negligible, LRAM can dynamic adjust the rate of link according to network load. Compared to SM, in realization of LRAM, it needs to design complex protocol or update devices and it will bring huge economic costs [3] , so in energy management, SM is widely used.
The traditional network has problems of closed structure, difficult expansion and difficult to deploy new application [4] , although SM is easier to implement than LRAM in traditional network, SM is still limited to the structure. After 30 years of rapid development, many new network architectures are proposed, Software Defined Network(SDN) is one of those [5] . In traditional network, control plane and forwarding plane are centralized on one devices; SDN separates the control plane and the forwarding plane, all devices are controlled by the centralized controller [6][7] . As with the traditional network, SDN also concerns network energy consumption and SM is also used by SDN to achieve energy management. SM may changes the topology of network and would affect data forwarding, that how to deal with SM has significant effect on result of SM. If design of SM is unreasonable, SM can cause a sudden decline in network performance and may eventually affect the normal operation of the network.

Preliminary
In 2009，professor Mckeown formally put forward the concept of SDN. Using the hierarchical idea, SDN separates the control plane and data plane of the switch network, moves the control functions to the controller and provides the application programming interface to the upper layer, the control plane can get the details of running status of the underlying network devices by OpenFlow [8] protocol. By abstracting the Layer 2 forwarding and Layer 3 routing table mechanism as flow tables, the control plane can control the forwarding layer by issuing rules to forwarding layer, at the same time, control plane provides interfaces to application plane to operate network devices and that gives the application plane good platform.
SM is a kind of energy management technology which is often used in green network. In traditional SM, component state is just divided into working and sleeping state, the energy consumption of working state is the rated energy consumption, and the energy consumption of sleeping state is 0. With continuous development of SM, as paper[9,10] describes, SM also can be divided in to different stages including deep sleep, light sleep and other stages. This paper choses the traditional SM to design smooth transition process of sleep state based on SDN framework.

Analysis
SM is used to achieve energy management and green network, however, SM should not have adverse effects on network normal operation and performance, it needs a algorithm to realize the smooth transition process of sleep state based on SDN framework to put components into sleep.  Fig 1, the network is SDN network, A, B and C are switches those support OpenFlow protocol. As can be seen, link A-C is ready to be put into sleep state to save energy. Though link A-C has low load, link A-C may still have data stream; in port 2 and port 5, much data may still be in the queue waiting for forwarding, meanwhile, data is likely to be forwarding according to the original routing rules which are calculated by the left topology in Fig 1. If link A-C is put into sleep state in sudden, much data will lose and can not reach the destination node. So it is very important to design the process of sleep to prevent the occurrence of packet loss and network performance degradation.
Accompanied by the transition from the left to the right of the network topology in Fig 1, link A-C changes its state from working to sleep. To ensure the smooth transition process, the data packets that are forwarded according to the original routing rules in the topology have been forwarded completely and a mechanism is needed to be able to guarantee this process.
In SDN network, the underlying devices forward data according to flow tables issued by controller, the controller control underlying network by issuing routing rules in form of flow tables [11] . Structure of a flow table is shown in Fig 2, it consists of header, counters and actions. header field has many match fields, data can match the fields with IP, destination address, MAC address and etc [12] . After a data packet reaches a switch, the data will match flow table's match fields, if data matches one of the match fields, the data will perform actions following the actions filed of the flow table.

Header
Counters Actions A switch has many flow tables, each flow table has its own priority and data packets match with flow table in order of priority from large to small [13] . The process is shown in

Algorithm
To ensure the smooth transition process of sleep state, the key is that the sleep process need to wait some tome to ensure the data packets that are forwarded according to the original routing rules in the topology have been forwarded completely. As Fig 1 shows, transition from left to right topology must wait some time. As shown in Fig 4, in left topology, if a data packet needs to be transferred from B to C, it go through A, however, if link A-C is dormant, the packet has to be transferred for B to C directly. The process will be analyzed in detail to explain how the left topology wait some time to leave link A-C sleep, at same time, it will give the algorithm that achieve smooth transition process of sleep state based on SDN framework. As shown in Fig 5, to meet the demand that data packets need to transfer from B to C and would go through A, A has four flow table, namely A1, B1, C1 and D1 and their priority order is A1, B1, C1, D1.
When the network need to put link A-C into sleep mode, link A-C is still at work and will wait some time. As shown in Fig 6, link A-C prepare to sleep, but it not immediately sleep. Assume the minimum priority of flow tables is P min , the SDN controller set the flow tables A1, B1, C1, D1 the priority P min -3, P min -2, P min -1, P min , and it also need to record the number of flow tables it has operated N f . New priority order will make the newly coming data packets match new flow tables while guaranteeing that old packet data can be forwarded. Because that the link A-C will sleep, data packets that transfer from B to C have to be forwarded to C directly, the SDN controller computes the new routing rules and issue new flow tables to A and B. With the new flow tables, new coming data packets from B to C will be transferred from B to C directory, meanwhile, the old data packets transferred from B to C before link A-C need to sleep still use path B-A-C. So as can be seen from Fig 6, there are two paths that can forward data packets from B to C. The new flow tables and new priority order make it possible that all data packets can be forwarded. We know that link A-C will sleep finally and flow tables including A1, B1, C1, D1, E1, F1, G1 and H1 will be useless, it is necessary to know if there is any old data that match the old table. If no old data packet match the old table, the table can be deleted by controller. As Fig 2 shows, any flow table has counters, the counters can record how many data packets the flow table has matched. So the SDN controller can scan switches whose flow tables has been degraded the priority, in each switch, the controller will scan N f flow tables according to the priority from small to large. The controller may scan once a minute, if counters of a flow table did not change between the two times, the controller will delete the flow table and N f of the switch needs to minus one. Until each N f is zero, the SM process finishes, the resulted topology can be seen in Fig 7 and smooth transition process of sleep mechanism based on SDN framework has achieved.

Software environment
The experiment was done in a simulated SDN environment and simulated SDN environment is composed of floodlight [14] and mininet [15] . Floodlight is a popular SDN controller, it can control the SDN network flexibly, mininet is a lightweight software defined network system platform, while providing support for the OpenFlow protocol, it can simulate the real environment of the SDN network.
Procedure of experiment: (1)Setting up a topology in simulated SDN environment randomly as Fig 8 shows, bandwidth of each link is shown in Table 1.

Result
As left o from s2 to section 3.

Conclus
Sleep m energy sav decline in mechanism it has been SDN frame

Future w
As a S time-consu apply the controller,