Methods, apparatus, equipment and readable storage media for packet loss measurement
By introducing a maintenance board collaboration mechanism and a distributed counter acquisition architecture, the problem of cross-chip and cross-board packet loss detection in high-performance distributed communication equipment is solved, and accurate packet loss measurement and operational observability of equivalent multi-path links are achieved.
Patent Information
- Application Number
- CN202610695474.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-19
- Publication Date
- 2026-06-30
AI Technical Summary
In high-performance distributed communication devices, traditional packet loss measurement methods based on single-chip counters cannot adapt to link aggregation and equivalent multipath scenarios, resulting in packet loss detection failure.
A maintenance board collaboration and distributed counter acquisition architecture is introduced. The maintenance board initiates a unified call request to aggregate the local transmit/receive counter values of the NP chips on each LPU board, thereby realizing cross-board and cross-NP chip equivalent multipath link packet loss detection.
It supports accurate packet loss detection in multi-path load balancing scenarios such as link aggregation and ECMP, provides end-to-end operational observability, and adapts to complex forwarding topologies.
Smart Images

Figure CN122316948A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to a packet loss measurement method, apparatus, device, and readable storage medium. Background Technology
[0002] LPU service boards are available with single-NP or multi-NP chips. Counters are NP chip resources; that is, the TxFC1 and RxFC1 counters are distributed based on the NP chips. Data frames are forwarded and processed on the NP chips, and the counters of the corresponding data frames count their forwarding status. The LM packet loss detection function relies on counters, so the above packet loss detection method requires the Layer 2 network head and tail nodes to have single-NP interfaces. The chip containing this output interface requests local transmit counter value TxFC1 and local receive counter value RxFC1 resources to be responsible for counting the transmission and reception of service frames for the specified data stream.
[0003] In this architecture, network nodes in the communication system contain multiple LPU boards. Each LPU board integrates at least one forwarding interface and has one or more built-in network processor chips for line-rate packet forwarding and statistics. The same service flow may be forwarded in the inbound / outbound direction via different NP chips on different LPU boards. For example, in scenarios such as Link Aggregation (LAG) and ECMP, traffic is hashed and distributed to multiple physical interfaces and corresponding NP resources, causing traditional LM packet loss measurement based on a single-chip counter to fail. Summary of the Invention
[0004] In view of this, in order to solve the above-mentioned technical problems, this application provides a packet loss measurement method, apparatus, device and readable storage medium.
[0005] Specifically, this application is implemented through the following technical solution: According to a first aspect of the embodiments of this application, a packet loss measurement method is provided, the method being applied to a first network node; the first network node and a second network node establish an LM measurement session; the first network node establishes a communication link with the second network node through multiple forwarding interfaces; the first network node includes multiple Line Processing Unit (LPU) boards, and one of the LPU boards to which each forwarding interface belongs is elected as a maintenance board; at least one LPU board integrates multiple Network Processor (NP) chips; at least two forwarding interfaces each use counters provided by different NP chips; the method includes: When this network node acts as the initiator of LM measurement, the maintenance board sends a first instruction to the LPU board to which each of the multiple forwarding interfaces belongs, and sends an LMM message to the second network node based on the transmission counter value returned by each LPU board in response to the first instruction; wherein, the transmission counter value returned by any LPU board in response to the first instruction represents the number of service frames sent from the forwarding interface on that LPU board to the second network node. Based on the LMR message returned by the second network node in response to the LMM message, packet loss measurement is performed on the communication link between the LM measurement initiator and the second network node; wherein, the LMR message carries at least the total number of service frames received from the first network node by each forwarding interface connected to the communication link on the second network node.
[0006] According to a second aspect of the embodiments of this application, a packet loss measurement device is provided, the device being applied to a first network node; the first network node and a second network node establish an LM measurement session; the first network node establishes a communication link with the second network node through multiple forwarding interfaces; the first network node includes multiple Line Processing Unit (LPU) boards, and one of the LPU boards to which each forwarding interface belongs is elected as a maintenance board; at least one LPU board integrates multiple Network Processor (NP) chips; at least two forwarding interfaces each use counters provided by different NP chips; the device includes: The initiating statistics module is configured to, when the network node acts as the initiating end of LM measurement, send a first instruction from the maintenance board to the LPU board to which each of the plurality of forwarding interfaces belongs, and send an LMM message to the second network node based on the transmission counter value returned by each LPU board in response to the first instruction; wherein, the transmission counter value returned by any LPU board in response to the first instruction represents the number of service frames sent from the forwarding interface on that LPU board to the second network node; The packet loss measurement module is configured to perform packet loss measurement on the communication link between the LM measurement initiator and the second network node based on the LMR message returned by the second network node in response to the LMM message; wherein, the LMR message carries at least the total number of service frames received from the first network node by each forwarding interface connected to the communication link on the second network node.
[0007] According to a third aspect of the embodiments of this application, an electronic device is provided, the electronic device comprising: a memory and a processor; the memory being used to store a computer program; the processor being used to execute the above-described packet loss measurement method by invoking the computer program.
[0008] According to a fourth aspect of the embodiments of this application, a computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements the above-described packet loss measurement method.
[0009] In this embodiment, by introducing a maintenance board collaboration and distributed counter acquisition architecture, the maintenance board uniformly initiates call requests and aggregates the local transmit / receive counter values of NP chips on each LPU board. This makes LM measurement no longer dependent on the transmit and receive interfaces being located in the same hardware resource unit, effectively supporting packet loss detection in multi-path load balancing scenarios such as link aggregation and ECMP. This allows data streams to be forwarded evenly among multiple NP chips while still providing accurate end-to-end operational observability, achieving comprehensive adaptation to complex forwarding topologies in high-performance distributed communication devices. Attached Figure Description
[0010] Figure 1A This is an exemplary embodiment illustrating Y.1731 inward detection in a Layer 2 VPN; Figure 1B This is a schematic diagram illustrating a distributed communication architecture as shown in an exemplary embodiment; Figure 2A This is a schematic flowchart illustrating a packet loss measurement method according to an exemplary embodiment of this application; Figure 2B This is a schematic diagram of the internal architecture of a network node shown in an exemplary embodiment of this application; Figure 2C This is an exemplary embodiment of the present application illustrating the interaction between the network node as the LM measurement peer, which collects local reception counter values and reports them to the software processing unit. Figure 3 This is a schematic diagram of the structure of a packet loss measurement device according to an exemplary embodiment of this application; Figure 4 This is a hardware schematic diagram of an electronic device illustrated in an exemplary embodiment of this application. Detailed Implementation
[0011] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims. It should be understood that although the terms first, second, third, etc., may be used in this application to describe various information, such information should not be limited to these terms. These terms are used only to distinguish information of the same type from one another.
[0012] The Y.1731 protocol is an end-to-end OAM (Operation, Administration, and Maintenance) mechanism for Layer 2 networks. It is typically used in Layer 2 networks to detect link connectivity and to identify and locate faults when they occur. Applicable Layer 2 networks include VLAN (Virtual Local Area Network) based Ethernet networks and MPLS (Multiprotocol Label Switching) based Layer 2 VPN (Virtual Leased Line) networks. The Y.1731 protocol includes several link quality detection functions, among which LM (Loss Measurement) is used to detect packet loss of service frames.
[0013] See Figure 1A This example illustrates a Y.1731 inward detection diagram for a Layer 2 VPN. The Access Circuit (AC) is the physical or virtual circuit connecting the Customer Edge (CE) and Provider Edge (PE) in the Layer 2 VPN network. The Pseudowire (PW) is a virtual bidirectional connection established between two PEs using MPLS or IP. The CE is located in the client network, and the PE is located in the MPLS or IP backbone network. The Maintenance End Point (MEP) is configured on the AC interface and establishes an association with the Layer 2 VPN network.
[0014] LM can perform packet loss testing on AC and PW links by exchanging LM messages containing packet loss measurement information between a pair of MEPs. Specifically, in a point-to-point Layer 2 network where packet loss measurement is to be performed, each MEP maintains two counters locally: Sending counter (TxFCf): Records the number of service frames sent from the outgoing interface of this MEP to the peer MEP; Receive counter (RxFCf): Records the number of service frames received from peer MEPs via the input interface of this MEP.
[0015] MEP sends an LMM message containing its own TxFCf value to the peer MEP and receives an LMR message from the peer MEP in response to the LMM message, which contains the peer MEP's RxFCf value. By comparing the service frames actually sent by this MEP and the service frames actually received by the peer during the transmission of the two LMM messages, the frame loss situation on the link between this MEP and the peer MEP can be determined.
[0016] LM supports two measurement modes: single-ended LM and dual-ended LM. In single-ended LM, one MEP actively initiates an LMM message, and the other MEP replies with an LMR message. Packet loss calculation relies on the initiating end collecting counter information from the other end and combining it with its local counter for bidirectional estimation. In dual-ended LM, both MEPs simultaneously initiate their respective LMM messages and reply to each other with LMR messages. Each end independently completes packet loss calculation in its own direction.
[0017] The following explanation uses a single-ended LM as an example to illustrate the existing method. The principles and types of dual-ended LM will not be elaborated here. In single-ended LM mode, the initiating MEP sends an LMM message to the peer MEP. After receiving the LMM message, the peer MEP returns an LMR message. An example message format is as follows: Table 1. Schematic diagram of LM message format
[0018] The LMM message includes TxFCf, which represents the current value of the local transmission counter TxFCl of the initiating MEP when sending the LMM frame.
[0019] LMR messages include: TxFCf: The TxFCf value copied directly from the received LMM message; RxFCf: The value of the local receive counter RxFCl of the peer MEP when it receives this LMM message; TxFCb: The value of the local transmission counter TxFCl of the peer MEP when sending LMR messages.
[0020] After receiving the LMR frame, the initiating MEP uses the following values to measure packet loss in the near and far directions: The values of TxFCf, RxFCf, and TxFCb of the received LMR frame and the value of the local receive counter RxFCl at the initiating MEP when the LMR frame is received. These values are represented as TxFCf[tc], RxFCf[tc], TxFCb[tc], and RxFCl[tc], where tc is the reception time of the current LMR frame.
[0021] The values of TxFCf, RxFCf, and TxFCb of the previous LMR frame, and the value of the local receive counter RxFCl at the initiating end's MEP when the previous LMR frame was received. These values are represented as TxFCf[tp], RxFCf[tp], TxFCb[tp], and RxFCl[tp], where tp is the reception time of the previous LMR frame.
[0022] Frame loss in the far direction (from the originating MEP to the peer MEP): Frame loss at the remote end = |TxFCf[tc]–TxFCf[tp]| – |RxFCf[tc] – RxFCf[tp]| ; that is, the difference between the frame increment sent by the initiating MEP and the frame increment received by the peer MEP is the number of frames lost on the remote link.
[0023] Near-end direction frame loss (from peer MEP to originating MEP): Frame loss near end = |TxFCb[tc] – TxFCb[tp]| – |RxFCl[tc] – RxFCl[tp]|; that is, the difference between the reverse frame increment sent by the peer MEP and the frame increment received locally by the initiating MEP is the number of frames lost on the near end link.
[0024] like Figure 1B This diagram illustrates an exemplary distributed communication architecture. Currently, most high-performance communication devices use this connection method. The LPU (not limited to NP and switching chips) is responsible for data packet processing and forwarding, while the SFU (System-Level Unit) handles intra-board communication and data interaction, enabling cross-LPU data interoperability. When the LPU service board chip receives an LM message, it obtains the RxFCl counter value from the chip containing the ingress interface for frame loss calculation.
[0025] LPU service boards are available in single-NP and multi-NP chip configurations. Counters are NP chip resources; specifically, the TxFCl and RxFCl counters are distributed across the NP chips. Data frames are forwarded and processed on the NP chips, and the corresponding data frame counters track their forwarding activity. The LM packet loss detection function relies on these counters. Therefore, the aforementioned packet loss detection method requires the Layer 2 network head and tail nodes to have single-NP output interfaces. The chip hosting this output interface requests local transmit counter values (TxFCl) and local receive counter values (RxFCl) to count the transmission and reception of service frames for a specified data stream, received or transmitted from this NP itself.
[0026] In this architecture, network nodes in the communication system contain multiple LPU boards. Each LPU board integrates at least one forwarding interface and has one or more built-in network processor chips for line-rate packet forwarding and statistics. The same service flow may be forwarded in the inbound / outbound direction via different NP chips on different LPU boards. For example, in scenarios such as Link Aggregation (LAG) and ECMP, traffic is hashed and distributed to multiple physical interfaces and corresponding NP resources, causing traditional LM packet loss measurement based on a single-chip counter to fail.
[0027] In view of this, this application provides a packet loss measurement method that is adaptable to high-performance distributed communication devices and supports accurate bidirectional frame loss rate measurement of equivalent multipath links across boards and NP chips. This method uses any network node in the aforementioned communication system as the execution subject, for example, a first network node as the execution subject. The first network node establishes an LM measurement session with a second network node; the first network node establishes a communication link with the second network node through multiple forwarding interfaces; the first network node includes multiple Line Processing Unit (LPU) boards, and one of the LPU boards to which each forwarding interface belongs is elected as the maintenance board; at least one LPU board integrates multiple Network Processor (NP) chips; and the counters used by at least two forwarding interfaces are provided by different NP chips.
[0028] The counters include a transmit counter and a receive counter. When a network node acts as the initiator of an LM measurement, the transmit counter counts the number of service frames sent from the forwarding interface to the network node acting as the peer in the LM measurement session, and the receive counter counts the number of service frames entering from the forwarding interface from the network node acting as the peer in the LM measurement session. When a network node acts as the peer in an LM measurement, the transmit counter counts the number of service frames sent from the forwarding interface to the network node acting as the initiator in the LM measurement session, and the receive counter counts the number of service frames entering from the forwarding interface from the network node acting as the initiator in the LM measurement session.
[0029] At least two forwarding interfaces use counters provided by different NP chips. This means that among the multiple forwarding interfaces, at least two belong to different NP chips, and the transmit and receive counters used by each forwarding interface during LM measurements are maintained locally by its respective NP chip. This configuration can include at least the following two cases: Different NP chips on the same LPU board: At least two forwarding interfaces are located on the same LPU board and are driven by different chips from multiple NP chips integrated within the LPU board. Each NP chip independently manages the counter resources of its corresponding forwarding interface. Different NP chips on different LPU boards: At least two forwarding interfaces are located on different LPU boards. Each LPU board integrates one or more NP chips, and the counter of each forwarding interface is provided by one of the NP chips on its LPU board. The counters of different forwarding interfaces are maintained by physically separate NP chips.
[0030] When selecting an LPU board from the LPU boards belonging to each forwarding interface communicating with the second network node as a maintenance board, an LPU board that meets preset conditions can be selected from the LPU boards belonging to each forwarding interface as the maintenance board; wherein, the preset conditions may include any of the following: the LPU board with the smallest slot number; the slot number represents the number used to identify the physical installation location of the LPU board; or, the LPU board with the longest board running time; or, the LPU board with the highest priority in the pre-configured priority list; or, the LPU board with the highest memory idle rate.
[0031] It is understood that the above preset conditions are only some of the selection criteria shown as examples. Those skilled in the art can flexibly configure and adjust them according to actual needs. This embodiment does not limit this.
[0032] In addition, if the multiple forwarding interfaces communicating with the second network node all belong to the same LPU board, the LPU board to which the multiple forwarding interfaces belong can be directly used as the maintenance board to simplify maintenance logic, reduce cross-board coordination overhead, and ensure centralized management of the relevant status and counter information of the LM measurement session.
[0033] Based on this, see Figure 2A The flowchart illustrating the interaction steps between the local network node (as the LM measurement initiator) and the second network node (as the LM measurement peer) in an exemplary packet loss measurement method is shown. This method is illustrated using single-end LM packet loss measurement as an example. It is understood that the implementation principle of dual-end LM packet loss measurement is the same, except that the control plane negotiation and counter reporting mechanisms are completed collaboratively by both ends, rather than being calculated independently by the initiating end alone. As shown in the figure, this method may include at least: S201, when this network node acts as the LM measurement initiator, the maintenance board sends a first instruction to the LPU board to which each of the plurality of forwarding interfaces belongs, and sends an LMM message to the second network node based on the transmission counter value returned by each LPU board in response to the first instruction; wherein, the transmission counter value returned by any LPU board in response to the first instruction represents the number of service frames sent from the forwarding interface on that LPU board to the second network node. S202, based on the LMR message returned by the second network node in response to the LMM message, packet loss measurement is performed on the communication link between the LM measurement initiator and the second network node; wherein, the LMR message carries at least the total number of service frames received from the first network node by each forwarding interface connected to the communication link on the second network node.
[0034] The first instruction triggers each LPU board to query the current value of its locally maintained transmit counter corresponding to the LM measurement session, and returns this value to the maintenance board. This first instruction carries the identifier of the LM measurement session between the first network node and the second network node to avoid data confusion in multi-session or multi-path scenarios. For example, the identifier of the LM measurement session can be uniquely defined by a combination of identifiers formed by the node identifiers of the first network node and the second network node.
[0035] The transmit counter is a hardware or software counter associated with the forwarding interface. It is used to count the number of service frames belonging to the current LM measurement session sent from the forwarding interface to the specified peer (second network node). It is maintained locally by the NP chip to which the forwarding interface belongs.
[0036] The LM measurement initiator represents the party that actively initiates the packet loss measurement process. It is responsible for sending LMM messages and calculating packet loss data based on the LMR messages returned by the peer. Therefore, the purpose of step S201 is to collect the number of service frames sent by all forwarding interfaces participating in the LM measurement session between this network node and the second network node when this network node acts as the LM initiator, encapsulate this information into LMM messages, and send them to the second network node, providing a data basis for bidirectional packet loss rate calculation.
[0037] When this network node acts as the initiator of an LM measurement, the elected maintenance board on this network node constructs a first instruction, which includes the identifier and query type of the current LM measurement session. In this step, the query type instructs the LPU board receiving the first instruction to return the transmit counter value for the current LM measurement session. The maintenance board sends this first instruction to the LPU board on this network node that belongs to the forwarding interface communicating with the second network node via internal control channels such as the inter-board high-speed bus or the management CPU channel.
[0038] Upon receiving the first instruction, any LPU board on this network node searches for the transmit counter of the corresponding forwarding interface in the local NP chip based on the identifier of the LM measurement session, reads the current value of the counter, and returns the value to the maintenance board through an internal channel.
[0039] After the maintenance board receives the transmit counter values returned by each LPU board, it can accumulate the transmit counter values to obtain the total number of service frames sent by the first network node, fill it into a specified field in the LMM, and select a forwarding interface through internal scheduling or polling to send the LMM message to the second network node.
[0040] For step S101, the following will illustrate with examples of different forwarding interface distributions.
[0041] Scenario 1: Multiple forwarding interfaces belong to the same LPU service board, but are distributed on different NP chips.
[0042] Suppose that this network node is configured with a Link Aggregation Group (LAG) connected to the second network node. This LAG contains two member ports, Port-A and Port-B, which are physically located on the same LPU service board. However, Port-A is handled by NP0 on this board, and Port-B is handled by NP1.
[0043] Since the TxFCl counter is an NP chip-level resource, NP0 and NP1 independently maintain their outgoing direction counts. At this time, after the maintenance board (the LPU board itself / other LPUs designated by the system) sends the first instruction to the LPU board, the LPU board's internal driver reads the local transmit counter value TxFCl for the corresponding flow from NP0 and NP1 respectively. For example, NP0 reports TxFCl=12500, NP1 reports TxFCl=12600, and the sum of the two, 25100, is returned to the maintenance board as the total transmit count value for the LPU board. The maintenance board then summarizes the transmit values of all LPU boards located at the forwarding interfaces connected to the communication links between the second network node and fills them into specified fields of the LMM message, such as the TxFCl field.
[0044] Scenario 2: Multiple forwarding interfaces are distributed on different LPU service boards.
[0045] For example, this network node is physically connected to the second network node via two LPU service boards (LPU-1 and LPU-2), forming a cross-board equivalent multipath. The NP chip on LPU-1 records its local transmit counter value TxFC1 for the second network node as 8200, and the NP chip on LPU-2 records it as 8350. When the maintenance board (e.g., the system designates LPU-1 as the maintenance board) initiates LM measurement, it sends the first command to both LPU-1 and LPU-2; LPU-1 directly returns 8200 from its local NP, while LPU-2 reports 8350 to the maintenance board via the backplane control channel. The maintenance board accumulates the total transmit count to 16550 and writes it into the TxFCf field of the LMM message, then sends the LMM message to the second network node via any outgoing interface or a dedicated OAM channel.
[0046] When this network node acts as the LM measurement initiator, if the LPU board to which the forwarding interface that receives the LMR message belongs is not among the elected maintenance boards, the LMM message is transmitted from the LPU board to which the forwarding interface belongs to the elected maintenance board in the LM measurement initiator. This transparent transmission is achieved through cross-board transmission methods within the network node, such as SFU switching, in-band signaling channels, or dedicated management VLANs. This embodiment does not limit this.
[0047] For step S202, the purpose of this step is to compare the total number of received frames carried in the LMR message returned by the second network node with the total number of sent frames counted by the first network node in step S201, thereby determining the packet loss situation on the communication link between the first and second network nodes. The LMR message represents the acknowledgment message returned by the LM measurement peer after receiving the LMM message, used to announce the actual number of service frames received from the LM measurement initiator.
[0048] In this configuration, at least one LPU board on the second network node integrates multiple NP chips; the counters used by at least two forwarding interfaces connected to the communication link are provided by different NP chips; one of the LPU boards on the second network node is elected as the maintenance board; this maintenance board is used for: Upon receiving an LMM message from the first network node, a second instruction is sent to the LPU boards belonging to the multiple forwarding interfaces on the second network node, and an LMR message is sent to the first network node based on the receive counter value returned by each LPU board in response to the second instruction; wherein, the receive counter value returned by any LPU board in response to the second instruction represents the number of service frames received from the first network node from the forwarding interface on that LPU board.
[0049] In other words, when the first network node acts as the initiator of the LM measurement, the LMM message sent to the second network node includes the identifier of the LM measurement session and the total number of service frames sent from the first network node to the second network node. The LMM message reaches a specific LPU board on the second network node via the communication link. The second network node, acting as the LM measurement peer, receives the LMM message. Upon receiving the message, the maintenance board on the second network node triggers a second instruction to send to the LPU boards belonging to each forwarding interface communicating with the first network node. Upon receiving the second instruction, any LPU board on the second network node reads the receive counter value from the NP chip used by the forwarding interface communicating with the first network node on its own LPU board, and sends this receive counter value to the maintenance board on the second network node. This allows the maintenance board on the second network node to determine the number of service frames received from the first network node based on the received receive counter values.
[0050] The second instruction is a query instruction sent by the maintenance board on the second network node to other LPU boards on this node. It may include an identifier of the current LM measurement session between this node and the first network node, and may also include a query type. This query type instructs the LPU board receiving the second instruction to return a receive counter value for the current LM measurement session on its own LPU board. This receive counter value reflects the number of service frames received from the first network node through the forwarding interface communicating between this LPU board and the first network node. Therefore, the maintenance board on the second network node can accumulate the sum of the receive counter values returned by each LPU board in response to the second instruction, and write this sum into the LMR message as the total number of service frames received by the second network node from the first network node.
[0051] See Figure 2B This example illustrates an internal architecture of a network node. The network node employs a layered hardware and software co-design. The platform layer, at the top, serves as the software processing unit, responsible for controlling the LM measurement session, summarizing counters, and calculating packet loss. The driver layer includes a maintenance board, responsible for issuing commands and aggregating data. The hardware forwarding layer consists of multiple LPU boards, each integrating one or more NP chips. Each NP chip has an independent hardware counter module, including: RxFCf / RxFCI (receive counter, used to count the number of service frames received from the peer) and TxFCf / TxFCI (transmit counter, used to count the number of service frames sent to the peer). The platform issues control commands to each LPU board through the maintenance board, triggering the NP chips to read the corresponding hardware counter values. Each LPU board returns its local counter values to the maintenance board, which then summarizes and reports them to the platform.
[0052] Based on this, after receiving the LMM message, the maintenance board on the second network node can write the cumulative sum of the collected receive counter values into the extended area field of the LMM message, and pass the updated LMM message to the software processing unit, so that the software processing unit can parse the extended area field of the LMM message to obtain the cumulative sum of the receive counter values, construct an LMR message in response to the LMM message based on the cumulative sum of the receive counter values, and pass the LMR message to the maintenance board.
[0053] like Figure 2CThe diagram illustrates the data flow when an LMM message is received within a network node. Taking MEP2 as an example, as the second network node, when it receives an LMM message from the LM measurement initiator MEP1, its internal processing flow includes: The LMM message is first sent to the maintenance board, which then issues a second instruction to all LPU boards (i.e., forwarding units containing NPn) participating in the LM measurement session. This triggers each NP chip to read the current value of its local receive counter RxFCI for the forwarding interface communicating with MEP1. This value represents the data received from MEP1 by that forwarding interface. Service frame count; Each LPU board returns the RxFCI value of the response to the maintenance board, which sums them up to obtain the current total number of received frames for this node. This sum is passed by the maintenance board to the upper-layer software processing unit (i.e., the platform). After receiving the sum, the software processing unit fills the total number of received frames into the first receive count field RxFCf field of the LMR message and fills in other necessary fields. The constructed LMR message is sent back to the maintenance board and then sent to the peer MEP1 via the TxFCI path of NPn (i.e., the LM packet loss detection packet forwarding path shown by the solid arrow in the figure).
[0054] Specifically, the step of constructing an LMR message in response to the LMM message based on the cumulative sum of the values of each receive counter can include at least the following operations: An LMR message is initialized according to a predefined message structure, and the cumulative sum of the values of each receive counter is filled into the first receive count field of the LMR message; the value of the specified field in the LMM message is copied to the first transmit count field of the LMR message.
[0055] Based on the data carried in the LMR message, during the packet loss measurement process for the communication link between the LM measurement initiator and the second network node described in step S102, the service frame packet loss result in the transmission direction from the LM measurement initiator to the second network node can be achieved through the following steps: Based on the total number of service frames sent by this network node as the LM measurement initiator in the first measurement period and the total number of service frames received by the second network node in the first measurement period, the service frame packet loss result in the transmission direction from the LM measurement initiator to the second network node is determined. Wherein, the first measurement period represents the interval between the transmission time of the LMM message that is sent in response to the currently received LMR message and the LMM message that was received in the previous time. The total number of service frames sent during the first measurement period is determined based on the difference between the value of the first transmission count field in the LMR message received at the previous moment and the value of the first transmission count field is the cumulative sum of the transmission counter values returned by each LPU board in response to the first instruction. The total number of service frames received in the first measurement period is determined based on the difference between the value of the first receive count field in the LMR message received at the previous moment and the value of the first receive count field is the total number of service frames received from the first network node by each forwarding interface connected to the communication link on the second network node.
[0056] For example, the first network node, acting as the initiator of LM measurements, sends service traffic to the second network node, and the second network node, acting as the peer of LM measurements, receives service traffic from the first network node. Both parties use the cross-LPU maintenance board aggregation mechanism described in this application for counting and data acquisition. LMM messages are sent periodically by the first network node (e.g., once every 5 seconds), and the second network node immediately returns an LMR message after each receipt.
[0057] Table 2 Examples of service frame transmission and reception data during the first measurement period.
[0058] Among them, T x0 / T x1 It is the sum of the local transmit counters TxFCl of all LPU boards participating in forwarding at time t0 / t1 of the first network node, i.e., the first transmit count field in LMR; R x0 / R x1 It is the sum of the local receive counters RxFCl of all incoming interface LPU boards of the second network node at time t0 / t1, which is the first receive count field in LMR.
[0059] The first measurement period = [LMM transmission time corresponding to t0, LMM transmission time corresponding to t1], which is the time window between two consecutive measurement periods.
[0060] Calculate the total number of service frames sent by the initiator during the first measurement period: ΔTx=Tx1-Tx0 =25000-10000=15000 Calculate the total number of service frames received by the peer during the first measurement period: ΔRx=Rx1-Rx0 =24950-9980=14970 Calculate the number of service frame packets lost in this direction: Number of lost packets = ΔTx - ΔRx = 15000 - 14970 = 30 Based on this packet loss measurement method, even if traffic is distributed across multiple LPU boards and multiple NP chips (e.g., the first network node has 3 LPUs sending 5k, 6k, and 4k frames respectively; the second network node has 2 LPUs receiving 8k and 6.97k frames respectively), the maintenance board correctly aggregates the counts from each board, and the above difference calculation remains accurate. Using the count difference between two adjacent LMRs instead of the absolute value can effectively eliminate the effects of initial counter offset and restart reset, ensuring that the measurement result reflects the actual packet loss within the current measurement period. Furthermore, this method inherently supports bidirectional measurement; simply switching roles (the second network node acting as the initiator of the LM measurement session) allows for the acquisition of reverse packet loss data.
[0061] In this embodiment, compared to the limitations of related technologies where LM packet loss measurement requires the transceiver interfaces to be located on the same NP chip and cannot support cross-chip or cross-board aggregation links, the packet loss measurement method provided in this application introduces a maintenance board collaboration mechanism and a distributed counter acquisition architecture. This allows data streams to be forwarded evenly across multiple NP chips while still providing accurate end-to-end operational observability, achieving comprehensive adaptation to complex forwarding topologies in high-performance distributed communication devices. This method, by having the maintenance board uniformly initiate a call request and aggregate the local transmit / receive counter values of the NP chips on each LPU board, eliminates the dependence of LM measurement on the transceiver interfaces being located on the same hardware resource unit, effectively supporting packet loss detection in multi-path load-sharing scenarios such as link aggregation and ECMP.
[0062] Furthermore, in the transmission direction from the first network node to the second network node, this method can accurately obtain the total number of frames sent and the total number of frames received at the other end of the entire path. Even if the traffic is distributed across multiple physical interfaces and different LPU boards, the difference calculation can still be performed based on the complete count, avoiding misjudgment or omission of packet loss due to count omission.
[0063] Furthermore, the above method is based on the standard LMM / LMR message interaction process, and only extends the counter acquisition and aggregation logic within the node. It does not require modification of the peer device's protocol stack or introduction of additional signaling, and has good interoperability and engineering feasibility.
[0064] The aforementioned embodiments describe the measurement of one-way packet loss from the first network node (LM measurement initiator) to the second network node (LM measurement peer). In asymmetric networks or fault diagnosis scenarios, it is also necessary to pay attention to the packet loss in the reverse link direction, that is, the packet loss in the direction from the second network node (LM measurement peer) to the first network node (LM measurement initiator).
[0065] Therefore, this embodiment proposes a method for handling reverse packet loss. In this method, the LMR message fed back by the second network node to the first network node can also carry the total number of service frames sent from each forwarding interface on the second network node connected to the communication link to the first network node. This reflects the number of service frames sent by the second network node to the first network node when the second network node returns the LMR message as the LM measurement peer. Combined with the number of service frames actually received locally by the first network node as the LM measurement initiator from the second network node, the packet loss situation in the reverse link direction can be estimated.
[0066] The total number of service frames sent from each forwarding interface on the second network node to the first network node in the LMR message is obtained in the following way: Before sending LMR messages, the maintenance board on the second network node sends a third instruction to the LPU boards belonging to each of the multiple forwarding interfaces on the second network node. Based on the transmission counter value returned by each LPU board in response to the third instruction, the total number of service frames sent from each forwarding interface on the second network node to the first network node is obtained. The transmission counter value returned by any LPU board in response to the third instruction represents the number of service frames sent from the forwarding interface on that LPU board to the first network node.
[0067] It is understood that this third instruction has the same function as the aforementioned first / second instructions. This third instruction represents a control message issued by the maintenance board within the second network node, used to trigger each LPU board to report its transmit counter value sent to the first network node. This value includes the identifier of the LM measurement session between the second and first network nodes and carries a query type. This query type instructs any LPU board on the second network node that receives the third instruction to read the transmit counter value on the NP chip belonging to the forwarding interface on this LPU board that communicates with the first network node. This transmit counter value is used to count the number of service frames sent from the forwarding interface on this LPU board to the first network node.
[0068] In other words, before the second network node's maintenance board prepares to send an LMR message, it sends a third instruction to all LPU boards belonging to its forwarding interfaces connected to the first network node. Upon receiving the third instruction, each LPU board queries its local NP chip for the transmission counter corresponding to the LM measurement session (recording the number of service frames sent to the first network node) and returns the value. The maintenance board sums the transmission counter values returned by each LPU board to obtain the total number of transmitted frames, fills this total number of transmitted frames into the second transmission count field of the LMR message, and sends it along with the LMR message to the first network node. Where a software processing unit is provided within the network node, the maintenance board on the second network node can begin collecting the transmission counter values returned by each LPU board in response to the third instruction upon receiving the LMR message issued by the software processing unit.
[0069] For the first network node that receives the aforementioned LMR message, acting as the initiator of the LM measurement, in order to statistically analyze packet loss on the reverse link, the first network node needs to determine the number of service frames received from the second network node. In the measurement mode where the first network node sends LMM messages, upon receiving the LMR message, the maintenance board on the first network node can also send a fourth instruction to the LPU boards belonging to each of the multiple forwarding interfaces on the network node, obtaining the receive counter value returned by each LPU board in response to the fourth instruction; wherein, the receive counter value returned by any LPU board in response to the fourth instruction represents the number of service frames received from the second network node from the forwarding interface on that LPU board.
[0070] The fourth instruction represents the control instruction issued by the first network node maintenance board after receiving the LMR message. It is used to trigger each LPU board on the first network node to report the number of service frames it received from the second network node. It triggers the counter reading at the same logical moment when it receives the LMR to ensure that the received data and the data sent in the LMR belong to the same measurement context.
[0071] When the first network node is equipped with a software processing unit, when this network node acts as the initiator of LM measurement, after receiving the LMR message, the maintenance board can write the cumulative sum of the receive counter values returned by each LPU board on the first network node in response to the fourth instruction into the extension field of the LMR message, and pass the updated LMR message to the software processing unit so that the software processing unit can perform packet loss measurement based on the LMR message returned by the second network node for the LMM message.
[0072] Based on this, when the first network node acts as the initiator of LM measurements, upon receiving the LMR message returned by the second network node in response to the LMM message, the process of performing packet loss measurement on the communication link between the LM measurement initiator and the second network node can be achieved through the following steps: Based on the total number of service frames sent by the second network node in the second measurement period and the total number of service frames received by the LM measurement initiator in the second measurement period, the service frame packet loss result in the direction from the second network node to the LM measurement initiator is determined. Wherein, the second measurement period represents the time interval between the currently received LMR message and the LMR message received at the previous moment; The total number of service frames sent during the second measurement period is determined based on the difference between the value of the second transmission count field in the LMR message received at the previous moment and the value of the second transmission count field; the value of the second transmission count field represents the total number of service frames sent from each forwarding interface on the second network node connected to the communication link to the first network node. The total number of service frames received during the second measurement period is determined based on the difference between the cumulative sum of the receive counter values returned by each LPU board in response to the fourth instruction at the previous moment and when the LMR message is received at the current moment.
[0073] For example, within the time period formed by the transmission times of two consecutive LMRs: Table 3. Data examples during two consecutive LMR message transmissions for near-end packet loss detection.
[0074] Calculate the number of service frames sent by the second network node during this period: ΔTxpeer =Txpeer1-Txpeer0 =28000-12000=16000 Calculate the number of service frames received by the first network node during this period: ΔRxlocal =Rxlocal1 -Rxlocal0 =27940-11970=15970 Calculate the number of packet losses in the near-end direction (second network node → first network node): Near-end packet loss count = ΔTxpeer - ΔRxlocal = 16000 - 15970 = 30 As can be seen from this measurement method, this embodiment does not require additional signaling or reverse LMM. By multiplexing the peer-end transmit count and the local end real-time receive count in the LMR message, it achieves accurate perception of the reverse link quality. The software processing unit only needs to read the two differences in the LMR extension area to complete the bidirectional SLA evaluation, which simplifies the packet loss measurement process and improves measurement efficiency.
[0075] As described in the preceding embodiments, the first network node acts as the LM measurement initiator and establishes an LM measurement session with the second network node, in which case the second network node acts as the LM measurement peer. In actual business processes, the first network node can also act as the LM measurement peer, in which case the second network node acts as the LM measurement initiator in the LM measurement session. Alternatively, the first network node can simultaneously act as the LM measurement initiator and the LM measurement peer. From the perspective of the LM measurement peer, the first network node receives an LMM message from the second network node and, in response to the LMM message, generates an LMR message in response and returns it to the second network node.
[0076] Based on this, when this network node acts as the LM measurement peer, the maintenance board, upon receiving an LMM message from the second network node, sends a fifth instruction to the LPU boards belonging to each of the multiple forwarding interfaces on this network node, and sends an LMR message to the second network node based on the receive counter value returned by each LPU board in response to the fifth instruction; wherein, the receive counter value returned by any LPU board on this network node in response to the fifth instruction represents the number of service frames received from the second network node from the forwarding interface on that LPU board.
[0077] The fifth instruction is functionally the same as the second instruction used by the second network node in the aforementioned embodiment; both are used to trigger the LPU board included in the node to report the receive counter value in the receive direction.
[0078] When this network node acts as the peer of LM measurement, if the LPU board to which the forwarding interface that receives the LMM message belongs is not among the elected maintenance boards, then the LMM message is transmitted from the LPU board to which the forwarding interface belongs to the elected maintenance board in the LM measurement peer.
[0079] When the first network node acts as the LM measurement peer and responds to the LMM message returning the LMR, the operation it performs is the same as the operation performed by the second network node acting as the LM measurement peer in the aforementioned embodiment. In other words, for any network node acting as the LM measurement peer, its internal processing logic can at least include receiving the LMM message, collecting the number of service frames received on the network node from the LM measurement initiator through the maintenance board, and returning the LMR message.
[0080] Corresponding to the embodiments of the aforementioned packet loss measurement method, see [link to relevant documentation]. Figure 3As shown, this application also provides an embodiment of a packet loss measurement device, which is applied to a first network node; the first network node and a second network node establish an LM measurement session; the first network node establishes a communication link with the second network node through multiple forwarding interfaces; the first network node includes multiple Line Processing Unit (LPU) boards, and one of the LPU boards to which each forwarding interface belongs is elected as a maintenance board; at least one LPU board integrates multiple Network Processor (NP) chips; the counters used by at least two forwarding interfaces are provided by different NP chips; the device includes: The initiating statistics module 301 is configured to, when the network node acts as the initiating end of LM measurement, send a first instruction to the LPU board to which each of the plurality of forwarding interfaces belongs, and send an LMM message to the second network node based on the transmission counter value returned by each LPU board in response to the first instruction; wherein, the transmission counter value returned by any LPU board in response to the first instruction represents the number of service frames sent from the forwarding interface on that LPU board to the second network node; The packet loss measurement module 302 is configured to perform packet loss measurement on the communication link between the LM measurement initiator and the second network node based on the LMR message returned by the second network node in response to the LMM message; wherein, the LMR message carries at least the total number of service frames received from the first network node by each forwarding interface connected to the communication link on the second network node.
[0081] The specific implementation process of the functions and roles of each unit in the above device can be found in the implementation process of the corresponding steps in the above method, and will not be repeated here.
[0082] This application also provides an electronic device, the structural schematic diagram of which is shown below. Figure 4 As shown, the electronic device 400 includes at least one processor 401, a memory 402, and a bus 403. At least one processor 401 is electrically connected to the memory 402. The memory 402 is configured to store at least one computer-executable instruction, and the processor 401 is configured to execute the at least one computer-executable instruction to perform the steps of any packet loss measurement method provided in any embodiment or optional implementation of this application.
[0083] Furthermore, the processor 401 can be an FPGA (Field-Programmable Gate Array) or other devices with logic processing capabilities, such as an MCU (Microcontroller Unit) or a CPU (Central Processing Unit).
[0084] This application also provides another readable storage medium storing a computer program that, when executed by a processor, implements the steps of any packet loss measurement method provided in any embodiment or optional implementation of this application.
[0085] The readable storage media provided in this application include, but are not limited to, any type of disk (including floppy disk, hard disk, optical disk, CD-ROM, and magneto-optical disk), ROM (Read-Only Memory), RAM (Random Access Memory), EPROM (Erasable Programmable Read-Only Memory), EEPROM (Electrically Erasable Programmable Read-Only Memory), flash memory, magnetic cards, or optical cards. In other words, readable storage media include any medium by which a device (e.g., a computer) stores or transmits information in a readable form.
[0086] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.
Claims
1. A method for measuring packet loss, characterized in that, The method is applied to a first network node; the first network node establishes an LM measurement session with a second network node; the first network node establishes a communication link with the second network node through multiple forwarding interfaces; the first network node includes multiple Line Processing Unit (LPU) boards, and one of the LPU boards to which each forwarding interface belongs is elected as the maintenance board; at least one LPU board integrates multiple Network Processor (NP) chips; the counters used by at least two forwarding interfaces are provided by different NP chips; the method includes: When this network node acts as the initiator of LM measurement, the maintenance board sends a first instruction to the LPU board to which each of the multiple forwarding interfaces belongs, and sends an LMM message to the second network node based on the transmission counter value returned by each LPU board in response to the first instruction; wherein, the transmission counter value returned by any LPU board in response to the first instruction represents the number of service frames sent from the forwarding interface on that LPU board to the second network node. Based on the LMR message returned by the second network node in response to the LMM message, packet loss measurement is performed on the communication link between the LM measurement initiator and the second network node; wherein, the LMR message carries at least the total number of service frames received from the first network node by each forwarding interface connected to the communication link on the second network node.
2. The method according to claim 1, characterized in that, At least one LPU board on the second network node integrates multiple NP chips; the counters used by at least two forwarding interfaces connected to the communication link are provided by different NP chips; one of the LPU boards on the second network node is elected as the maintenance board; The maintenance board is used to: upon receiving an LMM message from the first network node, send a second instruction to the LPU boards belonging to each of the multiple forwarding interfaces on the second network node, and send an LMR message to the first network node based on the receive counter value returned by each LPU board in response to the second instruction; wherein, the receive counter value returned by any LPU board in response to the second instruction represents the number of service frames received from the first network node from the forwarding interface on that LPU board.
3. The method according to claim 1 or 2, characterized in that, The packet loss measurement for the communication link between the LM measurement initiator and the second network node includes: Based on the total number of service frames sent by this network node as the LM measurement initiator in the first measurement period and the total number of service frames received by the second network node in the first measurement period, the service frame packet loss result in the transmission direction from the LM measurement initiator to the second network node is determined. Wherein, the first measurement period represents the interval between the transmission time of the LMM message that is sent in response to the currently received LMR message and the LMM message that was received in the previous time. The total number of service frames sent during the first measurement period is determined based on the difference between the value of the first transmission count field in the LMR message received at the previous moment and the value of the first transmission count field is the cumulative sum of the transmission counter values returned by each LPU board in response to the first instruction. The total number of service frames received in the first measurement period is determined based on the difference between the value of the first receive count field in the LMR message received at the previous moment and the value of the first receive count field is the total number of service frames received from the first network node by each forwarding interface connected to the communication link on the second network node.
4. The method according to claim 2, characterized in that, The LMR message also includes the total number of service frames sent from each forwarding interface on the second network node connected to the communication link to the first network node; the total number of service frames sent from each forwarding interface on the second network node to the first network node is obtained in the following way: Before sending LMR messages, the maintenance board on the second network node sends a third instruction to the LPU boards belonging to each of the multiple forwarding interfaces on the second network node. Based on the transmission counter value returned by each LPU board in response to the third instruction, the total number of service frames sent from each forwarding interface on the second network node to the first network node is obtained. The transmission counter value returned by any LPU board in response to the third instruction represents the number of service frames sent from the forwarding interface on that LPU board to the first network node.
5. The method according to claim 4, characterized in that, The method further includes: When this network node acts as the initiator of LM measurement, upon receiving an LMR message, the maintenance board on this network node sends a fourth instruction to the LPU board to which each of the multiple forwarding interfaces on this network node belongs, and obtains the receive counter value returned by each LPU board in response to the fourth instruction; wherein, the receive counter value returned by any LPU board in response to the fourth instruction represents the number of service frames received from the second network node from the forwarding interface on that LPU board.
6. The method according to claim 5, characterized in that, The packet loss measurement for the communication link between the LM measurement initiator and the second network node includes: Based on the total number of service frames sent by the second network node in the second measurement period and the total number of service frames received by the LM measurement initiator in the second measurement period, the service frame packet loss result in the direction from the second network node to the LM measurement initiator is determined. Wherein, the second measurement period represents the time interval between the currently received LMR message and the LMR message received at the previous moment; The total number of service frames sent during the second measurement period is determined based on the difference between the value of the second transmission count field in the LMR message received at the previous moment and the value of the second transmission count field; the value of the second transmission count field represents the total number of service frames sent from each forwarding interface on the second network node connected to the communication link to the first network node. The total number of service frames received during the second measurement period is determined based on the difference between the cumulative sum of the receive counter values returned by each LPU board in response to the fourth instruction at the previous moment and when the LMR message is received at the current moment.
7. The method according to claim 1, characterized in that, The method further includes: When this network node acts as the LM measurement peer, when the maintenance board receives the LMM message from the second network node, it sends a fifth instruction to the LPU board to which each of the multiple forwarding interfaces on this network node belongs, and sends an LMR message to the second network node based on the receive counter value returned by each LPU board in response to the fifth instruction. The receive counter value returned by any LPU board on this network node in response to the fifth instruction represents the number of service frames received from the second network node from the forwarding interface on that LPU board.
8. The method according to claim 1, characterized in that, The method further includes: When this network node acts as the LM measurement initiator, if the LPU board to which the forwarding interface that receives the LMR message belongs is not among the elected maintenance boards, then the LMM message is transmitted from the LPU board to which the forwarding interface belongs to the elected maintenance board in the LM measurement initiator. When this network node acts as the peer of LM measurement, if the LPU board to which the forwarding interface that receives the LMM message belongs is not among the elected maintenance boards, then the LMM message is transmitted from the LPU board to which the forwarding interface belongs to the elected maintenance board in the LM measurement peer.
9. A packet loss measurement device, characterized in that, The device is applied to a first network node; the first network node establishes an LM measurement session with a second network node; the first network node establishes a communication link with the second network node through multiple forwarding interfaces; the first network node includes multiple Line Processing Unit (LPU) boards, and one of the LPU boards to which each forwarding interface belongs is elected as the maintenance board; at least one LPU board integrates multiple Network Processor (NP) chips; the counters used by at least two forwarding interfaces are provided by different NP chips; the device includes: The initiating statistics module is configured to, when the network node acts as the initiating end of LM measurement, send a first instruction from the maintenance board to the LPU board to which each of the plurality of forwarding interfaces belongs, and send an LMM message to the second network node based on the transmission counter value returned by each LPU board in response to the first instruction; wherein, the transmission counter value returned by any LPU board in response to the first instruction represents the number of service frames sent from the forwarding interface on that LPU board to the second network node; The packet loss measurement module is configured to perform packet loss measurement on the communication link between the LM measurement initiator and the second network node based on the LMR message returned by the second network node in response to the LMM message; wherein, the LMR message carries at least the total number of service frames received from the first network node by each forwarding interface connected to the communication link on the second network node.
10. An electronic device, characterized in that, include: Memory, processor; The memory is used to store computer programs; The processor is configured to invoke the computer program to implement the method as described in any one of claims 1-8.
11. A readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-8.
