A method and device for obtaining forwarding information

The method identifies and manages congested queues in network devices by using business parameter identifiers to adjust priority or path, reducing latency and packet loss in microbursts.

CN113141311BActive Publication Date: 2025-07-15HUAWEI TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202010059919.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-01-19
Publication Date
2025-07-15
Estimated Expiration
2040-01-19

AI Technical Summary

Technical Problem

Network devices cannot determine the service flow affected by the micro burst under micro bursts, resulting in increased delay in message forwarding or packet loss.

Method used

By obtaining the service parameter identification of the message, determine the service flow affected by the micro burst, and perform corresponding operations to alleviate queue congestion, such as sending the service parameter identification to the controller or network management device, adjusting the service flow priority or changing the forwarding path.

Benefits of technology

Quickly and accurately determine and alleviate the impact of queue congestion on service flow, reducing message forwarding delays and packet loss.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113141311B_ABST
    Figure CN113141311B_ABST
Patent Text Reader

Abstract

An embodiment of this application discloses a method for obtaining forwarding information. Since microburst phenomena can cause congestion in the egress queue, a first device can, when the first queue is congested, obtain the service parameter identifier of the first packet buffered in the first queue, where the first queue is the egress queue in the first device. The service parameter identifier of the first packet is used to indicate the parameters for forwarding the first packet. The parameters for forwarding the first packet can be used to indicate the service flow to which the first packet belongs. The first device can determine the service flow to which the first packet belongs through the service parameter identifier of the first packet, that is, determine the service flow affected by the congestion in the first queue. The first device can further perform a first operation according to the service parameter identifier of the first packet. Using this method, the first device can determine the service affected by the congestion when the first queue is congested, and perform the first operation to mitigate the impact of the congestion in the first queue on the service flow to which the first packet belongs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of device management, and in particular, to a method and device for obtaining forwarding information. Background Art

[0002] Network devices can be used to forward packets. During the process of forwarding packets, microbursts may occur in network devices. A microburst refers to the phenomenon that a large amount of burst data is received within a short period of time, so that the port bandwidth and buffer capacity are approached or even exceeded within a short period of time. Microbursts will have a certain impact on the forwarded packets, such as increasing the packet forwarding delay or causing packet loss. When a microburst occurs, it is necessary to determine the traffic flow affected by the microburst. Currently, network devices cannot determine the traffic flow corresponding to the packets involved in the microburst. Summary of the Invention

[0003] An embodiment of this application provides a method for obtaining forwarding information, which can determine the traffic flow involved in a microburst.

[0004] In a first aspect, an embodiment of this application provides a method for obtaining forwarding information, which can be executed by a first device. When a first queue is congested, the first device obtains the service parameter identifier of the first packet cached in the first queue. The first queue is the egress queue of the first device. The service parameter identifier of the first packet is used to indicate the parameters for forwarding the first packet. The parameters for forwarding the first packet can be used to indicate the traffic flow to which the first packet belongs. When the first queue is congested, the first device can determine the traffic flow to which the first packet belongs through the service parameter identifier of the first packet, that is, determine the traffic flow affected by the congestion of the first queue. The first device performs a first operation according to the service parameter identifier of the first packet. The first operation is used to relieve the congestion of the first queue. In the above method, when the first queue is congested, the first device can quickly and accurately determine the service affected by the congestion of the first queue, which helps to reduce the impact of the congestion of the first queue on the traffic flow to which the first packet belongs.

[0005] In a possible implementation manner, the first device performing the first operation may be, for example, that the first device sends the service parameter identifier of the first packet to a second device. The second device may be a controller or a network management device. After the first device sends the service parameter identifier of the first packet to the second device, the second device analyzes and processes the service parameter identifier of the first packet and performs corresponding processing measures to reduce the impact of the congestion of the first queue on the traffic flow to which the first packet belongs.

[0006] In a possible implementation, to enable the second device to determine more information about the first queue that is congested, so that the second device can more comprehensively monitor the operating conditions of the first device, the first device may also send the information of the first queue to the second device. The information of the first queue mentioned here may include, for example, one or more of the identifier of the first queue, the priority of the first queue, and the buffer length of the first queue.

[0007] In a possible implementation, the first device may, based on the indication of the second device, perform the steps of obtaining the service parameter identifier of the first packet when the first queue is congested, and sending the service parameter identifier of the first packet to the second device. Specifically, the second device may generate a first message and send the first message to the first device. The first message is used to instruct the first device to send the service parameter identifier carried in the packets in the congested queue to the second device when congestion occurs.

[0008] In a possible implementation, when the second device is a network management device, the aforementioned first message may be a message expressed in the YANG data model. In some embodiments, the first message may include a correspondence relationship, which includes the service parameter identifier of the first packet and the parameters for forwarding the first packet. After receiving the first message, the first device may save the correspondence relationship. When the first device obtains the parameters for forwarding the first packet, it may determine the service parameter identifier of the first packet according to the correspondence relationship.

[0009] In a possible implementation, the first device performing the first operation may be, for example: the first device adjusts the priority of the service flow to which the first packet belongs. Specifically, the first device may store the correspondence relationship between the service parameter identifier of the first packet and the parameters for forwarding the first packet. The first device may determine the parameters for forwarding the first packet according to the correspondence relationship. After the second device determines the parameters for forwarding the first packet, it determines the service flow to which the first packet belongs. Then, the first device may obtain a first policy, which is used to increase the priority of the service flow corresponding to the service parameter identifier, that is, the first policy is used to adjust the priority of the service flow to which the first packet belongs. In this way, for a second packet that belongs to the same service flow as the first packet and is sent after the first packet, if the first device obtains the second packet, the first device may forward the second packet according to the first policy. Since the priority of the service flow to which the first packet belongs is increased, the priority of the second packet determined according to the first policy is higher than the priority of the first packet. Therefore, the first device may forward the second packet through a second queue with a higher priority than the first queue, thereby avoiding affecting the forwarding of the second packet due to congestion in the first queue in the first device.

[0010] In a possible implementation, the first device performing the first operation may be, for example: the first device changes the port for forwarding the traffic flow to which the first packet belongs. The first device may store a forwarding table entry for guiding the first device to forward packets. According to this forwarding table entry, the port for forwarding the packet can be determined. After determining the port for forwarding the packet, the packet can be buffered in the egress queue corresponding to the port according to the priority of the packet. If the first queue is congested, for the traffic flow to which the first packet belongs, the first device can change the port for forwarding the traffic flow to which the first packet belongs, so as to prevent the second packet sent after the first packet from continuing to be forwarded through the first queue. The second packet and the first packet belong to the same traffic flow. Specifically, the first device can generate a first forwarding table entry according to the foregoing service parameter identifier. Specifically, the first device can determine the parameter for forwarding the first packet according to the foregoing corresponding relationship, and then generate a first forwarding table entry including the corresponding relationship between the parameter for forwarding the first packet and the port, where: the port corresponding to the parameter for forwarding the first packet is different from the port through which the first device forwards the first packet. In the subsequent process of forwarding packets, the first device can forward packets according to the first forwarding table entry. For the second packet that belongs to the same traffic flow as the first packet and is sent after the first packet, the first device can forward the second packet according to the first forwarding table entry. Since the parameter for forwarding the second packet is the same as the parameter for forwarding the first packet, the port determined according to the first forwarding table entry for forwarding the second packet is different from the port for forwarding the first packet. In this way, the second packet can no longer be forwarded through the first queue, thereby preventing the forwarding of the second packet from being affected due to the congestion of the first queue in the first device.

[0011] In a possible implementation, different from the traditional technology, in addition to buffering the first packet, the first queue also buffers the service parameter identifier of the first packet, where the service parameter identifier of the first packet is located in the packet header of the third packet, and the third packet includes the first packet and the packet header. In this way, when the first device determines that the first queue is congested, the first device can read the service parameter identifier of the first packet from the packet header of the third packet buffered in the first queue.

[0012] In a possible implementation, the service parameter identifier in the header of the first message is added by the first device. Specifically, the first device obtains a second forwarding entry, which includes parameters for forwarding the first message. The second forwarding entry is the forwarding entry used to forward the first message. The first device can parse the first message and determine the parameters for forwarding the first message based on the parsing result and the second forwarding entry. Then, the first device obtains the service parameter identifier of the first message according to the corresponding relationship and the parameters for forwarding the first message. The corresponding relationship includes the service parameter identifier of the first message and the parameters for forwarding the first message. After obtaining the service parameter identifier of the first message, the first device can add the service parameter identifier to the message header and obtain a third message based on the message header and the first message, where the third message includes the first message and the aforementioned message header.

[0013] In a possible implementation, for a service flow, the address prefixes matching the destination Internet Protocol (IP) addresses in each message belonging to the service flow are the same. Therefore, the address prefix matching the destination IP address of the first message can be used to indicate the service flow to which the first message belongs. Therefore, the aforementioned parameters for forwarding the first message may include the address prefix matching the destination IP address of the first message. In some embodiments, the message can be forwarded using a tunnel during the forwarding process. For a service flow, the tunnels used to forward each message in the service flow are the same. The aforementioned parameters for forwarding the first message may include the tunnel used to forward the first message. In some embodiments, the multi-tuple information of each message in a service flow is the same, and the aforementioned parameters for forwarding the first message may include the multi-tuple information of the first message. The multi-tuple information mentioned here can be binary tuple information or five-tuple information, etc. This application will not give examples one by one for the possible forms adopted by the multi-tuple information.

[0014] In a second aspect, an embodiment of the present application provides a method for obtaining forwarding information. The method includes: the second device generates a first message, where the first message is used to instruct the first device to send the service parameter identifier carried in the message in the congestion queue to the second device when the first device is congested; the second device sends the first message to the first device.

[0015] In a possible implementation, the first message further includes a corresponding relationship, and the corresponding relationship includes the service parameter identifier and the parameters for forwarding the first message.

[0016] In a possible implementation, the method further includes: the second device receives the service parameter identifier sent by the first device, and the service identifier is used to indicate the parameters for forwarding the first message.

[0017] In a possible implementation, after the second device receives the service parameter identifier of the first packet, it can determine the parameters for forwarding the first packet according to the corresponding relationship. After the second device determines the parameters for forwarding the first packet, it determines the service flow to which the first packet belongs. Since the first queue of the first device is congested, for a second packet in the service flow to which the first packet belongs, if the second packet is still forwarded in the same forwarding manner as the first packet, the second packet will still be forwarded through the first queue in the first device, which may exacerbate the congestion of the first queue, resulting in a greater transmission delay or more serious packet loss for the service flow to which the first packet belongs. Herein, the second packet is a packet sent after the first packet. To solve this problem, after the second device determines the service flow to which the first packet belongs according to the service parameter identifier of the first packet, it can perform a path redirection operation on the second packet, that is, change the forwarding path of the second packet. For example, the path obtained by the second device performing the path redirection operation for forwarding the second packet does not include the first device. That is, for the second packet forwarded after the first packet in the service flow to which the first packet belongs, it is no longer forwarded through the first device, but through other paths, thereby avoiding affecting the forwarding of the second packet due to the congestion of the first queue in the first device.

[0018] In a third aspect, an embodiment of the present application provides a device for obtaining forwarding information. The device includes: an obtaining unit and a processing unit. The obtaining unit is configured to obtain a service parameter identifier of a first packet cached in the first queue when the first queue is congested, and the service parameter identifier is used to indicate the parameters for forwarding the first packet; the processing unit is configured to perform a first operation according to the service parameter identifier, and the first operation is used to relieve the congestion of the first queue.

[0019] In a possible implementation, the processing unit is specifically configured to send the service parameter identifier to the second device.

[0020] In a possible implementation, the processing unit is further configured to: send the information of the first queue to the second device, and the information of the first queue includes any one or more of the following: the identifier of the first queue, the priority of the first queue, and the cache length of the first queue.

[0021] In a possible implementation, the device further includes a receiving unit, and the receiving unit is configured to receive a first message from the second device, and the first message is used to indicate sending the service parameter identifier carried in the packet in the congested queue to the second device when congestion occurs.

[0022] In a possible implementation, the first message further includes a correspondence relationship, where the correspondence relationship includes the service parameter identifier and the parameter for forwarding the first packet.

[0023] In a possible implementation, the processing unit is specifically configured to: obtain a first policy according to the service parameter identifier, where the first policy is used to increase the priority of the service flow corresponding to the service parameter identifier; and send the second packet through a second queue according to the first policy, where the second packet is a packet sent after the first packet in the service flow to which the first packet belongs.

[0024] In a possible implementation, the processing unit is specifically configured to: obtain a first forwarding entry according to the service parameter identifier, where the first forwarding entry includes the correspondence relationship between the parameter for forwarding the first packet and the port, and the port is used to send the second packet, where the second packet is a packet sent after the first packet in the service flow to which the first packet belongs, and the port is different from the port used to send the first packet; and send the second packet according to the first forwarding entry.

[0025] In a possible implementation, the obtaining unit is specifically configured to: obtain the identifier of the service parameter from the packet header of a third packet, where the packet header of the third packet includes the identifier of the service parameter, and the third packet includes the first packet and the packet header.

[0026] In a possible implementation, the obtaining unit is further configured to: obtain a second forwarding entry, where the second forwarding entry includes the parameter for forwarding the first packet; obtain the service parameter identifier according to the correspondence relationship and the parameter for forwarding the first packet, where the correspondence relationship includes the service parameter identifier and the parameter for forwarding the first packet; and obtain a third packet according to the first packet and the service parameter identifier of the first packet. The packet header of the third packet includes the service parameter identifier of the first packet.

[0027] In a possible implementation, the parameter for forwarding the first packet includes one or more of: an address prefix matching the destination Internet Protocol (IP) address, a tunnel, and tuple information.

[0028] In a fourth aspect, an embodiment of the present application provides a device for obtaining forwarding information, which is applied to a second device. The device includes: a generating unit and a sending unit; the generating unit is configured to generate a first message for instructing a first device to send the service parameter identifier carried in the packets in a congestion queue to the second device when congestion occurs in the first device; and the sending unit is configured to send the first message to the first device.

[0029] In a possible implementation, the first message further includes a correspondence relationship, which includes the service parameter identifier and the parameter for forwarding the first packet.

[0030] In a possible implementation, the apparatus further includes a receiving unit, configured to receive the service parameter identifier sent by the first device, where the service identifier is used to indicate the parameter for forwarding the first packet.

[0031] In a possible implementation, the apparatus further includes an obtaining unit, configured to obtain, according to the service parameter identifier, a path for forwarding a second packet, where the path for forwarding the second packet does not include the first device, and the second packet is a packet sent after the first packet in the service flow to which the first packet belongs.

[0032] In a fifth aspect, an embodiment of the present application provides a device for obtaining forwarding information, where the device includes: a processor and a memory; the memory is configured to store instructions; the processor is configured to execute the instructions in the memory to execute the method according to any one of the above first aspects or the method according to any one of the above second aspects.

[0033] In a sixth aspect, an embodiment of the present application further provides a computer-readable storage medium, including instructions, which, when running on a computer, cause the computer to execute the method according to any one of the above first aspects or the method according to any one of the above second aspects.

[0034] In a seventh aspect, an embodiment of the present application provides a computer program product including instructions, which, when running on a computer, cause the computer to execute the method according to any one of the above first aspects or the method according to any one of the above second aspects. Description of the Drawings

[0035] To more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the accompanying drawings required for describing the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only some embodiments recorded in the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0036] Figure 1 It is a schematic structural diagram of a network device;

[0037] Figure 2 It is a schematic flowchart of a method for obtaining forwarding information provided by an embodiment of the present application;

[0038] Figure 3Schematic flow chart of a method for obtaining a third message provided by an embodiment of the present application;

[0039] Figure 4 Schematic structural diagram of a device for obtaining forwarding information provided by an embodiment of the present application;

[0040] Figure 5 Schematic structural diagram of a device for obtaining forwarding information provided by an embodiment of the present application;

[0041] Figure 6 Schematic structural diagram of a device for obtaining forwarding information provided by an embodiment of the present application. Detailed implementation manners

[0042] For ease of understanding, first, a mechanism for a network device to forward messages is briefly introduced.

[0043] Refer to Figure 1 , which is a schematic structural diagram of a network device. As Figure 1 shown, the network device 100 may include a forwarding engine (FE) 101 and a traffic management (TM) module 102. The FE 101 and the TM module 102 may be integrated on one chip or located on two different chips, which is not specifically limited in the embodiments of the present application. The FE 101 may be used to obtain messages from other network devices, parse the messages, and obtain information such as the outgoing interface and the next hop for forwarding the messages in combination with the forwarding table entries stored locally. Specifically, the FE 101 may identify the service flow to which the message belongs. The TM module 102 is used to implement queue scheduling. For example, one interface corresponds to multiple outgoing queues, and the TM module 102 determines the dequeueing rules of the messages in each outgoing queue through a scheduling algorithm. Among them, the TM module 102 may determine whether an outgoing queue is congested, but the TM module 102 cannot determine the service flow to which the message in the outgoing queue belongs. If the outgoing queue is congested due to a microburst phenomenon, the TM module 102 may determine that the outgoing queue is congested, but it cannot determine the service flow to which the messages cached in the congested outgoing queue belong, resulting in an impact on the service flow during the forwarding process. For example, the transmission delay increases and messages are lost, etc.

[0044] To solve the above problems, an embodiment of the present application provides a method for obtaining forwarding information. When the first queue of the first device is congested, the first device can determine the traffic flow to which the first packet belongs through the service parameter identifier of the first packet, that is, determine the traffic flow affected by the microburst. The first device can perform a first operation according to the service parameter identifier of the first packet, and the first operation is used to relieve the congestion of the first queue, so as to reduce the impact on the traffic flow to which the first packet belongs due to the congestion of the first queue. Herein, the first packet is the packet cached in the first queue.

[0045] The following introduces the method for obtaining forwarding information provided by the embodiment of the present application in conjunction with the accompanying drawings. Refer to Figure 2 , this figure is a schematic flowchart of a method for obtaining forwarding information provided by an embodiment of the present application, Figure 2 The method for obtaining forwarding information shown can be implemented, for example, through the following S101-S102.

[0046] S101: When the first queue of the first device is congested, obtain the service parameter identifier of the first packet cached in the first queue, and this service parameter identifier is used to indicate the parameters for forwarding the first packet.

[0047] The first device in the embodiment of the present application can be a network device with packet forwarding function. The first device can be, for example, the Figure 1 network device 100 shown. Specifically, the TM module 102 in the network device 100 can determine whether the first queue of the first device is congested. The so-called first queue congestion means that the number of packets cached in the first queue is greater than the cache length of the first queue, or the number of packets in the first queue exceeds a preset threshold.

[0048] The first queue in the embodiment of the present application refers to the egress queue corresponding to a certain port of the first device. The first queue can be used to cache packets to be forwarded. For a port on the first device, if this port can be used to forward packets to other devices, one or more egress queues can be set for this port. Each egress queue is set with a priority. When the first device performs packet forwarding, it can determine the egress queue into which the packet enters according to the priority of the packet. The priority of the egress queue matches the priority of the packets cached in this egress queue. For example, if the priority of the packet is high priority, then the priority of the egress queue into which this packet enters is also high priority.

[0049] When the first device determines that there is congestion in the first queue of the first device, the first device may obtain the service parameter identifier of the first packet buffered in the first queue. The service parameter identifier of the first packet may be carried in the header of the third packet sent by the FE 101 to the TM module 102. The third packet includes a header and the first packet. The header of the third packet includes the service parameter identifier of the first packet. When the first device determines that there is congestion in the first queue, the first device can read the service parameter identifier of the first packet from the header of the third packet buffered in the first queue. Among them, the service parameter identifier of the first packet is used to indicate the parameters for forwarding the first packet. For a service flow, the parameters for forwarding each packet in the service flow are the same. In other words, the parameters for forwarding the first packet can be used to indicate the service flow to which the first packet belongs. That is, the first device can determine the service flow to which the first packet belongs through the service parameter identifier of the first packet.

[0050] Regarding the parameters for forwarding the first packet, the embodiments of the present application do not make specific limitations. In some embodiments, for a service flow, the address prefixes matching the destination IP addresses of each packet belonging to the service flow are the same. Therefore, the address prefix matching the destination IP address of the first packet can be used to indicate the service flow to which the first packet belongs. Therefore, the aforementioned parameters for forwarding the first packet may include the address prefix matching the destination IP address of the first packet. In some embodiments, packets can be forwarded using tunnels during the forwarding process. For a service flow, the tunnels used to forward each packet in the service flow are the same. The tunnels mentioned here may include multi-protocol label switching (MPLS) tunnels, segment routing internet protocol version 6 (SRv6) tunnels, and virtual extensible local area network (VXLAN) tunnels, etc. The aforementioned parameters for forwarding the first packet may include the tunnel used to forward the first packet. In some embodiments, the multi-tuple information of each packet in a service flow is the same. The aforementioned parameters for forwarding the first packet may include the multi-tuple information of the first packet. The multi-tuple information mentioned here may be binary tuple information or five-tuple information. Among them, the binary tuple includes the source IP address and the destination IP address. The five-tuple includes the source IP address, source port number, destination IP address, destination port number, and transport layer protocol number. The multi-tuple information can be used to identify the service flow.

[0051] For example, the parameters for forwarding the first packet may include one or more of: an address prefix matching the destination IP address, a tunnel, and multi - tuple information. When the first device forwards the first packet, it can forward according to the forwarding entry items stored locally, and the foregoing address prefix, tunnel, and multi - tuple information can all be parameters included in the foregoing forwarding entry items. Of course, the parameters for forwarding the first packet can also be other parameters included in the forwarding entry items, which will not be listed one by one here.

[0052] S102: The first device performs a first operation according to the service parameter identifier of the first packet.

[0053] In the embodiment of the present application, after the first device obtains the service parameter identifier of the first packet, in order to further reduce the impact of the congestion of the first queue on the service flow to which the first packet belongs, the first device can perform a first operation according to the service parameter identifier of the first packet. The first operation is used to relieve the congestion of the first queue. For example, the first operation can be an operation related to reducing the impact of the congestion of the first queue on the service flow to which the first packet belongs. The following introduces three implementation manners for the first device to perform the first operation.

[0054] The first implementation manner: The first device sends the service parameter identifier of the first packet to the second device.

[0055] In the embodiment of the present application, the second device can be a controller, a network management device, or can also be implemented by artificial intelligence (AI) of the device.

[0056] In some embodiments, when the first device determines the congestion of the first queue, it can actively send the service parameter identifier of the first queue to the second device. In some embodiments, when the first device determines the congestion of the first queue, it can send the snapshot information of the first queue to the second device, where the snapshot information of the first queue includes the service parameter identifier of the first packet.

[0057] After the first device sends the service parameter identifier of the first message to the second device, the second device analyzes and processes the service parameter identifier of the first message, and executes corresponding processing measures to mitigate the impact of the congestion of the first queue on the service flow to which the first message belongs. Specifically, the second device may store the correspondence between the service parameter identifier of the first message and the parameters for forwarding the first message. After receiving the service parameter identifier of the first message, the second device may determine the parameters for forwarding the first message according to this correspondence. After the second device determines the parameters for forwarding the first message, it determines the service flow to which the first message belongs. Since the first queue of the first device is already congested, for the second message in the service flow to which the first message belongs, if the second message is still forwarded in the same forwarding manner as the first message, the second message will still be forwarded through the first queue in the first device, which may exacerbate the congestion of the first queue, resulting in a greater transmission delay or more serious packet loss for the service flow to which the first message belongs. Herein, the second message is a message sent after the first message. To solve this problem, after the second device determines the service flow to which the first message belongs according to the service parameter identifier of the first message, the second device may perform a path redirection operation on the second message, that is, change the forwarding path of the second message. For example, the path obtained by the second device performing the path redirection operation for forwarding the second message does not include the first device. That is, for the second message in the service flow to which the first message belongs and forwarded after the first message, it is no longer forwarded through the first device, but through other paths, so as to avoid affecting the forwarding of the second message due to the congestion of the first queue in the first device.

[0058] In an implementation manner of the embodiment of the present application, in order for the second device to determine more information about the congested first queue, so as to facilitate the second device to more comprehensively monitor the operation of the first device, the first device may also send the information of the first queue to the second device. The information of the first queue mentioned herein may include, for example, any one or more of the identifier of the first queue, the priority of the first queue, and the cache length of the first queue.

[0059] In some embodiments, the first device may, based on the indication of the second device, perform the foregoing S101 and the step of sending the service parameter identifier of the first message to the second device. Specifically, the second device may send a first message to the first device, and the first message is used to instruct the first device to send the service parameter identifier carried in the message in the congestion queue to the second device when congestion occurs at the first device. When the second device is a network management device, the foregoing first message may be a message expressed in the YANG data model. The embodiments of the present application do not specifically limit the content included in the first message. In some embodiments, the first message may include a correspondence relationship, and the correspondence relationship includes the service parameter identifier of the first message and the parameter for forwarding the first message. After receiving the first message, the first device may save the correspondence relationship, and when the first device obtains the parameter for forwarding the first message, it may determine the service parameter identifier of the first message according to the correspondence relationship.

[0060] The second implementation manner: The first device adjusts the priority of the service flow to which the first message belongs.

[0061] In the embodiments of the present application, the first device may store the correspondence relationship between the service parameter identifier of the first message and the parameter for forwarding the first message. The first device may determine the parameter for forwarding the first message according to the correspondence relationship. After the second device determines the parameter for forwarding the first message, it determines the service flow to which the first message belongs. Then, the first device may obtain a first policy, and the first policy is used to increase the priority of the service flow corresponding to the service parameter identifier, that is, the first policy is used to adjust the priority of the service flow to which the first message belongs. In this way, for a second message that belongs to the same service flow as the first message and is sent after the first message, if the first device obtains the second message, the first device may forward the second message according to the first policy. Since the priority of the service flow to which the first message belongs is increased, the priority of the second message determined according to the first policy is higher than the priority of the first message. Therefore, the first device may forward the second message through a second queue with a higher priority than the first queue, thereby avoiding affecting the forwarding of the second message due to congestion in the first queue in the first device.

[0062] Regarding the foregoing correspondence relationship mentioned above, taking the parameter for forwarding the first message as tuple information as an example for illustration, see Table 1 below.

[0063] Table 1

[0064] Parameters for forwarding the first message Service parameter identifier First multi - tuple information 1 Second multi - tuple information 2 Third multi - tuple information 3 Fourth multi - tuple information 4

[0065] Table 1 is shown only for convenience of understanding, and it does not constitute a limitation to the embodiments of the present application. The value of the service parameter identifier in the embodiments of the present application is not limited to the values shown in Table 1.

[0066] The third implementation method: The first device changes the port for forwarding the service flow to which the first packet belongs.

[0067] As described above, the first device may store a forwarding entry to guide the first device to forward packets. According to this forwarding entry, the port for forwarding the packet can be determined. After determining the port for forwarding the packet, the packet can be cached in the egress queue corresponding to this port according to the priority of the packet. In the embodiment of the present application, if the first queue is congested, for the service flow to which the first packet belongs, the first device may change the port for forwarding the service flow to which the first packet belongs, so as to prevent the second packet sent after the first packet from continuing to be forwarded through the first queue. The second packet and the first packet belong to the same service flow. Specifically, the first device may generate a first forwarding entry according to the foregoing service parameter identifier. Specifically, the first device may determine the parameter for forwarding the first packet according to the foregoing corresponding relationship, and then generate a first forwarding entry including the corresponding relationship between the parameter for forwarding the first packet and the port, where: the port corresponding to the parameter for forwarding the first packet is different from the port through which the first device forwards the first packet. In the subsequent process of forwarding packets, the first device may forward packets according to the first forwarding entry. For the second packet that belongs to the same service flow as the first packet and is sent after the first packet, the first device may send the second packet according to this first forwarding entry. Since the parameter for forwarding the second packet is the same as the parameter for forwarding the first packet, the port determined according to the first forwarding entry for forwarding the second packet is different from the port for forwarding the first packet. In this way, the second packet can no longer be forwarded through the first queue, thereby preventing the forwarding of the second packet from being affected due to the congestion of the first queue in the first device.

[0068] From the above description, it can be seen that by using the solution of the embodiment of the present application, when the first queue is congested, the service flow affected by the congestion of the first queue can be determined. And, a first operation can be performed to mitigate the impact of the congestion of the first queue on the service flow to which the first packet belongs.

[0069] As mentioned above, in addition to caching the first packet, the service parameter identifier of the first packet is also cached in the first queue. The following combines the drawings to introduce the specific implementation method for the first device to obtain a third packet including the service parameter identifier of the first packet. Refer to Figure 3 , which is a schematic flowchart of a method for obtaining a third packet provided by an embodiment of the present application. Figure 3 The method shown, for example, may be implemented through the following S201-S203.

[0070] S201: The first device obtains a second forwarding entry, and the second forwarding entry includes the parameter for forwarding the first packet.

[0071] In an embodiment of the present application, the second forwarding entry is the forwarding entry used to forward the first message. The first device may parse the first message and determine the parameters for forwarding the first message according to the parsing result and the second forwarding entry. Taking the parameter for forwarding the first message as the address prefix matching the destination IP address as an example, the first device may parse the first message to obtain the destination IP address of the first message, and then match the destination IP address with the second forwarding entry to obtain the address prefix matching the destination IP address.

[0072] S202: The first device obtains the service parameter identifier of the first message according to the corresponding relationship and the parameter for forwarding the first message. The corresponding relationship includes the service parameter identifier of the first message and the parameter for forwarding the first message.

[0073] As described above, the corresponding relationship between the service parameter identifier of the first parameter and the parameter for forwarding the first message is stored in the first device. Therefore, after the first device determines the parameter for forwarding the first message, it can determine the service parameter identifier of the first message according to this corresponding relationship.

[0074] S203: The first device obtains the third message according to the first message and the service parameter identifier of the first message.

[0075] For example, the first device obtains the third message according to the first message and the service parameter identifier of the first message. The message header of the third message includes the service parameter identifier of the first message.

[0076] It should be noted that in an embodiment of the present application, the foregoing S201 - S203 may be executed by the FE in the first device, and the step of storing the first message including the service parameter identifier may be executed by the TM. Specifically, after the FE executes S203, it may pass the third message including the foregoing service parameter identifier to the TM, and the TM further stores the third message including the foregoing service parameter identifier in the first queue.

[0077] Based on the method for obtaining forwarding information provided in the above embodiments, an embodiment of the present application further provides a corresponding device for obtaining forwarding information. The following introduces this device with reference to the accompanying drawings.

[0078] See Figure 4 , which is a schematic structural diagram of a device for obtaining forwarding information provided in an embodiment of the present application. Figure 4 The device 400 for obtaining forwarding information shown can be used to execute the method for obtaining forwarding information executed by the first device provided in the above embodiments.

[0079] Figure 4 The device 400 for obtaining forwarding information shown, for example, may include an obtaining unit 401 and a processing unit 402.

[0080] The obtaining unit 401 is configured to obtain, when the first queue is congested, a service parameter identifier of a first message buffered in the first queue, where the service parameter identifier is used to indicate a parameter for forwarding the first message; the processing unit 402 is configured to perform a first operation according to the service parameter identifier, and the first operation is used to relieve the congestion of the first queue.

[0081] In a possible implementation manner, the processing unit 402 is specifically configured to: send the service parameter identifier to a second device.

[0082] In a possible implementation manner, the processing unit 402 is further configured to: send information of the first queue to the second device, where the information of the first queue includes any one or more of the following: an identifier of the first queue, a priority of the first queue, and a buffer length of the first queue.

[0083] In a possible implementation manner, the apparatus further includes: a receiving unit, configured to receive a first message from a second device, where the first message is used to indicate sending a service parameter identifier carried in a message in a congested queue to the second device when congestion occurs.

[0084] In a possible implementation manner, the first message further includes a correspondence, where the correspondence includes the service parameter identifier and a parameter for forwarding the first message.

[0085] In a possible implementation manner, the processing unit 402 is specifically configured to: obtain a first policy according to the service parameter identifier, where the first policy is used to increase the priority of a service flow corresponding to the service parameter identifier; and send a second message through a second queue according to the first policy, where the second message is a message sent after the first message in the service flow to which the first message belongs.

[0086] In a possible implementation manner, the processing unit 402 is specifically configured to: obtain a first forwarding entry according to the service parameter identifier, where the first forwarding entry includes a correspondence between a parameter for forwarding a first message and a port, and the port is used to send a second message, where the second message is a message sent after the first message in the service flow to which the first message belongs, and the port is different from a port used to send the first message; and send the second message according to the first forwarding entry.

[0087] In a possible implementation manner, the obtaining unit 401 is specifically configured to: obtain the identifier of the service parameter from a message header of a third message, where the message header of the third message includes the identifier of the service parameter, and the third message includes the first message and the message header.

[0088] In a possible implementation, the obtaining unit 401 is further configured to: obtain a second forwarding entry, where the second forwarding entry includes parameters for forwarding the first message; obtain the service parameter identifier according to the correspondence relationship and the parameters for forwarding the first message, where the correspondence relationship includes the service parameter identifier and the parameters for forwarding the first message; obtain a third message according to the first message and the service parameter identifier of the first message. The message header of the third message includes the service parameter identifier of the first message.

[0089] In a possible implementation, the parameters for forwarding the first message include:

[0090] One or more of an address prefix, a tunnel, and tuple information that match the destination Internet Protocol (IP) address.

[0091] Since the device 400 corresponds to the steps performed by the first device provided in the foregoing method embodiment, the specific implementation of each unit of the device 400 is the same concept as the steps performed by the first device in the foregoing method embodiment. Therefore, for the specific implementation of each unit of the device 400, reference may be made to the description of the steps performed by the first device in the foregoing method embodiment, which will not be elaborated herein.

[0092] See Figure 5 , which is a schematic structural diagram of a device for obtaining forwarding information provided in an embodiment of the present application. Figure 5 The shown device 500 for obtaining forwarding information can be used to execute the method for obtaining forwarding information performed by the second device provided in the foregoing embodiment.

[0093] Figure 5 The shown device 400 for obtaining forwarding information may include, for example, a generating unit 501 and a sending unit 502.

[0094] The generating unit 501 is configured to generate a first message for instructing the first device to send the service parameter identifier carried in the congestion queue to the second device when congestion occurs in the first device; the sending unit 502 is configured to send the first message to the first device.

[0095] In a possible implementation, the first message further includes a correspondence relationship, where the correspondence relationship includes the service parameter identifier and the parameters for forwarding the first message.

[0096] In a possible implementation, the device further includes: a receiving unit, configured to receive the service parameter identifier sent by the first device, where the service identifier is used to indicate the parameters for forwarding the first message.

[0097] In a possible implementation, the device further includes: an obtaining unit, configured to obtain a path for forwarding the second packet according to the service parameter identifier, where the path for forwarding the second packet does not include the first device, and the second packet is a packet sent after the first packet in the service flow to which the first packet belongs.

[0098] Since the device 500 corresponds to the steps performed by the second device provided in the above method embodiments, the specific implementation of each unit of the device 500 is based on the same concept as the steps performed by the second device in the above method embodiments. Therefore, for the specific implementation of each unit of the device 500, reference may be made to the description of the steps performed by the second device in the above method embodiments, which will not be elaborated here.

[0099] An embodiment of the present application further provides a device for obtaining forwarding information, where the device includes: a processor and a memory; the memory is configured to store instructions; the processor is configured to execute the instructions in the memory to execute the method for obtaining forwarding information performed by the first device provided in the above method embodiments.

[0100] An embodiment of the present application further provides a device for obtaining forwarding information, where the device includes: a processor and a memory; the memory is configured to store instructions; the processor is configured to execute the instructions in the memory to execute the method for obtaining forwarding information performed by the second device provided in the above method embodiments.

[0101] It should be noted that the hardware structure of the aforementioned device for obtaining forwarding information may be as Figure 6 shown, Figure 6 which is a schematic structural diagram of a device for obtaining forwarding information provided by an embodiment of the present application.

[0102] Please refer to Figure 6 as shown, the device 600 for obtaining forwarding information includes: a processor 610, a communication interface 620, and a memory 630. The number of processors 610 in the device 600 for obtaining forwarding information may be one or more, Figure 6 and one processor is taken as an example here. In an embodiment of the present application, the processor 610, the communication interface 620, and the memory 630 may be connected through a bus system or other means. Here, Figure 6 the connection through the bus system 640 is taken as an example.

[0103] The processor 610 may be a central processing unit (CPU), a network processor (NP), or a combination of a CPU and an NP. The processor 610 may further include a hardware chip. The aforementioned hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The aforementioned PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.

[0104] The memory 630 may include volatile memory, such as random-access memory (RAM); the memory 630 may also include non-volatile memory, such as flash memory, a hard disk drive (HDD), or a solid-state drive (SSD); the memory 630 may further include a combination of the aforementioned types of memory. The memory 630 may store the correspondence between the service parameter identifier of the first message mentioned in the foregoing embodiments and the parameters for forwarding the first message.

[0105] Optionally, the memory 630 stores an operating system and programs, executable modules, or data structures, or subsets thereof, or extended sets thereof, wherein the programs may include various operation instructions for implementing various operations. The operating system may include various system programs for implementing various basic services and processing hardware-based tasks. The processor 610 may read the programs in the memory 630 to implement the method for obtaining forwarding information executed by the first device provided in the embodiments of the present application, or implement the method for obtaining forwarding information executed by the second device provided in the embodiments of the present application.

[0106] The bus system 640 can be a peripheral component interconnect (PCI) bus, an extended industry standard architecture (EISA) bus, or the like. The bus system 640 can be divided into an address bus, a data bus, a control bus, etc. For the sake of convenience of representation, Figure 6 only a thick line is used to represent it in Figure 6 , but it does not mean that there is only one bus or one type of bus.

[0107] The embodiments of the present application also provide a computer-readable storage medium, including instructions, which when running on a computer, cause the computer to execute the method for obtaining forwarding information executed by the first device provided in the above embodiments.

[0108] The embodiments of the present application also provide a computer-readable storage medium, including instructions, which when running on a computer, cause the computer to execute the method for obtaining forwarding information executed by the second device provided in the above embodiments.

[0109] The embodiments of the present application also provide a computer program product containing instructions, which when running on a computer, cause the computer to execute the method for obtaining forwarding information executed by the first device provided in the above embodiments.

[0110] The embodiments of the present application also provide a computer program product containing instructions, which when running on a computer, cause the computer to execute the method for obtaining forwarding information executed by the second device provided in the above embodiments.

[0111] Terms such as "first", "second", "third", "fourth", etc. (if any) in the specification, claims and the above-mentioned drawings of the present application are used to distinguish similar objects, and do not have to be used to describe a specific order or sequence. It should be understood that such used data can be interchanged under appropriate circumstances so that the embodiments described here can be implemented in an order different from that illustrated or described here. 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 including a series of steps or units does not have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these process, method, product or device.

[0112] 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 here.

[0113] In several embodiments provided by the present 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 units is only a logical service division. In actual implementation, there may be other division methods. 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 displayed or discussed coupling, direct coupling, or communication connection to each other can be through some interfaces, and the indirect coupling or communication connection of devices or units can be in electrical, mechanical, or other forms.

[0114] The units described as separate components may or may not be physically separated. The components displayed 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.

[0115] In addition, the business units in each embodiment of the present application can be integrated into a processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software business units.

[0116] If the integrated unit is implemented in the form of a software business unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing 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 in each embodiment of the present application. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs that can store program codes.

[0117] Those skilled in the art should be able to realize that in one or more of the above examples, the operations described in the present invention can be implemented by hardware, software, firmware, or any combination thereof. When implemented using software, these operations can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium. A computer-readable medium includes a computer storage medium and a communication medium, where the communication medium includes any medium that facilitates the transmission of a computer program from one place to another. The storage medium can be any available medium accessible by a general-purpose or special-purpose computer.

[0118] The above specific implementation manners have further elaborated on the purpose, technical solutions, and beneficial effects of the present invention. It should be understood that the above is only the specific implementation manners of the present invention.

[0119] The above, the above embodiments are only used to illustrate the technical solutions of the present application and are not intended to limit it; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments or perform equivalent replacements for some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for obtaining forwarding information, characterized in that, The method includes: When a first queue is congested, a first device obtains a service parameter identifier of a first packet from a packet header of a third packet cached in the first queue. The service parameter identifier is used to indicate a parameter for forwarding the first packet, and the parameter for forwarding the first packet is used to indicate a service flow to which the first packet belongs. Wherein: the third packet includes a packet header and the first packet, and the service parameter identifier of the first packet is located in the packet header of the third packet; The first device performs a first operation according to the service parameter identifier, and the first operation is used to relieve the congestion of the first queue; The first device performing the first operation according to the service parameter identifier includes: The first device obtains a first policy according to the service parameter identifier, and the first policy is used to increase the priority of the service flow corresponding to the service parameter identifier; the first device sends a second packet through a second queue according to the first policy, and the second packet is a packet sent after the first packet in the service flow to which the first packet belongs; Or, The first device obtains a first forwarding entry according to the service parameter identifier, and the first forwarding entry includes a correspondence between the parameter for forwarding the first packet and a port. The port is used to send a second packet, and the second packet is a packet sent after the first packet in the service flow to which the first packet belongs. The port is different from the port used to send the first packet; the first device sends the second packet according to the first forwarding entry; Wherein: the third packet is obtained in the following manner: The first device obtains a second forwarding entry, and the second forwarding entry includes a parameter for forwarding the first packet; The first device obtains the service parameter identifier according to the correspondence and the parameter for forwarding the first packet, and the correspondence includes the service parameter identifier and the parameter for forwarding the first packet; The first device obtains the third packet according to the first packet and the service parameter identifier of the first packet.

2. The method according to claim 1, wherein The method further includes: The first device sends the service parameter identifier and information of the first queue to a second device, and the information of the first queue includes any one or more of the following: an identifier of the first queue, a priority of the first queue, and a cache length of the first queue.

3. The method according to claim 2, characterized in that, The method further includes: The first device receives a first message from the second device, and the first message is used to instruct the first device to send the service parameter identifier carried in a packet in a congested queue to the second device when the first device is congested.

4. The method according to claim 3, wherein The first message further includes a correspondence, and the correspondence includes the service parameter identifier and the parameter for forwarding the first packet.

5. The method according to any one of claims 1 to 4, characterized in that The parameter for forwarding the first packet includes: One or more of an address prefix matching a destination Internet Protocol (IP) address, a tunnel, and tuple information.

6. A device for obtaining forwarding information, characterized in that, The apparatus includes: An obtaining unit, configured to obtain, when a first queue is congested, a service parameter identifier of a first packet from a packet header of a third packet cached in the first queue, where the service parameter identifier is used to indicate a parameter for forwarding the first packet, and the parameter for forwarding the first packet is used to indicate a service flow to which the first packet belongs, where: the third packet includes a packet header and the first packet, and the service parameter identifier of the first packet is located in the packet header of the third packet; A processing unit, configured to perform a first operation according to the service parameter identifier, where the first operation is used to relieve the congestion of the first queue; Specifically, the processing unit is configured to: Obtain a first policy according to the service parameter identifier, where the first policy is used to increase the priority of the service flow corresponding to the service parameter identifier; and send a second packet through a second queue according to the first policy, where the second packet is a packet sent after the first packet in the service flow to which the first packet belongs; Or Obtain a first forwarding entry according to the service parameter identifier, where the first forwarding entry includes a correspondence between the parameter for forwarding the first packet and a port, and the port is used to send a second packet, where the second packet is a packet sent after the first packet in the service flow to which the first packet belongs, and the port is different from the port used to send the first packet; and send the second packet according to the first forwarding entry; The third packet is obtained in the following manner: Obtain a second forwarding entry, where the second forwarding entry includes a parameter for forwarding the first packet; Obtain the service parameter identifier according to a correspondence and the parameter for forwarding the first packet, where the correspondence includes the service parameter identifier and the parameter for forwarding the first packet; Obtain the third packet according to the first packet and the service parameter identifier of the first packet.

7. The device according to claim 6, characterized in that, The processing unit is further configured to: Send the service parameter identifier and information of the first queue to a second device, where the information of the first queue includes any one or more of the following: an identifier of the first queue, a priority of the first queue, and a cache length of the first queue.

8. The device according to claim 7, characterized in that, The apparatus further includes: A receiving unit, configured to receive a first message from the second device, where the first message is used to indicate sending the service parameter identifier carried in a packet in a congested queue to the second device when congestion occurs.

9. The device according to claim 8, wherein The first message further includes a correspondence, where the correspondence includes the service parameter identifier and the parameter for forwarding the first packet.

10. The device according to any one of claims 6-9, characterized in that, The parameter for forwarding the first packet includes: One or more of an address prefix matching a destination Internet Protocol (IP) address, a tunnel, and tuple information.

Citation Information

Patent Citations

  • Method for relieving network congestion, core network device and access network device

    CN103907323A

  • Traffic control method and switching device

    CN108243116A

  • Congestion control methods, devices and system

    CN108667739A

  • Apparatus and method for controlling data communication

    US20100182920A1

  • User traffic accountability under congestion in flow-based multi-layer switches

    US20140192646A1