Patent Description:
A cluster switching system (CSS, Cluster Switch System), also referred to as a stack, means that multiple switches are combined together and virtualized into one switching device. When a stack is set up, switches that form the stack send a stack contention packet to each other, to elect an active switch according to a preset rule, and the active switch is used to manage the cluster switch system.

After the active switch is determined, only the active switch can register with a controller. The active switch sends a registration request to the controller, and the active switch and the controller interact with each other after a channel is established. However, in the prior art, after an active switch is elected, the active switch does not change, and only the active switch can register with a controller. If the registration of the active switch fails, the active switch continuously initiates new registration. When the active switch does not change, a result is still a registration failure. As a result, a stack device is in a hosted state for a long time until intervention of operation and maintenance personnel.

For example, <CIT> refers to a virtual cluster establishment method and a network device. The method includes: a first network device establishes, a network-layer-based first communication connection with a second network device; the first network device sends a first registration request message to the second network device through the first communication connection, where the first registration request message is used to establish a virtual cluster with the second network device; after the first network device receives a registration response message, selecting the second network device as an active main control device in the virtual cluster system; establishes, a network-layer-based second communication connection with a third network device; sends, a second registration request message to the third network device; and selects the third network device as a standby main control device. In this invention, a structure of a cluster is simplified, and scalability of the cluster is improved.

Further, <CIT> refers to a computing system. The computing system includes processing circuitry, one or more ports, a persistent storage module, and a management module. The persistent storage module stores a plurality of persistent storage instances associated with a plurality of switch groups. A respective persistent storage instance stores configuration information associated with a switch group in a data structure. The management module identifies at least two switch groups, which are associated with a logical network, from the plurality of switch groups and configures a respective virtual network representing the logical network in a respective identified switch group. The management module also maintains a mapping between a respective virtual network and the logical network.

<CIT> refers to a Controlling Bridge (CB) receiving a VCF registration request packet sent by a Port Extender (PE) and sets an interface state of a VCF interface receiving the VCF registration request packet from initial state to blocked state. The CB returns a VCF registration response packet to the PE and receives a VCF registration acknowledge packet returned by the PE after the PE receives the VCF registration response packet. The CB sets interface state of a VCF interface sending the VCF registration request packet from blocked state to forwarding state; sets interface state of the VCF interface receiving the VCF registration request packet as forwarding state, and establishing successfully a VCF link with the PE.

<CIT> refers to a Controlling Bridge (CB) receiving a VCF registration request packet sent by a Port Extender (PE) and setting an interface state of a VCF interface receiving the VCF registration request packet from initial state to blocked state. The CB returns a VCF registration response packet to the PE and receives a VCF registration acknowledge packet returned by the PE after the PE receives the VCF registration response packet. The CB sets interface state of a VCF interface sending the VCF registration request packet from blocked state to forwarding state; sets interface state of the VCF interface receiving the VCF registration request packet as forwarding state, and establishing successfully a VCF link with the PE.

This application provides a data processing method and a device, so that a controller can also participate in a procedure of electing an active switch, thereby improving active switch election efficiency. This problem is solved by the subject matter of the independent claims. Further implementation forms are provided in the dependent claims.

Compared with the prior art, in the solutions of this application, the controller also participates in a procedure of electing the active switch. This avoids a problem in the prior art caused by a registration failure when an active switch determined by means of switch election registers with a controller, and improves active switch election efficiency.

The following describes the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention.

In the specification, claims, and accompanying drawings of the embodiments of the present invention, the terms "first", "second", "third", "fourth", and so on (if existent) are intended to distinguish between similar objects but do not necessarily describe a specific order or sequence. It should be understood that the data termed in such a way is interchangeable in proper circumstances so that the embodiments described herein can be implemented in other orders than the order illustrated or described herein. Moreover, the terms "include" and any other variants mean to cover the non-exclusive inclusion, for example, a process, method, system, product, or device that includes a series of steps or units is not necessarily limited to those expressly listed steps or units, but may include other steps or units not expressly listed or inherent to such a process, method, system, product, or device.

A cluster switch system, also referred to as a stack system, means that multiple switches are combined together and virtualized into one switch. An active switch is elected from switches that form a stack, and subsequently, the active switch is used to manage the stack system. In one aspect, a quantity of ports increases in the stack system, and a relatively wide broadband link can be established between the switches. In another aspect, the multiple switches can serve as one large switch, thereby facilitating centralized management.

Referring to <FIG> shows a diagram of a possible system architecture according to an embodiment of the present invention. The system architecture includes a controller, a target switch, and another switch. The target switch and the another switch belong to a same stack system. The another switch may be one switch or multiple switches. This is not limited herein. The controller can mutually communicate with each switch in the stack system, and the switches can also communicate with each other. In the solution of this embodiment of the present invention, one switch needs to be elected from the stack system as an active switch, so as to implement centralized management of the stack system.

Referring to <FIG> and <FIG>, an embodiment of a data processing method provided in an embodiment of the present invention includes the following steps.

A controller receives a registration request sent by a target switch.

The target switch sends the registration request to the controller when in a no-active state. Correspondingly, the controller receives the registration request sent by the target switch. It can be understood that, the controller receives registration requests of multiple switches in a same stack system in a no-active state, and the target switch is merely one switch in the stack system. The controller also receives a registration request of another switch in the stack system, and sequentially performs processing according to a request receiving sequence or performs processing according to a preset priority.

Specifically, in this embodiment of the present invention, a switch in the stack system sends a registration request to the controller when in a no-active state. The no-active state may be the following several scenarios. In one scenario, switches in the stack system are just powered on. Because all the switches in the stack system are just powered on, no active switch has been elected, and the stack system is in the no-active state, in other words, switches in the system is in the no-active state. In another scenario, the active switch is faulty, but the active switch is still connected to a standby switch. The active switch sends, to the standby switch, a message indicating that the active switch loses an active switch identity, and the stack system changes back to the no-active state from an active state, in other words, switches in the system changes to the no-active state. In still another scenario, the active switch has been disconnected from the standby switch. A disconnection cause may be that a link between the active switch and the standby switch is faulty, or may be that the active switch is faulty. The standby switch may detect a disconnection from the active switch and determine that the stack system is in the no-active state. In the no-active state, the switches in the stack system send the registration requests to the controller at the same time or according to a preset sequence, to reelect an active switch.

The controller queries for actual stack information of the target switch.

Specifically, that the controller queries for the actual stack information of the target switch may include step 202a and step 202b.

The controller sends a stack information query request to the target switch.

Correspondingly, the target switch receives the stack information query request sent by the controller.

The controller receives the actual stack information sent by the target switch. Correspondingly, the target switch sends the actual stack information of the target switch to the controller.

The actual stack information is information about a stack to which the target switch actually belongs. Because the switches in the same stack system are connected to each other, the target switch may record information about another switch that is connected to the target switch. That is, the target switch stores the information about the stack to which the target switch actually belongs. Specifically, the actual stack information includes an identifier set of switches in the stack to which the target switch actually belongs. An identifier can uniquely identify each switch, and includes but is not limited to a sequence number, a MAC address, or the like of the switch. This is not limited herein.

The controller queries for preset stack information of the target switch.

The preset stack information is a set of identifiers of switches in a preset stacking system to which the target switch belongs. A switch identifier can uniquely identify each switch, and includes but is not limited to a sequence number, a MAC address, or the like of the switch. This is not limited herein.

Because the actual stack information includes an identifier of the target switch, the controller may query for the preset stack information of the target switch according to the identifier of the target switch.

The controller determines whether the actual stack information matches the preset stack information.

Specifically, that the actual stack information matches the preset stack information means that the identifier set included in the actual stack information is the same as the identifier set included in the preset stack information, and specifically means that both quantities of included switches and identifiers of the switches are the same. The controller may first determine whether the quantities of the switches in the actual stack information and in the preset stack information are the same, and when the quantities are the same, determine whether the identifiers are the same. A specific implementation is not limited herein.

If the identifier set of the switches in the stack to which the target switch actually belongs matches an identifier set of switches in the stack to which the target switch is preset to belong, the controller determines that the actual stack information of the target switch matches the preset stack information of the controller, and step <NUM> is performed.

If the identifier set of the switches in the stack to which the target switch actually belongs does not match the identifier set of the switches in the stack to which the target switch is preset to belong, the controller determines that the actual stack information of the target switch does not match the preset stack information of the controller, and step <NUM> is performed.

The controller generates alarm information.

Specifically, a case in which the actual stack information does not match the preset stack information includes: If the identifier set included in the actual stack information is a subset of the identifier set included in the preset stack information, it indicates that stack splitting occurs. In this case, the controller generates splitting alarm information.

It should be noted that, in some other implementations, an active switch of a split stack can still continue to be elected in a case of stack splitting, and step <NUM> may continue to be performed after step <NUM>.

A case in which the actual stack information does not match the preset stack information further includes: If the actual stack information includes an identifier that does not exist in the preset stack information, it indicates that there is a connection error in an actual stack, or that there is an error in the preset stack information. In this case, regardless of whether a quantity of identifiers in the identifier set included in the actual stack information is greater than, equal to, or less than a quantity of identifiers in the identifier set included in the preset stack information, the controller generates configuration error alarm information, and waits for intervention of management personnel.

The controller queries whether there is an active switch that has successfully registered.

After determining a switch that has successfully registered, the controller modifies label information of the switch in the preset stack information, to identify that the switch is the active switch. The controller may determine, by querying label information of each switch in the preset stack information, whether there is the active switch that has successfully registered. If there is no active switch that has successfully registered, step <NUM> and step <NUM> are performed. If there is an active switch that has successfully registered, step <NUM> and step <NUM> are performed.

The controller sends a registration failure message to the target switch.

Correspondingly, the target switch receives the registration failure message sent by the controller. The registration failure message includes information about the active switch that has successfully registered.

It should be noted that, after receiving a registration success message, the switch that has successfully registered declares its active switch identity to the another switch in the stack system, so that the another switch stops sending the registration request to the controller. However, the target switch may have not received an identity declaration message of the active switch until the target switch sends the registration request. Therefore, even if there is an active switch that has successfully registered, the target switch may still receive the registration failure message.

The target switch becomes a standby switch and stops sending the registration request to the controller.

After obtaining the information about the active switch from the registration failure message, the target switch automatically becomes the standby switch and stops sending the registration request to the controller. Specifically, the target switch may modify label information to identify itself as a standby switch. This is not limited herein.

The controller queries for basic information of the target switch.

Specifically, step <NUM> may include step 209a and step 209b.

The controller sends a basic information query request to the target switch.

Correspondingly, the target switch receives the basic information query request sent by the controller.

The controller receives the basic information of the target switch sent by the target switch. Correspondingly, the target switch sends the basic information of the target switch to the controller. The basic information includes but is not limited to a device type, model, and version of the target switch.

In this embodiment, the target switch sends the actual stack information of the target switch to the controller after receiving the stack information query request of the controller, and the target switch sends the basic information of the target switch to the controller after receiving the basic information query request of the controller. In some possible implementations, the controller may send only one query request. The query request is used to obtain the actual stack information and the basic information of the target switch. Correspondingly, after receiving the query request, the target switch sends the actual stack information and the basic information of the target switch to the controller. This is not limited herein.

The controller determines whether the basic information is verified.

Specifically, the controller presets the basic information of the target switch. If the basic information that is of the target switch and preset by the controller matches the basic information sent by the target switch, the controller determines that the basic information of the target switch is verified, and step <NUM> to step <NUM> are performed. If the basic information that is of the target switch and preset by the controller does not match the basic information sent by the target switch, step <NUM> is performed.

The controller sends a registration success message to the target switch.

Correspondingly, the target switch receives the registration success message sent by the controller and determines itself as an active switch. It should be noted that, the controller may identify the target switch as an active switch by modifying label information that is of the target switch and preset on the controller, and identify the another switch in the same stack system as a standby switch. In this way, the controller can identify, according to the label information of the switch, which switch is the active switch. Similarly, the target switch may also identify itself as an active switch by modifying label information preset on the target switch.

The target switch sends, to another switch, a message indicating that the target switch is an active switch.

After becoming the active switch, the target switch sends, to the another switch in the same stack system, a notification message indicating that the target switch becomes the active switch, so as to declare that the target switch has the active switch identity. Correspondingly, after receiving the notification message, the another switch identifies itself as a standby switch if the another switch is still in the no-active state.

The another switch becomes a standby switch and stops sending the registration request to the controller.

It should be noted that the another switch may identify itself as a standby switch by modifying preset label information.

Correspondingly, the target switch receives the registration failure message sent by the controller. Different from step <NUM>, the registration failure message does not include the information about the active switch, and the target switch continues to send the registration request to the controller after receiving the registration failure message.

In the solution of this embodiment of the present invention, the controller also participates in a procedure of electing the active switch. This avoids a problem in the prior art caused by a registration failure when an active switch determined by means of switch election registers with a controller, and improves active switch election efficiency. In addition, this embodiment of the present invention may further be applied to stack splitting detection and alarm generation.

The foregoing mainly describes the solutions in the embodiments of the present invention from a perspective of interaction between devices. It can be understood that, to implement the foregoing functions, each device, such as the controller or the target switch, includes a corresponding hardware structure and/or software module for performing each function. A person skilled in the art may be easily aware that, in combination with the example units and algorithm steps described in the embodiments disclosed in this specification, the embodiments of the present invention can be implemented by hardware or a combination of hardware and computer software. Whether a function is performed by hardware or in a form of computer software-driven hardware depends on particular applications and design constraint conditions of the technical solutions. For the particular applications, a person skilled in the art may use different methods to achieve the described functions, but it should not be considered that the implementation goes beyond the scope of the embodiments of the present invention.

Division of functional units may be performed on the controller, the target switch, and the like according to the foregoing method examples in the embodiments of the present invention. For example, each functional unit may be divided according to each function, or at least two functions may be integrated into one processing unit. It should be noted that the unit division in the embodiments of the present invention is an example, and is merely logical function division and may be other division in actual implementation.

<FIG> shows a possible schematic structural diagram of a controller. The controller <NUM> includes a processing unit <NUM> and a communications unit <NUM>. The processing unit <NUM> is configured to control and manage actions of the controller <NUM>. For example, the processing unit <NUM> is configured to support the controller <NUM> to perform step <NUM> to step <NUM>, and step <NUM> in <FIG> and <FIG>, and/or another process of the technology described in this specification. The communications unit <NUM> is configured to support communication between the controller <NUM> and another network device, for example, communication between the target switch, the another switch, and the like shown in <FIG> and <FIG>, and may be specifically configured to perform step <NUM> and step <NUM>, step <NUM>, step <NUM>, step <NUM>, and step <NUM> in <FIG> and <FIG>. The controller <NUM> may further include a storage unit <NUM>, configured to store program code and data of the controller <NUM>.

The processing unit <NUM> may be a processor, including a general purpose processor, for example, a central processing unit (English: Central Processing unit, CPU for short) or a network processor (NP), or may include a hardware chip, for example, an application-specific integrated circuit (English: Application-Specific Integrated Circuit, ASIC for short), a programmable logic device (English: programmable logic device, PLD for short), or a combination thereof. The PLD may be a complex programmable logic device (English: complex programmable logic device, CPLD for short), a field-programmable logic gate array (English: field-programmable gate array, FPGA for short), a generic array logic (English: generic array logic, GAL for short), or any combination thereof. The processing unit <NUM> may implement or execute various example logical blocks, modules, and circuits described with reference to content disclosed in the embodiments of the present invention. Alternatively, the processor may be a combination implementing a computing function, for example, a combination including one or more microprocessors, or a combination of a digital information processor and a microprocessor.

The communications unit <NUM> includes a communications interface, a transceiver, a transceiver circuit, and the like. The communications interface is a general term and may include one or more interfaces. The communications interface may be a wired communications interface, a wireless communications interface, or a combination thereof, and the wired communications interface may be, for example, an Ethernet interface. The Ethernet interface may be an optical interface, an electrical interface, or a combination thereof. The wireless communications interface may be a WLAN interface, a cellular network communications interface, a combination thereof, or the like.

The storage unit <NUM> may be a memory, including a volatile memory (English: volatile memory), for example, a random-access memory (English: random-access memory, RAM for short). Alternatively, the memory may include a non-volatile memory (English: non-volatile memory), for example, a flash memory (English: flash memory), a hard disk drive (English: hard disk drive, HDD for short), or a solid-state drive (English: solid-state drive, SSD for short). Alternatively, the memory may include a combination of the foregoing types of memories.

When the processing unit <NUM> is a processor, the communications unit <NUM> is a transceiver, and the storage unit <NUM> is a memory, the controller in the embodiments of the present invention may be a controller shown in <FIG>.

Referring to <FIG>, the controller <NUM> includes a processor <NUM>, a transceiver <NUM>, and a memory <NUM>. Optionally, the controller <NUM> may further include a bus <NUM>. The transceiver <NUM>, the processor <NUM>, and the memory <NUM> may be connected to each other by using the bus <NUM>. The bus <NUM> may be classified into an address bus, a data bus, a control bus, and the like. For ease of representation, only one thick line is used to represent the bus <NUM> in <FIG>, but this does not mean that there is only one bus or only one type of bus.

<FIG> shows a possible schematic structural diagram of a target switch. The target switch <NUM> includes a processing unit <NUM> and a communications unit <NUM>. The processing unit <NUM> is configured to control and manage actions of the target switch <NUM>. For example, the processing unit <NUM> is configured to support the target switch <NUM> to perform step <NUM> in <FIG> and <FIG>, and/or another process of the technology described in this specification. The communications unit <NUM> is configured to support communication between the target switch <NUM> and another network device, for example, communication between the controller, the another switch, and the like shown in <FIG> and <FIG>, and may be specifically configured to perform step <NUM> and step <NUM>, step <NUM>, step <NUM>, step <NUM> and step <NUM>, and step <NUM> in <FIG> and <FIG>. The target switch <NUM> may further include a storage unit <NUM>, configured to store program code and data of the target switch <NUM>.

The processing unit <NUM> may be a processor, including a general purpose processor, for example, a central processing unit or a network processor, or may include a hardware chip, for example, an application-specific integrated circuit, a programmable logic device, or a combination thereof. The programmable logic device may be a complex programmable logic device, a field-programmable gate array, a generic array logic, or any combination thereof. The processing unit <NUM> may implement or execute various example logical blocks, modules, and circuits described with reference to content disclosed in the embodiments of the present invention. Alternatively, the processor may be a combination implementing a computing function, for example, a combination including one or more microprocessors, or a combination of a digital information processor and a microprocessor.

The storage unit <NUM> may be a memory, including a volatile memory, for example, a random-access memory. Alternatively, the memory may include a non-volatile memory, for example, a flash memory, a hard disk drive, or a solid-state drive. Alternatively, the memory may include a combination of the foregoing types of memories.

When the processing unit <NUM> is a processor, the communications unit <NUM> is a transceiver, and the storage unit <NUM> is a memory, the target switch in the embodiments of the present invention may be a target switch shown in <FIG>.

Referring to <FIG>, the target switch <NUM> includes a processor <NUM>, a transceiver <NUM>, and a memory <NUM>. Optionally, the target switch <NUM> may further include a bus <NUM>. The transceiver <NUM>, the processor <NUM>, and the memory <NUM> may be connected to each other by using the bus <NUM>. The bus <NUM> may be classified into an address bus, a data bus, a control bus, and the like. For ease of representation, only one thick line is used to represent the bus <NUM> in <FIG>, but this does not mean that there is only one bus or only one type of bus.

All or some of the foregoing embodiments may be implemented by means of software, hardware, firmware, or any combination thereof. When software is used to implement the embodiments, the embodiments may be implemented completely or partially in a form of a computer program product.

Claim 1:
A data processing method performed by a controller, the method comprising the steps of:
a.) receiving (step <NUM>) a registration request sent by a target switch, wherein the target switch is one of multiple switches that send registration requests to the controller, and the multiple switches belong to a same stack system;
b.) querying (steps 202a, 202b) the target switch for actual stack information of the target switch, wherein the actual stack information is information about a stack to which the target switch actually belongs;
c.) if the actual stack information of the target switch matches preset stack information of the controller, querying (step <NUM>) whether there is an active switch that has successfully registered, wherein the preset stack information is information about a stack that is preset by the controller and that comprises the target switch;
d.) if there is no active switch that has successfully registered, querying (steps 209a, 209b) the target switch for basic information of the target switch;
e.) if the basic information of the target switch is verified, determining that the target switch meets a registration success condition;
f.) after the determination that the target switch meets the registration success condition, sending (step <NUM>) a registration success message to the target switch, and determining the target switch as an active switch of the stack system (step <NUM>).