CN108881059B - Controller role determination method, network switching equipment, controller and network system - Google Patents

Controller role determination method, network switching equipment, controller and network system Download PDF

Info

Publication number
CN108881059B
CN108881059B CN201810531903.0A CN201810531903A CN108881059B CN 108881059 B CN108881059 B CN 108881059B CN 201810531903 A CN201810531903 A CN 201810531903A CN 108881059 B CN108881059 B CN 108881059B
Authority
CN
China
Prior art keywords
controller
role
priority
request message
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810531903.0A
Other languages
Chinese (zh)
Other versions
CN108881059A (en
Inventor
宋小恒
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
New H3C Information Technologies Co Ltd
Original Assignee
New H3C Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by New H3C Technologies Co Ltd filed Critical New H3C Technologies Co Ltd
Priority to CN201810531903.0A priority Critical patent/CN108881059B/en
Publication of CN108881059A publication Critical patent/CN108881059A/en
Application granted granted Critical
Publication of CN108881059B publication Critical patent/CN108881059B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/24Traffic characterised by specific attributes, e.g. priority or QoS
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/24Traffic characterised by specific attributes, e.g. priority or QoS
    • H04L47/2425Traffic characterised by specific attributes, e.g. priority or QoS for supporting services specification, e.g. SLA

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The utility model relates to a role determination method for a controller, a network switching device, a controller and a network system, wherein the network switching device sends a role status message to a second controller when recognizing that role information in a first role request message is a main controller and priority information is the priority of the first controller, and the priority of the first controller is higher than that of the second controller; when the role information of the second role request message sent by the second controller is received as the slave controller, the roles of the second controller and the first controller on the device are changed, a change success message is sent to the second controller and the first controller, and the roles of the controllers on the network switching device are changed after the second controller which is originally used as the master controller in the cluster is determined to be applied as the slave controller.

Description

Controller role determination method, network switching equipment, controller and network system
Technical Field
The present disclosure relates to the field of communications technologies, and in particular, to a method for determining a role of a controller, a network switching device, a controller, and a network system.
Background
An SDN (software defined Network) is a novel Network innovation architecture, and a core idea thereof is to separate a control layer and a forwarding layer of a Network device to realize flexible control of Network traffic.
In an SDN network, an Openflow protocol is used as a signaling channel between a controller and a network switching device, and the controller may configure and manage the Openflow network switching device through the signaling channel. The network switching device may establish an Openflow connection with a plurality of controllers. One master controller is allowed to appear in the controller cluster, and the rest of the members in the cluster are all slave controllers. The master controller is used for receiving packet-in messages sent by the network switching equipment and is responsible for issuing a forwarding flow table, and the slave controller is mainly used for inquiring the state of the network switching equipment. When the master controller is abnormal, other controllers in the cluster can apply for changing the state of the controller into the master controller, and the network switching equipment can actively inform the state of the controller in the cluster to all the controllers so as to ensure the uniqueness of the master controller in the cluster.
When the network switching device accesses the controller cluster, if the selection work of the master controller in the cluster is not completed or the network connection is abnormal, a situation that a plurality of master controllers exist in the cluster within a period of time may be caused. The multiple master controllers may cause that the services in the cluster cannot be successfully delivered to the network switching device, and a failure in one-time configuration delivery may cause a long-time service interruption, and although a problem of configuration failure may be found by means of periodic configuration comparison between the controllers and the network switching device, it takes a long time to collect configuration of the network switching device in a large-scale data center, and the possibility that the services in the network are affected is high.
Disclosure of Invention
In view of this, the present disclosure provides a controller role determination method, a network switching device, a controller and a network system, which can reduce the possibility that a plurality of master controllers exist in a controller cluster.
According to a first aspect of the present disclosure, there is provided a controller role determination method, which is applied to a network switching device, the method including: identifying information carried in a first role request message from a first controller, wherein the role request message comprises role information requested by the controller and priority information of the controller; comparing the priority of the first controller with the priority of a second controller which is stored in the device and currently serves as the main controller under the condition that the role information requested by the controller in the first role request message is the main controller and the priority information of the controller in the first role request message is the priority of the first controller; when the priority of the first controller is higher than that of the second controller, sending a role status message to the second controller, wherein the role status message comprises: a device identification of the first controller, role information requested by the first controller, and priority information of the first controller; when a second role request message sent by the second controller is received, under the condition that role information in the second role request message is a slave controller, setting the role of the second controller on the device as the slave controller and the role of the first controller as the master controller, sending a change success message responding to the second role request message to the second controller, and sending a change success message responding to the first role request message to the first controller, so that the second controller sets the own role as the slave controller and the first controller sets the own role as the master controller.
According to a first aspect of the present disclosure, there is provided a controller role determination method applied to a first controller in a controller cluster, the method including: when a controller in a cluster does not select a main controller, generating a role request message according to the priority of the equipment, wherein the role information carried in the role request message is the main controller, and the priority information of the controller carried in the role request message is the priority of the equipment; sending the role request message to a network switching device so that the network switching device can determine whether to allow the device to act as a main controller according to information carried in the role request message; and if a change success message returned by the network switching equipment in response to the role request message is received, changing the role of the equipment into the main controller.
According to a third aspect of the present disclosure, there is provided a network switching device comprising: the message identification module is used for identifying information carried in a first role request message from a first controller, wherein the role request message comprises role information requested by the controller and priority information of the controller; a priority comparison module, configured to compare, when the role information requested by the controller in the first role request message is a master controller and the priority information of the controller in the first role request message is a priority of a first controller, the priority of the first controller with a priority of a second controller, which is currently a master controller and is stored in the device; a message sending module, configured to send a role status message to the second controller when the priority of the first controller is higher than the priority of the second controller, where the role status message includes: a device identification of the first controller, role information requested by the first controller, and priority information of the first controller; a first role setting module, configured to, when a second role request message sent by the second controller is received, set a role of the second controller on the device as a slave controller and a role of the first controller as a master controller when role information in the second role request message is the slave controller, send a change success message in response to the second role request message to the second controller, and send a change success message in response to the first role request message to the first controller, so that the second controller sets its own role as the slave controller and the first controller sets its own role as the master controller.
According to a fourth aspect of the present disclosure, there is provided a controller comprising: the first message generation module is used for generating a role request message according to the priority of the equipment when a controller in the cluster does not select the main controller, wherein the role information carried in the role request message is the main controller, and the priority information of the controller carried in the role request message is the priority of the equipment; a first message sending module, configured to send the role request message to a network switch device, so that the network switch device determines, according to information carried in the role request message, whether to allow the device to serve as a master controller; and the role changing module is used for changing the role of the equipment into the main controller if a change success message returned by the network switching equipment in response to the role request message is received.
According to a fifth aspect of the present disclosure, there is provided a network switching device comprising: a processor; a machine-readable storage medium for storing processor-executable instructions; wherein the processor is configured to perform the method of the first aspect.
According to a sixth aspect of the present disclosure there is provided a machine-readable storage medium having stored thereon machine-executable instructions which, when invoked and executed by a processor, cause the processor to carry out the method of the first aspect described above.
According to a seventh aspect of the present disclosure, there is provided a controller comprising: a processor; a machine-readable storage medium for storing processor-executable instructions; wherein the processor is configured to perform the method of the second aspect described above.
According to an eighth aspect of the present disclosure there is provided a machine-readable storage medium having stored thereon machine-executable instructions which, when invoked and executed by a processor, cause the processor to carry out the method of the second aspect described above.
According to a ninth aspect of the present disclosure, there is provided a network system comprising the network switching device of the fifth aspect and the controller of the seventh aspect.
In the method for determining the role of the controller, the network switching device, the controller and the network system in the embodiments of the disclosure, the network switching device identifies information carried in a first role request message from a first controller; comparing the priority of the first controller with the priority of a second controller which is currently used as the main controller and is stored in the equipment under the condition that the role information requested by the controller in the first role request message is the main controller and the priority information is the priority of the first controller; when the priority of the first controller is higher than that of the second controller, sending a role status message including the device identification of the first controller, role information requested by the first controller, and the priority of the first controller to the second controller; when receiving a second role request message sent by the second controller, setting the role of the second controller on the device as a slave controller and the role of the first controller as a master controller under the condition that the role information requested in the second role request message is the slave controller, sending a change success message responding to the second role request message to the second controller, and sending a change success message responding to the first role request message to the first controller, so that after determining that the second controller originally used as the master controller in the cluster applies to become the slave controller, the roles of the controllers on the network switching device can be changed, and other controllers can be agreed to become the master controller, therefore, the roles of the master controller on the network switching device and the roles of the master controllers in the cluster are kept consistent, and the possibility that a plurality of master controllers exist in the cluster at the same time is reduced, the stability of an Openflow control layer between the network switching equipment and the controller is improved.
Other features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments, which proceeds with reference to the accompanying drawings.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate exemplary embodiments, features, and aspects of the disclosure and, together with the description, serve to explain the principles of the disclosure.
Fig. 1 illustrates a flowchart of a controller role determination method according to an embodiment of the present disclosure.
Figure 2 illustrates an SDN network schematic according to an embodiment of the present disclosure.
Fig. 3 illustrates a flowchart of a controller role determination method according to an embodiment of the present disclosure.
Fig. 4 illustrates a flowchart of a controller role determination method according to an embodiment of the present disclosure.
Fig. 5 illustrates a flowchart of a controller role determination method according to an embodiment of the present disclosure.
Fig. 6 illustrates a flowchart of a controller role determination method according to an embodiment of the present disclosure.
Fig. 7 illustrates a flowchart of a controller role determination method according to an embodiment of the present disclosure.
Fig. 8 shows a block diagram of a network switching device according to an embodiment of the present disclosure.
Fig. 9 shows a block diagram of a network switching device according to an embodiment of the present disclosure.
FIG. 10 shows a block diagram of a controller according to an embodiment of the present disclosure.
FIG. 11 shows a block diagram of a controller according to an embodiment of the present disclosure.
Fig. 12 is a block diagram illustrating a network switching device in accordance with an example embodiment.
FIG. 13 is a block diagram illustrating a controller according to an exemplary embodiment.
Detailed Description
Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. In the drawings, like reference numbers can indicate functionally identical or similar elements. While the various aspects of the embodiments are presented in drawings, the drawings are not necessarily drawn to scale unless specifically indicated.
The word "exemplary" is used exclusively herein to mean "serving as an example, embodiment, or illustration. Any embodiment described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments.
Furthermore, in the following detailed description, numerous specific details are set forth in order to provide a better understanding of the present disclosure. It will be understood by those skilled in the art that the present disclosure may be practiced without some of these specific details. In some instances, methods, means, elements and circuits that are well known to those skilled in the art have not been described in detail so as not to obscure the present disclosure.
Fig. 1 illustrates a flowchart of a controller role determination method according to an embodiment of the present disclosure. Figure 2 illustrates an SDN network schematic according to an embodiment of the present disclosure. As shown in fig. 2, SW1, SW2, SW3, and SW4 are Openflow switches (hereinafter referred to as switches), GW is a gateway, and controllers 1 and 2 are Openflow controllers (hereinafter referred to as controllers). Controllers 1 and Controller2 are members of a Controller cluster (hereinafter referred to as a cluster). Openflow connection is established between the switch and the controller in the cluster, TLS (Transport Layer Security, secure Transport Layer Protocol) encryption can be adopted between the switch and the controller to ensure Transmission Security, and TCP (Transmission Control Protocol) direct Transmission can also be adopted.
As shown in fig. 2, SW1 is taken as an example for accessing the cluster. In the initial state, the cluster network is normally connected, when the SW1 accesses the cluster, the Controller in the cluster performs negotiation, and the Controller1 is selected as the main Controller of the SW 1. In the related art, when the Openflow connection between the SW1 and the Controller is disconnected due to an abnormal network connection, and then the network is recovered, the SW1 rejoins the SDN network and initiates the Openflow connection with the Controller, the Controller1 and the Controller2 sense the access of the SW1 at the same time, and negotiate a master Controller of the election SW1 in a cluster. If the cluster network is not fully restored (communication between Controller1 and Controller1 is abnormal) at this time, both Controller1 and Controller2 may apply SW1 to become the master Controller. When the generation id (generation identifier) in the application received by the SW1 is smaller than the maximum generation id on the current SW1, the SW1 does not allow the main controller to be changed; when the generation id in the application received by SW1 is greater than or equal to the maximum generation id on the current SW1, SW1 allows the main controller to be changed. SW1 will execute the received applications in sequence, assuming that SW1 executes the applications from Controller1 first, and then executes the applications from Controller 2. The SW1 receives the application from the Controller1, if the generation id in the application is larger than the maximum generation id on the current SW1, the SW1 determines that the Controller1 can become the main Controller, and the SW1 sets the role of the Controller1 in the device as the main Controller and sends a change success message to the Controller 1. The Controller1 receives the change success message and sets itself as the master Controller. In this case, the maximum generation id in SW1 is the generation id in the application from Controller 1.
Because a larger generation id is generated on the basis of the original generation id when the main Controller is selected in the cluster each time, the original generation ids corresponding to the Controller1 and the Controller2 are the same, and therefore, the generation ids carried in the applications sent by the Controller1 and the Controller2 may be the same. After SW1 receives the application from Controller2, if the generation id in the application is equal to the maximum generation id on SW1 (the generation id in the application from Controller 1), SW1 sets the role of Controller1 in the device as the slave Controller, sets the role of Controller2 as the master Controller, sends a change success message to Controller2, and sends a role status message to Controller 1. The Controller2 receives the change success message and sets itself as the master Controller. Controller1 receives the role status message, finds Controller2 as the master, and Controller1 sets itself as the slave. If the network condition is poor and the time that Controller1 receives the role status message is later than the time that Controller2 receives the change success message, or Controller1 cannot receive the role status message all the time, the state that Controller1 and Controller2 are used as the master Controller of SW1 occurs, and at this time, both Controller1 and Controller2 can issue configuration to SW1, that is, the situation of dual master control occurs in the cluster, and therefore service issue between the Controller and the network switching device may be inconsistent.
The controller role determination method shown in fig. 1 may be applied to a network switch device that establishes an Openflow connection with a controller cluster, and the network switch device may be an Openflow switch, such as SW1, SW2, SW3, SW4 and the like shown in fig. 2. As shown in fig. 1, the controller role determination method includes:
step S11, identifying information carried in a first role request message from the first controller, where the role request message includes role information requested by the controller and priority information of the controller.
Before describing the embodiments of the present disclosure, to avoid confusion of names, two types of messages related to the embodiments are described, and the embodiments include two types of messages, namely, a role request message and a role status message.
The role request message is a message sent by the controller to the network switching equipment, and the controller requests the network switching equipment to play a certain role through the role request message, for example, requests to play the role of a master controller or requests to play the role of a slave controller; alternatively, when the master controller has been elected inside the controller cluster, the controller may request the network switching device to change the information of the master controller and the slave controller recorded in the network switching device through the role request message.
The role state information is sent to the controller by the network switching equipment, and when the network switching equipment receives the role request information and determines that a controller in the controller cluster requests the network switching equipment for role conversion, the network switching equipment informs other controllers in the cluster and the relevant information of the controller requesting the role conversion through the role state information.
Specifically, the role request message includes role information requested by the controller and priority information of the controller.
The network switching device can set the role of the controller on the network switching device according to the role information in the role request message, and determine the role of the Openflow channel connected with the controller. The role information of the controller includes a master controller (master), a slave controller (slave), and a peer controller (equivalent). The priority information of the controller in the role request message may be the priority of the controller that sent the role request message, or may be a null value. When the priority information of the controller is the priority of the controller sending the role request, the network switching device needs to determine whether to allow the role of the controller to be changed according to the priority. When the priority information of the controller is null, the network switching device needs to determine whether to allow the role of the controller to be changed according to the generation id.
Of course, the role request message also includes the device identification of the controller requesting the role change.
When the device identifier included in the role request message is the first controller, the role request message in this embodiment is denoted as the first role request message, and when the device identifier included in the role request message is the second controller, the role request message in this embodiment is denoted as the second role request message.
The first role request message is that the first controller sends a role request message to the network switching device. The role information requested by the controller in the first role request message indicates that the first controller requests to assume a role, and the role information may be a master controller, a slave controller or a peer controller. The priority information of the controller in the first character request message may be a priority of the first controller or a null value.
The network switching device can identify which information is carried in the first persona request message and the value of the information. In an example, in the Openflow protocol, a role request message is a role request message, a role field of the role request message is role information requested by a controller, and a priority field of the role request message is priority information of the controller. When the value of the Role field is 1, the peer-to-peer controller is represented, when the value of the Role field is 2, the master controller is represented, and when the value of the Role field is 3, the slave controller is represented. And when the Priority field takes a value of 0, representing a null value, and when the Priority field takes a value of not 0, taking the Priority field as the Priority of the controller. The network switching device may recognize a value of the role field in the role request message, thereby determining the role that the controller requests to play. The network switch device may recognize the value of the priority field in the role request message, thereby determining whether the role is allowed to be changed.
The first controller may be any one of a cluster of controllers.
Step S12, when the role information requested by the controller in the first role request message is the master controller and the priority information of the controller in the first role request message is the priority of the first controller, comparing the priority of the first controller with the priority of the second controller currently serving as the master controller, which is stored in the device.
The priority represents the weight of the controller as the master controller in the cluster, and the higher the priority, the higher the success rate of the controller applying for becoming the master controller. The priority may be specified when the controller joins the cluster. In one possible implementation, the priority level of the controller may be determined according to the processing speed, stability, and the like of the controller.
When a controller in a cluster does not enumerate a master controller, the state of multiple master controllers may occur according to the controller role determination method in the related art. In the embodiment of the present disclosure, a priority information is set, and when a controller in a cluster does not elect a master controller, the priority information of the controller in a role request message sent by the controller to a network switching device is the priority of the controller; when the controller in the cluster elects the main controller, the priority information in the role request message sent by the controller to the network switching equipment is null. The network switching device may determine whether the controller in the cluster elects the master controller according to whether the role request message carries priority information, and further determine whether to allow changing the role of the controller according to the priority or according to the generating id.
When the role information requested by the controller in the first role request message is the main controller, the first role request message indicates that the first controller requests to act as the main controller. Due to the need to ensure the uniqueness of the master controller in the cluster, the first role request message may further trigger other controllers to change roles, for example, the original master controller changes its own role as the slave controller. When the priority information of the controller in the first role request message is the priority of the first controller, it indicates that the cluster where the first controller is located does not elect the master controller, and at this time, the network switching device needs to determine whether to allow the first controller to serve as the master controller according to the priority.
The second controller is a controller of which the current role is the main controller on the network switching equipment. The second controller may be a master controller selected by the controllers in the cluster in a load sharing manner, or may be determined based on the priorities of the controllers. The network switching device stores the priority of the second controller.
When a controller having a role as a master controller exists on the network switching device but the controller is selected from the controllers in the cluster, the priority of the second controller currently serving as the master controller stored in the network switching device is the default priority. Specifically, when the master controller on the network switching device is elected by the controller in the cluster, the priority information of the controller in the role request message received by the network switching device from the master controller is null, and the network switching device cannot acquire the priority of the master controller, so that the network switching device may set the priority of the second controller stored in the device to be the default priority.
In one example, the default priority may be lower than the lowest priority among the priorities of the controllers in the cluster.
Step S13, when the priority of the first controller is higher than the priority of the second controller, sending a role status message to the second controller, the role status message including: a device identification of the first controller, role information requested by the first controller, and priority information of the first controller.
The network switching device allows the role of the controller to change when the priority of the first controller is higher than the priority of the second controller. The network switching device may send a role status message to the second controller, the role status message including a device identification of the first controller, role information requested by the first controller, and priority information of the first controller. Wherein the device identification may be used to identify the unique controller and the device identification of the first controller may be used to identify the first controller. The network switching device may obtain the role information requested by the first controller and the priority information of the first controller from the first role request message, and according to step S12, the role information requested by the first controller is the master controller, and the priority information of the first controller is the priority of the first controller.
And after receiving the role state message, the second controller determines that the role state message corresponds to the first controller according to the equipment identifier of the first controller, determines that the first controller is a main controller according to the role information requested by the first controller, and determines the priority of the first controller according to the priority information of the first controller. When the second controller determines that the priority of the first controller is higher than the priority of the second controller, the second controller sends a role request message of which the role information is the slave controller to the network switching equipment to request to change the role, namely, the current role of the master controller is requested to be changed into the role of the slave controller.
Step S14, when receiving a second role request message sent by the second controller, if the controller role information in the second role request message is a slave controller, setting the role of the second controller on the device as the slave controller and the role of the first controller as the master controller, and sending a change success message in response to the second role request message and a change success message in response to the first role request message to the second controller, so that the second controller sets its own role as the slave controller and the first controller sets its own role as the master controller.
The second role request message is a request message sent by the second controller to the network switching device. And when the role information in the second request message is the slave controller, indicating that the second controller applies to become the slave controller and does not act as the master controller any more.
The network switching device receives the second role request message, which indicates that the network switching device is normally connected with the second controller, and at this time, the network switching device may set the role of the second controller on the device as the slave controller, and send a change success message responding to the second role request message to the second controller, so as to maintain the consistency of the roles of the network switching device and the second controller on the controller. Meanwhile, the network switching device may set the role of the first controller on the device as the master controller, and send a change success message in response to the first role request message to the first controller, so as to implement a change of the master controller. After receiving the successful change message, the first controller sets the own role as the main controller, so that the consistency of the roles of the network switching equipment and the main controller in the cluster is maintained, and only one main controller exists in the role change process.
After confirming that the second controller (original master controller) applies for becoming the slave controller, the network switching equipment changes the role of the controller on the equipment again, allows the second controller to become the slave controller, and allows the first controller (controller applying for becoming the master controller) to become the master controller, so that the possibility that multiple master controllers exist in the cluster at the same time is reduced, meanwhile, the consistency of the role of the master controller on the network switching equipment and the role of the master controller in the cluster is kept, the accuracy of configuration issuing between the network switching equipment and the controllers is improved, and the stability of the controller layer is improved.
Fig. 3 illustrates a flowchart of a controller role determination method according to an embodiment of the present disclosure. As shown in fig. 3, the controller role determination method further includes:
step S15, when the role information in the first role request message is a master controller and the priority information of the controller in the first role request message is the priority of the first controller, if the second controller does not exist in the device, setting the role of the first controller on the device as the master controller, and sending a change success message in response to the role request message to the first controller, so that the first controller sets its own role as the master controller.
The information of the elected master controller may not be present on the network switching device. In one example, after the network switching device joins the cluster, when it is not negotiated in the cluster who is the master controller of the network switching device, the information of the master controller does not exist on the network switching device. In one example, when the network switching device is abnormally connected with a master controller in the cluster, information of the master controller does not exist on the network switching device.
When the information of the main controller does not exist on the network switching equipment, the fact that the main controller does not exist in the cluster is indicated, after the network switching equipment receives the first role request message, the role of the first controller on the equipment can be directly set as the main controller, and the first controller is agreed to set the role of the first controller as the main controller, so that the first controller can issue configuration.
In one possible implementation manner, after the network switching device of step S14 or step S15 sets the role of the first controller on the device as the master controller, the network switching device may update the priority of the master controller stored in the device to the priority of the first controller. Therefore, the priority of the main controller on the network switching equipment can be kept consistent with the priority of the main controller in the cluster, so that the network switching equipment can determine whether to change the main controller according to the locally stored priority of the main controller. When the network switching device determines that the priority of the first controller is higher than the priority of the second controller currently serving as the main controller, the network switching device enters a main controller change flow and executes step S13 and step S14. When the network switching equipment determines that the priority of the first controller is lower than or equal to the priority of a second controller which is stored in the equipment and is currently used as a main controller, the network switching equipment refuses to change the main controller and sends a change failure message responding to the first role request message to the first controller so that the first controller keeps the role of the first controller unchanged.
In a possible implementation manner, the first role request message also carries a generation id generated when the master controller is elected in the cluster. The generation id is a monotonically increasing counter and the controller assigns a new (larger) generation id each time the master-slave relationship changes. For example, the generation identification may be incremented each time a new master controller is designated.
Fig. 4 illustrates a flowchart of a controller role determination method according to an embodiment of the present disclosure. As shown in fig. 4, after identifying the information carried in the first role request message from the first controller, the controller role determination method further includes:
step S16, when the role information requested by the controller in the first role request message is the master controller and the priority information of the controller in the first role request message is null, comparing the generation id carried in the first role request message with the maximum generation id in the device.
Step S17, when the generation id carried in the first role request message is greater than the maximum generation id in the device, setting the role of the first controller on the device as the main controller, and sending a change success message responding to the role request message to the first controller, so that the first controller sets its own role as the main controller.
The priority information of the controllers in the first role request message is null indicating that the controller in the cluster has selected the master controller through interaction between the cluster controllers. And the role information in the first role request message is the master controller, which indicates that the first controller is the master controller selected after interaction of the controllers in the cluster. At this time, the network switching device may determine whether to allow the change of the main controller according to the generation id carried in the first role request message.
In a possible implementation manner, when the generation id carried in the first role request message is less than or equal to the maximum generation id in the device, the network switching device sends a change failure message responding to the first role request message to the first controller, and refuses to change the main controller, so that the first controller keeps its own role unchanged.
In a possible implementation manner, after changing the role of the first controller on the local device to the master controller in step S17, the network switching device may further set the priority of the second controller stored in the local device to the default priority. In one example, the default priority may be lower than the lowest priority in the cluster. Since the priority information of the controller in the first role request message in step S16 is null, the network switching device cannot acquire the priority of the first controller, and therefore the network switching device may set the priority of the second controller stored in the device to the default priority.
It should be noted that, in the above-mentioned embodiment, the controller role determination method is applied to the network switching device, and thus the above-mentioned "present device" refers to the network switching device.
For the following controller role determination method, it applies to the controllers in the controller cluster, and thus the reference to "the present device" refers to the controller performing the method.
Fig. 5 illustrates a flowchart of a controller role determination method according to an embodiment of the present disclosure. The method may be applied to a first Controller in a Controller cluster, and the first Controller may be any one of controllers in the cluster, such as Controller1 and Controller2 shown in fig. 2. As shown in fig. 5, the controller role determination method includes:
step S21, when the controller in the cluster does not elect the master controller, generating a role request message according to the priority of the device, where the role information carried in the role request message is the master controller, and the priority information of the controller carried in the role request message is the priority of the device.
Step S22, sending the role request message to a network switch device, so that the network switch device determines whether to allow the device to act as a master controller according to the information carried in the role request message.
Step S23, if a change success message returned by the network switch device in response to the role request message is received, changing the role of the device to be the master controller.
The role request message, the role information, the priority information, and the change success message may refer to steps S11 to S14, which are not described herein again.
When the network switching equipment is accessed to a cluster, if communication among members in the cluster is abnormal due to reasons such as abnormal network connection and the like, negotiation of a main controller in the cluster cannot be normally carried out, at the moment, the controller in the cluster applies to the network switching equipment for becoming the main controller, role information carried in a role request message sent by the main controller is the main controller, and priority information carried by the controller is the priority of the equipment. When each controller joins the cluster, its own priority is assigned.
In a possible implementation manner, when the controller in the cluster does not select the master controller, each controller in the cluster (each controller that establishes Openflow connection with the network switching device) may generate a role request message according to the priority of the device, so as to apply the network switching device for becoming the master controller of the network switching device.
In one possible implementation, the first controller may obtain the priority of each controller within the cluster at the time of joining the cluster. If the priorities of the controllers are obtained, the first controller compares the priorities of the controllers, and generates a role request message according to the priority of the equipment when the priority of the equipment is the highest priority of the priorities of the controllers. And if the priority of each controller is not acquired, the first controller generates a role request message according to the priority of the equipment.
If the first controller acquires the priority of each controller, indicating that the network switching device accesses the cluster, the controllers in the cluster have already completed the transmission of the priority, that is, the first controller stores the priorities of all other controllers in the cluster. When the controller in the cluster has completed the transmission of the priority, the controller with the highest priority in the cluster may determine itself as the controller applying for becoming the master controller and generate the role request message, and the other controllers in the cluster do not generate the role request message. Therefore, each controller is not required to send role request messages, and resources of the controllers are saved; the number of role request messages is reduced, and network resources and resources used by network switching equipment for processing the role request messages are saved; the times of role change of the controller are reduced, and the network stability is improved.
And if the first controller does not acquire the priority of each controller, indicating that the establishment of the network connection between the network switching equipment and the cluster is earlier than the network connection in the cluster. At this time, each controller in the cluster may generate a role request message to apply the network switch device to become the master controller, so as to ensure that the controller with higher priority can become the master controller.
The manner in which the controller sends the role request message to the network switch device and the manner in which the network switch device processes the role request message may refer to steps S11 to S17, which are not described herein again.
Fig. 6 illustrates a flowchart of a controller role determination method according to an embodiment of the present disclosure. As shown in fig. 6, before sending the role request message to the network switching device, the controller role determination method further includes:
step S24, if the device is determined to be elected as the main controller, generating a role request message which comprises the generation id, the role information as the main controller and the priority information as null value according to the distributed generation id.
After the controller in the cluster elects the first controller as the main controller, other controllers in the cluster do not participate in competition, only the first controller sends the role request message, and at the moment, the role request message does not need to carry the priority of the equipment and only needs to carry the newly distributed generation id. It should be noted that the generating id may be allocated by a controller in the cluster by negotiation, or may be allocated by a third party, which is not limited in this disclosure.
Fig. 7 illustrates a flowchart of a controller role determination method according to an embodiment of the present disclosure. The method may be applied to any controller in a cluster of controllers. In this embodiment, the first controller in the above embodiments is taken as an example to describe the method, but it should be understood that any controller in the controller cluster may execute the method. The third controller in the following embodiments refers to other controllers in the controller cluster except the first controller. As shown in fig. 7, the role determination method further includes:
step S25, identifying information carried in a role status message from the network switch device, where the role status message is a message sent by the network switch device to notify role information when a third controller applies for role change, and the role status message includes a device identifier of the third controller, role information requested by the third controller, and priority information of the third controller.
Step S26, when the device is a master controller, if the role information requested by the third controller in the role status message is the master controller and the priority information in the role status message is the priority of the third controller, comparing the priority of the third controller with the priority of the device.
Step S27, when the priority of the third controller is higher than the priority of the third controller, sending a role request message for requesting to change the role of the third controller to the slave controller to the network switching device.
The network switching device may advertise role information to controllers within the cluster via role status messages. In order to ensure the uniqueness of the master controller in the cluster, when the master controller in the network switching device is determined not to be the device after the role status message received by the master controller in the cluster, the controller in the cluster may change the role.
The role status message in step S25 is a message for announcing role information transmitted by the network switching device when the third controller applies for a role change. Specifically, the third controller sends a third triangle request message to the network switching device, where the third triangle request message carries an identifier of the third controller, role information requested by the third controller, and priority information of the third controller. If the role information requested by the third controller is the master controller and the priority information of the third controller is the priority of the third controller, referring to steps S11 to S13, the network switching device may transmit a role status message to the first controller, the role status message including the device identifier of the third controller, the role information requested by the third controller, and the priority information of the third controller.
In step S26, when the role information requested by the third controller in the role status message is the master controller, it indicates that the third controller applies for becoming the master controller, and in order to ensure the uniqueness of the master controller in the cluster, the first controller currently serving as the master controller needs to enter a role change flow. When the priority information in the role status message is the priority of the third controller (when the priority information is not null), it indicates that the first controller needs to determine whether to change the role according to the priority.
In step S27, when the priority of the third controller is higher than that of the own device, the first controller may change its own role as the slave controller. When the priority corresponding to the priority information is lower than or equal to the priority of the device, the first controller may keep its own role unchanged. In this way, the controller with higher priority can be the master controller, and the controller with lower priority can be the slave controller.
When the first controller changes its own role as the slave controller, role request message role information for requesting to change the role of the first controller to the slave controller needs to be sent to the network switching device, so as to maintain the consistency of the roles of the network switching device and the controller.
In a possible implementation manner, when the cluster is split into a plurality of sub-clusters, interacting with other controllers in the sub-cluster to which the device belongs to determine whether the device continues to survive; if the equipment is determined to continue to survive, reestablishing the Openflow connection with the network switching equipment; and if the equipment is determined not to survive any more, closing the service corresponding to the network switching equipment.
When a cluster is split into sub-clusters, a controller within a sub-cluster may select one sub-cluster as a surviving cluster according to a majority rule. If the sub-cluster to which the controller belongs continues to survive, the controller continues to survive, and at this time, the controller may reestablish the Openflow connection with the network switch device, and then the controller determines the role of the controller in the sub-cluster according to steps S21 to S27 and according to steps S11 to S17. If the sub-cluster to which the controller belongs does not survive any more, the controller does not survive any more, at this time, the controller can close the service corresponding to the network switching device, the Openflow connection between the network switching device and the controller is also automatically disconnected, and the network switching device is only connected to the cluster which continues to survive. In this way it is ensured that the network switching device can be connected to a normal cluster.
Application example
As shown in fig. 2, there are two controllers Controller1 and Controller2 in the cluster, with Controller1 having priority 1, Controller2 having priority 2, and Controller2 having priority higher than Controller. Take SW1 access cluster as an example. In the initial state, the cluster network is normally connected, when the SW1 accesses the cluster, the controllers in the cluster negotiate, and the Controller1 is selected as the main Controller of the SW 1.
Due to network connection exception, the Openflow connection between SW1 and the Controller is disconnected, after which the network is restored, SW1 rejoins the SDN network, and initiates Openflow connections with controllers 1 and 2. If the cluster network has not been fully restored and controllers 1 and 2 do not elect a master Controller, both controllers 1 and 2 may apply SW1 for the master Controller.
Example 1
The priorities of controllers 1 and 2 are stored in controllers 1 and 2. Both Controller1 and Controller2 determine that Controller2 has a high priority. The Controller1 does not generate and transmit a role request message to the SW1, and the Controller2 generates and transmits a role request message to the SW1 according to its own priority, requesting to become the master Controller.
The SW1 receives the role request message from the Controller2, and recognizes that the priority information in the role request message is the priority of the Controller2, and the role information is the master Controller. If the Controller with the main Controller role does not exist in SW1, SW1 sets the role of Controller2 on the device as the main Controller, and sends a change success message to Controller2, so that Controller2 sets itself as the main Controller.
In this case, the master Controller on SW1 is Controller2, the master Controller of SW1 in the cluster is also Controller2, both are identical and there is only one master Controller on SW1 and in the cluster.
Example 2
Controller1 and Controller2 have not acquired the priority of each other. The controllers 1 and 2 generate role request messages according to their priorities, and send the role request messages to the SW1 to request the master Controller.
Assume that SW1 first processes a role request message from Controller1, and identifies that the priority information in the role request is the priority of Controller1 and the role information is the master Controller. If the Controller with the main Controller role does not exist in SW1, SW1 sets the role of Controller1 on the device as the main Controller, and sends a change success message to Controller1, so that Controller1 sets itself as the main Controller. In SW1, priority 1 of Controller1 is stored as the priority of the second Controller currently being the primary Controller.
The SW1 continues to process the role request message from the Controller2, and recognizes that the priority information in the role request message is the priority of the Controller2, and the role information is the master Controller. Since the priority of Controller2 is 2, which is higher than priority 1 stored in SW1, SW1 determines that the change needs to be accommodated. The SW1 sends a role status message to the Controller1, wherein the role status includes the device identifier of the high-priority Controller, the role information requested by the high-priority Controller, and the priority information of the high-priority Controller. In this embodiment, since the priority of Controller2 is higher than that of Controller1, the role status message carries the device identifier of Controller2, the priority information (priority 2) of Controller2, and the role information (primary Controller) requested by Controller 2.
Upon receiving the role status message, the Controller1 determines that the priority 2 corresponding to the priority information is higher than its own priority 1, and transmits a role request message to SW1 requesting to become a slave.
SW1 receives the role request message from Controller1, changes the role of Controller1 to the slave Controller, changes the role of Controller2 to the master Controller, and sends a change success message to controllers 1 and Controller 2.
Controller1 sets itself as the slave Controller after receiving the change success message sent by SW1, and Controller2 sets itself as the master Controller after Controller2 receives the change success message sent by SW 1.
In this case, the master Controller in SW1 is Controller2, and the master Controller in SW1 in the cluster is also Controller2, both of which are consistent and only one master Controller exists all the time.
Example 3
When the Controller in the cluster elects the master Controller, take election Controller1 as the master Controller as an example. The Controller1 generates a role request message including a generation id, having the role information of the master Controller and the priority information of null value, and transmits the role request message to the SW 1.
The SW1 receives the role request message from the Controller1, recognizes that the priority information in the role request message is null, and processes the role change of the main Controller according to the generation id in the role request message.
Fig. 8 shows a block diagram of a network switching device according to an embodiment of the present disclosure. As shown in fig. 8, the network switching apparatus 300 includes:
a first message identification module 301, configured to identify information carried in a first role request message from a first controller, where the role request message includes role information requested by the controller and priority information of the controller;
a first comparing module 302, configured to compare, when the role information requested by the controller in the first role request message is a master controller and the priority information of the controller in the first role request message is the priority of the first controller, the priority of the first controller with the priority of a second controller currently serving as the master controller, where the priority of the first controller is stored in the device;
a first message sending module 303, configured to send a role status message to the second controller when the priority of the first controller is higher than the priority of the second controller, where the role status message includes: a device identification of the first controller, role information requested by the first controller, and priority information of the first controller;
a first role setting module 304, configured to, when a second role request message sent by the second controller is received, set a role of the second controller on the device as a slave controller and a role of the first controller as a master controller when role information in the second role request message is the slave controller, send a change success message in response to the second role request message to the second controller, and send a change success message in response to the first role request message to the first controller, so that the second controller sets its own role as the slave controller and the first controller sets its own role as the master controller.
According to the network switching equipment disclosed by the embodiment of the disclosure, after the second controller which is originally used as the master controller in the cluster is determined to apply for becoming the slave controller, the roles of all controllers on the network switching equipment are changed, and other controllers are agreed to become the master controller, so that the roles of the master controller on the network switching equipment and the roles of the master controllers in the cluster are kept consistent, the possibility that a plurality of master controllers exist in the cluster at the same time is reduced, and the stability of an Openflow control layer between the network switching equipment and the controllers is improved.
Fig. 9 shows a block diagram of a network switching device according to an embodiment of the present disclosure. As shown in fig. 9, in a possible implementation manner, the network switching device 300 further includes:
a second role setting module 305, configured to, if the role information in the first role request message is a master controller and the priority information of the controller in the first role request message is the priority of the first controller, set the role of the first controller on the device as the master controller if the second controller is not present on the device, and send a change success message in response to the first role request message to the first controller, so that the first controller sets its own role as the master controller.
In a possible implementation manner, the first role request message further carries a generation identifier id generated when the master controller is elected in the cluster, and the network switching device 300 further includes:
an identifier comparing module 306, configured to compare the generation id carried in the first role request message with the maximum generation id in the device when the role information requested by the controller in the first role request message is a master controller and the priority information of the controller in the first role request message is a null value;
a third role setting module 307, configured to set the role of the first controller on the device as a master controller when the generation id carried in the first role request message is greater than the maximum generation id in the device, and send a change success message responding to the role request message to the first controller, so that the first controller sets its own role as the master controller.
In a possible implementation manner, the network switching device 300 further includes:
a priority setting module 308, configured to set the priority of the second controller stored in the device to a default priority.
Fig. 10 shows a block diagram of a controller according to an embodiment of the present disclosure. As shown in fig. 10, the controller 400 includes:
a first message generating module 401, configured to generate a role request message according to a priority of a device when a controller in a cluster does not elect a master controller, where role information carried in the role request message is the master controller, and priority information of the controller carried in the role request message is the priority of the device;
a second message sending module 402, configured to send the role request message to a network switch device, so that the network switch device determines, according to information carried in the role request message, whether to allow the device to serve as a master controller;
a role changing module 403, configured to change the role of the network switching device to be the master controller if a change success message returned by the network switching device in response to the role request message is received.
In a possible implementation manner, the first message generating module 401 is further configured to:
acquiring the priority of each controller in the cluster when the controller joins the cluster;
if the priorities of the controllers are obtained, comparing the priorities of the controllers, and generating the role request message according to the priority of the equipment when the priority of the equipment is the highest priority of the priorities of the controllers;
and if the priority of each controller is not acquired, generating the role request message according to the priority of the equipment.
Fig. 11 shows a block diagram of a controller according to an embodiment of the present disclosure. As shown in fig. 11, in one possible implementation manner, the controller 400 further includes:
a second message identifying module 404, configured to identify information carried in a role status message from the network switching device, where the role status message is a message sent by the network switching device for announcing role information when a third controller applies for role change, and the role status message includes a device identifier of the third controller, role information requested by the third controller, and priority information of the third controller;
a second comparing module 405, configured to, when the device is a master controller, compare the priority of a third controller with the priority of the device when role information requested by the third controller in the role state message is the master controller and priority information in the role state message is the priority of the third controller;
a third message sending module 406, configured to send a role request message for requesting to change the role of the local device to the slave controller to the network switching device when the priority of the third controller is higher than the priority of the local device.
In one possible implementation, the controller 400 further includes:
and a second message generating module 407, configured to generate, if it is determined that the device is elected as the master controller, a role request message that includes the generation id, the role information that is the master controller, and the priority information that is a null value, according to the assigned generation id.
In one possible implementation, the controller 400 further includes:
a survival determining module 408, configured to, when the cluster is split into multiple sub-clusters, interact with other controllers in the sub-cluster to which the device belongs, and determine whether the device continues to survive;
a connection establishing module 409, configured to reestablish an Openflow connection with the network switching device if it is determined that the device continues to survive;
a service closing module 410, configured to close a service corresponding to the network switching device if it is determined that the device is no longer alive.
Fig. 12 is a block diagram illustrating a network switching device 800 in accordance with an example embodiment. Referring to fig. 12, the network switching device 800 may include a processor 801, a machine-readable storage medium 802 having stored thereon machine-executable instructions. The processor 801 and the machine-readable storage medium 802 may communicate via a system bus 803. Also, the processor 801 performs the above controller role determination method applied to the network switching device by reading machine-executable instructions corresponding to the controller role determination logic in the machine-readable storage medium 802.
The machine-readable storage medium 802 referred to herein may be any electronic, magnetic, optical, or other physical storage device that can contain or store information such as executable instructions, data, and the like. For example, the machine-readable storage medium may be: a RAM (random Access Memory), a volatile Memory, a non-volatile Memory, a flash Memory, a storage drive (e.g., a hard drive), a solid state drive, any type of storage disk (e.g., an optical disk, a dvd, etc.), or similar storage medium, or a combination thereof.
Fig. 13 is a block diagram illustrating a controller 900 according to an example embodiment. Referring to fig. 13, the controller 900 may include a processor 901, a machine-readable storage medium 902 having stored thereon machine-executable instructions. The processor 901 and the machine-readable storage medium 902 may communicate via a system bus 903. Also, the processor 901 performs the controller role determination method applied to the controller as described above by reading machine-executable instructions corresponding to the controller role determination logic in the machine-readable storage medium 902.
The machine-readable storage medium 902 referred to herein may be any electronic, magnetic, optical, or other physical storage device that can contain or store information such as executable instructions, data, and the like. For example, the machine-readable storage medium may be: a RAM (random Access Memory), a volatile Memory, a non-volatile Memory, a flash Memory, a storage drive (e.g., a hard drive), a solid state drive, any type of storage disk (e.g., an optical disk, a dvd, etc.), or similar storage medium, or a combination thereof.
The disclosed embodiment also provides a network system, which includes a network switching device 800 and a controller 900.
Having described embodiments of the present disclosure, the foregoing description is intended to be exemplary, not exhaustive, and not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terms used herein were chosen in order to best explain the principles of the embodiments, the practical application, or technical improvements to the techniques in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein.

Claims (14)

1. A method for determining a role of a controller, the method being applied to a network switching device, the method comprising:
identifying information carried in a first role request message from a first controller, wherein the role request message comprises role information requested by the controller and priority information of the controller;
comparing the priority of the first controller with the priority of a second controller which is stored in the device and currently serves as the main controller under the condition that the role information requested by the controller in the first role request message is the main controller and the priority information of the controller in the first role request message is the priority of the first controller;
when the priority of the first controller is higher than that of the second controller, sending a role status message to the second controller, wherein the role status message comprises: a device identification of the first controller, role information requested by the first controller, and priority information of the first controller;
when a second role request message sent by the second controller is received, setting the role of the second controller on the equipment as a slave controller and the role of the first controller as a master controller under the condition that role information in the second role request message is the slave controller, sending a change success message responding to the second role request message to the second controller, and sending a change success message responding to the first role request message to the first controller, so that the second controller sets the own role as the slave controller and the first controller sets the own role as the master controller;
the second role request message is a role request message which is sent by the second controller according to the role state information and is used for requesting to change the role information of the second controller into the slave controller when the second controller determines that the first controller is the master controller and the priority of the first controller is higher than that of the second controller.
2. The method of claim 1, wherein after said identifying information carried in the first persona request message from the first controller, the method further comprises:
and if the role information in the first role request message is a master controller and the priority information of the controller in the first role request message is the priority of the first controller, if the second controller does not exist on the device, setting the role of the first controller on the device as the master controller, and sending a change success message responding to the first role request message to the first controller, so that the first controller sets the own role as the master controller.
3. The method according to claim 1, wherein the first role request message further carries a generation identification id generated when the master controller is elected in the cluster, and after the identifying information carried in the first role request message from the first controller, the method further comprises:
comparing the generation id carried in the first role request message with the maximum generation id in the equipment under the condition that the role information requested by the controller in the first role request message is the main controller and the priority information of the controller in the first role request message is a null value;
and when the generation id carried in the first role request message is larger than the maximum generation id in the equipment, setting the role of the first controller on the equipment as a main controller, and sending a change success message responding to the role request message to the first controller so that the first controller sets the own role as the main controller.
4. The method of claim 3, wherein after the changing the role of the first controller on the device to a master controller, the method further comprises:
the priority of the second controller stored in the present apparatus is set to the default priority.
5. A method for determining a role of a controller, the method being applied to a first controller in a controller cluster, the method comprising:
when a controller in a cluster does not select a main controller, generating a role request message according to the priority of the equipment, wherein the role information carried in the role request message is the main controller, and the priority information of the controller carried in the role request message is the priority of the equipment;
sending the role request message to a network switching device so that the network switching device can determine whether to allow the device to act as a main controller according to information carried in the role request message;
if a change success message returned by the network switching equipment in response to the role request message is received, changing the role of the equipment into a master controller, wherein the change success message is sent after the network switching equipment receives a role request message which is sent by a second controller currently serving as the master controller and takes the role information of the second controller as the slave controller, and sets the role of the second controller on the network switching equipment as the slave controller and the role of the first controller as the master controller;
wherein the role information sent by the second controller is a role request message from a slave controller, and is sent by the second controller when the second controller determines that the first controller is a master controller and the priority of the first controller is higher than the priority of the second controller according to the role state information from the network switch device, the role state information is sent by the network switch device to the second controller when the network switch device determines that the priority of the first controller is higher than the priority of the second controller according to the role request message from the first controller, and the role state information includes: a device identification of the first controller, role information requested by the first controller, and priority information of the first controller.
6. The method of claim 5, wherein the generating the role request message according to the priority of the device comprises:
acquiring the priority of each controller in the cluster when the controller joins the cluster;
if the priorities of the controllers are obtained, comparing the priorities of the controllers, and generating the role request message according to the priority of the equipment when the priority of the equipment is the highest priority of the priorities of the controllers;
and if the priority of each controller is not acquired, generating the role request message according to the priority of the equipment.
7. The method of claim 5, further comprising:
identifying information carried in a role status message from the network switching equipment, wherein the role status message is a message which is sent by the network switching equipment and used for announcing role information when a third controller applies for role change, and the role status message comprises an equipment identifier of the third controller, role information requested by the third controller and priority information of the third controller;
when the device is a master controller, comparing the priority of the third controller with the priority of the device under the condition that the role information requested by the third controller in the role state information is the master controller and the priority information in the role state information is the priority of the third controller;
and when the priority of the third controller is higher than that of the third controller, sending a role request message for requesting to change the role of the third controller to the slave controller to the network switching equipment.
8. The method of claim 5, wherein prior to sending the role request message to the network switching device, the method further comprises:
and if the equipment is determined to be elected as the main controller, generating a role request message which comprises the generation id, the role information as the main controller and the priority information as a null value according to the distributed generation id.
9. The method of claim 5, further comprising:
when the cluster is divided into a plurality of sub-clusters, interacting with other controllers in the sub-cluster to which the equipment belongs to determine whether the equipment continues to survive;
if the equipment is determined to continue to survive, reestablishing the Openflow connection with the network switching equipment;
and if the equipment is determined not to survive any more, closing the service corresponding to the network switching equipment.
10. A network switching device, comprising:
a processor and a machine-readable storage medium having stored thereon machine-executable instructions, the processor executing the machine-executable instructions to implement the method of any one of claims 1 to 4.
11. A machine-readable storage medium having stored thereon machine-executable instructions which, when invoked and executed by a processor, cause the processor to implement the method of any of claims 1 to 4.
12. A controller, comprising:
a processor and a machine-readable storage medium having stored thereon machine-executable instructions, the processor executing the machine-executable instructions to implement the method of any one of claims 5 to 9.
13. A machine-readable storage medium having stored thereon machine-executable instructions which, when invoked and executed by a processor, cause the processor to carry out the method of any one of claims 5 to 9.
14. A network system, characterized in that the network system comprises a controller and a network switching device;
the network switching device includes: a processor and a machine-readable storage medium having stored thereon machine-executable instructions, the processor executing the machine-executable instructions to implement the method of any one of claims 1 to 4;
the controller includes: a processor and a machine-readable storage medium having stored thereon machine-executable instructions, the processor executing the machine-executable instructions to implement the method of any one of claims 5 to 9.
CN201810531903.0A 2018-05-29 2018-05-29 Controller role determination method, network switching equipment, controller and network system Active CN108881059B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810531903.0A CN108881059B (en) 2018-05-29 2018-05-29 Controller role determination method, network switching equipment, controller and network system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810531903.0A CN108881059B (en) 2018-05-29 2018-05-29 Controller role determination method, network switching equipment, controller and network system

Publications (2)

Publication Number Publication Date
CN108881059A CN108881059A (en) 2018-11-23
CN108881059B true CN108881059B (en) 2022-05-24

Family

ID=64335554

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810531903.0A Active CN108881059B (en) 2018-05-29 2018-05-29 Controller role determination method, network switching equipment, controller and network system

Country Status (1)

Country Link
CN (1) CN108881059B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111586079B (en) * 2019-02-15 2022-04-12 阿里巴巴集团控股有限公司 Communication method, system, control terminal, controlled terminal, device and storage medium
CN115004655B (en) * 2020-02-18 2023-10-10 华为技术有限公司 System and method for Border Gateway Protocol (BGP) controlled network reliability
US20240015351A1 (en) * 2020-09-03 2024-01-11 Telefonaktiebolaget Lm Ericsson (Publ) A computer software module arrangement, a circuitry arrangement, a device, a system and a method for improved control of media casting
CN112583708B (en) * 2020-12-25 2022-08-30 新华三技术有限公司 Connection relation control method and device and electronic equipment
CN113225201B (en) * 2021-02-05 2022-05-24 新华三大数据技术有限公司 Information synchronization method and device
CN113098720A (en) * 2021-04-06 2021-07-09 辽宁大学 Multiple safe SDN control system and control method thereof
CN113489601B (en) * 2021-06-11 2024-05-14 海南视联通信技术有限公司 Anti-destruction method and device based on autonomous cloud network architecture of video networking

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104468231A (en) * 2014-12-23 2015-03-25 上海斐讯数据通信技术有限公司 SDN interchanger and controller dynamic registration method
CN104601365A (en) * 2014-12-05 2015-05-06 杭州华三通信技术有限公司 Monitoring method and device for node device
CN106230622A (en) * 2016-07-22 2016-12-14 杭州华三通信技术有限公司 A kind of cluster implementation method and device
CN107181720A (en) * 2016-03-11 2017-09-19 中兴通讯股份有限公司 A kind of method and device of software definition networking SDN secure communications

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150195162A1 (en) * 2014-01-06 2015-07-09 Google Inc. Multi-Master Selection in a Software Defined Network
CN107124300B (en) * 2017-04-01 2020-03-17 西安交通大学 Switch migration method in software defined network

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104601365A (en) * 2014-12-05 2015-05-06 杭州华三通信技术有限公司 Monitoring method and device for node device
CN104468231A (en) * 2014-12-23 2015-03-25 上海斐讯数据通信技术有限公司 SDN interchanger and controller dynamic registration method
CN107181720A (en) * 2016-03-11 2017-09-19 中兴通讯股份有限公司 A kind of method and device of software definition networking SDN secure communications
CN106230622A (en) * 2016-07-22 2016-12-14 杭州华三通信技术有限公司 A kind of cluster implementation method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
软件定义联网分布式控制机制和实现方法研究;李婉;《CNKI优秀硕士学位论文全文库》;20180215;第37-41页 *

Also Published As

Publication number Publication date
CN108881059A (en) 2018-11-23

Similar Documents

Publication Publication Date Title
CN108881059B (en) Controller role determination method, network switching equipment, controller and network system
US11528167B2 (en) Method and device for implementing gateway cooperation, IoT gateway and storage medium
CN103503540A (en) System and method for peer to peer communications in cellular communications systems
CN109981468B (en) Link state maintenance method and device
CN110290561B (en) Local service sending method and network equipment
US7898993B2 (en) Efficiency and resiliency enhancements for transition states in ad hoc networks
CN110808948A (en) Remote procedure calling method, device and system
US20170078382A1 (en) Group reformation mechanism for reducing disruption time in wireless peer to peer networks
WO2020043209A1 (en) Disconnected network state reporting method and apparatus, and storage medium
WO2021028053A1 (en) Devices and methods for supporting handover of ue
JP2012531161A (en) Communication device, communication method and product
CN107547374B (en) Aggregation route processing method and device
WO2019101101A1 (en) Communication method and apparatus
JP2003338839A (en) Mobile communication system using rsvp
CN110611615B (en) Routing information transmission method and device
JP2007142945A (en) Terminal device, wireless communication method, and wireless communication program
WO2018077313A1 (en) Connection capability notification method and device
CN103001987B (en) A kind of data processing method and data processing node
CN107431634A (en) A kind of method, apparatus and system of the interface established between VNFM
WO2016177135A1 (en) Resource management method, device, and control terminal
CN108306948B (en) Scheduling method and device
JP2004282474A (en) Radio channel number control method
US20170222879A1 (en) Service optimization method, transport controller, client controller, and system
CN116436755B (en) Network management method and device and electronic equipment
CN103166922A (en) Call request processing method, system and device in peer to peer overlay network

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20230609

Address after: 310052 11th Floor, 466 Changhe Road, Binjiang District, Hangzhou City, Zhejiang Province

Patentee after: H3C INFORMATION TECHNOLOGY Co.,Ltd.

Address before: 310052 Changhe Road, Binjiang District, Hangzhou, Zhejiang Province, No. 466

Patentee before: NEW H3C TECHNOLOGIES Co.,Ltd.

TR01 Transfer of patent right