CN103684923B - The method and the network equipment of a kind of packet loss measurement - Google Patents
The method and the network equipment of a kind of packet loss measurement Download PDFInfo
- Publication number
- CN103684923B CN103684923B CN201310722868.8A CN201310722868A CN103684923B CN 103684923 B CN103684923 B CN 103684923B CN 201310722868 A CN201310722868 A CN 201310722868A CN 103684923 B CN103684923 B CN 103684923B
- Authority
- CN
- China
- Prior art keywords
- data packet
- group
- node
- packet
- packet group
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/08—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
- H04L43/0823—Errors, e.g. transmission errors
- H04L43/0829—Packet loss
Landscapes
- Engineering & Computer Science (AREA)
- Environmental & Geological Engineering (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
本申请提供一种丢包测量的方法及网络设备,包括:第二节点接收第一节点发送的第一数据包,第一数据包属于第一数据包组,第一数据包组为第一节点向第二节点发送的数据包组,第一数据包包含第一数据包组的序列号和第一数据包数量,第一数据包数量用于标识第一数据包组包含的数据包的数量;第二节点接收第一节点发送的第二数据包;当第二节点确定第二数据包不属于第一数据包组时,统计接收到的属于第一数据包组的第二数据包数量;第二节点根据第一数据包数量和第二数据包数量确定第一数据包组的丢包数。采用本发明实施例的技术方案,有利于在负载分担场景下,提高丢包测量的准确性。
The present application provides a packet loss measurement method and network equipment, including: the second node receives the first data packet sent by the first node, the first data packet belongs to the first data packet group, and the first data packet group is the first node In the data packet group sent to the second node, the first data packet includes the sequence number of the first data packet group and the first data packet quantity, and the first data packet quantity is used to identify the quantity of data packets contained in the first data packet group; The second node receives the second data packet sent by the first node; when the second node determines that the second data packet does not belong to the first data packet group, counts the number of second data packets received belonging to the first data packet group; The second node determines the packet loss number of the first data packet group according to the first data packet quantity and the second data packet quantity. Adopting the technical solutions of the embodiments of the present invention is beneficial to improving the accuracy of packet loss measurement in a load sharing scenario.
Description
技术领域technical field
本发明涉及通信技术领域,尤其涉及一种丢包测量的方法及网络设备。The invention relates to the technical field of communications, in particular to a packet loss measurement method and network equipment.
背景技术Background technique
多协议标签交换(Multiprotocol Label Switching,简称MPLS)使用短而定长的标签(label)来封装报文分组。标签是一个长度固定、只具有本地意义的短标识符,用于唯一标识一个报文分组所属的转发等价类(Forwarding Equivalence Class,简称FEC)。Multiprotocol Label Switching (MPLS for short) uses short and fixed-length labels (labels) to encapsulate packet packets. A label is a short identifier with a fixed length and only local significance, and is used to uniquely identify the forwarding equivalence class (FEC for short) to which a packet belongs.
现有技术中,发送端可以向接收端发送带有请求信息的丢包检测消息(LossMeasurement Message,简称LMM),该LMM中包含了发送端发送数据包的本地发包计数值,当接收端接收到该LMM后,生成一个丢包检测回应(Loss Measurement Reply,简称LMR)消息,并将该LMR消息发送给该发送端。该LMR消息中包含有接收到该LMM时的收包计数值。该发送端可以根据发包计数值和该收包计数值进行丢包测量。然而,在负载分担的场景下,例如:发送端发送的多个数据包可能由于经由的路径不同,导致数据包晚于该LMM到达接收端,从而出现乱序问题,会导致丢包数测量结果不准确。In the prior art, the sending end can send a packet loss detection message (LossMeasurement Message, LMM for short) with request information to the receiving end. After the LMM generates a packet loss detection response (Loss Measurement Reply, LMR for short) message, and sends the LMR message to the sender. The LMR message includes the received packet count value when the LMM is received. The sending end can perform packet loss measurement according to the packet sending count value and the packet receiving count value. However, in a load sharing scenario, for example, multiple data packets sent by the sending end may arrive at the receiving end later than the LMM due to different paths, resulting in out-of-order problems, which will lead to packet loss measurement results Inaccurate.
发明内容Contents of the invention
本发明实施例提供一种丢包测量的方法及网络设备,有利于在负载分担场景下,提高丢包测量结果的准确性。Embodiments of the present invention provide a packet loss measurement method and network equipment, which are beneficial to improving the accuracy of packet loss measurement results in a load sharing scenario.
本发明的第一方面,提供一种丢包测量的方法,包括:A first aspect of the present invention provides a method for packet loss measurement, including:
第二节点接收第一节点发送的第一数据包,所述第一数据包属于第一数据包组,所述第一数据包组为所述第一节点向所述第二节点发送的数据包组,所述第一数据包包含所述第一数据包组的序列号和第一数据包数量,所述第一数据包数量用于标识所述第一数据包组包含的数据包的数量;The second node receives the first data packet sent by the first node, the first data packet belongs to a first data packet group, and the first data packet group is a data packet sent by the first node to the second node group, the first data packet includes a sequence number of the first data packet group and a first data packet quantity, and the first data packet quantity is used to identify the number of data packets contained in the first data packet group;
所述第二节点接收所述第一节点发送的第二数据包;The second node receives the second data packet sent by the first node;
当所述第二节点确定所述第二数据包不属于所述第一数据包组时,统计接收到的属于所述第一数据包组的第二数据包数量;When the second node determines that the second data packet does not belong to the first data packet group, counting the number of received second data packets belonging to the first data packet group;
所述第二节点根据所述第一数据包数量和所述第二数据包数量确定所述第一数据包组的丢包数。The second node determines the number of lost packets of the first data packet group according to the first number of data packets and the second number of data packets.
在第一种可能的实现方式中,根据第一方面,还包括:In a first possible implementation manner, according to the first aspect, it also includes:
当所述第二节点接收所述第一数据包组的数据包时,对接收的属于所述第一数据包组的数据包进行计数统计,相应地,根据所述统计的所述第一数据包组的数据包数量确定所述第二数据包数量。When the second node receives the data packets of the first data packet group, it counts the received data packets belonging to the first data packet group, and correspondingly, according to the statistics of the first data The number of data packets of the packet group determines the second number of data packets.
在第二种可能的实现方式中,结合第一方面和第一种可能的实现方式,所述第一数据包组中每个数据包封装有特殊标签,所述特殊标签包含所述第一数据包组的序列号和所述第一数据包数量。In the second possible implementation manner, in combination with the first aspect and the first possible implementation manner, each data packet in the first data packet group is encapsulated with a special tag, and the special tag contains the first data The sequence number of the packet group and the number of the first data packet.
在第三种可能的实现方式中,根据第二种可能的实现方式,还包括:In the third possible implementation, according to the second possible implementation, it also includes:
当所述第二节点判断所述第二数据包没有封装所述特殊标签时,确定所述第二数据包不属于所述第一数据包组,或者,When the second node determines that the second data packet does not encapsulate the special label, determine that the second data packet does not belong to the first data packet group, or,
当所述第二节点判断所述第二数据包所属的第二数据包组的序列号与第一数据包组的序列号不同时,确定所述第二数据包不属于所述第一数据包组。When the second node determines that the sequence number of the second data packet group to which the second data packet belongs is different from the sequence number of the first data packet group, determine that the second data packet does not belong to the first data packet Group.
在第四种可能的实现方式中,结合第一方面、第一种可能的实现方式、第二种可能的实现方式和第三种可能的实现方式,所述当所述第二节点确定所述第二数据包不属于所述第一数据包组之后,还包括:In a fourth possible implementation manner, in combination with the first aspect, the first possible implementation manner, the second possible implementation manner, and the third possible implementation manner, when the second node determines that the After the second data packet does not belong to the first data packet group, it also includes:
所述第二节点启动特定时长定时器;The second node starts a specific duration timer;
当所述定时器到期后,所述第二节点统计接收到的属于所述第一数据包组的所述第二数据包数量。When the timer expires, the second node counts the number of received second data packets belonging to the first data packet group.
在第五种可能的实现方式中,结合第一方面、第一种可能的实现方式、第二种可能的实现方式、第三种可能的实现方式和第四种可能的实现方式,所述第二节点根据所述第一数据包数量和所述第二数据包数量确定所述第一数据包组的丢包数,具体包括:In a fifth possible implementation, in combination with the first aspect, the first possible implementation, the second possible implementation, the third possible implementation and the fourth possible implementation, the first The second node determines the number of lost packets of the first data packet group according to the first data packet quantity and the second data packet quantity, specifically including:
对应所述第一数据包组的丢包数为Z=X-Y;The number of lost packets corresponding to the first data packet group is Z=X-Y;
其中,所述X表示第一数据包数量,所述Y表示第二数据包数量,所述Z表示所述丢包数。Wherein, the X represents the first number of data packets, the Y represents the second number of data packets, and the Z represents the number of lost packets.
本发明的第二方面,提供一种丢包测量的方法,包括:A second aspect of the present invention provides a method for packet loss measurement, including:
第一节点确定第一数据包组内所包含的第一数据包数量;The first node determines the number of first data packets included in the first data packet group;
所述第一节点向第二节点发送所述第一数据包组中的第一数据包,所述第一数据包包含所述第一数据包组的序列号和第一数据包数量,所述第一数据包数量用于标识所述第一数据包组包含的数据包的数量,所述第一数据包组为所述第一节点向所述第二节点发送的数据包组;The first node sends the first data packet in the first data packet group to the second node, the first data packet includes the sequence number and the first data packet quantity of the first data packet group, the The first number of data packets is used to identify the number of data packets included in the first data packet group, where the first data packet group is a data packet group sent by the first node to the second node;
当所述第一数据包组中的数据包发送完毕后,所述第一节点向所述第二节点发送第二数据包,所述第二数据包不属于所述第一数据包组。After the data packets in the first data packet group are completely sent, the first node sends a second data packet to the second node, and the second data packet does not belong to the first data packet group.
在第一种可能的实现方式中,根据第二方面,所述第一节点向第二节点发送第一数据包组中的第一数据包之前,还包括:In a first possible implementation manner, according to the second aspect, before the first node sends the first data packet in the first data packet group to the second node, the method further includes:
所述第一节点采用特殊标签对所述第一数据包进行封装,所述特殊标签包含所述第一数据包组的序列号和所述第一数据包数量。The first node encapsulates the first data packet with a special label, and the special label includes the serial number of the first data packet group and the quantity of the first data packet.
在第二种可能的实现方式中,根据第一种可能的实现方式,所述第一数据包组中的每个数据包都封装有所述特殊标签。In a second possible implementation manner, according to the first possible implementation manner, each data packet in the first data packet group is encapsulated with the special label.
本发明的第三方面,提供一种第二节点,包括:A third aspect of the present invention provides a second node, including:
接收单元,用于接收第一节点发送的第一数据包,所述第一数据包属于第一数据包组,所述第一数据包组为所述第一节点向所述第二节点发送的数据包组,所述第一数据包包含所述第一数据包组的序列号和第一数据包数量,所述第一数据包数量用于标识所述第一数据包组包含的数据包的数量;a receiving unit, configured to receive a first data packet sent by a first node, the first data packet belongs to a first data packet group, and the first data packet group is sent by the first node to the second node A data packet group, the first data packet includes a sequence number and a first data packet number of the first data packet group, and the first data packet number is used to identify the number of data packets contained in the first data packet group quantity;
所述接收单元,还用于接收所述第一节点发送的第二数据包;The receiving unit is further configured to receive the second data packet sent by the first node;
统计单元,用于确定所述第二数据包不属于所述第一数据包组时,统计接收到的属于所述第一数据包组的第二数据包数量;A statistical unit, configured to count the number of received second data packets belonging to the first data packet group when it is determined that the second data packet does not belong to the first data packet group;
计算单元,用于根据所述第一数据包数量和所述第二数据包数量确定所述第一数据包组的丢包数。A calculation unit, configured to determine the number of lost packets of the first data packet group according to the first number of data packets and the second number of data packets.
在第一种可能的实现方式中,根据第三方面,还包括:In the first possible implementation manner, according to the third aspect, it also includes:
计数单元,用于对接收的属于所述第一数据包组的数据包进行计数统计,相应地,根据所述统计的所述第一数据包组的数据包数量确定所述第二数据包数量。A counting unit, configured to count and count the received data packets belonging to the first data packet group, and correspondingly, determine the second data packet quantity according to the counted data packet quantity of the first data packet group .
在第二种可能的实现方式中,结合第三方面和第一种可能的实现方式,所述第一数据包组中每个数据包封装有特殊标签,所述特殊标签包含所述第一数据包组的序列号和所述第一数据包数量。In the second possible implementation manner, in combination with the third aspect and the first possible implementation manner, each data packet in the first data packet group is encapsulated with a special label, and the special label contains the first data The sequence number of the packet group and the number of the first data packet.
在第三种可能的实现方式中,根据第二种可能的实现方式,还包括:In the third possible implementation, according to the second possible implementation, it also includes:
确定单元,用于当判断所述第二数据包没有封装所述特殊标签时,确定所述第二数据包不属于所述第一数据包组,或者,A determining unit, configured to determine that the second data packet does not belong to the first data packet group when it is judged that the second data packet does not encapsulate the special label, or,
当判断所述第二数据包所属的第二数据包组的序列号与第一数据包组的序列号不同时,确定所述第二数据包不属于所述第一数据包组。When it is determined that the sequence number of the second data packet group to which the second data packet belongs is different from the sequence number of the first data packet group, it is determined that the second data packet does not belong to the first data packet group.
在第四种可能的实现方式中,结合第一方面、第一种可能的实现方式、第二种可能的实现方式和第三种可能的实现方式,还包括:In the fourth possible implementation, combined with the first aspect, the first possible implementation, the second possible implementation and the third possible implementation, it also includes:
定时单元,用于启动特定时长定时器;Timing unit for starting a specific duration timer;
所述统计单元具体用于当所述定时单元启动的所述定时器到期后,确定接收到的属于所述第一数据包组的所述第二数据包数量。The statistics unit is specifically configured to determine the number of the received second data packets belonging to the first data packet group after the timer started by the timing unit expires.
在第五种可能的实现方式中,结合第一方面、第一种可能的实现方式、第二种可能的实现方式、第三种可能的实现方式和第四种可能的实现方式,所述计算单元具体用于:In a fifth possible implementation, in combination with the first aspect, the first possible implementation, the second possible implementation, the third possible implementation and the fourth possible implementation, the calculation Units are used specifically for:
对应所述第一数据包组的丢包数为Z=X-Y;The number of lost packets corresponding to the first data packet group is Z=X-Y;
其中,所述X表示第一数据包数量,所述Y表示第二数据包数量,所述Z表示所述丢包数。Wherein, the X represents the first number of data packets, the Y represents the second number of data packets, and the Z represents the number of lost packets.
本发明的第四方面,提供一种第一节点,包括:A fourth aspect of the present invention provides a first node, including:
确定单元,用于确定第一数据包组内所包含的第一数据包数量;a determining unit, configured to determine the number of first data packets contained in the first data packet group;
发送单元,用于向第二节点发送所述第一数据包组中的第一数据包,所述第一数据包包含所述第一数据包组的序列号和第一数据包数量,所述第一数据包数量用于标识所述第一数据包组包含的数据包的数量,所述第一数据包组为所述第一节点向所述第二节点发送的数据包组;a sending unit, configured to send a first data packet in the first data packet group to a second node, where the first data packet includes a sequence number and a first data packet quantity of the first data packet group, the The first number of data packets is used to identify the number of data packets included in the first data packet group, where the first data packet group is a data packet group sent by the first node to the second node;
所述发送单元,还用于当所述第一数据包组中的数据包发送完毕后,向所述第二节点发送第二数据包,所述第二数据包不属于所述第一数据包组。The sending unit is further configured to send a second data packet to the second node after the data packets in the first data packet group are sent, and the second data packet does not belong to the first data packet Group.
在第一种可能的实现方式中,根据第四方面,还包括:In the first possible implementation manner, according to the fourth aspect, it also includes:
封装单元,用于所述发送单元向第二节点发送第一数据包组中的第一数据包之前,采用特殊标签对所述第一数据包进行封装,所述特殊标签包含所述第一数据包组的序列号和所述第一数据包数量。An encapsulating unit, configured to encapsulate the first data packet with a special label before the sending unit sends the first data packet in the first data packet group to the second node, and the special label contains the first data The sequence number of the packet group and the number of the first data packet.
在第二种可能的实现方式中,根据第一种可能的实现方式,所述封装单元,还用于对所述第一数据包组中的每个数据包封装所述特殊标签。In a second possible implementation manner, according to the first possible implementation manner, the encapsulation unit is further configured to encapsulate the special label for each data packet in the first data packet group.
在上述技术方案中,该第二节点接收第一节点发送的第一数据包,所述第一数据包属于第一数据包组,所述第一数据包包含所述第一数据包组的序列号和第一数据包数量,所述第一数据包数量用于标识所述第一数据包组包含的数据包的数量,当所述第二节点接收到不属于所述第一数据包组的第二数据包时,统计接收到的属于所述第一数据包组的第二数据包数量,所述第二节点根据所述第一数据包数量和所述第二数据包数量确定所述第一数据包组的丢包数,有利于在负载分担场景下,提高丢包测量结果的准确性。In the above technical solution, the second node receives the first data packet sent by the first node, the first data packet belongs to the first data packet group, and the first data packet contains the sequence of the first data packet group number and the first data packet number, the first data packet number is used to identify the number of data packets contained in the first data packet group, when the second node receives a packet that does not belong to the first data packet group For the second data packet, count the number of second data packets received belonging to the first data packet group, and the second node determines the first data packet number according to the first data packet number and the second data packet number The packet loss number of a data packet group is beneficial to improve the accuracy of packet loss measurement results in load sharing scenarios.
附图说明Description of drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图做一简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description These are some embodiments of the present invention. For those skilled in the art, other drawings can also be obtained according to these drawings without any creative effort.
图1为本发明实施例提供的一种丢包测量的方法的流程图示意图;FIG. 1 is a schematic flowchart of a method for packet loss measurement provided by an embodiment of the present invention;
图2为本发明实施例提供的一种丢包测量的方法的流程图示意图;FIG. 2 is a schematic flowchart of a method for packet loss measurement provided by an embodiment of the present invention;
图3为本发明实施例提供的一种第一节点和第二节点交互流程图示意图;FIG. 3 is a schematic diagram of an interaction flow chart between a first node and a second node provided by an embodiment of the present invention;
图4为本发明实施例提供的MPLS特殊标签格式示意图;FIG. 4 is a schematic diagram of the MPLS special label format provided by the embodiment of the present invention;
图5为本发明实施例提供的第二节点的状态切换示意图;FIG. 5 is a schematic diagram of state switching of a second node provided by an embodiment of the present invention;
图6为本发明实施例提供的一种第二节点的结构示意图;FIG. 6 is a schematic structural diagram of a second node provided by an embodiment of the present invention;
图7为本发明实施例提供的一种第二节点的结构示意图;FIG. 7 is a schematic structural diagram of a second node provided by an embodiment of the present invention;
图8为本发明实施例提供的一种第二节点的结构示意图;FIG. 8 is a schematic structural diagram of a second node provided by an embodiment of the present invention;
图9为本发明实施例提供的一种第二节点的结构示意图;FIG. 9 is a schematic structural diagram of a second node provided by an embodiment of the present invention;
图10为本发明实施例提供的一种第一节点的结构示意图;FIG. 10 is a schematic structural diagram of a first node provided by an embodiment of the present invention;
图11为本发明实施例提供的一种第一节点的结构示意图;FIG. 11 is a schematic structural diagram of a first node provided by an embodiment of the present invention;
图12为本发明实施例提供的一种第二节点的结构示意图;FIG. 12 is a schematic structural diagram of a second node provided by an embodiment of the present invention;
图13为本发明实施例提供的一种第一节点的结构示意图。Fig. 13 is a schematic structural diagram of a first node provided by an embodiment of the present invention.
具体实施方式detailed description
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments It is a part of embodiments of the present invention, but not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.
图1为本发明实施例提供的一种丢包测量的方法的流程图示意图。如图1所示,本实施例的丢包测量的方法,包括如下步骤:FIG. 1 is a schematic flowchart of a method for packet loss measurement provided by an embodiment of the present invention. As shown in Figure 1, the method for packet loss measurement of the present embodiment includes the following steps:
步骤S100、第二节点接收第一节点发送的第一数据包,所述第一数据包属于第一数据包组,所述第一数据包组为所述第一节点向所述第二节点发送的数据包组,所述第一数据包包含所述第一数据包组的序列号和第一数据包数量,所述第一数据包数量用于标识所述第一数据包组包含的数据包的数量。Step S100, the second node receives the first data packet sent by the first node, the first data packet belongs to the first data packet group, and the first data packet group is sent by the first node to the second node The data packet group, the first data packet includes the sequence number of the first data packet group and the first data packet number, the first data packet number is used to identify the data packets contained in the first data packet group quantity.
步骤S101、所述第二节点接收所述第一节点发送的第二数据包。Step S101, the second node receives the second data packet sent by the first node.
步骤S102、当所述第二节点确定所述第二数据包不属于所述第一数据包组时,统计接收到的属于所述第一数据包组的第二数据包数量。Step S102. When the second node determines that the second data packet does not belong to the first data packet group, count the number of received second data packets belonging to the first data packet group.
步骤S103、所述第二节点根据所述第一数据包数量和所述第二数据包数量确定所述第一数据包组的丢包数。Step S103, the second node determines the number of lost packets of the first data packet group according to the first number of data packets and the second number of data packets.
本实施例各步骤的执行主体为第二节点,在实际中,该第二节点可以是MPLS域中的标签交换路由器(Label Switched Router,LSR),该第二节点可以是标签交换路径(Label Switched Path,简称LSP)上除头节点外的任意节点,即可以是LSP上的中间节点或尾节点。The execution subject of each step in this embodiment is the second node. In practice, the second node may be a label switched router (Label Switched Router, LSR) in the MPLS domain, and the second node may be a label switched path (Label Switched Router). Any node on the Path (LSP for short) except the head node can be an intermediate node or a tail node on the LSP.
进一步地,由于上述第一数据包包含第一数据包组的序列号和第一数据包数量,因此,第二节点可以根据上述第一数据包组的序列号确定第一数据包所属的第一数据包组及上述第一数据包组的数量。Further, since the first data packet includes the sequence number of the first data packet group and the number of the first data packet, the second node can determine the first data packet to which the first data packet belongs according to the sequence number of the first data packet group The data packet group and the quantity of the first data packet group.
可选地,所述第一数据包组中每个数据包封装有特殊标签,所述特殊标签包含所述第一数据包组的序列号和所述第一数据包数量。作为一种可行的实施方式,第二节点可以通过解析封装在第一数据包上的特殊标签,获取第一数据包组的序列号和第一数据包数量。例如:该特殊标签可以是MPLS标签,那么,第二节点可以用现有技术的方法解析该MPLS标签,并从中获取上述特殊标签包含的第一数据包组的序列号和所述第一数据包数量。Optionally, each data packet in the first data packet group is encapsulated with a special label, and the special label includes a sequence number of the first data packet group and the number of the first data packets. As a feasible implementation manner, the second node may obtain the sequence number of the first data packet group and the quantity of the first data packet by analyzing the special label encapsulated on the first data packet. For example: the special label can be an MPLS label, then, the second node can analyze the MPLS label by means of the prior art, and obtain the sequence number of the first data packet group contained in the special label and the first data packet quantity.
可选地,当所述第二节点接收所述第一数据包组的数据包时,对接收的属于所述第一数据包组的数据包进行计数统计,相应地,根据所述统计的所述第一数据包组的数据包数量确定所述第二数据包数量。Optionally, when the second node receives the data packets of the first data packet group, it counts the received data packets belonging to the first data packet group, and correspondingly, according to the statistics of the The number of data packets in the first data packet group determines the second number of data packets.
作为另一种可行的实施方式,第二节点还可以读取第一数据包中直接携带的特殊标识,通过上述特殊标识来获取所述第一数据包组的序列号和所述第一数据包数量。需要说明的是,第二节点从第一数据包中获取特殊标识的具体方式在此不做出限制,例如:第二节点可以与第一节点约定好位置,并在约定位置读取第一数据包的特殊标识,也可以直接遍历第一数据包,从中获取特殊标识。As another feasible implementation manner, the second node can also read the special identifier directly carried in the first data packet, and obtain the sequence number of the first data packet group and the quantity. It should be noted that the specific method for the second node to obtain the special identifier from the first data packet is not limited here, for example: the second node can agree on a location with the first node, and read the first data at the agreed location The special identifier of the package can also directly traverse the first data packet to obtain the special identifier.
所述第一节点对所述第一数据包组中的数据包进行连续发送,即所述第一节点发送了所述第一数据包组中的第一个数据包后,连续发送所述第一数据包组中的其他数据包。相应地,所述第二节点在接收到所述第一节点发送的所述第一数据包组的第一个数据包后,会连续接收到所述第一数据包组中的其他数据包。The first node continuously sends the data packets in the first data packet group, that is, after the first node sends the first data packet in the first data packet group, it continuously sends the first data packet other packets in a packet group. Correspondingly, after receiving the first data packet of the first data packet group sent by the first node, the second node will continuously receive other data packets in the first data packet group.
在该第二节点接收到第一节点发送的第二数据包后,第二节点需要确定上述第二数据包是否属于第一数据包组。当所述第二节点判断所述第二数据包没有封装所述特殊标签时,确定所述第二数据包不属于所述第一数据包组,或者,当所述第二节点判断所述第二数据包所属的第二数据包组的序列号与第一数据包组的序列号不同时,确定所述第二数据包不属于所述第一数据包组。After the second node receives the second data packet sent by the first node, the second node needs to determine whether the second data packet belongs to the first data packet group. When the second node judges that the second data packet does not encapsulate the special label, it determines that the second data packet does not belong to the first data packet group, or, when the second node judges that the second data packet When the sequence number of the second data packet group to which the second data packet belongs is different from the sequence number of the first data packet group, it is determined that the second data packet does not belong to the first data packet group.
具体的,若第二数据包不属于第一数据包组,则第二节点可以根据上述第一数据包组的序列号,统计接收到的属于该第一数据包组的数据包的第二数据包数量。Specifically, if the second data packet does not belong to the first data packet group, the second node can count the second data of the received data packet belonging to the first data packet group according to the sequence number of the first data packet group Package quantity.
当确定了上述第二数据包数量后,第二节点可以根据上述第一数据包数量和第二数据包数量,确定所述第一数据包组中的数据包在所述第二节点上的丢包数。After the above-mentioned second data packet quantity is determined, the second node can determine the loss rate of the data packets in the first data packet group on the second node according to the above-mentioned first data packet quantity and the second data packet quantity. number of packages.
在上述实施例中,该第二节点接收第一节点发送的第一数据包,所述第一数据包属于第一数据包组,所述第一数据包包含所述第一数据包组的序列号和第一数据包数量,当所述第二节点接收到不属于所述第一数据包组的第二数据包时,统计接收到的属于所述第一数据包组的第二数据包数量,所述第二节点根据所述第一数据包数量和所述第二数据包数量确定所述第一数据包组的丢包数,由于所述第二节点只有在接收到不属于所述第一数据包组的所述第二数据包时,才进行丢包检测,有利于在负载分担场景下,提高丢包测量结果的准确性。In the above embodiment, the second node receives the first data packet sent by the first node, the first data packet belongs to the first data packet group, and the first data packet contains the sequence of the first data packet group number and the number of first data packets, when the second node receives a second data packet that does not belong to the first data packet group, count the number of received second data packets that belong to the first data packet group , the second node determines the number of lost packets of the first data packet group according to the first data packet number and the second data packet number, because the second node only receives packets that do not belong to the first data packet Packet loss detection is performed only when the second data packet of a data packet group is in use, which is beneficial to improving the accuracy of packet loss measurement results in a load sharing scenario.
图2为本发明实施例提供的一种丢包测量的方法的流程图示意图。如图2所示,本实施例的丢包测量的方法,包括如下步骤:FIG. 2 is a schematic flowchart of a method for measuring packet loss provided by an embodiment of the present invention. As shown in Figure 2, the method for packet loss measurement in this embodiment includes the following steps:
步骤S200、第一节点确定第一数据包组内所包含的第一数据包数量。Step S200, the first node determines the number of first data packets included in the first data packet group.
步骤S201、所述第一节点向第二节点发送所述第一数据包组中的第一数据包,所述第一数据包包含所述第一数据包组的序列号和第一数据包数量,所述第一数据包数量用于标识所述第一数据包组包含的数据包的数量,所述第一数据包组为所述第一节点向所述第二节点发送的数据包组。Step S201, the first node sends the first data packet in the first data packet group to the second node, the first data packet includes the sequence number of the first data packet group and the number of first data packets , the first data packet quantity is used to identify the quantity of data packets included in the first data packet group, where the first data packet group is a data packet group sent by the first node to the second node.
步骤S202、当所述第一数据包组中的数据包发送完毕后,所述第一节点向所述第二节点发送第二数据包,所述第二数据包不属于所述第一数据包组。Step S202, after the data packets in the first data packet group are sent, the first node sends a second data packet to the second node, and the second data packet does not belong to the first data packet Group.
本实施例中各步骤的执行主体为第一节点,在实际中,该第一节点可以是MPLS域中的LSR,它可以是LSP上除尾节点外的任意节点,即它可以是确定LSP上的头节点或中间节点。The execution subject of each step in this embodiment is the first node. In practice, the first node can be an LSR in the MPLS domain, and it can be any node on the LSP except the tail node, that is, it can be a node on the determined LSP. head node or middle node.
本实施例中,第一节点可以不向第二节点发送LMM消息来测量丢包数,而是可以直接通过所发送的第一数据包来标识该数据包所属的第一数据包组以及该数据包组中的第一数据包数量。In this embodiment, the first node may not send an LMM message to the second node to measure the number of lost packets, but may directly use the sent first data packet to identify the first data packet group to which the data packet belongs and the data Number of first packets in the packet group.
可选地,所述第一节点向第二节点发送第一数据包组中的第一数据包之前,还包括:Optionally, before the first node sends the first data packet in the first data packet group to the second node, the method further includes:
所述第一节点采用特殊标签对所述第一数据包进行封装,所述特殊标签包含所述第一数据包组的序列号和所述第一数据包数量。所述第一数据包组中的每个数据包都封装有所述特殊标签。The first node encapsulates the first data packet with a special label, and the special label includes the serial number of the first data packet group and the quantity of the first data packet. Each data packet in the first data packet group is encapsulated with the special label.
所述第一节点对所述第一数据包组中的数据包进行连续发送,即所述第一节点发送了所述第一数据包组中的第一个数据包后,连续发送所述第一数据包组中的其他数据包。相应地,所述第二节点在接收到所述第一节点发送的所述第一数据包组的第一个数据包后,会连续接收到所述第一数据包组中的其他数据包。The first node continuously sends the data packets in the first data packet group, that is, after the first node sends the first data packet in the first data packet group, it continuously sends the first data packet other packets in a packet group. Correspondingly, after receiving the first data packet of the first data packet group sent by the first node, the second node will continuously receive other data packets in the first data packet group.
在该第二节点接收到第一节点发送的第二数据包后,第二节点需要确定上述第二数据包是否属于第一数据包组。当所述第二节点判断所述第二数据包没有封装所述特殊标签时,确定所述第二数据包不属于所述第一数据包组,或者,当所述第二节点判断所述第二数据包所属的第二数据包组的序列号与第一数据包组的序列号不同时,确定所述第二数据包不属于所述第一数据包组。After the second node receives the second data packet sent by the first node, the second node needs to determine whether the second data packet belongs to the first data packet group. When the second node judges that the second data packet does not encapsulate the special label, it determines that the second data packet does not belong to the first data packet group, or, when the second node judges that the second data packet When the sequence number of the second data packet group to which the second data packet belongs is different from the sequence number of the first data packet group, it is determined that the second data packet does not belong to the first data packet group.
具体的,若第二数据包与第一数据包的类型相同,即第二数据包包含所述第一数据包组的序列号和所述第一数据包数量,那么此时第一节点在发送第二数据包时,只需重复执行步骤S200和步骤S201即可;若第二数据包为正常数据包,即该第二数据包并未包含所述第一数据包组的序列号和所述第一数据包数量,此时第一节点可以执行现有技术中对正常数据包的转发操作。Specifically, if the type of the second data packet is the same as that of the first data packet, that is, the second data packet contains the sequence number of the first data packet group and the number of the first data packet, then the first node is sending For the second data packet, it is only necessary to repeatedly execute step S200 and step S201; if the second data packet is a normal data packet, that is, the second data packet does not include the sequence number of the first data packet group and the The first number of data packets. At this time, the first node can perform the normal data packet forwarding operation in the prior art.
由于第一数据包携带所述第一数据包组的序列号和所述第一数据包数量,因此,第二节点可以根据接收到的第一数据包和第二数据包,确定其接收到的第一数据包组的第二数据包数量,并根据上述第一数据包数量和第二数据包数量确定第一数据包组的丢包数。Since the first data packet carries the sequence number of the first data packet group and the number of the first data packet, the second node can determine the received first data packet and the second data packet based on the received The second data packet number of the first data packet group, and determine the packet loss number of the first data packet group according to the above-mentioned first data packet number and the second data packet number.
上述实施例通过发送包含序列号和第一数据包数量的第一数据包,使得第二节点可以获取第一数据包所在的第一数据包组和第一数据包组的第一数据包数量,并根据接收的第一数据包和第二数据包,确定第一数据包组的丢包数,由于所述第二节点只有在接收到不属于所述第一数据包组的所述第二数据包时,才进行丢包检测,有利于在负载分担场景下,提高丢包测量结果的准确性。In the above embodiment, by sending the first data packet including the sequence number and the first data packet quantity, the second node can obtain the first data packet group where the first data packet is located and the first data packet quantity of the first data packet group, And according to the received first data packet and the second data packet, determine the packet loss number of the first data packet group, because the second node only receives the second data that does not belong to the first data packet group Packet loss detection is performed only when packets are received, which is beneficial to improve the accuracy of packet loss measurement results in load sharing scenarios.
图3为本发明实施例提供的一种第一节点和第二节点交互流程图示意图。如图3所示,该交互流程包括以下步骤:Fig. 3 is a schematic diagram of an interaction flow chart between a first node and a second node provided by an embodiment of the present invention. As shown in Figure 3, the interaction process includes the following steps:
步骤S300、第一节点确定第一数据包组内所包含的第一数据包数量。Step S300, the first node determines the number of first data packets included in the first data packet group.
在上述步骤中,执行主体为第一节点,在实际中,该节点可以是MPLS域中的LSR。In the above steps, the execution subject is the first node. In practice, this node may be an LSR in the MPLS domain.
具体的,第一数据包可以包含其所属的该第一数据包组的序列号和所述第一数据包数量。该第一数据包数量可以通过以下方式来标识:Specifically, the first data packet may include the sequence number of the first data packet group to which it belongs and the quantity of the first data packet. The first number of data packets may be identified in the following manner:
第一数据包包含发送计数x,那么,可选的,第一节点在每轮统计中的发包数量,即上述第一数据包数量可以表示为10x+1,若用8比特表示x,那么第一节点每轮统计至少需要发送10个报文,至多发送10256个报文,第一节点每轮统计中的发包数量即为第一数据包数量。第一节点可以根据系统配置的流量大小和统计时长,自动计算出每轮统计中发送的第一数据包包含的发送计数。例如,假设系统的流量大小为1万包每秒,系统配置的统计时长为30秒,也就是说,此时一轮统计需要传30万个数据包。那么,第一节点根据10x+1=300000计算出x的值,从而便可确定第一数据包包含的发送计数。此外,在实际中,第一节点在每轮统计中可以对发送的第一数据包进行计数,以记录其发送的第一数据包的个数,当第一数据包的个数到达10x+1个时,第一节点即可确定该轮统计的第一数据包发送完毕。The first data packet contains the sending count x, then, optionally, the number of packets sent by the first node in each round of statistics, that is, the number of the first data packet above can be expressed as 10 x+1 , if x is represented by 8 bits, then The first node needs to send at least 10 messages and at most 10256 messages in each round of statistics, and the number of packets sent by the first node in each round of statistics is the number of first data packets. The first node can automatically calculate the sending count included in the first data packet sent in each round of statistics according to the traffic size and the statistics time period configured by the system. For example, assuming that the traffic volume of the system is 10,000 packets per second, and the statistics period configured by the system is 30 seconds, that is to say, 300,000 data packets need to be transmitted for one round of statistics. Then, the first node calculates the value of x according to 10 x+1 =300000, so as to determine the sending count included in the first data packet. In addition, in practice, the first node can count the first data packets sent in each round of statistics to record the number of the first data packets it sends, when the number of the first data packets reaches 10 x+ 1 , the first node can determine that the first data packet of this round of statistics has been sent.
需要说明的是,由于每轮统计中,上述第一数据包数量为10x+1,但在实际中,第一节点有可能发送的第一数据包不足10x+1个,也就是说,虽然第一节点发送的第一数据包包含的发送计数为x,但其实际发送的第一数据包个数为n,该n值小于10x+1个,此时如果接收第一数据包的第二节点根据上述发送计数确定该轮统计中第一节点发送的第一数据包个数,并计算第一数据包组的丢包数,就会误以为第一节点没有发送的10x+1-n个为丢失的数据包,从而导致丢包数统计不准确。可选的,第一节点可以自己构造10x+1-n个无效数据包,使得其发送的第一数据包的总数为10x+1,并将上述10x+1个第一数据包发送出去。以第一节点需要发30万个第一数据包为例,比如此时用10x+1=300000计算x的值,由于没有正整数能够满足上述等式,因此可以取一个近似的整数解,如x等于5,此时10x+1表示100万个数据包,但第一节点需要发送的第一数据包的总数只有30万个,可选的,第一节点可以自己构造70万个无效数据包,使得其发送的总数据包个数为100万个,并将上述100万个数据包发送出去。具体的,第一节点首先发送上述30万个第一数据包,并在发送第一个第一数据包时,就启动一个定时器,若定时器到达时间时,第一节点发送的第一数据包个数不到100万个,则此时第一节点可以自己构造70万个无效数据包,并将其发送出去。由于第一节点共发送了100万个数据包,因此第二节点可以根据接收到的第一数据包包含的发送计数x=5,获取第一节点发送的第一数据包组的第一数据包数量为100万个。It should be noted that, since in each round of statistics, the number of the above-mentioned first data packets is 10 x+1 , but in practice, the first node may send less than 10 x+1 first data packets, that is to say, Although the sending count contained in the first data packet sent by the first node is x, the number of the first data packets actually sent by it is n, and the value of n is less than 10 x+1 . At this time, if the first data packet is received The second node determines the number of first data packets sent by the first node in this round of statistics according to the above sending count, and calculates the number of lost packets of the first data packet group, and will mistakenly think that the first node did not send 10 x+1 -n is lost data packets, resulting in inaccurate statistics of lost packets. Optionally, the first node can construct 10 x+1 -n invalid data packets by itself, so that the total number of the first data packets it sends is 10 x+1 , and send the above-mentioned 10 x+1 first data packets go out. Take the first node that needs to send 300,000 first data packets as an example. For example, use 10 x+1 =300000 to calculate the value of x at this time. Since there is no positive integer that can satisfy the above equation, an approximate integer solution can be taken. If x is equal to 5, then 10 x+1 means 1 million data packets, but the total number of first data packets that the first node needs to send is only 300,000. Optionally, the first node can construct 700,000 invalid packets by itself Data packets, so that the total number of data packets sent by it is 1 million, and the above-mentioned 1 million data packets are sent out. Specifically, the first node first sends the above-mentioned 300,000 first data packets, and starts a timer when sending the first first data packet. If the timer reaches the time, the first data packet sent by the first node If the number of packets is less than 1 million, the first node can construct 700,000 invalid data packets by itself and send them out. Since the first node sent a total of 1 million data packets, the second node can obtain the first data packet of the first data packet group sent by the first node according to the sending count x=5 contained in the received first data packet The quantity is 1 million.
此外,10x+1只是第一节点和第二节点约定的一种计数方式,实际操作中不一定使用该公式,也可以用其他收发端公知的计算公式。In addition, 10 x+1 is only a counting method agreed upon by the first node and the second node, and this formula may not necessarily be used in actual operation, and other well-known calculation formulas at the transmitting and receiving ends may also be used.
步骤S301、第一节点采用特殊标签对第一数据包进行封装。Step S301, the first node encapsulates the first data packet with a special label.
具体的,第一节点可以用特殊标签对第一数据包进行封装,并且,该特殊标签中可以包含第一数据包组的序列号和第一数据包数量。可选的,第一节点可以为第一数据包组中的每个数据包都封装上述特殊标签。不同类型的特殊标签可以具有不同的格式,以MPLS标签为例:MPLS标签长度是固定的,用于唯一标识一个分组所属的转发等价类(ForwardingEquivalence Class,简称FEC)。通常标签的长度为4个字节,即32比特。本发明实施例中,可以对现有的MPLS类型的特殊标签所包含的32位比特进行重新定义,图4为本发明实施例提供的MPLS特殊标签格式示意图。如图4所示,该特殊标签可以包括:Specifically, the first node may encapsulate the first data packet with a special label, and the special label may include the sequence number of the first data packet group and the quantity of the first data packet. Optionally, the first node may encapsulate the above special label for each data packet in the first data packet group. Different types of special labels can have different formats. Taking MPLS labels as an example: the length of an MPLS label is fixed, and it is used to uniquely identify the Forwarding Equivalence Class (FEC) to which a packet belongs. Usually the length of the label is 4 bytes, that is, 32 bits. In the embodiment of the present invention, the 32 bits contained in the existing MPLS-type special label can be redefined. FIG. 4 is a schematic diagram of the format of the MPLS special label provided by the embodiment of the present invention. As shown in Figure 4, this special label can include:
特殊标签值(Special Label),该特殊标签值可以为一保留标签;Special label value (Special Label), the special label value can be a reserved label;
序列号(Seq),用于携带该第一数据包组的序列号;A sequence number (Seq), used to carry the sequence number of the first data packet group;
栈底标记(S),栈底标识;Stack bottom mark (S), stack bottom mark;
发送计数(Tx count),用于标识该第一数据包数量。The sending count (Tx count) is used to identify the number of the first data packets.
其中,特殊标签值可以用于表示当前标签是否为特殊标签,它的长度为20比特,在实际使用时,该值可以取MPLS标签堆栈编码即RFC3032中规定的4-15这几个保留标签中,尚未被其他协议占用的一个标签。需要说明的是,只要第一节点发送给第二节点的数据包被封装了上述特殊标签,无论它们是否属于同一数据包组,它们的特殊标签值都是相同的;序列号用于标识第一数据包所属的第一数据包组,它的长度为3比特,不同数据包组的数据包所封装的MPLS标签可以对应不同的序列号,第一节点发送完一组数据包后,会将这个序列号做递增处理,以便于区分不同数据包所在的不同数据包组;栈底标记可以与现有技术定义相同,表示MPLS支持标签的分层结构,即支持多层标签,它的长度为1比特,当值为1时表示是最底层标签;发送计数可以用于标识第一数据包组的第一数据包数量,它的长度为8比特。Among them, the special label value can be used to indicate whether the current label is a special label, and its length is 20 bits. In actual use, this value can be selected from the MPLS label stack code, that is, the 4-15 reserved labels specified in RFC3032 , a label not already occupied by another protocol. It should be noted that as long as the data packets sent by the first node to the second node are encapsulated with the above-mentioned special tags, no matter whether they belong to the same data packet group or not, their special tag values are the same; the sequence number is used to identify the first The first data packet group to which the data packet belongs has a length of 3 bits. The MPLS labels encapsulated by the data packets of different data packet groups can correspond to different sequence numbers. After the first node sends a group of data packets, it will send this The serial number is incremented so as to distinguish the different data packet groups where different data packets are located; the bottom mark of the stack can be defined the same as in the prior art, indicating that MPLS supports the hierarchical structure of labels, that is, multi-layer labels are supported, and its length is 1 bit, when the value is 1, it represents the bottom label; the sending count can be used to identify the number of the first data packets of the first data packet group, and its length is 8 bits.
步骤S302、第一节点向第二节点发送第一数据包组中的第一数据包。Step S302, the first node sends the first data packet in the first data packet group to the second node.
该步骤与步骤S201的描述相同,在此不再赘述。This step is the same as the description of step S201, and will not be repeated here.
步骤S303、第一节点向第二节点发送第二数据包。Step S303, the first node sends the second data packet to the second node.
具体的,第一节点在发送完第一数据包组中的第一数据包后,还可以向第二节点发送第二数据包,该第二数据包并不属于该第一数据包组。Specifically, after sending the first data packet in the first data packet group, the first node may also send a second data packet to the second node, and the second data packet does not belong to the first data packet group.
第一节点在发送完第一数据包组中的数据包后,可以根据实际需要,对上述第二数据包进行两种不同的处理。一种是终止为第二数据包组中的第二数据包封装特殊标签,而只是按照确定的LSP路径完成转发,此时的第二数据包即为没有封装特殊标签的正常数据包,这种处理方式适用于按需统计,即一次性统计,也就是系统只需要对第一数据包组的丢包数进行统计;另一种情况是,若系统配置的统计需求为连续性统计,也就是需要进行多轮统计,那么,第一节点在发完上述第一数据包组之后,就要为下一次统计做准备。可选的,第一节点可以对第二数据包组的第二数据包包含的序列号做循环递增处理,并重复上述步骤S300~S302发送第二数据包。例如,第一节点为第一数据包组中的第一数据包封装了序列号为0的特殊标签,那么在为第二数据包组的数据包封装特殊标签时,就将该第二数据包组中的数据包的序列号递增为1,当还有多个数据包组时,也对后续的每组数据包做类似递增处理即可。需要说明的是,由于特殊标签的序列号为3比特,因此只能表示0-7这8个不同数字,因此,当序列号递增至7后,第一节点在为后续数据包组内的数据包封装特殊标签时,需将序列号重新置为0,以上过程即为序列号的循环递增过程。此外,这里并不限定第一节点发送的数据包组的个数,当发送多个不同的数据包组时,第二节点可以对每个数据包组中的数据包重复上述步骤S300~S302的操作。After sending the data packets in the first data packet group, the first node may perform two different processes on the second data packet according to actual needs. One is to terminate encapsulation of a special label for the second data packet in the second data packet group, and only complete forwarding according to the determined LSP path. At this time, the second data packet is a normal data packet without a special label encapsulation. The processing method is suitable for on-demand statistics, that is, one-time statistics, that is, the system only needs to count the number of lost packets of the first data packet group; another case is, if the statistical requirement of the system configuration is continuous statistics, that is, Multiple rounds of statistics are required. Then, after the first node sends the above-mentioned first data packet group, it needs to prepare for the next statistics. Optionally, the first node may perform cyclic increment processing on the sequence number included in the second data packet of the second data packet group, and repeat the above steps S300-S302 to send the second data packet. For example, if the first node encapsulates a special label with a sequence number of 0 for the first data packet in the first data packet group, then when encapsulating a special label for a data packet in the second data packet group, the second data packet The serial numbers of the data packets in the group are incremented to 1, and when there are multiple data packet groups, similar increment processing can be performed on each subsequent group of data packets. It should be noted that since the serial number of the special label is 3 bits, it can only represent 8 different numbers from 0 to 7. Therefore, when the serial number is incremented to 7, the first node is writing data in the subsequent data packet group. When encapsulating a special label, the serial number needs to be reset to 0, and the above process is the cyclic increment process of the serial number. In addition, the number of data packet groups sent by the first node is not limited here. When sending multiple different data packet groups, the second node can repeat the above steps S300 to S302 for the data packets in each data packet group. operate.
步骤S304、第二节点接收第一节点发送的第一数据包。Step S304, the second node receives the first data packet sent by the first node.
步骤S305、第二节点接收第一节点发送的第二数据包。Step S305, the second node receives the second data packet sent by the first node.
步骤S306、第二节点判断第二数据包是否属于第一数据包组。Step S306, the second node judges whether the second data packet belongs to the first data packet group.
当所述第二节点判断所述第二数据包没有封装所述特殊标签时,确定所述第二数据包不属于所述第一数据包组,或者,当所述第二节点判断所述第二数据包所属的第二数据包组的序列号与第一数据包组的序列号不同时,确定所述第二数据包不属于所述第一数据包组。When the second node judges that the second data packet does not encapsulate the special label, it determines that the second data packet does not belong to the first data packet group, or, when the second node judges that the second data packet When the sequence number of the second data packet group to which the second data packet belongs is different from the sequence number of the first data packet group, it is determined that the second data packet does not belong to the first data packet group.
步骤S307、第二节点启动特定时长定时器,当定时器到期后,第二节点统计接收到的属于第一数据包组的第二数据包数量。Step S307, the second node starts a specific duration timer, and when the timer expires, the second node counts the number of received second data packets belonging to the first data packet group.
由于第一节点发送的不同数据包不一定按照发送的顺序到达第二节点,所以第二节点需要等待一段时间以接收同一数据包组内延迟的数据包,以便更准确的测量丢包数。Since the different data packets sent by the first node may not reach the second node in the order in which they are sent, the second node needs to wait for a period of time to receive delayed data packets in the same data packet group, so as to measure the number of packet loss more accurately.
可选的,第二节点可以启动一个特定时长的定时器,若定时器到期之前,未接到第一数据包所属的第一数据包组内的数据包,则在定时器到期后,统计接收到的第一数据包组的第二数据包数量。Optionally, the second node may start a timer of a specific duration. If no data packet in the first data packet group to which the first data packet belongs is received before the timer expires, then after the timer expires, Count the number of second data packets received in the first data packet group.
举例来说,假设用于标识第一数据包组的序列号从0开始计数,第二节点先接到一些序列号为0的数据包,也就是属于第一数据包组的第一数据包,接着又有一个序列号为1的第二数据包到达,也就是属于第二数据包组的数据包,或者又有一个没有封装特殊标签的第二数据包到达,根据步骤S306的描述,第二节点需要比对其接收的第二数据包与第一数据包的序列号是否相同,若第二数据包为序列号为1的数据包,由于第一数据包的序列号是0,因此,第二节点可以启动一个定时器,当定时器到期后,第二节点统计接收到的属于第一数据包组的第二数据包数量。For example, assuming that the sequence number used to identify the first data packet group starts counting from 0, the second node first receives some data packets with a sequence number of 0, that is, the first data packet belonging to the first data packet group, Then another second data packet with a sequence number of 1 arrives, that is, a data packet belonging to the second data packet group, or another second data packet that does not encapsulate a special label arrives. According to the description of step S306, the second The node needs to compare whether the sequence number of the second data packet it receives is the same as that of the first data packet. If the second data packet is a data packet with a sequence number of 1, since the sequence number of the first data packet is 0, the The second node may start a timer, and when the timer expires, the second node counts the number of received second data packets belonging to the first data packet group.
具体的,定时器是为了让第二节点等待一段特定时长的时间,若在上述特定时间内没有收到第一数据包组的数据包,那么在定时器到期时,读取步骤S304中针对第一数据包组的统计计数值,即为第二节点接收到的第一数据包组中的第二数据包数量。Specifically, the timer is to allow the second node to wait for a certain period of time. If the data packet of the first data packet group is not received within the above-mentioned specified time, then when the timer expires, read the The statistical count value of the first data packet group is the number of second data packets in the first data packet group received by the second node.
进一步地,若在定时器还未到期时,第二节点又收到了和第一数据包具有相同的序列号的数据包,比如第二节点在收到序列号为1的第二数据包或未封装特殊标签的第二数据包后,又收到一个序列号为0的第一数据包,此时,根据步骤S304的描述,第二节点会对该第一数据包进行计数,也就是将针对第一数据包组的统计计数值加1,同时,可以将该定时器关闭。若之后第二节点又接收到第三数据包,该第三数据包属于第一数据包组,那么第一节点仍旧重复上述计数操作,直到接到一个不是第一数据包组内的数据包或没有封装特殊标签的正常数据包,此时第二节点再启动上述定时器,并重复步骤S307的操作。Further, if the second node receives a data packet with the same sequence number as the first data packet when the timer has not yet expired, for example, the second node receives the second data packet with the sequence number 1 or After the second data packet with no special label is encapsulated, a first data packet with a sequence number of 0 is received again. At this time, according to the description of step S304, the second node will count the first data packet, that is, the The counting value for the first data packet group is increased by 1, and at the same time, the timer can be turned off. If the second node receives a third data packet afterwards, and the third data packet belongs to the first data packet group, the first node still repeats the above-mentioned counting operation until receiving a data packet that is not in the first data packet group or If there is no normal data packet encapsulated with a special label, the second node restarts the above-mentioned timer at this time, and repeats the operation of step S307.
需要说明的是,上述定时器的特定时长是根据实际情况,例如实际的网络拥塞状况等设定的,例如60秒或120秒等。It should be noted that the specific duration of the above timer is set according to actual conditions, such as actual network congestion conditions, such as 60 seconds or 120 seconds.
步骤S308、第二节点根据第一数据包数量和第二数据包数量确定第一数据包组的丢包数。Step S308, the second node determines the number of lost packets of the first data packet group according to the first number of data packets and the second number of data packets.
具体的,第二节点可以从第一数据包的发送计数中获取第一数据包组包含的第一数据包量,并且,经过步骤S307的操作,第二节点可以确定其接收的第一数据包组的第二数据包量,因此,对应的第一数据包组的丢包数即为:Specifically, the second node can obtain the first data packet volume contained in the first data packet group from the sending count of the first data packet, and, after the operation of step S307, the second node can determine the first data packet received by it The second data packet volume of the group, therefore, the corresponding packet loss number of the first data packet group is:
Z=X-Y,其中,X表示第一数据包数量,Y表示第二数据包数量,Z表示丢包数。Z=X-Y, where X represents the number of first data packets, Y represents the number of second data packets, and Z represents the number of lost packets.
为了更清楚的说明该第二节点的几种不同工作状态,本实施例提供了第二节点的状态切换图。如图5所示,第二节点的状态有四种:初始状态、统计状态、等待状态和结束状态。In order to illustrate several different working states of the second node more clearly, this embodiment provides a state switching diagram of the second node. As shown in FIG. 5 , there are four states of the second node: an initial state, a statistics state, a waiting state, and an end state.
具体的,初始状态表示第二节点未使能丢包统计功能时的始发状态,当第二节点收到第一数据包组的封装了特殊标签的第一数据包时,它会启动计数器,并进入统计状态,当第二节点处于统计状态时,若该第二节点收到序列号与第一数据包相同的数据包,会将对应于该第一数据包组的收包计数器加1;若该第二收到的第二数据包序列号与该第一数据包组的序列号不同,会启动针对第一数据包组的定时器,进入等待状态,该等待状态是指第二节点会等待一段时间,以接收延迟的第一数据包组中的数据包。当第二节点处于等待状态时,若定时器还未到期,而第二节点又收到了第一数据包组内的数据包,则它会从等待状态切换至统计状态,然后对接收到的该第一数据包组的数据数量计数。若定时器到期,那么,第二节点会从等待状态进入结束状态,并在该状态进行统计结果的上报,即上报实际接收的第一数据包组的数据包数量。需要说明的是,统计状态、等待状态和结束状态都可以通过人为的去使能该节点的统计功能的操作,而恢复到初始状态。Specifically, the initial state represents the initial state when the second node does not enable the packet loss statistics function, and when the second node receives the first data packet of the first data packet group encapsulated with a special label, it will start the counter, And enter the statistical state, when the second node is in the statistical state, if the second node receives a data packet with the same sequence number as the first data packet, it will add 1 to the packet receiving counter corresponding to the first data packet group; If the sequence number of the second data packet received by the second is different from the sequence number of the first data packet group, the timer for the first data packet group will be started and enter the waiting state. The waiting state means that the second node will Wait for a period of time to receive packets in the delayed first packet group. When the second node is in the waiting state, if the timer has not yet expired, and the second node has received the data packets in the first data packet group, it will switch from the waiting state to the statistical state, and then the received The data quantity count of the first data packet group. If the timer expires, the second node will enter the end state from the waiting state, and report the statistical results in this state, that is, report the number of actually received data packets of the first data packet group. It should be noted that the statistical state, the waiting state and the end state can all be restored to the initial state by artificially disabling the operation of the statistical function of the node.
可选的,在实际操作中,由于本实施例并未限定第二节点为LSP的尾节点,因此,LSP上除第一节点外的任意节点都可作为第二节点,因而该类节点都可以进行丢包数的测量,也就是说,采用本发明实施例的方案,不仅可以知道LSP路径上从第一节点到任意节点之间的丢包数,还可以通过任意两个节点上报的第二数据包数量相减,得到任意两节点间的丢包数。Optionally, in actual operation, since this embodiment does not limit the second node to be the tail node of the LSP, any node on the LSP except the first node can be used as the second node, so all nodes of this type can be Carry out the measurement of the number of lost packets, that is to say, adopt the scheme of the embodiment of the present invention, not only can know the number of lost packets from the first node to any node on the LSP path, but also the second number reported by any two nodes Subtract the number of data packets to get the number of lost packets between any two nodes.
此外,可以通过在上述第一节点到第二节点之间的LSP路径所在的网络区域增加一台设备做公共服务器,或者使用已有的网管系统,来实现第二节点的统计上报。具体的,当所有使能了统计功能的第二节点在本轮统计结束后,都将各自统计的第二数据包数量汇总到公共服务器或网管上。这个功能的增强可以方便用户定位到具体丢包的故障段。In addition, the statistical report of the second node can be realized by adding a device as a public server in the network area where the LSP path between the first node and the second node is located, or by using an existing network management system. Specifically, after the current round of statistics is over, all the second nodes that have enabled the statistics function will summarize the numbers of the second data packets they have counted to the public server or network management. The enhancement of this function can facilitate the user to locate the specific fault segment of packet loss.
步骤S309、第二节点解封装第一数据包的特殊标签。Step S309, the second node decapsulates the special label of the first data packet.
可选的,第二节点除了可以使能统计功能进行统计上报,还可以使能删除功能,为第一数据包解封装该特殊标签。Optionally, in addition to enabling the statistical function for statistical reporting, the second node may also enable the deletion function to decapsulate the special label for the first data packet.
具体的,若第二节点使能了删除功能,那么,该第二节点便上述确定LSP的路径终点,也就是说,当有特殊标签的第一数据包到达上述第二节点后,该第二节点不仅会进行统计上报,与此同时,它还会将第一数据包的特殊标签去除,以使得后续沿着该确定LSP转发的数据包恢复成正常封装,不再携带有特殊标签。Specifically, if the second node enables the delete function, then the second node determines the path end point of the LSP, that is, when the first data packet with a special label arrives at the second node, the second node The node will not only report statistics, but at the same time, it will also remove the special label of the first data packet, so that the subsequent data packets forwarded along the determined LSP will return to normal encapsulation and will no longer carry special labels.
在本发明实施例中,该第二节点接收第一节点发送的第一数据包,所述第一数据包属于第一数据包组,所述第一数据包包含所述第一数据包组的序列号和第一数据包数量,当所述第二节点接收到不属于所述第一数据包组的第二数据包时,统计接收到的属于所述第一数据包组的第二数据包数量,所述第二节点根据所述第一数据包数量和所述第二数据包数量确定所述第一数据包组的丢包数,由于所述第二节点只有在接收到不属于所述第一数据包组的所述第二数据包时,才进行丢包检测,有利于在负载分担场景下,提高丢包测量结果的准确性。In this embodiment of the present invention, the second node receives the first data packet sent by the first node, the first data packet belongs to the first data packet group, and the first data packet includes the sequence number and the number of first data packets, when the second node receives a second data packet that does not belong to the first data packet group, count the received second data packets that belong to the first data packet group number, the second node determines the number of lost packets of the first data packet group according to the first data packet number and the second data packet number, because the second node only receives packets that do not belong to the Packet loss detection is performed only when the second data packets of the first data packet group are in use, which is beneficial to improving the accuracy of packet loss measurement results in a load sharing scenario.
图6为本发明实施例提供的一种第二节点的结构示意图。如图6所示,该第二节点600包括:接收单元610、统计单元611和计算单元612。该第二节点600可以为图1或图2或图3对应的实施例中的第二节点。Fig. 6 is a schematic structural diagram of a second node provided by an embodiment of the present invention. As shown in FIG. 6 , the second node 600 includes: a receiving unit 610 , a statistics unit 611 and a calculation unit 612 . The second node 600 may be the second node in the embodiment corresponding to FIG. 1 or FIG. 2 or FIG. 3 .
接收单元610,用于接收第一节点发送的第一数据包,第一数据包属于第一数据包组,第一数据包组为第一节点向第二节点发送的数据包组,第一数据包包含第一数据包组的序列号和第一数据包数量,第一数据包数量用于标识第一数据包组包含的数据包的数量;The receiving unit 610 is configured to receive the first data packet sent by the first node, the first data packet belongs to the first data packet group, the first data packet group is the data packet group sent by the first node to the second node, and the first data packet The packet includes a sequence number and a first data packet number of the first data packet group, and the first data packet number is used to identify the number of data packets contained in the first data packet group;
接收单元610,还用于接收第一节点发送的第二数据包;The receiving unit 610 is further configured to receive the second data packet sent by the first node;
统计单元611,用于确定第二数据包不属于第一数据包组时,统计接收到的属于第一数据包组的第二数据包数量;A statistical unit 611, configured to count the number of received second data packets belonging to the first data packet group when determining that the second data packet does not belong to the first data packet group;
计算单元612,用于根据第一数据包数量和第二数据包数量确定第一数据包组的丢包数。A calculating unit 612, configured to determine the number of lost packets of the first data packet group according to the first number of data packets and the second number of data packets.
进一步地,第一数据包组中每个数据包封装有特殊标签,特殊标签包含第一数据包组的序列号和第一数据包数量。Further, each data packet in the first data packet group is encapsulated with a special label, and the special label includes the serial number of the first data packet group and the quantity of the first data packet.
更进一步地,统计单元611具体用于当定时单元启动的定时器到期后,确定接收到的属于第一数据包组的第二数据包数量。Furthermore, the statistics unit 611 is specifically configured to determine the number of received second data packets belonging to the first data packet group after the timer started by the timing unit expires.
更进一步地,计算单元612具体用于:Furthermore, the calculation unit 612 is specifically used for:
对应第一数据包组的丢包数为Z=X-Y;The number of lost packets corresponding to the first data packet group is Z=X-Y;
其中,X表示第一数据包数量,Y表示第二数据包数量,Z表示丢包数。Wherein, X represents the number of first data packets, Y represents the number of second data packets, and Z represents the number of lost packets.
可选地,参见图7,该第二节点600还可以包括:Optionally, referring to FIG. 7, the second node 600 may further include:
计数单元710,用于对接收的属于第一数据包组的数据包进行计数统计,相应地,根据统计的第一数据包组的数据包数量确定第二数据包数量。The counting unit 710 is configured to count and count the received data packets belonging to the first data packet group, and correspondingly, determine the second data packet quantity according to the counted data packet quantity of the first data packet group.
可选地,参见图8,该第二节点600还可以包括:Optionally, referring to FIG. 8, the second node 600 may further include:
确定单元810,用于当判断第二数据包没有封装特殊标签时,确定第二数据包不属于第一数据包组,或者,当判断第二数据包所属的第二数据包组的序列号与第一数据包组的序列号不同时,确定第二数据包不属于第一数据包组。The determining unit 810 is configured to determine that the second data packet does not belong to the first data packet group when it is judged that the second data packet does not encapsulate a special label, or, when it is judged that the sequence number of the second data packet group to which the second data packet belongs is the same as When the sequence numbers of the first data packet group are different, it is determined that the second data packet does not belong to the first data packet group.
可选地,参见图9,该第二节点600还可以包括:Optionally, referring to FIG. 9, the second node 600 may further include:
定时单元910,用于启动特定时长定时器,当定时器到期后,确定接收到的属于第一数据包组的第二数据包数量。The timing unit 910 is configured to start a specific duration timer, and when the timer expires, determine the number of received second data packets belonging to the first data packet group.
在本发明实施例中,通过发送包含有所述第一数据包组序列号和第一数据包数量的第一数据包,使得第二节点600可以获取第一数据包所在的第一数据包组和第一数据包组的第一数据包数量,并根据接收的第一数据包和第二数据包,确定第一数据包组的丢包数,由于所述第二节点600只有在接收到不属于所述第一数据包组的所述第二数据包时,才进行丢包检测,有利于在负载分担场景下,提高丢包测量结果的准确性。In the embodiment of the present invention, the second node 600 can obtain the first data packet group where the first data packet is located by sending the first data packet including the sequence number of the first data packet group and the first data packet quantity and the first data packet number of the first data packet group, and according to the received first data packet and the second data packet, determine the packet loss number of the first data packet group, because the second node 600 only receives Packet loss detection is only performed when the second data packet belongs to the first data packet group, which is beneficial to improving the accuracy of packet loss measurement results in a load sharing scenario.
图10为本发明实施例提供的一种第一节点的结构示意图。如图10所示,该第一节点1000包括:确定单元1010和发送单元1020。该第一节点1000可以为图1或图2或图3对应的实施例中的第一节点。FIG. 10 is a schematic structural diagram of a first node provided by an embodiment of the present invention. As shown in FIG. 10 , the first node 1000 includes: a determining unit 1010 and a sending unit 1020 . The first node 1000 may be the first node in the embodiment corresponding to FIG. 1 or FIG. 2 or FIG. 3 .
确定单元1010,用于确定第一数据包组内所包含的第一数据包数量;A determining unit 1010, configured to determine the number of first data packets contained in the first data packet group;
发送单元1020,用于向第二节点发送第一数据包组中的第一数据包,第一数据包包含第一数据包组的序列号和第一数据包数量,第一数据包数量用于标识第一数据包组包含的数据包的数量;The sending unit 1020 is configured to send the first data packet in the first data packet group to the second node, the first data packet includes the sequence number and the first data packet quantity of the first data packet group, and the first data packet quantity is used for identifying the number of data packets contained in the first data packet group;
发送单元1020,还用于向第二节点发送第二数据包,第二数据包不属于第一数据包组。The sending unit 1020 is further configured to send a second data packet to the second node, where the second data packet does not belong to the first data packet group.
可选地,参见图11,该第一节点1000还包括:Optionally, referring to FIG. 11, the first node 1000 further includes:
封装单元1110,用于在所述发送单元1020向第二节点发送第一数据包组中的第一数据包之前,采用特殊标签对所述第一数据包进行封装,所述特殊标签包含所述第一数据包组的序列号和所述第一数据包数量。An encapsulating unit 1110, configured to encapsulate the first data packet with a special label before the sending unit 1020 sends the first data packet in the first data packet group to the second node, and the special label includes the The sequence number of the first data packet group and the number of the first data packets.
所述封装单元1110,还用于对所述第一数据包组中的每个数据包封装所述特殊标签。The encapsulation unit 1110 is further configured to encapsulate the special label for each data packet in the first data packet group.
在本发明实施例中,该第一节点1000通过发送包含有所述第一数据包组序列号和第一数据包数量的第一数据包,使得第二节点可以获取第一数据包所在的第一数据包组和第一数据包组的第一数据包数量,并根据接收的第一数据包和第二数据包,确定第一数据包组的丢包数,由于所述第二节点只有在接收到不属于所述第一数据包组的所述第二数据包时,才进行丢包检测,有利于在负载分担场景下,提高丢包测量结果的准确性。In the embodiment of the present invention, the first node 1000 sends the first data packet including the sequence number of the first data packet group and the first data packet number, so that the second node can obtain the first data packet where the first data packet is located. A data packet group and the first data packet quantity of the first data packet group, and according to the received first data packet and the second data packet, determine the packet loss number of the first data packet group, because the second node only has Packet loss detection is performed only when the second data packet that does not belong to the first data packet group is received, which is beneficial to improving the accuracy of packet loss measurement results in a load sharing scenario.
参见图12,本发明实施例还提供了一种第二节点结构示意图,该第二节点1200可以为图1或图2或图3对应的实施例中的第二节点。该第二节点1200包括:存储器1201和接收器1202,以及分别与所述存储器1201和所述接收器1202连接的处理器1203,所述存储器1201用于存储一组程序指令,所述处理器1203用于调用所述存储器1201存储的程序指令执行如下操作:Referring to FIG. 12 , an embodiment of the present invention also provides a schematic structural diagram of a second node. The second node 1200 may be the second node in the embodiment corresponding to FIG. 1 or FIG. 2 or FIG. 3 . The second node 1200 includes: a memory 1201 and a receiver 1202, and a processor 1203 respectively connected to the memory 1201 and the receiver 1202, the memory 1201 is used to store a set of program instructions, and the processor 1203 The program instructions stored in the memory 1201 are used to call to perform the following operations:
触发接收器1202接收第一节点发送的第一数据包,第一数据包属于第一数据包组,第一数据包组为第一节点向第二节点发送的数据包组,第一数据包包含第一数据包组的序列号和第一数据包数量,第一数据包数量用于标识第一数据包组包含的数据包的数量;The trigger receiver 1202 receives the first data packet sent by the first node, the first data packet belongs to the first data packet group, the first data packet group is the data packet group sent by the first node to the second node, and the first data packet includes The serial number and the first data packet quantity of the first data packet group, the first data packet quantity is used to identify the quantity of data packets contained in the first data packet group;
接收第一节点发送的第二数据包。Receive the second data packet sent by the first node.
当所述处理器1203确定第二数据包不属于第一数据包组时,统计接收到的属于第一数据包组的第二数据包数量,并根据第一数据包数量和第二数据包数量确定第一数据包组的丢包数。When the processor 1203 determines that the second data packet does not belong to the first data packet group, it counts the number of second data packets received belonging to the first data packet group, and according to the first data packet number and the second data packet number The number of lost packets of the first data packet group is determined.
进一步地,第一数据包组中每个数据包封装有特殊标签,特殊标签包含第一数据包组的序列号和第一数据包数量。Further, each data packet in the first data packet group is encapsulated with a special label, and the special label includes the serial number of the first data packet group and the quantity of the first data packet.
更进一步地,处理器1203具体用于当定时单元启动的定时器到期后,确定接收到的属于第一数据包组的第二数据包数量。Furthermore, the processor 1203 is specifically configured to determine the number of second received data packets belonging to the first data packet group after the timer started by the timing unit expires.
更进一步地,处理器1203具体用于:Furthermore, the processor 1203 is specifically used for:
对应第一数据包组的丢包数为Z=X-Y;The number of lost packets corresponding to the first data packet group is Z=X-Y;
其中,X表示第一数据包数量,Y表示第二数据包数量,Z表示丢包数。Wherein, X represents the number of first data packets, Y represents the number of second data packets, and Z represents the number of lost packets.
可选地,所述处理器1203可以为中央处理器(Central Processing Unit,简称CPU),所述存储器1201可以为随机访问内存(Random Access Memory,简称RAM)类型的内部存储器,所述接收器1202可以包含普通物理接口,所述物理接口可以为以太网(Ethernet)接口或异步传输模式(Asynchronous Transfer Mode,简称ATM)接口。所述处理器1203、发送器1202和存储器1201可以集成为一个或多个独立的电路或硬件,如:特定用途集成电路(Application Specific Integrated Circuit,简称ASIC)。Optionally, the processor 1203 may be a central processing unit (Central Processing Unit, CPU for short), the memory 1201 may be an internal memory of a random access memory (Random Access Memory, RAM for short), and the receiver 1202 It may include a common physical interface, and the physical interface may be an Ethernet (Ethernet) interface or an Asynchronous Transfer Mode (Asynchronous Transfer Mode, ATM for short) interface. The processor 1203, the transmitter 1202, and the memory 1201 may be integrated into one or more independent circuits or hardware, such as: Application Specific Integrated Circuit (Application Specific Integrated Circuit, ASIC for short).
图13为本发明实施例提供的一种第一节点的结构示意图。如图13所示,该第一节点1300可以为图1或图2或图3对应的实施例中的第一节点。该第一节点1300包括:存储器1301和发送器1302,以及分别与所述存储器1301和所述发送器1302连接的处理器1303,所述存储器1301用于存储一组程序指令,所述处理器1303用于调用所述存储器1301存储的程序指令执行如下操作:Fig. 13 is a schematic structural diagram of a first node provided by an embodiment of the present invention. As shown in FIG. 13 , the first node 1300 may be the first node in the embodiment corresponding to FIG. 1 or FIG. 2 or FIG. 3 . The first node 1300 includes: a memory 1301 and a transmitter 1302, and a processor 1303 respectively connected to the memory 1301 and the transmitter 1302, the memory 1301 is used to store a set of program instructions, and the processor 1303 The program instructions stored in the memory 1301 are used to perform the following operations:
确定第一数据包组内所包含的第一数据包数量。Determine the number of first data packets included in the first data packet group.
触发发送器1302向第二节点发送第一数据包组中的第一数据包,第一数据包包含第一数据包组的序列号和第一数据包数量,第一数据包数量用于标识第一数据包组包含的数据包的数量,并向第二节点发送第二数据包,第二数据包不属于第一数据包组。The trigger transmitter 1302 sends the first data packet in the first data packet group to the second node, the first data packet includes the sequence number and the first data packet number of the first data packet group, and the first data packet number is used to identify the first data packet number A data packet group contains the number of data packets, and sends a second data packet to the second node, and the second data packet does not belong to the first data packet group.
所述处理器1303,还用于在所述发送器1302向第二节点发送第一数据包组中的第一数据包之前,采用特殊标签对所述第一数据包进行封装,所述特殊标签包含所述第一数据包组的序列号和所述第一数据包数量。The processor 1303 is further configured to, before the sender 1302 sends the first data packet in the first data packet group to the second node, encapsulate the first data packet with a special label, the special label Including the sequence number of the first data packet group and the number of the first data packets.
所述处理器1303,还用于对所述第一数据包组中的每个数据包封装所述特殊标签。The processor 1303 is further configured to encapsulate the special label for each data packet in the first data packet group.
可选地,所述处理器1303可以为CPU,所述存储器1301可以为RAM类型的内部存储器,所述发送器1302可以包含普通物理接口,所述物理接口可以为Ethernet接口或ATM接口。所述处理器1303、发送器1302和存储器1301可以集成为一个或多个独立的电路或硬件,如:ASIC。Optionally, the processor 1303 may be a CPU, the memory 1301 may be a RAM-type internal memory, and the transmitter 1302 may include a common physical interface, and the physical interface may be an Ethernet interface or an ATM interface. The processor 1303, the transmitter 1302 and the memory 1301 may be integrated into one or more independent circuits or hardware, such as ASIC.
本领域普通技术人员可以理解:实现上述方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成,前述程序可以存储于一计算机可读取存储介质中,该程序在执行时,执行包括上述方法实施例的步骤;而前述的存储介质可以是下述介质中的至少一种:只读存储器(Read-Only Memory,简称为ROM)、RAM、磁碟或者光盘等各种可以存储程序代码的介质。Those of ordinary skill in the art can understand that all or part of the steps to realize the above method embodiments can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the execution includes: The steps of the above-mentioned method embodiment; and the aforementioned storage medium can be at least one of the following media: read-only memory (Read-Only Memory, referred to as ROM), RAM, magnetic disk or optical disk, etc. can store program codes medium.
最后应说明的是:以上实施例仅用以示例性说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明及本发明带来的有益效果进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明权利要求的范围。Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention and the beneficial effects brought by the present invention have been described in detail with reference to the foregoing embodiments, those skilled in the art Those of ordinary skill in the art should understand that: they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the present invention Scope of Claims.
Claims (18)
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310722868.8A CN103684923B (en) | 2013-12-24 | 2013-12-24 | The method and the network equipment of a kind of packet loss measurement |
PCT/CN2014/093824 WO2015096636A1 (en) | 2013-12-24 | 2014-12-15 | Method for measuring lost packets and network device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310722868.8A CN103684923B (en) | 2013-12-24 | 2013-12-24 | The method and the network equipment of a kind of packet loss measurement |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103684923A CN103684923A (en) | 2014-03-26 |
CN103684923B true CN103684923B (en) | 2017-10-17 |
Family
ID=50321302
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310722868.8A Active CN103684923B (en) | 2013-12-24 | 2013-12-24 | The method and the network equipment of a kind of packet loss measurement |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN103684923B (en) |
WO (1) | WO2015096636A1 (en) |
Families Citing this family (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103684923B (en) * | 2013-12-24 | 2017-10-17 | 华为技术有限公司 | The method and the network equipment of a kind of packet loss measurement |
CN106656644B (en) * | 2015-10-28 | 2020-01-10 | 华为技术有限公司 | Packet loss statistical method and network equipment |
CN108345621B (en) * | 2017-01-24 | 2022-03-08 | 腾讯科技(深圳)有限公司 | Data reconciliation method, system and data system |
CN111371634B (en) * | 2018-12-26 | 2022-01-18 | 华为技术有限公司 | Communication method, device and system |
CN110278058B (en) * | 2019-06-05 | 2020-11-03 | 华为技术有限公司 | A redundant information feedback method and communication device |
CN114073049B (en) * | 2019-09-21 | 2023-11-17 | 华为技术有限公司 | Method and network node for reliability measurement |
CN111158300B (en) * | 2019-11-20 | 2021-03-23 | 福建星云电子股份有限公司 | Data acquisition and reduction method |
CN112737884B (en) * | 2020-12-28 | 2022-11-11 | 北京达佳互联信息技术有限公司 | Method for forwarding data and detecting network performance and related device |
WO2024065550A1 (en) * | 2022-09-29 | 2024-04-04 | 北京小米移动软件有限公司 | Packet loss handling method and apparatus |
Family Cites Families (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6662223B1 (en) * | 1999-07-01 | 2003-12-09 | Cisco Technology, Inc. | Protocol to coordinate network end points to measure network latency |
CN101699786B (en) * | 2009-10-15 | 2012-09-05 | 华为技术有限公司 | Method, device and system for detecting packet loss |
CN101719850B (en) * | 2009-11-04 | 2013-03-27 | 中兴通讯股份有限公司 | Device and method for carrying out statistics on Ethernet packet loss rate as well as message switching device |
CN102546081B (en) * | 2010-12-21 | 2015-09-16 | 中兴通讯股份有限公司 | Method for detecting packet loss, system and media client |
CN102404166B (en) * | 2011-10-27 | 2015-04-08 | 华为技术有限公司 | Packet loss detecting method and system as well as transmitting equipment and receiving equipment |
CN102868576B (en) * | 2012-09-26 | 2015-05-13 | 电子科技大学 | Method for measuring downlink packet loss rate of access link of broadband network user |
CN102904775B (en) * | 2012-09-29 | 2015-04-29 | 华为技术有限公司 | Method, apparatus and system for measuring network packet loss |
CN103684923B (en) * | 2013-12-24 | 2017-10-17 | 华为技术有限公司 | The method and the network equipment of a kind of packet loss measurement |
-
2013
- 2013-12-24 CN CN201310722868.8A patent/CN103684923B/en active Active
-
2014
- 2014-12-15 WO PCT/CN2014/093824 patent/WO2015096636A1/en active Application Filing
Also Published As
Publication number | Publication date |
---|---|
WO2015096636A1 (en) | 2015-07-02 |
CN103684923A (en) | 2014-03-26 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103684923B (en) | The method and the network equipment of a kind of packet loss measurement | |
US11228515B2 (en) | Data packet detection method, device, and system | |
KR101492510B1 (en) | Multiple delivery route packet ordering | |
CN113328902B (en) | Network performance detection method and device and network equipment | |
CN102273136B (en) | Method and apparatus for detecting multi-service performance in tunnel | |
CN106375158B (en) | A packet loss detection method, network equipment and system | |
WO2019056899A1 (en) | Oam message transmission method and transmission device, and storage medium | |
US20110188380A1 (en) | Packet loss rate detection method, apparatus, and system | |
CN111385121B (en) | A kind of transmission method and corresponding device of operation management and maintenance iOAM message | |
CN108809759A (en) | Detect the method, apparatus and router of link state | |
CN111953553B (en) | A message detection method, device and system | |
CN111371634B (en) | Communication method, device and system | |
US20150036510A1 (en) | Method and device for measuring ethernet performance | |
CN115987754A (en) | A network communication method and device | |
US9331927B2 (en) | Communication system, communication device, and communication method | |
WO2013176607A1 (en) | Method and first network node for managing an ethernet network | |
CN106936656A (en) | A kind of methods, devices and systems for realizing packet loss detection | |
US11240162B1 (en) | Method for remote direct memory access (RDMA) congestion control over an ethernet network | |
KR101566139B1 (en) | Pseudowire extended group messaging in a packet switched network | |
EP2768187B1 (en) | Method for measuring traffic performance indicator and transmission side device | |
US20230208756A1 (en) | Operation, Administration, and Maintenance OAM Packet Processing Method and Device | |
CN101159691B (en) | Originated multi-protocol label switching packet maximum length determining method and node | |
CN112702218B (en) | Method, system, network device and storage medium for detecting data transmission quality | |
CN114629838A (en) | Error code information acquisition method and device | |
CN113708985A (en) | Flow detection method, device and system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |