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 ofly provides the method and system of backup for software defined network controller, the SDN network across multiple regions cannot be tackled for solving prior art Single Controller, Single Controller cannot be solved in reliability, autgmentability, the poor problem of aspect of performance.
For achieving the above object and other relevant objects, one aspect of the present invention provides a kind of and provides the method for backup for software defined network controller, be applied in the network system that comprises switch and multiple controllers, said method comprising the steps of: step 1, in the starting stage, multiple controllers are defined as to candidate's master controller, between described multiple candidate's master controllers, send first protocol massages with priority attribute; Step 2, respectively this candidate's master controller receives described the first protocol massages, extracts the priority of described the first protocol massages according to the priority attribute of described the first protocol massages; Step 3, compares the priority of described the first protocol massages extracting and the each priority of this candidate's master controller self, and whether the priority that detects each this candidate's master controller self is higher than the priority of described the first protocol massages; Step 4, if the priority of described candidate's main controller self higher than the priority of described the first protocol massages, defining described candidate's master controller is master controller, residue candidate master controller is backup controller; Step 5, described master controller sends second protocol message to switch; Step 6, described master controller sends respectively described the first protocol massages to each backup controller in the first Preset Time; Step 7, whether judgement respectively this backup controller receives described the first protocol massages in the second Preset Time section; If so, extract message priority, whether the priority that judges described backup controller self is higher than the priority of described the first protocol massages; If the priority of described backup controller self is higher than the priority of described the first protocol massages, defining described backup controller is master controller, returns to step 5; If the priority of described backup controller self, lower than the priority of described the first protocol massages, is returned to step 6; If not, defining described alternative master controller is master controller, returns to step 5.
Alternatively, describedly for providing the method for backup, software defined network controller also comprises: if the priority of described candidate's main controller self is not higher than the priority of described the first protocol massages, described candidate's master controller is defined as to backup controller, and described backup controller is placed in and waits for the state that receives described the first protocol massages, proceed to step 7.
Alternatively, describedly for software defined network controller provides in the method for backup, the priority of described the first protocol massages extracting and the each priority of this candidate's master controller self are compared, whether the priority that detects each this candidate's master controller self is equivalent to and judges whether the IP address of described Virtual Controller overlaps with the IP address of candidate's master controller in described multiple candidate's master controllers higher than the step of the priority of described the first protocol massages; If overlap, represent that the candidate's master controller overlapping with the IP address of described Virtual Controller has limit priority, described candidate's master controller with limit priority is master controller, residue candidate master controller is backup controller, and described master controller sends described the first protocol massages in described the first Preset Time section described backup controller.
Alternatively, the priority limit of described the first protocol massages is between 0~255, and limit priority is 255.
Alternatively, describedly for providing the method for backup, software defined network also comprises: when described candidate's master controller is defined as master controller, described master controller sends second protocol message to described switch, and described switch generates the IP address of recording described Virtual Controller and the mapping table that receives the port numbers of the inbound port of described second protocol message.
Alternatively, in the time that in described the second Preset Time section, described multiple backup controllers do not receive described the first protocol massages, represent that described master controller breaks down, described multiple backup controller declaration oneself is master controller, re-elects and produce new master controller in multiple backup controllers; The new described master controller producing sends second protocol message to described switch, and described switch upgrades described mapping table.
Alternatively, described the first protocol massages is virtual router redundancy protocol message, and described second protocol message is address analysis protocol message.
The present invention also provides on the other hand a kind of and provides the system of backup for software defined network controller, comprise: multiple controllers, described multiple controller comprises: sending module, for in the time that multiple controllers are defined as candidate's master controller by the starting stage, between described multiple candidate's master controllers, send first protocol massages with priority attribute; And described sending module is also for sending second protocol message to switch; Receiver module, for receiving the first protocol massages that respectively this candidate's master controller sends; Extraction module, for receiving after described the first protocol massages, extracts respectively the priority of described the first protocol massages according to the priority attribute of described the first protocol massages; Comparison module, for the priority of described the first protocol massages extracting and the each priority of this candidate's master controller self are compared, whether the priority that detects each this candidate's master controller self is higher than the priority of described the first protocol massages; If, defining described candidate's master controller is master controller, residue candidate master controller is backup controller, call described sending module and in the first Preset Time section, send second protocol message to described switch, and in the first Preset Time section, send respectively described the first protocol massages to each backup controller; If not, defining described candidate's master controller is backup controller, and described backup controller is placed in to the state that receives described the first protocol massages of waiting for; Judge module, for judging respectively whether this backup controller receives described the first protocol massages in the second Preset Time section, if, call described extraction module and comparison module and extract respectively the first protocol massages priority, whether the priority that detects described backup controller self is higher than the priority of described the first protocol massages, if so, defining described backup controller is master controller, and calls described sending module transmission second protocol message to described switch; If not, call described sending module and in described the first Preset Time section, send respectively described the first protocol massages to each backup controller; If not, defining described backup controller is master controller, calls described sending module and sends second protocol message to described switch.
Alternatively, describedly for providing the system of backup, software defined network controller also comprises virtual module, the Virtual Controller of described virtual module for being made up of described multiple controllers according to the first agreement is described multiple controllers and described Virtual Controller pre-configured IP address and priority.
Alternatively, whether described comparison module also overlaps with the IP address of candidate's master controller of described multiple candidate's master controllers for the IP address that judges described Virtual Controller, if overlap, represent that the candidate's master controller overlapping with the IP address of described Virtual Controller has limit priority, described candidate's master controller with limit priority is master controller, residue candidate master controller is backup controller, and described master controller sends the first protocol massages in a Preset Time section described backup controller.
As mentioned above, of the present invention for software defined network controller provides the method and system of backup, there is following beneficial effect:
The present invention is by arranging the IP address of Virtual Controller of VRRP controller group, switch is without the IP address of all controllers of perception, only need the virtual ip address of Virtual Controller described in perception, switch is without linking up with each controller, master controller meeting active and switch in VRRP controller group go to set up contact, and then switch only can be mutual with master controller.The invention solves the problem of reliability, autgmentability and the aspect of performance of single-point controller, increased the reliability of network, realized Single Controller and can tackle the SDN network across multiple regions, and realized the transmeridional expansion of multiple SDN controllers.
Embodiment
Below, by specific instantiation explanation embodiments of the present invention, those skilled in the art can understand other advantages of the present invention and effect easily by the disclosed content of this specification.The present invention can also be implemented or be applied by other different embodiment, and the every details in this specification also can be based on different viewpoints and application, carries out various modifications or change not deviating under spirit of the present invention.It should be noted that, in the situation that not conflicting, the feature in following examples and embodiment can combine mutually.
It should be noted that, the diagram providing in following examples only illustrates basic conception of the present invention in a schematic way, then in diagram, only show with assembly relevant in the present invention but not component count, shape and size drafting while implementing according to reality, when its actual enforcement, kenel, quantity and the ratio of each assembly can be a kind of random change, and its assembly layout kenel also may be more complicated.
Of the present inventionly provide the know-why of method and system of backup as follows for software defined network controller:
In SDN environment, datum plane separates with control plane, is connected as the switch of datum plane and the controller of control plane, is responsible to define forwarding strategy and is come the switch of guide data plane by controller.The present invention sets up a Virtual Controller by VRRP agreement, is referred to as a backup group.The responsibility of Virtual Controller can be dynamically distributed on certain concrete controller by VRRP, this virtual controller has oneself IP address, and (this IP address can be identical with the address of certain controller in backup group, identical be called IP owner), backup controller also has the IP address of oneself.Switch is only known the IP address of this Virtual Controller, and and does not know the IP address of master controller and backup controller.If the master controller of backup group breaks down, the controller of backup will elect a new master controller, and continuing provides service to switch.In VRRP controller group, according to priority elect master controller, the scope of VRRP agreement medium priority is 0-255, if the interface IP address of the IP address of VRRP controller and Virtual Controller is identical, this VRRP controller is called as the owner of this IP address, and the IP address owner has limit priority: 255.Configurable priority limit is 0-254.For candidate's controller of equal priority, according to the election of IP address size order.VRRP also provides priority preemptive policy, if the high priority of configuration, just the backup router of high priority could be deprived the master control controller of current low priority and become new master control controller.Only have master control controller can process the message from switch, and remove to control switch, backup controller is also processed the message from switch, but can not remove to control switch.Backup controller also can be accepted the VRRP message of master controller, and the priority of oneself contrast, if priority ratio oneself is low, oneself becomes master controller from backup controller.Meanwhile, backup controller and master controller can synchronization message carry out the synchronous of exchanger information and stream table, when become master control controller from backup controller, can know the state that current switch is up-to-date.
Embodiment mono-
The present embodiment provides a kind of and provides the method for backup for software defined network controller, be applied in the network system that comprises switch and multiple controllers, refer to Fig. 1, be shown as the flow chart that the method for backup is provided for software defined network controller, describedly comprise for software defined network controller provides the method for backup:
S1, in the starting stage, initialization comprises the network system of switch and multiple controllers, described multiple controllers are defined as to candidate's master controller, between described multiple candidate's master controller, send first protocol massages with priority attribute, and according to the first agreement, described multiple controllers are bundled and create a Virtual Controller, be described multiple controllers and described Virtual Controller pre-configured IP address and priority.Described the first protocol massages is Virtual Router Redundancy Protocol (VRRP) message.Wherein, described Virtual Controller is also referred to as controller backup group.
S2, described respectively this candidate's master controller receives described the first protocol massages that other candidate's master controllers send, and extracts the priority of described the first protocol massages according to the priority attribute of described the first protocol massages.The priority limit of described the first protocol massages is between 0~255, and limit priority is 255, and the scope of other configurable priority is 0-254.
S3, described multiple candidate's master controller compares the priority of described the first protocol massages extracting and the each priority of this candidate's master controller self respectively, and whether the priority that detects each this candidate's master controller self is higher than the priority of described the first protocol massages; If so, perform step S4; If not, perform step S7.In described step S3, the priority of described the first protocol massages extracting and the each priority of this candidate's master controller self are compared, whether the priority that detects each this candidate's master controller self is equivalent to and judges whether the IP address of described Virtual Controller overlaps with the IP address of candidate's master controller in described multiple candidate's master controllers higher than the step of the priority of described the first protocol massages, if overlap, perform step S4; If do not overlap, perform step S5.
S4, through priority ratio after, candidate's master controller the highest priority is defined as to master controller, represent that the candidate's master controller overlapping with the IP address of described Virtual Controller has limit priority, described candidate's master controller with limit priority is master controller, and residue candidate master controller is backup controller.
S5, described master controller sends second protocol message to described switch, and described switch generates the IP address of recording described Virtual Controller and the mapping table that receives the port numbers of the inbound port of described second protocol message.Described second protocol message is address resolution protocol (ARP) message.Wherein the message source IP of second protocol message is the IP address of described Virtual Controller, and the IP address of controller itself is used for VRRP broadcast, and described switch is the IP address of sensing controller not.When described switch is received second protocol message, can send the 3rd protocol massages based on OPEN FLOW agreement to controller according to the described mapping table generating, and proceed to step S8.
S6, described master controller sends described the first protocol massages to respectively in the first Preset Time each backup controller of mentioning in step S4.
S7, after priority, the priority of candidate's master controller self is not defined as to backup controller higher than candidate's master controller of the first protocol massages priority, and described backup controller is placed in and waits for the state that receives described the first protocol massages, and proceed to step S8.
S8, whether judgement respectively this backup controller receives described the first protocol massages in the second Preset Time section, if not, performs step S5; If so, perform step S9.In the present embodiment, this step S8 is in order to prevent that the phenomenon breaking down from appearring in the controller that is defined as master controller.In the time that in described the second Preset Time section, described multiple backup controllers do not receive described the first protocol massages, represent that described master controller breaks down, described multiple backup controller declaration oneself is master controller, re-elects and produce new master controller in multiple backup controllers; The new described master controller producing sends second protocol message to described switch, and described switch upgrades described mapping table.
S9, extracts the priority of described the first protocol massages according to the priority attribute of described the first protocol massages, and whether the priority that judges described backup controller self is higher than the priority of described the first protocol massages, if so, performs step S10; If not, represent through priority ratio after, if the priority of described backup controller self is lower than the priority of described the first protocol massages, return to step S6.
S10, through priority ratio after, if the priority of described backup controller self is higher than the priority of described the first protocol massages, backup controller higher priority is defined as to master controller, return to step S5;
What provide at the present embodiment also comprises in the time that in described another Preset Time section, described multiple backup controllers do not receive described the first protocol massages for software defined network controller provides in the method for backup, represent that described master controller breaks down, described multiple backup controller declaration oneself is master controller, in multiple backup controllers, re-elect, produce new master controller; The new master controller producing sends second protocol message to described switch, and described switch upgrades described mapping table.
The method that provides backup for software defined network controller described in the present embodiment is by arranging the IP address of Virtual Controller of VRRP controller group, switch is without the IP address of all controllers of perception, only need the virtual ip address of Virtual Controller described in perception, switch is without linking up with each controller, master controller meeting active and switch in VRRP controller group go to set up contact, and then switch only can be mutual with master controller.The invention solves the problem of reliability, autgmentability and the aspect of performance of single-point controller, increased the reliability of network, realized Single Controller and can tackle the SDN network across multiple hell, and realized the transmeridional expansion of multiple SDN controllers.
Embodiment bis-
The present embodiment provides a kind of and provides the system 1 of backup for software defined network controller, refer to Fig. 2, be shown as the entity structure diagram that the system of backup is provided for software defined network controller, describedly comprise multiple controllers 11, multiple switch 12 for software defined network controller provides the system 1 of backup, wherein described multiple controllers 11 are bundled and create a Virtual Controller 13.Described multiple controller 11 comprises master controller and backup controller.
Refer to Fig. 3, be shown as the system middle controller principle assumption diagram that backup is provided for software defined network controller, described multiple controllers 11 comprise virtual module 110, sending module 111, receiver module 112, extraction module 113, comparison module 114 and judge module 115.
Wherein, described sending module 111, in the time that multiple controllers are defined as candidate's master controller by the starting stage, sends the first protocol massages to controller described in other 11, i.e. candidate's master controller described in other, and described the first protocol massages has priority attribute.Described the first protocol massages is Virtual Router Redundancy Protocol (VRRP) message.Sending the first protocol massages to before other controllers 11, described virtual module 110 bundles described multiple controllers to create a Virtual Controller 13 according to the first agreement, is described multiple controllers 11 and described Virtual Controller 13 pre-configured IP address and priority.Wherein, described Virtual Controller 13 is also referred to as controller backup group.
The receiver module 112 being connected with described sending module 111 is for receiving other controllers 11, the first protocol massages that respectively this candidate's master controller sends.
The extraction module 113 being connected with described receiver module 112, for receiving after described the first protocol massages, extracts respectively the priority of described the first protocol massages according to the priority attribute of described the first protocol massages.The priority limit of described the first protocol massages is between 0~255, and limit priority is 255, and the scope of other configurable priority is 0-254.
The comparison module 114 being connected with described extraction module 113 is for comparing the priority of described the first protocol massages extracting and the each priority of this candidate's master controller self, and whether the priority that detects controller 11 (respectively this candidate's master controller) self is higher than the priority of described the first protocol massages; If so, defining the controller 11 that priority is the highest (candidate's master controller that priority is the highest) is master controller, and residue controller 11 (residue candidate master controller) is backup controller; If not, the priority that defines candidate's master controller self is not backup controller higher than candidate's master controller (controller 11) of the first protocol massages priority, and described backup controller is placed in to the state that receives described the first protocol massages of waiting for.Described comparison module 114 comprises timer A, and described timer A is used for starting described the first Preset Time section.Described comparison module 114 compares the priority of the priority of described the first protocol massages extracting and controller self, detect the respectively priority of this candidate's master controller self and whether judge higher than being functionally equivalent to of priority of described the first protocol massages whether the IP address of described Virtual Controller overlaps with the IP address of candidate's master controller in described multiple candidate's master controllers, if overlap, represent that the candidate's master controller overlapping with the IP address of described Virtual Controller has limit priority, described candidate's master controller with limit priority is master controller, residue candidate master controller is backup controller, described master controller sends the first protocol massages in a Preset Time section described backup controller, if do not overlap, definition priority is not backup controller higher than the controller 11 of the first protocol massages priority, and these controllers 11 are placed in to the state that receives described the first protocol massages of waiting for.
In the present embodiment, through priority ratio after, described sending module 111 is also for being sent to second protocol message described switch 12.Described switch 12 is for generating the IP address of recording described Virtual Controller 13 and the mapping table that receives the port numbers of the inbound port of described second protocol message.Described second protocol message is address resolution protocol (ARP) message.Wherein the message source IP of second protocol message is the IP address of described Virtual Controller 13, and the IP address of controller itself is used for VRRP broadcast, and described switch is the IP address of sensing controller not.When described switch 12 is received second protocol message, can send the 3rd protocol massages based on OPEN FLOW agreement to controller 11 according to the described mapping table generating.And described sending module 111 also for sending respectively described the first protocol massages to each backup controller in described the first Preset Time section.
The judge module 115 being connected with described comparison module 114 is for judging whether multiple backup controllers receive described the first protocol massages in the second Preset Time section, if not, continue to call described sending module 111, second protocol message is sent to described switch 12 by described sending module 111.Described switch 12 is for generating the IP address of recording described Virtual Controller 13 and the mapping table that receives the port numbers of the inbound port of described second protocol message.Described second protocol message is address resolution protocol (ARP) message.Wherein the message source IP of second protocol message is the IP address of described Virtual Controller 13, and the IP address of controller itself is used for VRRP broadcast, and described switch is the IP address of sensing controller not.When described switch 12 is received second protocol message, can send the 3rd protocol massages based on OPEN FLOW agreement to controller 11 according to the described mapping table generating.Described judge module 115 has timer B, and described timer B is used for starting described the second Preset Time section; If, call the priority that described extraction module 113 and comparison module 114 are respectively used to extract according to the priority attribute that detects described the first protocol massages that backup controller receives in the second Preset Time section described the first protocol massages, whether the priority that detects described backup controller self is higher than the priority of described the first protocol massages, if, backup controller higher priority is defined as to master controller, makes described sending module 111 for second protocol message being sent to described switch 12.Described switch 12 is for generating the IP address of recording described Virtual Controller 13 and the mapping table that receives the port numbers of the inbound port of described second protocol message.Described second protocol message is address resolution protocol (ARP) message.Wherein the message source IP of second protocol message is the IP address of described Virtual Controller 13, and the IP address of controller itself is used for VRRP broadcast, and described switch is the IP address of sensing controller not.When described switch 12 is received second protocol message, can send the 3rd protocol massages based on OPEN FLOW agreement to controller 11 according to the described mapping table generating.If not, make described sending module 111 send the first protocol massages.
The method and system that provide backup for software defined network controller of the present invention are by arranging the IP address of Virtual Controller of VRRP controller group, switch is without the IP address of all controllers of perception, only need the virtual ip address of Virtual Controller described in perception, switch is without linking up with each controller, master controller meeting active and switch in VRRP controller group go to set up contact, and then switch only can be mutual with master controller.The invention solves the problem of reliability, autgmentability and the aspect of performance of single-point controller, increased the reliability of network, realized Single Controller and can tackle the SDN network across multiple hell, and realized the transmeridional expansion of multiple SDN controllers.
So the present invention has effectively overcome various shortcoming of the prior art and tool high industrial utilization.
State only illustrative principle of the present invention and effect thereof of embodiment, but not for limiting the present invention.Any person skilled in the art scholar all can, under spirit of the present invention and category, modify or change above-described embodiment.Therefore, such as in affiliated technical field, have and conventionally know that the knowledgeable, not departing from all equivalence modifications that complete under disclosed spirit and technological thought or changing, must be contained by claim of the present invention.