A method and device for monitoring packet loss, electronic equipment and storage medium
By parsing and searching the MOD table, the five-tuple information of VXLAN and NVGRE tunnel packets can be flexibly extracted, solving the problem of inaccurate user traffic location in existing technologies and achieving accurate packet loss monitoring.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SUZHOU CENTEC COMM CO LTD
- Filing Date
- 2022-10-19
- Publication Date
- 2026-06-02
AI Technical Summary
In existing technologies, packet loss monitoring for VXLAN and NVGRE tunnel packets cannot accurately pinpoint the traffic of different users, resulting in inaccurate packet loss monitoring.
By parsing the outer and inner five-tuple information of the packet, and combining it with tunnel type, forwarding type and encapsulation mark information, the MOD table is searched to determine whether the packet needs to be sent to the MOD engine for processing, and the five-tuple information is extracted flexibly to achieve accurate monitoring.
It enables precise monitoring of user packet loss in different scenarios and can flexibly extract packet 5-tuple information according to the scenario, thereby improving the accuracy of packet loss monitoring.
Smart Images

Figure CN115665011B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of network communication technology, and in particular to a method for flexibly monitoring packet loss in various traffic scenarios, as well as a device, electronic device, and storage medium for implementing the method. Background Technology
[0002] MOD (Monitor On Drop) can be used to detect packet loss during the internal forwarding process of packets within a device. For example... Figure 1 As shown, Export device A and Export device B are configured with MOD function, which is connected to the collector for packet loss detection of network flow. When packet loss occurs, the MOD function outputs the characteristics of the lost traffic, the cause of the loss, the packet loss count, and the lost sample packets to the collector.
[0003] MOD is a flow-based packet loss monitoring system. When a device configured with MOD receives a packet, the packet is processed by the ASIC chip. If packet loss occurs, MOD flow information is generated in the MOD engine, and this information, along with the sampled packet, is reported to the CPU via DMA.
[0004] After receiving the MOD stream information and sampling packets, the CPU reorganizes the data and sends packets in standard MOD format to the collector. For example... Figure 2As shown, the ASIC chip includes an inbound processing module, an outbound processing module, and a scheduling module connecting the two. In specific implementation, when the inbound processing module receives a message, if the message is lost, it will send the message information to the MOD engine for processing. In the MOD engine, MOD stream information will be generated and reported to the CPU. If the message is lost during inbound processing, it will not be sent to the scheduling and outbound processing. During outbound processing, if the message is lost, it will also be sent to the MOD engine for processing. In the MOD engine, MOD stream information will be generated and reported to the CPU. The MOD flow information here includes a Key and a Record. The Key identifies the data flow characteristics. Packets with the same data flow characteristics are automatically identified as belonging to the same Flow. (For example, when an Export device receives a data packet, it passes through the MOD engine of the ASIC chip. If the packet is dropped, the engine extracts the Key information of the packet and searches for a Flow with the same Key. If not found, it means the packet belongs to a new Flow, and a Flow with that Key is generated; if found, it means the packet belongs to an existing Flow, and the Flow's Record information is updated.) This data flow characteristic information typically uses the packet's six-tuple information, such as source IP address, destination IP address, TCP / UDP source port, TCP / UDP destination port, Layer 3 protocol type, and forwarding domain (VLAN / VRF). The Record is used to record packet loss reasons, packet loss counts, etc.
[0005] In practical applications, for the same Export device, multiple traffic scenarios may exist simultaneously, each with different MOD requirements. For example, for Layer 2 forwarding, VLANs are used as the forwarding domain; for Layer 3 forwarding, VRFs are used; for ordinary Layer 2 and 3 forwarding, the packet's 5-tuple information is directly extracted; and so on. Figure 3 As shown, for tunnel packets like VXLAN and NVGRE, user packets are encapsulated within a tunnel, requiring the extraction of the inner packet's 5-tuple information. Furthermore, the information extracted differs between the inbound and outbound directions for tunnel encapsulation and decapsulation scenarios. However, current technologies uniformly use the outer 5-tuple information and forwarding domain as the Flow Key when monitoring packet loss. But for tunnel packets like VXLAN and NVGRE, multiple users' traffic may be encapsulated with the same tunnel header, making it impossible to differentiate between different user traffic using the outer 5-tuple. This results in MOD (Multi-Option Distributed Detection) failing to accurately pinpoint the user experiencing packet loss.
[0006] The information disclosed in this background section is intended only to enhance the understanding of the overall background of the invention and should not be construed as an admission or in any way implying that the information constitutes prior art known to those skilled in the art. Summary of the Invention
[0007] The purpose of this invention is to provide a method for monitoring packet loss, which can flexibly extract packet 5-tuple information for different scenarios, so as to accurately monitor the packet loss situation of users.
[0008] To achieve the above objectives, embodiments of the present invention provide a method for monitoring packet loss, including an inbound packet loss monitoring method, wherein the inbound packet loss monitoring method includes:
[0009] Receive and parse the message to obtain the first outer 5-tuple information and the first tunnel type marker information;
[0010] Determine whether the message needs to be decapsulated, and select to decapsulate the message according to the determination result. Further parse to obtain the first inner five-tuple information and obtain the decapsulation mark information, or determine whether the message is a tunnel message. If it is a tunnel message, parse to obtain the first inner five-tuple information and obtain the decapsulation mark information. If it is a non-tunnel message, obtain the default decapsulation mark information.
[0011] Determine whether the destination MAC address of the packet is the local router's MAC address, and based on the determination result, look up the FDB table or routing table to obtain the corresponding forwarding type marking information and encapsulation marking information;
[0012] The first MOD table is searched based on the first tunnel type marking information, decapsulation marking information, forwarding type marking information, and encapsulation marking information to determine whether the packet needs to be sent to the MOD engine for processing and the first input engine information. The first input engine information includes scene marking information, forwarding domain information, and one of the first outer quintuple information and the first inner quintuple information.
[0013] In one or more embodiments of the present invention, the tunnel type marking information is determined according to the message type, wherein when the message is a normal message, the tunnel type marking information is none; when the message is an encapsulated message, the tunnel type marking information is the corresponding encapsulation type.
[0014] In one or more embodiments of the present invention, determining whether a message needs to be decapsulated includes:
[0015] Look up the tunnel table, and if the tunnel is found, determine that the packet needs to be decapsulated; if the tunnel is not found, determine that the packet does not need to be decapsulated.
[0016] In one or more embodiments of the present invention, the decapsulation marking information is a first preset value when the message needs to be decapsulated, and a second preset value when the message does not need to be decapsulated.
[0017] In one or more embodiments of the present invention, when the destination MAC address is the local routing MAC address, the FDB table is searched, and the forwarding type marking information and encapsulation marking information obtained when searching the FDB table are respectively a first type, a first preset value, or a second preset value;
[0018] When the destination MAC address is not the local route MAC address, the routing table is looked up, and the forwarding type tag information and encapsulation tag information obtained during the routing table lookup are the second type, the first preset value, or the second preset value, respectively.
[0019] In one or more embodiments of the present invention, determining whether a message needs to be sent to the MOD engine for processing and the first information to be sent to the engine includes:
[0020] Locate the first MOD entry, and if found, determine the message that needs to be sent to the MOD engine for processing and the first input engine information.
[0021] In one or more embodiments of the present invention, the MOD engine generates MOD stream information and reports it to the CPU, the MOD stream information including the scene marking information.
[0022] In one or more embodiments of the present invention, the method further includes an outbound packet loss monitoring method, the outbound packet loss monitoring method comprising:
[0023] Receive and parse messages, and edit messages based on the parsing results;
[0024] The edited message is parsed to obtain the second outer quintuple information and the second tunnel type marker information;
[0025] Determine whether the message is a tunnel message, and if it is a tunnel message, parse it to obtain the second inner 5-tuple information;
[0026] Based on the second tunnel type marking information, as well as the decapsulation marking information, forwarding type marking information, encapsulation marking information, and scenario marking information carried from the inbound direction to the outbound direction, the second MOD table is searched to determine whether the packet needs to be sent to the MOD engine for processing and the second sending engine information. The second sending engine information includes forwarding domain information, as well as one of the second outer quintuple information and the second inner quintuple information.
[0027] In one or more embodiments of the present invention, the outgoing packet loss monitoring method supports an associated mode or an independent mode. The associated mode is in which the first MOD table and the second MOD table are associated with each other through scene tagging information, and the independent mode is in which the second MOD table is independent of the first MOD table.
[0028] The present invention also discloses a packet loss monitoring device, the device including an incoming packet loss monitoring module, the incoming packet loss monitoring module comprising:
[0029] Incoming direction processing module one is used to receive and parse messages to obtain the first outer 5-tuple information and the first tunnel type marker information;
[0030] The second inbound processing module is used to determine whether a message needs to be decapsulated, and select to decapsulate the message according to the determination result. It further parses to obtain the first inner five-tuple information and obtains the decapsulation mark information, or determines whether the message is a tunnel message. If it is a tunnel message, it parses to obtain the first inner five-tuple information and obtains the decapsulation mark information. If it is a non-tunnel message, it obtains the default decapsulation mark information.
[0031] The third inbound processing module is used to determine whether the destination MAC address of the packet is the local routing MAC address, and based on the determination result, to look up the FDB table or routing table to obtain the corresponding forwarding type marking information and encapsulation marking information;
[0032] The inbound MOD processing module is used to look up the first MOD table based on the first tunnel type marking information, decapsulation marking information, forwarding type marking information and encapsulation marking information, to determine whether the packet needs to be sent to the MOD engine for processing and the first inbound engine information. The first inbound engine information includes scene marking information, forwarding domain information, and one of the first outer 5-tuple information and the first inner 5-tuple information.
[0033] In one or more embodiments of the present invention, the device further includes an outgoing packet loss monitoring module, the outgoing packet loss monitoring module comprising:
[0034] Outgoing direction processing module one is used to receive and parse messages, and edit messages based on the parsing results;
[0035] Outgoing direction processing module two is used to parse the edited message and obtain the second outer five-tuple information and the second tunnel type marking information;
[0036] Outgoing direction processing module three is used to determine whether a message is a tunnel message, and if it is a tunnel message, it is parsed to obtain the second inner five-tuple information;
[0037] The outgoing MOD processing module is used to look up the second MOD table based on the second tunnel type marking information, decapsulation marking information, forwarding type marking information, encapsulation marking information, and scenario marking information to determine whether the packet needs to be sent to the MOD engine for processing and the second input engine information. The second input engine information includes forwarding domain information, as well as one of the second outer 5-tuple information and the second inner 5-tuple information.
[0038] The present invention also discloses an electronic device comprising:
[0039] At least one processor;
[0040] At least one memory is coupled to the at least one processor and stores a computer program for execution by the at least one processor, which, when executed by the at least one processor, causes the electronic device to perform the method described above.
[0041] The present invention also discloses a computer-readable storage medium having a computer program stored thereon, which, when executed by a machine, implements the method described above.
[0042] Compared with the prior art, the present invention can flexibly extract packet 5-tuple information for different scenarios, so as to accurately monitor user packet loss. Attached Figure Description
[0043] Figure 1 This is a diagram of MOD networking;
[0044] Figure 2 This is a flowchart of MOD processing in existing technology;
[0045] Figure 3 This is a schematic diagram of the structure and encapsulation / decapsulation of VXLAN tunnel messages and NVGRE tunnel messages;
[0046] Figure 4 This is a flowchart of an inbound packet loss monitoring method according to an embodiment of the present invention;
[0047] Figure 5 This is a flowchart of an outbound packet loss monitoring method according to an embodiment of the present invention;
[0048] Figure 6 This is a flowchart of MOD processing according to an embodiment of the present invention;
[0049] Figure 7 This is a structural block diagram of a packet loss monitoring device according to an embodiment of the present invention. Detailed Implementation
[0050] The specific embodiments of the present invention will now be described in detail with reference to the accompanying drawings, but it should be understood that the scope of protection of the present invention is not limited to the specific embodiments.
[0051] Unless otherwise expressly stated, throughout the specification and claims, the term "comprising" or its variations such as "including" or "comprises" shall be understood to include the stated elements or components without excluding other elements or other components.
[0052] Combination Figure 4 and Figure 6 As shown, a packet loss monitoring method according to a preferred embodiment of the present invention can flexibly extract packet 5-tuple information for different scenarios, so as to accurately monitor user packet loss. The following uses... Figure 1 The network topology shown illustrates the method described in this invention in detail. This network topology includes a host, a host, at least one output device connected between host 1 and host 2, and a collector communicatively connected to each output device. Host 1 and host 2 transmit traffic to each other; the output device performs packet loss detection on the data flow. When packet loss occurs, the characteristics of the lost traffic, the cause of the loss, the packet loss count, and sample packets are transmitted to the collector. The collector parses the data packets (MODs) transmitted by the output device to collect the data in a database for user viewing. The packet loss monitoring method described in this invention can be applied to the output device in this network topology, enabling it to flexibly extract packet 5-tuple information for different scenarios, facilitating accurate monitoring of user packet loss. This packet loss monitoring method includes an inbound packet loss monitoring method, which can be implemented through the cooperation of an inbound processing module and a MOD engine. The inbound packet loss monitoring method includes the following steps:
[0053] S1, Receive and parse the message to obtain the first outer quintuple information and the first tunnel type marker information;
[0054] Specifically, MOD (Monitor On Drop) detects packet loss during the forwarding process within the output device. When packet loss occurs, the output device sends the cause of the loss and the characteristics (i.e., packet information) of the dropped packet to the collector. To flexibly extract packet 5-tuple information for different scenarios and accurately monitor user packet loss, the output device's inbound processing module first parses the received packet's Layer 2, Layer 3, and Layer 4 protocol headers to obtain the corresponding outer 5-tuple information and the first tunnel type marker (TunnelType) information (e.g., ...). Figure 6(The first message parsing shown). The first tunnel type marker information here can be determined based on the message type, which is obtained through message parsing. For non-tunnel messages, such as messages that have not undergone VxLAN tunnel encapsulation or NvGRE tunnel encapsulation, the tunnel type marker information is none. For tunnel messages, such as messages that have undergone VxLAN tunnel encapsulation or NvGRE tunnel encapsulation, the tunnel type marker information is the corresponding encapsulation type. For example, for messages that have undergone VxLAN tunnel encapsulation, the tunnel type marker information is vxlan; for messages that have undergone NvGRE tunnel encapsulation, the tunnel type marker information is nvgre.
[0055] S2, determine whether the message needs to be decapsulated, and select to decapsulate the message according to the judgment result, further parse to obtain the first inner five-tuple information and obtain the decapsulation mark information, or determine whether the message is a tunnel message, and if it is a tunnel message, parse to obtain the first inner five-tuple information and obtain the decapsulation mark information, and if it is a non-tunnel message, obtain the default decapsulation mark information;
[0056] Specifically, after obtaining the first outer 5-tuple information and the first tunnel type marker information, it is further determined whether the packet needs to be decapsulated. In implementation, this can be done by looking up a tunnel table, which contains information about tunnel packets. If the packet is found in the tunnel table (i.e., a result is found), then the packet needs to be decapsulated; if the packet is not found in the tunnel table, then the packet does not need to be decapsulated.
[0057] When it is determined that a message does not require decapsulation, it is then determined whether the message is a tunnel message. If it is a tunnel message, the first inner five-tuple information and decapsulation flag information are obtained through parsing. If it is a non-tunnel message, the default decapsulation flag information is obtained. When it is determined that a message requires decapsulation, the message is decapsulated and parsed (e.g., ...). Figure 6 The process described involves message decapsulation and secondary parsing, such as stripping the tunnel encapsulation header and determining the decapsulation (Decap) flag information. In this invention, for messages that do not require decapsulation, the decapsulation (Decap) flag information is a first preset value; for messages that require decapsulation, the decapsulation (Decap) flag information is a second preset value, such as the first preset value being 0 and the second preset value being 1. Of course, in other embodiments, the first preset value can also be 1 and the second preset value can be 0, and can be set according to actual needs.
[0058] S3, determine whether the destination MAC address of the packet is the local routing MAC address, and based on the determination result, look up the FDB table or routing table to obtain the forwarding type marking information and encapsulation marking information;
[0059] Specifically, after obtaining the decapsulation (Decapsulation) tag information, it further determines whether the destination MAC address of the packet matches the local router's MAC address. If the destination MAC address matches the local router's MAC address, it indicates that the packet is a Layer 3 forwarding packet. Then, the information carried by the packet can be used to look up the routing table (Route) to obtain the corresponding forwarding type tag information and encapsulation (Encapsulation) tag information. The routing table (Route) is configured with a mapping relationship between packet information and forwarding type tag information and decapsulation tag information (e.g., ...). Figure 6 (The forwarding process is shown below). The Layer 3 forwarding packets here include ordinary Layer 3 forwarding packets, VxLAN Layer 3 traversing packets, NvGRE Layer 3 traversing packets, VxLAN Layer 3 decapsulation forwarding packets, NvGRE Layer 3 decapsulation forwarding packets, VxLAN Layer 3 encapsulation forwarding packets, and NvGRE Layer 3 encapsulation forwarding packets. For ordinary Layer 3 forwarding packets, VxLAN Layer 3 traversing packets, NvGRE Layer 3 traversing packets, VxLAN Layer 3 decapsulation forwarding packets, and NvGRE Layer 3 decapsulation forwarding packets, the corresponding forwarding type label is Layer 3 (L3), and the encapsulation label is a first preset value (e.g., 0). For VxLAN Layer 3 encapsulation forwarding packets and NvGRE Layer 3 encapsulation forwarding packets, the corresponding forwarding type label is Layer 3 (L3), and the encapsulation label is a second preset value (e.g., 1).
[0060] When the destination MAC address of a packet does not match the local router's MAC address, it indicates that the packet is a Layer 2 forwarding packet. The information carried in the packet can then be used to look up the Forwarding Database (FDB) table to obtain the corresponding forwarding type flag and decapsulation flag information. The FDB table contains a mapping relationship between packet information and forwarding type flag and decapsulation flag information (e.g., ...). Figure 6(The forwarding process is shown below). The Layer 2 forwarding packets here include ordinary Layer 2 forwarding packets, VxLAN Layer 2 transit forwarding packets, NvGRE Layer 2 transit forwarding packets, VxLAN Layer 2 decapsulation forwarding packets, NvGRE Layer 2 decapsulation forwarding packets, VxLAN Layer 2 encapsulation forwarding packets, and NvGRE Layer 2 encapsulation forwarding packets. For ordinary Layer 2 forwarding packets, VxLAN Layer 2 transit packets, NvGRE Layer 2 transit packets, VxLAN Layer 2 decapsulation forwarding packets, and NvGRE Layer 2 decapsulation forwarding packets, the corresponding forwarding type label is Layer 2 (L2), and the encapsulation label is a first preset value (e.g., 0). For VxLAN Layer 2 encapsulation forwarding packets and NvGRE Layer 2 encapsulation forwarding packets, the corresponding forwarding type label is Layer 2 (L2), and the encapsulation label is a second preset value (e.g., 1).
[0061] S4. Based on the first tunnel type marking information, decapsulation marking information, forwarding type marking information and encapsulation information, look up the first MOD table to determine whether the packet needs to be sent to the MOD engine for processing and the first input engine information. The first input engine information includes scene marking information, forwarding domain information, and one of the first outer 5-tuple information and the first inner 5-tuple information.
[0062] Specifically, after obtaining the first tunnel type marker information, decapsulation marker information, forwarding type marker information, and encapsulation marker information through steps S1 to S3, the first MOD table is further searched to determine whether the packet needs to be sent to the MOD engine for processing and the first input engine information (such as...). Figure 6 The MOD processing described above. The first MOD table here is configured with a mapping relationship between Key information and Data information. The Key information includes the first tunnel type marker, decapsulation marker, forwarding type marker, and encapsulation marker. The Data information includes whether the packet is sent to the MOD engine for processing, the six-tuple information, and the scene marker information. The first information sent to the engine includes the six-tuple information corresponding to the packet and the scene marker information (Scene). The scene marker information differs for different scenes, as shown in the table below:
[0063]
[0064] As shown in the table above, for a normal Layer 2 forwarding packet, the corresponding tunnel type marker, decapsulation marker, forwarding type marker, and encapsulation information are none, L2, 0, and 0, respectively. By looking up the MOD table, it can be determined that the normal Layer 2 forwarding packet needs to be sent to the MOD engine for processing. The information sent includes the six-tuple information (VLAN + outer five-tuple information) and the scene marker information (this value is 1).
[0065] S5 determines whether the message needs to be discarded, and based on the result, generates the first MOD stream information and reports it to the CPU, or skips the MOD engine processing.
[0066] Specifically, for messages that need to be sent to the MOD engine for processing, the MOD engine determines whether the received message needs to be dropped. Messages that need to be dropped are configured with a drop flag, while messages that do not need to be dropped are not configured with a drop flag. Therefore, the drop flag can be used to determine whether a message needs to be dropped.
[0067] For packets that need to be discarded, i.e., packets configured with a discard flag, the MOD engine generates a corresponding first MOD stream information for that packet and sends it to the CPU for processing. This first MOD stream information not only records the packet information but also includes scene marker information to help the CPU identify the corresponding scene for subsequent processing. In practice, the MOD stream information is preferably sent directly to the CPU via DMA.
[0068] For messages that do not need to be dropped, i.e., messages that are not configured to be dropped, the MOD engine skips the processing and does not process the message.
[0069] Combination Figure 5 and Figure 6 As shown, the packet loss monitoring method also includes an outbound packet loss monitoring method. This outbound packet loss monitoring method can be implemented through the cooperation of the outbound processing module and the MOD engine. Simultaneously, the outbound processing module receives decapsulation marker information, forwarding type marker information, encapsulation marker information, and scene marker information obtained from the inbound processing module for subsequent use in outbound packet loss monitoring. The outbound packet loss monitoring method includes the following steps:
[0070] S1' receives and parses the message, and edits the message based on the parsing result;
[0071] Specifically, after receiving the message, the outgoing processing module performs routine editing operations on the message (such as...). Figure 6 The first message parsing operation in the outgoing processing module (shown here) is for parsing the received message. In practice, the parsed message information can be used to look up the corresponding entry to determine the message editing information. This message editing information identifies what editing operation is performed on the message, such as whether encapsulation is added. Once the message editing information is determined, further editing operations are performed (e.g., ...). Figure 6 The message editing operation shown in the outgoing processing module is for editing messages based on the parsing results.
[0072] S2' parses the edited message to obtain the second outer quintuple information and the second tunnel type marker information;
[0073] Specifically, after the message editing is completed, the message is further parsed to obtain the corresponding second quintuple information and second tunnel type marker information (such as...). Figure 6 The second message parsing in the outgoing processing module is used to parse the edited message and obtain the second outer 5-tuple information and the second tunnel type marker information. The second tunnel type marker information can be determined based on the message type, which is obtained through message parsing. For non-tunnel messages, such as messages that have not undergone VxLAN tunnel encapsulation or NvGRE tunnel encapsulation, the tunnel type marker information is none. For tunnel messages, such as messages that have undergone VxLAN tunnel encapsulation or NvGRE tunnel encapsulation, the tunnel type marker information is the corresponding encapsulation type. For example, for messages that have undergone VxLAN tunnel encapsulation, the tunnel type marker information is vxlan (Virtual Local Area Network); for messages that have undergone NvGRE tunnel encapsulation, the tunnel type marker information is nvgre.
[0074] S3' determines whether the message is a tunnel message, and if it is a tunnel message, it is parsed to obtain the second inner 5-tuple information;
[0075] Specifically, after obtaining the second outer 5-tuple information and the second tunnel type marker information, it is further determined whether the message is a tunnel message. In practice, this can be determined by parsing the message. When it is determined that the message is a tunnel message, the message is decapsulated, such as stripping the tunnel encapsulation header, and the second inner 5-tuple information is obtained (e.g., ...). Figure 6 The third message parsing operation in the outgoing direction processing module shown is used to determine whether the message is a tunnel message, and to decapsulate and parse the message according to the determination result to obtain the second inner quintuple information.
[0076] S4': Based on the second tunnel type marking information and the decapsulation marking information, forwarding type marking information, encapsulation marking information, and scene marking information carried from the inbound direction to the outbound direction, look up the second MOD table to determine whether the packet needs to be sent to the MOD engine for processing and the second sending engine information. The second sending engine information includes forwarding domain information and one of the second outer 5-tuple information and the second inner 5-tuple information.
[0077] Specifically, after obtaining the second tunnel type marking information through steps S1' to S3', the second tunnel type marking information, along with the aforementioned decapsulation marking information, forwarding type marking information, encapsulation marking information, and scenario marking information, is used to look up the second MOD table to determine whether the packet needs to be sent to the MOD engine for processing and the second input engine information (such as...). Figure 6(The MOD processing operation in the outbound processing module is shown). The second MOD table here is configured with a mapping relationship between Key information and Data information. The Key information includes tunnel type marker information, decapsulation marker information, forwarding type marker information, and encapsulation information. The Data information includes whether the packet is sent to the MOD engine for processing and the second input engine information. The second input engine information includes the six-tuple information corresponding to the packet and the scene marker information. The scene marker information is different for different scenes. This second MOD table is described below.
[0078]
[0079] Of course, in other embodiments, the second MOD table for the outgoing direction can adopt the following second MOD table entry, in which the incoming and outgoing directions are concerned with the same scene and are related to each other through scene tag information. The key information of the MOD table entry is the scene tag information:
[0080]
[0081] The MOD table described in this invention can be configured according to actual needs, flexibly selecting whether to perform MOD monitoring on traffic in corresponding scenarios. Furthermore, the use of outer or inner five-tuple information and scenario tagging information can be flexibly configured and selected according to actual requirements. It also supports inbound and outbound direction association configuration, that is, associating inbound and outbound MOD flow information through scenario tagging information, enabling the outbound packet loss monitoring method to support an association mode. In this association mode, the first MOD table and the second MOD table are mutually associated through scenario tagging information. Alternatively, an independent mode can also be supported, where the second MOD table is independent of the first MOD table; that is, the outbound packet loss monitoring method only uses the second MOD table.
[0082] S5' determines whether the message needs to be discarded, and based on the result, generates a second MOD stream and reports it to the CPU, or skips the MOD engine processing.
[0083] Specifically, for messages that need to be sent to the MOD engine for processing, the MOD engine determines whether the received message needs to be dropped. Messages that need to be dropped are configured with a drop flag, while messages that do not need to be dropped are not configured with a drop flag. Therefore, the drop flag can be used to determine whether a message needs to be dropped.
[0084] For packets that need to be discarded, i.e., packets configured with a discard flag, the MOD engine generates a corresponding second MOD stream and sends it to the CPU for processing. This second MOD stream records the packet information for subsequent processing. In practice, the MOD stream information is preferably sent directly to the CPU via DMA.
[0085] For messages that do not need to be dropped, i.e., messages that are not configured to be dropped, the MOD engine skips the processing and does not process the message.
[0086] Furthermore, after the CPU receives the reported information, it associates the traffic with the same six-tuple and scene tag information in the two inbound and outbound directions and considers them as the same traffic, which makes it convenient for users to monitor packet loss information.
[0087] like Figure 7 As shown, this invention also discloses a packet loss monitoring device, including an inbound packet loss monitoring module, which can implement the aforementioned inbound packet loss monitoring method. This module includes an inbound processing module one, an inbound processing module two, an inbound processing module three, an inbound MOD processing module, and an inbound MOD engine module. Specifically, the inbound processing module one receives and parses packets to obtain the first outer 5-tuple information and the first tunnel type marker information; the inbound processing module two determines whether a packet needs to be decapsulated, and selects to decapsulate the packet based on the determination result, further parsing to obtain the first inner 5-tuple information and decapsulation marker information, or determines whether the packet is a tunnel packet, and if it is a tunnel packet, parses to obtain the first inner 5-tuple information and decapsulation marker information, and if it is a non-tunnel packet, obtains the default decapsulation marker information; the inbound processing module three determines the destination M of the packet. The system checks whether the AC address is the local router's MAC address and, based on the result, searches the FDB table or routing table to obtain the corresponding forwarding type marker information and encapsulation marker information. The inbound MOD processing module searches the first MOD table based on the first tunnel type marker information, decapsulation marker information, forwarding type marker information, and encapsulation marker information to determine whether the packet needs to be sent to the MOD engine for processing and to obtain the first inbound engine information. The first inbound engine information includes scenario marker information, forwarding domain information, and one of the first outer 5-tuple information and the first inner 5-tuple information. The inbound packet loss monitoring module also includes an inbound MOD engine module, which determines whether the packet carries a drop marker and, based on the result, generates first MOD flow information and reports it to the CPU, or skips MOD engine processing.
[0088] Furthermore, the packet loss monitoring device also includes an outbound packet loss monitoring module, which can implement the outbound packet loss monitoring method described above. This module includes an outbound processing module one, an outbound processing module two, an outbound processing module three, an outbound MOD processing module, and an outbound MOD engine module. Specifically, the outbound processing module one receives and parses packets, and edits the packets based on the parsing results; the outbound processing module two parses the edited packets to obtain the second outer 5-tuple information and the second tunnel type marker information; the outbound processing module three determines whether a packet is a tunnel packet, and if so, parses it to obtain the second inner 5-tuple information; the outbound MOD processing module searches the second MOD table based on the second tunnel type marker information, decapsulation marker information, forwarding type marker information, encapsulation marker information, and scenario marker information to determine whether the packet needs to be sent to the MOD engine for processing and to obtain the second input engine information. The second input engine information includes forwarding domain information, and one of the second outer 5-tuple information and the second inner 5-tuple information.
[0089] How each module implements the above functions is detailed above and will not be repeated here.
[0090] The electronic device disclosed in one embodiment of the present invention may include, but is not limited to, personal computers, server computers, workstations, desktop computers, laptop computers, notebook computers, mobile electronic devices, smartphones, tablet computers, cellular phones, personal digital assistants (PDAs), handheld devices, messaging devices, wearable electronic devices, consumer electronic devices, etc. This electronic device can implement the packet loss monitoring method described above, and can flexibly extract packet 5-tuple information for different scenarios to facilitate accurate monitoring of user packet loss. Specifically, the electronic device includes at least one memory, at least one processor, and a computer program. The at least one memory is coupled to the at least one processor, wherein the computer program is stored in the memory and can be run in the processor, such as a packet loss monitoring program. In implementation, when the processor executes the computer program, it can implement various steps in the above method, such as receiving and parsing packets to obtain first outer 5-tuple information and first tunnel type marker information, etc.
[0091] The computer program here can be divided into one or more units, which are stored in the memory and executed by the memory to complete the present invention. The one or more units may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program in the electronic device.
[0092] It should be noted that the electronic devices mentioned here include, but are not limited to, the memory, processor, and computer program described above. They may also include other devices, such as input devices (e.g., keyboards) for inputting predictive information, communication interfaces, etc. These components communicate with each other via a bus.
[0093] This invention also discloses a computer-readable storage medium storing a computer program that, when executed by a processor, can implement the aforementioned packet loss monitoring method. The computer program includes computer program code, which can be in the form of source code, an executable file, or some intermediate form. The computer-readable medium can include any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), etc.
[0094] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0095] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0096] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0097] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0098] The foregoing description of specific exemplary embodiments of the invention is for illustrative and explanatory purposes. These descriptions are not intended to limit the invention to the precise forms disclosed, and it will be apparent that many changes and variations can be made in accordance with the foregoing teachings. The exemplary embodiments were chosen and described in order to explain the specific principles of the invention and its practical application, thereby enabling those skilled in the art to implement and utilize various different exemplary embodiments of the invention, as well as various different choices and variations. The scope of the invention is intended to be defined by the claims and their equivalents.
Claims
1. A method for monitoring packet loss, characterized in that, This includes an inbound packet loss monitoring method, which includes: Receive and parse the message to obtain the first outer 5-tuple information and the first tunnel type marker information; Determine whether the message needs to be decapsulated, and select to decapsulate the message according to the determination result. Further parse to obtain the first inner five-tuple information and obtain the decapsulation mark information, or determine whether the message is a tunnel message. If it is a tunnel message, parse to obtain the first inner five-tuple information and obtain the decapsulation mark information. If it is a non-tunnel message, obtain the default decapsulation mark information. Determine whether the destination MAC address of the packet is the local router's MAC address, and based on the determination result, look up the FDB table or routing table to obtain the corresponding forwarding type marking information and encapsulation marking information; The first MOD table is searched based on the first tunnel type marking information, decapsulation marking information, forwarding type marking information, and encapsulation marking information to determine whether the packet needs to be sent to the MOD engine for processing and the first input engine information. The first input engine information includes scene marking information, forwarding domain information, and one of the first outer quintuple information and the first inner quintuple information.
2. The method as described in claim 1, characterized in that, The first tunnel type marking information is determined according to the message type. When the message is a normal message, the first tunnel type marking information is none; when the message is a tunnel message, the first tunnel type marking information is the corresponding tunnel type.
3. The method as described in claim 1, characterized in that, The process of determining whether a message needs to be decapsulated includes: Look up the tunnel table, and if the tunnel is found, determine that the packet needs to be decapsulated; if the tunnel is not found, determine that the packet does not need to be decapsulated.
4. The method as described in claim 1, characterized in that, The decapsulation marker information is a first preset value when the message needs to be decapsulated, and a second preset value when the message does not need to be decapsulated.
5. The method as described in claim 1, characterized in that, When the destination MAC address is the local router's MAC address, the FDB table is searched, and the forwarding type tag information and encapsulation tag information obtained when searching the FDB table are the first type, the first preset value, or the second preset value, respectively. When the destination MAC address is not the local route MAC address, the routing table is looked up, and the forwarding type tag information and encapsulation tag information obtained during the routing table lookup are the second type, the first preset value, or the second preset value, respectively.
6. The method as described in claim 1, characterized in that, Determining whether a message needs to be sent to the MOD engine for processing and the first information sent to the engine includes: Locate the first MOD entry, and if found, determine the message that needs to be sent to the MOD engine for processing and the first input engine information.
7. The method as described in claim 1, characterized in that, The MOD engine generates MOD stream information and reports it to the CPU. The MOD stream information includes the scene marker information.
8. The method as described in claim 1, characterized in that, The method further includes an outbound packet loss monitoring method, which includes: Receive and parse messages, and edit messages based on the parsing results; The edited message is parsed to obtain the second outer quintuple information and the second tunnel type marker information; Determine whether the message is a tunnel message, and if it is a tunnel message, parse it to obtain the second inner 5-tuple information; Based on the second tunnel type marking information, as well as the decapsulation marking information, forwarding type marking information, encapsulation marking information, and scenario marking information carried from the inbound direction to the outbound direction, the second MOD table is searched to determine whether the packet needs to be sent to the MOD engine for processing and the second sending engine information. The second sending engine information includes forwarding domain information, as well as one of the second outer quintuple information and the second inner quintuple information.
9. The method as described in claim 8, characterized in that, The outgoing packet loss monitoring method supports either an associated mode or an independent mode. In the associated mode, the first MOD table and the second MOD table are associated with each other through scene tagging information. In the independent mode, the second MOD table is independent of the first MOD table.
10. A device for monitoring packet loss, characterized in that, The device includes an incoming packet loss monitoring module, which includes: Incoming direction processing module one is used to receive and parse messages to obtain the first outer 5-tuple information and the first tunnel type marker information; The second inbound processing module is used to determine whether a message needs to be decapsulated, and select to decapsulate the message according to the determination result. It further parses to obtain the first inner five-tuple information and obtains the decapsulation mark information, or determines whether the message is a tunnel message. If it is a tunnel message, it parses to obtain the first inner five-tuple information and obtains the decapsulation mark information. If it is a non-tunnel message, it obtains the default decapsulation mark information. The third inbound processing module is used to determine whether the destination MAC address of the packet is the local routing MAC address, and based on the determination result, to look up the FDB table or routing table to obtain the corresponding forwarding type marking information and encapsulation marking information; The inbound MOD processing module is used to look up the first MOD table based on the first tunnel type marking information, decapsulation marking information, forwarding type marking information and encapsulation marking information, to determine whether the packet needs to be sent to the MOD engine for processing and the first inbound engine information. The first inbound engine information includes scene marking information, forwarding domain information, and one of the first outer 5-tuple information and the first inner 5-tuple information.
11. The apparatus as claimed in claim 10, characterized in that, The device further includes an outgoing packet loss monitoring module, which includes: Outgoing direction processing module one is used to receive and parse messages, and edit messages based on the parsing results; Outgoing direction processing module two is used to parse the edited message and obtain the second outer five-tuple information and the second tunnel type marking information; Outgoing direction processing module three is used to determine whether a message is a tunnel message, and if it is a tunnel message, it is parsed to obtain the second inner layer five-tuple information; The outgoing MOD processing module is used to look up the second MOD table based on the second tunnel type marking information, decapsulation marking information, forwarding type marking information, encapsulation marking information, and scenario marking information to determine whether the packet needs to be sent to the MOD engine for processing and the second input engine information. The second input engine information includes forwarding domain information, as well as one of the second outer 5-tuple information and the second inner 5-tuple information.
12. An electronic device, characterized in that, The electronic device includes: At least one processor; At least one memory coupled to the at least one processor and storing a computer program for execution by the at least one processor, the computer program, when executed by the at least one processor, causing the electronic device to perform the method according to any one of claims 1 to 8.
13. A computer-readable storage medium, characterized in that, It stores a computer program that, when executed by a machine, implements the method according to any one of claims 1 to 8.