A bandwidth monitoring method, system, PTP device and bandwidth calculation device

By carrying timestamps and flow statistics in PTP packets, the problem of inaccurate bandwidth calculations caused by software scheduled sampling is solved, achieving accurate bandwidth monitoring and saving resources.

CN116112402BActive Publication Date: 2024-10-18北京晟芯网络科技有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310009047.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-04
Publication Date
2024-10-18
Estimated Expiration
2043-01-04

AI Technical Summary

Technical Problem

In the existing technology, when the software timing sampling method calculates network bandwidth, the calculated bandwidth is inaccurate due to inaccurate timing and inaccurate time intervals caused by differences in the order of software running commands.

Method used

Use PTP packets to carry the timestamps and flow statistics required to calculate real-time bandwidth, receive and store the timestamps and flow statistics through the PTP device, and send them to the bandwidth calculation device, using accurate timestamps and flow statistics to calculate Bandwidth, avoiding software scheduled polling and scheduled interrupts to the CPU.

Benefits of technology

It achieves the accuracy of bandwidth calculation, saves timing and bandwidth resources, and does not require major changes to the PTP message format, which is conducive to hardware implementation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116112402B_ABST
    Figure CN116112402B_ABST
Patent Text Reader

Abstract

This disclosure provides a bandwidth monitoring method, system, PTP device, and bandwidth calculation device. The method includes: the PTP device receiving PTP packets, sampling timestamps and flow statistics, and storing the timestamps and flow statistics in the PTP packets; the PTP device sending the timestamps and flow statistics to the bandwidth calculation device, so that the bandwidth calculation device calculates the bandwidth based on the timestamps and flow statistics. The bandwidth monitoring method, system, PTP device, and bandwidth calculation device disclosed in this disclosure can improve the accuracy of bandwidth calculation, save timing resources, and save bandwidth resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to but is not limited to the field of communications, and in particular to a bandwidth monitoring method, system, PTP device, and bandwidth calculation device. Background Art

[0002] Bandwidth monitoring in the network mostly adopts the method of timed sampling, which may include software sampling, that is, the software periodically reads the flow statistics count in the underlying hardware.

[0003] The principle of software sampling flow statistics is: the hardware chip counts the received messages internally and maintains a statistical counter locally. The software samples and reads cnt1, cnt2, and cnt3 at time T1, T2, and T3 respectively, and calculates the bandwidth by the difference between the two sampling reads.

[0004] Bandwidth at time T2: (cnt2-cnt1) / (T2-T1)=(cnt2-cnt1) / △t1;

[0005] Bandwidth at time T3: (cnt3-cnt2) / (T3-T2)=(cnt3-cnt2) / △t2.

[0006] Due to the inaccurate software timing, the software originally intended to initiate sampling and reading at a fixed time interval of △t. However, since the software timing is not as accurate as the hardware, and the reading and writing will also be slightly different due to the software running command sequence, the final time interval at the bottom layer of the hardware chip is △t1 and △t2. However, the software still calculates the bandwidth according to:

[0007] Bandwidth at sampling time 2: (cnt2-cnt1) / △t;

[0008] Bandwidth at sampling time 3: (cnt3-cnt2) / △t.

[0009] Inaccurate timing leads to inaccurate intervals, and the bandwidth calculated by the software is not as accurate as the actual bandwidth. Summary of the invention

[0010] In a first aspect, an embodiment of the present disclosure provides a bandwidth monitoring method, including:

[0011] The PTP device receives the PTP message, samples the timestamp and the flow statistics information, and stores the timestamp and the flow statistics information in the PTP message;

[0012] The PTP device sends the timestamp and the flow statistics information to the bandwidth calculation device, so that the bandwidth calculation device calculates the bandwidth according to the timestamp and the flow statistics information.

[0013] In a second aspect, an embodiment of the present disclosure provides a bandwidth monitoring method, including:

[0014] The bandwidth calculation device receives a PTP message sent by the PTP device, wherein the PTP message carries a timestamp and flow statistics information of a corresponding time;

[0015] The bandwidth calculation device calculates the bandwidth according to the timestamp and the flow statistical information.

[0016] In a third aspect, an embodiment of the present disclosure further provides a PTP device, including a memory and a processor, wherein the memory is used to store execution instructions; the processor calls the execution instructions to execute the bandwidth monitoring method as described in any embodiment of the first aspect.

[0017] In a fourth aspect, an embodiment of the present disclosure further provides a bandwidth calculation device, including a memory and a processor, wherein the memory is used to store execution instructions; the processor calls the execution instructions to execute the bandwidth monitoring method as described in any embodiment of the second aspect.

[0018] In a fifth aspect, an embodiment of the present disclosure further provides a bandwidth monitoring system, comprising the PTP device described in any embodiment and the bandwidth calculation device described in any embodiment.

[0019] Compared with the prior art, the bandwidth monitoring method, system, PTP device and bandwidth calculation device provided by at least one embodiment of the present disclosure have the following beneficial effects: the PTP message is used to carry the time and flow statistics information required for calculating the real-time bandwidth, the sampling time interval is accurate, and the bandwidth calculated thereby is also accurate. In addition, the timestamp and flow statistics information carried by the PTP message are used to calculate the bandwidth, and there is no need for software to periodically poll and read the sampling information, and there is no need to periodically interrupt the CPU, which saves timing resources and bandwidth resources.

[0020] Other features and advantages of the present disclosure will be described in the following description, and partly become apparent from the description, or be understood by implementing the present disclosure. Other advantages of the present disclosure can be realized and obtained by the schemes described in the description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The accompanying drawings are used to provide an understanding of the technical solution of the present disclosure and constitute a part of the specification. Together with the embodiments of the present disclosure, they are used to explain the technical solution of the present disclosure and do not constitute a limitation on the technical solution of the present disclosure.

[0022] Figure 1 A flowchart of a bandwidth monitoring method provided by an exemplary embodiment of the present disclosure;

[0023] Figure 2 A schematic diagram of sending a PTP Sync message to a CPU provided in an embodiment of the present disclosure;

[0024] Figure 3 A schematic diagram of a Sync message passing through a chip, a board or a frame provided in an embodiment of the present disclosure;

[0025] Figure 4 A schematic diagram of a Sync message from one device to another provided in an embodiment of the present disclosure;

[0026] Figure 5 A flowchart of a bandwidth monitoring method provided for another exemplary embodiment of the present disclosure;

[0027] Figure 6 A structural block diagram of a PTP device provided in an embodiment of the present disclosure;

[0028] Figure 7 A structural block diagram of a bandwidth calculation device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0029] The present disclosure describes multiple embodiments, but the description is exemplary rather than restrictive, and it is apparent to those skilled in the art that there may be more embodiments and implementations within the scope of the embodiments described in the present disclosure. Although many possible feature combinations are shown in the drawings and discussed in the specific embodiments, many other combinations of the disclosed features are possible. Unless specifically limited, any feature or element of any embodiment may be used in combination with any other feature or element in any other embodiment, or may replace any other feature or element in any other embodiment.

[0030] The present disclosure includes and contemplates combinations of features and elements known to those of ordinary skill in the art. The embodiments, features, and elements disclosed in the present disclosure may also be combined with any conventional features or elements to form a unique invention scheme defined by the claims. Any features or elements of any embodiment may also be combined with features or elements from other invention schemes to form another unique invention scheme defined by the claims. Therefore, it should be understood that any feature shown and / or discussed in the present disclosure may be implemented individually or in any appropriate combination. Therefore, except for the limitations made according to the attached claims and their equivalents, the embodiments are not subject to other limitations. In addition, various modifications and changes may be made within the scope of protection of the attached claims.

[0031] In addition, when describing representative embodiments, the specification may have presented the method and / or process as a specific sequence of steps. However, to the extent that the method or process does not rely on the specific order of the steps described herein, the method or process should not be limited to the steps in the specific order described. As will be appreciated by those of ordinary skill in the art, other orders of steps are also possible. Therefore, the specific order of the steps set forth in the specification should not be interpreted as a limitation to the claims. In addition, the claims for the method and / or process should not be limited to the steps performed in the order written, and those skilled in the art can easily understand that these orders can be changed and still remain within the spirit and scope of the disclosed embodiments.

[0032] Figure 1 A flowchart of a bandwidth monitoring method provided by an exemplary embodiment of the present disclosure is shown in FIG. Figure 1 As shown, the bandwidth monitoring method may include: S101 and S102.

[0033] S101: The PTP device receives a PTP message, samples a timestamp and flow statistics information, and stores the timestamp and flow statistics information in the PTP message.

[0034] The disclosed embodiment proposes a monitoring method for accurate bandwidth real-time association in a PTP message synchronization network, which uses periodic PTP messages to sample timestamps and flow statistics information. The sampling timestamps and flow statistics are at the same time, and the PTP messages are used to carry the time and flow statistics information required for calculating the real-time bandwidth.

[0035] PTP (Precision Time Protocol) is a protocol defined in the IEEE 1588 protocol that uses messages for time synchronization. There are currently three versions: V1 in 2002, V2 in 2008, and V3 in 2019. V2 and V3 are currently the main versions in use. PTP defines 11 messages: Sync, Delay_Req, Pdelay_Req, Pdelay_Resp, Follow_Up, Delay_Resp, Pdelay_Resp_Follow_Up, Announce, Signaling, and Management. Among them, the messages Sync, Delay_Req, Pdelay_Req, and Pdelay_Resp are event messages that carry timestamps for time synchronization.

[0036] In an example embodiment of the present disclosure, the PTP message may be a PTP event message, because the PTP event message will be sampled and carry a timestamp when entering a port or exiting a port, and the PTP event message timestamp is sampled and recorded in the message when the message is received from a port or sent from a port. The PTP device samples flow statistics when the PTP event message enters a port or exits a port, and by sampling the flow statistics information at the same time as the sampling timestamp, the sampled timestamp and flow statistics can be realized at the same time. And the sampled flow statistics are stored in the PTP event message, and the PTP event message is used to carry the time and flow statistics information required for calculating the real-time bandwidth.

[0037] In an exemplary embodiment of the present disclosure, storing the flow statistics information in the PTP message may include: storing the flow statistics information in a reserved field of the PTP message.

[0038] The PTP message is provided with a reserved field, which is a field in the PTP message that is reserved but not used temporarily, or a field that is reserved but has no specific purpose defined. The disclosed embodiment can store the sampled flow statistics information in the reserved field of the PTP message, and carry the flow statistics information required for calculating the real-time bandwidth through the reserved field of the PTP message, so as to realize real-time bandwidth monitoring.

[0039] The PTP message has a 34-byte common header. Table 1 is the common header of the PTP message V2 version. As shown in Table 1, between the correctionField field and the sourcePortIdentity field of the V2 version of the PTP message is a 4-byte reserved field, which is reserved. There are multiple reserved fields in the V2 version common header. The embodiment of the present disclosure stores the sampled flow statistics information in the reserved field of 4 bytes.

[0040] Table 1

[0041]

[0042] Table 2 is the general header of the PTP message V3 version. As shown in Table 2, between the correctionField field and the sourcePortIdentity field of the PTP message V3 version is the messageTypeSpecific field with a length of 4 bytes. The messageTypeSpecific field does not define a specific usage in the V3 version standard of the PTP message. Different PTP equipment manufacturers can use this field for different purposes when implementing it, but this field only has local significance, that is, it is meaningful within a single PTP device and is still a reserved field between PTP devices.

[0043] Table 2

[0044]

[0045] The general header of the PTP message shown in Table 1 and Table 2 is a standard format defined by the IEEE 1588 protocol V2 and V3 versions, which is not limited or elaborated in this embodiment.

[0046] In one example, storing the flow statistics information in a reserved field of a PTP message may include:

[0047] The flow statistics information is stored in the reserved field in the PTP message version 2 or the messageTypeSpecific field in the PTP message version 3.

[0048] The disclosed embodiment may store the sampled flow statistics information in the 4-byte length reserved field of the PTP message V2 version, or may store the sampled flow statistics information in the messageTypeSpecific field of the PTP message V3 version. The reserved field or the messageTypeSpecific field of the PTP message carries the flow statistics information required for calculating the real-time bandwidth, thereby realizing real-time bandwidth monitoring.

[0049] There are multiple reserved fields in the V2 version common header. The embodiment of the present disclosure stores the sampled flow statistics information in a 4-byte reserved field between the V2 version correctionField field and the sourcePortIdentity field of the PTP message.

[0050] In an exemplary embodiment of the present disclosure, storing the flow statistics information in the PTP message may include: storing the flow statistics information at the end of the PTP message.

[0051] An additional field may be added at the end of the PTP message to place the sampled flow statistics information at the end of the PTP message. For example, when the reserved field of the PTP message is occupied, the sampled flow statistics information may be placed at the end of the PTP message.

[0052] In an exemplary embodiment of the present disclosure, storing the timestamp in the PTP message may include: storing the timestamp in a timestamp field of the PTP message.

[0053] The sampled timestamp may be placed in an inherent field of the PTP message for storing time. For example, the timestamp may be placed in a timestamp field of a PTP event message.

[0054] In an exemplary embodiment of the present disclosure, storing the timestamp in the PTP message may include: storing the timestamp at the end of the PTP message.

[0055] An additional field can be added to the end of the PTP message to place the sampled timestamp at the end of the PTP message. For example, when the timestamp field of the PTP event message is occupied, the sampled timestamp can be placed at the end of the PTP message. Alternatively, for a PTP normal message that does not have an inherent field for storing time, the sampled timestamp can be placed at the end of the PTP message.

[0056] In one example, the PTP event message can place the sampled timestamp in the inherent field for storing the timestamp in the sending direction, and place it at the end of the message when sending it to the CPU in the receiving direction. There is only one timestamp field in the PTP event message. If the timestamp field is already occupied in the sending direction, the timestamp is placed at the end of the PTP message in the receiving direction.

[0057] S102: The PTP device sends the timestamp and the flow statistics information to the bandwidth calculation device, so that the bandwidth calculation device calculates the bandwidth according to the timestamp and the flow statistics information.

[0058] The PTP message itself carries the time and flow statistics information required to calculate the real-time bandwidth. The flow statistics information and time information can be used to accurately calculate the bandwidth of the PTP message when it passes through the device node. With the help of PTP messages, the sampling time interval is accurate, and the bandwidth calculated is also accurate. There is no need to use software or hardware timers to regularly sample flow statistics information to calculate bandwidth. Only the timestamp and flow statistics information carried by the PTP message are used to calculate the bandwidth. There is no need for software to periodically poll to read the sampling information, and there is no need to periodically interrupt the CPU, which saves timing resources and bandwidth resources.

[0059] The PTP device sends the timestamp and flow statistics information to the bandwidth calculation device, and the bandwidth calculation device calculates the bandwidth according to the timestamp and flow statistics information. The bandwidth calculation device can use the existing solution to calculate the bandwidth according to the timestamp and flow statistics information, for example, bandwidth W = (cnt2-cnt1) / (T2-T1), T1 and T2 are the timestamps carried by two adjacent messages, and cnt1 and cnt2 are the flow statistics information carried by two adjacent messages.

[0060] In an exemplary embodiment of the present disclosure, the PTP device sends the timestamp and flow statistics information to the bandwidth calculation device, which may include: sending the PTP message carrying the timestamp and flow statistics information to the bandwidth calculation device.

[0061] By using PTP messages to carry the time and flow statistics information required to calculate real-time bandwidth, the messages are directly reported to the bandwidth calculation device, which can calculate the bandwidth of each device node at the moment when the PTP message flows through it.

[0062] In an exemplary embodiment of the present disclosure, the PTP device sends the timestamp and flow statistics information to the bandwidth calculation device, which may include: extracting the timestamp and flow statistics information stored in the PTP message and sending them to the bandwidth calculation device.

[0063] For the PTP message that is not sent to the bandwidth calculation device, the timestamp and flow statistics information stored in the PTP message may be extracted, and then the extracted timestamp and flow statistics information may be sent to the bandwidth calculation device.

[0064] The method of sending the extracted timestamp and flow statistics information to the bandwidth calculation device can be customized. For example, the bandwidth calculation device or PTP device (such as a network management device) has a dedicated interactive message that can exchange various types of information. A proprietary message can be defined to put the extracted timestamp and flow statistics information in the proprietary message and send it to the bandwidth calculation device.

[0065] The bandwidth monitoring method provided by the embodiment of the present disclosure uses PTP messages to carry the time and flow statistics information required for calculating the real-time bandwidth. The sampling time interval is accurate, and the bandwidth calculated thereby is also accurate. In addition, the timestamp and flow statistics information carried by the PTP message are used to calculate the bandwidth, and there is no need for software to periodically train and read the sampling information, nor is there a need to periodically interrupt the CPU, which saves timing resources and bandwidth resources. In addition, the embodiment of the present disclosure uses the existing fields of the PTP message, or places them at the end of the message, and there is no need to make major changes to the PTP message format, which is also conducive to hardware implementation.

[0066] In an exemplary embodiment of the present disclosure, the timestamp and flow statistics information sampled by the PTP device may include: an ingress timestamp and ingress flow statistics information sampled at the moment when the PTP message enters the port.

[0067] The ingress timestamp and ingress flow statistics of the PTP message entering the port can be sampled to calculate the flow of the PTP message at the ingress moment.

[0068] The PTP event message timestamp is sampled and recorded in the message when the message is received from the port or sent from the port. When sampling the timestamp, the flow statistics information is sampled at the same time, so that the sampled timestamp and flow statistics information can be at the same time.

[0069] Taking the PTP Sync event message as an example, other PTP event messages can be used as messages of flow statistics information, which will not be described in detail in this embodiment.

[0070] When a PTP Sync event message is received on a slave port, the timestamp of the moment it enters the port is sampled. The PTP device also samples flow statistics when the Sync event message enters the port.

[0071] According to the protocol, the Sync message is sampled at the time of reception by the Slave node (generated as described in the article). This patent newly adds re-sampling flow statistics, and writes the flow statistics into the message after sampling. The sampled timestamp can be placed in the special timestamp field of the Sync message, and the sampled flow statistics are stored in the reserved field of the Sync message.

[0072] In the sending direction, the PTP event message can put the sampled timestamp in the inherent field, but when sending to the bandwidth calculation device (such as CPU) in the receiving direction, it is generally placed at the end of the message. Because there is only one timestamp field in the PTP event message, which is occupied in the sending direction, it can be placed at the end of the message in the receiving direction and sent to the CPU along with the message. Similarly, there is only one reserved field in the PTP event message. After the reserved field is occupied, the flow statistics sampled in the receiving direction are placed at the end of the message.

[0073] In an example embodiment of the present disclosure, a PTP device samples timestamps and flow statistics information, and stores the timestamps and flow statistics information in a PTP message, which may include: the PTP device samples ingress timestamps and ingress flow statistics information, stores the ingress timestamp in the timestamp field of the PTP message or at the end of the message, and stores the ingress flow statistics information in a reserved field of the PTP message.

[0074] Accordingly, the PTP device sending the timestamp and the flow statistics information to the bandwidth calculation device may include: the PTP device sending a PTP message carrying the ingress timestamp and the ingress flow statistics information to the bandwidth calculation device.

[0075] Figure 2 A schematic diagram of sending a PTP Sync message to a CPU provided in an embodiment of the present disclosure, such as Figure 2 As shown in the figure, the application scenario is to send the Sync message to the CPU. According to the PTP protocol, for the Slave node, the Sync message needs to be sent and carry the ingress timestamp (called TS2 in the PTP protocol). The carried ingress timestamp is usually placed at the end of the message. When the Sync message carries the timestamp T1, the ingress flow statistics are sampled and stored in the 4-byte reserved field of the PTP message V2 version or the messageTypeSpecific field of the V3 version.

[0076] When the first Sync message is sent up, it carries the timestamp T1 and the flow statistics information cnt1. When the second Sync message is sent up, it carries the timestamp T2 and the flow statistics information cnt2. The precise bandwidth can be calculated: W = (cnt2-cnt1) / (T2-T1).

[0077] Each Sync message sent to the CPU can calculate the bandwidth based on the timestamp and flow statistics it carries, and accurately know the traffic situation of each PTP message at the ingress moment.

[0078] In an example embodiment of the present disclosure, the timestamps and flow statistics sampled by the PTP device may include: ingress timestamps and ingress flow statistics sampled when the PTP message enters the port, and egress timestamps and egress flow statistics sampled when the PTP message exits the port.

[0079] The ingress timestamp, ingress flow statistics, egress timestamp, and egress flow statistics of the PTP message egress port can be sampled to calculate the precise bandwidth between two PTP messages.

[0080] In an example embodiment of the present disclosure, a PTP device samples timestamps and flow statistics information, and stores the timestamps and flow statistics information in a PTP message, which may include: the PTP device samples ingress timestamps and ingress flow statistics information, stores the ingress timestamp in the timestamp field of the PTP message or at the end of the message, and stores the ingress flow statistics information in a reserved field of the PTP message; and, the PTP device samples egress timestamps and egress flow statistics information, extracts the ingress timestamps and ingress flow statistics information stored in the PTP message, stores the egress flow statistics information in the reserved field of the PTP message, and stores the egress timestamp in the timestamp field of the PTP message or at the end of the message.

[0081] Accordingly, the PTP device sends the timestamp and flow statistics information to the bandwidth calculation device, which may include: packaging the inlet timestamp, the inlet flow statistics information, the outlet timestamp and the outlet flow statistics information and sending them to the bandwidth calculation device.

[0082] Figure 3 A schematic diagram of a Sync message passing through a chip, a board or a frame provided in an embodiment of the present disclosure, such as Figure 3 As shown in the figure, the application scenario is that the PTP Sync message passes through the chip, board or chassis, which belongs to the PTP TC (transparent clock) node in the PTP protocol. The Sync message samples the ingress timestamp and ingress flow statistics at the ingress, and transmits the ingress timestamp with the message in the chip as a descriptor, or puts it at the end of the message, or stores the timestamp in the chip, board or chassis, and puts the ingress flow statistics in the reserved field.

[0083] After various exchange processes, the Sync message finally reaches the exit of the chip (single board or frame). When the message arrives at the exit, the exit timestamp and exit flow statistics are sampled. The timestamp and flow statistics sampled at the entrance of the Sync message are extracted, the flow statistics sampled at the exit are placed in the reserved field, and the entrance timestamp loaded at the end of the message at the entrance of the Sync message is deleted, so that the message maintains the original length. Since the reserved field has only local meaning, the reserved field can be overwritten by the next PTP device without any impact. The sampled entrance timestamp and entrance flow statistics, exit timestamp and exit flow statistics are sent to the CPU as a whole.

[0084] When the second Sync message passes through, the precise bandwidth between the first message and the second message can be calculated: precise ingress bandwidth W1 = (cnt2in-cnt1in) / (T2in-T1in); precise egress bandwidth W2 = (cnt2out-cnt1out) / (T2out-T1out). T1in, cnt1in, T1out and cnt1out are the ingress timestamp, ingress flow statistics, egress timestamp and egress flow statistics of the first Sync message respectively, and T2in, cnt2in, T2out and cnt2out are the ingress timestamp, ingress flow statistics, egress timestamp and egress flow statistics of the second Sync message respectively.

[0085] The sampling results when the PTP Sync message passes through the chip, single board or machine frame, because there is no message sent to the CPU, you can use the method of packaging the results and sending them, or you can use a custom sending method. For example, the bandwidth calculation device or chip (single board or machine frame) has a special interactive message that can exchange various types of information. You can define a proprietary message and put the extracted timestamp and flow statistics information in the proprietary message and send it to the bandwidth calculation device.

[0086] In an exemplary embodiment of the present disclosure, the timestamp and flow statistics information sampled by the PTP device may include: an egress timestamp and egress flow statistics information sampled at the time when the PTP message exits the port.

[0087] The egress timestamp and egress flow statistics of the PTP message egress port can be sampled to calculate the flow of the PTP message at the egress moment.

[0088] In an example embodiment of the present disclosure, a PTP device samples timestamps and flow statistics information, and stores the timestamps and flow statistics information in a PTP message, which may include: the PTP device samples an export timestamp and export flow statistics information, stores the export timestamp in a timestamp field of the PTP message or at the end of the message, stores the export flow statistics information in a reserved field of the PTP message, and sends the PTP message to a downstream PTP device.

[0089] Accordingly, the PTP device sending the timestamp and flow statistics information to the bandwidth calculation device may include: extracting the egress timestamp and egress flow statistics information stored in the PTP message and sending them to the bandwidth calculation device.

[0090] Figure 4 A schematic diagram of a Sync message from one device to another provided in an embodiment of the present disclosure, such as Figure 4 As shown, the application scenario is that the PTP Sync message is sent from the previous device ( Figure 4 The PTP device 1 in the downstream device ( Figure 4 2) received by the PTP device in the upstream device. For example, the upstream device is the PTP Master and the downstream device is the PTP Slave. According to the PTP protocol, when the upstream device PTP Master sends a Sync message, the Sync message will record the egress timestamp, and at the same time sample the egress flow statistics to the reserved field in the Sync message for use by the downstream device, and before sending the Sync message to the downstream device, the egress timestamp and egress flow statistics stored in the Sync message will be extracted and sent to the CPU.

[0091] On the upstream PTP Master device, when the second Sync message is sent, the outbound bandwidth of the device can be calculated as W = (cnt2out-cnt1out) / (T2out-T1out).

[0092] In an example embodiment of the present disclosure, a PTP device receives a PTP message, samples a timestamp and flow statistics information, and stores the timestamp and flow statistics information in the PTP message, which may include: the PTP device receives a PTP message sent by an upstream PTP device, extracts the export timestamp and export flow statistics information of the PTP message at the upstream PTP device from the PTP message; the PTP device samples the import timestamp of the current device and the import flow statistics information of the current device, stores the import timestamp of the current device at the end of the PTP message, and stores the import flow statistics information of the current device in a reserved field of the PTP message.

[0093] Accordingly, the PTP device sends the timestamp and flow statistics information to the bandwidth calculation device, which may include: packaging the egress timestamp and egress flow statistics of the upstream PTP device and the ingress timestamp and ingress flow statistics of the current device and sending them to the bandwidth calculation device.

[0094] like Figure 4 As shown, the application scenario is that the PTP Sync message is sent from the previous device ( Figure 4 The PTP device 1 in the downstream device ( Figure 4 2) Received by the PTP device in the upstream device. For example, the upstream device is the PTP Master and the downstream device is the PTP Slave. According to the PTP protocol, when the upstream device PTP Master sends out the Sync message, it will record the egress timestamp and sample the egress flow statistics to the reserved field in the Sync message for use by the downstream device. When the downstream Slave device receives it, the Sync message samples the ingress timestamp and the ingress flow statistics, and puts the sampled ingress timestamp and ingress flow statistics at the end of the message, and sends the Sync message to the CPU.

[0095] On the downstream PTP Slave device, when the second Sync message is received, the outbound bandwidth W3 = (cnt2out-cnt1out) / (T2out-T1out) of the upstream device PTP Master can be calculated, and the inbound bandwidth W4 = (cnt2in-cnt1in) / (T2in-T1in) of the device can be calculated.

[0096] Figure 2 , Figure 3 and Figure 4 In the illustrated embodiment, the bandwidth of the PTP Sync message at the time of sending, traversing and receiving can be accurately calculated, thereby knowing the precise bandwidth of the entire path process of the PTP Sync message, and based on these interrelated bandwidth information, it is convenient for network management personnel to make decisions.

[0097] The bandwidth monitoring method provided by the embodiment of the present disclosure can calculate the bandwidth situation of the PTP event message at the moment when it flows through each device node, and can associate all bandwidth situations of the PTP event message, so as to facilitate the upper layer protocol to analyze and make timely adjustments.

[0098] Figure 5 A flowchart of a bandwidth monitoring method provided by another exemplary embodiment of the present disclosure is as follows: Figure 5 As shown, the bandwidth monitoring method may include:

[0099] S501: The bandwidth calculation device receives a PTP message sent by a PTP device. The PTP message carries a timestamp and flow statistics information of a corresponding time.

[0100] The disclosed embodiment proposes a monitoring method for accurate bandwidth real-time association in a PTP message synchronization network, which uses periodic PTP messages to sample timestamps and flow statistics information. The sampling timestamps and flow statistics are at the same time, and the PTP messages are used to carry the time and flow statistics information required for calculating the real-time bandwidth.

[0101] In an exemplary embodiment of the present disclosure, the reserved field of the PTP message stores flow statistics information. The PTP message can be used to carry the time and flow statistics information required for calculating the real-time bandwidth, and the message is directly reported to the bandwidth calculation device, and the bandwidth of the PTP message at the moment when it flows through each device node can be calculated.

[0102] In an exemplary embodiment of the present disclosure, flow statistics information is stored at the end of the PTP message. For the PTP message that is not sent to the bandwidth calculation device, the timestamp and flow statistics information stored in the PTP message can be extracted and then sent to the bandwidth calculation device.

[0103] The method of sending the extracted timestamp and flow statistics information to the bandwidth calculation device can be customized. For example, the bandwidth calculation device or PTP device (such as a network management device) has a dedicated interactive message that can exchange various types of information. A proprietary message can be defined to put the extracted timestamp and flow statistics information in the proprietary message and send it to the bandwidth calculation device.

[0104] S502: The bandwidth calculation device calculates the bandwidth according to the timestamp and the flow statistics information.

[0105] The PTP message itself carries the time and flow statistics information required for calculating the real-time bandwidth. The flow statistics information and time information can be used to accurately calculate the bandwidth of the PTP message when it passes through the device node.

[0106] In an exemplary embodiment of the present disclosure, the bandwidth monitoring method may further include: receiving packet information sent by a PTP device, wherein the packet information includes a timestamp and flow statistics information of a corresponding time;

[0107] Calculating the bandwidth according to the timestamp and the flow statistics information may include: calculating the bandwidth according to the flow statistics information with the timestamp and the corresponding time carried in the PTP message; or calculating the bandwidth according to the timestamp in the packetization information and the flow statistics information with the corresponding time.

[0108] The PTP device sends the timestamp and flow statistics information to the bandwidth calculation device, and the bandwidth calculation device calculates the bandwidth according to the timestamp and flow statistics information. The bandwidth calculation device can use the existing solution to calculate the bandwidth according to the timestamp and flow statistics information, for example, bandwidth W = (cnt2-cnt1) / (T2-T1), T1 and T2 are the timestamps carried by two adjacent messages, and cnt1 and cnt2 are the flow statistics information carried by two adjacent messages.

[0109] The bandwidth monitoring method provided by the embodiment of the present disclosure uses PTP messages to carry the time and flow statistics information required for calculating the real-time bandwidth. The sampling time interval is accurate, and the bandwidth calculated thereby is also accurate. In addition, the timestamp and flow statistics information carried by the PTP message are used to calculate the bandwidth, and there is no need for software to periodically poll and read the sampling information, and there is no need to periodically interrupt the CPU, which saves timing resources and bandwidth resources.

[0110] In an exemplary embodiment of the present disclosure, the types of the received timestamp and statistical flow information may include one or more of the following:

[0111] The ingress timestamp and ingress flow statistics of the local node sent by the PTP device acting as a slave node;

[0112] The egress timestamp and egress flow statistics of the upstream node sent by the PTP device acting as a slave node;

[0113] The ingress timestamp and ingress flow statistics of the PTP device as the PTP TC node, as well as the egress timestamp and egress flow statistics of the PTP device itself, are sent.

[0114] See above for details Figure 2 , Figure 3 and Figure 4 The illustrated embodiment can accurately calculate the bandwidth of the PTP Sync message at the time of sending, traversing and receiving, thereby knowing the precise bandwidth of the entire path process of the PTP Sync message. Based on these interrelated bandwidth information, it is convenient for network management personnel to make decisions.

[0115] Figure 6 A structural block diagram of a PTP device provided in an embodiment of the present disclosure, such as Figure 6 As shown, the PTP device may include: a memory 61 and a processor 62 .

[0116] The memory is used to store execution instructions, and the processor can be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits that implement the embodiment of the present invention. When the PTP device is running, the processor communicates with the memory, and the processor calls the execution instruction to perform the following operations:

[0117] Receiving a PTP message, sampling a timestamp and flow statistics information, and storing the timestamp and flow statistics information in the PTP message;

[0118] The timestamp and the flow statistics information are sent to a bandwidth calculation device, so that the bandwidth calculation device calculates the bandwidth according to the timestamp and the flow statistics information.

[0119] In an exemplary embodiment of the present disclosure, the sampled timestamp and flow statistics information may include at least one of the following: an ingress timestamp and ingress flow statistics information sampled at the moment when the PTP message enters the port, and an egress timestamp and egress flow statistics information sampled at the moment when the PTP message exits the port.

[0120] In an exemplary embodiment of the present disclosure, the processor stores the flow statistics information in the PTP message, which may include:

[0121] Storing the flow statistics information in a reserved field of the PTP message;

[0122] or,

[0123] The flow statistics information is stored at the end of the PTP message.

[0124] In an exemplary embodiment of the present disclosure, the processor storing the flow statistics information in a reserved field of the PTP message may include:

[0125] The flow statistics information is stored in the reserved field of the V2 version or the messageTypeSpecific field of the V3 version of the PTP message.

[0126] In an exemplary embodiment of the present disclosure, the processor sending the timestamp and the flow statistics information to the bandwidth calculation device may include:

[0127] Sending the PTP message carrying the timestamp and the flow statistics information to the bandwidth calculation device;

[0128] or,

[0129] The timestamp and flow statistics information stored in the PTP message are extracted and sent to the bandwidth calculation device.

[0130] In an exemplary embodiment of the present disclosure, the processor samples the timestamp and the flow statistics information, and stores the timestamp and the flow statistics information in the PTP message, which may include: the PTP device samples the ingress timestamp and the ingress flow statistics information, stores the ingress timestamp in the timestamp field of the PTP message or at the end of the message, and stores the ingress flow statistics information in the reserved field of the PTP message;

[0131] The processor sending the timestamp and the flow statistics information to the bandwidth calculation device may include: the PTP device sending the PTP message carrying the ingress timestamp and the ingress flow statistics information to the bandwidth calculation device.

[0132] In an exemplary embodiment of the present disclosure, the processor samples the timestamp and the flow statistics information, and stores the timestamp and the flow statistics information in the PTP message, which may include: the PTP device samples the inlet timestamp and the inlet flow statistics information, stores the inlet timestamp in the timestamp field of the PTP message or at the end of the message, and stores the inlet flow statistics information in the reserved field of the PTP message; and the PTP device samples the egress timestamp and the egress flow statistics information, extracts the ingress timestamp and the ingress flow statistics information stored in the PTP message, stores the egress flow statistics information in the reserved field of the PTP message, and stores the egress timestamp in the timestamp field of the PTP message or at the end of the message;

[0133] The processor sends the timestamp and flow statistics information to the bandwidth calculation device, which may include: packaging the inlet timestamp, the inlet flow statistics information, the outlet timestamp and the outlet flow statistics information and sending them to the bandwidth calculation device.

[0134] In an exemplary embodiment of the present disclosure, the processor samples the timestamp and the flow statistics information, and stores the timestamp and the flow statistics information in the PTP message, which may include: the PTP device samples the egress timestamp and the egress flow statistics information, stores the egress timestamp in the timestamp field of the PTP message or at the end of the message, stores the egress flow statistics information in the reserved field of the PTP message, and sends the PTP message to a downstream PTP device;

[0135] The processor sending the timestamp and flow statistics information to the bandwidth calculation device may include: extracting the egress timestamp and egress flow statistics information stored in the PTP message and sending them to the bandwidth calculation device.

[0136] In an exemplary embodiment of the present disclosure, a processor receives a PTP message, samples a timestamp and flow statistics information, and stores the timestamp and flow statistics information in the PTP message, which may include: the PTP device receives a PTP message sent by an upstream PTP device, extracts an egress timestamp and egress flow statistics information of the PTP message at the upstream PTP device from the PTP message; the PTP device samples an ingress timestamp of a current device and an ingress flow statistics information of the current device, stores the ingress timestamp of the current device at the end of the PTP message, and stores the ingress flow statistics information of the current device in a reserved field of the PTP message;

[0137] The processor sends the timestamp and flow statistics information to the bandwidth calculation device, which may include: packaging the egress timestamp and egress flow statistics of the upstream PTP device and the ingress timestamp and ingress flow statistics of the current device and sending them to the bandwidth calculation device.

[0138] Figure 7 A structural block diagram of a bandwidth calculation device provided in an embodiment of the present disclosure, such as Figure 7 As shown, the bandwidth calculation device may include: a memory 71 and a processor 72 .

[0139] The memory is used to store execution instructions, and the processor may be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits that implement the embodiment of the present invention. When the bandwidth calculation device is running, the processor communicates with the memory, and the processor calls the execution instruction to perform the following operations:

[0140] A PTP message sent by a PTP device is received, wherein the PTP message carries a timestamp and flow statistics information of a corresponding time; and a bandwidth is calculated according to the timestamp and the flow statistics information.

[0141] In an exemplary embodiment of the present disclosure, the bandwidth calculation device and the PTP device may be the same device, or the bandwidth calculation device and the PTP device may be two different devices.

[0142] In an exemplary embodiment of the present disclosure, the flow statistics information is stored in a reserved field of the PTP message; or, the flow statistics information is stored at the end of the PTP message.

[0143] In an exemplary embodiment of the present disclosure, the types of the received timestamp and statistical flow information may include one or more of the following:

[0144] The ingress timestamp and ingress flow statistics of the local node sent by the PTP device acting as a slave node;

[0145] The egress timestamp and egress flow statistics of the upstream node sent by the PTP device acting as a slave node;

[0146] The ingress timestamp and ingress flow statistics of the PTP device as the PTP TC node, as well as the egress timestamp and egress flow statistics of the PTP device itself, are sent.

[0147] In an exemplary embodiment of the present disclosure, the processor is further configured to: receive packet information sent by a PTP device, wherein the packet information includes a timestamp and flow statistics information of a corresponding time;

[0148] The processor calculates the bandwidth according to the timestamp and the flow statistics information, which may include: calculating the bandwidth according to the flow statistics information carrying the timestamp and the corresponding time in the PTP message; or calculating the bandwidth according to the timestamp in the packaging information and the flow statistics information of the corresponding time.

[0149] The disclosed embodiments further provide a bandwidth monitoring system, comprising a PTP device shown in any embodiment and a bandwidth calculation device shown in any embodiment.

[0150] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In hardware implementations, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all components may be implemented as software executed by a processor, such as a digital signal processor or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those of ordinary skill in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.

Claims

1. A bandwidth monitoring method, comprising: The PTP device receives the PTP message, samples the timestamp and the flow statistics information, and stores the timestamp and the flow statistics information in the PTP message; The PTP device sends the timestamp and the flow statistics information to the bandwidth calculation device, so that the bandwidth calculation device calculates the bandwidth according to the timestamp and the flow statistics information.

2. The method according to claim 1, characterized in that The timestamp and flow statistics sampled by the PTP device include at least one of the following: an ingress timestamp and ingress flow statistics sampled when the PTP message enters the port, and an egress timestamp and egress flow statistics sampled when the PTP message exits the port.

3. The method according to claim 1, characterized in that Storing the flow statistics information in the PTP message includes: Storing the flow statistics information in a reserved field of the PTP message; or, The flow statistics information is stored at the end of the PTP message.

4. The method according to claim 3, characterized in that The storing the flow statistics information in a reserved field of the PTP message comprises: The flow statistics information is stored in the reserved field of the V2 version or the messageTypeSpecific field of the V3 version of the PTP message.

5. The method according to claim 1, characterized in that The PTP device sends the timestamp and the flow statistics information to the bandwidth calculation device, including: Sending the PTP message carrying the timestamp and the flow statistics information to the bandwidth calculation device; or, The timestamp and flow statistics information stored in the PTP message are extracted and sent to the bandwidth calculation device.

6. The method according to claim 1, characterized in that The PTP device samples the timestamp and the flow statistics information, and stores the timestamp and the flow statistics information in the PTP message, including: the PTP device samples the inlet timestamp and the inlet flow statistics information, stores the inlet timestamp in the timestamp field of the PTP message or at the end of the message, and stores the inlet flow statistics information in the reserved field of the PTP message; The PTP device sends the timestamp and the flow statistics information to the bandwidth calculation device, including: the PTP device sends the PTP message carrying the inlet timestamp and the inlet flow statistics information to the bandwidth calculation device.

7. The method according to claim 1, characterized in that The PTP device samples timestamps and flow statistics information, and stores the timestamps and flow statistics information in the PTP message, including: the PTP device samples inlet timestamps and inlet flow statistics information, stores the inlet timestamp in the timestamp field of the PTP message or at the end of the message, and stores the inlet flow statistics information in a reserved field of the PTP message; and the PTP device samples outlet timestamps and outlet flow statistics information, extracts the inlet timestamps and inlet flow statistics information stored in the PTP message, stores the outlet flow statistics information in the reserved field of the PTP message, and stores the outlet timestamp in the timestamp field of the PTP message or at the end of the message; The PTP device sends the timestamp and flow statistics information to the bandwidth calculation device, including: packaging the inlet timestamp, the inlet flow statistics information, the outlet timestamp and the outlet flow statistics information and sending them to the bandwidth calculation device.

8. The method according to claim 1, characterized in that The PTP device samples the timestamp and the flow statistics information, and stores the timestamp and the flow statistics information in the PTP message, including: the PTP device samples the egress timestamp and the egress flow statistics information, stores the egress timestamp in the timestamp field of the PTP message or at the end of the message, stores the egress flow statistics information in the reserved field of the PTP message, and sends the PTP message to a downstream PTP device; The PTP device sends the timestamp and flow statistics information to the bandwidth calculation device, including: extracting the egress timestamp and egress flow statistics information stored in the PTP message and sending them to the bandwidth calculation device.

9. The method according to claim 1, characterized in that: The PTP device receives a PTP message, samples a timestamp and flow statistics information, and stores the timestamp and flow statistics information in the PTP message, including: the PTP device receives a PTP message sent by an upstream PTP device, extracts an export timestamp and export flow statistics information of the PTP message at the upstream PTP device from the PTP message; the PTP device samples an import timestamp of a current device and import flow statistics information of the current device, stores the import timestamp of the current device at the end of the PTP message, and stores the import flow statistics information of the current device in a reserved field of the PTP message; The PTP device sends the timestamp and flow statistics information to the bandwidth calculation device, including: packaging the egress timestamp and egress flow statistics of the upstream PTP device and the ingress timestamp and ingress flow statistics of the current device and sending them to the bandwidth calculation device.

10. A bandwidth monitoring method, comprising: The bandwidth calculation device receives a PTP message sent by the PTP device, wherein the PTP message carries a timestamp and flow statistics information of a corresponding time; The bandwidth calculation device calculates the bandwidth according to the timestamp and the flow statistical information.

11. The method according to claim 10, characterized in that The reserved field of the PTP message stores the flow statistics information; Alternatively, the flow statistics information is stored at the end of the PTP message.

12. The method according to claim 10, characterized in that The type of timestamp and statistics flow information received, including one or more of the following: The ingress timestamp and ingress flow statistics of the local node sent by the PTP device acting as a slave node; The egress timestamp and egress flow statistics of the upstream node sent by the PTP device acting as a slave node; The ingress timestamp and ingress flow statistics of the PTP device as the PTP TC node, as well as the egress timestamp and egress flow statistics of the PTP device itself, are sent.

13. The method according to claim 10, characterized in that The method further comprises: Receive the packet information sent by the PTP device, wherein the packet information includes a timestamp and flow statistics information of the corresponding time; The calculating of the bandwidth according to the timestamp and the flow statistics information includes: calculating the bandwidth according to the flow statistics information carrying the timestamp and the corresponding time in the PTP message; or calculating the bandwidth according to the timestamp in the packaging information and the flow statistics information of the corresponding time.

14. A PTP device, characterized in that: It comprises a memory and a processor, the memory is used to store execution instructions; the processor calls the execution instructions to execute the bandwidth monitoring method according to any one of claims 1-9.

15. A bandwidth calculation device, characterized in that: It includes a memory and a processor, the memory is used to store execution instructions; the processor calls the execution instructions to execute the bandwidth monitoring method as described in any one of claims 10-13.

16. A bandwidth monitoring system, characterized in that: It comprises the PTP device as claimed in claim 14 and the bandwidth calculation device as claimed in claim 15.

Citation Information

Patent Citations

  • Network flux statistical method for broad band and narrow band integrated access equipment

    CN101155086A

  • Processing method of 1588 event messages and processing method of 1588 event messages

    CN103138887A