(19)
(11)EP 3 996 335 A9

(12)CORRECTED EUROPEAN PATENT APPLICATION
published in accordance with Art. 153(4) EPC

(15)Correction information:
Corrected version no 1 (W1 A1)
Corrections, see
Claims

(48)Corrigendum issued on:
13.07.2022 Bulletin 2022/28

(43)Date of publication:
11.05.2022 Bulletin 2022/19

(21)Application number: 20849896.4

(22)Date of filing:  03.08.2020
(51)International Patent Classification (IPC): 
H04L 12/713(2013.01)
(52)Cooperative Patent Classification (CPC):
H04L 45/54; H04L 45/586; H04L 45/74
(86)International application number:
PCT/CN2020/106496
(87)International publication number:
WO 2021/023141 (11.02.2021 Gazette  2021/06)
(84)Designated Contracting States:
AL AT BE BG CH CY CZ DE DK EE ES FI FR GB GR HR HU IE IS IT LI LT LU LV MC MK MT NL NO PL PT RO RS SE SI SK SM TR
Designated Extension States:
BA ME
Designated Validation States:
KH MA MD TN

(30)Priority: 02.08.2019 CN 201910713391

(71)Applicant: Huawei Technologies Co., Ltd.
Shenzhen, Guangdong 518129 (CN)

(72)Inventors:
  • PENG, Shuping
    Shenzhen, Guangdong 518129 (CN)
  • LI, Lei
    Shenzhen, Guangdong 518129 (CN)
  • LI, Zhenbin
    Shenzhen, Guangdong 518129 (CN)
  • HAO, Jianwu
    Shenzhen, Guangdong 518129 (CN)

(74)Representative: Gill Jennings & Every LLP 
The Broadgate Tower 20 Primrose Street
London EC2A 2ES
London EC2A 2ES (GB)

 
Remarks:
Published with correct parts incorporated by reference (Rule 20.6 PCT) and erroneously filed parts (Rule 20.5bis PCT).
 


(54)METHOD AND APPARATUS FOR OBTAINING ROUTING TABLE ENTRY, AND DEVICE


(57) Embodiments of this application disclose a routing entry obtaining method and apparatus, and a device, to provide a user with an apparatus with an appropriate computing capability to interact with a terminal device. The method is applied to a first network device and specifically includes: obtaining an identifier of an application program, a computing capability of a first apparatus running the application program, and a computing capability of a second apparatus running the application program; determining, based on the computing capability of the first apparatus and the computing capability of the second apparatus, an apparatus whose computing capability satisfies a preset condition as a target apparatus; obtaining an identifier of a target instance, where the identifier of the target instance is used to identify an instance of the application program run by the target apparatus; and generating a routing entry based on the identifier of the application program and the identifier of the target instance, where the routing entry includes the identifier of the application program and an egress port of the first network device, and the egress port of the first network device is a port determined based on the identifier of the target instance and is capable of communicating with a next-hop device on a path to the target apparatus.




Description


[0001] This application claims priority to Chinese Patent Application No. CN201910713391.4, filed with the China National Intellectual Property Administration on August 2, 2019 and entitled "ROUTING ENTRY OBTAINING METHOD AND APPARATUS, AND DEVICE", which is incorporated herein by reference in its entirety.

TECHNICAL FIELD



[0002] This application relates to the network field, and in particular, to a routing entry obtaining method and apparatus, and a device.

BACKGROUND



[0003] An application program (APP), which is also referred to as application software (APP), is a computer program designated to carry out one or more specific tasks, and usually needs to interact with a user. The application program usually includes a client and a server side. The client is installed in a terminal device, and is configured to interact with the user. The server side is installed in a server, and is configured to respond to a request from the client, deliver software update content to the client, and the like.

[0004] In an existing technology, to enhance a computing capability of an application program, a server side of a same application program may be deployed in different apparatuses, and each apparatus may run one or more application program instances (instances). Apparatuses running different application program instances of the same application program may have different computing capabilities. Because a computing capability of an apparatus directly affects user experience of a client of an application program, it is quite important to select an apparatus with an appropriate computing capability to respond to a request from the client of the application program.

SUMMARY



[0005] Embodiments of this application provide a routing entry obtaining method and apparatus, to provide a user with an apparatus with an appropriate computing capability to interact with a terminal device.

[0006] According to a first aspect, an embodiment of this application provides a routing entry obtaining method. The method may be applied to a first network device, and the first network device may be a router or a layer 3 switch. The method specifically includes the following steps: First, the first network device obtains an identifier of an application program, a computing capability of a first apparatus running the application program, and a computing capability of a second apparatus running the application program. The first apparatus and the second apparatus each may be a virtual machine, a server, or a container (container). The computing capability of the first apparatus and the computing capability of the second apparatus include, for example, one or more of load, a quantity of central processing unit (CPU) cores, and a size of a random-access memory (RAM). This is not specifically limited in this embodiment of this application. The identifier of the application program is used to identify the application program. For example, the identifier of the application program is a protocol characteristic string or an application attribute code (attribute code) of the application program. This is not specifically limited in this embodiment of this application. Next, the first network device determines, based on the computing capability of the first apparatus and the computing capability of the second apparatus, an apparatus whose computing capability satisfies a preset condition as a target apparatus. Then, the first network device obtains an identifier of a target instance. The identifier of the target instance is used to identify an instance of the application program run by the target apparatus. Finally, the first network device generates a routing entry based on the identifier of the application program and the identifier of the target instance. The routing entry includes the identifier of the application program and an egress port of the first network device, the egress port of the first network device is a port determined based on the identifier of the target instance, and the egress port of the first network device is capable of communicating with a next-hop device on a path to the target apparatus. The identifier of the target instance may be an Internet Protocol (IP) address of the target instance. The IP address of the target instance may be, for example, an IP address of a virtual machine or an IP address of a server, or an IP address of a server and a port number of the server.

[0007] After receiving a packet from a terminal device, the first network device can forward the packet to the target apparatus based on the routing entry, and the target apparatus processes the packet. Because the target apparatus is the apparatus that satisfies the preset condition, that is, an apparatus with a relatively high computing capability, the target apparatus can process the packet relatively quickly. This achieves relatively high packet processing efficiency and better user experience. In addition, when each of a plurality of network devices in a network topology can be used as the first network device to perform the routing entry obtaining method, if some network devices are faulty, another network device may forward, to the target apparatus, the packet that is from the terminal device, to ensure packet processing and achieve relatively high reliability.

[0008] In this embodiment of this application, based on different objects connected to the first network device, that the first network device obtains an identifier of an application program, a computing capability of a first apparatus running the application program, and a computing capability of a second apparatus running the application program includes the following three possible implementations:

[0009] In a possible implementation, if the first network device is connected to the first apparatus and the second apparatus, that the first network device obtains an identifier of an application program, a computing capability of a first apparatus running the application program, and a computing capability of a second apparatus running the application program includes: The first network device receives a first packet from the first apparatus, where the first packet includes the computing capability of the first apparatus and the identifier of the application program. The first network device receives a second packet from the second apparatus, where the second packet includes the computing capability of the second apparatus and the identifier of the application program. In other words, when the first network device is connected to both the first apparatus and the second apparatus, a manner in which the first network device obtains the identifier of the application program, the computing capability of the first apparatus running the application program, and the computing capability of the second apparatus running the application program is receiving the first packet from the first apparatus and the second packet from the second apparatus.

[0010] In another possible implementation, if the first network device is connected to the first apparatus, that the first network device obtains an identifier of an application program, a computing capability of a first apparatus running the application program, and a computing capability of a second apparatus running the application program includes: The first network device receives a third packet from the first apparatus, where the third packet includes the computing capability of the first apparatus and the identifier of the application program. The first network device receives a fourth packet from a second network device in a same network topology, where the fourth packet includes the computing capability of the second apparatus and the identifier of the application program. In other words, when the first network device is connected to only the first apparatus, a manner in which the first network device obtains the identifier of the application program, the computing capability of the first apparatus running the application program, and the computing capability of the second apparatus running the application program is receiving the third packet from the first apparatus and the fourth packet from another network device such as the second network device in the network topology.

[0011] Certainly, it can be understood that if the first network device is connected to the second apparatus, an obtaining method is similar to the obtaining manner used if the first network device is connected to the first apparatus. To be specific, if the first network device is connected to the second apparatus, that the first network device obtains an identifier of an application program, a computing capability of a first apparatus, and a computing capability of a second apparatus includes: The first network device receives a tenth packet from the second apparatus, where the tenth packet includes the computing capability of the first apparatus and the identifier of the application program. The first network device receives an eleventh packet from a fifth network device in a same network topology, where the eleventh packet includes the computing capability of the second apparatus and the identifier of the application program.

[0012] In still another possible implementation, if the first network device is connected to a virtual router (VRouter), that the first network device obtains an identifier of an application program, a computing capability of a first apparatus running the application program, and a computing capability of a second apparatus running the application program includes: The first network device receives a fifth packet sent by the virtual router, where the fifth packet includes the identifier of the application program, the computing capability of the first apparatus, and the computing capability of the second apparatus. In other words, in this implementation, the first network device is not directly connected to the first apparatus and the second apparatus, but is connected to the first apparatus and the second apparatus through the virtual router. In this case, the virtual router collects the identifier of the application program, the computing capability of the first apparatus running the application program, and the computing capability of the second apparatus running the application program, and sends the identifier of the application program, the computing capability of the first apparatus, and the computing capability of the second apparatus to the first network device.

[0013] In this embodiment of this application, all of the computing capability of the first apparatus, the computing capability of the second apparatus, and the identifier of the application program may be added to a typelength-value (TLV) field of the corresponding packet, for sending. The first packet to a seventh packet may be interior gateway protocol (IGP) packets, or may be border gateway protocol (BGP) packets.

[0014] In this embodiment of this application, in the first possible implementation and the third possible implementation, after receiving the computing capability of the first apparatus, the computing capability of the second apparatus, and the identifier of the application program, the first network device may send, to another network device in a same network topology, the parameters or a packet carrying the parameters. For example, the method further includes: The first network device sends a sixth packet to a third network device in the same network topology, where the sixth packet includes the identifier of the application program, the computing capability of the first apparatus, and the computing capability of the second apparatus. The computing capability of the first apparatus, the computing capability of the second apparatus, and the identifier of the application program may be carried in a TLV field of the sixth packet. The sixth packet may be an IGP packet, or may be a BGP packet.

[0015] If the sixth packet is an IGP packet, after receiving the sixth packet, the third network device sends the identifier of the application program, the computing capability of the first apparatus, and the computing capability of the second apparatus to another network device in the same network topology. Therefore, each network device in the network topology can obtain the identifier of the application program, the computing capability of the first apparatus, and the computing capability of the second apparatus in such a flooding manner. If the sixth packet is a BGP packet, the third network device may be a network device, that is, a headend, connected to the terminal device.

[0016] In the second possible implementation, after receiving the identifier of the application program, and either the computing capability of the first apparatus or the computing capability of the second apparatus, the first network device may send the received parameters to another network device in the same network topology. For example, if the first network device is connected to the first apparatus, the first network device sends the seventh packet to a fourth network device in the same network topology, where the seventh packet includes the identifier of the application program and the computing capability of the first apparatus. If the first network device is connected to the second apparatus, the first network device sends a twelfth packet to a sixth network device in the same network topology, where the twelfth packet includes the identifier of the application program and the computing capability of the second apparatus. The computing capability of the first apparatus and the identifier of the application program may be carried in a TLV field of the seventh packet. The identifier of the application program and the computing capability of the second apparatus may be carried in a TLV field of the twelfth packet. The seventh packet and the twelfth packet may be IGP packets, or may be BGP packets.

[0017] If the seventh packet is an IGP packet, after receiving the seventh packet, the fourth network device sends the identifier of the application program and the computing capability of the first apparatus to another network device in the same network topology. Therefore, each network device in the network topology can obtain the computing capability of the first apparatus and the identifier of the application program in such a flooding manner. If the seventh packet is a BGP packet, the fourth network device may be a network device, that is, a headend, connected to the terminal device. Likewise, if the twelfth packet is an IGP packet, after receiving the twelfth packet, the sixth network device sends the identifier of the application program and the computing capability of the second apparatus to another network device in the same network topology. Therefore, each network device in the network topology can obtain the identifier of the application program and the computing capability of the second apparatus in such a flooding manner. If the twelfth packet is a BGP packet, the sixth network device may be a network device, that is, a headend, connected to the terminal device.

[0018] The foregoing describes specific details of obtaining, by an edge network device connected to an apparatus, the identifier of the application program, the computing capability of the first apparatus running the application program, and the computing capability of the second apparatus running the application program. When another network device that is in the network topology and that is not connected to the apparatus serves as the first network device to specifically perform the step, the another network device receives the computing capability of the first apparatus, the computing capability of the second apparatus, and the identifier of the application program from the edge network device connected to the apparatus.

[0019] Optionally, that the first network device generates a routing entry based on the identifier of the application program and the identifier of the target instance includes: The first network device determines, based on the identifier of the target instance, the next-hop device on the path to the target apparatus. The first network device obtains, based on the next-hop device on the path to the target apparatus, the egress port that is of the first network device and that is capable of communicating with the next-hop device. In this embodiment of this application, the egress port in the routing entry is determined based on the identifier of the target instance, so as to generate the routing entry.

[0020] Correspondingly, the method further includes: The first network device receives an eighth packet from a terminal device, where the eighth packet includes the identifier of the application program. The first network device obtains the egress port of the first network device based on the identifier of the application program and the routing entry. The first network device sends the eighth packet through the egress port of the first network device. Because the egress port in the routing entry leads to the target apparatus, the packet that is from the terminal device can be sent to the target apparatus.

[0021] Optionally, the routing entry further includes network performance of the path, and that the first network device determines, based on the identifier of the target instance, the next-hop device on the path to the target apparatus includes: The first network device obtains the network performance of the path. The first network device determines, based on the network performance of the path and the identifier of the target instance, the next-hop device on the path to the target apparatus. Because the routing entry includes the network performance corresponding to the egress port, the path that reaches the target apparatus and that satisfies the specific network performance can be provided for the terminal device, so as to forward the packet that is from the terminal device, thereby improving user experience.

[0022] Optionally, the method further includes: The first network device receives a ninth packet from a terminal device, where the ninth packet includes the identifier of the application program and a network performance requirement of the application program. The first network device obtains the egress port of the first network device based on the identifier of the application program, the network performance requirement of the application program, and the routing entry, where the network performance of the path corresponding to the egress port matches the network performance requirement of the application program. The first network device sends the ninth packet through the egress port of the first network device.

[0023] Optionally, the routing entry further includes a weight value determined based on a computing capability of the target apparatus, and the weight value is used to identify a probability of sending a packet to the target apparatus through the egress port. When there are a plurality of target apparatuses, load balancing can be implemented while computing capabilities of the apparatuses are ensured.

[0024] According to a second aspect, an embodiment of this application further provides a packet sending method. The method may be applied to a terminal device, and specifically includes the following steps: First, the terminal device sends an application processing request to a first device, where the application processing request includes a uniform resource locator (URL) of an application program. The first device may be a domain name system (DNS), a load balancer (LB), or a first network device, and the first network device may be a headend in a network topology. Next, the terminal device receives, from the first device, an identifier of the application program corresponding to the URL of the application program. The identifier of the application program is carried in a destination address field of a packet. Then, the terminal device sends the packet to the first network device, where the packet includes the identifier of the application program. The first network device stores a routing entry, where the routing entry includes the identifier of the application program and an egress port, and the egress port leads to a target apparatus. Because the target apparatus is an apparatus that satisfies a preset condition, that is, an apparatus with a relatively high computing capability, the target apparatus can process the packet relatively quickly. This achieves relatively high packet processing efficiency and better user experience.

[0025] According to a third aspect, an embodiment of this application further provides a sending method. The method may be applied to a first device, and the first device may be a DNS, an LB, or an edge network device connected to a terminal device. The method specifically includes the following steps: First, the first device receives an application processing request from the terminal device, where the application processing request carries a URL of an application program. Next, the first device obtains an identifier of the application program based on the URL of the application program and a mapping relationship, where the mapping relationship includes the URL of the application program and the identifier of the application program. Finally, the first device sends the identifier of the application program to the terminal device. The first device sends the identifier of the application program to the terminal device, so that the terminal device can send a packet carrying the identifier of the application program, and forward the packet to a target apparatus with a relatively high computing capability by using a network topology, thereby improving user experience.

[0026] According to a fourth aspect, an embodiment of this application further provides a routing entry obtaining apparatus. The routing entry obtaining apparatus is applied to a first network device. The routing entry obtaining apparatus includes: a first obtaining unit, configured to obtain an identifier of an application program, a computing capability of a first apparatus running the application program, and a computing capability of a second apparatus running the application program; a determining unit, configured to determine, based on the computing capability of the first apparatus and the computing capability of the second apparatus, an apparatus whose computing capability satisfies a preset condition as a target apparatus; a second obtaining unit, configured to obtain an identifier of a target instance, where the identifier of the target instance is used to identify an instance of the application program run by the target apparatus; and a generation unit, configured to generate a routing entry based on the identifier of the application program and the identifier of the target instance, where the routing entry includes the identifier of the application program and an egress port of the routing entry obtaining apparatus, the egress port of the routing entry obtaining apparatus is a port determined based on the identifier of the target instance, and the egress port of the routing entry obtaining apparatus is capable of communicating with a next-hop device on a path to the target apparatus.

[0027] Optionally, the routing entry obtaining apparatus is connected to the first apparatus and the second apparatus; and
the first obtaining unit is configured to: receive a first packet from the first apparatus, where the first packet includes the computing capability of the first apparatus and the identifier of the application program; and receive a second packet from the second apparatus, where the second packet includes the computing capability of the second apparatus and the identifier of the application program.

[0028] Optionally, the routing entry obtaining apparatus is connected to the first apparatus; and
the first obtaining unit is configured to: receive a third packet from the first apparatus, where the third packet includes the computing capability of the first apparatus and the identifier of the application program; and receive a fourth packet from a second network device in a same network topology, where the fourth packet includes the computing capability of the second apparatus and the identifier of the application program.

[0029] Optionally, the routing entry obtaining apparatus is connected to a virtual router; and the first obtaining unit is configured to receive a fifth packet sent by the virtual router, where the fifth packet includes the identifier of the application program, the computing capability of the first apparatus, and the computing capability of the second apparatus.

[0030] Optionally, the routing entry obtaining apparatus further includes a first sending unit, configured to send a sixth packet to a third network device in a same network topology, where the sixth packet includes the identifier of the application program, the computing capability of the first apparatus, and the computing capability of the second apparatus.

[0031] Optionally, the routing entry obtaining apparatus further includes a second sending unit, configured to send a seventh packet to a fourth network device in the same network topology, where the seventh packet includes the identifier of the application program and the computing capability of the first apparatus.

[0032] Optionally, the generation unit is configured to: determine, based on the identifier of the target instance, the next-hop device on the path to the target apparatus; and obtain, based on the next-hop device on the path to the target apparatus, the egress port that is of the routing entry obtaining apparatus and that is capable of communicating with the next-hop device.

[0033] Optionally, the routing entry obtaining apparatus further includes: a first receiving unit, configured to receive an eighth packet from a terminal device, where the eighth packet includes the identifier of the application program; a third obtaining unit, configured to obtain the egress port of the first network device based on the identifier of the application program and the routing entry; and a third sending unit, configured to send the eighth packet through the egress port of the first network device.

[0034] Optionally, the routing entry further includes network performance of the path, and the generation unit is specifically configured to: obtain the network performance of the path; and determine, based on the network performance of the path and the identifier of the target instance, the next-hop device on the path to the target apparatus.

[0035] Optionally, the routing entry obtaining apparatus further includes: a second receiving unit, configured to receive a ninth packet from a terminal device, where the ninth packet includes the identifier of the application program and a network performance requirement of the application program; a fourth obtaining unit, configured to obtain the egress port of the routing entry obtaining apparatus based on the identifier of the application program, the network performance requirement of the application program, and the routing entry, where the network performance of the path corresponding to the egress port matches the network performance requirement of the application program; and a fourth sending unit, configured to send the ninth packet through the egress port of the routing entry obtaining apparatus.

[0036] Optionally, the routing entry further includes a weight value determined based on a computing capability of the target apparatus, and the weight value is used to identify a probability of sending a packet to the target apparatus through the egress port.

[0037] According to a fifth aspect, an embodiment of this application further provides a packet sending apparatus. The apparatus may be applied to a terminal device, and specifically includes: a first sending unit, configured to send an application processing request to a first device, where the application processing request includes a URL of an application program; a receiving unit, configured to receive, from the first device, an identifier of the application program corresponding to the URL of the application program; and a second sending unit, configured to send a packet to a first network device, where the packet includes the identifier of the application program.

[0038] Optionally, the first device is a DNS, an LB, or the first network device.

[0039] According to a sixth aspect, an embodiment of this application further provides a sending apparatus. The apparatus may be applied to a first device. The sending apparatus specifically includes: a receiving unit, configured to receive an application processing request from a terminal device, where the application processing request carries a URL of an application program; an obtaining unit, configured to obtain an identifier of the application program based on the URL of the application program and a mapping relationship, where the mapping relationship includes the URL of the application program and the identifier of the application program; and a sending unit, configured to send the identifier of the application program to the terminal device.

[0040] Optionally, the first device may be a DNS, an LB, or an edge network device connected to the terminal device.

BRIEF DESCRIPTION OF DRAWINGS



[0041] 

FIG. 1 is a schematic structural diagram of a network system according to an embodiment of this application;

FIG. 2 is a flowchart of a routing entry obtaining method according to an embodiment of this application;

FIG. 3 is a structural block diagram of a routing entry obtaining apparatus according to an embodiment of this application;

FIG. 4 is a structural block diagram of a packet sending apparatus according to an embodiment of this application;

FIG. 5 is a structural block diagram of a sending apparatus according to an embodiment of this application;

FIG. 6 is a structural block diagram of a network device according to an embodiment of this application;

FIG. 7 is a structural block diagram of a packet sending apparatus according to an embodiment of this application; and

FIG. 8 is a structural block diagram of a sending apparatus according to an embodiment of this application.


DESCRIPTION OF EMBODIMENTS



[0042] To provide a user with an apparatus with an appropriate computing capability to perform communication, embodiments of this application provide a network system, a routing entry obtaining method and apparatus, and a device. In the embodiments of this application, an apparatus running an application program may be an apparatus such as a virtual machine, a server, or a container. For ease of description, in method embodiments and examples provided in this application, that the apparatus running the application program is a virtual machine is used as an example for description.

[0043] FIG. 1 is a schematic structural diagram of a network system 100 according to an embodiment of this application. In FIG. 1, the network system includes a virtual machine 101, a virtual machine 102, a virtual machine 103, a virtual machine 104, a virtual machine 105, a network device 111, a network device 112, a network device 113, a network device 114, a network device 115, a network device 116, and a terminal device 121. The virtual machine 101, the virtual machine 102, and the virtual machine 103 are all connected to the network device 111. Both the virtual machine 104 and the virtual machine 105 are connected to the network device 114. The network device 111 is connected to both the network device 112 and the network device 114. The network device 112 is connected to both the network device 113 and the network device 115. The network device 114 is connected to the network device 115. The network device 113 is connected to the network device 116. The network device 116 is connected to the terminal device 121.

[0044] It should be noted that in this embodiment of this application, a connection between a virtual machine and a network device may be a direct connection, or may be an indirect connection. The indirect connection between the virtual machine and the network device may mean that the virtual machine is connected to the network device through a device such as a gateway. A connection between a network device and a terminal device may be a direct connection, or may be an indirect connection. The indirect connection between the network device and the terminal device may mean that the network device is connected to the terminal device through a customer edge (CE) device.

[0045] In this embodiment of this application, any network device in FIG. 1 may be a device such as a router (router) or a layer 3 switch. The network device 111 and the network device 114 are edge network devices connected to virtual machines. For example, the network device 111 and the network device 114 are provider edge (PE) devices. The network device 112, the network device 113, the network device 115, and the network device 116 are non-edge network devices. For example, the network device 112, the network device 113, the network device 115, and the network device 116 are provider (P) devices. The network device 116 may be connected to the terminal device 121 through a customer edge device.

[0046] The terminal device 121 may be a mobile phone or a personal computer (PC). The personal computer may be a tablet personal computer (Tablet PC), a notebook computer, an ultra-mobile personal computer, a personal digital assistant, or the like. An application program is installed in the terminal device 121. In this embodiment of this application, the application program may be, for example, a game-related APP, a video-related APP, an email-related APP, an instant messaging-related APP, a traffic information-related APP, or a weather forecast-related APP.

[0047] One or more application program instances of a same application program are deployed on the virtual machine 101, the virtual machine 102, the virtual machine 103, the virtual machine 104, and the virtual machine 105. Different application program instances are deployed on different virtual machines. A plurality of virtual machines connected to a same network device can be deployed on one or more servers. For example, the virtual machine 101, the virtual machine 102, and the virtual machine 103 may be deployed on a same server, or may be deployed on different servers. For example, the virtual machine 104 and the virtual machine 105 may be deployed on a same server, or may be deployed on different servers.

[0048] FIG. 2 is a flowchart of a routing entry obtaining method according to an embodiment of this application.

[0049] The routing entry obtaining method provided in this embodiment of this application may be performed by a first network device. The first network device may be any network device in FIG. 1. The first network device may be an edge network device connected to a virtual machine, for example, the network device 111 or the network device 114. The first network device may alternatively be a network device in a network topology other than the edge network device connected to the virtual machine, for example, may be the network device 112, the network device 113, the network device 115, or the network device 116. Specific details of performing the method by the edge network device connected to the virtual machine are different from specific details of performing the method by the network device other than the edge network device. The following provides detailed descriptions.

[0050] S201. The first network device obtains an identifier of an application program, a computing capability of a first apparatus, and a computing capability of a second apparatus, where both the first apparatus and the second apparatus are configured to run the application program.

[0051] In this embodiment of this application, the computing capability of the first apparatus and the computing capability of the second apparatus include, for example, one or more of load, a quantity of central processing unit (CPU) cores, and a size of a random-access memory (RAM). This is not specifically limited in this embodiment of this application. The first apparatus may be a virtual machine, a server, or a container. The second apparatus may be a virtual machine, a server, or a container.

[0052] The identifier of the application program is used to identify the application program. For example, the identifier of the application program is a protocol characteristic string or an application attribute code (attribute code) of the application program. This is not specifically limited in this embodiment of this application. The identifier of the application program may be a segment identifier (SID).

[0053] In this embodiment of this application, if the first network device is an edge network device connected to a virtual machine in FIG. 1, for example, the network device 111 and the network device 114, the first network device may obtain the computing capability of the first apparatus, the computing capability of the second apparatus, and the identifier of the application program in three implementations.

[0054] In a first possible implementation, the first network device is connected to both the first apparatus and the second apparatus. If the first network device is the network device 111, the first apparatus is the virtual machine 101 in FIG. 1, and the second apparatus is the virtual machine 102 in FIG. 1. That the first network device obtains an identifier of an application program, a computing capability of a first apparatus, and a computing capability of a second apparatus includes: The first network device receives a first packet from the first apparatus, where the first packet includes the computing capability of the first apparatus and the identifier of the application program. The first network device receives a second packet from the second apparatus, where the second packet includes the computing capability of the second apparatus and the identifier of the application program.

[0055] In a second possible implementation, the first network device is connected to either the first apparatus or the second apparatus. If the first network device is the network device 111 in FIG. 1, the first apparatus is the virtual machine 101 in FIG. 1, and the second apparatus is the virtual machine 104 in FIG. 1. If the first network device is the network device 114 in FIG. 1, the first apparatus is the virtual machine 102 in FIG. 1, and the second apparatus is the virtual machine 104 in FIG. 1. If the first network device is connected to the first apparatus, that the first network device obtains an identifier of an application program, a computing capability of a first apparatus, and a computing capability of a second apparatus includes: The first network device receives a third packet from the first apparatus, where a first packet includes the computing capability of the first apparatus and the identifier of the application program. The first network device receives a fourth packet from a second network device in a same network topology, where a second packet includes the computing capability of the second apparatus and the identifier of the application program. If the first network device is connected to the second apparatus, that the first network device obtains an identifier of an application program, a computing capability of a first apparatus, and a computing capability of a second apparatus includes: The first network device receives a tenth packet from the second apparatus, where the tenth packet includes the computing capability of the first apparatus and the identifier of the application program. The first network device receives an eleventh packet from a fifth network device in a same network topology, where the eleventh packet includes the computing capability of the second apparatus and the identifier of the application program.

[0056] Using FIG. 1 as an example, if the first network device is the network device 111, the second network device may be the network device 114.

[0057] In a third possible implementation, the first network device is connected to a virtual router (VRouter). In this embodiment of this application, the virtual router may be connected to the first apparatus and the second apparatus through a hypervisor (hypervisor). The hypervisor obtains the computing capability of the first apparatus, the computing capability of the second apparatus, and the identifier of the application program. The hypervisor sends the computing capability of the first apparatus, the computing capability of the second apparatus, and the identifier of the application program to the virtual router, and the virtual router sends the computing capability of the first apparatus, the computing capability of the second apparatus, and the identifier of the application program to the first network device. That the first network device obtains an identifier of an application program, a computing capability of a first apparatus, and a computing capability of a second apparatus includes: The first network device receives a fifth packet sent by the virtual router, where the fifth packet includes the identifier of the application program, the computing capability of the first apparatus, and the computing capability of the second apparatus. In this implementation, the first apparatus may be a first virtual machine, and the second apparatus may be a second virtual machine.

[0058] In this embodiment of this application, all of the computing capability of the first apparatus, the computing capability of the second apparatus, and the identifier of the application program may be added to a typelength-value (TLV) field of the corresponding packet, for sending. The first packet to a seventh packet may be interior gateway protocol (IGP) packets, or may be border gateway protocol (BGP) packets.

[0059] In the first possible implementation and the third possible implementation, after receiving the computing capability of the first apparatus, the computing capability of the second apparatus, and the identifier of the application program, the first network device may send, to another network device in a same network topology, the parameters or a packet carrying the parameters. For example, the first network device sends a sixth packet to a third network device in the same network topology, where the sixth packet includes the identifier of the application program, the computing capability of the first apparatus, and the computing capability of the second apparatus. The computing capability of the first apparatus, the computing capability of the second apparatus, and the identifier of the application program may be carried in a TLV field of the sixth packet. The sixth packet may be an IGP packet, or may be a BGP packet.

[0060] If the sixth packet is an IGP packet, after receiving the sixth packet, the third network device sends the identifier of the application program, the computing capability of the first apparatus, and the computing capability of the second apparatus to another network device in the same network topology. Therefore, each network device in the network topology can obtain the identifier of the application program, the computing capability of the first apparatus, and the computing capability of the second apparatus in such a flooding manner. If the sixth packet is a BGP packet, the third network device may be a network device, that is, a headend, connected to the terminal device.

[0061] In the second possible implementation, after receiving the identifier of the application program, and either the computing capability of the first apparatus or the computing capability of the second apparatus, the first network device may send the received parameters to another network device in the same network topology. For example, if the first network device is connected to the first apparatus, the first network device sends the seventh packet to a fourth network device in the same network topology, where the seventh packet includes the identifier of the application program and the computing capability of the first apparatus. If the first network device is connected to the second apparatus, the first network device sends a twelfth packet to a sixth network device in the same network topology, where the twelfth packet includes the identifier of the application program and the computing capability of the second apparatus. The computing capability of the first apparatus and the identifier of the application program may be carried in a TLV field of the seventh packet. The identifier of the application program and the computing capability of the second apparatus may be carried in a TLV field of the twelfth packet. The seventh packet and the twelfth packet may be IGP packets, or may be BGP packets.

[0062] If the seventh packet is an IGP packet, after receiving the seventh packet, the fourth network device sends the identifier of the application program and the computing capability of the first apparatus to another network device in the same network topology. Therefore, each network device in the network topology can obtain the computing capability of the first apparatus and the identifier of the application program in such a flooding manner. If the seventh packet is a BGP packet, the fourth network device may be a network device, that is, a headend, connected to the terminal device. Likewise, if the twelfth packet is an IGP packet, after receiving the twelfth packet, the sixth network device sends the identifier of the application program and the computing capability of the second apparatus to another network device in the same network topology. Therefore, each network device in the network topology can obtain the identifier of the application program and the computing capability of the second apparatus in such a flooding manner. If the twelfth packet is a BGP packet, the sixth network device may be a network device, that is, a headend, connected to the terminal device.

[0063] The foregoing describes specific details of performing S201 by an edge network device connected to an apparatus. When another network device that is in the network topology and that is not connected to the apparatus specifically performs S201, the another network device receives the computing capability of the first apparatus, the computing capability of the second apparatus, and the identifier of the application program from the edge network device connected to the apparatus.

[0064] S202. The first network device determines, based on the computing capability of the first apparatus and the computing capability of the second apparatus, an apparatus whose computing capability satisfies a preset condition as a target apparatus.

[0065] In this embodiment of this application, after obtaining the computing capability of the first apparatus connected to the network topology and the computing capability of the second apparatus connected to the network topology, the first network device in the network topology may determine, based on the computing capability of the first apparatus and the computing capability of the second apparatus, the target apparatus whose computing capability satisfies the preset condition. The first network device herein may be an edge network device connected to the first apparatus and/or the second apparatus, or may be a network device connected to the edge network device.

[0066] In a possible implementation, the preset condition may be determined based on a threshold of the computing capability. If the computing capability includes load, the preset condition may be, for example, that the load is less than or equal to 50%. If the computing capability includes a quantity of CPU cores, the preset condition may be, for example, that the quantity of CPU cores is greater than or equal to four. If the computing capability includes a size of a RAM, the preset condition may be, for example, that the size of the RAM is greater than or equal to 100 megabytes.

[0067] In another possible implementation, the preset condition may alternatively be determined based on the computing capability of the first apparatus and the computing capability of the second apparatus. To be specific, the first network device may sort apparatuses based on computing capabilities of the apparatuses, and then select, from the apparatuses, apparatuses that rank in the top 1-N as target apparatuses. During specific implementation, a corresponding score may be calculated for each apparatus based on the computing capability of the apparatus. A higher score indicates a higher computing capability of the apparatus, and a lower score indicates a lower computing capability of the apparatus. Afterwards, the computing capabilities of the apparatuses are sorted based on the corresponding scores of the apparatuses, and then the apparatuses that rank in the top 1-N are selected as target apparatuses, or an apparatus whose score is greater than or equal to a preset score is selected as the target apparatus. N is an integer greater than or equal to 1.In this embodiment of this application, the first apparatus and/or the second apparatus may satisfy the preset condition. If the two apparatuses satisfy the preset condition, one apparatus may be selected from the two apparatuses as the target apparatus, or both of the two apparatuses are used as target apparatuses, to communicate with the terminal device to implement load balancing. If one apparatus is selected from the two apparatuses that satisfy the preset condition, an apparatus may be randomly selected as the target apparatus, or an apparatus with a higher computing capability may be selected from the first apparatus and the second apparatus, as the target apparatus.

[0068] S203. The first network device obtains an identifier of a target instance, where the identifier of the target instance is used to identify an instance of the application program run by the target apparatus.

[0069] For example, the identifier of the target instance may be an Internet Protocol (IP) address of the target instance. When one target apparatus runs only one target instance of a same application program, an IP address of the target instance may be an IP address of the target apparatus. The identifier of the target instance may be a SID.

[0070] For example, if target apparatuses include a target apparatus 1 and a target apparatus 2, the target apparatus 1 runs a target instance 1 of an application program A, and the target apparatus runs a target instance 2 of the application program A, an identifier of the target instance 1 may be an IP address of the target apparatus 1, and an identifier of the target instance 2 may be an IP address of the target apparatus 2.

[0071] Certainly, the identifier of the target instance may be the IP address of the target instance, or may be another type of identifier. Persons skilled in the art may determine the identifier of the target instance depending on an actual situation.

[0072] In this embodiment of this application, the first network device may obtain the identifier of the target instance after determining the target apparatus, or may obtain the identifier of the target instance before determining the target apparatus.

[0073] If the identifier of the target instance is obtained after the target apparatus is determined, the first network device may send an identifier obtaining request to the target apparatus or the virtual router connected to the target apparatus, and receive the identifier of the target instance that is sent, to the first network device according to the identifier obtaining request, by the target apparatus or the virtual router connected to the target apparatus. When preset conditions for selecting target apparatuses by all first network devices in the network topology are the same, identifiers of target instances that need to be obtained by all the first network devices are also the same. Therefore, after obtaining the identifier of the target instance, the edge network device connected to the target apparatus may send the identifier of the target instance to another network device in the network topology in a flooding manner, so that each network device obtains the identifier of the target instance.

[0074] Using FIG. 1 as an example, if the network device 114 determines that the target apparatus is the virtual machine 104, the network device 114 may send an identifier obtaining request to the virtual machine 104, and receive an identifier that is of a target instance run by the virtual machine 104 and that is sent by the virtual machine 104 according to the identifier obtaining request. After obtaining the identifier of the target instance, the network device 114 may send the identifier of the target instance to other network devices in the network topology in a flooding manner, so that the network device 111 to the network device 116 all obtain the identifier of the target instance.

[0075] If the identifier of the target instance is obtained before the target apparatus is determined, the identifier of the target instance may be carried in a packet that carries the identifier of the application program and a computing capability of the target apparatus and that is sent by the target apparatus or the virtual router connected to the target apparatus. In other words, when sending, to the first network device, the packet carrying the identifier of the application program and the computing capability of the target apparatus, the target apparatus or the virtual router connected to the target apparatus further adds the identifier of the target instance to a TLV field of the packet and sends the identifier of the target instance together with the identifier of the application program and the computing capability of the target apparatus. Specifically, the packet carrying the computing capability of the first apparatus further carries an identifier of an instance of the application program run by the first apparatus, and the packet carrying the computing capability of the second apparatus further carries an identifier of an instance of the application program run by the second apparatus. In this way, after the target apparatus is determined, the identifier of the target instance can be determined from the identifier of the instance of the application program run by the first apparatus and the identifier of the instance of the application program run by the second apparatus. After receiving the identifier of the instance of the application program run by the first apparatus and the identifier of the instance of the application program run by the second apparatus, the first network device may send the two identifiers to another network device in the network topology in a flooding manner. A specific process is similar to the process of sending the computing capability of the first apparatus, the computing capability of the second apparatus, and the identifier of the application program in a flooding manner. Details are not described herein again.

[0076] S204. The first network device generates a routing entry, where the routing entry includes the identifier of the application program and an egress port, and the egress port is capable of communicating with a next-hop device on a path to the target apparatus.

[0077] In this embodiment of this application, if the first network device is an edge network device connected to the first apparatus and/or the second apparatus, the first network device generates the routing entry based on the identifier of the target instance and the identifier of the application program. Specifically, the first network device may obtain the path from the edge network device to the target apparatus based on the identifier of the target instance; determine the egress port of the first network device based on the path, where the egress port is a port used by the first network device to communicate with the next-hop device on the path to the target apparatus; and obtain the routing entry based on the egress port and the identifier of the application program.

[0078] Using FIG. 1 as an example, the target apparatus is the virtual machine 104, and the network device 114 is an edge network device connected to the virtual machine 104. The network device 114 obtains a path from the network device 114 to the virtual machine 104 based on the identifier of the target instance run by the virtual machine 104. The network device 114 determines an egress port of the network device 114 based on the obtained path. The egress port is a port used by the network device 114 to communicate with a next-hop device on the path. Finally, the network device 114 obtains a routing entry of the network device 114 based on the egress port and the identifier of the application program.

[0079] The network device 112 in FIG. 1 is used as an example. The target apparatus is the virtual machine 104, and the network device 112 obtains a path from the network device 112 to the virtual machine 104 based on the identifier of the target instance run by the virtual machine 104. The path is: the network device 112 -> the network device 111 -> the network device 114. The network device 112 determines, based on the path, a port that is of the network device 112 and that communicates with a next-hop device on the path, that is, the network device 111. The network device 112 uses the obtained port as an egress port. The network device 112 obtains a routing entry of the network device 112 based on the egress port and the identifier of the application program. Methods for obtaining routing entries of the network device 111, the network device 113, the network device 115, and the network device 116 are basically the same as the method for obtaining the routing entry of the network device 112. Details are not described herein again.

[0080] An entry included in Table 1 is an example of a routing entry including an egress port reaching the first apparatus. In Table 1, an APP ID corresponds to an egress port 1, and the egress port 1 can reach the first apparatus.
Table 1
Identifier of an application programEgress port
APP ID Egress port 1


[0081] There may be one or more paths from the first network device to a target apparatus. If there are a plurality of paths from the first network device to the target apparatus, a shortest path may be selected from the paths, or a path that satisfies a network performance requirement of the application program may be determined based on network performance of the paths, so as to obtain a corresponding egress port based on the selected or determined path. The network performance requirement of the application program may be represented as one or more of information such as a bandwidth (bandwidth), a latency (latency), a latency jitter (jitter), a packet loss (packet loss), reliability (reliability), and security (security).

[0082] The network performance requirement of the application program may be represented as a specific value of information such as a bandwidth and a latency (for example, a value of a minimum bandwidth and a value of an upper latency limit), or may be represented as a service level agreement (SLA) indicative of information such as a bandwidth and a latency, or may be represented as a path attribute in a path computation algorithm. The SLA specifies multi-dimensional network performance requirements, for example, a bandwidth of 150 M, an upper latency limit of 5 ms, and a latency jitter of +/-2 ms. The path attribute may be indicated by using a color (color). For example, red indicates that information about the network performance requirement of the application program is a high bandwidth, or blue indicates that information about the network performance requirement of the application program is a low latency. The SLA may also be indicated by using a color (color). For example, an SLA indicated by red indicates a high bandwidth and a low latency, or an SLA indicated by blue indicates a low bandwidth. It should be noted that "high" and "low" are relative to each other in this embodiment of this application. Specific degrees of "high" and "low" are determined by persons skilled in the art.

[0083] During generation of the routing entry, the routing entry may include the network performance of the path in addition to the identifier of the application program and the egress port.

[0084] Entries included in Table 2 are examples of routing entries including egress ports reaching the second apparatus. In Table 2, an APP ID corresponds to three egress ports: an egress port 2, an egress port 3, and an egress port 4. Different egress ports correspond to paths with different network performance. All the three egress ports can reach the second apparatus.
Table 2
Identifier of an application programEgress portNetwork performance requirement
APP ID Egress port 2 Bandwidth>20 Mbit/s
Egress port 3 Latency<1 ms
Egress port 4 Latency jitter of +/-2 ms


[0085] It should be noted that in this embodiment of this application, the egress port may be a physical port, or may be a logical port. If the egress port is a logical port, a tunnel (tunnel) identifier may be used to identify the egress port. The tunnel identifier is used to identify a tunnel. In Table 2, the egress port 2 may be indicated by using a tunnel identifier 1, the egress port 3 may be indicated by using a tunnel identifier 2, and the egress port 4 may be indicated by using a tunnel identifier 3.

[0086] In this embodiment of this application, the routing entry may further include a weight value determined based on the computing capability of the target apparatus, and the weight value is used to identify a probability of sending a packet to the target apparatus through the egress port. When there are a plurality of target apparatuses, weight values are used to indicate load balancing capabilities of the plurality of target apparatuses. In actual application, the weight value may be determined based on the computing capability of the target apparatus.

[0087] Entries included in Table 3 are examples of routing entries including egress ports respectively reaching the first apparatus and the second apparatus. In Table 3, an APP ID corresponds to two egress ports: an egress port 5 and an egress port 6. The egress port 5 can reach the first apparatus and the egress port 6 can reach the second apparatus. Assuming that a ratio of the computing capability of the first apparatus to the computing capability of the second apparatus is 3:2, a weight value corresponding to the egress port 5 is 60%, and a weight value corresponding to the egress port 6 is 40%. In other words, in packets (for example, the following eighth packet) that include the APP ID in Table 3 and that are received by the first network device from the terminal device, 60% of the packets reach the first apparatus, and 40% of the packets reach the second apparatus, so as to implement load balancing.
Table 3
Identifier of an application programEgress portWeight value
APP ID Egress port 5 60%
Egress port 6 40%


[0088] In this embodiment of this application, if the routing entry includes the identifier of the application program and the egress port, for example, the routing entry described in Table 1, the first network device may correspondingly perform S204 and S205. If the routing entry includes the identifier of the application program, the egress port, and the network performance of the path, for example, the routing entry described in Table 2, the first network device may perform S205' and S206'.

[0089] S205. The first network device receives the eighth packet from the terminal device, and determines the corresponding egress port based on the routing entry and the identifier that is of the application program and that is included in the eighth packet.

[0090] In this embodiment of this application, the identifier of the application program may be carried in a destination address field of the eighth packet. The eighth packet may be, for example, an Internet Protocol version 4 (IPv4) packet or an Internet Protocol version 6 (IPv6) packet. If the eighth packet is an IPv6 packet, the eighth packet may specifically be a segment routing version 6 (SRv6) packet in the IPv6 packet.

[0091] S206. The first network device sends the eighth packet through the egress port of the first network device.

[0092] S205'. The first network device receives a ninth packet from the terminal device, and obtains the egress port of the first network device based on the routing entry, and the identifier of the application program and the network performance requirement of the application program that are included in the ninth packet.

[0093] In this embodiment of this application, the identifier of the application program and the network performance requirement of the application program may be carried in a destination address field of the ninth packet. The ninth packet may be, for example, an IPv4 packet or an IPv6 packet. If the ninth packet is an IPv6 packet, the ninth packet may specifically be an SRv6 packet.

[0094] The network performance of the path corresponding to the egress port determined by the first network device matches the network performance requirement of the application program. For example, the network performance requirement that is of the application program and that is carried in the ninth packet is that a bandwidth is higher than 20 Mbit/s. Assuming that all the three egress ports in Table 2 can reach the target apparatus, the first network device may select an egress port, that is, the egress port 2, corresponding to the path whose network performance matches the network performance requirement of the application program to send the ninth packet.

[0095] S206'. The first network device sends the ninth packet through the egress port of the first network device.

[0096] In this embodiment of this application, the terminal device may obtain identifier of the application program in a plurality of manners. In a first possible implementation, the identifier of the application program may be configured for the terminal device. In a second possible implementation, the terminal device may obtain the identifier of the application program from a domain name system (DNS), a load balancer (LB), or a headend (for example, the network device 116 in FIG. 1) in the network topology. Specifically, the terminal device may send a service processing request to the DNS, the LB, or the headend, where the service processing request carries a uniform resource locator (URL) of the application program. A mapping relationship between the URL of the application program and the identifier of the application program is prestored in the DNS, the LB, or the headend. After receiving the service processing request, the DNS, the LB, or the headend may determine the corresponding identifier of the application program based on the URL in the service processing request and the mapping relationship, and send the identifier of the application program to the terminal device.

[0097] For a manner in which the terminal device obtains the network performance requirement of the application program, refer to the foregoing two possible implementations. Details are not described herein again.

[0098] Certainly, the foregoing two possible implementations do not constitute any limitation on the technical solutions of this application. Persons skilled in the art may design implementations depending on an actual situation.

[0099] In this embodiment of this application, the first network device obtains the identifier of the application program, the computing capability of the first apparatus running the application program, and the computing capability of the second apparatus running the application program; determines, based on the computing capability of the first apparatus and the computing capability of the second apparatus, the apparatus whose computing capability satisfies the preset condition as the target apparatus; and generates the routing entry based on the identifier of the application program and the identifier of the target instance of the application program run by the target apparatus. After receiving a packet from the terminal device, the first network device can forward the packet to the target apparatus based on the routing entry, and the target apparatus processes the packet. Because the target apparatus is the apparatus that satisfies the preset condition, that is, an apparatus with a relatively high computing capability, the target apparatus can process the packet relatively quickly. This achieves relatively high packet processing efficiency and better user experience.

[0100] In addition, when each of a plurality of network devices in the network topology can be used as the first network device to perform the routing entry obtaining method, if some network devices are faulty, another network device may forward, to the target apparatus, the packet that is from the terminal device, to ensure packet processing and achieve relatively high reliability.

[0101] The following describes, based on the network system in FIG. 1, the routing entry generation method by using an application scenario of running an IGP protocol in the network topology as an example.

[0102] S301. The network device 111 separately receives packets from the virtual machine 101, the virtual machine 102, and the virtual machine 103, and the network device 114 separately receives packets from the virtual machine 104 and the virtual machine 105.

[0103] The packet from the virtual machine 101 includes an identifier of an application program A, a computing capability of the virtual machine 101, and an identifier of an instance 1 of the application program A run by the virtual machine 101. The packet from the virtual machine 102 includes the identifier of the application program A, a computing capability of the virtual machine 102, and an identifier of an instance 2 of the application program A run by the virtual machine 102. The packet from the virtual machine 103 includes the identifier of the application program A, a computing capability of the virtual machine 103, and an identifier of an instance 3 of the application program A run by the virtual machine 103. The packet from the virtual machine 104 includes the identifier of the application program A, a computing capability of the virtual machine 104, and an identifier of an instance 4 of the application program A run by the virtual machine 104. The packet from the virtual machine 105 includes the identifier of the application program A, a computing capability of the virtual machine 105, and an identifier of an instance 5 of the application program A run by the virtual machine 105.

[0104] S302. Based on the IGP protocol, the network device 111 sends, in a flooding manner, the identifier of the application program A, the computing capability of the virtual machine 101, the computing capability of the virtual machine 102, the computing capability of the virtual machine 103, the identifier of the instance 1, the identifier of the instance 2, and the identifier of the instance 3 in the network topology; and the network device 114 sends, in a flooding manner, the identifier of the application program A, the computing capability of the virtual machine 104, the computing capability of the virtual machine 105, the identifier of the instance 4, and the identifier of the instance 5 in the network topology. In this way, each network device in the network topology can obtain the identifier of the application program A, the computing capability of the virtual machine 101, the computing capability of the virtual machine 102, the computing capability of the virtual machine 103, the computing capability of the virtual machine 104, the computing capability of the virtual machine 105, the identifier of the instance 1, the identifier of the instance 2, the identifier of the instance 3, the identifier of the instance 4, and the identifier of the instance 5.

[0105] Alternatively, S302' is performed.

[0106] S302'. Based on a BGP protocol, the network device 111 sends the identifier of the application program A, the computing capability of the virtual machine 101, the computing capability of the virtual machine 102, the computing capability of the virtual machine 103, the identifier of the instance 1, the identifier of the instance 2, and the identifier of the instance 3 to a headend connected to the terminal device 121, that is, the network device 116; and the network device 114 sends the identifier of the application program A, the computing capability of the virtual machine 104, the computing capability of the virtual machine 105, the identifier of the instance 4, and the identifier of the instance 5 to the headend connected to the terminal device 121, that is, the network device 116. In this way, the network device 116 obtains the identifier of the application program A, the computing capability of the virtual machine 101, the computing capability of the virtual machine 102, the computing capability of the virtual machine 103, the computing capability of the virtual machine 104, the computing capability of the virtual machine 105, the identifier of the instance 1, the identifier of the instance 2, the identifier of the instance 3, the identifier of the instance 4, and the identifier of the instance 5.

[0107] Before sending the information to the headend connected to the terminal device 121, that is, the network device 116, the network device 111 and the network device 114 may first separately establish a BGP session with the network device 116.

[0108] S303: The network device, such as all network devices or the network device 116 in the network topology, that obtains the identifier of the application program A, the computing capability of the virtual machine 101, the computing capability of the virtual machine 102, the computing capability of the virtual machine 103, the computing capability of the virtual machine 104, the computing capability of the virtual machine 105, the identifier of the instance 1, the identifier of the instance 2, the identifier of the instance 3, the identifier of the instance 4, and the identifier of the instance 5 determines, from the five virtual machines, target virtual machines that satisfy a preset computing capability condition, for example, the virtual machine 101, the virtual machine 104, and the virtual machine 105; determines, based on the identifier of the instance 1, an egress port reaching the virtual machine 101, determines, based on the identifier of the instance 4, an egress port reaching the virtual machine 104, and determines, based on the identifier of the instance 5, an egress port reaching the virtual machine 105; and then obtains a corresponding routing entry based on the egress ports and the identifier of the application program A.

[0109] For example, the egress port that reaches the virtual machine 101 and that is determined by the network device 116 based on the identifier of the instance 1, the egress port that reaches the virtual machine 104 and that is determined by the network device 116 based on the identifier of the instance 4, and the egress port that reaches the virtual machine 105 and that is determined by the network device 116 based on the identifier of the instance 5 each are an egress port a connected to the network device 113. In this case, the network device 116 may generate a routing entry in the following Table 4:
Table 4
Identifier of an application programEgress portWeight value
Identifier of the application program A Egress port a 100%


[0110] Corresponding weight values that are obtained based on the computing capability of the virtual machine 101, the computing capability of the virtual machine 104, and the computing capability of the virtual machine 105 may be 40%, 30%, and 30%, respectively. In this case, a weight value corresponding to the egress port a is a sum of the three weight values, that is, 100%. In other words, all packets about the application program A that are from the terminal device are sent to a next-hop device, that is, the network device 113, through the port a.

[0111] For another example, the egress port that reaches the virtual machine 101 and that is determined by the network device 111 based on the identifier of the instance 1 is an egress port b, and the egress port that reaches the virtual machine 104 and that is determined by the network device 111 based on the identifier of the instance 4 and the egress port that reaches the virtual machine 105 and that is determined by the network device 111 based on the identifier of the instance 5 each are an egress port c connected to the network device 114. In this case, the network device 111 may generate a routing entry in the following Table 5:
Table 5
Identifier of an application programEgress portWeight value
Identifier of the application program A Egress port b 40%
Egress port c 60%


[0112] Because the egress port b can reach the virtual machine 101, a corresponding weight value of the egress port b is 40%. Because the egress port c can reach the virtual machine 104 and the virtual machine 105, a corresponding weight value of the egress port c is 30%+30%, that is, 60%. In other words, 40% of packets about the application program A that are from the terminal device are sent to the virtual machine 101 through the egress port b, and 60% of the packets are sent to the virtual machine 104 and the virtual machine 105 through the egress port c.

[0113] S304. The network device 116 receives a packet from the terminal device 121, where the packet includes the identifier of the application program A. The network device 116 finds a corresponding egress port, that is, the egress port a, based on the routing entry corresponding to the network device 116, and sends the packet to the network device 113. The network device 113 sends the packet to the network device 112, and the network device 112 sends the packet to the network device 111. The network device 111 sends the packet through the egress port b with a probability of 40%, and sends the packet through the egress port c with a probability of 60%. In this way, load balancing is implemented while the computing capabilities of the virtual machines are ensured.

[0114] Refer to FIG. 3. An embodiment of this application further provides a routing entry obtaining apparatus 300. The routing entry obtaining apparatus is applied to a first network device.

[0115] The routing entry obtaining apparatus 300 includes a first obtaining unit 301, a determining unit 302, a second obtaining unit 303, and a generation unit 304. The first obtaining unit 301 is configured to perform S201 in the embodiment shown in FIG. 2. The determining unit 302 is configured to perform S202 in the embodiment shown in FIG. 2. The second obtaining unit 303 is configured to perform S203 in the embodiment shown in FIG. 2. The generation unit 304 is configured to perform S204 in the embodiment shown in FIG. 2. Details are as follows. The first obtaining unit 301 is configured to obtain an identifier of an application program, a computing capability of a first apparatus running the application program, and a computing capability of a second apparatus running the application program;

the determining unit 302 is configured to determine, based on the computing capability of the first apparatus and the computing capability of the second apparatus, an apparatus whose computing capability satisfies a preset condition as a target apparatus;

the second obtaining unit 303 is configured to obtain an identifier of a target instance, where the identifier of the target instance is used to identify an instance of the application program run by the target apparatus; and

the generation unit 304 is configured to generate a routing entry based on the identifier of the application program and the identifier of the target instance, where the routing entry includes the identifier of the application program and an egress port of the routing entry obtaining apparatus, the egress port of the routing entry obtaining apparatus is a port determined based on the identifier of the target instance, and the egress port of the routing entry obtaining apparatus is capable of communicating with a next-hop device on a path to the target apparatus.



[0116] The routing entry obtaining apparatus 300 can implement functions of the first network device in the method embodiment in FIG. 2. For specific execution steps, refer to the foregoing method embodiment. Details are not described herein again.

[0117] Refer to FIG. 4. An embodiment of this application further provides a packet sending apparatus 400. The apparatus may be applied to a terminal device. The packet sending apparatus 400 can implement functions of the terminal device in the embodiment shown in FIG. 2.

[0118] The packet sending apparatus 400 includes a first sending unit 401, a receiving unit 402, and a second sending unit 403. The first sending unit 401 is configured to send an application processing request to a first device, where the application processing request includes a URL of an application program. The receiving unit 402 is configured to receive, from the first device, an identifier of the application program corresponding to the URL of the application program. The second sending unit 403 is configured to send a packet to a routing entry obtaining apparatus, where the packet includes the identifier of the application program.

[0119] The packet sending apparatus 400 can implement functions of the terminal device in the method embodiment in FIG. 2. For specific execution steps, refer to the foregoing method embodiment. Details are not described herein again.

[0120] Refer to FIG. 5. An embodiment of this application further provides a sending apparatus 500. The apparatus may be applied to a first device. The sending apparatus 500 can implement functions of the DNS, the LB, or the first network device in the embodiment shown in FIG. 2.

[0121] The sending apparatus 500 specifically includes a receiving unit 501, an obtaining unit 502, and a sending unit 503.

[0122] The receiving unit 501 is configured to receive an application processing request from a terminal device, where the application processing request carries a URL of an application program. The obtaining unit 502 is configured to obtain an identifier of the application program based on the URL of the application program and a mapping relationship, where the mapping relationship includes the URL of the application program and the identifier of the application program. The sending unit 503 is configured to send the identifier of the application program to the terminal device.

[0123] The sending apparatus 500 can implement functions of the first device in the method embodiment in FIG. 2. For specific execution steps, refer to the foregoing method embodiment. Details are not described herein again.

[0124] Refer to FIG. 6. An embodiment of this application provides a network device 600. The network device 600 can implement functions of the first network device in the embodiments shown in FIG. 2 to FIG. 5. The network device 600 includes a memory 601, a processor 602, and a communications interface 603.

[0125] The memory 601 is configured to store instructions. When the embodiment shown in FIG. 3 is implemented and the units described in the embodiment in FIG. 3 are implemented by software, software or program code required for performing functions of the first obtaining unit 301, the determining unit 302, the second obtaining unit 303, and the generation unit 304 in FIG. 3 is stored in the memory 601.

[0126] The processor 602 is configured to execute the instructions in the memory 601 to perform the routing entry obtaining method applied to the first network device in the embodiment shown in FIG. 2.

[0127] The communications interface 603 is configured to perform communication.

[0128] The memory 601, the processor 602, and the communications interface 603 are connected to each other through a bus 604. The bus 604 may be a peripheral component interconnect (PCI) bus, an extended industry standard architecture (EISA) bus, or the like. The bus 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 in FIG. 6, but this does not mean that there is only one bus or only one type of bus.

[0129] In a specific embodiment, the processor 601 is configured to: obtain an identifier of an application program, a computing capability of a first apparatus running the application program, and a computing capability of a second apparatus running the application program; determine, based on the computing capability of the first apparatus and the computing capability of the second apparatus, an apparatus whose computing capability satisfies a preset condition as a target apparatus; obtain an identifier of a target instance, where the identifier of the target instance is used to identify an instance of the application program run by the target apparatus; and generate a routing entry based on the identifier of the application program and the identifier of the target instance, where the routing entry includes the identifier of the application program and an egress port of the network device, the egress port of the network device is a port determined based on the identifier of the target instance, and the egress port of the network device is capable of communicating with a next-hop device on a path to the target apparatus. For a detailed processing process of the processor 601, refer to detailed descriptions of S202 to S204 in the embodiment shown in FIG. 2. Details are not described herein again.

[0130] The communications interface 603 is configured to receive the identifier of the application program, the computing capability of the first apparatus running the application program, and the computing capability of the second apparatus running the application program. For a specific process thereof, refer to detailed descriptions of S201 in the embodiment shown in FIG. 2. Details are not described herein again.

[0131] Refer to FIG. 7. An embodiment of this application provides a terminal device 700. The terminal device 700 can implement functions of the terminal device in the embodiments shown in FIG. 2 to FIG. 5. The terminal device 700 includes a memory 701, a processor 702, and a communications interface 703.

[0132] The memory 701 is configured to store instructions. When the embodiment shown in FIG. 4 is implemented and the units described in the embodiment in FIG. 4 are implemented by software, software or program code required for performing functions of the first sending unit 401, the receiving unit 402, and the second sending unit 403 in FIG. 4 is stored in the memory 701.

[0133] The processor 702 is configured to execute the instructions in the memory 701 to perform the packet sending method applied to the terminal device in the embodiment shown in FIG. 2.

[0134] The communications interface 703 is configured to perform communication.

[0135] The memory 701, the processor 702, and the communications interface 703 are connected to each other through a bus 704. The bus 704 may be a peripheral component interconnect (PCI) bus, an extended industry standard architecture () bus, or the like. The bus 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 in FIG. 7, but this does not mean that there is only one bus or only one type of bus.

[0136] In a specific embodiment, the communications interface 703 is configured to: send an application processing request to a first device, where the application processing request includes a URL of an application program; receive, from the first device, an identifier of the application program corresponding to the URL of the application program; and send a packet to a first network device, where the packet includes the identifier of the application program. For a specific process thereof, refer to detailed descriptions in the embodiment shown in FIG. 2. Details are not described herein again.

[0137] Refer to FIG. 8. An embodiment of this application provides a device 800. The device 800 can implement functions of the first device in the embodiments shown in FIG. 2 to FIG. 5. The device 800 includes a memory 801, a processor 802, and a communications interface 803.

[0138] The memory 801 is configured to store instructions. When the embodiment shown in FIG. 5 is implemented and the units described in the embodiment in FIG. 5 are implemented by software, software or program code required for performing functions of the receiving unit 501, the obtaining unit 502, and the sending unit 503 in FIG. 5 is stored in the memory 801.

[0139] The processor 802 is configured to execute the instructions in the memory 801 to perform the sending method applied to the first device in the embodiment shown in FIG. 2.

[0140] The communications interface 803 is configured to perform communication.

[0141] The memory 801, the processor 802, and the communications interface 803 are connected to each other through a bus 804. The bus 804 may be a peripheral component interconnect (PCI) bus, an extended industry standard architecture (EISA) bus, or the like. The bus 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 in FIG. 8, but this does not mean that there is only one bus or only one type of bus.

[0142] In a specific embodiment, the processor 801 is configured to obtain an identifier of an application program based on a URL of the application program and a mapping relationship, where the mapping relationship includes the URL of the application program and the identifier of the application program. The communications interface 803 is configured to: send an application processing request to the first device, where the application processing request includes the URL of the application program; receive, from the first device, the identifier of the application program corresponding to the URL of the application program; and send a packet to a first network device, where the packet includes the identifier of the application program. For a specific process thereof, refer to detailed descriptions in the embodiment shown in FIG. 2. Details are not described herein again.

[0143] The memory 601, the memory 701, and the memory 801 each may be a random-access memory (RAM), a flash memory (flash), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a register (register), a hard disk, a removable hard disk, a CD-ROM, or any other form of storage medium known to persons skilled in the art.

[0144] The processor 602, the processor 702, and the processor 802 may be, for example, a central processing unit (CPU), a general-purpose processor, a digital signal processor (DSP), or an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or another programmable logic device, a transistor logic device, a hardware component, or any combination thereof. The processor may implement or execute various example logical blocks, modules, and circuits described with reference to content disclosed in this application. Alternatively, the processor may be a combination of processors implementing a computing function, for example, a combination of one or more microprocessors, or a combination of the DSP and a microprocessor.

[0145] The communications interface 603, the communications interface 703, and the communications interface 803 each may be an interface card such as the Ethernet (Ethernet) interface or an asynchronous transfer mode (ATM) interface.

[0146] An embodiment of this application further provides a network system. The network system includes a first network device and a terminal device. The first network device in the network system is the routing entry obtaining apparatus 300 shown in FIG. 3, and the terminal device is the packet sending apparatus 400 in the embodiment shown in FIG. 4.

[0147] Optionally, the network system may further include a first device, and the first device may be the sending apparatus 500 in the embodiment shown in FIG. 5.

[0148] An embodiment of this application further provides a computer-readable storage medium, including instructions. When the instructions are run on a computer, the computer is enabled to perform the routing entry obtaining method applied to the network device 600.

[0149] An embodiment of this application further provides a computer-readable storage medium, including instructions. When the instructions are run on a computer, the computer is enabled to perform the packet sending method applied to the terminal device 700.

[0150] An embodiment of this application further provides a computer-readable storage medium, including instructions. When the instructions are run on a computer, the computer is enabled to perform the sending method applied to the device 800.

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

[0152] It may be clearly understood by persons skilled in the art that, for the purpose of convenient and brief description, for a detailed working process of the foregoing system, apparatus, and unit, refer to a corresponding process in the foregoing method embodiments. Details are not described herein again.

[0153] In the several embodiments provided in this application, it should be understood that the disclosed system, apparatus, and method may be implemented in other manners. For example, the described apparatus embodiment is merely an example. For example, the unit division is merely logical module division and may be other division in actual implementation. For example, a plurality of units or components may be combined or integrated into another system, or some features may be ignored or not performed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections may be implemented through some interfaces. The indirect couplings or communication connections between the apparatuses or units may be implemented in electrical, mechanical, or other forms.

[0154] The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one position, or may be distributed on a plurality of network units. Some or all of the units may be obtained depending on an actual requirement to achieve the objectives of the solutions of the embodiments.

[0155] In addition, module units in the embodiments of this application may be integrated into one processing unit, or each of the units may exist alone physically, or two or more units are integrated into one unit. The integrated unit may be implemented in a form of hardware, or may be implemented in a form of a software module unit.

[0156] When the integrated unit is implemented in the form of a software module unit and sold or used as an independent product, the integrated unit may be stored in a computer-readable storage medium. Based on such an understanding, the technical solutions of this application essentially, or the part contributing to the conventional technology, or all or some of the technical solutions may be implemented in the form of a software product. The software product is stored in a storage medium and includes several instructions for instructing a computer device (which may be a personal computer, a server, or a network device) to perform all or some of the steps of the methods described in the embodiments of this application. The foregoing storage medium includes: any medium that can store program code, such as a USB flash drive, a removable hard disk, a read-only memory (ROM), a random-access memory (RAM), a magnetic disk, or an optical disc.

[0157] Persons skilled in the art should be aware that in the foregoing one or more examples, functions described in the present invention may be implemented by hardware, software, firmware, or any combination thereof. When the present invention is implemented by software, the foregoing functions may be stored in a computer-readable medium or transmitted as one or more instructions or code in the computer-readable medium. The computer-readable medium includes a computer storage medium and a communications medium, where the communications medium includes any medium that enables a computer program to be transmitted from one place to another. The storage medium may be any available medium accessible to a general-purpose or dedicated computer.

[0158] The objectives, technical solutions, and beneficial effects of the present invention are further described in detail in the foregoing specific implementations. It should be understood that the foregoing descriptions are merely specific implementations of the present invention.

[0159] In conclusion, the foregoing embodiments are merely intended for describing the technical solutions of this application, but not for limiting this application. Although this application is described in detail with reference to the foregoing embodiments, persons of ordinary skill in the art should understand that they may still make modifications to the technical solutions described in the foregoing embodiments or make equivalent replacements to some technical features thereof, without departing from the scope of the technical solutions of the embodiments of this application.


Claims

1. A routing entry obtaining method, wherein the method comprises:

obtaining, by a first network device, an identifier of an application program, a computing capability of a first apparatus running the application program, and a computing capability of a second apparatus running the application program;

determining, by the first network device based on the computing capability of the first apparatus and the computing capability of the second apparatus, an apparatus whose computing capability satisfies a preset condition as a target apparatus;

obtaining, by the first network device, an identifier of a target instance, wherein the identifier of the target instance is used to identify an instance of the application program run by the target apparatus; and

generating, by the first network device, a routing entry based on the identifier of the application program and the identifier of the target instance, wherein the routing entry comprises the identifier of the application program and an egress port of the first network device, the egress port of the first network device is a port determined based on the identifier of the target instance, and the egress port of the first network device is capable of communicating with a next-hop device on a path to the target apparatus.


 
2. The method according to claim 1, wherein if the first network device is connected to the first apparatus and the second apparatus, the obtaining, by a first network device, an identifier of an application program, a computing capability of a first apparatus running the application program, and a computing capability of a second apparatus running the application program comprises:

receiving, by the first network device, a first packet from the first apparatus, wherein the first packet comprises the computing capability of the first apparatus and the identifier of the application program; and

receiving, by the first network device, a second packet from the second apparatus, wherein the second packet comprises the computing capability of the second apparatus and the identifier of the application program.


 
3. The method according to claim 1, wherein if the first network device is connected to the first apparatus, the obtaining, by a first network device, an identifier of an application program, a computing capability of a first apparatus running the application program, and a computing capability of a second apparatus running the application program comprises:

receiving, by the first network device, a third packet from the first apparatus, wherein the third packet comprises the computing capability of the first apparatus and the identifier of the application program; and

receiving, by the first network device, a fourth packet from a second network device in a same network topology, wherein the fourth packet comprises the computing capability of the second apparatus and the identifier of the application program.


 
4. The method according to claim 1, wherein if the first network device is connected to a virtual router, the obtaining, by a first network device, an identifier of an application program, a computing capability of a first apparatus running the application program, and a computing capability of a second apparatus running the application program comprises:
receiving, by the first network device, a fifth packet sent by the virtual router, wherein the fifth packet comprises the identifier of the application program, the computing capability of the first apparatus, and the computing capability of the second apparatus.
 
5. The method according to claim 2 or 4, wherein the method further comprises:
sending, by the first network device, a sixth packet to a third network device in a same network topology, wherein the sixth packet comprises the identifier of the application program, the computing capability of the first apparatus, and the computing capability of the second apparatus.
 
6. The method according to claim 3, wherein the method further comprises:
sending, by the first network device, a seventh packet to a fourth network device in the same network topology, wherein the seventh packet comprises the identifier of the application program and the computing capability of the first apparatus.
 
7. The method according to any one of claims 1 to 6, wherein the generating, by the first network device, a routing entry based on the identifier of the application program and the identifier of the target instance comprises:

determining, by the first network device based on the identifier of the target instance, the next-hop device on the path to the target apparatus; and

obtaining, by the first network device based on the next-hop device on the path to the target apparatus, the egress port that is of the first network device and that is capable of communicating with the next-hop device.


 
8. The method according to any one of claims 1 to 7, wherein the method further comprises:

receiving, by the first network device, an eighth packet from a terminal device, wherein the eighth packet comprises the identifier of the application program;

obtaining, by the first network device, the egress port of the first network device based on the identifier of the application program and the routing entry; and

sending, by the first network device, the eighth packet through the egress port of the first network device.


 
9. The method according to claim 7, wherein the routing entry further comprises network performance of the path, and the determining, by the first network device based on the identifier of the target instance, the next-hop device on the path to the target apparatus comprises:

obtaining, by the first network device, the network performance of the path; and

determining, by the first network device based on the network performance of the path and the identifier of the target instance, the next-hop device on the path to the target apparatus.


 
10. The method according to claim 9, wherein the method further comprises:

receiving, by the first network device, a ninth packet from a terminal device, wherein the ninth packet comprises the identifier of the application program and a network performance requirement of the application program;

obtaining, by the first network device, the egress port of the first network device based on the identifier of the application program, the network performance requirement of the application program, and the routing entry, wherein the network performance of the path corresponding to the egress port matches the network performance requirement of the application program; and

sending, by the first network device, the ninth packet through the egress port of the first network device.


 
11. The method according to any one of claims 1 to 10, wherein the routing entry further comprises a weight value determined based on a computing capability of the target apparatus, and the weight value is used to identify a probability of sending a packet to the target apparatus through the egress port.
 
12. A routing entry obtaining apparatus, wherein the apparatus is applied to a first network device, and the apparatus comprises:

a first obtaining unit, configured to obtain an identifier of an application program, a computing capability of a first apparatus running the application program, and a computing capability of a second apparatus running the application program;

a determining unit, configured to determine, based on the computing capability of the first apparatus and the computing capability of the second apparatus, an apparatus whose computing capability satisfies a preset condition as a target apparatus;

a second obtaining unit, configured to obtain an identifier of a target instance, wherein the identifier of the target instance is used to identify an instance of the application program run by the target apparatus; and

a generation unit, configured to generate a routing entry based on the identifier of the application program and the identifier of the target instance, wherein the routing entry comprises the identifier of the application program and an egress port of the routing entry obtaining apparatus, the egress port of the routing entry obtaining apparatus is a port determined based on the identifier of the target instance, and the egress port of the routing entry obtaining apparatus is capable of communicating with a next-hop device on a path to the target apparatus.


 
13. The routing entry obtaining apparatus according to claim 12, wherein the routing entry obtaining apparatus is connected to the first apparatus and the second apparatus; and
the first obtaining unit is configured to: receive a first packet from the first apparatus, wherein the first packet comprises the computing capability of the first apparatus and the identifier of the application program; and receive a second packet from the second apparatus, wherein the second packet comprises the computing capability of the second apparatus and the identifier of the application program.
 
14. The routing entry obtaining apparatus according to claim 12, wherein the routing entry obtaining apparatus is connected to the first apparatus; and
the first obtaining unit is configured to: receive a third packet from the first apparatus, wherein the third packet comprises the computing capability of the first apparatus and the identifier of the application program; and receive a fourth packet from a second network device in a same network topology, wherein the fourth packet comprises the computing capability of the second apparatus and the identifier of the application program.
 
15. The routing entry obtaining apparatus according to claim 12, wherein the routing entry obtaining apparatus is connected to a virtual router; and the first obtaining unit is configured to receive a fifth packet sent by the virtual router, wherein the fifth packet comprises the identifier of the application program, the computing capability of the first apparatus, and the computing capability of the second apparatus.
 
16. The routing entry obtaining apparatus according to claim 13 or 15, wherein the routing entry obtaining apparatus further comprises:
a first sending unit, configured to send a sixth packet to a third network device in a same network topology, wherein the sixth packet comprises the identifier of the application program, the computing capability of the first apparatus, and the computing capability of the second apparatus.
 
17. The routing entry obtaining apparatus according to claim 14, wherein the routing entry obtaining apparatus further comprises:
a second sending unit, configured to send a seventh packet to a fourth network device in the same network topology, wherein the seventh packet comprises the identifier of the application program and the computing capability of the first apparatus.
 
18. The routing entry obtaining apparatus according to any one of claims 12 to 17, wherein
the generation unit is configured to: determine, based on the identifier of the target instance, the next-hop device on the path to the target apparatus; and obtain, based on the next-hop device on the path to the target apparatus, the egress port that is of the routing entry obtaining apparatus and that is capable of communicating with the next-hop device.
 
19. The routing entry obtaining apparatus according to any one of claims 12 to 18, wherein the routing entry obtaining apparatus further comprises:

a first receiving unit, configured to receive an eighth packet from a terminal device, wherein the eighth packet comprises the identifier of the application program;

a third obtaining unit, configured to obtain the egress port of the routing entry obtaining apparatus based on the identifier of the application program and the routing entry; and

a third sending unit, configured to send the eighth packet through the egress port of the routing entry obtaining apparatus.


 
20. The routing entry obtaining apparatus according to claim 18, wherein the routing entry further comprises network performance of the path, and the generation unit is specifically configured to:

obtain the network performance of the path; and

determine, based on the network performance of the path and the identifier of the target instance, the next-hop device on the path to the target apparatus.


 
21. The routing entry obtaining apparatus according to claim 20, wherein the routing entry obtaining apparatus further comprises:

a second receiving unit, configured to receive a ninth packet from a terminal device, wherein the ninth packet comprises the identifier of the application program and a network performance requirement of the application program;

a fourth obtaining unit, configured to obtain the egress port of the routing entry obtaining apparatus based on the identifier of the application program, the network performance requirement of the application program, and the routing entry, wherein the network performance of the path corresponding to the egress port matches the network performance requirement of the application program; and

a fourth sending unit, configured to send the ninth packet through the egress port of the routing entry obtaining apparatus.


 
22. The routing entry obtaining apparatus according to any one of claims 12 to 21, wherein the routing entry further comprises a weight value determined based on a computing capability of the target apparatus, and the weight value is used to identify a probability of sending a packet to the target apparatus through the egress port.
 




Drawing



















Search report










Cited references

REFERENCES CITED IN THE DESCRIPTION



This list of references cited by the applicant is for the reader's convenience only. It does not form part of the European patent document. Even though great care has been taken in compiling the references, errors or omissions cannot be excluded and the EPO disclaims all liability in this regard.

Patent documents cited in the description






Erroneously filed documents

Erroneous claims

1. A cell site gateway (CSG) determining method, comprising:

obtaining, by a first device before a first moment, a location range of a mobile device at the first moment; and

obtaining, by the first device before the first moment, an identifier of at least one target CSG based on the location range, wherein the at least one target CSG is capable of providing downlink data transmission for the mobile device at the first moment.


 
2. The method according to claim 1, wherein the obtaining, by a first device before a first moment, a location range of a mobile device at the first moment comprises:

determining, by the first device, a first location and a second moment of the mobile device, wherein the first location is a location of the mobile device at the second moment, and the second moment is earlier than the first moment; and

calculating, by the first device, the location range based on the first location, the second moment, a preset speed, and preset duration, wherein the preset speed is a moving speed of the mobile device within the preset duration, and the preset duration is duration between the second moment and the first moment.


 
3. The method according to claim 1, wherein the obtaining, by a first device before a first moment, a location range of a mobile device at the first moment comprises:

determining, by the first device, a first location, a second moment, and a speed of the mobile device, wherein the first location is a location of the mobile device at the second moment, the speed is a moving speed of the mobile device, and the second moment is earlier than the first moment; and

calculating, by the first device, the location range based on the first location, the second moment, the speed, and the preset duration, wherein the preset duration is duration between the second moment and the first moment.


 
4. The method according to claim 1, wherein the obtaining, by a first device before a first moment, a location range of a mobile device at the first moment comprises:

determining, by the first device, a first location, a second moment, a first speed, a first acceleration, a second location, a third moment, a second speed, and a second acceleration of the mobile device, wherein the first location is a location of the mobile device at the second moment, the first speed is a moving speed of the mobile device at the second moment, the first acceleration is a moving acceleration of the mobile device at the second moment, the second location is a location of the mobile device at the third moment, the second speed is a moving speed of the mobile device at the third moment, the second acceleration is a moving acceleration of the mobile device at the third moment, and both the second moment and the third moment are earlier than the first moment; and

calculating, by the first device, the location range by using a prediction algorithm based on the first location, the second moment, the first speed, the first acceleration, the second location, the third moment, the second speed, the second acceleration, and the preset duration, wherein the preset duration is duration between the second moment and the first moment or duration between the third moment and the first moment.


 
5. The method according to any one of claims 1 to 4, wherein the first device is a multi-service aggregation site gateway MASG, and the obtaining, by the first device before the first moment, an identifier of at least one target CSG based on the location range comprises:

obtaining, by the first device, a mapping relationship from a controller;

determining, by the first device based on the location range, an identifier of a radio access device that covers the location range; and

obtaining, by the first device, the identifier of the at least one target CSG based on the mapping relationship and the identifier of the radio access device, wherein the mapping relationship comprises the identifier of the at least one target CSG and the identifier of the radio access device that communicates with the at least one target CSG.


 
6. The method according to any one of claims 1 to 5, wherein the first device is the MASG, and after the obtaining, by the first device before the first moment, an identifier of at least one target CSG based on the location range, the method further comprises:

establishing, by the first device, a tunnel to the at least one target CSG based on the identifier of the at least one target CSG before the first moment; and

sending, by the first device, downlink data of the mobile device to the at least one target CSG through the tunnel at the first moment.


 
7. The method according to claim 6, wherein the establishing, by the first device, a tunnel to the at least one target CSG based on the identifier of the at least one target CSG before the first moment comprises:
sending, by the first device to the at least one target CSG, a correspondence used for tunnel forwarding, wherein the correspondence used for tunnel forwarding comprises the identifier of the at least one target CSG and tunnel information, and the tunnel information is used to perform tunnel encapsulation.
 
8. The method according to any one of claims 1 to 4, wherein the first device is a controller, and the obtaining, by the first device before the first moment, an identifier of at least one target cell site gateway (CSG) based on the location range comprises:

determining, by the first device based on the location range, an identifier of a radio access device that covers the location range; and

obtaining, by the first device, the identifier of the at least one target CSG based on a mapping relationship and the identifier of the radio access device, wherein the mapping relationship comprises the identifier of the at least one target CSG and the identifier of the radio access device that communicates with the at least one target CSG.


 
9. The method according to claim 8, wherein the controller is a mobility management controller, and the method further comprises:
sending, by the first device, the identifier of the at least one target CSG to a fixed network controller.
 
10. The method according to claim 8, wherein the controller is a fixed network controller, and the method further comprises:
obtaining, by the first device, the mapping relationship from a mobility management controller.
 
11. The method according to any one of claims 8 to 10, wherein the method further comprises:
sending, by the first device, the identifier of the at least one target CSG to an MASG before the first moment.
 
12. The method according to claim 8 or 10, wherein the method further comprises:
sending, by the first device to the at least one target CSG, a correspondence used for tunnel forwarding, wherein the correspondence used for tunnel forwarding comprises the identifier of the at least one target CSG and tunnel information, and the tunnel information is used to perform tunnel encapsulation.
 
13. A cell site gateway (CSG) determining apparatus, comprising:

an obtaining unit, configured to obtain, before a first moment, a location range of a mobile device at the first moment; and

a processing unit, configured to obtain, before the first moment, an identifier of at least one target CSG based on the location range, wherein the at least one target CSG is capable of providing downlink data transmission for the mobile device at the first moment.


 
14. The apparatus according to claim 13, wherein the obtaining unit is specifically configured to:

determine a first location and a second moment of the mobile device, wherein the first location is a location of the mobile device at the second moment, and the second moment is earlier than the first moment; and

calculate the location range based on the first location, the second moment, a preset speed, and preset duration, wherein the preset speed is a moving speed of the mobile device within the preset duration, and the preset duration is duration between the second moment and the first moment.


 
15. The apparatus according to claim 13, wherein the obtaining unit is specifically configured to:

determine a first location, a second moment, and a speed of the mobile device, wherein the first location is a location of the mobile device at the second moment, the speed is a moving speed of the mobile device, and the second moment is earlier than the first moment; and

calculate the location range based on the first location, the second moment, the speed, and the preset duration, wherein the preset duration is duration between the second moment and the first moment.


 
16. The apparatus according to claim 13, wherein the obtaining unit is specifically configured to:

determine a first location, a second moment, a first speed, a first acceleration, a second location, a third moment, a second speed, and a second acceleration of the mobile device, wherein the first location is a location of the mobile device at the second moment, the first speed is a moving speed of the mobile device at the second moment, the first acceleration is a moving acceleration of the mobile device at the second moment, the second location is a location of the mobile device at the third moment, the second speed is a moving speed of the mobile device at the third moment, the second acceleration is a moving acceleration of the mobile device at the third moment, and both the second moment and the third moment are earlier than the first moment; and

calculate the location range by using a prediction algorithm based on the first location, the second moment, the first speed, the first acceleration, the second location, the third moment, the second speed, the second acceleration, and the preset duration, wherein the preset duration is duration between the second moment and the first moment or duration between the third moment and the first moment.


 
17. The apparatus according to any one of claims 13 to 16, wherein the apparatus is configured on a multi-service aggregation site gateway MASG or the apparatus is an MASG, and the processing unit is specifically configured to:

obtain a mapping relationship from a controller;

determine, based on the location range, an identifier of a radio access device that covers the location range; and

obtain the identifier of the at least one target CSG based on the mapping relationship and the identifier of the radio access device, wherein the mapping relationship comprises the identifier of the at least one target CSG and the identifier of the radio access device that communicates with the at least one target CSG.


 
18. The apparatus according to any one of claims 13 to 17, wherein the apparatus is configured on the MASG or the apparatus is the MASG, and the apparatus further comprises:

a tunnel establishment unit, configured to establish a tunnel to the at least one target CSG based on the identifier of the at least one target CSG before the first moment; and

a data sending unit, configured to send downlink data of the mobile device to the at least one target CSG through the tunnel at the first moment.


 
19. The apparatus according to claim 18, wherein the tunnel establishment unit is specifically configured to:

send, to the at least one target CSG, a correspondence used for tunnel forwarding, wherein the correspondence used for tunnel forwarding comprises the identifier of the at least one target CSG and tunnel information, and the tunnel information is used to perform tunnel encapsulation.


 
20. The apparatus according to any one of claims 13 to 16, wherein the apparatus is configured on a controller or the apparatus is a controller, and the processing unit is specifically configured to:

determine, based on the location range, an identifier of a radio access device that covers the location range; and

obtain the identifier of the at least one target CSG based on a mapping relationship and the identifier of the radio access device, wherein the mapping relationship comprises the identifier of the at least one target CSG and the identifier of the radio access device that communicates with the at least one target CSG.


 
21. The apparatus according to claim 20, wherein the controller is a mobility management controller, and the apparatus further comprises:
a first sending unit, configured to send the identifier of the at least one target CSG to a fixed network controller.
 
22. The apparatus according to claim 20, wherein the controller is a fixed network controller, and the obtaining unit is further configured to obtain the mapping relationship from a mobility management controller.
 
23. The apparatus according to any one of claims 20 to 22, wherein the apparatus further comprises:
a second sending unit, configured to send the identifier of the at least one target CSG to an MASG before the first moment.
 
24. The apparatus according to claim 20 or 22, wherein the apparatus further comprises:
a third sending unit, configured to send, to the at least one target CSG, a correspondence used for tunnel forwarding, wherein the correspondence used for tunnel forwarding comprises the identifier of the at least one target CSG and tunnel information, and the tunnel information is used to perform tunnel encapsulation.