Patent Description:
A virtual extensible virtual local area network (VXLAN) is a layer <NUM> virtual private network (VPN) technology based on an Internet Protocol (IP) network and uses an encapsulation form of "media access control (MAC) in user datagram protocol (UDP)". An Ethernet virtual private network (EVPN) is a layer <NUM> VPN technology in which a control plane uses a multiprotocol border gateway protocol (MP-BGP) to notify EVPN routing information, and a forwarding plane forwards a packet through VXLAN encapsulation.

In an EVPN VXLAN telecom cloud scenario, after receiving traffic of user equipment (UE), an operator edge router (PE) usually sends the traffic to different switches via a data center gateway (DCGW) in load balancing mode. After receiving the traffic, the switch sends the traffic to a virtualized network function (VNF) device. Therefore, to send the traffic to different switches in a load balancing mode, the VNF device is deployed across switches (top of rack, TOR) in different network segments. In other words, there are a plurality of routes for sending the traffic to the VNF device via the switch. <FIG> is a schematic diagram of an architecture in the prior art. As shown in <FIG>, a first network device may directly send traffic to a VNF device via directly connected next-hop interface processing units (IPU) IPU <NUM> and IPU <NUM>, or may send the traffic to the VNF device via an indirectly connected IPU <NUM>. The IPU <NUM> is directly connected to a second network device. Therefore, when using the route passing through the IPU <NUM>, the first network device first forwards the traffic to the second network device, and the second network device forwards the traffic to the VNF device, so that the VNF device can provide a service externally. Reference may be made to <FIG> for understanding.

However, when the traffic reaches the second network device, the second network device may not know that the traffic needs to be forwarded to the VNF device via the IPU <NUM>. Therefore, the second network device recalculates a route and considers that the traffic can be forwarded to the VNF device via the IPU <NUM> or the IPU <NUM>, and the traffic is forwarded to the first network device again in this case. The first network device then recalculates a route and considers that the traffic can be forwarded to the VNF device via the IPU <NUM>, and the traffic is forwarded to the second network device again in this case. Consequently, a three-layer traffic loop is caused.

Further, <CIT> refers to a method and a switch for forwarding a message. The method for forwarding the message comprises the steps that: a first node obtains the message; the first node determines a forwarding path of the message when the message needs to be forwarded through a prescribed path; the first node determines at least one output interface according to the forwarding path; and the first node forwards the message to a second node through one of the at least one output interface.

Embodiments of the present invention provide a packet processing method, a packet forwarding apparatus, and a packet processing apparatus, to precisely send a service packet to a VNF device corresponding to a destination IP address, thereby avoiding a three-layer traffic loop. This problem is solved by the subject matter of the independent claims. Further implementation forms are provided in the dependent claims.

In view of this, the embodiments of this application provide the following solutions.

According to a first aspect, an embodiment of this application provides a packet processing method. The processing method is applied to an Ethernet virtual private network EVPN, and the EVPN includes a first network device and a second network device. The processing method may include: receiving, by the first network device, a virtual extensible local area network VXLAN packet sent by the second network device, where the VXLAN packet may include a path identifier and a service packet, the path identifier indicates a path from the first network device to a virtualized network function VNF device through an interface processing unit IPU, the first network device is connected to the IPU, the service packet includes a destination Internet Protocol IP address, the destination IP address is an IP address of the VNF device, and the IPU is connected to the VNF device; determining, by the first network device based on the path identifier, first routing information included in equal-cost multipath ECMP routing information, where the first routing information indicates the path from the first network device to the VNF device through the IPU; and forwarding, by the first network device, the service packet to the VNF device via the IPU based on the first routing information and the destination IP address. Because the VXLAN packet carries the path identifier that may be used to indicate a forwarding path of the service packet, efficiency and precision of forwarding the service packet are effectively improved.

Optionally, with reference to the first aspect, in a first possible implementation, before the receiving, by the first network device, the virtual extensible local area network VXLAN packet sent by the second network device, the method may further include: obtaining, by the first network device, the first routing information; and storing, by the first network device, the first routing information in the ECMP routing information. Because the first routing information may be used to indicate the path from the first network device to the VNF device through the IPU, storing the first routing information in the ECMP routing information can provide a convenient path selection manner for subsequent forwarding of a packet such as a service packet.

Optionally, with reference to the first possible implementation of the first aspect, in a second possible implementation, after the obtaining, by the first network device, the first routing information, the method may further include: generating, by the first network device, EVPN routing information based on the first routing information, where the EVPN routing information may include the path identifier and the destination IP address; and sending, by the first network device, the EVPN routing information to the second network device.

The VXLAN packet further includes a flag bit, and the flag bit is used to indicate that the VXLAN packet includes the path identifier. If the flag bit is set to <NUM>, a label field may be filled into the VXLAN packet to store the path identifier, so that the path identifier can be relatively easily obtained, and a forwarding path of the service packet can be learned.

According to a second aspect, an embodiment of this application provides a packet processing method. The processing method is applied to an Ethernet virtual private network EVPN, and the EVPN includes a first network device and a second network device. The processing method includes: determining, by the second network device based on equal-cost multipath ECMP routing information, to send a service packet to a virtualized network function VNF device via an interface processing unit IPU, where the first network device is connected to the IPU, the IPU is connected to the VNF device, the service packet includes a destination Internet Protocol IP address, and the destination IP address is an IP address of the VNF device; generating, by the second network device, a virtual extensible local area network VXLAN packet, where the VXLAN packet includes a path identifier and the service packet, and the path identifier indicates a path from the first network device to the VNF device through the IPU; and sending, by the second network device, the VXLAN packet to the first network device, where the path identifier is used to trigger the first network device to forward the service packet based on the path indicated by the path identifier. Because the VXLAN packet carries the path identifier that may be used to indicate a forwarding path of the service packet, efficiency and precision of forwarding the service packet are effectively improved.

Optionally, with reference to the second aspect, in a first possible implementation, before the generating, by the second network device, a virtual extensible local area network VXLAN packet, the method may further include: receiving, by the second network device, EVPN routing information sent by the first network device, where the EVPN routing information may include the path identifier and the destination IP address.

Optionally, with reference to the first possible implementation of the second aspect, in a second possible implementation, after the receiving, by the second network device, the EVPN routing information sent by the first network device, the method may further include: storing, by the second network device, the EVPN routing information in the ECMP routing information. Storing the EVPN routing information in the ECMP routing information can provide a convenient path selection manner for subsequent forwarding of a packet such as a service packet.

The VXLAN packet further includes a flag bit, and the flag bit is used to indicate that the VXLAN packet may include the path identifier. If the flag bit is set to <NUM>, a label field may be filled into the VXLAN packet to store the path identifier, so that the path identifier can be relatively easily obtained, and a forwarding path of the service packet can be learned.

According to a third aspect, an embodiment of this application provides a first network device according to claim <NUM>.

Optionally, with reference to the first possible implementation of the third aspect, in a second possible implementation, the packet forwarding apparatus further includes: a generation module, configured to generate EVPN routing information based on the first routing information after the obtaining module obtains the first routing information, where the EVPN routing information may include the path identifier and the destination IP address; and
According to a fourth aspect, an embodiment of this application provides a second network device according to claim <NUM>.

It can be learned from the foregoing technical solutions that the embodiments of this application have the following advantages:.

By receiving the VXLAN packet that is sent by the second network device and that includes the path identifier and the service packet, the first network device can determine the first routing information based on the path identifier. In addition, the first routing information is used to indicate the path from the first network device to the VNF device through the IPU, and therefore, the first network device may send the service packet to the VNF device via the IPU based on the first routing information and the destination IP address. In this way, the service packet is precisely sent to the VNF device corresponding to the destination IP address, thereby avoiding a three-layer traffic loop.

The embodiments of this application provide a packet processing method, a packet forwarding apparatus, and a packet processing apparatus, to precisely send a service packet to a VNF device corresponding to a destination IP address, thereby avoiding a three-layer traffic loop.

It is clearly that the described embodiments are some but not all of the embodiments of this application.

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 this application described herein can be implemented in orders except the order illustrated or described herein. Moreover, the terms "include", "have", or any other variant thereof are intended to cover a non-exclusive inclusion.

For ease of understanding, this application proposes a packet processing method. The method is applied to a packet processing system shown in <FIG> is a schematic architectural diagram of a packet processing system according to an embodiment of this application. As shown in the figure, <FIG> includes a first network device, a second network device, and a VNF device. In addition, it can be learned from <FIG> that a plurality of interface processing units IPUs are connected between the first network device and the VNF device. Some IPUs are directly connected to the first network device, such as an IPU <NUM> and an IPU <NUM>. The remaining IPUs such as an IPU <NUM> and an IPU <NUM> may be connected to the first network device via another network device that has a neighbor relationship with the first network device, for example, the second network device.

In an EVPN VXLAN telecom cloud scenario, a service packet needs to be sent to the VNF device by using different nodes in a load balancing mode, for example, by using a node such as an IPU. In this case, if inter-network segment deployment is adopted for the VNF device (the inter-network segment means that the first network device is located in a server in an area A, the second network device is located in a server in an area B, and the servers in the area A and the area B do not intersect each other), a path identifier is generated in advance on the first network device to prevent a three-layer loop from occurring. For example, an identifier of a path reaching the VNF device via the IPU <NUM> is marked as "<NUM>", and an identifier of a path reaching the VNF device via the IPU <NUM> is marked as "<NUM>". Therefore, when sending a service packet to the first network device, the second network device sends the service packet in a manner in which the service packet is encapsulated into a VXLAN packet together with the path identifier. The mentioned path identifier is used to identify a path direction of the service packet after the service packet is sent to the first network device: sequentially passing through the first network device, the IPU, and the VNF device.

It should be noted that the VNF device mentioned above is a virtualized network function device, and mainly provides an external service channel for a service packet. The VNF device usually includes an interface processing unit IPU and a service processing unit (data plane unit, DPU). The IPU mentioned above mainly has a function of providing network switching for the VNF device. The mentioned service packet may be specifically VXLAN traffic, an Ethernet frame, or the like. This is not specifically limited herein.

It should be noted that devices such as the first network device and the second network device in <FIG> may be specifically switches. Regardless of whether these devices are switches or entities, they are merely names. These names are not limited in this embodiment of this application.

With reference to the description of the schematic architectural diagram of this application in <FIG>, a packet processing method provided in the embodiments of this application is described below. <FIG> is a schematic diagram of an embodiment of a packet processing method according to an embodiment of this application.

As shown in <FIG>, the embodiment of the packet processing method provided in this embodiment of this application includes the following steps.

A second network device determines, based on equal-cost multipath ECMP routing information, to send a service packet to a virtualized network function VNF device via an interface processing unit IPU.

In this embodiment, equal-cost multipath (ECMP) routing is an initial routing policy that is for calculating a routing weight and that is generated when a plurality of optimal paths are in parallel when the VXLAN packet is transferred to a single destination, so that a plurality of equal-cost paths may be simultaneously used when the VXLAN packet reaches network environments of a same destination address. Therefore, bandwidth can be increased to a large extent when the plurality of paths have traffic with a balanced load. Therefore, the second network device may determine, based on the ECMP routing information, a path that needs to forward the service packet to the VNF device via the IPU, that is, select and determine a forwarding path of the service packet from the plurality of equal-cost paths.

It should be noted that both the second network device and a first network device are deployed in an Ethernet virtual private network EVPN, the first network device is connected to the IPU, and the IPU is connected to the VNF device. The service packet includes a destination IP address, and the destination IP address is an IP address that may be used to identify the VNF device. It indicates that after determining the service packet, the second network device may clearly learn a destination to which the service packet needs to be sent, because the service packet includes the destination IP address.

The second network device generates a virtual extensible local area network VXLAN packet.

In this embodiment, the VXLAN packet includes a path identifier and the service packet, and the path identifier may be used to indicate a path from the first network device to the VNF device through the IPU. <FIG> is a schematic diagram of a packet header (VALAN header) of a VXLAN packet. As shown in <FIG>, a flag bit may be set in the packet header of the VXLAN packet to indicate that the VXLAN packet includes the path identifier. To be specific, the flag bit is first set in the packet header of the VXLAN packet, and is usually set at a location of a sixth bit of the packet header. If a value of the flag bit is <NUM>, it indicates that the VXLAN packet carries the path identifier mentioned above. On the contrary, if the value is <NUM>, it indicates that the VXLAN packet does not carry the path identifier. Therefore, after the flag bit is set to <NUM>, that is, when the value is <NUM>, a label field may be further filled into the packet header to store the path identifier. The label field is usually located in a multiprotocol label switching label (MPLS label) field in the packet header. For details, reference may be made to <FIG> for understanding.

The second network device sends the VXLAN packet to a first network device.

In this embodiment, after generating the corresponding VXLAN packet, the second network device may send the VXLAN packet to the first network device, so that the first network device may obtain the path identifier and the service packet that are included in the VXLAN packet.

It should be noted that because the service packet includes the destination IP address, after receiving the VXLAN packet, the first network device may learn, by querying a local routing table, a virtualized network function device corresponding to the destination IP address.

The first network device determines, based on a path identifier, first routing information included in the equal-cost multipath ECMP routing information.

In this embodiment, after receiving the VXLAN packet sent by the second network device, the first network device may determine, based on the path identifier in the VXLAN packet, the first routing information included in the equal-cost multipath ECMP routing information. A manner of determining the first routing information may be as follows: Because first network device first obtains the first routing information, and stores the first routing information in the ECMP routing information, after obtaining the path identifier, the first network device may match the path identifier with a path identifier in the ECMP routing information. For example, the obtained path identifier is "<NUM>", and path identifiers stored in the ECMP routing information include "<NUM>", "<NUM>", and the like. In this case, the first routing information corresponding to the path identifier "<NUM>" may be obtained through matching. In other words, the forwarding path of the service packet may be learned from the path identifier "<NUM>", that is, a path from the first network device to the VNF device corresponding to the destination IP address through an IPU corresponding to a next-hop address <NUM>.

Optionally, before receiving the VXLAN packet sent by the second network device, the first network device may further first obtain the first routing information, and store the first routing information in the ECMP routing information, that is, store the first routing information in the local routing table on a side of the first network device. It should be noted that before the first routing information is obtained, a plurality of static routes to the destination IP address further need to be configured on the first network device. When the plurality of static routes are configured, path identifiers corresponding to the static routes need to be separately set. In other words, when the static route is configured, the path identifier is configured to indicate an exact forwarding path. Configuration of the static route is as follows:.

Therefore, it can be clearly learned from the first piece of static routing information that, a path corresponding to the path identifier pathid=<NUM> is in a path direction that includes the IPU corresponding to the next-hop IP address <NUM>. <NUM> and a VNF device corresponding to a destination IP address <NUM>. A path corresponding to the path identifier pathid=<NUM> is in a path direction that includes an IPU corresponding to a next-hop IP address <NUM>. <NUM> and a VNF device corresponding to a destination IP address <NUM>.

Usually, the first network device can notify the second network device of only one piece of static routing information. However, to enable the second network device to learn that there are a plurality of static routes that can reach the VNF device corresponding to the destination IP address through the first network device, EVPN routing information needs to be generated by using the EVPN, so that the first network device can introduce a plurality of static routes with a "same prefix", and send the plurality of static routes to the second network device, to achieve load sharing. The "same prefix" mentioned above actually means that the plurality of static routes correspond to a same destination IP address.

It should be noted that the EVPN routing information is specifically a type <NUM> route, namely, an IP prefix route, and is mainly used to implement communication between a VXLAN and an external network. A packet format of the type <NUM> -- IP prefix route is as follows:.

It can be learned from above that a path identifier Pathid is filled on the basis of a traditional type <NUM> route, to indicate a corresponding forwarding path. For example, a value of Pathid is "<NUM>", and the corresponding forwarding path is IPU <NUM>-> VNF device.

It should be further noted that after the corresponding path identifiers are separately configured for the plurality of static routes, the first network device may further fill a first identifier field into the local routing table. The first identifier field is used to fill the path identifier. Reference may be made to the following table for understanding.

It can be learned from the table that routing information in the row in which the first identifier field is "<NUM>" indicates that the service packet may be sent in a forwarding path that uses the outbound interface vbdifl as an initial sending point, and passes through a node corresponding to the next-hop address <NUM>. <NUM> and the VNF device corresponding to the destination IP address. Likewise, it can be learned that routing information in the row in which the first identifier field is "<NUM>" indicates that the service packet may be sent in a forwarding path that uses the outbound interface vbdif1 as an initial sending point, and passes through a node corresponding to the next-hop address <NUM>. <NUM>, and the VNF device corresponding to the destination IP address.

For example, if an IP address of an IPU <NUM> is set to <NUM>. <NUM> in advance, a routing entry indicated by the path identifier "<NUM>" is: first network device -> IPU <NUM> -> VNF device. Likewise, if an IP address of an IPU <NUM> is set to <NUM>. <NUM> in advance, a routing entry indicated by the path identifier "<NUM>" is: first network device -> IPU <NUM> -> VNF device.

It should be noted that the mentioned outbound interface is an interface for sending the EVPN routing information, and the first network device considers that the VNF device corresponding to the destination IP address and the outbound interface are in a "directly connected network", that is, in a same network segment. Therefore, it is required to ensure that an interface of the second network device has an address resolution protocol (ARP) proxy capability; or transmission fails if the interface of the second network device does not have the address resolution protocol (ARP) proxy capability.

The first identifier field mentioned above may be an revpathid field or a field similar to a field used to fill the path identifier. This is not specifically limited herein.

The first network device forwards the service packet to the VNF device via the IPU based on the first routing information and a destination IP address.

In this embodiment, after obtaining the first routing information from the ECMP routing information through matching based on the path identifier, the first network device may precisely send the service packet to the VNF device via the IPU based on the first routing information and the destination IP address that are included in the service packet. For example, to be specific, the service packet may be forwarded along the following path: the first network device, the IPU corresponding to the next-hop address <NUM>. <NUM>, and the VNF device corresponding to the destination IP address.

In this embodiment, by receiving the VXLAN packet that is sent by the second network device and that includes the path identifier and the service packet, the first network device can determine the first routing information based on the path identifier. In addition, the first routing information is used to indicate the path from the first network device to the VNF device through the IPU, and therefore, the first network device may send the service packet to the VNF device via the IPU based on the first routing information and the destination IP address, so that the service packet is precisely sent to the VNF device corresponding to the destination IP address, thereby avoiding a three-layer traffic loop.

For ease of understanding, a specific procedure in the embodiments of this application is described below in detail. <FIG> is a schematic diagram of another embodiment of a packet processing method according to an embodiment of this application.

As shown in <FIG>, the another embodiment of the packet processing method provided in this embodiment of this application includes the following steps.

A first network device obtains first routing information.

In this embodiment, this step is similar to step <NUM>, and details are not described herein again.

The first network device generates EVPN routing information based on the first routing information.

In this embodiment, the first routing information may be obtained by configuring a static route, and the first network device can send only one static route to a second network device. Therefore, the first network device needs to generate the EVPN routing information by using an EVPN, so as to notify the second network device of a plurality of pieces of routing information with a same prefix.

It should be noted that, optionally, after obtaining the first routing information, the first network device may further store the first routing information in ECMP routing information, that is, deliver the first routing information to a local routing table on a side of the first network device, so that after subsequently receiving a VXLAN packet, the first network device can determine the exact first routing information based on a path identifier in the VXLAN packet, to find a correct forwarding path, thereby reducing a process of performing addressing through broadcast again.

The first network device sends the EVPN routing information to a second network device.

The second network device stores the EVPN routing information in ECMP routing information.

In this embodiment, after receiving the EVPN routing information sent by the first network device, the second network device may store the EVPN routing information in the ECPM routing information, that is, deliver the EVPN routing information to a local routing table on a side of the second network device.

It should be noted that a manner of storing the EVPN routing information may be as follows: The second network device may fill a second identifier field into the local routing table to fill the path identifier into the local routing table on the side of the second network device. In this way, when sending the VXLAN packet to the first network device, the second network device may query the local routing table to select the path identifier from the second identifier field for forwarding. Reference may be made to the following table for understanding.

It can be learned from the table that routing information in the row in which the second identifier field is "<NUM>" indicates that the service packet may be sent in a forwarding path that uses the outbound interface vbdifl as an initial sending point, and passes through a node corresponding to a next-hop address <NUM>. <NUM>, and a VNF device corresponding to a destination IP address. Likewise, it can be learned that routing information in the row in which the second identifier field is "<NUM>" indicates that the service packet may be sent in a forwarding path that uses the outbound interface vbdif1 as an initial sending point, and passes through a node corresponding to a next-hop address <NUM>. <NUM>, and the VNF device corresponding to the destination IP address.

With reference to the embodiment described in <FIG>, the following is clearly indicated on the side of the first network device: If an IP address of an IPU <NUM> is set to <NUM>. <NUM> in advance, a routing entry indicated by the path identifier "<NUM>" is: first network device -> IPU <NUM> -> VNF device. Likewise, if an IP address of an IPU <NUM> is set to <NUM>. <NUM> in advance, a routing entry indicated by the path identifier "<NUM>" is: first network device -> IPU <NUM> -> VNF device. Therefore, the second network device stores the EVPN routing information, to provide a convenient manner for subsequent forwarding of a service packet to a relatively great extent.

The second identifier field mentioned above may be a sendpathid field or a field similar to a field used to fill the path identifier. This is not specifically limited herein.

The second network device determines, based on the equal-cost multipath ECMP routing information, to send a service packet to a virtualized network function VNF device via an interface processing unit IPU.

In this embodiment, the VXLAN packet includes the path identifier and the service packet, and the path identifier may be used to indicate a path from the first network device to the VNF device through the IPU. As shown in <FIG>, a flag bit may be set in the packet header of the VXLAN packet to indicate that the VXLAN packet includes the path identifier. To be specific, the flag bit is first set in the packet header of the VXLAN packet, and is usually set at a location of a sixth bit of the packet header. If a value of the flag bit is <NUM>, it indicates that the VXLAN packet carries the path identifier mentioned above. On the contrary, if the value is <NUM>, it indicates that the VXLAN packet does not carry the path identifier. Therefore, after the flag bit is set to <NUM>, that is, when the value is <NUM>, a label field may be further filled into the packet header to store the path identifier. The label field is usually located in an MPLS label field in the packet header. For details, reference may be made to step <NUM> in <FIG> for understanding.

The second network device sends the VXLAN packet to the first network device.

It should be noted that because the service packet includes the destination IP address, after receiving the VXLAN packet, the first network device may learn, by querying the local routing table, a virtualized network function device corresponding to the destination IP address.

The first network device determines, based on a path identifier, the first routing information included in the equal-cost multipath ECMP routing information.

In this embodiment, after receiving the VXLAN packet sent by the second network device, the first network device may determine, based on the path identifier in the VXLAN packet, the first routing information included in the equal-cost multipath ECMP routing information.

A manner of determining the first routing information may be as follows: The first network device stores the first routing information in the ECMP routing information. Therefore, the first network device may obtain the path identifier after parsing the VXLAN packet, and may match the path identifier with a path identifier in the ECMP routing information. For example, the obtained path identifier is "<NUM>", and path identifiers stored in the ECMP routing information include "<NUM>", "<NUM>", and the like. In this case, the first routing information corresponding to the path identifier "<NUM>" may be obtained through matching. In other words, a forwarding path of the service packet may be learned from the path identifier "<NUM>", that is, a path from the first network device to the VNF device corresponding to the destination IP address through an IPU corresponding to a next-hop address <NUM>. <NUM>, that is, a path reaching the VNF device corresponding to the destination IP address through the IPU <NUM>.

It should be noted that the VXLAN packet further includes the flag bit that may be used to indicate that the VXLAN packet includes the path identifier. Therefore, after parsing the VXLAN packet, the first network device further needs to first determine whether the flag bit is set to <NUM>, that is, whether the flag bit is <NUM>, to determine whether the VXLAN packet carries the path identifier. Because the flag bit is set at the location of the sixth bit of the packet header, the first network device may directly determine, after parsing the VXLAN packet, whether a value of the sixth bit is <NUM>.

Because the second network device fills the path identifier into the label field of the packet header, after determining that the flag bit is set to <NUM>, the first network device may obtain the path identifier from the label field of the packet header. For example, if the second network device fills the path identifier "<NUM>" into the label field, the path identifier that can be obtained by the first network device is "<NUM>".

In this embodiment, after obtaining the first routing information from the ECMP routing information through matching based on the path identifier, the first network device may precisely send the service packet to the VNF device via the IPU based on the first routing information and the destination IP address that are included in the service packet. For example, to be specific, the service packet may be forwarded along the following path: the first network device, the IPU (that is, the IPU <NUM>) corresponding to the next-hop address <NUM>. <NUM>, and the VNF device corresponding to the destination IP address.

The first network device stores the first routing information in ECMP routing information.

In this embodiment, the first routing information is stored in the ECMP routing information, that is, the first routing information is delivered to a local routing table on a side of the first network device, so that after subsequently receiving a VXLAN packet, the first network device can determine the exact first routing information on a path identifier in the VXLAN packet, to find a correct forwarding path.

A second network device determines, based on the equal-cost multipath ECMP routing information, to send a service packet to a virtualized network function VNF device via an interface processing unit IPU.

In this embodiment, steps <NUM> to <NUM> are similar to steps <NUM> to <NUM>, and details are not described herein again.

A manner of determining the first routing information may be as follows: The first network device stores the first routing information in the ECMP routing information. Therefore, the first network device may obtain the path identifier after parsing the VXLAN packet, and may match the path identifier with a path identifier in the ECMP routing information. For example, the obtained path identifier is "<NUM>", and path identifiers stored in the ECMP routing information include "<NUM>", "<NUM>", and the like. In this case, the first routing information corresponding to the path identifier "<NUM>" may be obtained through matching. In other words, a forwarding path of the service packet may be learned from the path identifier "<NUM>", that is, a path from the first network device to the VNF device corresponding to the destination IP address through an IPU corresponding to a next-hop address <NUM>. <NUM>, that is, a path reaching the VNF device corresponding to the destination IP address through an IPU <NUM>.

The solutions provided in the embodiments of this application are mainly described above from a perspective of interaction. It may be understood that, to implement the foregoing functions, the packet forwarding apparatus and the packet processing apparatus include corresponding hardware structures and/or software modules for performing the functions. A person skilled in the art should be easily aware that, in combination with modules and algorithm steps of the examples described in the embodiments disclosed in this specification, this application may be implemented by hardware or a combination of hardware and computer software. Whether a function is performed by hardware or hardware driven by computer software depends on particular applications and design constraints of the technical solutions.

In the embodiments of this application, the packet forwarding apparatus and the packet processing apparatus may be divided into functional modules based on the foregoing method examples. For example, each functional module may be obtained through division based on each function, or two or more functions may be integrated into one processing module. The integrated module may be implemented in a form of hardware, or may be implemented in a form of a software functional module. It should be noted that, in the embodiments of this application, division into the modules is an example, and is merely logical function division. In actual implementation, another division manner may be used.

The packet forwarding apparatus in this application is described below in detail. <FIG> is a schematic diagram of an embodiment of a packet forwarding apparatus according to an embodiment of this application. The packet forwarding apparatus is applied to an Ethernet virtual private network EVPN, and the EVPN further includes a packet processing apparatus. The packet forwarding apparatus <NUM> includes:.

In this embodiment of this application, the path identifier may be used to indicate the path from the packet forwarding apparatus to the virtualized network function VNF device through the interface processing unit IPU, and therefore, the receiving module <NUM> receives the VXLAN packet that is sent by the packet processing apparatus and that includes the path identifier and the service packet, so that the determining module <NUM> can determine the first routing information based on the path identifier included in the VXLAN packet received by the receiving module <NUM>. The first routing information is used to indicate the path from the packet forwarding apparatus to the VNF device through the IPU, and therefore, the forwarding module <NUM> may send the service packet to the VNF device via the IPU based on the first routing information determined by the determining module <NUM> and the destination IP address included in the VXLAN packet received by the receiving module <NUM>. In this way, the service packet is precisely sent to the VNF device corresponding to the destination IP address, thereby avoiding a three-layer traffic loop.

Optionally, based on the embodiment corresponding to <FIG> is a schematic diagram of another embodiment of a packet forwarding apparatus according to an embodiment of this application. The packet forwarding apparatus <NUM> further includes:.

In this embodiment, the first routing information indicates the path from the packet forwarding apparatus to the VNF device through the IPU. Therefore, after the obtaining module <NUM> obtains the first routing information, the storage module <NUM> stores the first routing information in the ECMP routing information, so that a convenient path selection manner can be provided for subsequent forwarding of a packet such as a service packet.

Optionally, based on the embodiment corresponding to <FIG>, <FIG> is a schematic diagram of another embodiment of a packet forwarding apparatus according to an embodiment of this application. The packet forwarding apparatus <NUM> further includes:.

In this embodiment, to enable the packet processing apparatus to learn that there are a plurality of routes to reach the VNF device corresponding to the destination IP address, the generation module <NUM> generates the EVPN routing information based on the first routing information, and the sending module <NUM> sends the EVPN routing information to the packet processing apparatus. Therefore, the packet processing apparatus can store the EVPN routing information, so as to provide a convenient path selection manner for subsequent forwarding of a packet such as a service packet.

The packet processing apparatus in this application is described below in detail. <FIG> is a schematic diagram of an embodiment of a packet processing apparatus according to an embodiment of this application. The packet processing apparatus is applied to an Ethernet virtual private network EVPN, and the EVPN further includes a packet forwarding apparatus. The packet processing apparatus <NUM> includes:.

In this embodiment of this application, the generation unit <NUM> encapsulates the path identifier and the service packet determined by the determining unit <NUM> into the VXLAN packet, and the VXLAN packet carries the path identifier that may be used to indicate a forwarding path of the service packet. Therefore, the sending unit <NUM> sends the service packet to the packet forwarding apparatus, so that efficiency and precision of forwarding the service packet can be effectively improved.

Optionally, based on the embodiment corresponding to <FIG>, <FIG> is a schematic diagram of another embodiment of a packet processing apparatus according to an embodiment of this application. The packet processing apparatus <NUM> further includes:.

In this embodiment, the EVPN routing information may notify the packet processing apparatus that there are a plurality of routes to reach the VNF device corresponding to the destination IP address. Therefore, the storage unit <NUM> stores the EVPN routing information after the receiving unit <NUM> receives the EVPN routing information, so as to provide a convenient path selection manner for subsequent forwarding of a packet such as a service packet.

It should be noted that content such as information exchange between the modules/units of the apparatus and the execution processes thereof is based on the same idea as the method embodiments of this application, and produces the same technical effects as the method embodiments of this application. For the specific content, refer to the foregoing description in the method embodiments of this application, and the details are not described herein again.

The packet forwarding apparatus and the packet processing apparatus in the embodiments of this application are described above from a perspective of a modular functional entity, and the packet forwarding apparatus and the packet processing apparatus in the embodiments of this application are described below from a perspective of hardware processing. <FIG> is a schematic diagram of a hardware structure of a communications apparatus according to an embodiment of this application. As shown in <FIG>, the communications apparatus may include:.

The communications apparatus includes at least one processor <NUM>, a communications line <NUM>, a memory <NUM>, and at least one communications interface <NUM>.

The processor <NUM> may be a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (application-specific integrated circuit, ASIC), or one or more integrated circuits configured to control program execution of the solutions in this application.

The communications line <NUM> may include a channel for transmitting information between the foregoing components.

The communications interface <NUM> is any apparatus such as a transceiver, and is configured to communicate with another device or communications network such as an Ethernet.

The memory <NUM> may be a read-only memory (ROM) or another type of static storage apparatus that can store static information and an instruction, a random access memory (RAM) or another type of dynamic storage apparatus that can store information and an instruction. The memory may exist independently, and is connected to the processor by using the communications line <NUM>; or the memory may be integrated with the processor.

The memory <NUM> is configured to store computer executable instructions for executing the solutions in this application, and the processor <NUM> controls the execution. The processor <NUM> is configured to execute the computer executable instructions stored in the memory <NUM>, so as to implement the packet processing method provided in the foregoing embodiments of this application.

Optionally, the computer executable instructions in this embodiment of this application may also be referred to as application program code. This is not specifically limited in this embodiment of this application.

In specific implementation, in an embodiment, the communications apparatus may include a plurality of processors, for example, the processor <NUM> and a processor <NUM> in <FIG>. Each of the processors may be a single-core (single-CPU) processor, or may be a multi-core (multi-CPU) processor. The processor herein may be one or more apparatuses, circuits, and/or processing cores configured to process data (such as a computer program instruction).

In specific implementation, in an embodiment, the communications apparatus may further include an output apparatus <NUM> and an input apparatus <NUM>. The output apparatus <NUM> communicates with the processor <NUM>, and may display information in a plurality of manners. The input apparatus <NUM> communicates with the processor <NUM>, and may receive user input in a plurality of manners. For example, the input apparatus <NUM> may be a mouse, a touchscreen apparatus, a sensing apparatus, or the like.

The communications apparatus may be a general-purpose apparatus or a dedicated apparatus. In specific implementation, the communications apparatus may be a desktop computer, a portable computer, a network server, a wireless terminal apparatus, an embedded apparatus, or an apparatus having a structure similar to that shown in <FIG>. A type of the communications apparatus is not limited in this embodiment of this application.

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

It may be clearly understood by a person skilled in the art that, for the purpose of convenient and brief description, for a detailed working process of the packet forwarding apparatus and the packet processing apparatus, unit, and module described above, refer to a corresponding process in the foregoing method embodiments, and details are not described herein again.

In the several embodiments provided in this application, it should be understood that the disclosed device and method may be implemented in other manners. For example, the described packet forwarding apparatus and packet processing apparatus embodiments are merely examples. The indirect couplings or communication connections between the modules or units may be implemented in electronic, mechanical, or other forms.

Claim 1:
A packet processing method performed by a first network device in an Ethernet virtual private network, EVPN, the EVPN comprising the first network device and a second network device, and the method comprises the steps of:
• receiving (<NUM>) a virtual extensible local area network, VXLAN, packet from the second network device,
∘ wherein the VXLAN packet comprises a path identifier, a service packet, and a flag bit,
∘ wherein the path identifier indicates a path from the first network device to a virtualized network function, VNF, device through an interface processing unit, IPU, the first network device is connected to the IPU, the service packet comprises a destination Internet Protocol, IP, address, the destination IP address is an IP address of the VNF device, and the IPU is connected to the VNF device,
∘ wherein the flag bit is used to indicate that the VXLAN packet comprises the path identifier;
• determining based on the flag bit that the VXLAN packet comprises the path identifier;
• in response to the determination that the VXLAN packet comprises the path identifier, determining (step <NUM>), based on the path identifier and based on equal-cost multipath, ECMP, routing information, first routing information contained in the ECMP routing information, wherein the first routing information indicates the path from the first network device to the VNF device through the IPU; and
• forwarding (<NUM>) the service packet to the VNF device via the IPU based on the first routing information and the destination IP address.