Packet loss detection method and device for forwarding chip, equipment and medium

By configuring ACL rules to obtain mod_profile ID and using mapping tables and speed limiters, the problem that traditional MOD technology cannot accurately monitor the reasons for packet loss is solved, customized packet loss detection is realized, MOD packet interference is reduced, and troubleshooting efficiency is improved.

CN120455328APending Publication Date: 2025-08-08YUNHE ZHIWANG (SHANGHAI) TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510786909.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-13
Publication Date
2025-08-08

AI Technical Summary

Technical Problem

Traditional MOD technology cannot accurately monitor the packet loss on demand, resulting in interference from operation and maintenance personnel in troubleshooting and performance optimization.

Method used

By configuring ACL rules to obtain mod_profile ID, using mapping table sets and speed limiters, custom packet loss detection for different traffic is achieved, and interference between MOD packets is reduced.

Benefits of technology

It realizes user-defined refined packet loss detection, reduces interference between MOD packets, and improves the accuracy and efficiency of troubleshooting.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120455328A_ABST
    Figure CN120455328A_ABST
Patent Text Reader

Abstract

The invention discloses a packet loss detection method and device for a forwarding chip, equipment and a medium, and the method comprises the following steps: S101, configuring a corresponding ACL rule when the MOD is carried out on the transmitted flow, and obtaining a modprofile ID of a packet loss reason according to the hit ACL rule; s102, if it is detected that the flow generates packet loss in the chip, obtaining a corresponding packet loss reason; s103, indexing to a corresponding mapping table from the mapping table set according to the modprofile ID; wherein each mapping table has N bits, and each bit represents a packet loss reason; and S104, comparing the packet loss reason obtained in the step S102 with the mapping table, if the comparison succeeds, performing MOD packaging processing on the flow to obtain an MOD message, and sending the MOD message to a collector. According to the invention, customized packet loss detection can be carried out on different flows, and interference among MOD messages is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of network technology, and in particular to a packet loss detection method, device, equipment and medium for a forwarding chip. Background Art

[0002] With the rapid development of innovative technologies such as 5G, the Internet of Things, big data, cloud computing, and artificial intelligence (AI), network data traffic is experiencing explosive growth, posing unprecedented challenges to data center networks. Intelligent and efficient O&M capabilities are crucial for ensuring stable network operation. When a network failure occurs, O&M personnel must accurately locate the fault and quickly restore service transmission.

[0003] When network transmission performance deteriorates or failures occur, packet loss is a common phenomenon and one of the main reasons for network performance degradation. Traditional network monitoring methods have difficulty capturing discarded data packets, resulting in operations and maintenance personnel being unable to accurately analyze the cause of packet loss, which in turn affects the efficiency of troubleshooting and performance optimization. MOD (Mirror On Drop) technology has emerged to detect packet loss that occurs during packet forwarding within the device. Figure 1 As shown in the figure, when packet loss occurs on node2, the device will output information such as the cause of packet loss, traffic characteristics (congestion status, queue depth, ingress port, egress port, etc.), and original messages to the collector for analysis by operation and maintenance personnel.

[0004] MOD technology can monitor specific traffic by matching message features (such as quintuple information) through ACL (Access Control List). Figure 2As shown in the figure, to capture packet loss on a device, you first need to configure which packet loss scenarios to monitor (each bit in the drop_reason_bmp_register represents a specific packet loss reason). Then, you need to configure ACL rules: match the corresponding traffic's five-tuple information and set the MOD_ENABLE action. If the data flow is dropped internally by the chip, a drop_reason (packet loss reason) is generated. This drop_reason is compared with the drop_reason configured in the drop_reason_bmp_register. If the comparison is successful and the traffic is MOD-enabled, the chip encapsulates the packet according to the configuration and sends the MOD message to the Collector. Because the packet loss monitoring register is global, all MOD-enabled traffic flows share the same packet loss monitoring configuration, making it impossible to achieve precise monitoring on demand. For example, if traffic A monitors packet loss due to route lookup failures and traffic B monitors errors due to rate limiting, if the device simultaneously limits traffic A, traffic A may generate a large number of MOD messages due to rate limiting. If the bandwidth of flow A is large, this will seriously interfere with problem location. Summary of the Invention

[0005] In view of the above problems, the embodiments of the present invention aim to provide a packet loss detection method, apparatus, device and medium for a forwarding chip to improve the above problems.

[0006] An embodiment of the present invention provides a packet loss detection method for a forwarding chip, which includes the following steps:

[0007] S101, when MOD is to be performed on the transmitted traffic, the corresponding ACL rule is configured to obtain the mod_profile ID of the packet loss cause according to the matched ACL rule;

[0008] S102, if it is detected that packet loss occurs within the chip, the corresponding packet loss cause is obtained;

[0009] S103, indexing the corresponding mapping table from the mapping table set according to the mod_profile ID; wherein each mapping table has N bits, and each bit represents a packet loss reason;

[0010] S104: Compare the packet loss reason obtained in step S102 with the mapping table. If the comparison is successful, perform MOD encapsulation on the traffic to obtain a MOD message, and send the MOD message to the collector.

[0011] Preferably, before S101, the method further includes:

[0012] When performing MOD monitoring, create a mod_profile ID based on the packet loss cause to be monitored.

[0013] Preferably, the mapping table set consists of a series of mapping tables indexed by mod_profile ID; when the bit is set to "1", it indicates that the packet loss cause is to be monitored.

[0014] Preferably, when an ACL rule is hit, the action of the ACL rule will generate a mod_profile ID; the same mod_profile ID can be used by multiple ACL rules, and one ACL rule can only use one mod_profile ID.

[0015] Preferably, each mod_profile ID also points to a speed limiter; then it also includes:

[0016] When traffic is lost inside the chip, the rate limiter is searched based on the mod_profile ID, and MOD encapsulation is performed based on the sampling ratio configured by the rate limiter.

[0017] An embodiment of the present invention further provides a packet loss detection device for a forwarding chip, which includes the following steps:

[0018] A configuration unit, configured to configure corresponding ACL rules when MOD is to be performed on the transmitted traffic, so as to obtain the mod_profile ID of the packet loss cause according to the matched ACL rules;

[0019] A packet loss detection unit is used to obtain the corresponding packet loss cause if it detects that the traffic has been lost inside the chip;

[0020] An index unit, used to index from a mapping table set to a corresponding mapping table based on a mod_profile ID; each mapping table has N bits, and each bit represents a packet loss reason;

[0021] The comparison unit is used to compare the packet loss reason obtained by the packet loss detection unit with the mapping table. If the comparison is successful, the traffic is MOD encapsulated to obtain a MOD message, and the MOD message is sent to the collector.

[0022] Preferably, when an ACL rule is hit, the action of the ACL rule will generate a mod_profile ID; the same mod_profile ID can be used by multiple ACL rules, and one ACL rule can only use one mod_profile ID.

[0023] Preferably, each mod_profile ID also points to a speed limiter; then it also includes:

[0024] The rate limiter is used to find the rate limiter based on the mod_profile ID when packet loss occurs inside the chip, and perform MOD encapsulation based on the sampling ratio configured by the rate limiter.

[0025] An embodiment of the present invention further provides a packet loss detection device for a forwarding chip, which includes a memory and a processor. The memory stores a computer program, and the computer program can be executed by the processor to implement the packet loss detection method for the forwarding chip as described above.

[0026] An embodiment of the present invention further provides a computer-readable storage medium storing a computer program. The computer program can be executed by a processor of a device where the computer-readable storage medium is located to implement the packet loss detection method for a forwarding chip as described above.

[0027] In summary, this embodiment can implement user-defined refined packet loss detection. By introducing a flexible drop_reason profile mechanism, customized packet loss detection can be performed for different traffic flows, reducing interference between MOD messages. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] In order to more clearly illustrate the technical solution of the present invention, the following briefly introduces the drawings required for use in the implementation. Obviously, the drawings described below are only some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0029] Figure 1 It is the scene graph used by the MOD.

[0030] Figure 2 This is a schematic diagram of the MOD generated in the chip.

[0031] Figure 3 It is a flowchart of a packet loss detection method for a forwarding chip provided by the first embodiment of the present invention.

[0032] Figure 4 It is a schematic diagram of the principle of the packet loss detection method for the forwarding chip provided by the first embodiment of the present invention.

[0033] Figure 5 This is a diagram of a set of mapping tables indexed by mod_profile ID.

[0034] Figure 6 This is a schematic diagram of the MOD generated in the chip after adding the speed limiter.

[0035] Figure 7This is a structural diagram of a packet loss detection method and device for a forwarding chip provided by the second embodiment of the present invention. DETAILED DESCRIPTION

[0036] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0037] See also Figure 3 and Figure 4 A first embodiment of the present invention provides a packet loss detection method for a forwarding chip. The method can be performed by a packet loss detection device for the forwarding chip (hereinafter referred to as the detection device), and in particular, by one or more processors within the detection device to implement the following steps:

[0038] S101: When MOD is to be performed on the transmitted traffic, a corresponding ACL rule is configured to obtain the mod_profile ID of the packet loss cause according to the matched ACL rule.

[0039] In this embodiment, when MOD monitoring is to be performed, a mod_profile ID must first be created according to the packet loss cause to be monitored. If a mod_profile ID for the packet loss cause has already been created, the mod_profile ID can be directly used.

[0040] S102: If it is detected that packet loss occurs in the chip, the corresponding packet loss reason is obtained.

[0041] S103, indexing the corresponding mapping table from the mapping table set according to the mod_profile ID; wherein each mapping table has N bits, and each bit represents a packet loss reason.

[0042] In this embodiment, if Figure 5As shown, the core of this embodiment is composed of a series of mapping table sets indexed by mod_profile ID, and the mapping table set has a total of M mapping tables. Each mapping table has N bits, and each bit represents a packet loss reason (drop reason). As for which drop reason each bit represents, it is determined by the system. When the bit is set to "1", it means that the drop reason is to be monitored. When MOD monitoring traffic is to be performed and an ACL rule is hit, the action of the ACL rule will generate a mod_profile ID, and then the detection device will index the corresponding mapping table based on the mod_profile ID to find the drop reason to be monitored.

[0043] In this embodiment, the same mod_profile ID can be used by multiple ACL rules, while one ACL rule can only use one mod_profile ID. This ensures accurate MOD detection and saves resources.

[0044] For example, as shown in Table 1, users can create different profile tables based on the type of packet loss to be monitored.

[0045]

[0046] S104: Compare the packet loss reason obtained in step S102 with the mapping table. If the comparison is successful, perform MOD encapsulation on the traffic to obtain a MOD message, and send the MOD message to the collector.

[0047] In the above embodiment, if another flow is to be monitored for different packet loss reasons, a different mod_profile is configured based on the drop reason to be monitored and applied to the ACL. However, if a large flow in the network experiences packet loss, a large number of MOD messages will be generated, inevitably interfering with other MODs.

[0048] To this end, in this preferred embodiment, each mod_profle ID also points to a rate limiter; when traffic generates packet loss inside the chip, the rate limiter is found according to the mod_profle ID, and MOD encapsulation is performed according to the sampling ratio configured by the rate limiter.

[0049] The sampling ratio of the rate limiter can be configured according to actual needs. For example, it can be configured as 1:1, 10:1, 100:1, 1000:1, 10000:1, etc. If it is configured as 100:1, it means that only one MOD message will be generated for every 100 packet losses, which can reduce the number of MOD messages generated by elephant flows.

[0050] The solution of this preferred embodiment is as follows Figure 6 As shown in the figure, packet loss occurs inside the chip. In addition to searching the mapping table for the drop reason using the mod_profile ID, the system also searches for the rate limiter and performs MOD encapsulation based on the sampling ratio configured by the rate limiter.

[0051] In summary, this embodiment can implement user-defined refined packet loss detection. By introducing a flexible drop_reason profile mechanism, customized packet loss detection can be performed for different traffic flows, reducing interference between MOD messages.

[0052] See also Figure 7 The second embodiment of the present invention further provides a packet loss detection device for a forwarding chip, which includes the following steps:

[0053] The configuration unit 210 is configured to configure a corresponding ACL rule when MOD is to be performed on the transmitted traffic, so as to obtain the mod_profile ID of the packet loss cause according to the matched ACL rule;

[0054] The packet loss detection unit 220 is configured to obtain the corresponding packet loss cause if it detects that packet loss has occurred within the chip;

[0055] An indexing unit 230 is configured to index a corresponding mapping table from a mapping table set according to a mod_profile ID; wherein each mapping table has N bits, and each bit represents a packet loss reason;

[0056] The comparison unit 240 is configured to compare the packet loss reason obtained by the packet loss detection unit with the mapping table. If the comparison is successful, the traffic is MOD encapsulated to obtain a MOD message, and the MOD message is sent to the collector.

[0057] Preferably, when an ACL rule is hit, the action of the ACL rule will generate a mod_profile ID; the same mod_profile ID can be used by multiple ACL rules, and one ACL rule can only use one mod_profile ID.

[0058] Preferably, each mod_profile ID also points to a speed limiter; then it also includes:

[0059] The rate limiter is used to find the rate limiter based on the mod_profile ID when packet loss occurs inside the chip, and perform MOD encapsulation based on the sampling ratio configured by the rate limiter.

[0060] An embodiment of the present invention further provides a packet loss detection device for a forwarding chip, which includes a memory and a processor. The memory stores a computer program, and the computer program can be executed by the processor to implement the packet loss detection method for the forwarding chip as described above.

[0061] An embodiment of the present invention further provides a computer-readable storage medium storing a computer program. The computer program can be executed by a processor of a device where the computer-readable storage medium is located to implement the packet loss detection method for a forwarding chip as described above.

[0062] In the several embodiments provided in the embodiments of the present invention, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device and method embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architectures, functions, and operations of the devices, methods, and computer program products according to multiple embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or part of the code, which contains one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions marked in the boxes can also occur in an order different from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, as well as the combination of boxes in the block diagram and / or flowchart, can be implemented using a dedicated hardware-based system that performs the specified functions or actions, or can be implemented using a combination of dedicated hardware and computer instructions.

[0063] In addition, the functional modules in the various embodiments of the present invention may be integrated together to form an independent part, or each module may exist independently, or two or more modules may be integrated to form an independent part.

[0064] If the functions are implemented in the form of software modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the portion that contributes to the prior art, or a portion of the 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 for causing a computer device (which can be a personal computer, electronic device, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage media include various media that can store program code, such as USB flash drives, mobile hard drives, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical disks. It should be noted that, in this document, the terms "comprise," "include," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or device that includes a series of elements includes not only those elements but also other elements not explicitly listed, or also includes elements inherent to such process, method, article, or device. Without further constraints, an element defined by the phrase "comprises a..." does not preclude the existence of additional identical elements in the process, method, article or apparatus that includes the element.

[0065] The terms used in the embodiments of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The singular forms "a", "an", "the" and "the" used in the embodiments of the present invention and the appended claims are also intended to include plural forms unless the context clearly indicates otherwise.

[0066] It should be understood that the term "and / or" as used herein is merely a description of the relationship between associated objects, indicating that three possible relationships exist. For example, "A and / or B" can represent: A exists alone, A and B exist simultaneously, or B exists alone. Furthermore, the character " / " in this document generally indicates that the associated objects are in an "or" relationship.

[0067] The word "if," as used herein, may be interpreted as "at the time of" or "when" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrases "if it is determined" or "if (stated condition or event) is detected" may be interpreted as "when it is determined" or "in response to the determination" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)," depending on the context.

[0068] The "first" and "second" mentioned in the embodiments are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It is understood that the specific order or precedence of "first" and "second" can be interchanged where appropriate. It should be understood that the objects distinguished by "first" and "second" can be interchanged where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein.

[0069] The foregoing description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Those skilled in the art will readily appreciate that various modifications and variations of the present invention are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention are intended to be within the scope of protection of the present invention.

Claims

1. A packet loss detection method for a forwarding chip, characterized in that: The following steps are involved: S101, when MOD is to be performed on the transmitted traffic, the corresponding ACL rule is configured to obtain the mod_profile ID of the packet loss cause according to the matched ACL rule; S102, if it is detected that packet loss occurs within the chip, the corresponding packet loss cause is obtained; S103, indexing the corresponding mapping table from the mapping table set according to the mod_profile ID; wherein each mapping table has N bits, and each bit represents a packet loss reason; S104: Compare the packet loss reason obtained in step S102 with the mapping table. If the comparison is successful, perform MOD encapsulation on the traffic to obtain a MOD message, and send the MOD message to the collector.

2. The packet loss detection method for a forwarding chip according to claim 1, characterized in that: Prior to S101, it also included: When performing MOD monitoring, create a mod_profile ID based on the packet loss cause to be monitored.

3. The packet loss detection method for a forwarding chip according to claim 1, wherein: The mapping table set consists of a series of mapping tables indexed by mod_profile ID; when the bit is set to "1", it means that the packet loss cause is to be monitored.

4. The packet loss detection method for a forwarding chip according to claim 3, characterized in that: When an ACL rule is matched, the action of the ACL rule generates a mod_profile ID. The same mod_profile ID can be used by multiple ACL rules, but only one mod_profile ID can be used by one ACL rule.

5. The packet loss detection method for a forwarding chip according to claim 1, characterized in that: Each mod_profile ID also points to a rate limiter; it also includes: When traffic is lost inside the chip, the rate limiter is searched based on the mod_profile ID, and MOD encapsulation is performed based on the sampling ratio configured by the rate limiter.

6. A packet loss detection device for a forwarding chip, characterized in that: The following steps are involved: A configuration unit, configured to configure corresponding ACL rules when MOD is to be performed on the transmitted traffic, so as to obtain the mod_profile ID of the packet loss cause according to the matched ACL rules; A packet loss detection unit is used to obtain the corresponding packet loss cause if it detects that the traffic has been lost inside the chip; An index unit, used to index from a mapping table set to a corresponding mapping table based on a mod_profile ID; each mapping table has N bits, and each bit represents a packet loss reason; The comparison unit is used to compare the packet loss reason obtained by the packet loss detection unit with the mapping table. If the comparison is successful, the traffic is MOD encapsulated to obtain a MOD message, and the MOD message is sent to the collector.

7. The packet loss detection device for a forwarding chip according to claim 6, characterized in that: When an ACL rule is matched, the action of the ACL rule generates a mod_profile ID. The same mod_profile ID can be used by multiple ACL rules, but only one mod_profile ID can be used by one ACL rule.

8. The packet loss detection device for a forwarding chip according to claim 6, characterized in that: Each mod_profile ID also points to a rate limiter; it also includes: The rate limiter is used to find the rate limiter based on the mod_profile ID when packet loss occurs inside the chip, and perform MOD encapsulation based on the sampling ratio configured by the rate limiter.

9. A packet loss detection device for a forwarding chip, characterized in that: It includes a memory and a processor, wherein the memory stores a computer program, and the computer program can be executed by the processor to implement the packet loss detection method for the forwarding chip according to any one of claims 1 to 5.

10. A computer-readable storage medium, characterized in that A computer program is stored, and the computer program can be executed by a processor of the device where the computer-readable storage medium is located to implement the packet loss detection method for the forwarding chip according to any one of claims 1 to 5.