# US 2017/0289026 A1 · Switch processing method, controller, switch, and switch processing system

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2017/0289026 A1
- Document ID: US20170289026A1
- Status: Published application
- Kind: A1
- Application number: 15/499,163
- Filed: 2017-04-27
- Published: 2017-10-05
- Earliest claimed: 2014-10-28
- Assignees: Huawei Technologies Co., Ltd.
- Applicants: Huawei Technologies Co., Ltd.
- Inventors: Weiqi HU
- Web page: https://patentgrep.com/patent/US20170289026A1

## CPC

- H04L 45/38: {Flow based routing}
- H04L 45/64: using an overlay routing layer
- H04L 49/70: {Virtual switches}
- H04L 45/583: {Stackable routers}
- H04L: TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION (arrangements common to telegraphic and telephonic communication H04M)

## Abstract

Embodiments of the present invention provide a switch processing method, a controller, a switch, and a switch processing system. The method provided by the embodiments of the present invention is executed by the controller and a logical Switch, where the logical Switch includes at least two physical Switches. The method includes: allocating, by the controller, a flow table of the logical Switch to each physical Switch; sending, by the controller, mapping information, so that each physical Switch obtains the mapping information; and sending, by the controller, flow entries, so that each physical Switch obtains flow entries corresponding to each physical switch and processes a data packet. For the logical Switch for executing the method provided by the embodiments of the present invention, new physical Switches may be stacked on a basis of a physical structure of the logical Switch.

## Claims

### Claim 1

A switch processing method, wherein the method is executed by a controller and a logical switch, the logical Switch comprises at least two physical Switches, and the method comprises:
allocating, by the controller, a flow table in multiple flow tables of the logical Switch to each physical Switch, wherein the multiple flow tables are a pipeline of the logical Switch;
sending, by the controller, mapping information, so that each physical Switch obtains the mapping information, wherein the mapping information comprises a mapping relationship between the physical Switch and each flow table in the multiple flow tables; and
sending, by the controller, flow entries to the logical Switch, so that each physical Switch obtains flow entries corresponding to each physical switch and processes a received data packet according to the flow entries or according to the flow entries and the mapping information, wherein the flow entries are content information of each flow table in a flow table set allocated by the controller to each physical Switch.

### Claim 2 (depends on 1)

The method according to claim 1, wherein the at least two physical Switches comprise a primary Switch and a first extended Switch, wherein the controller is connected to at least the primary Switch, and the first extended Switch is connected to at least the primary Switch;
the sending, by the controller, mapping information, comprises:
sending, by the controller, the mapping information to at least the primary Switch, so that the primary Switch receives the mapping information and the mapping information received by the first extended Switch comprises the mapping information sent by the controller and/or the primary Switch; and
the sending, by the controller, flow entries to the logical Switch, comprises:
sending, by the controller, the flow entries of the logical Switch to at least the primary Switch, so that the flow entries received by the primary Switch comprise flow entries corresponding to the primary Switch or the flow entries corresponding to each physical Switch and flow entries received by the first extended Switch comprise flow entries sent by the controller and/or the primary Switch.

### Claim 3 (depends on 2)

The method according to claim 2, wherein the physical Switches further comprise a second extended Switch, and the second extended Switch is connected to at least the first extended Switch;
the sending, by the controller, mapping information, comprises:
sending, by the controller, the mapping information to at least the primary Switch, so that the primary Switch receives the mapping information, the mapping information received by the first extended Switch comprises the mapping information sent by the controller and/or the primary Switch, and the mapping information received by the second extended Switch comprises the mapping information sent by the controller and/or the primary Switch and/or the first extended Switch; and
the sending, by the controller, flow entries to the logical Switch, comprises:
sending, by the controller, the flow entries of the logical Switch to at least the primary Switch, so that the flow entries received by the primary Switch comprise flow entries corresponding to the primary Switch or flow entries corresponding to the primary Switch and flow entries corresponding to the first extended Switch and/or the second extended Switch, flow entries received by the first extended Switch comprise flow entries corresponding to the first extended Switch and sent by the controller and/or the primary Switch, and flow entries received by the second extended Switch comprise flow entries corresponding to the second extended Switch and sent by the controller and/or the primary Switch and/or the first extended Switch.

### Claim 4 (depends on 2)

The method according to claim 2, wherein a flow table allocated by the controller to the primary Switch comprises at least a first flow table (table0) in the multiple flow tables of the logical Switch, so that when the primary Switch receives the data packet, the primary Switch processes the data packet by using the table0.

### Claim 5 (depends on 1)

The method according to claim 1, wherein the sending, by the controller, flow entries to the logical Switch, comprises:
sending, by the controller, the flow entries to the logical Switch, so that when a current physical Switch receives the data packet, the current physical Switch processes the data packet by using a current flow table, determines a location of a next flow table according to the mapping information, and when the determined next flow table is located in the current physical Switch, directs the data packet to the next flow table to continue processing, or when the determined next flow table is located in another physical Switch, initiates pipeline environment protection to generate an encapsulation packet, and sends the encapsulation packet to the physical Switch corresponding to the next flow table.

### Claim 6 (depends on 1)

The method according to claim 1, wherein the sending, by the controller, flow entries to the logical Switch, comprises:
when a to-be-sent flow entry comprises a flow table jump instruction, determining, by the controller, whether a next flow table is located in a current physical Switch; and
when determining that the next flow table is located in the current physical Switch, sending, by the controller, the flow entry comprising the flow table jump instruction to the current physical Switch, so that the current physical Switch directs the data packet to the next flow table to continue processing; or
when determining that the next flow table is located in another physical Switch, replacing, by the controller, the flow table jump instruction in the to-be-sent flow entry with a Switch forwarding instruction, and sending the flow entry comprising the Switch forwarding instruction to the current physical Switch, so that the current physical Switch initiates pipeline environment protection to generate an encapsulation packet and sends the encapsulation packet to the physical Switch corresponding to the next flow table.

### Claim 7 (depends on 5)

The method according to claim 5, wherein the pipeline environment protection is that the current physical Switch encapsulates the data packet and related information for processing the data packet into the encapsulation packet, wherein the related information for processing the data packet comprises at least a identity of the next flow table, and further comprises any quantity of the following information: an ingress port (Ingress port), an action set (Action set) currently corresponding to the data packet, and metadata (Metadata).

### Claim 8 (depends on 5)

The method according to claim 5, wherein the pipeline environment protection is used to enable the physical Switch corresponding to the next flow table to parse the encapsulation packet received by the physical Switch and obtain parsed information, so as to perform pipeline environment recovery according to the parsed information and direct the data packet to the next flow table to continue processing, wherein the parsed information comprises the data packet and the related information for processing the data packet.

### Claim 9 (depends on 5)

The method according to claim 5, wherein the flow entries corresponding to the extended Switch and sent by the controller comprise a flow entry used for performing pipeline recovery; and the method further comprises:
sending, by the controller, the flow entry used for performing pipeline recovery to the extended Switch, so that the extended Switch adds the flow entry to a first flow table table0′ of the extended Switch and when the encapsulation packet is received, performs pipeline environment recovery by using the flow entry added to the table0′.

### Claim 10 (depends on 9)

The method according to claim 9, wherein the encapsulation packet comprises the ID of the next flow table, and the flow entry used for performing pipeline recovery comprises a match part and an executable instruction, wherein the match part is used by the extended Switch to take the ID of the next flow table as a match object corresponding to the flow entry, and the executable instruction comprises a flow table recovery instruction and/or a flow table jump instruction; and
the pipeline environment recovery is that the extended Switch matches, by using the flow entry in the table0′, the encapsulation packet received by the extended Switch, and when the ID of the next flow table matches the flow entry in the table0′, executes the flow table recovery instruction and/or the flow table jump instruction in the matched flow entry in sequence according to a match result.

### Claim 11

A controller, connected to a logical switch, wherein the logical Switch comprises at least two physical Switches, and the controller comprises:
a processor, configured to allocate each flow table in multiple flow tables of the logical Switch to each physical Switch, wherein the multiple flow tables are a pipeline of the logical Switch; and
a transmitter, in communication with the processor and configured to send mapping information, so that each physical Switch obtains the mapping information, wherein the mapping information comprises a mapping relationship between the physical Switch and each flow table in the multiple flow tables; wherein
the transmitter is further configured to send flow entries to the logical Switch, so that each physical Switch obtains flow entries corresponding to each physical switch and processes a received data packet according to the flow entries or according to the flow entries and the mapping information, wherein the flow entries are content information of each flow table in a flow table set allocated by the controller to each physical Switch.

### Claim 12 (depends on 11)

The controller according to claim 11, wherein the at least two physical Switches comprise a primary Switch and a first extended Switch, wherein the controller is connected to at least the primary Switch, and the first extended Switch is connected to at least the primary Switch;
that the transmitter is configured to send mapping information comprises: sending the mapping information to at least the primary Switch, so that the primary Switch receives the mapping information and that the mapping information received by the first extended Switch comprises the mapping information sent by the controller and/or the primary Switch; and
that the transmitter is further configured to send flow entries to the logical Switch comprises: sending the flow entries of the logical Switch to at least the primary Switch, so that the flow entries received by the primary Switch comprise flow entries corresponding to the primary Switch or the flow entries corresponding to each physical Switch and that flow entries received by the first extended Switch comprise flow entries sent by the controller and/or the primary Switch.

### Claim 13 (depends on 12)

The controller according to claim 12, wherein the physical Switches further comprise a second extended Switch, and the second extended Switch is connected to at least the first extended Switch;
that the transmitter is configured to send mapping information comprises: sending the mapping information to at least the primary Switch, so that the primary Switch receives the mapping information, the mapping information received by the first extended Switch comprises the mapping information sent by the controller and/or the primary Switch, and the mapping information received by the second extended Switch comprises the mapping information sent by the controller and/or the primary Switch and/or the first extended Switch; and
that the transmitter is further configured to send flow entries to the logical Switch comprises: sending the flow entries of the logical Switch to at least the primary Switch, so that the flow entries received by the primary Switch comprise flow entries corresponding to the primary Switch or flow entries corresponding to the primary Switch and flow entries corresponding to the first extended Switch and/or the second extended Switch, flow entries received by the first extended Switch comprise flow entries corresponding to the first extended Switch and sent by the controller and/or the primary Switch, and flow entries received by the second extended Switch comprise flow entries corresponding to the second extended Switch and sent by the controller and/or the primary Switch and/or the first extended Switch.

### Claim 14 (depends on 12)

The controller according to claim 12, wherein a flow table allocated by the processor to the primary Switch comprises at least a first flow table table0 in the multiple flow tables of the logical Switch, so that when the primary Switch receives the data packet, the primary Switch processes the data packet by using the table0.

### Claim 15 (depends on 11)

The controller according to claim 11, wherein that the transmitter is further configured to send flow entries to the logical Switch comprises: sending the flow entries to the logical Switch, so that when a current physical Switch receives the data packet, the current physical Switch processes the data packet by using a current flow table, determines, according to the mapping information sent by the transmitter, whether a next flow table is located in the current physical Switch, and if yes, directs the data packet to the next flow table to continue processing, or if no, initiates pipeline environment protection to generate an encapsulation packet, and sends the encapsulation packet to a physical Switch corresponding to the next flow table.

### Claim 16 (depends on 11)

The controller according to claim 11, wherein that the transmitter is further configured to send flow entries to the logical Switch comprises: when a to-be-sent flow entry comprises a flow table jump instruction, determining whether a next flow table is located in the current physical Switch; and if yes, sending the flow entry comprising the flow table jump instruction to the current physical Switch, so that the current physical Switch directs the data packet to the next flow table to continue processing; or if no, replacing the flow table jump instruction in the to-be-sent flow entry with a Switch forwarding instruction, and sending the flow entry comprising the Switch forwarding instruction to the current physical Switch, so that the current physical Switch initiates pipeline environment protection to generate an encapsulation packet and sends the encapsulation packet to a physical Switch corresponding to the next flow table.

### Claim 17 (depends on 15)

The controller according to claim 15, wherein the pipeline environment protection is that the current physical Switch encapsulates the data packet and related information for processing the data packet into the encapsulation packet, wherein the related information for processing the data packet comprises at least a number ID of the next flow table, and further comprises any quantity of the following information: an ingress port (Ingress port), an action set (Action set) currently corresponding to the data packet, and metadata (Metadata).

### Claim 18 (depends on 15)

The controller according to claim 15, wherein the pipeline environment protection is used to enable the physical Switch corresponding to the next flow table to parse the encapsulation packet received by the physical Switch and obtain parsed information, so as to perform pipeline environment recovery according to the parsed information and direct the data packet to the next flow table to continue processing, wherein the parsed information comprises the data packet and the related information for processing the data packet.

### Claim 19 (depends on 15)

The controller according to claim 15, wherein the flow entries corresponding to the extended Switch and sent by the transmitter comprise a flow entry used for performing pipeline recovery; and the transmitter is further configured to send the flow entry used for performing pipeline recovery to the extended Switch, so that the extended Switch adds the flow entry to a first flow table table0′ of the extended Switch and when the encapsulation packet is received, performs pipeline environment recovery by using the flow entry added to the table0′.

### Claim 20 (depends on 19)

The controller according to claim 19, wherein the encapsulation packet comprises the ID of the next flow table, and the flow entry used for performing pipeline recovery and sent by the transmitter comprises a match part and an executable instruction, wherein the match part is used by the extended Switch to take the ID of the next flow table as a match object corresponding to the flow entry, and the executable instruction comprises a flow table recovery instruction and/or a flow table jump instruction; and
the pipeline environment recovery is that the extended Switch matches, by using the flow entry in the table0′, the encapsulation packet received by the extended Switch, and when the ID of the next flow table matches the flow entry in the table0′, executes the flow table recovery instruction and/or the flow table jump instruction in the matched flow entry in sequence according to a match result.
