A message processing method and related device

By adding identifiers to the forwarding table items of network devices, the problem of inaccurate forwarding of packets after the simulation algorithm simulates the network architecture changes is solved, and more accurate prediction of network changes impacts is achieved, reducing network accidents.

CN114205244BActive Publication Date: 2025-08-01HUAWEI TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202010903665.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-01
Publication Date
2025-08-01
Estimated Expiration
2040-09-01

AI Technical Summary

Technical Problem

The prior art simulates the message forwarding process after the network architecture is changed through simulation algorithms that cannot be consistent with the actual results, resulting in unpredictable network accidents after the network changes.

Method used

By adding an identifier to the forwarding entry of the network device, the message forwarding behavior after the network is simulated, so that the detection packet can match the forwarding entry of the network device updated, thereby obtaining more accurate message forwarding results.

Benefits of technology

Improve the prediction accuracy of network changes and reduce unpredictable network accidents after network changes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114205244B_ABST
    Figure CN114205244B_ABST
Patent Text Reader

Abstract

The present application discloses a message processing method for improving the accuracy of predicting the impact of network changes. A first network device obtains a first message, and the first message includes a simulation detection identifier; the first network device determines a first forwarding entry corresponding to the first message; when the first forwarding entry includes a first identifier, the first network device forwards the first message according to the first forwarding entry, and the first identifier indicates that the first forwarding entry is a forwarding entry to be created; when the first forwarding entry includes a second identifier, the first network device does not forward the first message according to the first forwarding entry, and the second identifier indicates that the first forwarding entry is a forwarding entry to be deleted.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technologies, and in particular, to a method for processing packets and related devices. Background Art

[0002] During network operation and maintenance, it is sometimes necessary to change the network architecture. For example, disconnect the connection of a certain physical link or device in the network to implement the maintenance of the physical link or device.

[0003] Currently, before changing the network architecture, a simulation algorithm is usually used to predict the impact on packet forwarding after the network architecture changes, so as to decide whether to perform the change operation.

[0004] However, by using a simulation algorithm to simulate the packet forwarding process after the network architecture changes, it cannot be completely consistent with the actual packet forwarding process. There may be a large deviation between the simulation result and the actual result, resulting in some unpredictable network accidents after the network architecture changes. Summary of the Invention

[0005] This application provides a method for processing packets and related devices. By adding an identifier to the forwarding table entries that will change after the network changes, the network device can determine the forwarding table entries that can be used for packet forwarding based on the identifier of the forwarding table entry during the process of forwarding the probe packet, so as to simulate the packet forwarding behavior after the network changes. Since during the simulation process, the forwarding table entries that the probe packet can match are the updated forwarding table entries of the network device after the network changes, obtaining the packet forwarding path based on the actual forwarding behavior of the devices in the existing network can obtain a more accurate packet forwarding result and improve the accuracy of predicting the impact of network changes.

[0006] The first aspect of this application provides a message processing method. A first network device obtains a first message, for example, obtains the first message from a controller or a neighbor network device, or the first network device generates the first message. The first message includes an emulation detection identifier, and the emulation detection identifier is used to indicate that the detection message is for emulation detection. "Emulation detection" in this application refers to simulating the message forwarding behavior after the change of the network system before the network system changes, so as to detect whether the network devices are reachable after the change of the network system. The first network device may determine a first forwarding entry corresponding to the first message according to the destination address of the first message. When the first forwarding entry includes a first identifier, the first network device forwards the first message according to the first forwarding entry, and the first identifier indicates that the first forwarding entry is a forwarding entry to be created; when the first forwarding entry includes a second identifier, the first network device does not forward the first message according to the first forwarding entry, and the second identifier indicates that the first forwarding entry is a forwarding entry to be deleted.

[0007] That is to say, when the first forwarding entry includes a first identifier, the first forwarding entry is a forwarding entry to be created, that is, the forwarding entry that will be created in the first network device after the network architecture changes. Therefore, in order to simulate the message forwarding behavior after the network architecture changes, when forwarding the first message, the first network device may forward the first message according to the first forwarding entry. When the first forwarding entry includes a second identifier, the first forwarding entry is a forwarding entry to be deleted, that is, the forwarding entry that will be deleted in the first network device after the network architecture changes. Therefore, when forwarding the first message, the first network device does not forward the first message according to the first forwarding entry.

[0008] In this application, by adding identifiers to the forwarding entries that will change after the network changes, the network device can determine the forwarding entries that can be used for message forwarding based on the identifiers of the forwarding entries during the process of forwarding the detection message, so as to simulate the message forwarding behavior after the network changes. Since during the simulation process, the forwarding entries that the detection message can match are the forwarding entries updated by the network device after the network changes, obtaining the message forwarding path based on the actual forwarding behavior of the devices in the existing network can obtain a more accurate message forwarding result and improve the accuracy of predicting the impact of network changes.

[0009] Optionally, the first network device further obtains a second packet, where the second packet is a service packet, that is, a packet that the network device needs to forward normally, such as a control packet or a data packet. The first network device determines a second forwarding entry corresponding to the second packet according to the destination address of the second packet; when the second forwarding entry includes the first identifier, the first network device does not forward the second packet according to the second forwarding entry; when the second forwarding entry includes the second identifier, the first network device forwards the second packet according to the second forwarding entry.

[0010] Briefly, since the forwarding entries with the second identifier (i.e., the forwarding entries to be deleted) and the forwarding entries without the first identifier and the second identifier (i.e., the forwarding entries that do not change after the network architecture change) are all forwarding entries that existed before the network architecture change. Therefore, the first network device can forward the second packet according to the forwarding entry with the second identifier or the forwarding entry without the first identifier and the second identifier. Since the forwarding entry with the first identifier is a forwarding entry created after the network architecture change, the first network device does not forward the second packet according to the forwarding entry with the first identifier. In this way, before the network change, it can be ensured that the network device can forward service packets normally.

[0011] Optionally, after forwarding the first packet according to the first forwarding entry, the first network device sends first information to the controller, where the first information is used to indicate that the first packet is successfully forwarded according to the first forwarding entry; or, the first network device sends second information to the controller, where the second information is used to indicate the forwarding result of the first packet. The first information may carry the out-interface information corresponding to the first forwarding entry, so that the controller can determine which network device the first packet is forwarded to according to the first information. The first information may further include the in-interface information corresponding to the first packet, that is, the information of the in-interface through which the first network device receives the first packet. That is to say, for each network device that receives the first packet, these network devices can send the in-interface information of the first packet they receive and the out-interface information of forwarding the first packet to the controller. In this way, on the controller, the in-interface and out-interface passed by the first packet can be obtained, so as to obtain the forwarding path of the first packet.

[0012] Optionally, when all the forwarding entries corresponding to the first packet include the second identifier, the first network device cannot forward the first packet according to the forwarding entries, and the forwarding result of the first packet is forwarding failure.

[0013] Optionally, the first network device further obtains a deletion instruction for instructing that the status of a first interface on the first network device is to be deleted; the first network device determines that the outgoing interface of the first forwarding entry is the first interface; the first network device adds the second identifier to the first forwarding entry. That is to say, when it is necessary to disconnect a certain link in the network architecture, a deletion instruction can be sent to the network devices at both ends of the link to configure the interfaces corresponding to the link to the to-be-deleted state. When an interface is configured to the to-be-deleted state, a second identifier can be added to the forwarding entry corresponding to the interface to indicate that the forwarding entry corresponding to the interface is a to-be-deleted forwarding entry.

[0014] Optionally, if all the forwarding entries in the first network device with the same destination address as the first forwarding entry have the second identifier, or there are no other forwarding entries in the first network device with the same destination address as the first forwarding entry, the first network device generates a first route according to the first forwarding entry, and the first route includes the second identifier; the first network device advertises the first route to a second network device. Briefly speaking, for the first network device, if all the forwarding entries under the same destination address have the second identifier, it can be considered that all the paths from the first network device to the destination address are in the to-be-deleted state, that is, the destination address is unreachable. Therefore, the first network device can generate a first route including the second identifier according to the first forwarding entry, and thus advertise the first route including the second identifier to the second network device. In this way, after receiving the first route including the second identifier, the second network device can generate a forwarding entry including the second identifier.

[0015] Optionally, the first network device further obtains a creation instruction for instructing that the status of a second interface on the first network device is to be created; the first network device advertises a second route to the second network device through the second interface, and the second route includes the first identifier. In this way, after receiving the second route, the second network device can generate a forwarding entry with the first identifier according to the second route, and the outgoing interface of the forwarding entry is the interface corresponding to the link between the second network device and the first network device.

[0016] Optionally, the first network device further receives a first route advertisement message, and the first route advertisement message includes the first identifier or the second identifier; the first network device generates the first forwarding entry according to the first route advertisement message.

[0017] Optionally, when the first forwarding entry has the first identifier, if all the forwarding entries in the first network device with the same destination address as the first forwarding entry have the first identifier, or there are no other forwarding entries in the first network device with the same destination address as the first forwarding entry, the first network device generates a second routing advertisement message according to the first forwarding entry, and the second routing advertisement message includes the first identifier; the first network device sends the second routing advertisement message to the second network device.

[0018] Optionally, the first forwarding entry includes one or more of a routing information base (RIB) entry, a forwarding information base (FIB) entry, an Address Resolution Protocol (ARP) entry, a media access control (MAC) entry, and a neighbor discovery (ND) entry.

[0019] A second aspect of this application provides a network device. The network device is a first network device and includes a functional module that executes the routing processing method provided in the first aspect or any possible design of the first aspect; this application does not limit the division of functional modules. The functional modules can be correspondingly divided according to the process steps of the routing processing method in the first aspect, or can be divided according to specific implementation requirements.

[0020] A third aspect of this application provides a network device, which includes: a processor and a memory; the memory is used to store instructions; the processor is used to execute the instructions in the memory, so that the network device executes the routing processing method provided in the foregoing first aspect or any possible design of the first aspect.

[0021] A fourth aspect of this application provides a computer storage medium, which can be non-volatile; the computer storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, the routing processing method provided in the foregoing first aspect or any possible design of the first aspect can be implemented.

[0022] A fifth aspect of this application provides a computer program product containing instructions, which when running on a computer, causes the computer to execute the routing processing method provided in the foregoing first aspect or any possible design of the first aspect.

[0023] From the above technical solutions, it can be seen that this application has the following advantages:

[0024] In this application, by adding an identifier to the forwarding table entries that will change after the network changes, the network device can, during the process of forwarding probe packets, determine the forwarding table entries that can be used for packet forwarding based on the identifiers of the forwarding table entries, thereby simulating the packet forwarding behavior after the network changes. Since, during the simulation process, the forwarding table entries that the probe packets can match are the updated forwarding table entries of the network device after the network changes, obtaining the packet forwarding path based on the actual forwarding behavior of the devices in the existing network can yield a more accurate packet forwarding result and improve the accuracy of predicting the impact of network changes. Description of the Drawings

[0025] Figure 1 It is a schematic diagram of a network architecture provided by an embodiment of this application;

[0026] Figure 2 It is a schematic flowchart of a packet processing method provided by an embodiment of this application;

[0027] Figure 3 It is a schematic diagram of a network architecture to be changed provided by an embodiment of this application;

[0028] Figure 4 It is a schematic diagram of a network device advertising a route provided by an embodiment of this application;

[0029] Figure 5 It is a schematic diagram of performing forwarding path detection provided by an embodiment of this application;

[0030] Figure 6 It is another schematic diagram of a network architecture to be changed provided by an embodiment of this application;

[0031] Figure 7 It is another schematic diagram of a network device advertising a route provided by an embodiment of this application;

[0032] Figure 8 It is another schematic diagram of performing forwarding path detection provided by an embodiment of this application;

[0033] Figure 9 It is a schematic diagram of a RIB with an identifier added provided by an embodiment of this application;

[0034] Figure 10 It is a schematic diagram of the structure of a network device 1000 provided by an embodiment of this application. Detailed Embodiments

[0035] In order to make the objectives, technical solutions and advantages of the present application more clearly understood, the embodiments of the present application will be described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. Those of ordinary skill in the art will understand that with the emergence of new application scenarios, the technical solutions provided by the embodiments of the present application are equally applicable to similar technical problems.

[0036] Terms such as "first" and "second" in the description and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily describe a specific order or sequence. It should be understood that such descriptions can be interchanged under appropriate circumstances so that the embodiments can be implemented in an order other than those shown or described in the present application. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or modules does not necessarily have to be limited to those steps or modules clearly listed, but may include other steps or modules not clearly listed or inherent to these processes, methods, products or devices. The naming or numbering of steps that appear in the present application does not mean that the steps in the method flow must be executed in the time / logical order indicated by the naming or numbering. The named or numbered process steps can be changed in the execution order according to the technical objectives to be achieved, as long as the same or similar technical effects can be achieved. The division of units in the present application is a logical division, and there may be other division methods in actual implementation. For example, multiple units can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed couplings or direct couplings or communication connections between each other can be through some interfaces. The indirect couplings or communication connections between units can be electrical or other similar forms, which are not limited in the present application. And the units or subunits described as separate components may or may not be physically separated, may or may not be physical units, or may be distributed to multiple circuit units. Some or all of the units can be selected according to actual needs to achieve the purpose of the present application solution.

[0037] During network operation and maintenance, it is sometimes necessary to change the network architecture, for example, disconnect the connection of a certain physical link or device in the network to achieve the maintenance of the physical link or device.

[0038] Currently, before changing the network architecture, the impact on packet forwarding after the network architecture change is usually predicted through a simulation algorithm to determine whether to perform the change operation. Specifically, before changing the network architecture, information such as the topology of the current network, the configuration of each network device in the network, and the forwarding table entries can be imported into the simulation system. When it is necessary to disconnect a network link or a network device in the live network, or change the connection of a network device, the above operations can be simulated in the simulation system. In this way, the simulation system can calculate the forwarding path of a specified packet through the simulation algorithm based on the changed network topology, the configuration of the network device, and the forwarding table entries.

[0039] However, the simulation algorithm cannot fully simulate the forwarding chip in the network device. In the scenario of multi-link load balancing, the simulation algorithm is likely to produce results inconsistent with the actual situation when calculating the forwarding path. That is to say, simulating the packet forwarding behavior after the network change through the simulation algorithm cannot be completely consistent with the actual forwarding behavior of the network device, and there may be a large deviation between the simulation result and the actual result, resulting in some unpredictable network accidents after the network change.

[0040] In view of this, the embodiments of the present application provide a packet processing method and related device. By adding identifiers to the forwarding table entries that will change after the network change, the network device can determine the forwarding table entries that can be used for packet forwarding based on the identifiers of the forwarding table entries during the process of forwarding the probe packet, so as to simulate the packet forwarding behavior after the network change. Since in the simulation process, the forwarding table entries that the probe packet can match are the updated forwarding table entries of the network device after the network change, obtaining the packet forwarding path based on the actual forwarding behavior of the devices in the live network can obtain a more accurate packet forwarding result and improve the accuracy of predicting the impact of network changes.

[0041] Reference can be made to Figure 1 , Figure 1 which is a schematic diagram of a network architecture provided by the embodiments of the present application. The packet processing method provided by the embodiments of the present application can be applied to the Figure 1 network architecture shown. As shown in Figure 1As shown in the figure, the controller is respectively connected to network devices 1 to 5, and is used to manage network devices 1 to 5. In the case where it is necessary to disconnect the link between network device 1 and network device 3, an identifier indicating to be deleted is added to the forwarding table entries that will change among network devices 1 to 5. The controller can send a probe message with the destination being network device 5 (for example, the IP address or MAC address of network device 5) to network device 1. This probe message includes an emulation probe identifier, so that network device 1 can forward the probe message according to the forwarding table entry. During the forwarding process of this probe message, after the network device receiving this probe message determines the corresponding forwarding table entry, it can decide whether to forward this probe message according to this forwarding table entry based on the identifier of this forwarding table entry, thereby simulating the forwarding behavior of network devices after the link is disconnected. Figure 1 This is just an example. In actual deployment, the controller can be independent of the network device or can be set inside a network device (for example, network device 1). This controller can also be called a network management device.

[0042] Reference can be made to Figure 2 , Figure 2 which is a schematic flowchart of a message processing method provided by an embodiment of this application. This method can be applied to Figure 1 the network structure shown in the figure.

[0043] In step 201, the first network device obtains a first message, and this first message includes an emulation probe identifier.

[0044] In this embodiment, before changing the network architecture, a first message including an emulation probe identifier can be sent in the existing network, so that network devices in the existing network can select corresponding forwarding table entries to forward the first message according to the emulation probe identifier in the first message. Among them, this emulation probe identifier is used to indicate that this probe message is used for emulation detection.

[0045] The first network device can obtain the first message in various ways.

[0046] The first network device can obtain this first message from the controller. For example, when it is necessary to determine the forwarding path from the first network device to the second network device, the controller can construct a first message with the first network device as the source network device and the second network device as the destination network device, and send this first message to the first network device. This first message includes an emulation probe identifier, and the destination address of this first message is the address of the second network device. After the first network device obtains this first message, it needs to forward this first message according to the destination address of this first message.

[0047] The first network device may also obtain the first packet from its neighboring network devices. For example, after the controller sends the first packet to other network devices, the other network devices may forward the first packet according to the destination address of the first packet. When the first network device is on the forwarding path of the first packet, the first network device may receive the first packet forwarded by its neighboring network devices.

[0048] The first network device may also generate the first packet based on a packet generation instruction. For example, the first network device may receive a packet generation instruction sent by the controller, or the first network device may obtain a packet generation instruction input by the user in a command line manner. The packet generation instruction is used to instruct the first network device to generate and forward the first packet. In this way, the first network device may generate the first packet including an emulation detection identifier according to the packet generation instruction, and forward the first packet to its neighboring network devices.

[0049] In a possible embodiment, the first packet may be a probe request packet for probing the forwarding path in the network. Exemplarily, the first packet may be an operation administration and maintenance (OAM) probe packet constructed by the controller. All network devices that receive the first packet need to send a response message to the controller to report the situation of forwarding the first packet. The first packet may also be a ping packet sent by the source network device to the destination network device; after receiving the ping packet, the destination network device sends a response packet to the source network device to indicate that it has successfully received the ping packet.

[0050] In step 202, the first network device determines a first forwarding entry corresponding to the first packet.

[0051] After obtaining the first packet, the first network device may determine the forwarding entry corresponding to the first packet according to the destination address of the first packet. The destination address may be a destination MAC address or a destination IP address.

[0052] It can be understood that one or more forwarding entries corresponding to the first packet may be included in the first network device. When the first network device includes one forwarding entry corresponding to the first packet, the first forwarding entry is the only forwarding entry corresponding to the first packet. When the first network device includes multiple forwarding entries corresponding to the first packet, the first forwarding entry may be one of the multiple forwarding entries.

[0053] There may also be no forwarding entry corresponding to the first packet in the first network device. When the first network device determines that there is no forwarding entry corresponding to the first packet, the first network device cannot forward the first packet according to the forwarding entry, and the first network device discards the first packet. The forwarding result of the first network device is forwarding failure.

[0054] In step 203, when the first forwarding entry includes a first identifier, the first network device forwards the first packet according to the first forwarding entry, and the first identifier indicates that the first forwarding entry is a forwarding entry to be created.

[0055] It can be understood that after the network architecture changes, the forwarding entries in some network devices may change. For example, after a new link is added to the network, forwarding entries with the new link as the outgoing interface will be newly added on the network devices at both ends of the new link. For another example, after a link is disconnected from the network, the forwarding entries with the disconnected link as the outgoing interface will be deleted on the network devices at both ends of the disconnected link.

[0056] Therefore, in this embodiment, by adding an identifier to the forwarding entry, it can be indicated that the forwarding entry with the identifier is a forwarding entry that will change after the network architecture changes. Exemplarily, by adding a first identifier to the forwarding entry, it can be indicated that the forwarding entry with the first identifier is a forwarding entry to be created. By adding a second identifier to the forwarding entry, it can be indicated that the forwarding entry with the second identifier is a forwarding entry to be deleted.

[0057] That is to say, when the first forwarding entry includes a first identifier, the first forwarding entry is a forwarding entry to be created, that is, the forwarding entry that will be created in the first network device after the network architecture changes. Therefore, in order to simulate the packet forwarding behavior after the network architecture changes, the first network device can forward the first packet according to the first forwarding entry.

[0058] In a possible embodiment, the first network device includes multiple forwarding entries corresponding to the first packet, and the first forwarding entry may be a forwarding entry selected by the first network device from multiple forwarding entries corresponding to the first packet according to the load balancing policy.

[0059] In step 204, when the first forwarding entry includes a second identifier, the first network device does not forward the first packet according to the first forwarding entry, and the second identifier indicates that the first forwarding entry is a forwarding entry to be deleted.

[0060] In this embodiment, when the first forwarding entry includes a second identifier, the first forwarding entry is a forwarding entry to be deleted, that is, the forwarding entry that will be deleted in the first network device after the network architecture changes. Therefore, when forwarding the first packet, the first network device does not forward the first packet according to the first forwarding entry.

[0061] In a possible embodiment, when the first forwarding table entry is the only forwarding table entry corresponding to the first packet, the first network device can no longer forward the first packet according to other forwarding table entries. Therefore, the forwarding result of the first packet is forwarding failure.

[0062] In another possible embodiment, when the first forwarding table entry is one of the multiple forwarding table entries corresponding to the first packet, the first network device can determine, among other forwarding table entries, the forwarding table entries that do not have the second identifier, and forward the first packet according to the determined forwarding table entries.

[0063] In step 205, when the first forwarding table entry does not include the first identifier and the second identifier, the first network device forwards the first packet according to the first forwarding table entry.

[0064] It can be understood that, in the case where the first forwarding table entry does not include the first identifier and the second identifier, the first forwarding table entry is the forwarding table entry that does not change in the first network device after the network architecture change. Therefore, the first network device can forward the first packet according to the first forwarding table entry.

[0065] That is to say, the first network device can forward the first packet according to the forwarding table entry with the first identifier or the forwarding table entry without the first identifier and the second identifier; the first network device does not forward the first packet according to the forwarding table entry with the second identifier.

[0066] For ease of understanding, the following will describe the process of the first network device forwarding the first packet in different cases with specific examples.

[0067] Case 1: Among the forwarding table entries corresponding to the first packet, there are forwarding table entries with the second identifier and forwarding table entries without the second identifier.

[0068] Among them, the forwarding table entries without the second identifier can refer to the forwarding table entries with the first identifier or the forwarding table entries without the first identifier and the second identifier. That is to say, in Case 1, there are multiple corresponding forwarding table entries for the first packet. In addition to the forwarding table entries with the second identifier, the multiple corresponding forwarding table entries also include the forwarding table entries with the first identifier and / or the forwarding table entries without the first identifier and the second identifier.

[0069] In Case 1, the first network device can determine one of the one or more forwarding table entries without the second identifier, for example, determine one of them according to the load balancing policy, and forward the first packet according to the determined forwarding table entry.

[0070] Exemplarily, the forwarding table entries corresponding to the first message may include forwarding table entry 1, forwarding table entry 2, and forwarding table entry 3. Among them, forwarding table entry 1 has a second identifier, forwarding table entry 2 has a first identifier, and forwarding table entry 3 does not have the first identifier and the second identifier. Therefore, the first network device may select one of forwarding table entry 2 and forwarding table entry 3 to forward the first message.

[0071] Case 2: The forwarding table entries corresponding to the first message do not include a forwarding table entry with a second identifier.

[0072] In Case 2, the first message may have one or more corresponding forwarding table entries, and the one or more corresponding forwarding table entries may include a forwarding table entry with a first identifier and / or a forwarding table entry without the first identifier and the second identifier. That is to say, any of the one or more forwarding table entries corresponding to the first message can be used to perform the forwarding of the first message.

[0073] Therefore, in this case, the first network device may directly determine one of the one or more forwarding table entries corresponding to the first message, and forward the first message according to the determined forwarding table entry. [[ID=eleven]]

[0074] Exemplarily, the forwarding table entries corresponding to the first message may include forwarding table entry 1 and forwarding table entry 2. Among them, forwarding table entry 1 has a first identifier, and forwarding table entry 2 does not have the first identifier and the second identifier. The first network device may select one of forwarding table entry 1 and forwarding table entry 2 to forward the first message.

[0075] Case 3: The forwarding table entries corresponding to the first message only include forwarding table entries with a second identifier.

[0076] In Case 3, the first message may have one or more corresponding forwarding table entries, and all of the one or more corresponding forwarding table entries are forwarding table entries with a second identifier. That is to say, any of the one or more forwarding table entries corresponding to the first message cannot be used to forward the first message.

[0077] In Case 3, the first network device cannot forward the first message according to the forwarding table entry, and the forwarding result of the first message is forwarding failure.

[0078] In a possible embodiment, when the controller issues the first message to the network devices in the network, in order for the controller to obtain the path for the network device to forward the first message, the network device that receives the first message may feedback the result of its forwarding of the first message to the controller.

[0079] In a possible example, after the first network device forwards the first message according to the first forwarding table entry, the first network device may send first information to the controller, and the first information is used to indicate that the first message has been successfully forwarded according to the first forwarding table entry. In this way, after receiving the first information sent by the first network device, the controller can learn from the first information that the first network device has forwarded the first message according to the first forwarding table entry. The first information may carry the outgoing interface information corresponding to the first forwarding table entry, so that the controller can determine which network device the first message has been forwarded to according to the first information.

[0080] The first information may further include the incoming interface information corresponding to the first message, that is, the information of the incoming interface through which the first network device receives the first message. That is to say, for each network device that receives the first message, these network devices can send the incoming interface information of the first message they receive and the outgoing interface information for forwarding the first message to the controller. In this way, each outgoing interface and incoming interface through which the first message passes can be obtained on the controller, so as to obtain the forwarding path of the first message.

[0081] In another possible example, the first network device may send second information to the controller, and the second information is used to indicate the forwarding result of the first message. The forwarding result of the first message may be, for example, successful forwarding or forwarding failure. That is to say, after the first network device successfully forwards the first message according to the foregoing first forwarding table entry or other forwarding table entries, the first network device may send second information to the controller to indicate that the first message has been successfully forwarded, and the second information may also carry the incoming interface information and the outgoing interface information corresponding to the first message. When the first network device cannot forward the first message according to the forwarding table entry, for example, there is no forwarding table entry corresponding to the first message in the first network device or all the forwarding table entries corresponding to the first message have a second identifier, the first network device may send second information to the controller to indicate that the first message has failed to be forwarded.

[0082] In this way, by having the network device that receives the first message feedback the forwarding result of the first message to the controller, the controller can learn about the forwarding situation of the first message, so as to determine whether the first message can still be successfully forwarded after the network architecture changes.

[0083] In another possible embodiment, it may also be that the destination network device of the first message feeds back a response message to the source network device of the first message to determine whether the first message can be successfully forwarded to the destination network device after the network architecture changes.

[0084] Exemplarily, the first message may be a ping message. The source network device of the first message sends the ping message to the destination network device, and requests the destination network device to return a response message of the ping message to determine whether the destination network device has successfully received the ping message. When the source network device receives the response message returned by the destination network device, the source network device may determine that the first message can be successfully forwarded to the destination network device, that is, the forwarding path between the source network device and the destination network device is not interrupted after the network architecture change. When the source network device does not receive the response message returned by the destination network device, the source network device may determine that the first message cannot be successfully forwarded to the destination network device, that is, the forwarding path between the source network device and the destination network device is interrupted after the network architecture change.

[0085] Therefore, for the first network device, when the first network device is the source network device of the first message, the first network device may generate and send the first message, and determine whether the forwarding path of the first message is interrupted according to whether the destination network device of the first message returns a response message. When the first network device is a network device in the forwarding path of the first message, the first network device may forward the first message and the response message of the first message. When the first network device is the destination network device of the first message, the first network device may send a response message to the source network device of the first message after receiving the first message.

[0086] The process of a network device forwarding a message including a simulation detection identifier is described in detail above. The process of a network device forwarding a service message that does not include a simulation detection identifier will be described in detail below.

[0087] It can be understood that before the network architecture change, during the process of a network device forwarding a message including a simulation detection identifier, network devices in the existing network usually also need to forward normal service messages (including control messages and data messages). The network device may forward the service message according to the forwarding entry before the network architecture change.

[0088] In a possible embodiment, the message processing method 200 may further include: The first network device obtains a second message, where the second message is a service message and does not include a simulation detection identifier. The first network device determines a second forwarding entry corresponding to the second message according to the destination address of the second message. The second forwarding entry and the foregoing first forwarding entry may be different forwarding entries. For example, when the destination addresses of the first message and the second message are different, the second forwarding entry and the foregoing first forwarding entry are different forwarding entries. The second forwarding entry and the foregoing first forwarding entry may also be the same forwarding entry. For example, when the destination addresses of the first message and the second message are the same, the second forwarding entry and the foregoing first forwarding entry may be the same forwarding entry.

[0089] When the second forwarding table entry includes the first identifier, the first network device does not forward the second packet according to the second forwarding table entry. When the second forwarding table entry includes the second identifier, the first network device forwards the second packet according to the second forwarding table entry. When the second forwarding table entry does not include the first identifier and the second identifier, the first network device may forward the second packet according to the second forwarding table entry.

[0090] Briefly, since the forwarding table entries with the second identifier (i.e., the forwarding table entries to be deleted) and the forwarding table entries without the first identifier and the second identifier (i.e., the forwarding table entries that do not change after the network architecture change) are both the forwarding table entries that existed before the network architecture change. Therefore, the first network device can forward the second packet according to the forwarding table entry with the second identifier or the forwarding table entry without the first identifier and the second identifier. However, since the forwarding table entry with the first identifier is the forwarding table entry created after the network architecture change, the first network device does not forward the second packet according to the forwarding table entry with the first identifier.

[0091] The above describes the process of a network device forwarding packets based on the identifiers in the forwarding table entry. The following will detail the process of a network device generating a forwarding table entry including identifiers.

[0092] In a possible embodiment, the first network device can configure the state of an interface through an acquisition instruction, and add an identifier to the corresponding forwarding table entry according to the state of the interface.

[0093] Exemplarily, the first network device can obtain a deletion instruction, which is used to indicate that the state of the first interface on the first network device is to be deleted. The deletion instruction can be, for example, sent by a controller to the first network device, or the deletion instruction can also be input by a user to the first network device through the command line. This embodiment does not specifically limit the source of the deletion instruction.

[0094] After the first network device configures the first interface to the to-be-deleted state according to the indication of the deletion instruction, the first network device determines the forwarding table entry whose outgoing interface is the first interface, and adds the second identifier to the determined forwarding table entry. For example, after the first network device determines that the outgoing interface of the first forwarding table entry is the first interface, the first network device can add the second identifier to the first forwarding table entry.

[0095] That is to say, when it is necessary to disconnect a certain link in the network architecture, a deletion instruction can be sent to the network devices at both ends of the link to configure the interface corresponding to the link to the to-be-deleted state. In the case where the interface is configured to the to-be-deleted state, the second identifier can be added to the forwarding table entry corresponding to the interface to indicate that the forwarding table entry corresponding to the interface is the forwarding table entry to be deleted.

[0096] In a possible embodiment, after the first network device configures the status of the first interface to be to-be-deleted according to the deletion instruction, the first network device may also announce a route including a second identifier to other network devices.

[0097] Exemplarily, after the first network device adds a second identifier to the first forwarding entry, if all the forwarding entries in the first network device with the same destination address as the first forwarding entry have the second identifier, or there are no other forwarding entries in the first network device with the same destination address as the first forwarding entry, the first network device generates a first route according to the first forwarding entry, and the first route includes the second identifier; the first network device announces the first route to a second network device, and the second network device is a neighbor network device of the first network device.

[0098] In short, for the first network device, if all the forwarding entries under the same destination address have the second identifier, it can be considered that the paths from the first network device to the destination address are all in the to-be-deleted state, that is, the destination address is unreachable. Therefore, the first network device can generate a first route including the second identifier according to the first forwarding entry, so as to announce the first route including the second identifier to the second network device. In this way, after receiving the first route including the second identifier, the second network device can generate a forwarding entry including the second identifier.

[0099] In the first network device, if not all the forwarding entries under the same destination address have the second identifier, for example, one or more forwarding entries do not have the second identifier, the first network device may announce a route that does not include the second identifier to the second network device.

[0100] In addition, since the first interface is configured to be in the to-be-deleted state, when the first network device announces a route to other network devices through the first interface, the first network device may carry the second identifier on the route. In this way, after receiving the route including the second identifier, other network devices can generate a forwarding entry including the second identifier according to the second identifier on the route.

[0101] In one implementation manner, a field may be added to the forwarding entry, the first value of the field is used as the first identifier, the second value of the field is used as the second identifier, and when the field is empty, it indicates that the forwarding entry does not include the first identifier and the second identifier. In another implementation manner, a first field indicating the first identifier may be added to the forwarding entry, or a second field indicating the second identifier may be added to the forwarding entry. When the first field and the second field are not added to the forwarding entry, it indicates that the forwarding entry does not include the first identifier and the second identifier.

[0102] For ease of understanding, reference may be made to Figures 3 to 5 , Figure 3Schematic diagram of a network architecture to be changed provided by an embodiment of the present application; Figure 4 Schematic diagram of a network device advertising a route provided by an embodiment of the present application; Figure 5 Schematic diagram of performing a forwarding path detection provided by an embodiment of the present application. It should be noted that Figures 3 to 5 The corresponding network architectures are all Figure 1 The network architectures shown. For the convenience of description, Figures 3 to 5 Some devices are not drawn in all of them.

[0103] As Figure 3 shown, link 1 between network device 1 and network device 3 is a link to be deleted. The controller can send deletion instructions to network device 1 and network device 3 respectively to indicate that the interfaces on network device 1 and the interfaces on network device 3 are in a state to be deleted.

[0104] As Figure 4 shown, it is the operation performed by network device 1 after receiving the deletion instruction sent by the controller.

[0105] In step 401, network device 1 marks forwarding table entry 1.

[0106] Specifically, after network device 1 determines that the outgoing interface of forwarding table entry 1 is the interface corresponding to link 1, network device 1 can add a second identifier to forwarding table entry 1 to mark forwarding table entry 1 as a forwarding table entry to be deleted.

[0107] In step 402, network device 1 sends route 1 to network device 3 through the interface corresponding to link 1.

[0108] In this embodiment, after network device 1 marks forwarding table entry 1, since forwarding table entry 1 is updated, network device 1 can generate route 1 based on the forwarding table entry and send route 1 to network device 3 through the interface corresponding to link 1, and this route 1 includes the second identifier.

[0109] In addition, in the case where network device 1 needs to publish other routes to network device 3, network device 1 can also carry the second identifier in other routes published to network device 3.

[0110] In step 403, network device 1 sends route 2 to network device 4 and network device 5.

[0111] After network device 1 adds the second identifier to forwarding table entry 1, network device 1 can determine other forwarding table entries with the same destination address as forwarding table entry 1.

[0112] When the destination address of forwarding entry 1 is network device 3 and there is no other forwarding entry on network device 1 with the same destination address as forwarding entry 1, network device 1 generates route 2 according to forwarding entry 1, and this route 2 includes a second identifier. Then, network device 1 sends route 2 including this second identifier to network device 2 and network device 5.

[0113] When the destination address of forwarding entry 1 is network device 3 and there are other forwarding entries on network device 1 with the same destination address as forwarding entry 1 and without the second identifier, network device 1 can generate route 2 according to forwarding entry 1, and this route 2 does not carry the second identifier. Then, network device 1 sends route 2 without the second identifier to network device 4 and network device 5.

[0114] The following combines Figure 5 , and illustrates the process diagram of detecting the forwarding path after the network structure changes. As Figure 5 shown, the process for the controller to obtain the forwarding path between network device 5 and network device 3 includes the following steps:

[0115] In step 501, the controller sends probe message 1 to network device 5.

[0116] Among them, this probe message 1 can be an OAM message including an emulation detection identifier. The source Internet Protocol (IP) address of this probe message 1 is the IP address of network device 5, and the destination IP address of this probe message 1 is the IP address of network device 3.

[0117] In step 502, network device 5 sends this probe message 1 to network device 2.

[0118] After network device 5 receives the probe message 1 sent by the controller, network device 5 needs to forward the probe message 1 according to the destination address of the probe message 1. Network device 5 can determine two forwarding entries corresponding to the probe message 1 according to the destination address of the probe message 1, and the outgoing interfaces of these two forwarding entries are the interfaces on network device 1 and the interfaces on network device 2 respectively.

[0119] Based on Figure 4 , when network device 5 receives route 2 including the second identifier sent by network device 1, network device 5 can generate a forwarding entry with the outgoing interface being the interface on network device 1, the destination address of this forwarding entry being network device 3, and this forwarding entry including the second identifier.

[0120] After the network device 5 determines the above two forwarding entries according to the destination address of the probe packet 1, since the forwarding entry with the outgoing interface being the interface on the network device 1 includes the second identifier, the network device does not forward the probe packet 1 according to the forwarding entry with the outgoing interface being the interface on the network device 1, but forwards the probe packet 1 according to the forwarding entry with the outgoing interface being the interface on the network device 2, that is, the network device 5 sends the probe packet 1 to the network device 2.

[0121] In step 503, the network device 5 sends message 1 to the controller.

[0122] After the network device 5 successfully forwards the probe packet 1 to the network device 2, the network device 5 can send message 1 to the controller to feedback its successful forwarding of the probe packet 1. Among them, the message 1 can include the information of the incoming interface where the network device 5 receives the probe packet 1 and the information of the outgoing interface where the network device 5 forwards the probe packet 1.

[0123] In step 504, the network device 2 forwards the probe packet 1 to the network device 3.

[0124] After the network device 2 receives the probe packet 1 sent by the network device 5, the network device 2 can forward the probe packet 1 to the network device 3 according to the destination address of the probe packet 1.

[0125] In step 505, the network device 2 sends message 2 to the controller.

[0126] When the network device 2 recognizes that the probe packet 1 is a probe packet sent by the controller, after successfully forwarding the probe packet 1, the network device 2 can send message 2 to the controller to feedback its successful forwarding of the probe packet 1. Among them, the message 2 can include the information of the incoming interface where the network device 2 receives the probe packet 1 and the information of the outgoing interface where the network device 2 forwards the probe packet 1.

[0127] In step 506, the network device 3 sends message 3 to the controller.

[0128] After receiving the probe packet 1, the network device 3 can recognize that the probe packet 1 has reached the destination address according to the destination address of the probe packet 1. Therefore, the network device 3 can send message 3 to the controller to feedback its successful reception of the probe packet 1.

[0129] In step 507, the controller generates a forwarding path.

[0130] After the controller receives Message 3 sent by Network Device 3, the controller can determine the forwarding path of Probe Packet 1 based on the received Message 1, Message 2, and Message 3. The forwarding path can be, for example: from the outgoing interface A of Network Device 5 to the incoming interface B1 of Network Device 2, and then from the outgoing interface B2 of Network Device 2 to the incoming interface C of Network Device 3.

[0131] That is to say, after configuring the interface corresponding to the link between Network Device 1 and Network Device 3 to the to-be-deleted state, the controller can learn that the forwarding path from Network Device 5 to Network Device 3 is not interrupted, and the forwarding path between Network Device 5 and Network Device 3 is Network Device 5--Network Device 2--Network Device 3.

[0132] The process of a network device generating a forwarding entry including a second identifier is described above. The process of a network device generating a forwarding entry including a first identifier will be described in detail below.

[0133] In a possible embodiment, the first network device can obtain a creation instruction, which is used to indicate that the state of the second interface on the first network device is to be created. The creation instruction can be, for example, sent by the controller to the first network device, or the creation instruction can also be input by the user to the first network device through the command line. This embodiment does not specifically limit the source of the creation instruction.

[0134] After the first network device configures the first interface to the to-be-created state according to the indication of the creation instruction, the first network device can advertise a second route including the first identifier to the second network device through the second interface. In this way, after receiving the second route, the second network device can generate a forwarding entry with the first identifier, and the outgoing interface of this forwarding entry is the interface corresponding to the link between the second network device and the first network device.

[0135] In a possible embodiment, the first network device can also receive a first route advertisement message, which includes a first identifier or a second identifier; the first network device generates a first forwarding entry according to the first route advertisement message. That is to say, when the link between the first network device and other network devices is configured to be to-be-deleted or to-be-created, other network devices can send a first route advertisement message to the first network device so that the first network device can generate a first forwarding entry with the corresponding identifier.

[0136] In a possible embodiment, when a first forwarding table entry in a first network device has a first identifier, if all the forwarding table entries in the first network device with the same destination address as the first forwarding table entry have the first identifier, or there are no other forwarding table entries in the first network device with the same destination address as the first forwarding table entry, the first network device generates a second routing advertisement message according to the first forwarding table entry, and the second routing advertisement message includes the first identifier; the first network device sends the second routing advertisement message to a second network device.

[0137] That is to say, for the first network device, if all the forwarding table entries under the same destination address have the first identifier, it can be considered that the paths from the first network device to the destination address are all in a state to be created. Therefore, the first network device can generate a second routing advertisement message including the first identifier according to the first forwarding table entry, and thus send the second routing advertisement message including the first identifier to its second network device. In this way, after receiving the first routing including the first identifier, the second network device can generate a forwarding table entry including the first identifier.

[0138] In the first network device, if not all the forwarding table entries under the same destination address have the first identifier, for example, one or more forwarding table entries do not have the first identifier, the first network device can send a route that does not include the first identifier to the second network device.

[0139] For easy understanding, reference can be made to Figures 6 to 8 , Figure 6 which is a schematic diagram of another network architecture to be changed provided by the embodiment of the present application; Figure 7 which is a schematic diagram of another network device advertising routes provided by the embodiment of the present application; Figure 8 which is a schematic diagram of another forwarding path detection provided by the embodiment of the present application. It should be noted that Figures 6 to 8 the corresponding network architectures are all Figure 1 the network architectures shown. For the convenience of description, Figures 6 to 8 some devices are not drawn in all of them.

[0140] As Figure 6 shown, the link 2 (dotted line) between network device 1 and network device 3 is a link to be created. The controller can send creation instructions to network device 1 and network device 3 respectively to indicate that the interfaces on network device 1 and the interfaces on network device 3 are in a state to be created.

[0141] As Figure 7 shown, after receiving the creation instruction sent by the controller, network device 1 executes the following steps.

[0142] In step 701, network device 1 receives route 3 sent by network device 3.

[0143] It is understandable that after the network device 3 receives the creation instruction sent by the controller, the network device 3 can send route 3 to the network device 1 through the link 1 between the network device 1 and the network device 3, and the route 3 includes a first identifier. Similarly, the network device 1 can also send a route including the first identifier to the network device 3.

[0144] In step 702, the network device 1 generates a forwarding table entry 2 according to route 3.

[0145] Among them, the forwarding table entry 2 generated by the network device 1 has a first identifier, and the outgoing interface of the forwarding table entry 2 is the interface on the link between the network device 1 and the network device 3.

[0146] In step 703, the network device 1 sends route 4 to the network device 4 and the network device 5.

[0147] After the network device 1 generates the forwarding table entry 2 according to route 3, the network device 1 can send route 4 to the network device 4 and the network device 5 based on the routing dynamic protocol to publish the routes it has learned.

[0148] When the destination address of the forwarding table entry 2 is the network device 3 and the network device 1 does not have other forwarding table entries with the same destination address as the forwarding table entry 2, the network device 1 generates route 4 according to the forwarding table entry 2, and the route 4 includes a first identifier. Then, the network device 1 sends route 4 including the first identifier to the network device 4 and the network device 5.

[0149] When the destination address of the forwarding table entry 2 is the network device 3 and the network device 1 also has other forwarding table entries with the same destination address as the forwarding table entry 2 and without the first identifier, the network device 1 can generate route 4 according to the forwarding table entry 2, and the route 4 does not include a first identifier. Then, the network device 1 sends route 4 not including the first identifier to the network device 4 and the network device 5.

[0150] As Figure 8 shown, the process for the controller to obtain the forwarding path between the network device 3 and the network device 5 includes the following steps:

[0151] In step 801, the controller sends a probe message 2 to the network device 3.

[0152] Among them, the probe message 1 can be an OAM message including an emulation probe identifier. The source Internet Protocol (IP) address of the probe message 2 is the IP address of the network device 3, and the destination IP address of the probe message 2 is the IP address of the network device 5.

[0153] In step 802, the network device 3 sends the probe message 2 to the network device 1.

[0154] After the network device 3 receives the detection message 2 sent by the controller, the network device 3 needs to forward the detection message 2 according to the destination address of the detection message 2. The network device 3 can determine two forwarding table entries corresponding to the detection message 2 according to the destination address of the detection message 2, and the outgoing interfaces of the two forwarding table entries are the interface on the network device 1 and the interface on the network device 2 respectively.

[0155] After the network device 3 determines the above two forwarding table entries according to the destination address of the detection message 2, the network device 3 can select one of the forwarding table entries according to the load balancing policy to forward the detection message 2. For example, when the network device 3 selects the forwarding table entry with the outgoing interface being the interface on the network device 1, the network device 3 sends the detection message 2 to the network device 1.

[0156] In step 803, the network device 3 sends a message 4 to the controller.

[0157] After the network device 3 successfully forwards the detection message 2 to the network device 1, the network device 3 can send a message 4 to the controller to feedback that it has successfully forwarded the detection message 2. Among them, the message 4 can include the information of the incoming interface where the network device 3 receives the detection message 2 and the information of the outgoing interface where the network device 3 forwards the detection message 2.

[0158] In step 804, the network device 1 forwards the detection message 2 to the network device 5.

[0159] After the network device 1 receives the detection message 2 sent by the network device 3, the network device 1 can forward the detection message 2 to the network device 5 according to the destination address of the detection message 2.

[0160] In step 805, the network device 1 sends a message 5 to the controller.

[0161] In the case that the network device 1 recognizes that the detection message 2 is the detection message sent by the controller, after the network device 1 successfully forwards the detection message 2, it can send a message 5 to the controller to feedback that it has successfully forwarded the detection message 2. Among them, the message 5 can include the information of the incoming interface where the network device 1 receives the detection message 2 and the information of the outgoing interface where the network device 1 forwards the detection message 2.

[0162] In step 806, the network device 5 sends a message 6 to the controller.

[0163] After the network device 5 receives the detection message 2, the network device 5 can recognize that the detection message 2 has reached the destination address according to the destination address of the detection message 2. Therefore, the network device 5 can send a message 6 to the controller to feedback that it has successfully received the detection message 2.

[0164] In step 807, the controller generates a forwarding path.

[0165] After the controller receives message 6 sent by network device 5, the controller can determine the forwarding path of the probe packet 2 based on the received message 4, message 5, and message 6. The forwarding path can be, for example: from the outgoing interface D of network device 3 to the incoming interface E1 of network device 1, and then from the outgoing interface E2 of network device 1 to the incoming interface F of network device 5.

[0166] That is to say, after configuring the interface corresponding to the link between network device 1 and network device 3 to be in a to-be-created state, the controller can learn that in addition to the forwarding path "network device 3 - network device 2 - network device 5", the forwarding path from network device 3 to network device 5 also newly adds the forwarding path "network device 3 - network device 1 - network device 5".

[0167] It can be understood that the forwarding table entries described in this embodiment, such as the foregoing first forwarding table entry or second forwarding table entry, may include, but are not limited to, one or more of a routing information base (RIB) table entry, a forwarding information base (FIB) table entry, an Address Resolution Protocol (ARP) table entry, a media access control (MAC) table entry, and a neighbor discovery (ND) table entry.

[0168] Exemplarily, reference can be made to Figure 9 , Figure 9 which is a schematic diagram of a RIB with an added identifier provided by an embodiment of the present application. As Figure 9 shown, the RIB includes multiple table entries. In each RIB table entry, in addition to information such as the destination address and the next hop, an identifier for indicating the state of the RIB table entry is newly added. The state can be to-be-created, to-be-deleted, or existing. Among them, in the RIB, an "identifier" field is added. When the value of this field is 0, it indicates that the state of the RIB table entry is to-be-created; when the value of this field is 1, it indicates that the state of the RIB table entry is to-be-deleted; when this field is empty, it indicates that the RIB table entry is an existing table entry.

[0169] To implement the above embodiments, the present application further provides a network device 1000. Reference can be made to Figure 10 , Figure 10 which is a schematic structural diagram of a network device 1000 provided by an embodiment of the present application.

[0170] Figure 10 Although the network device 1000 shown exhibits certain specific features, for the sake of brevity, Figure 10 various other features are not shown so as not to obscure more relevant aspects of the embodiments disclosed in the embodiments of this application. For this purpose, as a restrictive example, in some implementations, the network device 1000 includes an acquisition unit 10042, a transceiver unit 10043, and a processing unit 10044. These units can be implemented in software form or in hardware form. In some implementations, if the acquisition unit 10042, the transceiver unit 10043, and the processing unit 10044 are implemented in software, the network device 1000 further includes one or more processors (e.g., a central processing unit CPU) 1001, a network interface 1002, a programming interface 1003, a memory 1004, and a communication bus 1005. The communication bus 1005 is used to interconnect various components.

[0171] In some implementations, the network interface 1002 is used, among other things, to connect to one or more other network devices in a network system. In some implementations, the communication bus 1005 includes circuitry for interconnecting and controlling communication between system components. The memory 1004 may include non-volatile memory, for example, read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The memory 1004 may also include volatile memory, and the volatile memory may be random access memory (RAM), which is used as an external cache.

[0172] In some implementations, the memory 1004 or the non-transitory computer-readable storage medium of the memory 1004 stores the following programs, modules, and data structures, or subsets thereof, specifically including an operating system 10041, an acquisition unit 10042, a transceiver unit 10043, and a processing unit 10044.

[0173] The operating system 10041 is used to process various basic system services and processes for performing tasks related to hardware.

[0174] In various implementation manners, the obtaining unit 10042 is configured to obtain a message, for example, obtain a first message (perform step 201) or a second message. In various implementation manners, the transceiver unit 10043 is configured to receive or send information and perform routing, for example, forward the above-mentioned first message (perform steps 203-205). In various implementation manners, the processing unit 10044 is configured to perform processing operations related to forwarding entry items, for example, determine a forwarding entry item corresponding to the first message or the second message (perform step 202). In various implementations, the network device 1000 is configured to execute various methods provided in the embodiments of the present application, for example, execute the Figure 2 message processing method 200 shown above.

[0175] The embodiments of the present application have been described in detail above. The steps in the methods of the embodiments of the present application can be scheduled, combined, or deleted according to actual needs; the modules in the devices of the embodiments of the present application can be divided, combined, or deleted according to actual needs.

[0176] It should be understood that throughout the specification, the phrase "one embodiment" or "an embodiment" means that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of the present application. Therefore, the appearances of the phrase "in one embodiment" or "in an embodiment" throughout the specification do not necessarily refer to the same embodiment. In addition, these specific features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. It should be understood that in various embodiments of the present application, the magnitudes of the sequence numbers of the above processes do not mean the order of execution, and the execution order of each process should be determined according to its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.

[0177] As used herein, the term "and / or" is merely a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B may represent: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " in this article generally represents an "or" relationship between the associated objects before and after.

[0178] It should be understood that in the embodiments of the present application, "B corresponding to A" means that B is associated with A, and B can be determined according to A. However, it should also be understood that determining B according to A does not mean determining B only according to A, and B can also be determined according to A and / or other information.

[0179] Those of ordinary skill in the art will appreciate that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the components and steps of the examples have been generally described in terms of function in the above description. Whether these functions are executed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled professionals may use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.

[0180] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the systems, devices, and units described above can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated herein.

[0181] In several embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division, and there can be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the couplings, direct couplings, or communication connections shown or discussed with each other can be through some interfaces, and the indirect couplings or communication connections of devices or units can be in electrical, mechanical, or other forms.

[0182] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0183] In addition, the functional units in each embodiment of this application can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above integrated units can be implemented in the form of hardware or in the form of software functional units.

[0184] When the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of this application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories, random access memories, magnetic disks, or optical discs.

Claims

1. A message processing method, characterized in that, including: A first network device obtains a first packet, where the first packet includes an emulation detection identifier; The first network device determines a first forwarding entry corresponding to the first packet; When the first forwarding entry includes a first identifier, the first network device forwards the first packet according to the first forwarding entry, where the first identifier indicates that the first forwarding entry is a forwarding entry to be created; When the first forwarding entry includes a second identifier, the first network device does not forward the first packet according to the first forwarding entry, where the second identifier indicates that the first forwarding entry is a forwarding entry to be deleted.

2. The message processing method according to claim 1, wherein The method further includes: The first network device obtains a second packet, where the second packet is a service packet; The first network device determines a second forwarding entry corresponding to the second packet; When the second forwarding entry includes the first identifier, the first network device does not forward the second packet according to the second forwarding entry; When the second forwarding entry includes the second identifier, the first network device forwards the second packet according to the second forwarding entry.

3. The message processing method according to claim 1, wherein The method further includes: After forwarding the first packet according to the first forwarding entry, the first network device sends first information to a controller, where the first information is used to indicate that the first packet is successfully forwarded according to the first forwarding entry; or The first network device sends second information to the controller, where the second information is used to indicate the forwarding result of the first packet.

4. The packet processing method according to claim 3, wherein When all the forwarding entries corresponding to the first packet include the second identifier, the forwarding result of the first packet is forwarding failure.

5. The message processing method according to claim 2, wherein The method further includes: After forwarding the first packet according to the first forwarding entry, the first network device sends first information to a controller, where the first information is used to indicate that the first packet is successfully forwarded according to the first forwarding entry; or The first network device sends second information to the controller, where the second information is used to indicate the forwarding result of the first packet.

6. The packet processing method according to claim 5, wherein When all the forwarding entries corresponding to the first packet include the second identifier, the forwarding result of the first packet is forwarding failure.

7. The message processing method according to claim 1, wherein The method further includes: The first network device obtains a deletion instruction, where the deletion instruction is used to indicate that the status of a first interface on the first network device is to be deleted; The first network device determines that the outgoing interface of the first forwarding entry is the first interface; The first network device adds the second identifier to the first forwarding entry.

8. The message processing method according to claim 2, wherein The method further includes: The first network device obtains a deletion instruction, where the deletion instruction is used to indicate that the status of a first interface on the first network device is to be deleted; The first network device determines that the outgoing interface of the first forwarding entry is the first interface; The first network device adds the second identifier to the first forwarding entry.

9. The message processing method according to claim 3, wherein The method further includes: If all the forwarding entries in the first network device with the same destination address as the first forwarding entry have the second identifier, or there are no other forwarding entries in the first network device with the same destination address as the first forwarding entry, then the first network device generates a first route according to the first forwarding entry, and the first route includes the second identifier; The first network device advertises the first route to the second network device.

10. The message processing method according to claim 5, characterized in that, The method further includes: If all the forwarding entries in the first network device with the same destination address as the first forwarding entry have the second identifier, or there are no other forwarding entries in the first network device with the same destination address as the first forwarding entry, then the first network device generates a first route according to the first forwarding entry, and the first route includes the second identifier; The first network device advertises the first route to the second network device.

11. The message processing method according to claim 1, wherein The method further includes: The first network device obtains a creation instruction, and the creation instruction is used to indicate that the status of the second interface on the first network device is to be created; The first network device advertises a second route to the second network device through the second interface, and the second route includes the first identifier.

12. The message processing method according to claim 2, wherein The method further includes: The first network device obtains a creation instruction, and the creation instruction is used to indicate that the status of the second interface on the first network device is to be created; The first network device advertises a second route to the second network device through the second interface, and the second route includes the first identifier.

13. The message processing method according to claim 1, wherein The method further includes: The first network device receives a first route advertisement message, and the first route advertisement message includes the first identifier or the second identifier; The first network device generates the first forwarding entry according to the first route advertisement message.

14. The message processing method according to claim 2, wherein The method further includes: The first network device receives a first route advertisement message, and the first route advertisement message includes the first identifier or the second identifier; The first network device generates the first forwarding entry according to the first route advertisement message.

15. The message processing method according to claim 1, wherein The method further includes: When the first forwarding entry has the first identifier, if all the forwarding entries in the first network device with the same destination address as the first forwarding entry have the first identifier, or there are no other forwarding entries in the first network device with the same destination address as the first forwarding entry, then the first network device generates a second route advertisement message according to the first forwarding entry, and the second route advertisement message includes the first identifier; The first network device sends the second route advertisement message to the second network device.

16. The message processing method according to claim 2, wherein The method further includes: When the first forwarding entry has the first identifier, if all the forwarding entries in the first network device with the same destination address as the first forwarding entry have the first identifier, or there are no other forwarding entries in the first network device with the same destination address as the first forwarding entry, then the first network device generates a second route advertisement message according to the first forwarding entry, and the second route advertisement message includes the first identifier; The first network device sends the second route advertisement message to the second network device.

17. The message processing method according to any one of claims 1 to 16, characterized in that The first forwarding table entry includes one or more of a route information base (RIB) table entry, a forwarding information base (FIB) table entry, an address resolution protocol (ARP) table entry, a media access control (MAC) table entry, and a neighbor discovery (ND) table entry.

18. A network device, characterized in that, The network device is a first network device, including: An obtaining unit, configured to obtain a first message, where the first message includes an emulation detection identifier; A processing unit, configured to determine a first forwarding table entry corresponding to the first message; A transceiver unit, configured to, when the first forwarding table entry includes a first identifier, forward the first message according to the first forwarding table entry, where the first identifier indicates that the first forwarding table entry is a forwarding table entry to be created; and, when the first forwarding table entry includes a second identifier, not forward the first message according to the first forwarding table entry, where the second identifier indicates that the first forwarding table entry is a forwarding table entry to be deleted.

19. The network device according to claim 18, wherein: The obtaining unit is further configured to obtain a second message, where the second message is a service message; The processing unit is further configured to determine a second forwarding table entry corresponding to the second message; The transceiver unit is further configured to, when the second forwarding table entry includes the first identifier, not forward the second message according to the second forwarding table entry; and, when the second forwarding table entry includes the second identifier, forward the second message according to the second forwarding table entry.

20. The network device according to claim 18, wherein: The transceiver unit is further configured to, after forwarding the first message according to the first forwarding table entry, send first information to the controller, where the first information is used to indicate that the first message is successfully forwarded according to the first forwarding table entry; or The transceiver unit is further configured to send second information to the controller, where the second information is used to indicate the forwarding result of the first message.

21. The network device according to claim 20, wherein: When all the forwarding table entries corresponding to the first message include the second identifier, the forwarding result of the first message is forwarding failure.

22. The network device according to claim 19, wherein: The transceiver unit is further configured to, after forwarding the first message according to the first forwarding table entry, send first information to the controller, where the first information is used to indicate that the first message is successfully forwarded according to the first forwarding table entry; or The transceiver unit is further configured to send second information to the controller, where the second information is used to indicate the forwarding result of the first message.

23. The network device according to claim 22, wherein: When all the forwarding table entries corresponding to the first message include the second identifier, the forwarding result of the first message is forwarding failure.

24. The network device according to claim 18, wherein: The obtaining unit is further configured to obtain a deletion instruction, where the deletion instruction is used to indicate that the status of a first interface on the first network device is to be deleted. The processing unit is further configured to determine that the outgoing interface of the first forwarding entry is the first interface; and add the second identifier to the first forwarding entry.

25. The network device according to claim 19, wherein The obtaining unit is further configured to obtain a deletion instruction for indicating that the status of the first interface on the first network device is to be deleted; The processing unit is further configured to determine that the outgoing interface of the first forwarding entry is the first interface; and add the second identifier to the first forwarding entry.

26. The network device according to claim 20, wherein The processing unit is further configured to, if all the forwarding entries in the first network device with the same destination address as the first forwarding entry have the second identifier, or there are no other forwarding entries in the first network device with the same destination address as the first forwarding entry, generate a first route according to the first forwarding entry, where the first route includes the second identifier; The transceiver unit is further configured to advertise the first route to a second network device.

27. The network device according to claim 22, wherein The processing unit is further configured to, if all the forwarding entries in the first network device with the same destination address as the first forwarding entry have the second identifier, or there are no other forwarding entries in the first network device with the same destination address as the first forwarding entry, generate a first route according to the first forwarding entry, where the first route includes the second identifier; The transceiver unit is further configured to advertise the first route to a second network device.

28. The network device according to claim 18, wherein The obtaining unit is further configured to obtain a creation instruction for indicating that the status of the second interface on the first network device is to be created; The transceiver unit is further configured to advertise a second route including the first identifier to a second network device through the second interface.

29. The network device according to claim 19, wherein The obtaining unit is further configured to obtain a creation instruction for indicating that the status of the second interface on the first network device is to be created; The transceiver unit is further configured to advertise a second route including the first identifier to a second network device through the second interface.

30. The network device according to claim 18, wherein The transceiver unit is further configured to receive a first route advertisement message including the first identifier or the second identifier; The processing unit is further configured to generate the first forwarding entry according to the first route advertisement message.

31. The network device according to claim 19, wherein The transceiver unit is further configured to receive a first route advertisement message including the first identifier or the second identifier; The processing unit is further configured to generate the first forwarding entry according to the first route advertisement message.

32. The network device according to claim 18, wherein The processing unit is further configured to, when the first forwarding entry has the first identifier, if all the forwarding entries in the first network device with the same destination address as the first forwarding entry have the first identifier, or there are no other forwarding entries in the first network device with the same destination address as the first forwarding entry, generate a second routing advertisement message according to the first forwarding entry, where the second routing advertisement message includes the first identifier; The transceiver unit is further configured to send the second routing advertisement message to a second network device.

33. The network device according to claim 19, wherein: The processing unit is further configured to, when the first forwarding entry has the first identifier, if all the forwarding entries in the first network device with the same destination address as the first forwarding entry have the first identifier, or there are no other forwarding entries in the first network device with the same destination address as the first forwarding entry, generate a second routing advertisement message according to the first forwarding entry, where the second routing advertisement message includes the first identifier; The transceiver unit is further configured to send the second routing advertisement message to a second network device.

34. The network device according to any one of claims 18 to 33, characterized in that The first forwarding entry includes one or more of a RIB entry, a FIB entry, an ARP entry, a MAC entry, and an ND entry.

35. A network device, characterized in that, The network device includes a processor and a memory; The memory is used for storing instructions; The processor is configured to execute the instructions in the memory, so that the network device executes the method according to any one of claims 1 to 17.

36. A computer-readable storage medium having computer-readable instructions stored thereon, characterized in that, When the computer-readable instructions are executed by the processor, the computer is caused to execute the method according to any one of claims 1 to 17.

37. A computer program product comprising instructions, characterized in that, When the instructions run on the computer, the computer is caused to execute the method according to any one of claims 1 to 17.

Citation Information

Patent Citations

  • Method and device for establishing forwarding table item

    CN105959226A