Patent Description:
A virtual extensible local area network (English: virtual extensible local area network, VXLAN) is a network virtualization technology. When a device needs to access a virtualized network, a VXLAN gateway needs to be used. The VXLAN gateway may provide packet transmission for the device. To relieve pressure on a single VXLAN gateway and improve forwarding efficiency of the VXLAN gateway, a VXLAN distributed gateway technology is proposed currently. The VXLAN distributed gateway technology refers to that different VXLAN distributed gateways deployed on two or more devices are configured with a same IP address and provide a gateway service at the same time.

All the VXLAN distributed gateways have the same IP address, and each VXLAN distributed gateway advertises a direct route based on the IP address. Therefore, in a VXLAN distributed gateway scenario, direct routes corresponding to layer <NUM> interfaces configured on the devices form equal-cost multi-path (English: equal-cost multi-path, ECMP). The direct route is defined relative to a remote route. The direct route is generated by a device based on an IP address of an interface of the device. The remote route is generated based on an IP address of an interface of another device. The ECMP indicates a plurality of different paths to a same destination IP address or a same destination network segment. The plurality of paths have same costs. However, because all ECMP occupies hardware resources of a device, ECMP needs to be avoided when the ECMP cannot be used or is not required by a user.

In an existing technical solution, route priorities of direct routes that can form ECMP are manually modified to avoid unnecessary ECMP. However, a workload of modifying the route priorities is relatively heavy, and an error is very likely to occur in a manual modification manner, thereby affecting route priority configuration efficiency.

<CIT> describes a traffic switching method, a device, and a system where, a software-defined networking (SDN) controller acquires a first state of a target gateway, where the target gateway belongs to an SDN gateway group, the SDN gateway group is used to forward traffic that is transmitted between a first network node and a second network node, and multiple forwarding paths on which multiple gateways in the SDN gateway group are located form multiple equal-cost paths between the first network node and the second network node. The SDN controller sends an Address Resolution Protocol (ARP) entry to the target gateway according to the first state, and changes, of the multiple equal-cost paths, a metric value of a forwarding path on which the target gateway is located from an original value to a first value, where the first value is greater than the original value.

<CIT> describes that Priority of a route, which carries a virtual extensible local area network (VXLAN) tunneling end point (VTEP) Internet protocol (IP) address of a port of a VXLAN tunnel corresponding to a first VXLAN IP GW to be mi grated, is lowered. The route is then released to a VTEP at peer end of the VXLAN tunnel. Priority of a static route destined for a virtual machine (VM) is also lowered. The static route is then released to a network device in a non-virtual network. At least two VXLAN IP GWs possess a same VTEP IP address of a port of a VXLAN tunnel. Before priority of route corresponding to first VXLAN IP GW is lowered, priority of route carrying the same VTEP IP address released by each of at least two VXLAN IP GWs is same. Priority of static route from each of at least two VXLAN IP GWs to the VM is same. When controller monitors no data flow between VM and network device in the non-virtual network passes the first VXLAN IP GW, migration actions may be executed.

Embodiments of the present invention provide a route priority configuration method, a device, and a controller, so that direct routes generated based on a same IP address can correspond to different route priorities, to avoid a case in which direct routes advertised by different distributed gateways form ECMP, and improve route priority configuration efficiency. The invention is defined by the appended independent claims, wherein preferred embodiments are defined in the dependent claims.

<FIG> is a schematic diagram of a possible VXLAN distributed gateway deployment scenario according to an embodiment of the present invention. As shown in <FIG>, the scenario includes spine (spine) switches, leaf (leaf) switches, and servers. The leaf switch is connected to the server, and the spine switch is connected to the leaf switch. The leaf switches include a device <NUM>, a device <NUM>, and a device <NUM>. A VXLAN distributed gateway is usually deployed on the leaf switch. For example, VXLAN distributed gateways may be deployed on the device <NUM> and the device <NUM> in the leaf switches, and IP addresses of the VXLAN distributed gateways each are <NUM>. In this scenario, there are two paths between any spine switch and a destination address <NUM>. One path is from the spine switch to the device <NUM>, and the other path is from the spine switch to the device <NUM>. The two paths form ECMP. When the ECMP is formed, a spine switch that sends a data packet forwards the data packet through the two paths in a load balancing mode.

However, in a specific packet forwarding scenario, a route is selected based on a longest match principle in terms of a mask length. The mask length indicates a quantity of <NUM> included in <NUM> bits corresponding to a four-byte field that represents a subnet mask. For example, the subnet mask is <NUM>. <NUM>, and therefore, the mask length is <NUM> bits. In the scenario shown in <FIG>, each leaf switch is connected to at least two servers, and provides a communication service for the at least two servers. Therefore, a subnet mask configured for the leaf switch is less than <NUM> bits. For example, a subnet mask configured for the device <NUM> in the leaf switches is <NUM>. <NUM>, and therefore, a mask length of a direct route corresponding to the device <NUM> is <NUM> bits. When a device <NUM> in the spine switches forwards a packet to the device <NUM> in the leaf switches, a routing table of the device <NUM> includes a plurality of pieces of routing information with different mask lengths, and there is another route whose mask length is greater than the mask length of the direct route. Therefore, the device <NUM> selects a route with a longest mask length to forward the packet. Therefore, it can be learned that the direct route is not used to forward a specific service, and all ECMP formed by different direct routes that are generated based on a same IP address occupies hardware resources such as memory resources of a device. Consequently, the hardware resources of the device are wasted. In an existing technical solution, to avoid a case in which direct routes form ECMP, route priorities corresponding to the direct routes that can form the ECMP need to be manually modified. However, a workload of modifying the route priorities is heavy, and an error is very likely to occur in a manual modification manner, affecting route priority configuration efficiency.

To overcome the foregoing disadvantage, the present invention provides a solution. <FIG> is a schematic diagram of another possible VXLAN distributed gateway deployment scenario according to an embodiment of the present invention. In the schematic diagram of the scenario shown in <FIG>, a controller is added based on the schematic diagram of the scenario shown in <FIG>. The controller may be connected to a leaf switch. Based on the example in <FIG>, VXLAN distributed gateways may be deployed on a device <NUM> and a device <NUM> in leaf switches, and IP addresses of the VXLAN distributed gateways each are <NUM>.

The device <NUM> is used as an example for description. The controller receives an interface creation request for creating a layer <NUM> interface on the device <NUM>, where the interface creation request carries the IP address <NUM>. <NUM> (namely, the IP addresses of the distributed gateways) and a subnet mask configured for the layer <NUM> interface; the controller generates a direct route of the layer <NUM> interface based on the interface creation request; the controller allocates a route priority to the direct route according to a preset allocation rule; and the controller sends the direct route and the route priority corresponding to the direct route to the device <NUM>. When a layer <NUM> interface with the IP address <NUM>. <NUM> is created for the device <NUM>, the controller may also complete configuration according to the execution process performed for the device <NUM>, and a route priority allocated to a direct route that is of the device <NUM> and that is generated based on <NUM>. <NUM> is different from a route priority allocated to a direct route that is of the device <NUM> and that is generated based on <NUM>. In this scenario, a factor of a route priority is considered for route selection between any spine switch and the destination address <NUM>. <NUM>, to avoid a case in which different direct routes form ECMP, reduce a workload caused by manually modifying the route priorities, and improve route priority configuration efficiency.

The following describes the embodiments of the present invention in detail. First, <FIG> is an architectural diagram of a possible network system according to an embodiment of the present invention. The network system in <FIG> includes a controller, a device A, and a device B. The device A and the device B are deployed with distributed gateways, and the distributed gateways on the device A and the device B have a same IP address. In the architectural diagram of the network system, the controller may directly establish a communication connection to the device A and the device B.

Then, <FIG> is an architectural diagram of another possible network system according to an embodiment of the present invention. The network system in <FIG> includes a controller, a device A, a device B, and a device C. The device A and the device B are deployed with distributed gateways, and the distributed gateways on the device A and the device B have a same IP address. In the architectural diagram of the network system, the controller may establish a communication connection to the device A and the device B by using the device C.

In addition to the foregoing network system shown in <FIG>, a route priority configuration method in the embodiments of the present invention may be applied to another system in which a route priority corresponding to a route needs to be configured, for example, a virtual local area network (English: virtual local area network, VLAN). This is not limited in the embodiments of the present invention.

A target device or another device in the embodiments of the present invention may include but is not limited to a device that has a routing and transfer function, for example, a router or a switch. A controller may be any device that has a communication function and a management function, for example, a server, a terminal (terminal), or a mobile station (English: mobile station, MS). Alternatively, a controller may be a mobile phone (or referred to as a "cellular" phone), or may be a portable, pocket-sized, handheld, computer built-in, or in-vehicle mobile apparatus (a smart band, a smartwatch, smart glasses, or the like).

Further, based on the architectural diagram of the network system shown in <FIG>, <FIG> is a schematic flowchart of a route priority configuration method according to an embodiment of the present invention. The route priority configuration method in this embodiment of the present invention is jointly performed by a controller and a target device. The target device may be either one of the device A and the device B in the architectural diagram of the network system shown in <FIG>. In addition, the controller and the target device in this embodiment of the present invention may have other names. All devices fall within the scope of the claims of the present invention and equivalent technologies of the present invention, provided that functions of the devices are similar to those in the present invention. For a specific process of the route priority configuration method, refer to the following detailed description.

The target device sends a registration request to the controller, where the registration request carries a MAC address of the target device.

Optionally, after being powered on, the target device sends the registration request to the controller, and the registration request carries the media access control (English: media access control, MAC) address of the target device. Because different devices have different MAC addresses, the registration request carries the MAC address, so that the controller can determine a device that sends the registration request.

Optionally, the target device may send the registration request to the controller in a format of a simple network management protocol (English: Simple Network Management Protocol, SNMP).

Correspondingly, the controller receives the registration request sent by the target device, and verifies the registration request from the target device. For example, the controller verifies whether the MAC address of the target device is valid. After the controller determines that the target device is successfully registered, the controller establishes a communication connection to the target device. Optionally, the controller may establish a communication connection to the target device by using a Network Configuration Protocol (English: Network Configuration, Netconf).

The controller determines, based on the MAC address of the target device, a device identifier corresponding to the target device.

Optionally, the controller may directly determine the MAC address of the target device as the device identifier of the target device. Alternatively, the controller may generate, based on the MAC address of the target device, another device identifier used to uniquely identify the target device. A process of determining the device identifier of the target device is not limited in this embodiment of the present invention. Optionally, because the MAC address uses a six-byte (<NUM>-bit) identifier, the generated device identifier may be represented by using less than six bytes, to reduce bit resource consumption in a transmission process of the device identifier.

The controller receives an interface creation request for creating a layer <NUM> interface on the target device.

The interface creation request carries an IP address and a subnet mask configured for the layer <NUM> interface. Creating the layer <NUM> interface on the target device indicates that the target device is allowed to work at a network layer. The subnet mask is used to determine a network segment within which a data packet may be transmitted by using the layer <NUM> interface. The IP address carried in the interface creation request is an IP address of the distributed gateway.

Optionally, the interface creation request may be initiated by a user on an operation platform corresponding to the controller, and the IP address and the subnet mask that are carried in the interface creation request may also be configured on the operation platform.

The controller generates a direct route of the layer <NUM> interface based on the interface creation request.

For example, if the IP address of the distributed gateway is <NUM>. <NUM>, the subnet mask configured for the layer <NUM> interface is <NUM>. Further, the controller may generate the direct route corresponding to the layer <NUM> interface, which is shown in Table <NUM>.

Further, it may be determined, based on the subnet mask, that a server whose IP address falls within <NUM>. <NUM> to <NUM>. <NUM> may communicate with a server or a device in another network by using the layer <NUM> interface.

The controller allocates a route priority to the direct route according to a preset allocation rule.

The user may create layer <NUM> interfaces on a plurality of devices by using the controller. In an optional solution, layer <NUM> interfaces created on a same device have different IP addresses, and layer <NUM> interfaces with a same IP address may be created on different devices. For example, distributed gateways may be deployed on two or more devices (namely, at least two devices).

In this embodiment of the present invention, the preset allocation rule indicates that a route priority corresponding to a direct route that is based on the IP address of the distributed gateway and that is of any one of the at least two devices is different from a route priority corresponding to a direct route that is based on the IP address of the distributed gateway and that is of another device in the at least two devices. In this case, direct routes generated based on a same IP address correspond to different route priorities. Therefore, a path to a destination IP address may be determined by considering a parameter of the route priority. For example, a path with a highest route priority is selected as the path to the destination IP address. According to the solution of this embodiment of the present invention, generation of unnecessary ECMP can be reduced, thereby saving a hardware resource occupied due to forming of the ECMP.

In an optional solution, the controller may generate, based on the device identifier of the target device and according to the preset allocation rule, the route priority corresponding to the direct route. The device identifier is used to uniquely identify the target device, and only one layer <NUM> interface configured with the IP address can be created on the target device. Therefore, the route priority generated according to the preset allocation rule and by using the device identifier can be distinguished from a route priority that is of another device and that is generated by using a device identifier of the another device.

For example, description is provided with reference to the architectural diagram of the network system shown in <FIG>. The distributed gateways are deployed on the device A and the device B, and the controller may establish a communication connection to the device A and the device B. The user may create, on the device A by using the controller, a layer <NUM> interface I1 whose IP address is <NUM>. <NUM> and subnet mask is <NUM>. <NUM>; and may create, on the device B, a layer <NUM> interface I2 whose IP address is <NUM>. <NUM> and subnet mask is <NUM>. A device identifier of the device A is <NUM>, and a device identifier of the device B is <NUM>.

Optionally, the controller may generate, based on a preset algorithm, route priorities of direct routes that are of the device A and the device B and that are generated based on the IP address <NUM>. For example, the device identifier <NUM> is directly determined as a route priority corresponding to a direct route that is of the device A and that is generated based on the IP address <NUM>. <NUM>; or the device identifier <NUM> is increased by a fixed offset, for example, <NUM>, and <NUM> is determined as a route priority corresponding to a direct route that is the device A and that is generated based on the IP address <NUM>. The preset algorithm is not limited in this embodiment of the present invention. Similarly, for the device B, a route priority of a direct route generated based on the IP address <NUM>. <NUM> may also be generated based on the device identifier of the device B. To be specific, routing information that includes the direct route and the priority corresponding to the direct route and that corresponds to the layer <NUM> interface I1 is configured in the device A as shown in Table <NUM>; and routing information corresponding to the layer <NUM> interface I2 is configured in the device B as shown in Table <NUM>.

Optionally, the controller may generate, based on the device identifiers, a preset basic priority, the preset allocation rule, and a preset algorithm, route priorities of direct routes that are of the device A and the device B and that are generated based on the IP address <NUM>. For example, the preset basic priority is <NUM>. Therefore, the device identifier <NUM> of the device A is added to the preset basic priority <NUM>, to obtain a route priority <NUM> of a direct route that is of the device A and that is generated by using the IP address <NUM>. <NUM>; and the device identifier <NUM> of the device B is added to the preset basic priority <NUM>, to obtain a route priority <NUM> of a direct route that is of the device B and that is generated by the IP address <NUM>. The preset algorithm is not limited in this embodiment of the present invention. However, direct routes that are of different devices and that are generated based on a same IP address correspond to different route priorities. Further, optionally, the basic priority may be used to set a default route priority of another route generated for the target device or another device.

For another example, for the device A and the device B on which the distributed gateways are deployed in the architectural diagram of the network system shown in <FIG>, route priorities of direct routes that are of the device A and the device B and that are generated based on the IP address <NUM>. <NUM> may be separately determined based on content described in the architectural diagram of the network system shown in <FIG>.

The controller sends, to the target device, the direct route and the route priority corresponding to the direct route.

The target device receives the direct route and the route priority corresponding to the direct route that are sent by the controller.

The target device stores the direct route and the route priority corresponding to the direct route.

Specifically, after the controller allocates the route priority to the direct route of the target device, the controller sends the direct route and the route priority corresponding to the direct route to the target device. Correspondingly, the target device receives the direct route and the route priority corresponding to the direct route that are sent by the controller, and stores the direct route and the route priority corresponding to the direct route that are received.

Optionally, the target device adds routing information that includes the direct route and the priority corresponding to the direct route to a routing table of the target device, and may notify a neighboring device of the added routing information. The neighboring device is another device that establishes a communication connection to the target device. In this way, the neighboring device may add, to a routing table of the neighboring device, the routing information added by the target device.

Based on the schematic diagram of the gateway deployment shown in <FIG>, the controller separately creates, on the device <NUM> and the device <NUM>, layer <NUM> interfaces whose IP addresses are <NUM>. <NUM> and subnet masks are <NUM>. A layer <NUM> interface on the device <NUM> is I1, and a layer <NUM> interface on the device <NUM> is I2. The controller sends, to the device <NUM>, a direct route <NUM> of the layer <NUM> interface created on the device <NUM> and a route priority <NUM> corresponding to the direct route <NUM>; and sends, to the device <NUM>, a direct route <NUM> of the layer <NUM> interface created on the device <NUM> and a route priority <NUM> corresponding to the direct route <NUM>. The device <NUM> and the device <NUM> also notify a neighboring device of newly added routing information (the direct route <NUM> and the direct route <NUM>). For example, the device <NUM> in spine switches receives the routing information notified by the device <NUM> and the device <NUM>, and stores the routing information in a routing table of the device <NUM>. For example, routing information shown in Table <NUM> exists in the routing table of the device <NUM>.

For the device <NUM>, if the device <NUM> needs to access the destination address <NUM>. <NUM>, no ECMP is formed because the direct route <NUM> and the direct route <NUM> have different route priorities. If a route priority with a larger specified value is higher, it can be learned that the route priority of the direct route <NUM> corresponding to the layer <NUM> interface I2 is higher than the route priority of the direct route <NUM> corresponding to the layer <NUM> interface Il. A routing policy is selecting a route with a higher priority, and therefore, the device <NUM> may select the direct route <NUM> to access <NUM>.

In this embodiment of the present invention, the controller receives the interface creation request for creating the layer <NUM> interface on the target device, where the interface creation request carries the IP address and the subnet mask configured for the layer <NUM> interface; the controller generates the direct route of the layer <NUM> interface based on the interface creation request; the controller allocates the route priority to the direct route according to the preset allocation rule; and the controller sends, to the target device, the direct route and the route priority corresponding to the direct route. According to this embodiment of the present invention, the route priority is allocated by using the preset allocation rule, to ensure that different direct routes generated based on a same IP address correspond to different route priorities, thereby avoiding a case in which the different direct routes form ECMP, reducing a workload caused by manually modifying the route priorities, and improving route priority configuration efficiency.

<FIG> is a schematic structural diagram of a controller according to an embodiment of the present invention. The controller is configured to implement the route priority configuration method disclosed in the embodiments of the present invention. The controller is applied to a network system, and the network system includes the controller and at least two devices. The at least two devices are deployed with distributed gateways, and the distributed gateways on the at least two devices have a same IP address. As shown in <FIG>, a controller <NUM> provided in this embodiment of the present invention may include a receiving module <NUM>, a generation module <NUM>, an allocation module <NUM>, and a sending module <NUM>.

The receiving module <NUM> is configured to receive an interface creation request for creating a layer <NUM> interface on a target device. The interface creation request carries the IP address and a subnet mask configured for the layer <NUM> interface, and the target device is any one of the at least two devices.

The generation module <NUM> is configured to generate, a direct route of the layer <NUM> interface based on the interface creation request.

The allocation module <NUM> is configured to allocate a route priority to the direct route according to a preset allocation rule.

The sending module <NUM> is configured to send, to the target device, the direct route and the route priority corresponding to the direct route.

The preset allocation rule indicates that a route priority corresponding to a direct route that is based on the IP address and that is of any one of the at least two devices is different from a route priority corresponding to a direct route that is based on the IP address and that is of another device in the at least two devices.

In an optional embodiment, the allocation module <NUM> is specifically configured to generate, based on a device identifier of the target device and according to the preset allocation rule, the route priority corresponding to the direct route. The device identifier is used to uniquely identify the target device.

In an optional embodiment, the allocation module <NUM> is specifically configured to generate, based on a device identifier of the target device and a preset basic priority and according to the preset allocation rule, the route priority corresponding to the direct route. The device identifier is used to uniquely identify the target device.

In an optional embodiment, the controller further includes a determining module <NUM>.

The receiving module <NUM> is further configured to receive a registration request sent by the target device. The registration request carries a media access control MAC address of the target device.

The determining module <NUM> is configured to determine, based on the MAC address of the target device, the device identifier corresponding to the target device.

The controller in the embodiment shown in <FIG> may be implemented by using a controller shown in <FIG> is a schematic structural diagram of another controller according to an embodiment of the present invention. A controller <NUM> shown in <FIG> includes a processor <NUM> and a communications interface <NUM>. The communications interface <NUM> is configured to support communication between the controller <NUM> and the at least two devices on which the distributed gateways are deployed in the foregoing embodiments. The processor <NUM> and the communications interface <NUM> are communicatively connected, for example, by using a bus. The controller <NUM> may further include a memory <NUM>. The memory <NUM> is configured to store program code and data that are executed by the controller <NUM>, to implement an action of the controller provided in any one of the embodiments shown in <FIG>.

The processor <NUM> is applied to this embodiment of the present invention, and is configured to implement functions of the generation module <NUM>, the allocation module <NUM>, and the determining module <NUM> shown in <FIG>. The communications interface <NUM> is applied to this embodiment of the present invention, and is configured to implement functions of the receiving module <NUM> and the sending module <NUM> shown in <FIG>.

The processor <NUM> may be a central processing unit (English: central processing unit, CPU), a network processor (English: network processor, NP), a hardware chip, or any combination thereof. The hardware chip may be an application-specific integrated circuit (English: application-specific integrated circuit, ASIC), a programmable logic device (English: programmable logic device, PLD), or a combination thereof. The PLD may be a complex programmable logical device (English: complex programmable logic device, CPLD), a field-programmable gate array (English: field-programmable gate array, FPGA), generic array logic (English: generic array logic, GAL), or any combination thereof.

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

An embodiment of the present invention further provides a computer storage medium. The computer storage medium is configured to store a computer software instruction used by the foregoing controller. The computer storage medium includes a program designed for the controller to execute the foregoing aspects.

<FIG> is a schematic structural diagram of a device according to an embodiment of the present invention. The device is configured to implement the route priority configuration method disclosed in the embodiments of the present invention. The device is a target device in a network system, and the network system includes a controller and at least two devices. The at least two devices are deployed with distributed gateways, and the distributed gateways on the at least two devices have a same IP address. The target device is any one of the at least two devices. As shown in <FIG>, a device <NUM> in this embodiment of the present invention may include a receiving module <NUM> and a storage module <NUM>.

The receiving module <NUM> is configured to receive a direct route and a route priority corresponding to the direct route that are sent by the controller. The direct route is generated according to a preset allocation rule and based on the IP address and a subnet mask of a layer <NUM> interface created on the target device.

The storage module <NUM> is configured to store the direct route and the route priority corresponding to the direct route.

In an optional embodiment, the route priority is generated based on a device identifier of the device and according to the preset allocation rule, and the device identifier is used to uniquely identify the device.

In an optional embodiment, the route priority is generated based on a device identifier of the device and a preset basic priority and according to the preset allocation rule, and the device identifier is used to uniquely identify the device.

In an optional embodiment, the device further includes a sending module <NUM>.

The sending module <NUM> is configured to send a registration request to the controller. The registration request carries a media access control MAC address of the device, and the MAC address of the device is used to generate the device identifier of the device.

The device in the embodiment shown in <FIG> may be implemented by using a device shown in <FIG> is a schematic structural diagram of a device according to an embodiment of the present invention. A device <NUM> shown in <FIG> includes a processor <NUM> and a communications interface <NUM>. The communications interface <NUM> is configured to support transmission of communications information between the device <NUM> and the controller in the foregoing embodiments. The processor <NUM> and the communications interface <NUM> are communicatively connected, for example, by using a bus. The device <NUM> may further include a memory <NUM>. The memory <NUM> is configured to store program code and data that are executed by the device <NUM>, to implement an action of the target device provided in any one of the embodiments shown in <FIG>.

The processor <NUM> is applied to this embodiment of the present invention, and is configured to implement a function of the storage module <NUM> shown in <FIG>. The communications interface <NUM> is applied to this embodiment of the present invention, and is configured to implement functions of the receiving module <NUM> and the sending module <NUM> shown in <FIG>.

The processor <NUM> may be a CPU, an NP, a hardware chip, or any combination thereof. The hardware chip may be an ASIC, a PLD, or a combination thereof. The PLD may be a CPLD, an FPGA, GAL, or any combination thereof.

The memory <NUM> may include a volatile memory, for example, a RAM. Alternatively, the memory <NUM> may include a nonvolatile memory, for example, a ROM, a flash memory, an HDD, or an SSD. Alternatively, the memory <NUM> may include a combination of the foregoing types of memories.

An embodiment of the present invention further provides a computer storage medium. The computer storage medium is configured to store a computer software instruction used by the foregoing device. The computer storage medium includes a program designed for the device to execute the foregoing aspects.

A person of ordinary skill in the art may understand that all or some of the processes of the method in the embodiments may be implemented by a computer program instructing related hardware. The program may be stored in a computer readable storage medium. When the program runs, the processes of the method in the embodiments are performed. The storage medium may be a magnetic disk, an optical disc, a ROM, a RAM, or the like.

Claim 1:
A route priority configuration method, wherein the method is applied to a network system, the network system comprises a controller (<NUM>) and at least two devices (<NUM>, <NUM>, <NUM>), the at least two devices (<NUM>, <NUM>, <NUM>) are deployed with distributed gateways, the distributed gateways on the at least two devices (<NUM>, <NUM>, <NUM>) have a same IP address, and the method comprises:
receiving, by the controller (<NUM>), an interface creation request for creating a layer <NUM> interface on a target device (<NUM>, <NUM>, <NUM>) sent by the target device (<NUM>, <NUM>, <NUM>), wherein the interface creation request carries the IP address and a subnet mask configured for the layer <NUM> interface, and the target device is any one of the at least two devices (<NUM>, <NUM>, <NUM>);
generating, by the controller (<NUM>), a direct route of the layer <NUM> interface based on the interface creation request;
allocating, by the controller (<NUM>), a route priority to the direct route according to a preset allocation rule; and
sending, by the controller (<NUM>), the direct route and the route priority corresponding to the direct route to the target device (<NUM>, <NUM>, <NUM>), wherein
the preset allocation rule indicates that a route priority corresponding to a direct route that is based on the IP address and that is of any one of the at least two devices (<NUM>, <NUM>, <NUM>) is different from a route priority corresponding to a direct route that is based on the IP address and that is of another device in the at least two devices (<NUM>, <NUM>, <NUM>), and wherein
the controller (<NUM>) uniquely identifies the target device (<NUM>, <NUM>, <NUM>) by a media access control, MAC, address of the target device.