Summary of the invention
The shortcoming of prior art in view of the above, the object of the present invention is to provide a kind of SDN active and standby controller seamless handover method based on NAT technology, the technology of similar NAT TCP load balancing is adopted to realize unique cluster virtual address, even if active and standby controller switches, unique cluster virtual address also can not change, because switch sets up TCP by unique cluster virtual address with controller cluster to be connected, therefore switch is without the need to the switching of perception active and standby controller, thus it is seamless and switch fast to realize active and standby controller.
For achieving the above object and other relevant objects, the invention provides a kind of SDN active and standby controller seamless handover method based on NAT technology, between SDN active and standby controller, the data format of control channel comprises active message, EB packet and sync message; The active message of SDN controller and EB packet adopt same message format; SDN controller be synchronously divided into real-time synchronization and cycle synchronisation; Described real-time synchronization is increment synchronization, and described cycle synchronisation is the synchronous of full database; Router must be shown by configuration NAT, and set up the mapping relations of virtual address to controller real ip address one-to-many, SDN switch and virtual address are set up TCP and be connected; Definition backup controller is to the process behavior of Openflow message.
According to the above-mentioned SDN active and standby controller seamless handover method based on NAT technology, wherein: described active message is two-way, for confirming that the connection with the other side is connected time delay with measurement; Described EB packet is two-way, for carrying the IP address information of sender; Described sync message is sent to backup controller by master controller, when the database of master controller changes, for upgrading the data-base content of backup controller.
According to the above-mentioned SDN active and standby controller seamless handover method based on NAT technology, wherein: the active message of described SDN controller and the form of EB packet include sequence number and two, IP address field, 32bits is total to.
Further, according to the above-mentioned SDN active and standby controller seamless handover method based on NAT technology, wherein: described sequence number is 16bits, initial value is 1, if when the value of described sequence number is more than 65535, will again calculate from 1; The node IP of described IP address field recording controller, for the election of master controller.
According to the above-mentioned SDN active and standby controller seamless handover method based on NAT technology, wherein: SDN controller flow process that is active and election comprises the following steps:
Step S21, active message timer expiry;
Step S22, judge whether to receive response; If so, step S23 is proceeded to; If not, step S27 is proceeded to;
Step S23, by cumulative for the sequence number of response message 1, send opposite end, compare peer IP address and local ip address;
Step S24, judge whether peer IP address is less than local ip address, if so, proceeds to step S25; If not, step S26 is proceeded to;
Step S25, judge whether local controller is master controller, and if so, local mode of operation changes backup controller into, and flow process terminates; If not, do not perform any operation, flow process terminates;
Step S26, judge whether local controller is backup controller, and if so, local mode of operation changes master controller into, and flow process terminates; If not, do not perform any operation, flow process terminates;
Step S27, judge whether number of retransmissions is greater than number of retransmissions threshold value, if so, local mode of operation is set to master controller, and flow process terminates; If not, the sequence number of response message is constant, and send opposite end, flow process terminates.
According to the above-mentioned SDN active and standby controller seamless handover method based on NAT technology, wherein: the factor that described real-time synchronization produces comprises statistical information change, composer change, north orientation application change and the change of OF message.
According to the above-mentioned SDN active and standby controller seamless handover method based on NAT technology, wherein: in SDN controller sync message handling process, after master controller database receives real-time synchronization and cycle synchronisation request, send sync message to backup controller database, be consistent to make the two.
According to the above-mentioned SDN active and standby controller seamless handover method based on NAT technology, wherein: when router is forwarded to all controllers the OF message of switch, virtual object IP address is replaced with the controller IP address of reality; When router is forwarded to switch the OF message of controller, replace actual controller IP with virtual source IP address.
According to the above-mentioned SDN active and standby controller seamless handover method based on NAT technology, wherein: only have master controller just can to outgoing OF message.
As mentioned above, the SDN active and standby controller seamless handover method based on NAT technology of the present invention, has following beneficial effect:
(1) NAT technology is combined, have employed mechanism that is real-time and periodic synchronization active and standby controller database, when master controller breaks down time, such as power down, system exception etc., when switch unaware, the seamless switching of active and standby controller can be accomplished, improves controller robustness largely;
(2) because backup controller can the data of real-time synchronization master controller, when master controller breaks down time without the need to derived data again to backup controller;
(3) technology of similar NAT TCP load balancing is adopted to realize unique cluster virtual address, even if master controller switches, unique cluster virtual address also can not change, because switch sets up TCP by unique cluster virtual address with controller cluster to be connected, therefore switch is without the need to the switching of perception active and standby controller.
Embodiment
Below by way of specific instantiation, embodiments of the present invention are described, those skilled in the art the content disclosed by this specification can understand other advantages of the present invention and effect easily.The present invention can also be implemented or be applied by embodiments different in addition, and the every details in this specification also can based on different viewpoints and application, carries out various modification or change not deviating under spirit of the present invention.
It should be noted that, the diagram provided in the present embodiment only illustrates basic conception of the present invention in a schematic way, then only the assembly relevant with the present invention is shown in graphic but not component count, shape and size when implementing according to reality is drawn, it is actual when implementing, and the kenel of each assembly, quantity and ratio can be a kind of change arbitrarily, and its assembly layout kenel also may be more complicated.
SDN active and standby controller seamless handover method based on NAT technology of the present invention comprises following content:
(1) between SDN active and standby controller, the data format of control channel comprises active message, EB packet and sync message.Wherein, active message, by sending response (echo) and obtaining responding (reply), confirms that the connection with the other side is no problem, also can be used to measure connect time delay.EB packet carries the IP address information of sender.
Various data format is defined as follows shown in table 1.
The data format definition table of control channel between table 1, SDN active and standby controller
(2) the active message of SDN controller and EB packet adopt same message format.The active message of SDN controller and the form of EB packet as shown in Figure 1, comprise sequence number and two, IP address field, altogether 32bits.Wherein, sequence number is 16bits, and initial value is 1, if value is more than 65535, will again calculate from 1.IP address field have recorded the node IP of controller, for the election of master controller.
The Activity determination of SDN controller supports Retransmission timeout mechanism.Number of retransmissions default value is 3 times, and time-out time default value is 1 second.User can revise number of retransmissions and time-out time according to actual conditions.Control in the middle of cluster at SDN, IP address minimum and active controller will become master controller.
As shown in Figure 2, SDN controller of the present invention flow process that is active and election comprises the following steps:
Step S21, active message timer expiry (time-out time default value is 1s);
Step S22, judge whether to receive response; If so, step S23 is proceeded to; If not, step S27 is proceeded to;
Step S23, the sequence number cumulative 1 of (echo) message will be replied, and send opposite end, compare peer IP address and local ip address;
Step S24, judge whether peer IP address is less than local ip address, if so, proceeds to step S25; If not, step S26 is proceeded to;
Step S25, judge whether local controller is master controller, and if so, local mode of operation changes backup controller into, and flow process terminates; If not, do not perform any operation, flow process terminates;
Step S26, judge whether local controller is backup controller, and if so, local mode of operation changes master controller into, and flow process terminates; If not, do not perform any operation, flow process terminates;
Step S27, judge whether number of retransmissions is greater than number of retransmissions threshold value (as default value 3), and if so, local mode of operation is set to master controller, and flow process terminates; If not, the sequence number of echo message is constant, and send opposite end, flow process terminates.
(3) SDN controller be synchronously divided into real-time synchronization and cycle synchronisation.Real-time synchronization is increment synchronization, and cycle synchronisation is the synchronous of full database.
Wherein, cause real-time synchronization because have following 4 points: statistical information change, composer change, north orientation application change and OF message change.With reference in Fig. 3, SDN controller sync message handling process, after master controller database receives real-time synchronization and cycle synchronisation request, send sync message to backup controller database, be consistent to make the two.
(4) router must be shown by configuration NAT, sets up the mapping relations of virtual address to controller real ip address one-to-many.SDN switch and virtual address are set up TCP and are connected, need not the controller IP address of perception reality.
Wherein, NAT tableau format and sample as shown in table 3 below.
Table 3, NAT show
In order to ensure the consistency of database, the OF message that active and standby controller all needs processing switch to send over.It is to be noted that router needs the OF message of switch to be forwarded to all controllers, replace virtual object IP address with the controller IP address of reality.Equally, router also needs the OF message of controller to be forwarded to switch, replaces actual controller IP with virtual source IP address.
With reference to Fig. 4, the flow process of SDN controller OF message sink of the present invention process comprises the following steps:
Step S41, router must be shown by configuration NAT, set up the mapping relations of virtual address to controller real ip address one-to-many.
Step S42, switch are set up TCP with unique cluster virtual address and are connected.
Step S43, router receive the OF message of switch, inquire about NAT table with object IP.
Step S44, judge whether controller IP matches with object IP; If so, replace virtual IP address with the controller IP of coupling and OF message is sent to corresponding controller, controller process OF message, proceeds to step S45; If not, step S45 is proceeded to.
Step S45, judge whether the coupling of object IP terminates, and if so, flow process terminates; If not, step S43 is proceeded to.
With reference to Fig. 5, the flow process of SDN controller OF message transmission processing of the present invention comprises the following steps:
Step S51, router must be shown by configuration NAT, set up the mapping relations of virtual address to controller real ip address one-to-many.
Step S52, switch are set up TCP with unique cluster virtual address and are connected.
Step S53, router receive the OF message of controller, inquire about NAT table with source IP.
Step S54, judge whether source IP matches with virtual IP address, if so, replace source IP with the virtual IP address of coupling and OF message is sent to corresponding switch that switch processes OF message and generate stream table proceeds to step S55; If not, step S55 is proceeded to.
Step S55, judge whether the coupling of source IP terminates, and if so, flow process terminates; If not, step S53 is proceeded to.
It should be noted that to only have master controller just can to outgoing OF message.
(5) backup controller is defined to the process behavior of Openflow message, as shown in table 2 below.
Table 2, backup controller OF Message Processing table
As shown in Figure 6, when carrying out SDN active and standby controller switch test in the switching of the SDN active and standby controller based on NAT technology simulation test environment of the present invention, comprise the following steps:
A, build simulation test environment as shown in Figure 6;
B, controller 1 power-off;
C, guarantee SDN forward face normally work;
D, user manage SDN by controller 2, as revised and delete previous stream table data by controller 2.
By above-mentioned test, the switching without the need to switch perception active and standby controller can be reached, the technique effect that active and standby controller is seamless and switch fast can be realized.
In sum, SDN active and standby controller seamless handover method based on NAT technology of the present invention combines NAT technology, have employed mechanism that is real-time and periodic synchronization active and standby controller database, when master controller breaks down time, such as power down, system exceptions etc., can when switch unaware, accomplish the seamless switching of active and standby controller, improve controller robustness largely; Because backup controller can the data of real-time synchronization master controller, when master controller breaks down time without the need to derived data again to backup controller; The technology of similar NAT TCP load balancing is adopted to realize unique cluster virtual address, even if master controller switches, unique cluster virtual address also can not change, because switch sets up TCP by unique cluster virtual address with controller cluster to be connected, therefore switch is without the need to the active-standby switch of sensing controller.So the present invention effectively overcomes various shortcoming of the prior art and tool high industrial utilization.
Above-described embodiment is illustrative principle of the present invention and effect thereof only, but not for limiting the present invention.Any person skilled in the art scholar all without prejudice under spirit of the present invention and category, can modify above-described embodiment or changes.Therefore, such as have in art usually know the knowledgeable do not depart from complete under disclosed spirit and technological thought all equivalence modify or change, must be contained by claim of the present invention.