CN111756588B - Communication link detection method and related device - Google Patents
Communication link detection method and related device Download PDFInfo
- Publication number
- CN111756588B CN111756588B CN201910234008.7A CN201910234008A CN111756588B CN 111756588 B CN111756588 B CN 111756588B CN 201910234008 A CN201910234008 A CN 201910234008A CN 111756588 B CN111756588 B CN 111756588B
- Authority
- CN
- China
- Prior art keywords
- detection
- communication link
- network device
- link
- packets
- 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
Images
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
- H04L43/0841—Round trip packet loss
-
- 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/0805—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
- H04L43/0811—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking connectivity
-
- 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
- H04L43/0835—One way packet loss
-
- 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/0852—Delays
- H04L43/0858—One way delays
-
- 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/0852—Delays
- H04L43/0864—Round trip delays
-
- 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/10—Active monitoring, e.g. heartbeat, ping or trace-route
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Environmental & Geological Engineering (AREA)
- Health & Medical Sciences (AREA)
- Cardiology (AREA)
- General Health & Medical Sciences (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
一种通信链路检测方法及相关装置,属于网络技术领域。第一网络设备在第n个检测周期通过通信链路向第二网络设备发送链路检测请求报文,并通过该通信链路接收第二网络设备发送的链路检测响应报文,该链路检测响应报文包括第二网络设备在第n个检测周期之前的m个检测周期内通过该通信链路接收的报文数量和发送的报文数量。该第一网络设备确定该第一网络设备在m个检测周期内通过该通信链路发送的报文数量和接收的报文数量,并根据第一网络设备在m个检测周期内发送的报文数量和接收的报文数量以及第二网络设备在m个检测周期内接收的报文数量和发送的报文数量,确定第一通信链路的丢包量。本申请能够确定通信链路的网络质量。
A communication link detection method and a related device belong to the technical field of networks. The first network device sends a link detection request message to the second network device through the communication link in the nth detection cycle, and receives the link detection response message sent by the second network device through the communication link. The detection response message includes the number of messages received and the number of messages sent by the second network device through the communication link in the m detection cycles before the n detection cycle. The first network device determines the number of packets sent and received by the first network device through the communication link within m detection periods, and according to the packets sent by the first network device within m detection periods The number of received packets and the number of packets received and sent by the second network device within m detection periods determine the packet loss amount of the first communication link. The application is able to determine the network quality of the communication link.
Description
技术领域technical field
本申请涉及网络技术领域,特别涉及一种通信链路检测方法及相关装置。The present application relates to the field of network technology, in particular to a communication link detection method and a related device.
背景技术Background technique
通信网络,例如软件定义广域网(software-defined wide area network,SD-WAN),通常包括多个网络设备和多个主机,网络设备之间建立有通信链路,主机与网络设备通信连接。网络设备通过通信链路转发主机的数据报文,以实现主机之间的数据通信。为了保证通信的可靠性,网络设备通常需要检测通信链路。A communication network, such as a software-defined wide area network (SD-WAN), usually includes multiple network devices and multiple hosts, communication links are established between the network devices, and the hosts communicate with the network devices. The network device forwards the data packets of the host through the communication link to realize the data communication between the hosts. In order to ensure communication reliability, network devices usually need to detect communication links.
目前,网络设备可以采用双向转发检测(bidirectional forwarding detection,BFD)技术检测通信链路。检测过程包括:通信链路两端点的网络设备建立BFD会话后,分别通过该通信链路向对端设备发送链路检测请求报文,并接收对端设备针对链路检测请求报文返回的链路检测响应报文,如果在一定时长内,该两端点的网络设备均未接收到对端设备返回的链路检测响应报文,则该两端点的网络设备确定该通信链路故障。Currently, a network device may use a bidirectional forwarding detection (bidirectional forwarding detection, BFD) technology to detect a communication link. The detection process includes: after the network devices at both ends of the communication link establish a BFD session, they respectively send a link detection request message to the peer device through the communication link, and receive the link detection request message returned by the peer device for the link detection request message. If within a certain period of time, the network devices at the two ends do not receive the link detection response message returned by the peer device, the network devices at the two ends determine that the communication link is faulty.
但是,采用BFD技术仅能确定通信链路是否故障,无法确定通信链路的网络质量。However, the BFD technology can only determine whether the communication link is faulty, but cannot determine the network quality of the communication link.
发明内容Contents of the invention
本申请实施例提供了一种通信链路检测方法及相关装置,可以确定通信链路的网络质量。所述技术方案如下:Embodiments of the present application provide a communication link detection method and a related device, which can determine the network quality of the communication link. Described technical scheme is as follows:
第一方面,提供一种通信链路检测方法,用于通信网络中的第一网络设备,通信网络包括第一网络设备和第二网络设备,第一网络设备与第二网络设备之间建立有第一通信链路,该方法包括:In the first aspect, a method for detecting a communication link is provided, which is used for a first network device in a communication network. The communication network includes a first network device and a second network device, and a relationship is established between the first network device and the second network device. A first communication link, the method comprising:
在第n个检测周期,通过第一通信链路向第二网络设备发送第一链路检测请求报文,n>1,且n为整数;In the nth detection cycle, send a first link detection request message to the second network device through the first communication link, where n>1, and n is an integer;
通过第一通信链路接收第二网络设备针对第一链路检测请求报文发送的第一链路检测响应报文,第一链路检测响应报文包括第二网络设备在第n个检测周期之前的m个检测周期内通过第一通信链路接收的报文数量,以及,第二网络设备在所述m个检测周期内通过第一通信链路发送的报文数量,n>m≥1,且m为整数;Receive the first link detection response message sent by the second network device for the first link detection request message through the first communication link, the first link detection response message includes the second network device in the nth detection period The number of packets received through the first communication link in the previous m detection periods, and the number of packets sent by the second network device through the first communication link within the m detection periods, n>m≥1 , and m is an integer;
确定第一网络设备在所述m个检测周期内通过第一通信链路发送的报文数量,以及,第一网络设备在所述m个检测周期内通过第一通信链路接收的报文数量;determining the number of packets sent by the first network device through the first communication link within the m detection periods, and the number of packets received by the first network device through the first communication link within the m detection periods ;
根据第一网络设备在所述m个检测周期内通过第一通信链路发送的报文数量,第二网络设备在所述m个检测周期内通过第一通信链路接收的报文数量,第二网络设备在所述m个检测周期内通过第一通信链路发送的报文数量,以及,第一网络设备在所述m个检测周期内通过第一通信链路接收的报文数量,确定第一通信链路的丢包量,丢包量用于表征第一通信链路的网络质量。According to the number of packets sent by the first network device through the first communication link within the m detection periods, and the number of packets received by the second network device through the first communication link within the m detection periods, the first The number of packets sent by the second network device through the first communication link within the m detection periods, and the number of packets received by the first network device through the first communication link within the m detection periods are determined The packet loss amount of the first communication link, where the packet loss amount is used to characterize the network quality of the first communication link.
由于可以根据第一网络设备在所述m个检测周期内通过第一通信链路发送的报文数量和接收的报文数量,以及,第二网络设备在所述m个检测周期内通过第一通信链路发送的报文数量和接收的报文数量,确定第一通信链路的丢包量,该丢包量用于表征第一通信链路的网络质量,因此本申请实施例提供的技术方案可以确定通信链路的网络质量。Since the number of packets sent and received by the first network device through the first communication link within the m detection periods can be used, and the second network device passes the first communication link within the m detection periods The number of packets sent by the communication link and the number of packets received determine the amount of packet loss of the first communication link, which is used to characterize the network quality of the first communication link, so the technology provided in the embodiment of this application Scenarios can determine the network quality of communication links.
可选地,确定第一网络设备在所述m个检测周期内通过第一通信链路发送的报文数量,以及,第一网络设备在所述m个检测周期内通过第一通信链路接收的报文数量,包括:Optionally, determine the number of packets sent by the first network device through the first communication link within the m detection periods, and the first network device receives the packets through the first communication link within the m detection periods The number of messages, including:
对于所述m个检测周期中的第i个检测周期,从通过第一通信链路发送所述第i个检测周期的链路检测请求报文的时刻开始统计通过第一通信链路发送的报文数量,直至通过第一通信链路发送第i+1个检测周期的链路检测请求报文的时刻停止统计,将统计到的发送的报文数量确定为第一网络设备在所述第i个检测周期内通过第一通信链路发送的报文数量,所述第i个检测周期为所述m个检测周期中的任一检测周期,1≤i≤m,且i为整数;根据第一网络设备在所述m个检测周期中的每个检测周期内通过第一通信链路发送的报文数量,确定第一网络设备在所述m个检测周期内通过第一通信链路发送的报文数量;For the i-th detection cycle in the m detection cycles, count the messages sent through the first communication link from the moment when the link detection request message of the i-th detection cycle is sent through the first communication link The number of messages, until the moment when the link detection request message of the i+1 detection cycle is sent through the first communication link, the statistics are stopped, and the counted number of sent messages is determined as the first network device in the i-th The number of messages sent through the first communication link in the first detection cycle, the i-th detection cycle is any detection cycle in the m detection cycles, 1≤i≤m, and i is an integer; according to the first The number of packets sent by a network device through the first communication link in each of the m detection cycles, determining the number of packets sent by the first network device through the first communication link in the m detection cycles number of messages;
对于所述m个检测周期中的第i个检测周期,从通过第一通信链路接收到所述第i个检测周期的链路检测响应报文的时刻开始统计通过第一通信链路接收的报文数量,直至通过第一通信链路接收到第i+1个检测周期的链路检测响应报文的时刻停止统计,将统计到的接收的报文数量确定为第一网络设备在所述第i个检测周期内通过第一通信链路接收的报文数量;根据第一网络设备在所述m个检测周期中的每个检测周期内通过第一通信链路接收的报文数量,确定第一网络设备在所述m个检测周期内通过第一通信链路接收的报文数量。For the i-th detection cycle in the m detection cycles, start counting the link detection response message received through the first communication link from the moment when the link detection response message of the i-th detection cycle is received through the first communication link The number of messages, until the moment when the link detection response message of the i+1 detection period is received through the first communication link, the statistics are stopped, and the number of received messages counted is determined as the first network device in the said The number of packets received through the first communication link in the i-th detection cycle; determined according to the number of packets received by the first network device through the first communication link in each detection cycle of the m detection cycles The number of packets received by the first network device through the first communication link within the m detection periods.
第二方面,提供一种通信链路检测方法,用于通信网络中的第二网络设备,通信网络包括第一网络设备和第二网络设备,第一网络设备与第二网络设备之间建立有第一通信链路,该方法包括:In the second aspect, a method for detecting a communication link is provided, which is used for a second network device in a communication network. The communication network includes a first network device and a second network device, and a relationship is established between the first network device and the second network device. A first communication link, the method comprising:
在第n个检测周期,通过第一通信链路接收第一网络设备发送的第一链路检测请求报文,第一链路检测请求报文包括第一网络设备在第n个检测周期之前的m个检测周期内通过第一通信链路发送的报文数量,n>m≥1,且n和m均为整数;In the nth detection cycle, receive the first link detection request message sent by the first network device through the first communication link, the first link detection request message includes the first network device before the nth detection cycle The number of messages sent through the first communication link within m detection periods, n>m≥1, and both n and m are integers;
根据第一链路检测请求报文,通过第一通信链路向第一网络设备发送第一链路检测响应报文;Sending a first link detection response message to the first network device through the first communication link according to the first link detection request message;
在第n+1个检测周期,通过第一通信链路接收第一网络设备发送的第二链路检测请求报文,第二链路检测请求报文包括第一网络设备在所述m个检测周期内通过第一通信链路接收的报文数量;In the n+1th detection period, receive a second link detection request message sent by the first network device through the first communication link, the second link detection request message includes the first network device in the m detection The number of messages received through the first communication link within the period;
确定第二网络设备在所述m个检测周期内通过第一通信链路接收的报文数量,以及,第二网络设备在所述m个检测周期内通过第一通信链路发送的报文数量;determining the number of packets received by the second network device through the first communication link within the m detection periods, and the number of packets sent by the second network device through the first communication link within the m detection periods ;
根据第一网络设备在所述m个检测周期内通过第一通信链路发送的报文数量,第二网络设备在所述m个检测周期内通过第一通信链路接收的报文数量,第二网络设备在所述m个检测周期内通过第一通信链路发送的报文数量,以及,第一网络设备在所述m个检测周期内通过第一通信链路接收的报文数量,确定第一通信链路的丢包量,丢包量用于表征第一通信链路的网络质量。According to the number of packets sent by the first network device through the first communication link within the m detection periods, and the number of packets received by the second network device through the first communication link within the m detection periods, the first The number of packets sent by the second network device through the first communication link within the m detection periods, and the number of packets received by the first network device through the first communication link within the m detection periods are determined The packet loss amount of the first communication link, where the packet loss amount is used to characterize the network quality of the first communication link.
由于可以根据第一网络设备在所述m个检测周期内通过第一通信链路发送的报文数量和接收的报文数量,以及,第二网络设备在所述m个检测周期内通过第一通信链路发送的报文数量和接收的报文数量,确定第一通信链路的丢包量,该丢包量用于表征第一通信链路的网络质量,因此本申请实施例提供的技术方案可以确定通信链路的网络质量。Since the number of packets sent and received by the first network device through the first communication link within the m detection periods can be used, and the second network device passes the first communication link within the m detection periods The number of packets sent by the communication link and the number of packets received determine the amount of packet loss of the first communication link, which is used to characterize the network quality of the first communication link, so the technology provided in the embodiment of this application Scenarios can determine the network quality of communication links.
可选地,确定第二网络设备在所述m个检测周期内通过第一通信链路接收的报文数量,以及,第二网络设备在所述m个检测周期内通过第一通信链路发送的报文数量,包括:Optionally, determine the number of packets received by the second network device through the first communication link within the m detection periods, and send the second network device through the first communication link within the m detection periods The number of messages, including:
对于所述m个检测周期中的第i个检测周期,从通过第一通信链路接收到所述第i个检测周期的链路检测请求报文的时刻开始统计通过第一通信链路接收的报文数量,直至通过第一通信链路接收到第i+1个检测周期的链路检测请求报文的时刻停止统计,将统计到的接收的报文数量确定为第二网络设备在所述第i个检测周期内通过第一通信链路接收的报文数量,所述第i个检测周期为所述m个检测周期中的任一检测周期,1≤i≤m,且i为整数;根据第二网络设备在所述m个检测周期中的每个检测周期内通过第一通信链路接收的报文数量,确定第二网络设备在所述m个检测周期内通过第一通信链路接收的报文数量;For the i-th detection cycle in the m detection cycles, start counting the link detection request message received through the first communication link from the moment when the link detection request message of the i-th detection cycle is received through the first communication link The number of messages, until the moment when the link detection request message of the i+1 detection cycle is received through the first communication link, the statistics are stopped, and the number of received messages counted is determined as the second network device in the said The number of messages received through the first communication link in the i-th detection cycle, the i-th detection cycle is any one of the m detection cycles, 1≤i≤m, and i is an integer; According to the number of packets received by the second network device through the first communication link in each of the m detection periods, determine that the second network device passes through the first communication link within the m detection periods The number of received messages;
对于所述m个检测周期中的第i个检测周期,从通过第一通信链路发送所述第i个检测周期的链路检测响应报文的时刻开始统计通过第一通信链路发送的报文数量,直至通过第一通信链路发送第i+1个检测周期的链路检测响应报文的时刻停止统计,将统计到的发送的报文数量确定为第二网络设备在所述第i个检测周期内通过第一通信链路发送的报文数量;根据第二网络设备在所述m个检测周期中的每个检测周期内通过第一通信链路发送的报文数量,确定第二网络设备在所述m个检测周期内通过第一通信链路发送的报文数量。For the i-th detection cycle in the m detection cycles, count the messages sent through the first communication link from the moment when the link detection response message of the i-th detection cycle is sent through the first communication link The number of messages is stopped until the moment when the link detection response message of the i+1 detection period is sent through the first communication link, and the counted number of sent messages is determined as the number of messages sent by the second network device in the i-th The number of packets sent through the first communication link in each detection cycle; according to the number of packets sent by the second network device through the first communication link in each detection cycle of the m detection cycles, determine the second The number of packets sent by the network device through the first communication link within the m detection periods.
可选地,在上述第一方面或第二方面中,第一网络设备在所述m个检测周期内通过第一通信链路发送的报文数量包括:第一网络设备在所述m个检测周期内通过第一通信链路发送的数据报文的数量和链路检测请求报文的数量;第一网络设备在所述m个检测周期内通过第一通信链路接收的报文数量包括:第一网络设备在所述m个检测周期内通过第一通信链路接收的数据报文的数量和链路检测响应报文的数量;第二网络设备在所述m个检测周期内通过第一通信链路接收的报文数量包括:第二网络设备在所述m个检测周期内通过第一通信链路接收的数据报文的数量和链路检测请求报文的数量;第二网络设备在所述m个检测周期内通过第一通信链路发送的报文数量包括:第二网络设备在所述m个检测周期内通过第一通信链路发送的数据报文的数量和链路检测响应报文的数量。Optionally, in the first aspect or the second aspect above, the number of packets sent by the first network device through the first communication link during the m detection periods includes: The number of data packets sent through the first communication link and the number of link detection request packets within the cycle; the number of packets received by the first network device through the first communication link within the m detection cycles includes: The number of data packets and the number of link detection response packets received by the first network device through the first communication link within the m detection periods; the second network device passes the first communication link within the m detection periods The number of packets received by the communication link includes: the number of data packets and the number of link detection request packets received by the second network device through the first communication link within the m detection periods; The number of packets sent through the first communication link within the m detection periods includes: the number of data packets sent by the second network device through the first communication link within the m detection periods and the link detection response The number of messages.
可选地,在上述第一方面或第二方面中,第一链路检测请求报文为第一网络设备的自发报文。这样一来,可以根据需要灵活配置链路检测请求报文的发送间隔(也即是检测周期),提高检测的灵活性、精度和灵敏度。Optionally, in the above first or second aspect, the first link detection request message is a spontaneous message of the first network device. In this way, the sending interval (that is, the detection period) of the link detection request message can be flexibly configured according to needs, thereby improving the flexibility, precision and sensitivity of detection.
可选地,在上述第一方面或第二方面中,检测周期为100毫秒。这样一来,可以在较短时间内实现智能选路。Optionally, in the first aspect or the second aspect above, the detection period is 100 milliseconds. In this way, intelligent route selection can be realized in a relatively short period of time.
可选地,在上述第一方面或第二方面中,m=10,n-m=1。Optionally, in the first aspect or the second aspect above, m=10, n-m=1.
第三方面,提供一种通信链路检测装置,该通信链路检测装置包括至少一个模块,该至少一个模块用于实现上述第一方面或第一方面的任一可选方式所提供的通信链路检测方法。In a third aspect, a communication link detection device is provided, the communication link detection device includes at least one module, and the at least one module is used to implement the communication link provided in the first aspect or any optional mode of the first aspect road detection method.
第四方面,提供一种通信链路检测装置,该通信链路检测装置包括至少一个模块,该至少一个模块用于实现上述第二方面或第二方面的任一可选方式所提供的通信链路检测方法。In a fourth aspect, a communication link detection device is provided, the communication link detection device includes at least one module, and the at least one module is used to implement the communication link provided in the second aspect or any optional manner of the second aspect. road detection method.
本申请实施例提供的方案,由于统计的发送的报文数量和接收的报文数量均包括数据报文的数量和链路检测报文(包括链路检测请求报文和链路检测响应报文)的数量,这样一来,确定出通信链路的网络质量更接近于主机实际使用的通信链路的网络质量,检测的可靠性较高。此外,网络设备之间交互的链路检测报文可以携带最近m次的报文数量统计结果,这样一来,当某一链路检测报文丢失时,网络设备可以根据该某一链路检测报文之后的链路检测报文携带的统计结果,还原该被丢失的链路检测报文,进一步提高检测的可靠性。In the solution provided by the embodiment of the present application, since the number of packets sent and the number of packets received in statistics include the number of data packets and link detection packets (including link detection request packets and link detection response packets) ), in this way, it is determined that the network quality of the communication link is closer to the network quality of the communication link actually used by the host, and the detection reliability is higher. In addition, the link detection messages exchanged between network devices can carry the last m statistics of the number of messages. In this way, when a certain link detection message is lost, the network device can detect The statistical result carried in the link detection message after the message restores the lost link detection message, further improving the reliability of detection.
第五方面,提供一种计算机可读存储介质,该计算机可读存储介质中存储有指令,当该指令在计算机的处理组件上运行时,使得处理组件执行第一方面或第一方面的任一可选方式所提供的通信链路检测方法。In a fifth aspect, a computer-readable storage medium is provided. Instructions are stored in the computer-readable storage medium. When the instructions are run on a processing component of a computer, the processing component executes any one of the first aspect or the first aspect. The communication link detection method provided by the optional mode.
第六方面,提供一种计算机可读存储介质,该计算机可读存储介质中存储有指令,当该指令在计算机的处理组件上运行时,使得处理组件执行第二方面或第二方面的任一可选方式所提供的通信链路检测方法。According to a sixth aspect, a computer-readable storage medium is provided. Instructions are stored in the computer-readable storage medium. When the instructions are run on a processing component of a computer, the processing component executes any one of the second aspect or the second aspect. The communication link detection method provided by the optional mode.
第七方面,提供一种包含指令的计算机程序产品,当该计算机程序产品在计算机上运行时,使得计算机执行第一方面或第一方面的任一可选方式所提供的通信链路检测方法。In a seventh aspect, a computer program product including instructions is provided, and when the computer program product is run on a computer, the computer is made to execute the communication link detection method provided in the first aspect or any optional manner of the first aspect.
第八方面,提供一种包含指令的计算机程序产品,当该计算机程序产品在计算机上运行时,使得计算机执行第二方面或第二方面的任一可选方式所提供的通信链路检测方法。In an eighth aspect, a computer program product including instructions is provided, and when the computer program product is run on a computer, the computer is made to execute the communication link detection method provided in the second aspect or any optional manner of the second aspect.
第九方面,提供一种芯片,该芯片包括可编程逻辑电路和/或程序指令,当该芯片运行时用于实现第一方面或第一方面的任一可选方式所提供的通信链路检测方法。In the ninth aspect, there is provided a chip, the chip includes a programmable logic circuit and/or program instructions, and when the chip is running, it is used to realize the communication link detection provided by the first aspect or any optional method of the first aspect method.
第十方面,提供一种芯片,该芯片包括可编程逻辑电路和/或程序指令,当该芯片运行时用于实现第二方面或第二方面的任一可选方式所提供的通信链路检测方法。In a tenth aspect, a chip is provided, the chip includes a programmable logic circuit and/or program instructions, and when the chip is running, it is used to realize the communication link detection provided by the second aspect or any optional method of the second aspect method.
第十一方面,提供一种通信链路检测系统,该通信链路检测系统包括第一网络设备和第二网络设备,第一网络设备包括第三方面所提供的通信链路检测装置,第二网络设备包括第四方面所提供的通信链路检测装置。In the eleventh aspect, a communication link detection system is provided, the communication link detection system includes a first network device and a second network device, the first network device includes the communication link detection device provided in the third aspect, and the second network device The network equipment includes the device for detecting a communication link provided in the fourth aspect.
本申请实施例提供的技术方案,第一网络设备在第n个检测周期通过第一通信链路向第二网络设备发送第一链路检测请求报文,并通过第一通信链路接收第二网络设备发送的第一链路检测响应报文,第一链路检测响应报文包括第二网络设备在第n个检测周期之前的m个检测周期内通过第一通信链路接收的报文数量和发送的报文数量,且第一网络设备可以确定第一网络设备在该m个检测周期内通过第一通信链路发送的报文数量和接收的报文数量,之后第一网络设备可以根据第一网络设备在该m个检测周期内通过第一通信链路发送的报文数量和接收的报文数量,以及,第二网络设备在该m个检测周期内通过第一通信链路发送的报文数量和接收的报文数量,确定第一通信链路的丢包量,该丢包量用于表征第一通信链路的网络质量,因此本申请实施例提供的技术方案可以确定通信链路的网络质量。In the technical solution provided by the embodiment of this application, the first network device sends the first link detection request message to the second network device through the first communication link in the nth detection period, and receives the second link detection request message through the first communication link. The first link detection response message sent by the network device, the first link detection response message includes the number of messages received by the second network device through the first communication link in the m detection cycles before the n detection cycle and the number of packets sent, and the first network device can determine the number of packets sent and received by the first network device through the first communication link within the m detection periods, and then the first network device can be based on The number of packets sent and received by the first network device through the first communication link within the m detection periods, and the number of packets sent by the second network device through the first communication link within the m detection periods The number of messages and the number of received messages determine the amount of packet loss of the first communication link, which is used to characterize the network quality of the first communication link, so the technical solution provided by the embodiment of the application can determine the road network quality.
附图说明Description of drawings
图1是本申请实施例所涉及的一种实施环境的示意图;FIG. 1 is a schematic diagram of an implementation environment involved in an embodiment of the present application;
图2是本申请实施例提供的一种通信链路检测方法的信令图;FIG. 2 is a signaling diagram of a communication link detection method provided in an embodiment of the present application;
图3是本申请实施例提供的一种通信链路检测方法的示意图;FIG. 3 is a schematic diagram of a method for detecting a communication link provided in an embodiment of the present application;
图4是本申请实施例提供的一种通信链路检测装置的逻辑结构示意图;FIG. 4 is a schematic diagram of a logic structure of a communication link detection device provided in an embodiment of the present application;
图5是本申请实施例提供的另一种通信链路检测装置的逻辑结构示意图;FIG. 5 is a schematic diagram of a logic structure of another communication link detection device provided in an embodiment of the present application;
图6是本申请实施例提供的一种通信链路检测装置的硬件结构示意图。FIG. 6 is a schematic diagram of a hardware structure of a device for detecting a communication link provided by an embodiment of the present application.
具体实施方式detailed description
为使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请实施方式作进一步地详细描述。In order to make the purpose, technical solution and advantages of the present application clearer, the implementation manners of the present application will be further described in detail below in conjunction with the accompanying drawings.
在通信网络中,网络设备之间建立有通信链路,网络设备通过通信链路转发主机的数据报文,以实现主机之间的数据通信。为了保证主机之间数据通信的可靠性,网络设备通常需要检测通信链路,并根据检测结果选路。目前,检测通信链路的方案主要包括:采用BFD技术检测通信链路和采用互联网协议(Internet Protocol,IP)流性能管理(flowperformance management,FPM)技术检测通信链路。但是,采用BFD技术仅能确定通信链路是否故障,无法确定通信链路的网络质量,采用IP FPM技术检测通信链路需要依赖网络时间协议(Network Time Protocol,NTP)的时钟同步,检测的灵活性、精度和灵敏度均较低,通常10秒才会检测一次,因此无法在较短的时间内(小于10秒的时间,例如3秒)实现选路。In a communication network, a communication link is established between network devices, and the network device forwards a data packet of a host through the communication link to realize data communication between hosts. In order to ensure the reliability of data communication between hosts, network devices usually need to detect communication links and select routes based on the detection results. At present, solutions for detecting communication links mainly include: using BFD technology to detect communication links and using Internet Protocol (Internet Protocol, IP) flow performance management (flow performance management, FPM) technology to detect communication links. However, the use of BFD technology can only determine whether the communication link is faulty, and cannot determine the network quality of the communication link. The use of IP FPM technology to detect communication links needs to rely on the clock synchronization of the Network Time Protocol (NTP), and the detection is flexible. The performance, precision and sensitivity are all low, and it is usually detected once every 10 seconds, so it is impossible to realize route selection in a short period of time (less than 10 seconds, for example, 3 seconds).
本申请实施例提供一种通信链路检测方法及相关装置,不仅能够检测通信链路是否故障,还可以确定通信链路的网络质量,并且具有较高的灵活性、精度和灵敏度。其中,通信链路的网络质量可以是通信链路的丢包量、通信链路的丢包率、通信链路的时延或通信链路的抖动等,该丢包量指的是在一定时长内的丢包量,该时延可以是单向时延和双向时延中的至少一种,该抖动可以基于时延确定。下面主要以通信链路的网络质量是通信链路的丢包量为例阐述本申请实施例的方案。Embodiments of the present application provide a communication link detection method and a related device, which can not only detect whether the communication link is faulty, but also determine the network quality of the communication link, and have high flexibility, precision and sensitivity. Among them, the network quality of the communication link can be the packet loss amount of the communication link, the packet loss rate of the communication link, the time delay of the communication link or the jitter of the communication link, etc. The amount of packet loss within, the delay may be at least one of a one-way delay and a two-way delay, and the jitter may be determined based on the delay. The solution of the embodiment of the present application will be described below mainly by taking the network quality of the communication link as the packet loss amount of the communication link as an example.
请参考图1,其示出了本申请实施例所涉及的一种实施环境的示意图,该实施环境提供一种通信网络,该通信网络可以为SD-WAN,该通信网络包括多个网络设备和多个主机(host),网络设备之间建立有通信链路,主机与网络设备通信连接。网络设备通过通信链路转发主机的数据报文,以实现主机之间的数据通信。Please refer to FIG. 1, which shows a schematic diagram of an implementation environment involved in the embodiment of the present application. The implementation environment provides a communication network, which may be SD-WAN, and the communication network includes multiple network devices and There are multiple hosts, communication links are established between the network devices, and the hosts communicate with the network devices. The network device forwards the data packets of the host through the communication link to realize the data communication between the hosts.
示例地,该图1以多个网络设备包括网络设备001~003,多个主机包括主机004~005为例说明,网络设备001与网络设备002之间建立有通信链路L12,网络设备001与网络设备003之间建立有通信链路L13,网络设备002与网络设备003之间建立有通信链路L23和通信链路L213,通信链路L213由通信链路L12和通信链路L13构成;主机004与网络设备002通信连接,主机005与网络设备003通信连接。网络设备002可以通过通信链路L23将主机004的数据报文转发给网络设备003,也可以通过通信链路L213将主机004的数据报文转发给网络设备003,以由网络设备003将该数据报文转发给主机005,实现主机004与主机005之间的数据通信;网络设备003可以通过通信链路L23将主机005的数据报文转发给网络设备002,也可以通过通信链路L213将主机005的数据报文转发给网络设备002,以由网络设备002将该数据报文转发给主机004,实现主机005与主机004之间的数据通信。Exemplarily, in FIG. 1, a plurality of network devices including network devices 001-003, and a plurality of hosts including hosts 004-005 are used as an example for illustration. A communication link L12 is established between
网络设备通常需要检测通信链路,以根据检测结果选路,从而保证主机之间数据通信的可靠性。示例地,网络设备002需要检测通信链路L23和通信链路L213,以在通信链路L23和通信链路L213中选择一条通信链路转发数据报文,例如,在通信链路L23的网络质量较差时,网络设备002将数据报文切换至通信链路L213转发;同理,网络设备003需要检测通信链路L23和通信链路L213,以在通信链路L23和通信链路L213中选择一条通信链路转发数据报文,例如,在通信链路L213的网络质量较差时,网络设备003将数据报文切换至通信链路L23转发。通过上述选路,可以保证主机004与主机005主机之间数据通信的可靠性。Network devices usually need to detect communication links to select routes according to the detection results, so as to ensure the reliability of data communication between hosts. For example, the
其中,在图1所示实施环境中,网络设备001~003中的每个网络设备可以是交换机、接入路由器(access router,AR)等在通信网络中用于转发数据报文的设备,网络设备001~003可以是相同的网络设备,例如,网络设备001~003均可以是AR,或者,网络设备001~003可以是不同的网络设备,例如,网络设备001和网络设备002为AR,网络设备003为交换机。主机004~005中的每个主机可以是具备无线通信功能的通信设备,例如,主机004~005中的每个主机可以是智能手机、平板电脑、台式计算机、物联网(internet of things,IoT)设备等,且主机004~005可以是相同的通信设备,例如,主机004~005均可以是智能手机,或者,主机004~005可以是不同的通信设备,例如,主机004是智能手机,主机005是IoT设备。其中,IoT设备可以是家用电器、智能家居、交通工具、工具设备、服务设备、服务设施或可穿戴设备等,IoT设备例如但不限于:智能冰箱、智能洗衣机、智能水表、智能电表、智能汽车、车载设备或可穿戴设备等等。Wherein, in the implementation environment shown in FIG. 1, each of the network devices 001-003 may be a switch, an access router (access router, AR) and other devices used to forward data packets in a communication network, and the
需要指出的是,为了便于描述,图1中以虚线的形式示出了通信链路L213,本领域技术人员应当明白,通信链路L213实际指的是由通信链路L12和通信链路L13构成的链路(也即是L213=L12+L13),而不是独立于通信链路L12和通信链路L13的链路。在一些场景中,本申请实施例所述的通信链路也可以称为通信通路、通信隧道或隧道通路等,并且容易理解,通信链路L12、通信链路L13和通信链路23中的每个通信链路可以是一个传输网络。It should be pointed out that, for the convenience of description, the communication link L213 is shown in the form of a dotted line in FIG. (that is, L213=L12+L13), rather than a link independent of the communication link L12 and the communication link L13. In some scenarios, the communication link described in the embodiment of the present application may also be called a communication path, a communication tunnel, or a tunnel path, etc., and it is easy to understand that each of the communication link L12, the communication link L13, and the communication link 23 A communication link may be a transport network.
还需要指出的是,图1所示的通信网络仅用于举例,并非用于限制本申请实施例的技术方案。本领域的技术人员应当明白,在具体实现过程中,通信网络还可能包括其他设备,例如,通信网络还可以包括控制设备,控制设备例如可以是控制器,控制设备可以向上述各个网络设备下发网络配置信息,以便于上述通信链路的建立。并且容易理解,在具体实现过程中,可以根据需要来配置网络设备的数量。It should also be pointed out that the communication network shown in FIG. 1 is only used as an example, and is not used to limit the technical solutions of the embodiments of the present application. Those skilled in the art should understand that in the specific implementation process, the communication network may also include other devices. For example, the communication network may also include a control device. The control device may be a controller, for example, and the control device may send Network configuration information to facilitate the establishment of the above-mentioned communication link. And it is easy to understand that in a specific implementation process, the number of network devices can be configured according to needs.
请参考图2,其示出了本申请实施例提供的一种通信链路检测方法的信令图,该通信链路检测方法可以应用于通信网络,该通信网络包括第一网络设备和第二网络设备,第一网络设备与第二网络设备之间建立有第一通信链路。参见图2,该方法可以包括如下步骤:Please refer to FIG. 2, which shows a signaling diagram of a communication link detection method provided by an embodiment of the present application. The communication link detection method can be applied to a communication network, and the communication network includes a first network device and a second network device. A network device, a first communication link is established between the first network device and the second network device. Referring to Figure 2, the method may include the following steps:
步骤201、第一网络设备确定第一网络设备在第n个检测周期之前的m个检测周期内通过第一通信链路发送的报文数量。Step 201, the first network device determines the number of packets sent by the first network device through the first communication link in the m detection cycles before the n detection cycle.
其中,第一网络设备在第n个检测周期之前的m个检测周期内通过第一通信链路发送的报文数量可以包括:第一网络设备在所述m个检测周期内通过第一通信链路发送的数据报文的数量和链路检测请求报文的数量,n>m≥1,且n和m均为整数。由于第一通信链路是第一网络设备与第二网络设备之间的通信链路,因此容易理解,第一网络设备通过第一通信链路发送的数据报文和链路检测请求报文的接收端均为第二网络设备。Wherein, the number of packets sent by the first network device through the first communication link in the m detection periods before the n detection period may include: The number of data packets sent by the link and the number of link detection request packets, n>m≥1, and both n and m are integers. Since the first communication link is a communication link between the first network device and the second network device, it is easy to understand that the data packet and the link detection request message sent by the first network device through the first communication link The receiving end is the second network device.
可选地,n-m=1,也即是,所述m个检测周期中的第m检测周期与第n个检测周期相邻;进一步可选地,m=10,也即是,第一网络设备确定第一网络设备在第n个检测周期之前的10个检测周期内通过第一通信链路发送的报文数量,该10个检测周期中的第10个检测周期与该第n个检测周期相邻。示例地,以T表示检测周期,当n=13时,第n个检测周期可以为检测周期T13,则第n个检测周期之前的10个检测周期可以为检测周期T3~T12,该10个检测周期中的第10个检测周期可以为检测周期T12。Optionally, n-m=1, that is, the mth detection period among the m detection periods is adjacent to the nth detection period; further optionally, m=10, that is, the first network device Determine the number of packets sent by the first network device through the first communication link in the 10 detection cycles before the nth detection cycle, and the 10th detection cycle in the 10 detection cycles is the same as the nth detection cycle adjacent. For example, T represents the detection cycle, when n=13, the nth detection cycle can be the detection cycle T13, then the 10 detection cycles before the nth detection cycle can be the detection cycle T3 ~ T12, the 10 detection cycles The tenth detection cycle in the cycle may be the detection cycle T12.
在本申请实施例中,链路检测请求报文可以是第一网络设备的自发报文,该自发报文指的是由第一网络设备生成并发送的,用于检测通信链路的报文,第一网络设备发送的数据报文指的是由主机生成且由第一网络设备转发的报文,数据报文用于主机之间通信。由于链路检测请求报文可以是第一网络设备的自发报文,因此可以根据实际需要配置链路检测请求报文的发送间隔(也即是检测周期),这样一来,可以提高通信链路检测的灵活性、精度以及灵敏度。示例地,检测周期可以为100毫秒。容易理解,检测周期为100毫秒仅仅是示例性的,实际应用中,可以灵活配置检测周期,检测周期可以小于100毫秒,也可以大于100毫秒。In this embodiment of the application, the link detection request message may be a spontaneous message sent by the first network device, and the spontaneous message refers to a message generated and sent by the first network device for detecting a communication link , the data packet sent by the first network device refers to a packet generated by the host and forwarded by the first network device, and the data packet is used for communication between hosts. Since the link detection request message can be a spontaneous message of the first network device, the sending interval (that is, the detection period) of the link detection request message can be configured according to actual needs. In this way, the communication link can be improved. Detection flexibility, precision and sensitivity. Exemplarily, the detection period may be 100 milliseconds. It is easy to understand that the detection period of 100 milliseconds is only exemplary. In practical applications, the detection period can be flexibly configured, and the detection period can be less than 100 milliseconds or greater than 100 milliseconds.
可选地,第一网络设备确定第一网络设备在所述m个检测周期内通过第一通信链路发送的报文数量可以包括:对于所述m个检测周期中的第i个检测周期,第一网络设备从通过第一通信链路发送所述第i个检测周期的链路检测请求报文的时刻开始统计通过第一通信链路发送的报文数量,直至通过第一通信链路发送第i+1个检测周期的链路检测请求报文的时刻停止统计,将统计到的发送的报文数量确定为第一网络设备在所述第i个检测周期内通过第一通信链路发送的报文数量;对于所述m个检测周期中的每个检测周期,第一网络设备可以采用与所述第i个检测周期相同的方式确定第一网络设备在该每个检测周期内通过第一通信链路发送的报文数量,之后,第一网络设备可以根据第一网络设备在所述m个检测周期中的每个检测周期内通过第一通信链路发送的报文数量,确定第一网络设备在所述m个检测周期内通过第一通信链路发送的报文数量。其中,所述第i个检测周期为所述m个检测周期中的任一检测周期,1≤i≤m,且i为整数。Optionally, the first network device determining the number of packets sent by the first network device through the first communication link within the m detection periods may include: for the i-th detection period in the m detection periods, The first network device counts the number of packets sent through the first communication link from the moment when the link detection request packet of the i-th detection period is sent through the first communication link until the number of packets sent through the first communication link Stop counting at the moment of the link detection request message in the i+1 detection cycle, and determine the number of packets sent that have been counted as being sent by the first network device through the first communication link in the i-th detection cycle number of packets; for each detection cycle in the m detection cycles, the first network device may determine that the first network device passes the first detection cycle in each detection cycle in the same manner as the ith detection cycle The number of packets sent by a communication link, and then, the first network device can determine the number of packets sent by the first network device through the first communication link in each of the m detection cycles in each detection cycle. The number of packets sent by a network device through the first communication link within the m detection periods. Wherein, the i-th detection period is any one of the m detection periods, 1≤i≤m, and i is an integer.
可选地,第一网络设备可以具有通信接口和处理器,处理器可以具有计时功能和计数功能。对于所述第i个检测周期,当所述第i个检测周期的起始时刻到来时,处理器触发通信接口通过第一通信链路发送所述第i个检测周期的链路检测请求报文,同时处理器开始统计所述第i个检测周期第一网络设备通过第一通信链路发送的报文数量,当第i+1个检测周期的起始时刻到来时,处理器触发通信接口通过第一通信链路发送所述第i+1个检测周期的链路检测请求报文,并停止统计所述第i个检测周期第一网络设备通过第一通信链路发送的报文数量,处理器可以将该段时间段(也即是所述第i个检测周期的起始时刻与所述第i+1个检测周期的起始时刻之间的时间段)内统计到的发送的报文数量确定为第一网络设备在所述第i个检测周期内通过第一通信链路发送的报文数量。需要指出的是,第一网络设备在所述第i个检测周期内通过第一通信链路发送的报文数量包括第一网络设备在所述第i个检测周期内通过第一通信链路发送的链路检测请求报文的数量和数据报文的数量。容易理解,第一网络设备在每个检测周期内通过第一通信链路发送的链路检测请求报文的数量通常为1。Optionally, the first network device may have a communication interface and a processor, and the processor may have a timing function and a counting function. For the i-th detection period, when the starting moment of the i-th detection period arrives, the processor triggers the communication interface to send the link detection request message of the i-th detection period through the first communication link At the same time, the processor starts to count the number of packets sent by the first network device through the first communication link in the i-th detection cycle, and when the start moment of the i+1th detection cycle arrives, the processor triggers the communication interface to pass The first communication link sends the link detection request message of the i+1 detection cycle, and stops counting the number of messages sent by the first network device through the first communication link in the i-th detection cycle, and processes The device can count the sent packets within the time period (that is, the time period between the start time of the i-th detection cycle and the start time of the i+1-th detection cycle) The number is determined as the number of packets sent by the first network device through the first communication link within the i-th detection period. It should be noted that the number of packets sent by the first network device through the first communication link during the ith detection period includes the number of packets sent by the first network device through the first communication link during the ith detection period The number of link detection request packets and the number of data packets. It is easy to understand that the number of link detection request packets sent by the first network device through the first communication link in each detection period is usually one.
示例地,第一网络设备在所述第i个检测周期内通过第一通信链路发送的报文数量可以为S1_SC[i]。第一网络设备在所述m个检测周期内通过第一通信链路发送的报文数量可以为S1_SC[1~m],S1_SC[1~m]包括S1_SC[m]、S1_SC[m-1]、S1_SC[m-2]、S1_SC[i]......S1_SC[1],S1_SC[m]表示第一网络设备在所述m个检测周期中的第m个检测周期内通过第一通信链路发送的报文数量,S1_SC[m-1]表示第一网络设备在所述m个检测周期中的第m-1个检测周期内通过第一通信链路发送的报文数量,依次类推,S1_SC[1]表示第一网络设备在所述m个检测周期中的第1个检测周期内通过第一通信链路发送的报文数量。需要指出的是,检测第一通信链路的过程是持续执行的,所述m个检测周期中的第1个检测周期可以是第一通信链路的第1个检测周期,也可以不是第一通信链路的第1个检测周期。For example, the number of packets sent by the first network device through the first communication link within the i-th detection period may be S1_SC[i]. The number of packets sent by the first network device through the first communication link within the m detection periods may be S1_SC[1~m], and S1_SC[1~m] includes S1_SC[m], S1_SC[m-1] , S1_SC[m-2], S1_SC[i]...S1_SC[1], S1_SC[m] indicates that the first network device passes the first The number of packets sent by the communication link, S1_SC[m-1] indicates the number of packets sent by the first network device through the first communication link in the m-1th detection cycle among the m detection cycles, in order By analogy, S1_SC[1] represents the number of packets sent by the first network device through the first communication link in the first detection cycle among the m detection cycles. It should be pointed out that the process of detecting the first communication link is continuously executed, and the first detection cycle among the m detection cycles may be the first detection cycle of the first communication link, or may not be the first detection cycle. The first detection cycle of the communication link.
步骤202、第一网络设备在第n个检测周期,通过第一通信链路向第二网络设备发送第一链路检测请求报文,第一链路检测请求报文包括第一网络设备在所述m个检测周期内通过第一通信链路发送的报文数量。Step 202, the first network device sends a first link detection request message to the second network device through the first communication link in the nth detection cycle, the first link detection request message includes the first network device in the The number of packets sent through the first communication link within the m detection periods.
第一链路检测请求报文为第一网络设备的自发报文。The first link detection request packet is a spontaneous packet of the first network device.
在本申请实施例中,第一网络设备可以在第n个检测周期的起始时刻到来时,通过第一通信链路向第二网络设备发送第一链路检测请求报文。In this embodiment of the present application, the first network device may send the first link detection request message to the second network device through the first communication link when the start moment of the nth detection period arrives.
可选地,在第n个检测周期的起始时刻到来时,第一网络设备可以先生成第一链路检测请求报文,然后通过第一通信链路向第二网络设备发送第一链路检测请求报文。其中,第一链路检测请求报文包括第一网络设备在所述m个检测周期内通过第一通信链路发送的报文数量。示例地,第一链路检测请求报文包括S1_SC[1~m]。Optionally, when the start moment of the nth detection period arrives, the first network device may first generate a first link detection request message, and then send the first link detection request message to the second network device through the first communication link. Detect request packets. Wherein, the first link detection request message includes the number of messages sent by the first network device through the first communication link within the m detection periods. Exemplarily, the first link detection request message includes S1_SC[1~m].
本申请实施例对第一链路检测请求报文所包含的信息的描述仅仅是示例性的,本领域技术人员应当明白,第一链路检测请求报文还可以包括其他信息,例如,第一链路检测请求报文还可以包括第一链路检测请求报文的类型(请求类型或响应类型)、第一链路检测请求报文的序列号,以及,第一链路检测请求报文的发送时间戳S1_STn等,S1_STn表示第一网络设备在第n个检测周期内通过第一通信链路发送链路检测请求报文的时间戳。The description of the information contained in the first link detection request packet in this embodiment of the present application is only exemplary, and those skilled in the art should understand that the first link detection request packet may also include other information, for example, the first The link detection request message may also include the type (request type or response type) of the first link detection request message, the sequence number of the first link detection request message, and the first link detection request message. Sending time stamps S1_STn, etc., where S1_STn represents the time stamp of the link detection request message sent by the first network device through the first communication link in the nth detection cycle.
步骤203、第二网络设备在第n个检测周期,通过第一通信链路接收第一网络设备发送的第一链路检测请求报文。Step 203, the second network device receives the first link detection request message sent by the first network device through the first communication link in the nth detection period.
第二网络设备接收到第一链路检测请求报文后,可以解析第一链路检测请求报文,得到第一网络设备在所述m个检测周期内通过第一通信链路发送的报文数量,第一网络设备在所述m个检测周期内通过第一通信链路发送的报文数量可以为S1_SC[1~m]。容易理解,第二网络设备解析第一链路检测请求报文还可以得到第一链路检测请求报文的类型、第一链路检测请求报文的序列号以及第一链路检测请求报文的发送时间戳S1_STn等信息。After receiving the first link detection request message, the second network device may parse the first link detection request message to obtain the message sent by the first network device through the first communication link within the m detection periods The number of packets sent by the first network device through the first communication link within the m detection periods may be S1_SC[1~m]. It is easy to understand that the second network device can also obtain the type of the first link detection request message, the serial number of the first link detection request message, and the first link detection request message by analyzing the first link detection request message. The sending time stamp S1_STn and other information.
可选地,第二网络设备可以确定第一链路检测请求报文的接收时间戳S2_RTn,当第一链路检测请求报文还包括第一链路检测请求报文的发送时间戳S1_STn时,第二网络设备可以根据第一链路检测请求报文的接收时间戳S2_RTn和第一链路检测请求报文的发送时间戳S1_STn,确定第一通信链路的第一单向时延。示例地,该第一单向时延可以是△Tn1=S2_RTn-S1_STn。S2_RTn表示第二网络设备在第n个检测周期内通过第一通信链路接收链路检测请求报文的时间戳,△Tn1表示第一通信链路在第n个检测周期的第一单向时延,该第一单向时延指的是第一通信链路在第一方向上的时延,该第一方向指的是从第一网络设备到第二网络设备的方向。Optionally, the second network device may determine the receiving timestamp S2_RTn of the first link detection request message. When the first link detection request message also includes the sending timestamp S1_STn of the first link detection request message, The second network device may determine the first one-way delay of the first communication link according to the receiving timestamp S2_RTn of the first link detection request message and the sending timestamp S1_STn of the first link detection request message. Exemplarily, the first one-way time delay may be ΔTn1=S2_RTn−S1_STn. S2_RTn indicates the time stamp when the second network device receives the link detection request message through the first communication link in the nth detection period, and △Tn1 indicates the first one-way time of the first communication link in the nth detection period Delay, the first one-way delay refers to the delay of the first communication link in the first direction, and the first direction refers to the direction from the first network device to the second network device.
步骤204、第二网络设备在第n个检测周期,确定第二网络设备在所述m个检测周期内通过第一通信链路接收的报文数量。Step 204, the second network device determines the number of packets received by the second network device through the first communication link within the m detection periods in the nth detection period.
其中,第二网络设备在所述m个检测周期内通过第一通信链路接收的报文数量可以包括:第二网络设备在所述m个检测周期内通过第一通信链路接收的数据报文的数量和链路检测请求报文的数量。由于第一通信链路是第一网络设备与第二网络设备之间的通信链路,因此容易理解,第二网络设备通过第一通信链路接收的数据报文和链路检测请求报文的发送端均为第一网络设备。如步骤201所述,链路检测请求报文可以是第一网络设备的自发报文。Wherein, the number of packets received by the second network device through the first communication link within the m detection periods may include: datagrams received by the second network device through the first communication link within the m detection periods The number of messages and the number of link detection request messages. Since the first communication link is a communication link between the first network device and the second network device, it is easy to understand that the data packet and the link detection request message received by the second network device through the first communication link The sending ends are all first network devices. As described in step 201, the link detection request packet may be a spontaneous packet of the first network device.
可选地,第二网络设备确定第二网络设备在所述m个检测周期内通过第一通信链路接收的报文数量可以包括:对于所述m个检测周期中的第i个检测周期,第二网络设备从通过第一通信链路接收到所述第i个检测周期的链路检测请求报文的时刻开始统计通过第一通信链路接收的报文数量,直至通过第一通信链路接收到第i+1个检测周期的链路检测请求报文的时刻停止统计,将统计到的接收的报文数量确定为第二网络设备在所述第i个检测周期内通过第一通信链路接收的报文数量;对于所述m个检测周期中的每个检测周期,第二网络设备可以采用与所述第i个检测周期相同的方式确定第二网络设备在该每个检测周期内通过第一通信链路接收的报文数量,之后,第二网络设备可以根据第二网络设备在所述m个检测周期中的每个检测周期内通过第一通信链路接收的报文数量,确定第二网络设备在所述m个检测周期内通过第一通信链路接收的报文数量。其中,所述第i个检测周期为所述m个检测周期中的任一检测周期,1≤i≤m,且i为整数。Optionally, the second network device determining the number of packets received by the second network device through the first communication link within the m detection periods may include: for the i-th detection period in the m detection periods, The second network device starts counting the number of packets received through the first communication link from the moment when it receives the link detection request message of the i-th detection period through the first communication link until the number of packets received through the first communication link Stop counting when the link detection request message of the i+1th detection cycle is received, and determine the number of received packets counted as the second network device passing through the first communication link within the i-th detection cycle The number of packets received by the path; for each detection period in the m detection periods, the second network device can determine the second network device in each detection period in the same way as the i-th detection period The number of packets received through the first communication link, and then, the second network device may, according to the number of packets received by the second network device through the first communication link in each of the m detection cycles, Determine the number of packets received by the second network device through the first communication link within the m detection periods. Wherein, the i-th detection period is any one of the m detection periods, 1≤i≤m, and i is an integer.
可选地,第二网络设备可以具有通信接口和处理器,处理器可以具有计时功能和计数功能。对于所述第i个检测周期,当处理器通过通信接口接收到所述i个检测周期的链路检测请求报文时,处理器开始统计所述第i个检测周期第二网络设备通过第一通信链路接收的报文数量,当处理器通过通信接口接收到第i+1个检测周期的链路检测请求报文时,处理器停止统计所述第i个检测周期第二网络设备通过第一通信链路接收的报文数量,处理器可以将该段时间段(也即是接收到所述第i+1个检测周期的链路检测请求报文的时刻与接收到所述第i个检测周期的链路检测请求报文的时刻之间的时间段)内统计到的接收到的数据报文的数量确定为第二网络设备在所述第i个检测周期内通过第一通信链路接收的报文数量。需要指出的是,第二网络设备在所述第i个检测周期内通过第一通信链路接收的报文数量包括第二网络设备在所述第i个检测周期内通过第一通信链路接收的链路检测请求报文的数量和数据报文的数量,而不包括所述第i+1个检测周期的链路检测请求报文的数量。容易理解,第二网络设备在每个检测周期内通过第一通信链路接收的链路检测请求报文的数量通常为1。Optionally, the second network device may have a communication interface and a processor, and the processor may have a timing function and a counting function. For the i-th detection period, when the processor receives the link detection request message of the i-th detection period through the communication interface, the processor starts to count the i-th detection period when the second network device passes through the first The number of messages received by the communication link. When the processor receives the link detection request message of the i+1th detection cycle through the communication interface, the processor stops counting the second network device passing through the i-th detection cycle. The number of messages received by a communication link, the processor can compare the period of time (that is, the time when the link detection request message of the i+1 detection cycle is received with the time when the i-th detection cycle is received) The number of received data packets counted in the period between the moments of the link detection request message of the detection cycle) is determined as the second network device passing the first communication link in the i-th detection cycle The number of packets received. It should be noted that the number of packets received by the second network device through the first communication link during the ith detection period includes the number of packets received by the second network device through the first communication link during the ith detection period The number of link detection request packets and the number of data packets, excluding the number of link detection request packets of the i+1th detection cycle. It is easy to understand that the number of link detection request packets received by the second network device through the first communication link in each detection cycle is usually one.
示例地,第二网络设备在所述第i个检测周期内通过第一通信链路接收的报文数量可以为S2_RC[i]。第二网络设备在所述m个检测周期内通过第一通信链路接收的报文数量可以为S2_RC[1~m],S2_RC[1~m]包括S2_RC[m]、S2_RC[m-1]、S2_RC[m-2]、S2_RC[i]......S2_RC[1],S2_RC[m]表示第二网络设备在所述m个检测周期中的第m个检测周期内通过第一通信链路接收的报文数量,S2_RC[m-1]表示第二网络设备在所述m个检测周期中的第m-1个检测周期内通过第一通信链路接收的报文数量,依次类推,S2_RC[1]表示第二网络设备在所述m个检测周期中的第1个检测周期内通过第一通信链路接收的报文数量。For example, the number of packets received by the second network device through the first communication link within the i-th detection period may be S2_RC[i]. The number of packets received by the second network device through the first communication link within the m detection periods may be S2_RC[1~m], and S2_RC[1~m] includes S2_RC[m], S2_RC[m-1] , S2_RC[m-2], S2_RC[i]...S2_RC[1], S2_RC[m] indicates that the second network device passes the first The number of packets received by the communication link, S2_RC[m-1] indicates the number of packets received by the second network device through the first communication link in the m-1th detection cycle among the m detection cycles, in order By analogy, S2_RC[1] represents the number of packets received by the second network device through the first communication link in the first detection cycle among the m detection cycles.
第二网络设备确定第二网络设备在所述m个检测周期内通过第一通信链路接收的报文数量S2_RC[1~m]后,可以根据第二网络设备在所述m个检测周期内通过第一通信链路接收的报文数量S2_RC[1~m]和步骤203解析得到的第一网络设备在所述m个检测周期内通过第一通信链路发送的报文数量S1_SC[1~m],确定第一通信链路的第一单向丢包量。示例地,该第一单向丢包量可以是△RS1=S2_RC[1~m]-S1_SC[1~m]=(S2_RC[1]-S1_SC[1])+(S2_RC[2]-S1_SC[2])+...+(S2_RC[m-2]-S1_SC[m-2])+(S2_RC[m-1]-S1_SC[m-1])+(S2_RC[m]-S1_SC[m])。该第一单向丢包量指的是第一通信链路在第一方向上的丢包量,该第一方向指的是从第一网络设备到第二网络设备的方向。After the second network device determines the number of packets S2_RC[1~m] received by the second network device through the first communication link within the m detection periods, it may The number of packets S2_RC[1~m] received through the first communication link and the number of packets S1_SC[1~m] sent by the first network device through the first communication link within the m detection periods obtained from the analysis in step 203 m] to determine the first unidirectional packet loss amount of the first communication link. For example, the first unidirectional packet loss amount may be ΔRS1=S2_RC[1~m]-S1_SC[1~m]=(S2_RC[1]-S1_SC[1])+(S2_RC[2]-S1_SC[ 2])+...+(S2_RC[m-2]-S1_SC[m-2])+(S2_RC[m-1]-S1_SC[m-1])+(S2_RC[m]-S1_SC[m] ). The first unidirectional packet loss amount refers to the packet loss amount of the first communication link in a first direction, and the first direction refers to a direction from the first network device to the second network device.
步骤205、第二网络设备在第n个检测周期,确定第二网络设备在所述m个检测周期内通过第一通信链路发送的报文数量。Step 205, the second network device determines the number of packets sent by the second network device through the first communication link within the m detection periods in the nth detection period.
其中,第二网络设备在所述m个检测周期内通过第一通信链路发送的报文数量可以包括:第二网络设备在所述m个检测周期内通过第一通信链路发送的数据报文的数量和链路检测响应报文的数量。由于第一通信链路是第一网络设备与第二网络设备之间的通信链路,因此容易理解,第二网络设备通过第一通信链路发送的数据报文和链路检测响应报文的接收端均为第一网络设备。第一网络设备通过第一通信链路向第二网络设备发送链路检测请求报文后,第二网络设备可以通过第一通信链路向第一网络设备发送链路检测响应报文。其中,链路检测响应报文可以是在第二网络设备接收到链路检测请求报文后立即发送的,链路检测响应报文的发送时刻与链路检测请求报文的接收时刻可以是相邻的两个时刻。Wherein, the number of packets sent by the second network device through the first communication link within the m detection periods may include: datagrams sent by the second network device through the first communication link within the m detection periods The number of messages and the number of link detection response messages. Since the first communication link is a communication link between the first network device and the second network device, it is easy to understand that the data packet and the link detection response message sent by the second network device through the first communication link The receiving ends are all first network devices. After the first network device sends a link detection request message to the second network device through the first communication link, the second network device may send a link detection response message to the first network device through the first communication link. Wherein, the link detection response message may be sent immediately after the second network device receives the link detection request message, and the sending time of the link detection response message may be the same as the receiving time of the link detection request message. Neighboring two moments.
在本申请实施例中,链路检测响应报文可以是第二网络设备的自发报文,该自发报文指的是由第二网络设备生成并发送的,用于响应链路检测请求报文的报文,第二网络设备发送的数据报文指的是由主机生成且由第二网络设备转发的报文,数据报文用于主机之间通信。由于链路检测响应报文可以是第二网络设备的自发报文,因此可以根据实际需要配置链路检测响应报文的发送间隔(也即是检测周期),这样一来,可以提高通信链路检测的灵活性、精度以及灵敏度。示例地,检测周期可以为100毫秒。容易理解,检测周期为100毫秒仅仅是示例性的,实际应用中,可以灵活配置检测周期,检测周期可以小于100毫秒,也可以大于100毫秒。In this embodiment of the application, the link detection response message may be a spontaneous message sent by the second network device, and the spontaneous message refers to a message generated and sent by the second network device to respond to the link detection request message The data message sent by the second network device refers to a message generated by the host and forwarded by the second network device, and the data message is used for communication between hosts. Since the link detection response message can be a spontaneous message of the second network device, the sending interval (that is, the detection cycle) of the link detection response message can be configured according to actual needs. In this way, the communication link can be improved. Detection flexibility, precision and sensitivity. Exemplarily, the detection period may be 100 milliseconds. It is easy to understand that the detection period of 100 milliseconds is only exemplary. In practical applications, the detection period can be flexibly configured, and the detection period can be less than 100 milliseconds or greater than 100 milliseconds.
可选地,第二网络设备确定第二网络设备在所述m个检测周期内通过第一通信链路发送的报文数量可以包括:对于所述m个检测周期中的第i个检测周期,第二网络设备从通过第一通信链路发送所述第i个检测周期的链路检测响应报文的时刻开始统计通过第一通信链路发送的报文数量,直至通过第一通信链路发送第i+1个检测周期的链路检测响应报文的时刻停止统计,将统计到的发送的报文数量确定为第二网络设备在所述第i个检测周期内通过第一通信链路发送的报文数量;对于所述m个检测周期中的每个检测周期,第二网络设备可以采用与所述第i个检测周期相同的方式确定第二网络设备在该每个检测周期内通过第一通信链路发送的报文数量,之后,第二网络设备可以根据第二网络设备在所述m个检测周期中的每个检测周期内通过第一通信链路发送的报文数量,确定第二网络设备在所述m个检测周期内通过第一通信链路发送的报文数量。其中,所述第i个检测周期为所述m个检测周期中的任一检测周期,1≤i≤m,且i为整数。Optionally, the second network device determining the number of packets sent by the second network device through the first communication link within the m detection periods may include: for the i-th detection period in the m detection periods, The second network device starts counting the number of packets sent through the first communication link from the moment when the link detection response packet of the i-th detection period is sent through the first communication link until the number of packets sent through the first communication link Stop counting at the moment of the link detection response message in the i+1 detection cycle, and determine the number of packets sent that have been counted as being sent by the second network device through the first communication link in the i-th detection cycle number of packets; for each detection cycle in the m detection cycles, the second network device can determine that the second network device passes the first detection cycle in each detection cycle in the same manner as the i-th detection cycle The number of packets sent by a communication link, and then, the second network device can determine the second network device according to the number of packets sent by the second network device through the first communication link in each of the m detection cycles. The number of packets sent by the second network device through the first communication link within the m detection periods. Wherein, the i-th detection period is any one of the m detection periods, 1≤i≤m, and i is an integer.
可选地,第二网络设备可以具有通信接口和处理器,处理器可以具有计时功能和计数功能。对于所述第i个检测周期,当处理器通过通信接口接收到所述i个检测周期的链路检测请求报文时,处理器触发通信接口通过第一通信链路发送所述第i个检测周期的链路检测响应报文,同时处理器开始统计所述第i个检测周期第二网络设备通过第一通信链路发送的报文数量,当处理器通过通信接口接收到第i+1个检测周期的链路检测请求报文时,处理器触发通信接口通过第一通信链路发送所述第i+1个检测周期的链路检测响应报文,同时处理器停止统计所述第i个检测周期第二网络设备通过第一通信链路发送的报文数量,处理器可以将该段时间段(也即是发送所述第i+1个检测周期的链路检测响应报文的时刻与发送所述第i个检测周期的链路检测响应报文的时刻之间的时间段)内统计到的发送的报文数量确定为第二网络设备在所述第i个检测周期内通过第一通信链路发送的报文数量。需要指出的是,第二网络设备在所述第i个检测周期内通过第一通信链路发送的报文数量包括第二网络设备在所述第i个检测周期内通过第一通信链路发送的链路检测响应报文的数量和数据报文的数量,而不包括所述第i+1个检测周期的链路检测响应报文的数量。容易理解,第二网络设备在每个检测周期内通过第一通信链路发送的链路检测响应报文的数量通常为1。Optionally, the second network device may have a communication interface and a processor, and the processor may have a timing function and a counting function. For the i-th detection cycle, when the processor receives the link detection request message of the i-th detection cycle through the communication interface, the processor triggers the communication interface to send the i-th detection cycle through the first communication link Periodic link detection response message, and the processor starts to count the number of messages sent by the second network device through the first communication link in the i-th detection cycle at the same time, when the processor receives the i+1th message through the communication interface When the link detection request message of the detection cycle is detected, the processor triggers the communication interface to send the link detection response message of the i+1 detection cycle through the first communication link, and at the same time, the processor stops counting the i-th The number of packets sent by the second network device in the detection cycle through the first communication link, and the processor can compare the time period (that is, the time when the link detection response message of the i+1th detection cycle is sent) with The time period between the moments when the link detection response message of the i-th detection period is sent) is determined as the second network device passing the first Number of telegrams sent on the communication link. It should be noted that the number of packets sent by the second network device through the first communication link during the ith detection period includes the number of packets sent by the second network device through the first communication link during the ith detection period The number of link detection response packets and the number of data packets, excluding the number of link detection response packets in the i+1th detection cycle. It is easy to understand that the number of link detection response packets sent by the second network device through the first communication link in each detection period is usually one.
示例地,第二网络设备在所述第i个检测周期内通过第一通信链路发送的报文数量可以为S2_SC[i]。第二网络设备在所述m个检测周期内通过第一通信链路发送的报文数量可以为S2_SC[1~m],S2_SC[1~m]包括S2_SC[m]、S2_SC[m-1]、S2_SC[m-2]、S2_SC[i]......S2_SC[1],S2_SC[m]表示第二网络设备在所述m个检测周期中的第m个检测周期内通过第一通信链路发送的报文数量,S2_SC[m-1]表示第二网络设备在所述m个检测周期中的第m-1个检测周期内通过第一通信链路发送的报文数量,依次类推,S2_SC[1]表示第二网络设备在所述m个检测周期中的第1个检测周期内通过第一通信链路发送的报文数量。For example, the number of packets sent by the second network device through the first communication link in the i-th detection period may be S2_SC[i]. The number of messages sent by the second network device through the first communication link within the m detection periods may be S2_SC[1~m], and S2_SC[1~m] includes S2_SC[m], S2_SC[m-1] , S2_SC[m-2], S2_SC[i]...S2_SC[1], S2_SC[m] indicates that the second network device passes the first The number of packets sent by the communication link, S2_SC[m-1] indicates the number of packets sent by the second network device through the first communication link in the m-1th detection cycle among the m detection cycles, in order By analogy, S2_SC[1] represents the number of packets sent by the second network device through the first communication link in the first detection cycle among the m detection cycles.
步骤206、第二网络设备在第n个检测周期,根据第一链路检测请求报文,通过第一通信链路向第一网络设备发送第一链路检测响应报文,第一链路检测响应报文包括第二网络设备在所述m个检测周期内通过第一通信链路接收的报文数量和发送的报文数量。Step 206, the second network device sends a first link detection response message to the first network device through the first communication link according to the first link detection request message in the nth detection cycle, and the first link detection The response message includes the number of messages received and the number of messages sent by the second network device through the first communication link within the m detection periods.
第二网络设备接收到第一链路检测请求报文后,可以根据第一链路检测请求报文,通过第一通信链路向第一网络设备发送第一链路检测响应报文。其中,第一链路检测响应报文的发送可以在接收到第一链路检测请求报文后立即执行,当然,也可以不是立即执行的,本申请实施例对此不做限定。After receiving the first link detection request message, the second network device may send the first link detection response message to the first network device through the first communication link according to the first link detection request message. The sending of the first link detection response message may be performed immediately after receiving the first link detection request message, of course, it may not be performed immediately, which is not limited in this embodiment of the present application.
可选地,第二网络设备可以先生成第一链路检测响应报文,然后通过第一通信链路向第一网络设备发送第一链路检测响应报文。其中,第一链路检测响应报文可以包括第二网络设备在所述m个检测周期内通过第一通信链路接收的报文数量和发送的报文数量。示例地,第一链路检测响应报文包括S2_RC[1~m]和S2_SC[1~m]。Optionally, the second network device may first generate the first link detection response message, and then send the first link detection response message to the first network device through the first communication link. Wherein, the first link detection response message may include the number of messages received and the number of messages sent by the second network device through the first communication link within the m detection periods. Exemplarily, the first link detection response message includes S2_RC[1~m] and S2_SC[1~m].
本申请实施例对第一链路检测响应报文所包含的信息的描述仅仅是示例性的,本领域技术人员应当明白,第一链路检测响应报文还可以包括其他信息,例如,第一链路检测响应报文还可以包括第一链路检测响应报文的类型(请求类型或响应类型)、第一链路检测响应报文的序列号、第一链路检测请求报文的发送时间戳S1_STn、第一链路检测请求报文的接收时间戳S2_RTn和第一链路检测响应报文的发送时间戳S2_STn,S1_STn表示第一网络设备在第n个检测周期内通过第一通信链路发送链路检测请求报文的时间戳,S2_RTn表示第二网络设备在第n个检测周期内通过第一通信链路接收链路检测请求报文的时间戳,S2_STn表示第二网络设备在第n个检测周期内通过第一通信链路发送链路检测响应报文的时间戳。The description of the information contained in the first link detection response packet in this embodiment of the present application is only exemplary, and those skilled in the art should understand that the first link detection response packet may also include other information, for example, the first The link detection response message may also include the type (request type or response type) of the first link detection response message, the serial number of the first link detection response message, and the sending time of the first link detection request message Stamp S1_STn, the receiving timestamp S2_RTn of the first link detection request message and the sending timestamp S2_STn of the first link detection response message, S1_STn indicates that the first network device passes the first communication link in the nth detection cycle The time stamp of sending the link detection request message, S2_RTn indicates the time stamp of the second network device receiving the link detection request message through the first communication link in the nth detection period, and S2_STn indicates that the second network device receives the link detection request message at the nth detection cycle The time stamp of the link detection response message sent through the first communication link within a detection period.
步骤207、第一网络设备在第n个检测周期,通过第一通信链路接收第二网络设备发送的第一链路检测响应报文。Step 207, the first network device receives the first link detection response message sent by the second network device through the first communication link in the nth detection period.
第一网络设备接收到第一链路检测响应报文后,可以解析第一链路检测响应报文,得到第二网络设备在所述m个检测周期内通过第一通信链路接收的报文数量,以及第二网络设备在所述m个检测周期内通过第一通信链路发送的报文数量。其中,第二网络设备在所述m个检测周期内通过第一通信链路接收的报文数量可以为S2_RC[1~m],第二网络设备在所述m个检测周期内通过第一通信链路发送的报文数量可以为S2_SC[1~m]。容易理解,第一网络设备解析第一链路检测响应报文还可以得到第一链路检测响应报文的类型、第一链路检测响应报文的序列号、第一链路检测请求报文的发送时间戳S1_STn、第一链路检测请求报文的接收时间戳S2_RTn和第一链路检测响应报文的发送时间戳S2_STn等信息。After receiving the first link detection response message, the first network device may parse the first link detection response message to obtain the messages received by the second network device through the first communication link within the m detection periods number, and the number of packets sent by the second network device through the first communication link within the m detection periods. Wherein, the number of packets received by the second network device through the first communication link during the m detection periods may be S2_RC[1~m], and the second network device passes the first communication link within the m detection periods The number of packets sent by the link can be S2_SC[1~m]. It is easy to understand that the first network device can also obtain the type of the first link detection response message, the serial number of the first link detection response message, and the first link detection request message by analyzing the first link detection response message. information such as the sending time stamp S1_STn of the first link detection request message, the receiving time stamp S2_RTn of the first link detection request message, and the sending time stamp S2_STn of the first link detection response message.
可选地,第一网络设备可以确定第一链路检测响应报文的接收时间戳S1_RTn,当第一链路检测响应报文还包括第一链路检测响应报文的发送时间戳S2_STn时,第一网络设备可以根据第一链路检测响应报文的发送时间戳S2_STn和第一链路检测响应报文的接收时间戳S1_RTn,确定第一通信链路的第二单向时延。示例地,该第二单向时延可以是△Tn2=S1_RTn-S2_STn,S1_RTn表示第一网络设备在第n个检测周期内通过第一通信链路接收链路检测响应报文的时间戳,△Tn2表示第一通信链路在第n个检测周期的第二单向时延,该第二单向时延指的是第一通信链路在第二方向上的时延,该第二方向指的是从第二网络设备到第一网络设备的方向。Optionally, the first network device may determine the receiving timestamp S1_RTn of the first link detection response message, and when the first link detection response message further includes the sending timestamp S2_STn of the first link detection response message, The first network device may determine the second one-way delay of the first communication link according to the sending timestamp S2_STn of the first link detection response packet and the receiving timestamp S1_RTn of the first link detection response packet. Exemplarily, the second one-way time delay may be ΔTn2=S1_RTn-S2_STn, S1_RTn represents the time stamp when the first network device receives the link detection response message through the first communication link in the nth detection period, ΔTn2 Tn2 represents the second one-way delay of the first communication link in the nth detection cycle, the second one-way delay refers to the delay of the first communication link in the second direction, and the second direction refers to is the direction from the second network device to the first network device.
可选地,第一网络设备可以确定第一链路检测响应报文的接收时间戳S1_RTn,当第一链路检测响应报文还包括第一链路检测请求报文的发送时间戳S1_STn、第一链路检测请求报文的接收时间戳S2_RTn和第一链路检测响应报文的发送时间戳S2_STn时,第一网络设备可以根据第一链路检测响应报文的接收时间戳S1_RTn、第一链路检测响应报文的发送时间戳S2_STn、第一链路检测请求报文的接收时间戳S2_RTn和第一链路检测请求报文的发送时间戳S1_STn,确定第一通信链路的双向时延。示例地,该双向时延可以是△Tn=(S1_RTn-S2_STn)+(S2_RTn-S1_STn)。Optionally, the first network device may determine the receiving time stamp S1_RTn of the first link detection response message, when the first link detection response message also includes the sending time stamp S1_STn, the first link detection request message When receiving the time stamp S2_RTn of a link detection request message and the sending time stamp S2_STn of the first link detection response message, the first network device may according to the receiving time stamp S1_RTn of the first link detection response message, the first The sending timestamp S2_STn of the link detection response message, the receiving timestamp S2_RTn of the first link detection request message, and the sending timestamp S1_STn of the first link detection request message determine the two-way delay of the first communication link . Exemplarily, the two-way time delay may be ΔTn=(S1_RTn-S2_STn)+(S2_RTn-S1_STn).
步骤208、第一网络设备第n个检测周期,确定第一网络设备在所述m个检测周期内通过第一通信链路接收的报文数量。Step 208 , the first network device determines the number of packets received by the first network device through the first communication link within the m detection cycles in the nth detection cycle.
其中,第一网络设备在所述m个检测周期内通过第一通信链路接收的报文数量可以包括:第一网络设备在所述m个检测周期内通过第一通信链路接收的数据报文的数量和链路检测响应报文的数量。由于第一通信链路是第一网络设备与第二网络设备之间的通信链路,因此容易理解,第一网络设备通过第一通信链路接收的数据报文和链路检测响应报文的发送端均为第二网络设备。如步骤202所述,链路检测响应报文可以是第二网络设备的自发报文。Wherein, the number of packets received by the first network device through the first communication link within the m detection periods may include: datagrams received by the first network device through the first communication link within the m detection periods The number of messages and the number of link detection response messages. Since the first communication link is a communication link between the first network device and the second network device, it is easy to understand that the data packet and the link detection response message received by the first network device through the first communication link The sending ends are all second network devices. As described in step 202, the link detection response packet may be a spontaneous packet of the second network device.
可选地,第一网络设备确定第一网络设备在所述m个检测周期内通过第一通信链路接收的报文数量可以包括:对于所述m个检测周期中的第i个检测周期,第一网络设备从通过第一通信链路接收到所述第i个检测周期的链路检测响应报文的时刻开始统计通过第一通信链路接收的报文数量,直至通过第一通信链路接收到第i+1个检测周期的链路检测响应报文的时刻停止统计,将统计到的接收的报文数量确定为第一网络设备在所述第i个检测周期内通过第一通信链路接收的报文数量;对于所述m个检测周期中的每个检测周期,第一网络设备可以采用与所述第i个检测周期相同的方式确定第一网络设备在该每个检测周期内通过第一通信链路接收的报文数量,之后,第一网络设备可以根据第一网络设备在所述m个检测周期中的每个检测周期内通过第一通信链路接收的报文数量,确定第一网络设备在所述m个检测周期内通过第一通信链路接收的报文数量。其中,所述第i个检测周期为所述m个检测周期中的任一检测周期,1≤i≤m,且i为整数。Optionally, the first network device determining the number of packets received by the first network device through the first communication link within the m detection periods may include: for the i-th detection period in the m detection periods, The first network device starts counting the number of packets received through the first communication link from the moment when it receives the link detection response message of the i-th detection period through the first communication link until the number of packets received through the first communication link Stop counting when the link detection response message of the i+1th detection cycle is received, and determine the number of received packets counted as the first network device passing the first communication link within the i-th detection cycle The number of packets received by the path; for each detection period in the m detection periods, the first network device can determine that the first network device is within each detection period in the same manner as the i-th detection period The number of packets received through the first communication link. Afterwards, the first network device may, according to the number of packets received by the first network device through the first communication link in each of the m detection cycles, Determine the number of packets received by the first network device through the first communication link within the m detection periods. Wherein, the i-th detection period is any one of the m detection periods, 1≤i≤m, and i is an integer.
可选地,第一网络设备可以具有通信接口和处理器,处理器可以具有计时功能和计数功能。对于所述第i个检测周期,当处理器通过通信接口接收到所述i个检测周期的链路检测响应报文时,处理器开始统计所述第i个检测周期第一网络设备通过第一通信链路接收的报文数量,当处理器通过通信接口接收到第i+1个检测周期的链路检测响应报文时,处理器停止统计所述第i个检测周期第一网络设备通过第一通信链路接收的报文数量,处理器可以将该段时间段(也即是接收到所述第i+1个检测周期的链路检测响应报文的时刻与接收到所述第i个检测周期的链路检测响应报文的时刻之间的时间段)内统计到的接收到的数据报文的数量确定为第一网络设备在所述第i个检测周期内通过第一通信链路接收的报文数量。需要指出的是,第一网络设备在所述第i个检测周期内通过第一通信链路接收的报文数量包括第一网络设备在所述第i个检测周期内通过第一通信链路接收的链路检测响应报文的数量和数据报文的数量,而不包括所述第i+1个检测周期的链路检测响应报文的数量。容易理解,第一网络设备在每个检测周期内通过第一通信链路接收的链路检测响应报文的数量通常为1。Optionally, the first network device may have a communication interface and a processor, and the processor may have a timing function and a counting function. For the i-th detection period, when the processor receives the link detection response message of the i-th detection period through the communication interface, the processor starts to count The number of messages received by the communication link. When the processor receives the link detection response message of the i+1 detection cycle through the communication interface, the processor stops counting the first network device passing the first network device in the i-th detection cycle. The number of messages received by a communication link, the processor can compare the period of time (that is, the time when the link detection response message of the i+1 detection cycle is received with the time when the i-th detection cycle is received) The number of received data packets counted in the time period between the moments of the link detection response message in the detection cycle) is determined as the first network device passing the first communication link in the i-th detection cycle The number of packets received. It should be noted that the number of packets received by the first network device through the first communication link during the ith detection period includes The number of link detection response packets and the number of data packets, excluding the number of link detection response packets in the i+1th detection cycle. It is easy to understand that the number of link detection response packets received by the first network device through the first communication link in each detection cycle is usually one.
示例地,第一网络设备在所述第i个检测周期内通过第一通信链路接收的报文数量可以为S1_RC[i]。第一网络设备在所述m个检测周期内通过第一通信链路接收的报文数量可以为S1_RC[1~m],S1_RC[1~m]包括S1_RC[m]、S1_RC[m-1]、S1_RC[m-2]、S1_RC[i]......S1_RC[1],S1_RC[m]表示第一网络设备在所述m个检测周期中的第m个检测周期内通过第一通信链路接收的报文数量,S1_RC[m-1]表示第一网络设备在所述m个检测周期中的第m-1个检测周期内通过第一通信链路接收的报文数量,依次类推,S1_RC[1]表示第一网络设备在所述m个检测周期中的第1个检测周期内通过第一通信链路接收的报文数量。For example, the number of packets received by the first network device through the first communication link within the i-th detection period may be S1_RC[i]. The number of packets received by the first network device through the first communication link within the m detection periods may be S1_RC[1~m], and S1_RC[1~m] includes S1_RC[m], S1_RC[m-1] , S1_RC[m-2], S1_RC[i]...S1_RC[1], S1_RC[m] indicates that the first network device passes the first The number of packets received by the communication link, S1_RC[m-1] indicates the number of packets received by the first network device through the first communication link in the m-1th detection cycle among the m detection cycles, in order By analogy, S1_RC[1] represents the number of packets received by the first network device through the first communication link in the first detection cycle among the m detection cycles.
第一网络设备确定第一网络设备在所述m个检测周期内通过第一通信链路接收的报文数量S1_RC[1~m]后,可以根据第一网络设备在所述m个检测周期内通过第一通信链路接收的报文数量S1_RC[1~m]和步骤207中解析得到的第二网络设备在所述m个检测周期内通过第一通信链路发送的报文数量可以为S2_SC[1~m],确定第一通信链路的第二单向丢包量。示例地,该第二单向丢包量可以是△RS2=S1_RC[1~m]-S2_SC[1~m]=(S1_RC[1]-S2_SC[1])+(S1_RC[2]-S2_SC[2])+...+(S1_RC[m-2]-S2_SC[m-2])+(S1_RC[m-1]-S2_SC[m-1])+(S1_RC[m]-S2_SC[m])。该第二单向丢包量指的是第一通信链路在第二方向上的丢包量,该第二方向指的是从第二网络设备到第一网络设备的方向。After the first network device determines the number of packets S1_RC[1~m] received by the first network device through the first communication link within the m detection periods, it may The number of packets S1_RC[1~m] received through the first communication link and the number of packets sent by the second network device through the first communication link within the m detection periods analyzed in step 207 may be S2_SC [1~m], determine the second unidirectional packet loss amount of the first communication link. For example, the second unidirectional packet loss amount may be ΔRS2=S1_RC[1~m]-S2_SC[1~m]=(S1_RC[1]-S2_SC[1])+(S1_RC[2]-S2_SC[ 2])+...+(S1_RC[m-2]-S2_SC[m-2])+(S1_RC[m-1]-S2_SC[m-1])+(S1_RC[m]-S2_SC[m] ). The second unidirectional packet loss amount refers to a packet loss amount of the first communication link in a second direction, and the second direction refers to a direction from the second network device to the first network device.
步骤209、第一网络设备根据第一网络设备在所述m个检测周期内通过第一通信链路发送的报文数量和接收的报文数量,以及,第二网络设备在所述m个检测周期内通过第一通信链路发送的报文数量和接收的报文数量,确定第一通信链路的丢包量,丢包量用于表征第一通信链路的网络质量。Step 209, the first network device according to the number of packets sent and received by the first network device through the first communication link within the m detection periods, and the second network device during the m detection periods The number of packets sent and received through the first communication link within a period determines the amount of packet loss of the first communication link, and the amount of packet loss is used to represent the network quality of the first communication link.
经过上述步骤201、步骤207和步骤208,第一网络设备可以获取到第一网络设备在所述m个检测周期内通过第一通信链路发送的报文数量S1_SC[1~m],第一网络设备在所述m个检测周期内通过第一通信链路接收的报文数量S1_RC[1~m],第二网络设备在所述m个检测周期内通过第一通信链路发送的报文数量S2_SC[1~m],和,第二网络设备在所述m个检测周期内通过第一通信链路接收的报文数量S2_RC[1~m],因此,第一网络设备可以根据第一网络设备在所述m个检测周期内通过第一通信链路发送的报文数量S1_SC[1~m],第一网络设备在所述m个检测周期内通过第一通信链路接收的报文数量S1_RC[1~m],第二网络设备在所述m个检测周期内通过第一通信链路发送的报文数量S2_SC[1~m],和,第二网络设备在所述m个检测周期内通过第一通信链路接收的报文数量S2_RC[1~m],确定第一通信链路的丢包量,该丢包量可以是双向丢包量,该丢包量用于表征第一通信链路的网络质量。示例地,第一通信链路的丢包量可以为△RS=(S2_RC[1~m]-S1_SC[1~m])+(S1_RC[1~m]-S2_SC[1~m])。After the above step 201, step 207 and step 208, the first network device can obtain the number of packets S1_SC[1~m] sent by the first network device through the first communication link within the m detection periods, the first The number of packets S1_RC[1~m] received by the network device through the first communication link within the m detection periods, and the number of packets sent by the second network device through the first communication link within the m detection periods The number S2_SC[1~m], and the number S2_RC[1~m] of packets received by the second network device through the first communication link within the m detection periods, therefore, the first network device can use the first The number of packets S1_SC[1~m] sent by the network device through the first communication link within the m detection periods, and the number of packets received by the first network device through the first communication link within the m detection periods The number S1_RC[1~m], the number of packets S2_SC[1~m] sent by the second network device through the first communication link within the m detection periods, and, the number of packets S2_SC[1~m] sent by the second network device during the m detection periods The number of packets S2_RC[1~m] received through the first communication link within a period determines the packet loss amount of the first communication link. The packet loss amount can be a two-way packet loss amount, and the packet loss amount is used to represent the second A network quality of a communication link. For example, the packet loss amount of the first communication link may be ΔRS=(S2_RC[1˜m]−S1_SC[1˜m])+(S1_RC[1˜m]−S2_SC[1˜m]).
步骤210、第一网络设备在第n+1个检测周期,通过第一通信链路向第二网络设备发送第二链路检测请求报文,第二链路检测请求报文包括第一网络设备在所述m个检测周期内通过第一通信链路接收的报文数量。Step 210, the first network device sends a second link detection request message to the second network device through the first communication link in the n+1 detection cycle, the second link detection request message includes the first network device The number of packets received through the first communication link within the m detection periods.
在本申请实施例中,第一网络设备可以在第n+1个检测周期的起始时刻到来时,通过第一通信链路向第二网络设备发送第二链路检测请求报文。In this embodiment of the present application, the first network device may send the second link detection request message to the second network device through the first communication link when the start moment of the n+1th detection period arrives.
可选地,在第n+1个检测周期的起始时刻到来时,第一网络设备可以先生成第二链路检测请求报文,然后通过第一通信链路向第二网络设备发送第二链路检测请求报文。其中,第二链路检测请求报文包括第一网络设备在所述m个检测周期内通过第一通信链路接收的报文数量。示例地,第二链路检测请求报文包括S1_RC[1~m]。Optionally, when the start moment of the n+1th detection period arrives, the first network device may first generate a second link detection request message, and then send the second link detection request message to the second network device through the first communication link. Link detection request message. Wherein, the second link detection request message includes the number of messages received by the first network device through the first communication link within the m detection periods. Exemplarily, the second link detection request message includes S1_RC[1~m].
本申请实施例对第二链路检测请求报文所包含的信息的描述仅仅是示例性的,本领域技术人员应当明白,第二链路检测请求报文还可以包括其他信息,例如,第二链路检测请求报文还可以包括第二链路检测请求报文的类型(请求类型或响应类型),第二链路检测请求报文的序列号,第二链路检测请求报文的发送时间戳,第n+1个检测周期之前的m个检测周期内第一网络设备通过第一通信链路接收的报文数量,第一网络设备计算出的双向时延等,本申请实施例对此不做限定。The description of the information contained in the second link detection request message in this embodiment of the present application is only exemplary, and those skilled in the art should understand that the second link detection request message may also include other information, for example, the second The link detection request message can also include the type (request type or response type) of the second link detection request message, the serial number of the second link detection request message, and the sending time of the second link detection request message Stamp, the number of packets received by the first network device through the first communication link in the m detection cycles before the n+1th detection cycle, the two-way delay calculated by the first network device, etc., this embodiment of the present application No limit.
步骤211、第二网络设备在第n+1个检测周期,通过第一通信链路接收第一网络设备发送的第二链路检测请求报文。Step 211 , the second network device receives the second link detection request message sent by the first network device through the first communication link in the n+1th detection period.
第二网络设备接收到第二链路检测请求报文后,可以解析第二链路检测请求报文,得到第一网络设备在所述m个检测周期内通过第一通信链路接收的报文数量,第一网络设备在所述m个检测周期内通过第一通信链路接收的报文数量可以为S1_RC[1~m]。容易理解,第二网络设备解析第二链路检测请求报文还可以得到第二链路检测请求报文的发送时间戳、第一通信链路的双向时延等信息,当然第二网络设备也可以根据第一链路检测请求的发送时间戳、第一链路检测请求的接收时间戳、第一链路检测响应的发送时间戳和第一链路检测响应的接收时间戳计算第一通信链路的双向时延,本申请实施例对此不做限定。After receiving the second link detection request message, the second network device may parse the second link detection request message to obtain the messages received by the first network device through the first communication link within the m detection periods The number of packets received by the first network device through the first communication link within the m detection periods may be S1_RC[1-m]. It is easy to understand that the second network device can also obtain information such as the sending time stamp of the second link detection request message and the two-way delay of the first communication link by parsing the second link detection request message. The first communication link may be calculated according to the sending timestamp of the first link detection request, the receiving timestamp of the first link detection request, the sending timestamp of the first link detection response, and the receiving timestamp of the first link detection response The two-way delay of the path is not limited in this embodiment of the present application.
步骤212、第二网络设备根据第一网络设备在所述m个检测周期内通过第一通信链路发送的报文数量和接收的报文数量,以及,第二网络设备在所述m个检测周期内通过第一通信链路发送的报文数量和接收的报文数量,确定第一通信链路的丢包量,丢包量用于表征第一通信链路的网络质量。Step 212, the second network device according to the number of packets sent and received by the first network device through the first communication link within the m detection periods, and the second network device detects The number of packets sent and received through the first communication link within a period determines the amount of packet loss of the first communication link, and the amount of packet loss is used to represent the network quality of the first communication link.
经过上述步骤203~205,以及步骤211,第二网络设备可以获取到第一网络设备在所述m个检测周期内通过第一通信链路发送的报文数量S1_SC[1~m],第一网络设备在所述m个检测周期内通过第一通信链路接收的报文数量S1_RC[1~m],第二网络设备在所述m个检测周期内通过第一通信链路发送的报文数量S2_SC[1~m],和,第二网络设备在所述m个检测周期内通过第一通信链路接收的报文数量S2_RC[1~m],因此,第二网络设备可以根据这些信息确定第一通信链路的丢包量,该丢包量可以是双向丢包量。第二网络设备确定第一通信链路的丢包量的过程可以参考步骤209,本申请实施例在此不再赘述。After the above steps 203-205 and step 211, the second network device can obtain the number of packets S1_SC[1-m] sent by the first network device through the first communication link within the m detection periods, the first The number of packets S1_RC[1~m] received by the network device through the first communication link within the m detection periods, and the number of packets sent by the second network device through the first communication link within the m detection periods The number S2_SC[1~m], and the number S2_RC[1~m] of packets received by the second network device through the first communication link within the m detection periods, therefore, the second network device can A packet loss amount of the first communication link is determined, and the packet loss amount may be a two-way packet loss amount. For the process of the second network device determining the packet loss amount of the first communication link, reference may be made to step 209, which will not be described again in this embodiment of the present application.
在本申请实施例中,网络设备统计的发送的报文数量和接收的报文数量均包括数据报文的数量和链路检测报文(包括链路检测请求报文和链路检测响应报文)的数量,这样一来,确定出通信链路的网络质量更接近于主机实际使用的通信链路的网络质量,因此本申请实施例提供的方案检测的可靠性较高。此外,网络设备之间交互的链路检测报文可以携带最近m次(m个检测周期)的报文数量统计结果,这样一来,当某一链路检测报文丢失时,网络设备可以根据该某一链路检测报文之后的链路检测报文携带的统计结果,还原该被丢失的链路检测报文,进一步提高检测的可靠性。In this embodiment of the application, the number of packets sent and the number of packets received by the network equipment include the number of data packets and link detection packets (including link detection request packets and link detection response packets). ), in this way, it is determined that the network quality of the communication link is closer to the network quality of the communication link actually used by the host, so the solution detection provided by the embodiment of the present application has higher reliability. In addition, link detection packets exchanged between network devices can carry the last m times (m detection cycles) packet statistics results, so that when a link detection packet is lost, the network device can The statistical result carried in the link detection message subsequent to the certain link detection message restores the lost link detection message, further improving the reliability of detection.
本申请第一网络设备和第二网络设备之间可以具有至少两条通信链路,可以根据本申请实施例提供的方案检测每条通信链路,以根据检测结果在至少两条通信链路之间切换流量。例如,第一网络设备和第二网络设备之间可以具有第一通信链路和第二通信链路,在根据本申请实施例提供的方案检测到第一通信链路的网络质量较差时,可以将第一网络设备与第二网络设备之间的流量切换至第二通信链路,以实现智能选路。示例地,在本实施例中,第一网络设备可以为图1所示实施环境中的网络设备002,第二网络设备可以为图1所示实施环境中的网络设备003,第一通信链路可以是图1所示实施环境中的通信链路L23,第二通信链路可以是图1所示实施环境中的通信链路L213,当通信链路L23的网络质量较差时,可以将网络设备002与网络设备003之间的流量切换至通信链路L213。There may be at least two communication links between the first network device and the second network device in this application, and each communication link may be detected according to the solution provided by the embodiment of this application, so that the at least two communication links may be connected according to the detection results. switch traffic. For example, there may be a first communication link and a second communication link between the first network device and the second network device, and when it is detected that the network quality of the first communication link is poor according to the solution provided in this embodiment, The traffic between the first network device and the second network device can be switched to the second communication link, so as to realize intelligent route selection. Exemplarily, in this embodiment, the first network device may be
本申请实施例提供的通信链路检测方法步骤的先后顺序可以适当调整,步骤也可以根据情况相应增减,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化的方法,都应涵盖在本申请的保护范围之内,因此不再赘述。The order of the steps of the communication link detection method provided in the embodiment of the application can be adjusted appropriately, and the steps can also be increased or decreased according to the situation. Any person familiar with the technical field can easily think of changes within the technical scope disclosed in the application. Methods should be covered within the scope of protection of the present application, so they will not be repeated here.
综上所述,本申请实施例提供的通信链路检测方法中,第一网络设备在第n个检测周期通过第一通信链路向第二网络设备发送第一链路检测请求报文,并通过第一通信链路接收第二网络设备发送的第一链路检测响应报文,第一链路检测响应报文包括第二网络设备在第n个检测周期之前的m个检测周期内通过第一通信链路接收的报文数量和发送的报文数量,且第一网络设备可以确定第一网络设备在该m个检测周期内通过第一通信链路发送的报文数量和接收的报文数量,之后第一网络设备可以根据第一网络设备在该m个检测周期内通过第一通信链路发送的报文数量和接收的报文数量,以及,第二网络设备在该m个检测周期内通过第一通信链路发送的报文数量和接收的报文数量,确定第一通信链路的丢包量,该丢包量用于表征第一通信链路的网络质量,因此本申请实施例提供的技术方案可以确定通信链路的网络质量。进一步地,由于链路检测请求报文为第一网络设备的自发报文,因此第一网络设备可以灵活配置链路检测请求报文的发送间隔(也即是检测周期),相比于IP FPM技术,本申请实施例提供的方案可以提高检测的灵活性、精度和灵敏度。To sum up, in the communication link detection method provided by the embodiment of the present application, the first network device sends the first link detection request message to the second network device through the first communication link in the nth detection period, and The first link detection response message sent by the second network device is received through the first communication link, and the first link detection response message includes that the second network device passes the first detection cycle in the m detection cycle before the nth detection cycle. The number of packets received and the number of packets sent by a communication link, and the first network device can determine the number of packets sent and received by the first network device through the first communication link within the m detection periods Afterwards, the first network device can send and receive packets according to the number of packets sent and received by the first network device through the first communication link within the m detection periods, and the number of packets received by the second network device during the m detection periods The packet loss amount of the first communication link is determined by the number of packets sent and received through the first communication link, and the packet loss amount is used to characterize the network quality of the first communication link. Therefore, the implementation of the present application The technical solution provided by the example can determine the network quality of the communication link. Further, since the link detection request message is a spontaneous message of the first network device, the first network device can flexibly configure the sending interval (that is, the detection period) of the link detection request message, compared to IP FPM technology, the solutions provided in the embodiments of the present application can improve the flexibility, precision and sensitivity of detection.
下面结合图3,以一个示例对本申请实施例提供的通信链路检测方法进行说明。The method for detecting a communication link provided in the embodiment of the present application will be described below by using an example with reference to FIG. 3 .
请参考图3,其示出了本申请实施例提供的一种通信链路检测方法的示意图。在图3中中,T1~T(n+1)表示n+1个检测周期,P1~P24中的每个点对应一个时刻(或称为时间戳),KA req报文为链路检测请求报文,KA Ack报文为链路检测响应报文。其中,P1点对应的时刻可以是检测周期T1的起始时刻,P5点对应的时刻可以是检测周期T2的起始时刻(或者是检测周期T1结束时刻),P9点对应的时刻可以是检测周期T3的起始时刻(或者是检测周期T2结束时刻),依次类推,P13点对应的时刻可以是检测周期Tm的起始时刻(或者是检测周期T(m-1)的结束时刻),P17点对应的时刻可以是检测周期Tn的起始时刻(或者是检测周期Tm的结束时刻),P21点对应的时刻可以是检测周期T(n+1)的起始时刻(或者是检测周期Tn的结束时刻)。本申请实施例以KA req报文和KA Ack报文均通过第一通信链路传输为例进行说明。参见图3:Please refer to FIG. 3 , which shows a schematic diagram of a method for detecting a communication link provided by an embodiment of the present application. In Figure 3, T1~T(n+1) represent n+1 detection cycles, each point in P1~P24 corresponds to a moment (or called a time stamp), and the KA req message is a link detection request message, and the KA Ack message is a link detection response message. Wherein, the time corresponding to the P1 point can be the starting time of the detection cycle T1, the time corresponding to the P5 point can be the starting time of the detection cycle T2 (or the end time of the detection cycle T1), and the time corresponding to the P9 point can be the detection cycle The start time of T3 (or the end time of the detection cycle T2), and so on, the time corresponding to the point P13 can be the start time of the detection cycle Tm (or the end time of the detection cycle T(m-1)), and the point P17 The corresponding moment can be the starting moment of the detection period Tn (or the end moment of the detection period Tm), and the corresponding moment of P21 point can be the starting moment of the detection period T(n+1) (or the end of the detection period Tn time). In this embodiment of the present application, both the KA req message and the KA Ack message are transmitted through the first communication link as an example for illustration. See Figure 3:
第一网络设备在P1点对应的时刻,通过第一通信链路向第二网络设备发送KA req报文1,发送KA req报文1之后,包含KA req报文1在内,第一网络设备开始统计检测周期T1内第一网络设备通过第一通信链路发送的报文数量,直至P5点对应的时刻,第一网络设备停止统计,并将这段时间内统计到的通过第一通信链路发送的报文数量确定为第一网络设备在检测周期T1内通过第一通信链路发送的报文数量S1_SC[1]。其中,KA req报文1包括该KA req报文1的序列号seq=1和KA req报文1的发送时间戳S1_ST1(也即是P1点对应的时刻)。At the time corresponding to point P1, the first network device sends KA req
第二网络设备在P2点对应的时刻接收到KA req报文1,在接收到KA req报文1之后,包含KA req报文1在内,第二网络设备开始统计检测周期T1内第二网络设备通过第一通信链路接收的报文数量,直至P6点对应的时刻,第二网络设备停止统计,并将这段时间内统计到的通过第一通信链路接收的报文数量确定为第二网络设备在检测周期T1内通过第一通信链路接收的报文数量S2_RC[1]。在P2点对应的时刻,第二网络设备可以确定KA req报文1的接收时间戳S2_RT1(也即是P2点对应的时刻),由于KA req报文1包括KA req报文1的发送时间戳S1_ST1,因此,在P2点对应的时刻,第二网络设备根据KA req报文1的接收时间戳S2_RT1和KA req报文1的发送时间戳S1_ST1,确定第一通信链路的第一单向时延,该第一单向时延可以是△T11=S2_RT1-S1_ST1。The second network device receives KA req
第二网络设备在P3点对应的时刻,通过第一通信链路向第一网络设备发送KA Ack报文1,发送KA Ack报文1之后,包含KA Ack报文1在内,第二网络设备开始统计检测周期T1内第一网络设备通过第一通信链路发送的报文数量,直至P7点对应的时刻,第二网络设备停止统计,并将这段时间内统计到的通过第一通信链路发送的报文数量确定为第二网络设备在检测周期T1内通过第一通信链路发送的报文数量S2_SC[1]。其中,KA Ack报文1包括该KA Ack报文1的序列号seq=1、KA req报文1的发送时间戳S1_ST1(也即是P1点对应的时刻)、KA req报文1的接收时间戳S2_RT1和KA Ack报文1的发送时间戳S2_ST1(也即是P3点对应的时刻)。KA Ack报文1的发送可以是在接收到KA req报文1后立即执行的。At the time corresponding to point P3, the second network device sends
第一网络设备在P4点对应的时刻接收到KA Ack报文1,在接收到KA Ack报文1之后,包含KA Ack报文1在内,第一网络设备开始统计检测周期T1内第一网络设备通过第一通信链路接收的报文数量,直至P8点对应的时刻,第一网络设备停止统计,并将这段时间内统计到的通过第一通信链路接收的报文数量确定为第一网络设备在检测周期T1内通过第一通信链路接收的报文数量S1_RC[1]。在P4点对应的时刻,第一网络设备可以确定KA Ack报文1的接收时间戳S1_RT1,由于KA Ack报文1包括KA Ack报文1的发送时间戳S2_ST1,因此,在P4点对应的时刻,第一网络设备可以根据KA Ack报文1的接收时间戳S1_RT1和KA Ack报文1的发送时间戳S2_ST1,确定第一通信链路的第二单向时延,该第二单向时延可以是△T12=S1_RT1-S2_ST1。此外,由于KA Ack报文1包括KA req报文1的发送时间戳S1_ST1、KAreq报文1的接收时间戳S2_RT1和KA Ack报文1的发送时间戳S2_ST1,因此,在P4点对应的时刻,第一网络设备可以根据KA Ack报文1的接收时间戳S1_RT1、KA Ack报文1的发送时间戳S2_ST1、KA req报文1的接收时间戳S2_RT1和KA req报文1的发送时间戳S1_ST1,确定第一通信链路的双向时延,该双向时延可以是△T1=(S1_RT1-S2_ST1)+(S2_RT1-S1_ST1)。The first network device receives the
第一网络设备在P5点对应的时刻,通过第一通信链路向第二网络设备发送KA req报文2,发送KA req报文2之后,包含KA req报文2在内,第一网络设备开始统计检测周期T2内第一网络设备通过第一通信链路发送的报文数量,直至P9点对应的时刻,第一网络设备停止统计,并将这段时间内统计到的通过第一通信链路发送的报文数量确定为第一网络设备在检测周期T2内通过第一通信链路发送的报文数量S1_SC[2]。其中,KA req报文2包括该KA req报文2的序列号seq=2、KA req报文2的发送时间戳S1_ST2(也即是P5点对应的时刻)和第一网络设备在检测周期T1内通过第一通信链路发送的报文数量S1_SC[1],此时,由于还未到P6点、P7点和P8点对应的时刻,因此S2_RC[1]、S2_SC[1]和S1_RC[1]均为0。At the time corresponding to point P5, the first network device sends KA req
第二网络设备在P6点接收到KA req报文2,在接收到KA req报文2之后,第二网络设备可以得到S2_RC[1]。同时,在接收到KA req报文2后,包含KA req报文2在内,第二网络设备开始统计检测周期T2内第二网络设备通过第一通信链路接收的报文数量,直至P10点对应的时刻,第二网络设备停止统计,并将这段时间内统计到的通过第一通信链路接收的报文数量确定为第二网络设备在检测周期T2内通过第一通信链路接收的报文数量S2_RC[2]。The second network device receives the KA req
第二网络设备在P7点对应的时刻,通过第一通信链路向第一网络设备发送KA Ack报文2,发送KA Ack报文2之后,包含KA Ack报文2在内,第二网络设备开始统计检测周期T2内第一网络设备通过第一通信链路发送的报文数量,直至P11点对应的时刻,第二网络设备停止统计,并将这段时间内统计到的通过第一通信链路发送的报文数量确定为第二网络设备在检测周期T2内通过第一通信链路发送的报文数量S2_SC[2]。其中,在P7点对应的时刻,第二网络设备可以得到S2_SC[1],KA Ack报文2包括该KA Ack报文2的序列号seq=2、KAreq报文2的发送时间戳S1_ST2(也即是P5点对应的时刻)、KA req报文2的接收时间戳S2_RT2(也即是P6点对应的时刻)、KA req报文2的发送时间戳S2_ST2(也即是P7点对应的时刻)、第一网络设备在检测周期T1内通过第一通信链路发送的报文数量S1_SC[1]、第二网络设备在检测周期T1内通过第一通信链路接收的报文数量S2_RC[1],以及,第二网络设备在检测周期T1内通过第一通信链路发送的报文数量S2_SC[1]。KA Ack报文2的发送可以是在接收到KA req报文2后立即执行的。The second network device sends a
第一网络设备在P8点对应的时刻接收到KA Ack报文2,在接收到KA Ack报文2之后,包含KA Ack报文2在内,第一网络设备开始统计检测周期T2内第一网络设备通过第一通信链路接收的报文数量,直至P12点对应的时刻,第一网络设备停止统计,并将这段时间内统计到的通过第一通信链路接收的报文数量确定为第一网络设备在检测周期T1内通过第一通信链路接收的报文数量S1_RC[2]。其中,在P8点对应的时刻,第一网络设备可以确定第一网络设备在检测周期T1内通过第一通信链路接收的报文数量S1_RC[1],由于KA Ack报文2中包括第一网络设备在检测周期T1内通过第一通信链路发送的报文数量S1_SC[1]、第二网络设备在检测周期T1内通过第一通信链路接收的报文数量S2_RC[1],以及,第二网络设备在检测周期T1内通过第一通信链路发送的报文数量S2_SC[1],因此,在P8点对应的时刻,第一网络设备可以确定第一通信链路的丢包量,该丢包量可以为(S2_RC[1]~S1_SC[1])+(S1_RC[1]~S2_SC[1])。The first network device receives the
第一网络设备在P9点对应的时刻,通过第一通信链路向第二网络设备发送KA req报文3,发送KA req报文3之后,第一网络设备开始统计检测周期T3内第一网络设备通过第一通信链路发送的报文数量。KA req报文3可以包括第一网络设备在检测周期T1内通过第一通信链路接收的报文数量S1_RC[1],以便于第二网络设备计算第一通信链路的丢包量,或者,KA req报文3可以包括(S2_RC[1]~S1_SC[1])+(S1_RC[1]~S2_SC[1]),从而可以避免第二网络设备的计算过程。At the time corresponding to point P9, the first network device sends a KA req
后续过程可以参考上述描述类推,在此不再赘述。The subsequent process can be analogized with reference to the above description, and will not be repeated here.
下述为本申请的装置实施例,可以用于执行本申请的方法实施例。对于本申请装置实施例中未披露的细节,请参照本申请方法实施例。The following are device embodiments of the present application, which can be used to implement the method embodiments of the present application. For details not disclosed in the device embodiments of the present application, please refer to the method embodiments of the present application.
请参考图4,其示出了本申请实施例提供的一种通信链路检测装置400的逻辑结构示意图,该通信链路检测装置400可以为第一网络设备,或者是第一网络设备中的功能组件。参见图4,该通信链路检测装置400包括:发送模块410、接收模块420、第一确定模块430和第二确定模块440。发送模块410用于执行图2所示实施例中的步骤202和步骤210;接收模块420用于执行图2所示实施例中的步骤207;第一确定模块430用于执行图2所示实施例中的步骤201和步骤208;第二确定模块440用于执行图2所示实施例中的步骤209。Please refer to FIG. 4 , which shows a schematic diagram of a logical structure of a communication
本申请实施例中,第一确定模块430和第二确定模块440可以是相同的确定模块,也可以是不同的确定模块,并且第一确定模块430和第二确定模块440也可以是一个处理模块,该处理模块执行上述步骤中的确定等步骤,本申请实施例对此不做限定。In the embodiment of the present application, the
请参考图5,其示出了本申请实施例提供的另一种通信链路检测装置500的逻辑结构示意图,该通信链路检测装置500可以为第二网络设备,或者是第二网络设备中的功能组件。参见图5,该通信链路检测装置500包括:第一接收模块510、发送模块520、第二接收模块530、第一确定模块540和第二确定模块550。第一接收模块510用于执行图2所示实施例中的步骤203;发送模块520用于执行图2所示实施例中的步骤206;第二接收模块530用于执行图2所示实施例中的步骤211;第一确定模块540用于执行图2所示实施例中的步骤204和步骤205;第二确定模块550用于执行图2所示实施例中的步骤212。Please refer to FIG. 5 , which shows a schematic diagram of the logic structure of another communication
本申请实施例中,第一接收模块510和第二接收模块530可以是相同的接收模块,也可以是不同的接收模块,并且第一接收模块510、发送模块520和第二接收模块530也可以是一个收发模块,该收发模块执行上述步骤中的发送和接收等步骤;第一确定模块540和第二确定模块550可以是相同的确定模块,也可以是不同的确定模块,并且第一确定模块540和第二确定模块550也可以是一个处理模块,该处理模块执行上述步骤中的确定等步骤,本申请实施例对此不做限定。In this embodiment of the application, the
综上所述,本申请实施例提供的通信链路检测装置中,第一网络设备在第n个检测周期通过第一通信链路向第二网络设备发送第一链路检测请求报文,并通过第一通信链路接收第二网络设备发送的第一链路检测响应报文,第一链路检测响应报文包括第二网络设备在第n个检测周期之前的m个检测周期内通过第一通信链路接收的报文数量和发送的报文数量,且第一网络设备可以确定第一网络设备在该m个检测周期内通过第一通信链路发送的报文数量和接收的报文数量,之后第一网络设备可以根据第一网络设备在该m个检测周期内通过第一通信链路发送的报文数量和接收的报文数量,以及,第二网络设备在该m个检测周期内通过第一通信链路发送的报文数量和接收的报文数量,确定第一通信链路的丢包量,该丢包量用于表征第一通信链路的网络质量,因此本申请实施例提供的技术方案可以确定通信链路的网络质量。进一步地,由于链路检测请求报文为第一网络设备的自发报文,因此第一网络设备可以灵活设置检测周期,相比于IP FPM技术,本申请实施例提供的方案可以提高检测的灵活性、精度和灵敏度。To sum up, in the communication link detection device provided in the embodiment of the present application, the first network device sends the first link detection request message to the second network device through the first communication link in the nth detection cycle, and The first link detection response message sent by the second network device is received through the first communication link, and the first link detection response message includes that the second network device passes the first detection cycle in the m detection cycle before the nth detection cycle. The number of packets received and the number of packets sent by a communication link, and the first network device can determine the number of packets sent and received by the first network device through the first communication link within the m detection periods Afterwards, the first network device can send and receive packets according to the number of packets sent and received by the first network device through the first communication link within the m detection periods, and the number of packets received by the second network device during the m detection periods The packet loss amount of the first communication link is determined by the number of packets sent and received through the first communication link, and the packet loss amount is used to characterize the network quality of the first communication link. Therefore, the implementation of the present application The technical solution provided by the example can determine the network quality of the communication link. Further, since the link detection request message is a spontaneous message sent by the first network device, the first network device can flexibly set the detection period. Compared with the IP FPM technology, the solution provided by the embodiment of the present application can improve the flexibility of detection performance, precision and sensitivity.
上述实施例提供的通信链路检测装置在检测通信链路时,仅以上述各功能模块的划分举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将设备的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的通信链路检测装置与通信链路检测方法实施例属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。When the communication link detection device provided in the above-mentioned embodiment detects the communication link, it only uses the division of the above-mentioned functional modules as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional modules according to the needs. The internal structure is divided into different functional modules to complete all or part of the functions described above. In addition, the device for detecting a communication link provided in the above embodiment and the embodiment of the method for detecting a communication link belong to the same concept, and its specific implementation process is detailed in the method embodiment, and will not be repeated here.
请参考图6,其示出了本申请实施例提供的一种通信链路检测装置600的硬件结构示意图,该通信链路检测装置600可以为网络设备,该网络设备可以为上述实施例中的第一网络设备或第二网络设备。参见图6,该通信链路检测装置600包括处理器602、存储器604、通信接口606和总线608,处理器602、存储器604和通信接口606通过总线608彼此通信连接。本领域技术人员应当明白,图6所示的处理器602、存储器604和通信接口606之间的连接方式仅仅是示例性的,在实现过程中,处理器602、存储器604和通信接口606也可以采用除了总线608之外的其他连接方式彼此通信连接。Please refer to FIG. 6, which shows a schematic diagram of the hardware structure of a communication
其中,存储器604可以用于存储指令6042和数据6044。在本申请实施例中,存储器604可以是各种类型的存储介质,例如随机存取存储器(random access memory,RAM)、只读存储器(read-only memory,ROM)、非易失性RAM(non-volatile RAM,NVRAM)、可编程ROM(programmable ROM,PROM)、可擦除PROM(erasable PROM,EPROM)、电可擦除PROM(electrically erasable PROM,EEPROM)、闪存、光存储器和寄存器等。Wherein, the
其中,处理器602可以是通用处理器,通用处理器可以是通过读取并执行存储器(例如存储器604)中存储的指令(例如指令6042)来执行特定步骤和/或操作的处理器,通用处理器在执行上述步骤和/或操作的过程中可能用到存储在存储器(例如存储器604)中的数据(例如数据6044)。通用处理器可以是,例如但不限于,中央处理器(centralprocessing unit,CPU)。此外,处理器602也可以是专用处理器,专用处理器可以是专门设计的用于执行特定步骤和/或操作的处理器,该专用处理器可以是,例如但不限于,数字信号处理器(digital signal processor,DSP)、应用专用集成电路(application-specificintegrated circuit,ASIC)和现场可编程门阵列(field-programmable gate array,FPGA)等。此外,处理器602还可以是多个处理器的组合,例如多核处理器。处理器602可以包括至少一个电路,以执行上述实施例提供的通信链路检测方法的全部或部分步骤。Wherein, the processor 602 may be a general-purpose processor, and the general-purpose processor may be a processor that performs specific steps and/or operations by reading and executing instructions (such as instructions 6042) stored in a memory (such as the memory 604). The processor may use data (eg, data 6044 ) stored in a memory (eg, memory 604 ) during the process of performing the above steps and/or operations. A general processor may be, for example but not limited to, a central processing unit (central processing unit, CPU). In addition, the processor 602 may also be a special-purpose processor, which may be a processor specially designed to perform specific steps and/or operations, such as but not limited to, a digital signal processor ( digital signal processor (DSP), application-specific integrated circuit (application-specific integrated circuit, ASIC) and field-programmable gate array (field-programmable gate array, FPGA), etc. In addition, the processor 602 may also be a combination of multiple processors, such as a multi-core processor. The processor 602 may include at least one circuit to execute all or part of the steps of the method for detecting a communication link provided in the foregoing embodiments.
其中,通信接口606可以包括输入/输出(input/output,I/O)接口、物理接口和逻辑接口等用于实现通信链路检测装置600内部的器件互连的接口,以及用于实现通信链路检测装置600与其他设备(例如网络设备或主机)互连的接口。物理接口可以是千兆的以太接口(gigabit Ethernet,GE),其可以用于实现通信链路检测装置600与其他设备(例如网络设备或主机)互连,逻辑接口是通信链路检测装置600内部的接口,其可以用于实现通信链路检测装置600内部的器件互连。容易理解,通信接口606可以用于通信链路检测装置600与其他网络设备和/或主机通信,例如,通信接口606用于通信链路检测装置600与其他网络设备之间报文的发送和接收。Among them, the
其中,总线608可以是任何类型的,用于实现处理器602、存储器604和通信接口606互连的通信总线。Wherein, the
上述器件可以分别设置在彼此独立的芯片上,也可以至少部分的或者全部的设置在同一块芯片上。将各个器件独立设置在不同的芯片上,还是整合设置在一个或者多个芯片上,往往取决于产品设计的需要。本申请实施例对上述器件的具体实现形式不做限定。The above-mentioned devices may be respectively arranged on independent chips, or at least partly or all of them may be arranged on the same chip. Whether each device is independently arranged on different chips or integrated and arranged on one or more chips often depends on the needs of product design. The embodiments of the present application do not limit the specific implementation forms of the foregoing devices.
图6所示的通信链路检测装置600仅仅是示例性的,在实现过程中,通信链路检测装置600还可以包括其他组件,本文不再一一列举。其中,图6所示的通信链路检测装置600可以通过执行上述实施例提供的通信链路检测方法的全部或部分步骤,确定通信链路的网络质量。The
本申请实施例提供了一种通信链路检测系统,该通信链路检测系统包括第一网络设备和第二网络设备。在一种可能的实现方式中,第一网络设备包括图4所示的通信链路检测装置400,第二网络设备包括图5所示的通信链路检测装置500;在另一种可能的实现方式中,第一网络设备和第二网络设备中的至少一者可以为图6所示的通信链路检测装置600。An embodiment of the present application provides a communication link detection system, where the communication link detection system includes a first network device and a second network device. In a possible implementation, the first network device includes the communication
本申请实施例提供了一种计算机可读存储介质,该计算机可读存储介质中存储有指令,当该指令在计算机的处理组件上运行时,使得处理组件执行图2所示实施例提供的通信链路方法的全部或部分步骤。An embodiment of the present application provides a computer-readable storage medium, and instructions are stored in the computer-readable storage medium, and when the instruction is run on a processing component of a computer, the processing component performs the communication provided by the embodiment shown in FIG. 2 All or part of the steps of the link method.
本申请实施例提供了一种包含指令的计算机程序产品,当该计算机程序产品在计算机上运行时,使得计算机执行图2所示实施例提供的通信链路方法的全部或部分步骤。An embodiment of the present application provides a computer program product containing instructions, and when the computer program product is run on a computer, the computer is made to execute all or part of the steps of the communication link method provided by the embodiment shown in FIG. 2 .
本申请实施例提供了一种芯片,该芯片包括可编程逻辑电路和/或程序指令,当该芯片运行时用于实现图2所示实施例提供的通信链路方法的全部或部分步骤。An embodiment of the present application provides a chip, which includes a programmable logic circuit and/or program instructions, and is used to implement all or part of the steps of the communication link method provided by the embodiment shown in FIG. 2 when the chip is running.
应理解,本文中术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中字符“/”,一般表示前后关联对象是一种“或”的关系。It should be understood that the term "and/or" in this article is only an association relationship describing associated objects, which means that there may be three relationships, for example, A and/or B may mean: A exists alone, and A and B exist at the same time , there are three cases of B alone. In addition, the character "/" in this article generally indicates that the contextual objects are an "or" relationship.
应理解,在本申请的各种实施例中,上述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It should be understood that, in various embodiments of the present application, the sequence numbers of the above-mentioned processes do not mean the order of execution, and the execution order of the processes should be determined by their functions and internal logic, and should not be used in the embodiments of the present application. The implementation process constitutes any limitation.
应理解,本文中的“第一”“第二”等词汇,仅用于区分描述的目的,而不能理解为指示或暗示相对重要性,也不能理解为指示或暗示顺序。It should be understood that words such as "first" and "second" herein are only used for the purpose of distinguishing and describing, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying order.
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。The serial numbers of the above embodiments of the present application are for description only, and do not represent the advantages and disadvantages of the embodiments.
以上所述仅为本申请的可选实施例,并不用以限制本申请,凡在本申请的原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。The above descriptions are only optional embodiments of the application, and are not intended to limit the application. Any modifications, equivalent replacements, improvements, etc. made within the principles of the application shall be included in the protection scope of the application. Inside.
Claims (14)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910234008.7A CN111756588B (en) | 2019-03-26 | 2019-03-26 | Communication link detection method and related device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910234008.7A CN111756588B (en) | 2019-03-26 | 2019-03-26 | Communication link detection method and related device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111756588A CN111756588A (en) | 2020-10-09 |
CN111756588B true CN111756588B (en) | 2023-01-06 |
Family
ID=72671378
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910234008.7A Active CN111756588B (en) | 2019-03-26 | 2019-03-26 | Communication link detection method and related device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111756588B (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114928561B (en) * | 2021-02-03 | 2024-10-29 | 华为技术有限公司 | Packet loss rate detection method, communication device and communication system |
CN115701048A (en) * | 2021-07-30 | 2023-02-07 | 上海擎感智能科技有限公司 | Data channel exception processing method, system, device and medium |
CN114285782B (en) * | 2021-12-22 | 2024-10-15 | 深圳电器公司 | Data processing method and related device |
CN116321276B (en) * | 2023-05-19 | 2023-10-31 | 阿里巴巴(中国)有限公司 | Time delay determining method, communication network, device and storage medium |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102724086A (en) * | 2012-06-21 | 2012-10-10 | 中兴通讯股份有限公司 | Method and device for detecting quality of transmission link |
WO2017032133A1 (en) * | 2015-08-26 | 2017-03-02 | 中兴通讯股份有限公司 | Packet loss rate detection method and apparatus |
CN106817264A (en) * | 2015-11-27 | 2017-06-09 | 华为软件技术有限公司 | A kind of methods, devices and systems of link failure detection |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101729197B (en) * | 2008-10-14 | 2014-04-16 | 华为技术有限公司 | Method, device and system for detecting packet loss rate |
CN102035692B (en) * | 2009-09-30 | 2013-04-03 | 中兴通讯股份有限公司 | Method and device for detecting quality of link |
CN102064981A (en) * | 2010-12-29 | 2011-05-18 | 中兴通讯股份有限公司 | Bidirectional forwarding detection (BFD) method and system |
CN102158371A (en) * | 2011-04-12 | 2011-08-17 | 杭州华三通信技术有限公司 | Link performance detection method and device based on BFD (Bidirectional Forwarding Detection) |
CN106571970B (en) * | 2015-10-08 | 2019-07-26 | 中兴通讯股份有限公司 | The monitoring method and device of bearer network |
CN106789709B (en) * | 2016-12-21 | 2020-03-03 | 迈普通信技术股份有限公司 | Load balancing method and device |
-
2019
- 2019-03-26 CN CN201910234008.7A patent/CN111756588B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102724086A (en) * | 2012-06-21 | 2012-10-10 | 中兴通讯股份有限公司 | Method and device for detecting quality of transmission link |
WO2017032133A1 (en) * | 2015-08-26 | 2017-03-02 | 中兴通讯股份有限公司 | Packet loss rate detection method and apparatus |
CN106817264A (en) * | 2015-11-27 | 2017-06-09 | 华为软件技术有限公司 | A kind of methods, devices and systems of link failure detection |
Also Published As
Publication number | Publication date |
---|---|
CN111756588A (en) | 2020-10-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111756588B (en) | Communication link detection method and related device | |
CN116208524B (en) | Method, equipment and system for detecting data message | |
US4292623A (en) | Port logic for a communication bus system | |
US10833995B2 (en) | Method and apparatus for datacenter congestion control based on software defined network | |
CN102984059B (en) | Gigabit Ethernet redundancy network interface card and link switching condition criterion output control method thereof | |
CN105634840B (en) | Method and device for measuring packet loss | |
CN103236893A (en) | Network message synchronizing method for process levels of intelligent substation | |
KR102091565B1 (en) | Data transmission with protocol exception state | |
CN105656708A (en) | Single-board testing method and device | |
CN114338465A (en) | Network anomaly determination method and device | |
CN101013928A (en) | Apparatus and method for implementing line fault detection of pseudo-wire simulation | |
CN116781573A (en) | Fault detection method, device, equipment, system and computer-readable storage medium | |
CN107623607B (en) | BFD session connection establishment method and device | |
CN110545198A (en) | ERPS loop breaking method and master node | |
CN101194479B (en) | Electronic device, method for frame synchronization and mobile device | |
CN113691459A (en) | Data transmission method and device based on identification message | |
US9887927B2 (en) | End-to-end credit recovery | |
US9910822B2 (en) | Network interface for a SoC comprising an improved communication controller | |
JPH02189046A (en) | Transfer delay time counting method in packet exchange network | |
CN109150646B (en) | Link state detection system, method and apparatus | |
JPWO2017199913A1 (en) | Transmission apparatus, method and program | |
US11996932B2 (en) | Active-active TDM PW with asymmetry control | |
CN117640511B (en) | Wired communication system, communication chip, communication method and medium thereof | |
WO2024174783A1 (en) | Bandwidth measurement method, apparatus, and system | |
CN102201911B (en) | Method and system for synchronously transmitting data |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |