# US 2018/0324097 A1 · Method for Implementing Load Balancing, Apparatus, and Network System

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

- Number: US 2018/0324097 A1
- Document ID: US20180324097A1
- Status: Published application
- Kind: A1
- Application number: 15/971,443
- Filed: 2018-05-04
- Published: 2018-11-08
- Earliest claimed: 2017-05-05
- Assignees: Huawei Technologies Co., Ltd.
- Applicants: Huawei Technologies Co., Ltd.
- Inventors: Heyang Liu; Qinghua Yan; Li Shen; Meiling Sun; Zhiyu Xie
- Web page: https://patentgrep.com/patent/US20180324097A1

## CPC

- H04L 45/00: Routing or path finding of packets in data switching networks (routing or path finding in wireless networks H04W40/00)
- H04L 45/745: Address table lookup; Address filtering
- H04L 47/125: by balancing the load, e.g. traffic engineering
- H04L 49/25: Routing or path finding in a switch fabric
- H04L: TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION (arrangements common to telegraphic and telephonic communication H04M)

## Abstract

A method for implementing load balancing, an apparatus, and a network system, where a controller obtains a port attribute of each port of a first switch in a mesh network, determines, according to the port attribute of each port of the first switch, a virtual routing and forwarding instance corresponding to each port of the first switch, where all user-side ports of the first switch correspond to a first virtual routing and forwarding instance, generates a forwarding table of the first switch according to a topology of the mesh network and the virtual routing and forwarding instance corresponding to each port of the first switch, where a first forwarding entry of the forwarding table includes the first virtual routing and forwarding instance, a destination network segment and at least two forwarding paths corresponding to the destination network segment, and sends the forwarding table to the first switch.

## Claims

### Claim 1

A method for implementing load balancing, applied to a system comprising a controller and a mesh network, the mesh network comprising a plurality of switches, and the method comprising:
obtaining, by the controller, a port attribute of each port of a first switch, the first switch comprising any switch in the mesh network, and the port attribute indicating that the port is a user-side port or a network-side port;
determining, by the controller according to the port attribute of each port of the first switch, a virtual routing and forwarding instance corresponding to each port of the first switch, the user-side port and the network-side port corresponding to different virtual routing and forwarding instances, and all user-side ports of the first switch corresponding to a first virtual routing and forwarding instance;
generating, by the controller, a forwarding table of the first switch according to a topology of the mesh network and the virtual routing and forwarding instance corresponding to each port of the first switch, a first forwarding entry of the forwarding table comprising the first virtual routing and forwarding instance, a first destination network segment corresponding to the first virtual routing and forwarding instance and at least two forwarding paths corresponding to the first destination network segment; and
sending, by the controller, the forwarding table to the first switch, the forwarding table enabling the first switch to select, according to a load balancing algorithm and the first forwarding entry and from the at least two forwarding paths corresponding to the first destination network segment, a target forwarding path for a packet corresponding to the first destination network segment.

### Claim 2 (depends on 1)

The method of claim 1, wherein obtaining the port attribute of each port of the first switch comprises:
sending, by the controller, a notification message to the first switch instructing the first switch to send a discovery message from all ports of the first switch, the discovery message instructing a device receiving the discovery message to send a report message to the controller; and
determining, by the controller, the port attribute of each port of the first switch based on whether a device coupled to each port of the first switch sends the report message.

### Claim 3 (depends on 2)

The method of claim 2, wherein determining the port attribute of each port of the first switch comprises:
receiving, by the controller, the report message comprising a type of the device sending the report message and an identifier of a port through which the first switch sends the discovery message to the device;
determining, by the controller, the type of the device sending the report message;
determining, by the controller, a port through which the first switch sends the discovery message to another switch as the network-side port when the device sending the report message comprises the other switch; and
determining, by the controller, a port through which the first switch sends the discovery message to a server as the user-side port when the device sending the report message comprises the server.

### Claim 4 (depends on 3)

The method of claim 3, wherein after sending the notification message to the first switch, the method further comprises determining, by the controller, a port on the first switch and not reported within a specified time period as the user-side port.

### Claim 5 (depends on 4)

The method of claim 4, wherein the mesh network comprises a level-2 mesh network, and determining the port through which the first switch sends the discover message to the other switch as the network-side port comprising one of:
determining, by the controller, the port through which the first switch sends the discovery message to the other switch as an intra-group port when the first switch and the other switch belong to a same switch group; and
determining, by the controller, the port through which the first switch sends the discovery message to the other switch as an inter-group port when the first switch and the other switch belong to different switch groups.

### Claim 6 (depends on 5)

The method of claim 5, wherein all intra-group ports of the first switch correspond to a second virtual routing and forwarding instance, a forwarding entry in the forwarding table corresponding to the second virtual routing and forwarding instance comprising the second virtual routing and forwarding instance, a destination network segment, and at least one forwarding path corresponding to the destination network segment, all inter-group ports of the first switch corresponding to a third virtual routing and forwarding instance, and a forwarding entry in the forwarding table corresponding to the third virtual routing and forwarding instance comprising the third virtual routing and forwarding instance, another destination network segment, and at least one forwarding path corresponding to the other destination network segment.

### Claim 7 (depends on 1)

The method of claim 1, wherein generating the forwarding table of the first switch comprises:
obtaining, by the controller, a network segment configured for each of the switches to obtain a plurality of network segments;
determining, by the controller, a source network segment and a destination network segment in the network segments, the source network segment comprising any one of the network segments, and the destination network segment comprising any one of the network segments except the source network segment;
determining, by the controller according to the topology of the mesh network, N forwarding paths from the source network segment to the destination network segment;
generating, by the controller, a route entry corresponding to an ith forwarding path for each switch other than a destination switch on the ith forwarding path in the N forwarding paths, each route entry comprising a virtual routing and forwarding instance, a destination network segment, a next hop, and an egress port, and i comprising a natural number less than or equal to N; and
determining, by the controller according to all route entries of the first switch, a forwarding path corresponding to each destination network segment of the first switch in each virtual routing and forwarding instance to generate the forwarding table of the first switch.

### Claim 8

A method for implementing load balancing, applied to a system comprising a controller and a mesh network, the mesh network comprising a plurality of switches, and the method comprising:
receiving, by a first switch, a forwarding table from the controller, the first switch being any one of the switches and comprising a plurality of ports, the ports comprising a network-side port and a user-side port corresponding to different virtual routing and forwarding instances, a first forwarding entry of the forwarding table comprising a first virtual routing and forwarding instance, a first destination network segment corresponding to the first virtual routing and forwarding instance and at least two forwarding paths corresponding to the first destination network segment, and the first virtual routing and forwarding instance comprising a virtual routing and forwarding instance corresponding to all user-side ports of the first switch;
receiving, by the first switch, a packet; and
selecting, by the first switch according to a load balancing algorithm and the first forwarding entry, a target forwarding path for the packet from the at least two forwarding paths corresponding to the first destination network segment when a port receiving the packet corresponding to the first destination network segment comprises the user-side port; and
forwarding, by the first switch, the packet using the target forwarding path.

### Claim 9 (depends on 8)

The method of claim 8, wherein before receiving the forwarding table, the method further comprises:
receiving, by the first switch, a notification message from the controller; and
sending, by the first switch, a discovery message from all ports of the first switch according to the notification message, the discovery message instructing a device that receives the discovery message to send a report message to the controller.

### Claim 10 (depends on 9)

The method of claim 9, further comprising:
receiving, by the first switch, a second discovery message from a second switch, the second discovery message comprising an identifier of the second switch and an identifier of a port through which the second switch sends the second discovery message to the first switch; and
sending, by the first switch, a second report message to the controller according to the second discovery message to enable the controller to determine a port attribute of the port through which the second switch sends the second discovery message to the first switch, the second report message comprising the identifier of the port through which the second switch sends the second discovery message to the first switch.

### Claim 11 (depends on 8)

The method of claim 8, wherein the network-side port comprises an intra-group port and an inter-group port, all intra-group ports of the first switch corresponding to a second virtual routing and forwarding instance, a forwarding entry in the forwarding table corresponding to the second virtual routing and forwarding instance comprising the second virtual routing and forwarding instance, a destination network segment, and at least one forwarding path corresponding to the destination network segment, all inter-group ports of the first switch corresponding to a third virtual routing and forwarding instance, and a forwarding entry in the forwarding table corresponding to the third virtual routing and forwarding instance comprising the third virtual routing and forwarding instance, another destination network segment, and at least one forwarding path corresponding to the other destination network segment.

### Claim 12

A controller, applied to a system comprising the controller and a mesh network, the mesh network comprising a plurality of switches, and the controller comprising:
a memory configured to store program instructions; and
a processor coupled to the memory, the program instructions causing the processor to be configured to:
obtain a port attribute of each port of a first switch, the first switch comprising any switch in the mesh network, and the port attribute indicating that the port is a user-side port or a network-side port;
determine, according to the port attribute of each port of the first switch, a virtual routing and forwarding instance corresponding to each port of the first switch, the user-side port and the network-side port corresponding to different virtual routing and forwarding instances, and all user-side ports of the first switch corresponding to a first virtual routing and forwarding instance;
generate a forwarding table of the first switch according to a topology of the mesh network and the virtual routing and forwarding instance corresponding to each port of the first switch, a first forwarding entry of the forwarding table comprising the first virtual routing and forwarding instance, a first destination network segment corresponding to the first virtual routing and forwarding instance and at least two forwarding paths corresponding to the first destination network segment; and
send the forwarding table to the first switch, the forwarding table enabling the first switch to select, according to a load balancing algorithm and the first forwarding entry and from the at least two forwarding paths corresponding to the first destination network segment, a target forwarding path for a packet corresponding to the first destination network segment.

### Claim 13 (depends on 12)

The controller of claim 12, wherein the program instructions further cause the processor to be configured to:
send a notification message to the first switch, the notification message instructing the first switch to send a discovery message from all ports of the first switch, and the discovery message instructing a device receiving the discovery message to send a report message to the controller; and
determine the port attribute of each port of the first switch based on whether a device coupled to each port of the first switch sends the report message.

### Claim 14 (depends on 13)

The controller of claim 13, wherein when determining the port attribute of each port of the first switch, the program instructions further cause the processor to be configured to:
receive the report message comprising a type of the device sending the report message and an identifier of a port through which the first switch sends the discovery message to the device;
determine the type of the device;
determine a port through which the first switch sends the discovery message to another switch as the network-side port when the device comprises the other switch; and
determine a port through which the first switch sends the discovery message to a server as the user-side port when the device comprises the server.

### Claim 15 (depends on 14)

The controller of claim 14, wherein after sending the notification message to the first switch the program instructions further cause the processor to be configured to determine a port that is on the first switch and that is not reported within a specified time period as the user-side port.

### Claim 16 (depends on 15)

The controller of claim 15, wherein the mesh network comprises a level-2 mesh network, and when determining the port through which the first switch sends the discovery message to the other switch as the network-side port, the program instructions further cause the processor to be configured to:
determine the port through which the first switch sends the discovery message to the other switch as an intra-group port when the first switch and the other switch belong to a same switch group; and
determine the port through which the first switch sends the discovery message to the other switch as an inter-group port when the first switch and the other switch belong to different switch groups.

### Claim 17 (depends on 12)

The controller of claim 12, wherein the program instructions further cause the processor to be configured to:
obtain a network segment configured for each of the switches to obtain a plurality of network segments;
determine a source network segment and a destination network segment in the network segments, the source network segment comprising any one of the network segments, and the destination network segment comprising any one of the network segments except the source network segment;
determine, according to the topology of the mesh network, N forwarding paths from the source network segment to the destination network segment;
generate a route entry corresponding to an ith forwarding path for each switch other than a destination switch on the ith forwarding path in the N forwarding paths, each route entry comprising a virtual routing and forwarding instance, a destination network segment, a next hop, and an egress port, and i comprising a natural number less than or equal to N; and
determine, according to all route entries of the first switch, a forwarding path corresponding to each destination network segment of the first switch in each virtual routing and forwarding instance to generate the forwarding table of the first switch.

### Claim 18

A switch, applied to a system comprising a controller and a mesh network, the mesh network comprising a plurality of switches, the switch being any one of the switches, and the switch comprising:
a memory configured to store program instructions; and
a processor coupled to the memory, the instructions causing the processor to be configured to:
receive a forwarding table from the controller, the switch comprising a plurality of ports, the ports comprising a network-side port and a user-side port corresponding to different virtual routing and forwarding instances, a first forwarding entry of the forwarding table comprising a first virtual routing and forwarding instance, a first destination network segment corresponding to the first virtual routing and forwarding instance and at least two forwarding paths corresponding to the first destination network segment, and the first virtual routing and forwarding instance comprising a virtual routing and forwarding instance corresponding to all user-side ports of the switch;
receive a packet;
select, according to a load balancing algorithm and the first forwarding entry, a target forwarding path for the packet from the at least two forwarding paths corresponding to the first destination network segment; and
forward, using the target forwarding path, the packet when a port receiving the packet corresponding to the first destination network segment comprises a user-side port.

### Claim 19 (depends on 18)

The switch of claim 18, wherein the program instructions further cause the processor to be configured to:
receive a notification message from the controller; and
send a discovery message from all ports of the switch according to the notification message instructing a device receiving the discovery message to send a report message to the controller.

### Claim 20 (depends on 19)

The switch of claim 19, wherein the program instructions further cause the processor to be configured to:
receive a second discovery message from another switch, the second discovery message comprising an identifier of the other switch and an identifier of a port through which the other switch sends the second discovery message to the switch; and
send a second report message to the controller to enable the controller to determine a port attribute of the port through which the other switch sends the second discovery message to the switch according to the second discovery message, the second report message comprising the identifier of the port through which the other switch sends the second discovery message to the switch.
