CN111416751B - Method and device for calculating port forwarding time delay - Google Patents

Method and device for calculating port forwarding time delay Download PDF

Info

Publication number
CN111416751B
CN111416751B CN201910010654.5A CN201910010654A CN111416751B CN 111416751 B CN111416751 B CN 111416751B CN 201910010654 A CN201910010654 A CN 201910010654A CN 111416751 B CN111416751 B CN 111416751B
Authority
CN
China
Prior art keywords
port
message
timestamp
forwarding
ptploop
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910010654.5A
Other languages
Chinese (zh)
Other versions
CN111416751A (en
Inventor
杨新国
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Mobile Communications Group Co Ltd
China Mobile Communications Ltd Research Institute
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile Communications Ltd Research Institute
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Mobile Communications Group Co Ltd, China Mobile Communications Ltd Research Institute filed Critical China Mobile Communications Group Co Ltd
Priority to CN201910010654.5A priority Critical patent/CN111416751B/en
Publication of CN111416751A publication Critical patent/CN111416751A/en
Application granted granted Critical
Publication of CN111416751B publication Critical patent/CN111416751B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0852Delays
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04JMULTIPLEX COMMUNICATION
    • H04J3/00Time-division multiplex systems
    • H04J3/02Details
    • H04J3/06Synchronising arrangements
    • H04J3/0635Clock or time synchronisation in a network
    • H04J3/0638Clock or time synchronisation among nodes; Internode synchronisation
    • H04J3/0658Clock or time synchronisation among packet nodes
    • H04J3/0661Clock or time synchronisation among packet nodes using timestamps
    • H04J3/0667Bidirectional timestamps, e.g. NTP or PTP for compensation of clock drift and for compensation of propagation delays

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Environmental & Geological Engineering (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention provides a method and a device for calculating port forwarding delay, and belongs to the technical field of IP (Internet protocol) bearer networks. The method for calculating the port forwarding delay applied to the second port comprises the following steps: the second port receives a high-precision clock synchronization protocol loop PTPLoop message sent by the first port, and extracts a first message timestamp corresponding to the receiving time; the second port sends the PTPLoop message to the first port, and extracts a second message timestamp corresponding to the sending time; and the second port reports the first message timestamp and the second message timestamp to the main controller. The method for calculating the port forwarding delay applied to the main controller comprises the following steps: the main controller receives a first message timestamp and a second message timestamp reported by a second port; and the main controller calculates the forwarding time delay between the first port and the second port according to the first message timestamp and the second message timestamp. By the technical scheme of the invention, the internal forwarding time delay of the equipment between the ports can be calculated.

Description

Method and device for calculating port forwarding time delay
Technical Field
The present invention relates to the technical field of IP bearer networks, and in particular, to a method and an apparatus for calculating port forwarding delay.
Background
The current technologies for realizing delay measurement are classified into two types, one is IP FPM (IP flow performance monitoring), TWAMP (bidirectional active measurement protocol), MPLS (multiprotocol label switching) OAM (operation, administration and maintenance) and the like, which perform end-to-end delay statistics based on service detection, and the like, and the measurement precision is millisecond level by using software to stamp. One is PTP (high precision clock synchronization protocol), which can measure the transmission delay of links between devices and the time deviation between devices, and the measurement precision is ns level by stamping hardware, but cannot measure the internal forwarding delay of the devices.
Introduction of IP FPM implementation technology
Based on service detection, the technologies of IP FPM, TWAMP, MPLS OAM, etc. for performing end-to-end delay measurement are similar in implementation principle, and the IP FPM is used as an example:
the statistical model of the IP FPM is a universal model for directly carrying out packet loss and time delay statistics on user service flow. From the point of statistics, a service flow is a target object of statistics, and the purpose of the statistics is to obtain packet loss and delay generated when the service flow passes through a transmission network, that is, to perform statistics at an inlet and an outlet of the transmission network respectively, and then to obtain a performance index to be counted in a summary manner.
As shown in fig. 1, the statistical process of IP FPM mainly involves three objects: target flow, network (Transit Network) traversed by the target flow, and statistical system. The statistical system is further divided into roles, which may be divided into a TLP (Target Logical Port), a DCP (Data Collecting Point), and an MCP (Measurement Control Point).
The target flow is a key element for implementing IP FPM statistics, each time the statistics must first specify the target flow, and a target flow is uniquely determined by specifying relevant field information in an IP (network protocol) message header.
TLPs are observation points distributed at the edge of the network, correspond to interfaces of edge nodes in the network, and are responsible for performing statistical actions and generating statistical data.
The dye bit is also called a characteristic identification bit, and is divided into a packet loss dye bit and a time delay dye bit, and is used for identifying whether a certain service message is used for packet loss statistics or time delay statistics.
The delay statistic function means that in a certain measurement period, the difference between the time when a specified service flow enters the network and the time when the specified service flow leaves the network is counted.
The time delay statistical function supported by the IP FPM means that the equipment samples the service message and records the actual forwarding time of the service message in the network, so as to calculate the transmission time delay of the specified service flow in the network. The implementation principle is shown in fig. 2.
Wherein, R1- > R2 direction:
at the time t 1: r1 is used for dyeing a time delay position 1 of a certain appointed entrance service message, and a time stamp t1 is obtained.
At the time t 2: after network forwarding and network delay, the exit of R2 starts to receive the service packet with the delay dyeing bit of 1, and obtains the timestamp t2.
R2- > R1 direction:
at time t 3: r2 is used for dyeing a time delay position 1 of a certain appointed entrance service message, and a time stamp t3 is obtained.
At the time t 4: after network forwarding and network delay, the outlet of the R1 starts receiving the service packet with the delay dyeing bit of 1, and obtains a timestamp t4.
The one-way time delays in the two directions are respectively: 1d (R1- > R2) = t2-t1,1d (R2- > R1) = t4-t3; the two-way time delay is: 2d = (t 2-t 1) + (t 4-t 3) = (t 4-t 1) - (t 3-t 2).
(II) Precision Time Protocol (PTP)
The PTP protocol exchanges synchronous messages between a master clock and a slave clock and records the receiving and sending time of the messages, the round-trip total delay between the master clock and the slave clock is calculated by calculating the round-trip time difference of the messages, if the network is symmetrical (namely the transmission delays in two directions are the same), the one-way transmission delay and the clock deviation between the two clocks can be simultaneously calculated, and the slave clock adjusts the local time according to the deviation, so that the synchronization with the master clock can be realized.
The PTP protocol extracts a message timestamp between a PHY (physical layer) and an MAC (media access control) through hardware support, and can greatly improve the timestamp precision, thereby realizing ns-level transmission delay calculation and time deviation calculation.
The PTP protocol message interaction process is shown in fig. 3:
(1) The master clock sends a Sync message to the slave clock and records the sending time t1; and after receiving the message from the clock, recording the receiving time t2.
(2) After the master clock sends the Sync message, it sends a Follow _ Up message carrying t1 (if the timestamp can be carried by the Sync message, it may not send the Follow _ Up message).
(3) The slave clock sends a Delay _ Req message to the master clock, is used for initiating the calculation of reverse transmission Delay and records the sending time t3; and after receiving the message, the master clock records the receiving time t4.
(4) After receiving the Delay _ Req message, the master clock replies a Delay _ Resp message carrying t4.
At this time, the slave clock has four time stamps t1 to t4, so that the total round-trip delay between the master clock and the slave clock is calculated to be [ (t 2-t 1) + (t 4-t 3) ], and the one-way delay between the master clock and the slave clock is calculated to be [ (t 2-t 1) + (t 4-t 3) ]/2 because the network is symmetrical. Thus, the clock skew of the slave clock relative to the master clock is: offset = (t 2-t 1) - [ (t 2-t 1) + (t 4-t 3) ]/2= [ (t 2-t 1) - (t 4-t 3) ]/2.
The prior art has the following defects:
the IPFPM latency detection technology is based on service detection, such as tunnel, VPN (virtual private network), IP flow, etc., so that relevant detection can be performed only after identifying a service, and the service identification needs to be processed in a network forwarding engine (NP), so that a timestamp can only be extracted through software, and the measurement accuracy is low, and only ms-level accuracy measurement can be achieved. The hardware timestamp extraction technology is implemented on the daughter card, and only simple logic processing (for example, judging whether a message is a PTP message) can be performed on the daughter card, but complicated service deployment and identification cannot be performed, so that the precision cannot be improved by hardware timestamp. And based on the detection of the service, the measurement is carried out after the service deployment, but the forwarding time delay of the service path cannot be obtained before the service deployment, so that the selection and the establishment of the service path are influenced by the time delay.
The PTP technique can measure the transmission delay between the master and slave clocks and the time deviation between the master and slave clocks, but cannot calculate the forwarding delay between any ports inside the device.
Disclosure of Invention
The technical problem to be solved by the invention is to provide a method and a device for calculating the port forwarding delay, which support the calculation of the internal forwarding delay of equipment between ports and cooperate with the transmission delay between the equipment which can be calculated by PTP, thereby calculating and maintaining the end-to-end delay data between any two ports of the whole network as the important reference condition for selecting the service path.
To solve the above technical problem, embodiments of the present invention provide the following technical solutions:
the embodiment of the invention provides a method for calculating port forwarding delay, which is applied to a first port and comprises the following steps:
the method comprises the steps that a first port sends a high-precision clock synchronization protocol loop PTPLoop message to a second port, and a destination network protocol address DIP address of the PTPLoop message is an IP address of the first port.
The embodiment of the invention provides a method for calculating port forwarding delay, which is applied to a second port and comprises the following steps:
the second port receives a high-precision clock synchronization protocol loop PTPLoop message sent by the first port, and extracts a first message timestamp corresponding to the receiving time;
the second port sends the PTPLoop message to the first port, and extracts a second message timestamp corresponding to the sending time;
and the second port reports the first message timestamp and the second message timestamp to a main controller.
Further, the destination network protocol address DIP of the PTPLoop packet is an IP address of the first port, and the sending, by the second port, the PTPLoop packet to the first port includes:
and the second port performs table look-up forwarding according to the DIP address in the PTPLoop message and sends the PTPLoop message to the first port.
Further, the reporting, by the second port, the first packet timestamp and the second packet timestamp to the host controller includes:
after extracting the first message timestamp, the second port reports the first message timestamp to the main controller; or
And after the second port extracts the timestamp of the first message, filling the timestamp of the first message into a corrigenfield field in the PTPLoop message, and after the timestamp of the second message is obtained, reporting the timestamp of the first message and the timestamp of the second message to the main controller.
The embodiment of the invention provides a method for calculating port forwarding time delay, which is applied to a main controller and comprises the following steps:
the main controller receives a first message timestamp and a second message timestamp reported by the second port;
and the main controller calculates the forwarding time delay between the first port and the second port according to the first message timestamp and the second message timestamp.
Further, the calculating, by the master controller, the forwarding delay between the first port and the second port according to the first packet timestamp and the second packet timestamp includes:
the main controller calculates the forwarding time delay T between different ports according to the following formula:
T=T1+T2+T3;
T2=t6-t5+T1;
wherein, T1 is a preset uplink forwarding delay, T2 is a downlink forwarding delay of each port, T3 is a preset inter-board forwarding delay, T6 is the timestamp of the second message, and T5 is the timestamp of the first message.
The embodiment of the invention provides a device for calculating the port forwarding delay, which is applied to a first port and comprises a transceiver and a processor,
the transceiver is used for sending a high-precision clock synchronization protocol loop (PTPLoop) message to a second port, and a destination network protocol address (DIP) address of the PTPLoop message is an IP address of the first port.
The embodiment of the invention provides a device for calculating the port forwarding delay, which is applied to a second port and comprises a transceiver and a processor,
the transceiver is used for receiving a high-precision clock synchronization protocol loop PTPLoop message sent by a first port and extracting a first message timestamp corresponding to the receiving time; sending the PTPLoop message to the first port, and extracting a second message timestamp corresponding to the sending time; and reporting the first message timestamp and the second message timestamp to a main controller.
Further, the destination network protocol address DIP address of the PTPLoop message is the IP address of the first port,
the transceiver is specifically configured to perform table lookup and forwarding according to the DIP address in the PTPLoop message, and send the PTPLoop message to the first port.
Further, the transceiver is specifically configured to report the timestamp of the first message to the main controller after extracting the timestamp of the first message; or
And after extracting the first message timestamp, filling the first message timestamp into a corrionfield field in the PTPLoop message, and after obtaining the second message timestamp, reporting the first message timestamp and the second message timestamp to the main controller.
The embodiment of the invention provides a device for calculating the port forwarding delay, which is applied to a main controller and comprises a transceiver and a processor,
the transceiver is used for receiving a first message timestamp and a second message timestamp reported by the second port;
and the processor is used for calculating the forwarding time delay between different ports according to the first message timestamp and the second message timestamp.
Further, the processor is specifically configured to calculate the forwarding delay T between different ports according to the following formula:
T=T1+T2+T3;
T2=t6-t5+T1;
wherein T1 is a preset uplink forwarding time delay, T2 is a downlink forwarding time delay of each port, T3 is a preset inter-board forwarding time delay, T6 is the second message timestamp, and T5 is the first message timestamp.
An embodiment of the present invention provides an apparatus for calculating a port forwarding delay, including: a memory, a processor and a computer program stored on the memory and executable on the processor, the computer program, when executed by the processor, implementing the steps in the method of calculating a port forwarding delay as described above.
An embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements the steps in the method for calculating a port forwarding delay as described above.
The embodiment of the invention has the following beneficial effects:
in the scheme, a first port sends a high-precision clock synchronization protocol loop (PTPLoop) message to a second port, a destination network protocol address (DIP) address of the PTPLoop message is an IP address of the first port, the second port receives the high-precision clock synchronization protocol loop (PTPLoop) message sent by the first port, a first message timestamp corresponding to a receiving moment is extracted, the second port sends the PTPLoop message to the first port, a second message timestamp corresponding to a sending moment is extracted, the second port reports the first message timestamp and the second message timestamp to a master controller, and the master controller calculates the forwarding delay between the first port and the second port according to the first message timestamp and the second message timestamp. According to the technical scheme, calculation of the internal forwarding time delay of the equipment between the ports is supported, and the transmission time delay between the equipment which can be calculated by matching PTP is matched, so that end-to-end time delay data between any two ports of the whole network can be calculated and maintained and serve as an important reference condition for service path selection.
Drawings
FIG. 1 is a schematic diagram of a statistical process for IP FPM;
FIG. 2 is a schematic diagram of an implementation principle of an IP FPM;
FIG. 3 is a diagram illustrating a PTP protocol message interaction process;
fig. 4 is a schematic flowchart of a method for calculating a port forwarding delay applied to a first port according to an embodiment of the present invention;
fig. 5 is a flowchart illustrating a method for calculating a port forwarding delay applied to a second port according to an embodiment of the present invention;
fig. 6 is a schematic flowchart of a method for calculating a port forwarding delay applied to a host controller according to an embodiment of the present invention;
fig. 7 is a schematic diagram of sending a PTPLoop packet according to an embodiment of the present invention;
fig. 8 is a schematic diagram of calculating forwarding delays between different ports according to an embodiment of the present invention;
FIG. 9 is a schematic structural diagram of a first port according to an embodiment of the present invention;
FIG. 10 is a schematic structural diagram of a second port according to the embodiment of the present invention;
fig. 11 is a schematic structural diagram of a main controller according to an embodiment of the present invention.
Detailed Description
In order to make the technical problems, technical solutions and advantages to be solved by the embodiments of the present invention clearer, the following detailed description will be given with reference to the accompanying drawings and specific embodiments.
The names and abbreviations of the terms related to the present invention may be changed correspondingly, and the technical solution of the present invention is still applicable when the abbreviations are changed.
The embodiment of the invention provides a method and a device for calculating port forwarding time delay, which support the calculation of the internal forwarding time delay of equipment among ports and are matched with PTP (precision time protocol) to calculate the transmission time delay among the equipment, so that end-to-end time delay data between any two ports of a whole network can be calculated and maintained and serve as an important reference condition for service path selection.
An embodiment of the present invention provides a method for calculating a port forwarding delay, which is applied to a first port, as shown in fig. 4, and includes:
step 101: the method comprises the steps that a first port sends a high-precision clock synchronization protocol loop PTPLoop message to a second port, and the destination network protocol address DIP address of the PTPLoop message is the IP address of the first port.
An embodiment of the present invention provides a method for calculating a port forwarding delay, which is applied to a second port, and as shown in fig. 5, the method includes:
step 201: the second port receives a high-precision clock synchronization protocol loop PTPLoop message sent by the first port, and extracts a first message timestamp corresponding to the receiving time;
step 202: the second port sends the PTPLoop message to the first port, and extracts a second message timestamp corresponding to the sending time;
step 203: and the second port reports the timestamp of the first message and the timestamp of the second message to a main controller.
Further, the sending, by the second port, the PTPLoop packet to the first port includes:
and the second port performs table look-up forwarding according to the DIP address in the PTPLoop message and sends the PTPLoop message to the first port.
Further, the reporting, by the second port, the first packet timestamp and the second packet timestamp to the host controller includes:
after the second port extracts the first message timestamp, reporting the first message timestamp to the main controller; or
And after extracting the first message timestamp, the second port fills the first message timestamp into a correctionfield field in the PTPLoop message, and after obtaining the second message timestamp, reports the first message timestamp and the second message timestamp to the main controller.
An embodiment of the present invention provides a method for calculating a port forwarding delay, which is applied to a host controller, as shown in fig. 6, and includes:
step 301: the main controller receives a first message timestamp and a second message timestamp reported by the second port;
step 302: and the main controller calculates the forwarding time delay between the first port and the second port according to the first message timestamp and the second message timestamp.
Further, the calculating, by the master controller, the forwarding delay between the first port and the second port according to the first packet timestamp and the second packet timestamp includes:
the main controller calculates the forwarding time delay T between different ports according to the following formula:
T=T1+T2+T3;
T2=t6-t5+T1;
wherein, T1 is a preset uplink forwarding delay, T2 is a downlink forwarding delay of each port, T3 is a preset inter-board forwarding delay, T6 is the timestamp of the second message, and T5 is the timestamp of the first message.
In this embodiment, a first port sends a high-precision clock synchronization protocol loop (PTPLoop) message to a second port, a destination network protocol address (DIP) address of the PTPLoop message is an IP address of the first port, the second port receives the PTPLoop message sent by the first port, a first message timestamp corresponding to a receiving time is extracted, the second port sends the PTPLoop message to the first port, a second message timestamp corresponding to a sending time is extracted, the second port reports the first message timestamp and the second message timestamp to a master controller, and the master controller calculates a forwarding delay between the first port and the second port according to the first message timestamp and the second message timestamp. According to the technical scheme, calculation of the internal forwarding time delay of the equipment between the ports is supported, and the transmission time delay between the equipment which can be calculated by matching PTP is matched, so that end-to-end time delay data between any two ports of the whole network can be calculated and maintained and serve as an important reference condition for service path selection.
The method for calculating port forwarding delay of the present invention is further described with reference to the following drawings and specific embodiments:
step 1, as shown in fig. 7, a first port configured with PTP sends a PTPLoop message to a second port, where the message is UDP (user datagram protocol) encapsulation, and a DIP in an IP header is an IP address of the first port.
The format of the PTPLoop message is shown in the following table, where a messageType =8 is newly defined as the PTPLoop message:
Figure BDA0001937133850000101
the message sending method comprises the steps of transmitting specific information in a transmission format, using a message type as a message type, using reserved bits as reserved bits, using a version PTP as a version PTP (precision time protocol), using message length as a message length, using domain number as a domain name number, using a flagField to mark a domain, using corrigenField as a correction domain, using sourcePortIdentity as a source port identification, using sequence ID as a sequence identification, using a control Field as a control domain, and using logMessageInterval to define the sending interval of the message.
And 2, after receiving the PTPLoop message, an opposite port (namely a second port) configured with the PTP extracts a timestamp t5 of the message, and after judging that the message type is the PTP message, fills the timestamp t5 into a corestrionefield field of the PTP message.
And 3, looking up a table on NP for forwarding according to DIP of the PTP message, obtaining a downlink single board and a port according to the table look-up of the DIP, sending the message to a target single board by the exchange board, and extracting a timestamp t6 at an outlet, wherein the outlet port and the inlet port of the DIP are the same as each other because the DIP is the IP address of the first port.
And 4, the daughter card sends the time stamps T5 and T6 to the main controller, and the downlink forwarding time delay T2 of the port is calculated.
Step 5, as shown in fig. 8, according to the previously preset inter-board forwarding delay T3, calculating the inter-port forwarding delay T = T1 (ingress port uplink delay) + T2 (egress port downlink delay) + T3 (inter-board forwarding delay).
The uplink forwarding time delay T1 is a fixed value and is given according to the product implementation; the inter-board forwarding time delay T3 is a fixed value and is given according to product implementation; and according to T6 and T5 obtained by detecting the message, obtaining the downlink forwarding time delay T2= T6-T5-T1 of each port. The forwarding delay between different ports is T1 (input port) + T2 (output port) + T3.
In this embodiment, DIP is a PTP message of the IP of the local port, and is sent to the opposite terminal, the message is returned from the source port by checking the routing table at the opposite terminal, and the ingress direction and the egress direction of the message are respectively stamped with a time stamp, so that the uplink and downlink forwarding delay of the local port can be calculated. Wherein, SIP (source IP) and DIP of PTP message encapsulation finish the packet package according to the configuration on the daughter card, newly-increased delay measurement message is according to port IP, finish the message encapsulation on the daughter card, the message DIP is the IP of this port
The PTP requires deployment in the whole network, and PTP protocols are configured on all service ports, so that the node device can obtain the downlink forwarding delay T2 of all service ports by this method, and thus can calculate the uplink and downlink forwarding delay T = T1 (uplink delay at the ingress port) + T2 (downlink delay at the egress port) + T3 (forwarding delay between boards) between any two ports.
The embodiment of the present invention provides an apparatus for calculating port forwarding delay, which is applied to a first port, as shown in fig. 9, and includes a transceiver 12 and a processor 11,
the transceiver 12 is configured to send a high-precision clock synchronization protocol loop PTPLoop message to the second port, where a destination network protocol address DIP address of the PTPLoop message is an IP address of the first port.
An embodiment of the present invention provides an apparatus for calculating a port forwarding delay, which is applied to a second port, as shown in fig. 10, and includes a transceiver 22 and a processor 21,
the transceiver 22 is configured to receive a high-precision clock synchronization protocol loop PTPLoop message sent by a first port, and extract a timestamp of a first message corresponding to a receiving time; sending the PTPLoop message to the first port, and extracting a second message timestamp corresponding to the sending time; and reporting the timestamp of the first message and the timestamp of the second message to a main controller.
Further, the destination network protocol address DIP address of the PTPLoop message is the IP address of the first port,
the transceiver 22 is specifically configured to perform table lookup and forwarding according to the DIP address in the PTPLoop message, and send the PTPLoop message to the first port.
Further, the transceiver 22 is specifically configured to report the first message timestamp to the main controller after extracting the first message timestamp; or
And after extracting the first message timestamp, filling the first message timestamp into a corrionfield field in the PTPLoop message, and after obtaining the second message timestamp, reporting the first message timestamp and the second message timestamp to the main controller.
An embodiment of the present invention provides an apparatus for calculating port forwarding delay, which is applied to a host controller, as shown in fig. 11, and includes a transceiver 32 and a processor 31,
the transceiver 32 is configured to receive a first message timestamp and a second message timestamp reported by the second port;
the processor 31 is configured to calculate forwarding delays between different ports according to the timestamp of the first packet and the timestamp of the second packet.
Further, the processor 31 is specifically configured to calculate the forwarding delay T between different ports according to the following formula:
T=T1+T2+T3;
T2=t6-t5+T1;
wherein, T1 is a preset uplink forwarding delay, T2 is a downlink forwarding delay of each port, T3 is a preset inter-board forwarding delay, T6 is the timestamp of the second message, and T5 is the timestamp of the first message.
In this embodiment, a first port sends a high-precision clock synchronization protocol loop (PTPLoop) message to a second port, a destination network protocol address (DIP) address of the PTPLoop message is an IP address of the first port, the second port receives the PTPLoop message sent by the first port, a first message timestamp corresponding to a receiving time is extracted, the second port sends the PTPLoop message to the first port, a second message timestamp corresponding to a sending time is extracted, the second port reports the first message timestamp and the second message timestamp to a master controller, and the master controller calculates a forwarding delay between the first port and the second port according to the first message timestamp and the second message timestamp. The technical scheme of the invention supports the calculation of the internal forwarding time delay of the equipment between the ports, and is matched with the transmission time delay between the equipment which can be calculated by PTP, thereby calculating and maintaining the end-to-end time delay data between any two ports of the whole network as the important reference condition for selecting the service path.
An embodiment of the present invention provides an apparatus for calculating a port forwarding delay, including: a memory, a processor and a computer program stored on the memory and executable on the processor, the computer program, when executed by the processor, implementing the steps in the method of calculating a port forwarding delay as described above.
An embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements the steps in the method for calculating a port forwarding delay as described above.
It is to be understood that the embodiments described herein may be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For a hardware implementation, the Processing units may be implemented within one or more Application Specific Integrated Circuits (ASICs), digital Signal Processors (DSPs), digital Signal Processing Devices (DSPDs), programmable Logic Devices (PLDs), field Programmable Gate Arrays (FPGAs), general purpose processors, controllers, micro-controllers, microprocessors, other electronic units configured to perform the functions described herein, or a combination thereof.
For a software implementation, the techniques described herein may be implemented with modules (e.g., procedures, functions, and so on) that perform the functions described herein. The software codes may be stored in a memory and executed by a processor. The memory may be implemented within the processor or external to the processor.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
As will be appreciated by one of skill in the art, embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, embodiments of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
Embodiments of the present invention are described with reference to flowchart illustrations and/or block diagrams of methods, user equipment (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications of these embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the embodiments of the invention.
It is further noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "include", "including" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or user equipment including a series of elements includes not only those elements but also other elements not explicitly listed or inherent to such process, method, article, or user equipment. Without further limitation, an element defined by the phrases "comprising one of \ 8230; \8230;" does not exclude the presence of additional like elements in a process, method, article, or user device that comprises the element.
While the foregoing is directed to the preferred embodiment of the present invention, it will be appreciated by those skilled in the art that various changes and modifications may be made therein without departing from the spirit and scope of the invention as defined in the appended claims.

Claims (12)

1. A method for calculating port forwarding delay is applied to a first port, and comprises the following steps:
a first port sends a high-precision clock synchronization protocol loop (PTPLoop) message to a second port, wherein a destination network protocol address (DIP) address of the PTPLoop message is an IP address of the first port;
the timestamp of a first message corresponding to the arrival of the high-precision clock synchronization protocol loop PTPLoop message at a second port is used for calculating the forwarding time delay between the first port and the second port;
the main controller calculates the forwarding time delay T between different ports according to the following formula:
t = T1+ T2+ T3; t2= T6-T5+ T1; wherein, T1 is a preset uplink forwarding time delay, T2 is a downlink forwarding time delay of each port, T3 is a preset inter-board forwarding time delay, T6 is a second message timestamp, and T5 is the first message timestamp; and the timestamp of the second message is the sending time corresponding to the second port sending the PTPLoop message to the first port.
2. A method for calculating port forwarding delay is applied to a second port, and comprises the following steps:
the second port receives a high-precision clock synchronization protocol loop PTPLoop message sent by the first port, and extracts a first message timestamp corresponding to the receiving time;
the second port sends the PTPLoop message to the first port, and a second message timestamp corresponding to the sending time is extracted;
the second port reports the first message timestamp and the second message timestamp to the main controller, and the first message timestamp and the second message timestamp are used for calculating the forwarding time delay between the first port and the second port;
the main controller calculates the forwarding time delay T between different ports according to the following formula:
t = T1+ T2+ T3; t2= T6-T5+ T1; wherein T1 is a preset uplink forwarding time delay, T2 is a downlink forwarding time delay of each port, T3 is a preset inter-board forwarding time delay, T6 is the second message timestamp, and T5 is the first message timestamp; and the second message timestamp is the sending time corresponding to the PTPLoop message sent to the first port by the second port.
3. The method according to claim 2, wherein the destination network protocol address DIP of the PTPLoop packet is an IP address of the first port, and the sending of the PTPLoop packet to the first port by the second port comprises:
and the second port performs table look-up forwarding according to the DIP address in the PTPLoop message and sends the PTPLoop message to the first port.
4. The method according to claim 2, wherein the reporting, by the second port, the first packet timestamp and the second packet timestamp to the host controller comprises:
after the second port extracts the first message timestamp, reporting the first message timestamp to the main controller; or
And after extracting the first message timestamp, the second port fills the first message timestamp into a correctionfield field in the PTPLoop message, and after obtaining the second message timestamp, reports the first message timestamp and the second message timestamp to the main controller.
5. A method for calculating port forwarding delay is applied to a main controller, and comprises the following steps:
the main controller receives a first message timestamp and a second message timestamp reported by a second port;
the main controller calculates the forwarding time delay between the first port and the second port according to the first message timestamp and the second message timestamp;
the main controller calculates the forwarding time delay T between different ports according to the following formula:
t = T1+ T2+ T3; t2= T6-T5+ T1; wherein, T1 is a preset uplink forwarding delay, T2 is a downlink forwarding delay of each port, T3 is a preset inter-board forwarding delay, T6 is the timestamp of the second message, and T5 is the timestamp of the first message; the second message timestamp is the sending time corresponding to the second port sending the PTPLoop message to the first port.
6. The device for calculating the port forwarding time delay is applied to a first port and comprises a transceiver and a processor,
the transceiver is used for sending a high-precision clock synchronization protocol loop PTPLoop message to a second port, and a destination network protocol address DIP address of the PTPLoop message is an IP address of the first port;
the timestamp of a first message corresponding to the arrival of the high-precision clock synchronization protocol loop PTPLoop message at a second port is used for calculating the forwarding time delay between the first port and the second port;
the main controller calculates the forwarding time delay T between different ports according to the following formula:
t = T1+ T2+ T3; t2= T6-T5+ T1; wherein, T1 is a preset uplink forwarding delay, T2 is a downlink forwarding delay of each port, T3 is a preset inter-board forwarding delay, T6 is a second message timestamp, and T5 is the first message timestamp; and the second message timestamp is the sending time corresponding to the PTPLoop message sent to the first port by the second port.
7. The device for calculating the port forwarding time delay is applied to a second port and comprises a transceiver and a processor,
the transceiver is used for receiving a high-precision clock synchronization protocol loop PTPLoop message sent by a first port and extracting a first message timestamp corresponding to the receiving time; sending the PTPLoop message to the first port, and extracting a second message timestamp corresponding to the sending time; reporting the first message timestamp and the second message timestamp to a main controller, wherein the first message timestamp and the second message timestamp are used for calculating the forwarding time delay between a first port and a second port;
the main controller calculates the forwarding time delay T between different ports according to the following formula:
t = T1+ T2+ T3; t2= T6-T5+ T1; wherein T1 is a preset uplink forwarding time delay, T2 is a downlink forwarding time delay of each port, T3 is a preset inter-board forwarding time delay, T6 is the second message timestamp, and T5 is the first message timestamp; the second message timestamp is the sending time corresponding to the second port sending the PTPLoop message to the first port.
8. The apparatus according to claim 7, wherein the destination network protocol address DIP address of the PTPLoop packet is the IP address of the first port,
the transceiver is specifically configured to perform table lookup and forwarding according to the DIP address in the PTPLoop message, and send the PTPLoop message to the first port.
9. The apparatus for calculating port forwarding delay of claim 7,
the transceiver is specifically configured to report the first packet timestamp to the main controller after extracting the first packet timestamp; or
And after extracting the timestamp of the first message, filling the timestamp of the first message into a corrigenfield field in the PTPLoop message, and after obtaining the timestamp of the second message, reporting the timestamp of the first message and the timestamp of the second message to the main controller.
10. The device for calculating the port forwarding delay is applied to a main controller and comprises a transceiver and a processor,
the transceiver is used for receiving a first message timestamp and a second message timestamp reported by a second port;
the processor is used for calculating the forwarding time delay among different ports according to the first message timestamp and the second message timestamp;
the main controller calculates the forwarding time delay T between different ports according to the following formula:
t = T1+ T2+ T3; t2= T6-T5+ T1; wherein T1 is a preset uplink forwarding time delay, T2 is a downlink forwarding time delay of each port, T3 is a preset inter-board forwarding time delay, T6 is the second message timestamp, and T5 is the first message timestamp; the second message timestamp is the sending time corresponding to the second port sending the PTPLoop message to the first port.
11. An apparatus for calculating port forwarding delay, comprising: memory, a processor and a computer program stored on the memory and executable on the processor, the computer program, when executed by the processor, implementing the steps in the method of calculating a port forwarding delay as claimed in any one of claims 1 to 5.
12. A computer-readable storage medium, having stored thereon a computer program which, when executed by a processor, implements the steps in the method of calculating port forwarding delay of any of claims 1 to 5.
CN201910010654.5A 2019-01-07 2019-01-07 Method and device for calculating port forwarding time delay Active CN111416751B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910010654.5A CN111416751B (en) 2019-01-07 2019-01-07 Method and device for calculating port forwarding time delay

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910010654.5A CN111416751B (en) 2019-01-07 2019-01-07 Method and device for calculating port forwarding time delay

Publications (2)

Publication Number Publication Date
CN111416751A CN111416751A (en) 2020-07-14
CN111416751B true CN111416751B (en) 2023-01-03

Family

ID=71492586

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910010654.5A Active CN111416751B (en) 2019-01-07 2019-01-07 Method and device for calculating port forwarding time delay

Country Status (1)

Country Link
CN (1) CN111416751B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112152946B (en) * 2020-09-25 2022-09-23 苏州盛科通信股份有限公司 Delay processing method and system based on message forwarding path
CN114697202B (en) * 2020-12-31 2023-09-29 华为技术有限公司 Detection method and device
CN113644998B (en) * 2021-08-23 2023-06-09 烽火通信科技股份有限公司 IOAM time delay measuring method and device for 5G network

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101692632A (en) * 2009-09-08 2010-04-07 华为技术有限公司 Method and device for supporting transmission clock
CN102082697A (en) * 2009-11-27 2011-06-01 华为技术有限公司 Communication path asymmetric time delay measuring method, device and system
EP2333993A1 (en) * 2009-12-09 2011-06-15 Alcatel Lucent Automatic management of timestamp-based synchronisation protocols
CN103607267A (en) * 2013-07-23 2014-02-26 王健 End-to-end transmission delay carrying measurement method of data network message
CN106254182A (en) * 2016-08-31 2016-12-21 北京信而泰科技股份有限公司 A kind of time synchronism apparatus of IP network tester

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101692632A (en) * 2009-09-08 2010-04-07 华为技术有限公司 Method and device for supporting transmission clock
CN102082697A (en) * 2009-11-27 2011-06-01 华为技术有限公司 Communication path asymmetric time delay measuring method, device and system
EP2333993A1 (en) * 2009-12-09 2011-06-15 Alcatel Lucent Automatic management of timestamp-based synchronisation protocols
CN103607267A (en) * 2013-07-23 2014-02-26 王健 End-to-end transmission delay carrying measurement method of data network message
CN106254182A (en) * 2016-08-31 2016-12-21 北京信而泰科技股份有限公司 A kind of time synchronism apparatus of IP network tester

Also Published As

Publication number Publication date
CN111416751A (en) 2020-07-14

Similar Documents

Publication Publication Date Title
US9667370B2 (en) Communication device with peer-to-peer assist to provide synchronization
CN111416751B (en) Method and device for calculating port forwarding time delay
US10158444B1 (en) Event-driven precision time transfer
US9698926B2 (en) Distributed two-step clock
US10439748B1 (en) Time correction using extension fields
CN107113236B (en) Transmitting residence time information in a network
CN101425891B (en) Time synchronization method, system and customer terminal
US9882666B2 (en) Time synchronization for network testing equipment
KR102031268B1 (en) Method and apparatus for communicating time information between time-aware devices
US7372846B2 (en) Method for transmitting time information via a data packet network
CN102833062B (en) Intelligent substation IEEE1588 master-salve clock synchronization message setting means and system
KR101597255B1 (en) Performing a time measurement in a communication network
US8166216B1 (en) Floating frame timing circuits for network devices
TW201921892A (en) Indirect packet classification timestamping system and method
US9876596B2 (en) Method and device for detecting fault in synchronization link
WO2010057398A1 (en) Device and method for implementing clock transparent transmission
EP2288070A1 (en) Time synchronizing method, device and system of master clock side and slave clock side in synchronous network
CN111385048A (en) Time synchronization method and system
CA2652594A1 (en) Network time protocol precision timestamping service
CN101494613A (en) Method for clock message tunnel transmission, network node and communication system
EP1290839A2 (en) Method for ensuring access to a transmission medium
CN103067112A (en) Clock synchronization method and device and network equipment
WO2016177065A1 (en) Delay measurement method and device
CN107294633A (en) Method for synchronizing time and device
EP2458757B1 (en) A method for transmitting IEEE 1588V2 synchronization packets over ethernet in link-by-link mode, via network elements having a transparent clock, and associated help device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant