Network latency computation method, apparatus, network node, and storage medium
Patent Information
- Application Number
- CN202311146109.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-05
- Publication Date
- 2026-08-21
- Estimated Expiration
- 2043-09-05
AI Technical Summary
[0007]有鉴于此,本申请的目的在于提供一种网络时延计算方法、装置、网络节点和存储介质,以解决入口节点为分布式系统时存在的网络时延不准确、增大处理开销从而影响转发性能以及存在一定解析难度的问题
[0040]本申请实施例提供的网络时延计算方法、装置、网络节点和存储介质,业务报文处理网络中的每个网络节点都包括有至少一个转发部件,且每个转发部件对应一个区分标识符,则网络节点可以在获取到时延测量报文后,记录该时延测量报文对应的接收时间戳与区分标识符之间的接收对应关系,以及发送时间戳与区分标识符之间的转发对应关系,从而将接收时间戳和发送时间戳通过区分标识符与时延测量报文对应起来,因此,即使业务报文处理网络在一个测量周期内包括多个时延测量报文,也可以将各个时延测量报文和时间戳进行对应,从而直接根据各个时延测量报文对应的时间戳信息计算网络时延,从而使网络时延更加精确;同时,由于区分标识符在时延测量报文的报文头中,因此在将时延测量报文与时间戳对应时,也无需解析报文的内部载荷,仅需要解析报文头即可,因此可减小处理开销和解析难度,提高转发性能。
Smart Images

Figure CN117061391B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of network latency calculation, and more specifically, to a network latency calculation method, apparatus, network node, and storage medium. Background Technology
[0002] Currently, the latency information of a network is generally calculated using the In-situ Flow Information Telemetry (IFIT) technology. This is achieved by inserting IFIT packet fragments into service packets and measuring the forwarding path that the service traffic follows, thereby obtaining the latency information of the network.
[0003] In existing technologies, an entry node in a network can select a service message in each measurement period, and then record the timestamp of the service message through various nodes, and summarize the multiple timestamps to calculate the network latency.
[0004] To ensure more accurate timestamps, minimize measurement errors caused by internal device processing, and reduce the impact on service packet forwarding performance, existing technologies typically place service packet selection in the forwarding plane, for example, through forwarding components. However, for ingress nodes with multiple forwarding components, since each component processes independently, the ingress node may select multiple service packets to record timestamps within the same measurement period. In this case, it becomes impossible to determine the correspondence between the multiple timestamps ultimately obtained in the network and the individual service packets. Therefore, network latency is usually calculated by averaging all timestamps.
[0005] However, if there is loss of business packets during packet forwarding, and the difference between timestamps is relatively large, the method of calculating average latency will lead to inaccurate network latency.
[0006] Furthermore, since the outer headers of the service messages are consistent, it is necessary to parse the internal payload of the service messages in order to map each service message to a timestamp. This will increase the processing overhead, affect the forwarding performance, and also present a certain degree of parsing difficulty. Summary of the Invention
[0007] In view of this, the purpose of this application is to provide a network latency calculation method, apparatus, network node and storage medium to solve the problems of inaccurate network latency, increased processing overhead affecting forwarding performance and certain parsing difficulties when the entry node is a distributed system.
[0008] To achieve the above objectives, the technical solutions adopted in the embodiments of this application are as follows:
[0009] In a first aspect, this application provides a network latency calculation method, applied to any network node in a service message processing network, wherein the network node includes at least one forwarding component, each forwarding component corresponds to a distinguishing identifier, and the network node is communicatively connected to an analysis device, the method comprising:
[0010] Receive multiple service messages and obtain a delay measurement message from the received multiple service messages;
[0011] The header of the delay measurement message includes a distinguishing identifier corresponding to the ingress forwarding component. The ingress forwarding component is the forwarding component in the ingress network node that receives the delay measurement message. The ingress network node is the network node in the service message processing network that receives service messages sent by other networks.
[0012] Record the reception correspondence between the received timestamp of the delay measurement message and the distinguishing identifier;
[0013] The latency measurement message is sent to the corresponding next network node, and the forwarding correspondence between the sending timestamp of the latency measurement message and the distinguishing identifier is recorded;
[0014] The receiving correspondence and the forwarding correspondence are sent to the analysis device so that the analysis device can calculate the network latency of the service packet processing network based on the receiving correspondence and the forwarding correspondence.
[0015] In an optional implementation, receiving multiple service messages and obtaining a latency measurement message from the received multiple service messages includes:
[0016] If the multiple received service messages are service messages sent by other networks, then the first received service message among the multiple service messages received in the current measurement period is determined as the target service message;
[0017] Add the distinguishing identifier and coloring identifier corresponding to the ingress forwarding component to the header of the target service message to obtain the delay measurement message;
[0018] If the received multiple service messages are service messages sent by network nodes in the service message processing network, then the delay measurement message is determined from the multiple service messages according to the coloring identifier.
[0019] In an optional implementation, the header of the target service packet includes a flow-following detection (IFIT) header. Adding the distinguishing identifier and coloring identifier corresponding to the ingress forwarding component to the header of the target service packet to obtain the latency measurement packet includes:
[0020] Add the distinguishing identifier and coloring identifier corresponding to the ingress forwarding component to the IFIT header of the target service message.
[0021] In an optional implementation, the method further includes:
[0022] Determine whether the network node meets the conditions for receiving and sending records based on the current latency measurement mode;
[0023] The recording of the reception correspondence between the received timestamp of the delay measurement message and the distinguishing identifier includes:
[0024] When the network node meets the reception recording conditions, the reception correspondence between the reception timestamp of the delay measurement message and the distinguishing identifier is recorded;
[0025] The recording of the forwarding correspondence between the sending timestamp of the delay measurement message and the distinguishing identifier includes:
[0026] When the network node meets the sending record conditions, it records the forwarding correspondence between the sending timestamp of the delay measurement message and the distinguishing identifier.
[0027] In an optional implementation, determining whether the network node meets the receive record condition and the send record condition based on the current latency measurement mode includes:
[0028] If the current latency measurement mode is an end-to-end measurement mode, then if the received multiple service packets are service packets sent by other networks, it is determined that the network node meets the reception record conditions.
[0029] If the next network node is a network node in another network, it is determined that the network node satisfies the sending record condition;
[0030] If the current latency measurement mode is hop-by-hop measurement mode, then the network node is determined to meet the receive record condition and the send record condition.
[0031] In an optional implementation, the distinguishing identifier is determined based on the local index of the ingress forwarding component, or based on the stack member to which the ingress forwarding component belongs and the slot it is located, or based on the index of the message receiving interface corresponding to the ingress forwarding component.
[0032] Secondly, this application provides a network latency calculation device, applied to any network node in a service message processing network, wherein the network node includes at least one forwarding component, each forwarding component corresponds to a distinguishing identifier, the network node is communicatively connected to an analysis device, and the device includes:
[0033] A receiving module is used to receive multiple service messages and obtain a latency measurement message from the received multiple service messages; the header of the latency measurement message includes a distinguishing identifier corresponding to the ingress forwarding component, the ingress forwarding component is the forwarding component in the ingress network node that receives the latency measurement message, and the ingress network node is the network node in the service message processing network that receives service messages sent by other networks;
[0034] The recording module is used to record the receiving correspondence between the receiving timestamp corresponding to the delay measurement message and the distinguishing identifier;
[0035] The sending module is used to send the latency measurement message to the corresponding next network node and record the forwarding correspondence between the sending timestamp of the latency measurement message and the distinguishing identifier;
[0036] The sending module is further configured to send the receiving correspondence and the forwarding correspondence to the analysis device, so that the analysis device can calculate the network latency of the service message processing network based on the receiving correspondence and the forwarding correspondence.
[0037] In an optional implementation, the receiving module is further configured to: if the received multiple service packets are service packets sent by other networks, then, upon entering the current measurement period, determine the first received service packet among the multiple service packets as the target service packet; add a distinguishing identifier and a coloring identifier corresponding to the ingress forwarding component to the header of the target service packet to obtain the delay measurement packet; if the received multiple service packets are service packets sent by network nodes in the service packet processing network, then determine the delay measurement packet from the multiple service packets according to the coloring identifier.
[0038] Thirdly, this application provides a network node including a processor and a memory, wherein the memory stores a computer program executable by the processor, and the processor can execute the computer program to implement the method described in any of the foregoing embodiments.
[0039] Fourthly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in any of the foregoing embodiments.
[0040] The network latency calculation method, apparatus, network node, and storage medium provided in this application embodiment include at least one forwarding component in each network node of the service packet processing network, and each forwarding component corresponds to a distinguishing identifier. After acquiring a latency measurement packet, the network node can record the receiving correspondence between the receiving timestamp and the distinguishing identifier, as well as the forwarding correspondence between the sending timestamp and the distinguishing identifier. This allows the receiving timestamp and sending timestamp to be mapped to the latency measurement packet through the distinguishing identifier. Therefore, even if the service packet processing network includes multiple latency measurement packets within a measurement period, each latency measurement packet can be mapped to a timestamp, allowing the network latency to be calculated directly based on the timestamp information corresponding to each latency measurement packet, thus making the network latency more accurate. Furthermore, since the distinguishing identifier is in the packet header of the latency measurement packet, it is not necessary to parse the internal payload of the packet when mapping the latency measurement packet to the timestamp; only the packet header needs to be parsed. This reduces processing overhead and parsing difficulty, improving forwarding performance.
[0041] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0042] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0043] Figure 1 A block diagram of a service message processing network is shown.
[0044] Figure 2 A block diagram of a network node provided in an embodiment of this application is shown;
[0045] Figure 3 This paper illustrates a flowchart of a network latency calculation method provided in an embodiment of this application.
[0046] Figure 4 An example diagram showing the correspondence between receivers is provided.
[0047] Figure 5 A schematic diagram of the message header of a business message is shown;
[0048] Figure 6 A functional block diagram of a network latency calculation device provided in an embodiment of this application is shown.
[0049] Icons: 10-Business message processing network; 100-Network node; 110-Analysis device; 101-Memory; 102-Processor; 103-Communication module; 200-Receiving module; 210-Recording module; 220-Sending module. Detailed Implementation
[0050] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can be arranged and designed in various different configurations.
[0051] Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0052] It should be noted that relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes the element.
[0053] Figure 1 Please refer to the block diagram of a service message processing network 10. Figure 1 The service message processing network 10 includes multiple network nodes 100, and each network node 100 is communicatively connected to the analysis device 110.
[0054] Optionally, network node 100 can be a single device, such as a centralized device or a distributed device, or it can be a stacked system composed of several single devices.
[0055] Optionally, the network node 100 can send the collected information to the analysis device 110, and the analysis device 110 can perform network performance analysis on the service packet processing network 10 based on the information sent by each network node, such as calculating network latency and calculating the actual packet loss rate of the network.
[0056] Optionally, each network node includes at least one forwarding component; that is, a network node 100 may include only one forwarding component or it may include multiple forwarding components. For example, if the network node is a centralized device, it includes only one forwarding component; if the network node is a distributed device and the distributed device has only one LPU (Line Processing Unit), then the network node also includes only one forwarding component; while if the network node is a distributed device and the distributed device has multiple LPUs, or the network node is a stacked system, then it includes multiple forwarding components.
[0057] Understandably, if a network node is a stacked system, then the number of forwarding components it includes is the sum of the number of forwarding components included in each individual device that makes up the stacked system.
[0058] Optionally, each forwarding component in a network node has a corresponding distinguishing identifier.
[0059] Optionally, the forwarding component can be used to receive service packets sent by other network nodes, or it can be used to send service packets to other network nodes. In one possible implementation, within a network node, the forwarding component for receiving service packets sent by other network nodes and the forwarding component for sending service packets to other network nodes can be the same forwarding component or different forwarding components.
[0060] Optionally, the analysis device 110 can receive information sent by each network node and perform network performance analysis on the service packet processing network 10 based on the information, such as calculating network latency and calculating the actual packet loss rate of the network.
[0061] Please refer to Figure 2 This is a block diagram of a network node 100 provided in an embodiment of this application. The network node 100 includes a memory 101, a processor 102, and a communication module 103. The memory 101, processor 102, and communication module 103 are electrically connected to each other directly or indirectly to realize data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines.
[0062] The memory 101 is used to store programs or data. The memory 101 may be, but is not limited to, random access memory (RAM), read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), etc.
[0063] The processor 102 is used to read / write data or programs stored in memory and to perform corresponding functions.
[0064] The communication module 103 is used to establish a communication connection between the network node 100 and other communication terminals through the network, and to send and receive data through the network.
[0065] It should be understood that, Figure 2 The structure shown is only a schematic diagram of network node 100. Network node 100 may also include more than Figure 2 The more or fewer components shown, or having the same Figure 2 The different configurations shown. Figure 2 The components shown can be implemented using hardware, software, or a combination thereof.
[0066] The following section uses any network node in the aforementioned business message processing network as the execution subject, and provides an exemplary description of the network latency calculation method provided in this application embodiment in conjunction with the flowchart.
[0067] Specifically, Figure 3 Please refer to the flowchart of a network latency calculation method provided in this application embodiment. Figure 3 The method includes:
[0068] Step S20: Receive multiple service messages and obtain a delay measurement message from the received multiple service messages.
[0069] The delay measurement message header includes a distinguishing identifier corresponding to the ingress forwarding component. The ingress forwarding component is the forwarding component in the ingress network node that receives the delay measurement message. The ingress network node is the network node in the service message processing network that receives service messages sent by other networks.
[0070] Optionally, if the service message processing network can communicate with other networks, then the network node in the service message processing network that receives service messages sent by other networks is the ingress network node, and the forwarding component in the ingress network node that receives the delay measurement message is the ingress forwarding component.
[0071] Optionally, if the ingress network node includes multiple forwarding components, there may be multiple ingress forwarding components, and the corresponding delay measurement messages may also be multiple.
[0072] Step S21: Record the reception correspondence between the reception timestamp and the distinguishing identifier corresponding to the delay measurement message.
[0073] Optionally, network nodes can obtain the corresponding distinguishing identifier by parsing the header of the latency measurement message.
[0074] Optionally, the receiving timestamp refers to the time when the forwarding component of the receiving delay measurement message in the network node receives the delay measurement message.
[0075] Optionally, network nodes can record this receiving correspondence in the form of a table.
[0076] Optionally, in order to record the current measurement status more accurately, the receiving correspondence may include not only the correspondence between the receiving timestamp and the distinguishing identifier, but also node information, flow ID, period ID, and the forwarding direction of the message.
[0077] Optionally, the node information refers to information about the network node, such as whether the network node is an ingress network node or a transit network node.
[0078] Optionally, the forwarding direction includes a receiving direction and a sending direction, wherein the receiving direction refers to the network node receiving the delay measurement message at this time, and the sending direction refers to the network node sending the delay measurement message at this time.
[0079] It is understandable that the forwarding direction included in the receiving correspondence is the receiving direction.
[0080] In one possible implementation, the receiving direction can be represented as RX, and the transmitting direction can be represented as TX.
[0081] In one example, if there are two delay measurement messages, with corresponding distinguishing identifiers of 1 and 2, a flow ID of 100, a period ID of 50, and the direction is the receive direction RX, then the receive correspondence can be represented as follows: Figure 4 The example diagram is shown.
[0082] Step S22: Send the latency measurement message to the corresponding next network node and record the forwarding correspondence between the sending timestamp and the distinguishing identifier of the latency measurement message.
[0083] Optionally, the sending timestamp refers to the time when the forwarding component in the network node that sends the delay measurement message sends the delay measurement message.
[0084] In this embodiment, the network node also needs to determine which network node should send the delay measurement message to. In one possible implementation, the network node can determine the forwarding path based on the SRv6 mechanism.
[0085] Understandably, the SRv6 (Segment Routing IPv6) mechanism is a source path selection mechanism. The ingress network node can insert a routing extension header SRH (Segment Routing Header) into the IPv6 packet, and push an explicit IPv6 address stack onto the SRH. This address stack stores the IPv6 segment list information, so other forwarding nodes can continuously update the destination address and offset address stack to complete hop-by-hop forwarding.
[0086] Optionally, when a network node sends a latency measurement message to the next network node, it can record the forwarding correspondence between the sending timestamp and the distinguishing identifier corresponding to the latency measurement message.
[0087] Optionally, in order to record the current measurement status more accurately, the forwarding correspondence may include not only the correspondence between the sending timestamp and the distinguishing identifier, but also node information, flow ID, period ID, and the forwarding direction of the packet.
[0088] It is understandable that the forwarding direction included in the forwarding correspondence is the sending direction.
[0089] Step S23: Send the receiving correspondence and forwarding correspondence to the analysis device so that the analysis device can calculate the network latency of the service packet processing network based on the receiving correspondence and forwarding correspondence.
[0090] In one possible implementation, after recording the received or forwarded correspondence, the network node can directly send the received or forwarded correspondence to the analysis device.
[0091] In another possible implementation, the network node can send the received correspondence and forwarded correspondence to the analysis device after the current measurement period has ended.
[0092] Optionally, the analysis device can receive the receive and forwarding correspondences sent by each network node, and then determine the timestamps of the latency measurement packets based on these correspondences. Therefore, even if multiple latency measurement packets exist, the receive and forwarding timestamps corresponding to each latency measurement packet can be accurately determined. Furthermore, based on this, even if lost latency measurement packets exist in the service packet processing network, the lost latency measurement packets can be accurately located.
[0093] Understandably, analysis equipment can calculate network latency based on the timestamps corresponding to each latency measurement message, thereby improving the accuracy of network latency calculation.
[0094] Meanwhile, since the distinguishing identifier is added to the header of the latency measurement message, network nodes only need to parse the header when mapping the latency measurement message to the timestamp, without having to parse the internal payload of the message. This reduces the processing overhead and parsing difficulty for network nodes and improves their forwarding performance.
[0095] Optionally, the analysis device can first calculate a network latency based on each latency measurement message, and then calculate the network latency of the service message processing network by taking the average, maximum or minimum value of each network latency.
[0096] The network latency calculation method provided in this application embodiment includes at least one forwarding component in each network node of the service packet processing network, and each forwarding component corresponds to a distinguishing identifier. After obtaining a latency measurement packet, the network node can record the receiving correspondence between the receiving timestamp and the distinguishing identifier, as well as the forwarding correspondence between the sending timestamp and the distinguishing identifier. This allows the receiving timestamp and sending timestamp to be mapped to the latency measurement packet through the distinguishing identifier. Therefore, even if the service packet processing network includes multiple latency measurement packets within a measurement period, each latency measurement packet can be mapped to a timestamp, and the network latency can be calculated directly based on the timestamp information corresponding to each latency measurement packet, thus making the network latency more accurate. At the same time, since the distinguishing identifier is in the packet header of the latency measurement packet, it is not necessary to parse the internal payload of the packet when mapping the latency measurement packet to the timestamp; only the packet header needs to be parsed. This reduces processing overhead and parsing difficulty, and improves forwarding performance.
[0097] Optionally, the network node may be a regular relay network node or an entry network node. Understandably, if the network node is an entry node, it needs to select one message from the multiple received service messages to generate a latency measurement message, while if the network node is a regular relay node, it needs to find the latency measurement message from the multiple service messages.
[0098] In one possible implementation, if the multiple received service packets are service packets sent by other networks, the first received service packet among the multiple service packets received in the current measurement period can be identified as the target service packet, and the distinguishing identifier and coloring identifier corresponding to the ingress forwarding component can be added to the header of the target service packet to obtain the delay measurement packet.
[0099] Optionally, the coloring identifier can be used to identify delay measurement messages.
[0100] Understandably, if multiple received service messages are service messages sent by other networks, then that network node is an ingress network node.
[0101] Optionally, when applying IFIT (In-situ Flow Information Telemetry) technology in an SRv6 network, it is often necessary to add an IFIT header to the SRH header. See [link to relevant documentation]. Figure 5 If the IFIT header contains a coloring bit D, the network node can add a coloring identifier to the target service message by setting the coloring bit D in the IFIT header of the target service message to 1.
[0102] In addition, the IFIT header also has a reserved field, which network nodes can use to set a distinguishing identifier.
[0103] Understandably, the ingress forwarding component can obtain the latency measurement message by adding the distinguishing identifier and coloring identifier corresponding to the ingress forwarding component to the IFIT header of the target service message.
[0104] In another possible implementation, if the received multiple service messages are service messages sent by network nodes in the service message processing network, then the delay measurement message is determined from the multiple service messages based on the coloring identifier.
[0105] Understandably, if multiple received service messages are service messages sent by other network nodes in the service message processing network, then that network node is a relay network node.
[0106] In this embodiment, after receiving service packets sent by other network nodes in the service packet processing network, the network node can parse the header of each service packet, thereby identifying the service packets with coloring identifiers in the header as delay measurement packets and obtaining the corresponding distinguishing identifier.
[0107] Optionally, considering that the data required to calculate network latency may differ under different latency measurement modes, network nodes can determine whether to record the receive correspondence and the forwarding correspondence based on the current latency measurement mode.
[0108] Optionally, a network node can determine whether it meets the reception recording condition and the transmission recording condition based on the current latency measurement mode. If the network node meets the reception recording condition, it records the reception correspondence between the reception timestamp and the distinguishing identifier corresponding to the latency measurement message. If the network node meets the transmission recording condition, it records the forwarding correspondence between the transmission timestamp and the distinguishing identifier corresponding to the latency measurement message.
[0109] Optionally, the delay measurement mode may include an end-to-end measurement mode and a hop-by-hop measurement mode.
[0110] Optionally, in end-to-end measurement mode, the analysis device can calculate the network latency of the service packet processing network based on the receive timestamp of the service packet processing network's receive latency measurement packet and the send timestamp of the latency measurement packet. That is, if the measurement mode is end-to-end measurement mode, the analysis device can obtain the receive correspondence sent by the ingress network node and the forwarding correspondence sent by the egress network node.
[0111] Understandably, the egress network node refers to the network node in the business message processing network that sends business messages to other networks.
[0112] Optionally, in hop-by-hop measurement mode, the analysis device can calculate the network latency of the service packet processing network based on the receive timestamp and send timestamp of each network node. That is, if the measurement mode is hop-by-hop measurement mode, the analysis device can obtain the receive correspondence and forwarding correspondence of each network node.
[0113] Optionally, in end-to-end measurement mode, the ingress network node in the service message processing network can be controlled to record the receiving correspondence, the egress network node can be controlled to record the forwarding correspondence, and other network nodes can not record the correspondence.
[0114] Specifically, if the current latency measurement mode is end-to-end measurement mode, the network node can determine that it meets the reception record condition if multiple received service packets are service packets sent by other networks, and determine that it meets the transmission record condition if the next corresponding network node is a network node in another network.
[0115] Optionally, in hop-by-hop measurement mode, each network node in the service message processing network can be controlled to record the receiving correspondence and the forwarding correspondence.
[0116] Specifically, if the current delay measurement mode is hop-by-hop measurement mode, the network node can directly determine that it meets the conditions for receiving and sending records.
[0117] In this embodiment, if the current measurement mode is hop-by-hop measurement mode, the analysis device can obtain the receive correspondence and forwarding correspondence generated by each network node. Based on this, the analysis device can calculate the latency between any two packet processing nodes and the latency within any packet processing node based on the obtained receive correspondence and forwarding correspondence.
[0118] Optionally, the distinguishing identifier corresponding to each ingress forwarding component needs to be set in advance. In one possible implementation, the distinguishing identifier can be determined based on the local index of the ingress forwarding component, for example, set to the local index, where the local index can be an index pre-allocated by the distributed system where the ingress forwarding component is located.
[0119] In another possible implementation, the distinguishing identifier can be determined based on the stack member to which the ingress forwarding component belongs and the slot it is located in, for example, set as stack member ID + slot ID.
[0120] In one example, the distinguishing identifier can be 8 bits, with the stack member ID occupying 4 bits and the slot ID occupying 4 bits. For example, if the stack member ID corresponding to the forwarding component is 2 and the slot ID is 3, then its corresponding distinguishing identifier is 35 (binary 00100011, hexadecimal 0x23).
[0121] In another possible implementation, the distinguishing identifier can also be determined based on the index of the message receiving interface corresponding to the ingress forwarding component, for example, by setting the distinguishing identifier to the index of the message receiving interface corresponding to the ingress forwarding component.
[0122] To perform the corresponding steps in the above embodiments and various possible methods, an implementation of a network latency calculation device is given below. Further, please refer to... Figure 6 , Figure 6This is a functional block diagram of a network latency calculation device provided in an embodiment of this application. It should be noted that the basic principle and technical effects of the network latency calculation device provided in this embodiment are the same as those in the above embodiments. For the sake of brevity, any parts not mentioned in this embodiment can be referred to the corresponding content in the above embodiments. The network latency calculation device includes: a receiving module 200, a recording module 210, and a sending module 220.
[0123] The receiving module 200 is used to receive multiple service messages and obtain a delay measurement message from the received multiple service messages. The header of the delay measurement message includes a distinguishing identifier corresponding to the ingress forwarding component. The ingress forwarding component is the forwarding component in the ingress network node that receives the delay measurement message. The ingress network node is the network node in the service message processing network that receives service messages sent by other networks.
[0124] Understandably, the receiving module 200 can also be used to perform the above step S20.
[0125] The recording module 210 is used to record the receiving correspondence between the receiving timestamp and the distinguishing identifier corresponding to the delay measurement message.
[0126] Understandably, the recording module 210 can also be used to perform the above step S21.
[0127] The sending module 220 is used to send the delay measurement message to the corresponding next network node and record the forwarding correspondence between the sending timestamp and the distinguishing identifier of the delay measurement message.
[0128] Understandably, the recording module 210 can also be used to perform the above step S22.
[0129] The sending module 220 is also used to send the receiving correspondence and the forwarding correspondence to the analysis device, so that the analysis device can calculate the network latency of the service message processing network based on the receiving correspondence and the forwarding correspondence.
[0130] Understandably, the sending module 220 can also be used to perform the above step S22.
[0131] Optionally, the receiving module 200 is further configured to, if the received multiple service packets are service packets sent by other networks, determine the first received service packet among the multiple service packets as the target service packet when entering the current measurement period; add a distinguishing identifier and a coloring identifier corresponding to the ingress forwarding component to the header of the target service packet to obtain a delay measurement packet; if the received multiple service packets are service packets sent by network nodes in the service packet processing network, determine the delay measurement packet from the multiple service packets according to the coloring identifier.
[0132] Optionally, the receiving module 200 is also used to add a distinguishing identifier and a coloring identifier corresponding to the ingress forwarding component to the IFIT header of the target service message.
[0133] Optionally, the recording module 210 is further configured to determine whether the network node meets the receiving recording conditions and the sending recording conditions based on the current delay measurement mode; if the network node meets the receiving recording conditions, it records the receiving correspondence between the receiving timestamp and the distinguishing identifier corresponding to the delay measurement message.
[0134] Optionally, the sending module 220 is also used to record the forwarding correspondence between the sending timestamp and the distinguishing identifier corresponding to the delay measurement message when the network node meets the sending record conditions.
[0135] Optionally, the recording module 210 is further configured to, if the current latency measurement mode is end-to-end measurement mode, determine that the network node meets the reception recording condition when the multiple received service packets are service packets sent by other networks; determine that the network node meets the transmission recording condition when the corresponding next network node is a network node in another network; and determine that the network node meets both the reception recording condition and the transmission recording condition if the current latency measurement mode is hop-by-hop measurement mode.
[0136] The network latency calculation device provided in this application embodiment receives multiple service packets through a receiving module and obtains latency measurement packets from the received service packets. The header of the latency measurement packet includes a distinguishing identifier corresponding to the ingress forwarding component. The ingress forwarding component is the forwarding component in the ingress network node that receives the latency measurement packet. The ingress network node is the network node in the service packet processing network that receives service packets sent by other networks. The recording module records the reception correspondence between the reception timestamp and the distinguishing identifier corresponding to the latency measurement packet. The sending module sends the latency measurement packet to the corresponding next network node, records the forwarding correspondence between the sending timestamp and the distinguishing identifier corresponding to the latency measurement packet, and sends the reception correspondence and forwarding correspondence to the analysis device. The analysis device calculates the network latency of the service packet processing network based on the reception correspondence and forwarding correspondence, thus making the network latency more accurate, reducing processing overhead and parsing difficulty, and improving forwarding performance.
[0137] Optionally, the above modules can be stored in the form of software or firmware. Figure 2 The memory shown is either stored in or embedded in the operating system (OS) of the forwarding component, and can be accessed by... Figure 2The processor executes the commands. Meanwhile, the data and program code required to execute these modules can be stored in memory.
[0138] Optionally, embodiments of this application also provide a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, can implement the network latency calculation method provided in embodiments of this application.
[0139] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code, which contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0140] In addition, the functional modules in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0141] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0142] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A method for calculating network latency, characterized in that, The method is applied to any network node in a service message processing network, wherein the network node includes at least one forwarding component, each forwarding component corresponds to a distinguishing identifier, and the network node is communicatively connected to an analysis device. The method includes: Receive multiple service messages and obtain a delay measurement message from the received multiple service messages; The header of the delay measurement message includes a distinguishing identifier corresponding to the ingress forwarding component. The ingress forwarding component is the forwarding component in the ingress network node that receives the delay measurement message. The ingress network node is the network node in the service message processing network that receives service messages sent by other networks. Record the reception correspondence between the received timestamp of the delay measurement message and the distinguishing identifier; The latency measurement message is sent to the corresponding next network node, and the forwarding correspondence between the sending timestamp of the latency measurement message and the distinguishing identifier is recorded; The receiving correspondence and the forwarding correspondence are sent to the analysis device so that the analysis device can calculate the network latency of the service packet processing network based on the receiving correspondence and the forwarding correspondence.
2. The method according to claim 1, characterized in that, The step of receiving multiple service messages and obtaining a delay measurement message from the received multiple service messages includes: If the multiple received service messages are service messages sent by other networks, then the first received service message among the multiple service messages received in the current measurement period is determined as the target service message; Add the distinguishing identifier and coloring identifier corresponding to the ingress forwarding component to the header of the target service message to obtain the delay measurement message; If the received multiple service messages are service messages sent by network nodes in the service message processing network, then the delay measurement message is determined from the multiple service messages according to the coloring identifier.
3. The method according to claim 2, characterized in that, The header of the target service message includes a flow-following detection IFIT header. Adding the distinguishing identifier and coloring identifier corresponding to the ingress forwarding component to the header of the target service message to obtain the latency measurement message includes: Add the distinguishing identifier and coloring identifier corresponding to the ingress forwarding component to the IFIT header of the target service message.
4. The method according to claim 2, characterized in that, The method further includes: Determine whether the network node meets the conditions for receiving and sending records based on the current latency measurement mode; The recording of the reception correspondence between the received timestamp of the delay measurement message and the distinguishing identifier includes: When the network node meets the reception recording conditions, the reception correspondence between the reception timestamp of the delay measurement message and the distinguishing identifier is recorded; The recording of the forwarding correspondence between the sending timestamp of the delay measurement message and the distinguishing identifier includes: When the network node meets the sending record conditions, it records the forwarding correspondence between the sending timestamp of the delay measurement message and the distinguishing identifier.
5. The method according to claim 4, characterized in that, The step of determining whether the network node meets the reception record condition and the transmission record condition based on the current latency measurement mode includes: If the current latency measurement mode is an end-to-end measurement mode, then if the received multiple service packets are service packets sent by other networks, it is determined that the network node meets the reception record conditions. If the next network node is a network node in another network, it is determined that the network node satisfies the sending record condition; If the current latency measurement mode is hop-by-hop measurement mode, then the network node is determined to meet the receive record condition and the send record condition.
6. The method according to any one of claims 1-5, characterized in that, The distinguishing identifier is determined based on the local index of the ingress forwarding component, or based on the stack member to which the ingress forwarding component belongs and the slot it is located, or based on the index of the message receiving interface corresponding to the ingress forwarding component.
7. A network latency calculation device, characterized in that, An apparatus applicable to any network node in a service message processing network, wherein the network node includes at least one forwarding component, each forwarding component corresponding to a distinguishing identifier, and the network node is communicatively connected to an analysis device, the apparatus comprising: A receiving module is used to receive multiple service messages and obtain a latency measurement message from the received multiple service messages; the header of the latency measurement message includes a distinguishing identifier corresponding to the ingress forwarding component, the ingress forwarding component is the forwarding component in the ingress network node that receives the latency measurement message, and the ingress network node is the network node in the service message processing network that receives service messages sent by other networks; The recording module is used to record the receiving correspondence between the receiving timestamp corresponding to the delay measurement message and the distinguishing identifier; The sending module is used to send the latency measurement message to the corresponding next network node and record the forwarding correspondence between the sending timestamp of the latency measurement message and the distinguishing identifier; The sending module is further configured to send the receiving correspondence and the forwarding correspondence to the analysis device, so that the analysis device can calculate the network latency of the service message processing network based on the receiving correspondence and the forwarding correspondence.
8. The apparatus according to claim 7, characterized in that, The receiving module is further configured to, if the received multiple service messages are service messages sent by other networks, determine the first received service message among the multiple service messages as the target service message when entering the current measurement period. Add the distinguishing identifier and coloring identifier corresponding to the ingress forwarding component to the header of the target service message to obtain the delay measurement message; If the received multiple service messages are service messages sent by network nodes in the service message processing network, then the delay measurement message is determined from the multiple service messages according to the coloring identifier.
9. A network node, characterized in that, It includes a processor and a memory, the memory storing a computer program executable by the processor, the processor being able to execute the computer program to implement the method of any one of claims 1-6.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method described in any one of claims 1-6.
Citation Information
Patent Citations
Network delay measurement method and device and network node
CN107508719A
Hop-by-hop time delay measurement method and system
CN110971331A