WO2020132834A1 - Method and device for stamping processing - Google Patents

Method and device for stamping processing Download PDF

Info

Publication number
WO2020132834A1
WO2020132834A1 PCT/CN2018/123226 CN2018123226W WO2020132834A1 WO 2020132834 A1 WO2020132834 A1 WO 2020132834A1 CN 2018123226 W CN2018123226 W CN 2018123226W WO 2020132834 A1 WO2020132834 A1 WO 2020132834A1
Authority
WO
WIPO (PCT)
Prior art keywords
ptp
timestamp
network node
target
lane
Prior art date
Application number
PCT/CN2018/123226
Other languages
French (fr)
Chinese (zh)
Inventor
林涛
刘永志
史永杰
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Priority to CN201880100455.7A priority Critical patent/CN113228564B/en
Priority to PCT/CN2018/123226 priority patent/WO2020132834A1/en
Publication of WO2020132834A1 publication Critical patent/WO2020132834A1/en

Links

Images

Classifications

    • 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
    • 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/0685Clock or time synchronisation in a node; Intranode synchronisation
    • H04J3/0697Synchronisation in a packet node
    • 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
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/10Active monitoring, e.g. heartbeat, ping or trace-route
    • H04L43/106Active monitoring, e.g. heartbeat, ping or trace-route using time related information in packets, e.g. by adding timestamps

Definitions

  • the present application relates to the field of communication technology, and in particular, to a stamping processing method and device.
  • Ethernet ports that need to support precise time synchronization (PTP) protocols is also getting higher and higher, such as 100 gigabit Ethernet (GE), 200GE, and 400GE.
  • PTP time synchronization
  • the current single data path (lane) Ethernet port is no longer sufficient to support the deployment of PTP protocol functions, and the PTP protocol function needs to be deployed on multiple lane Ethernet ports.
  • lane Ethernet ports use PTP packets to measure the delay between two network nodes, for the sending direction, the PTP protocol requires that multiple lanes of the same Ethernet port must be aligned, that is, multiple lanes of the same Ethernet port are shot at the same time.
  • the timestamp value of multiple PTP messages is the same, and is affected by the transmission environment of multiple lanes, such as the optical transmission of multiple lanes. Multiple lanes cannot guarantee the same delay. Therefore, the PTP protocol defines that In the direction, it is necessary to align the timestamp values of the timestamps of multiple lanes to receive PTP packets to the same reference lane.
  • the currently defined reference lane is the lane with the longest delay.
  • the network node performs delay difference alignment on the PTP message received by each lane of the Ethernet port through a delay difference alignment buffer (deskew fifo), where the fifo refers to a first-in first-out buffer (first input)
  • the network node caches the PTP messages received by each lane through deskewfifo, and then reads out the cached PTP messages received by each lane through deskewfifo, so as to realize the PTP messages received by each lane
  • the delay difference is aligned.
  • the network node generates a timestamp for receiving the PTP message according to the difference between the read time of the PTP message received by each lane and the length of the PTP message buffered in deskew fifo.
  • the delay of the lane relative to the reference lane compensates the timestamp value of the timestamp of multiple lanes receiving PTP packets to the timestamp value of the timestamp of the baseline lane receiving PTP packets, in order to delay the network nodes Take measurements.
  • asynchronous deskew fifo may occur in various scenarios. For example, when multi-rate Ethernet ports are mixed with the same set of media access control (MAC) logic, deskew fifo writes PTP in the Ethernet ports of network nodes
  • the write clock (wr_clk) followed by the message is different from the read clock (rd_clk) followed by the PTP message. It is an asynchronous deskew fifo.
  • the PTP message crosses the clock domain during the deskew fifo process. Because of the wr_clk and rd_clk Different frequencies and/or phases result in inaccurate timestamps generated by network nodes to receive PTP messages.
  • the time that the network node writes PTP message 1 in deskew fifo according to wr_clk is 19:23:1.02 seconds on November 23, 2018 because of the frequency of rd_clk and wr_clk Different from the phase, the duration of deskew fifo cached PTP message 1 read by the network node is 0.1 seconds, and the time of deskew fifo read PTP message 1 is 19:23:1.13 seconds on November 23, 2018, resulting in The calculated time stamp value of PTP packet 1 is 19:23:1.03 seconds on November 23, 2018, and there is an error from 19:23:1.02 seconds on November 23, 2018, which leads to a gap between network nodes Delay measurement is not accurate.
  • the present application provides a stamping processing method and device to solve the problem of inaccurate delay measurement between network nodes due to inaccurate stamping processing in the prior art.
  • the present application provides a method for processing a stamp.
  • the method may be implemented by a network node.
  • the method includes: the network node respectively punches a plurality of PTP messages received by an Ethernet port into a first time stamp; wherein, The Ethernet port has multiple lanes, and the multiple PTP packets are received by the network node through the multiple lanes; after the multiple PTP packets cross the clock domain, the network node sends all The first timestamp value of the first timestamp respectively entered in the multiple PTP messages is updated to the target timestamp value corresponding to the target PTP message in the multiple PTP messages; wherein, the target PTP message It is a PTP message received by a target lane among the multiple lanes, where the target lane is the lane with the shortest delay or the lane with the longest delay; the network node according to the target timestamp value and the multiple PTPs The difference between the time stamp value of the sending time stamp of the message determines the delay between the network node and the network node that
  • the network node performs a stamp before the PTP message received by each lane of the Ethernet port crosses the clock domain, that is, before the PTP message received by each lane is written to deskewfifo, and the multiple PTP messages After crossing the clock domain, that is, when deskew fifo outputs the multiple PTP messages, the time stamp value of the PTP message received by each lane is compensated to the time stamp value of the PTP message received by the specified target lane
  • To achieve delay difference alignment avoid errors caused by asynchronous deskew fifo, improve the accuracy of stamping processing, and ensure the accuracy of delay determination between network nodes; at the same time, because the stamping occurs when PTP messages are written to deskew fifo Previously, there was no need for deskew fifo's write clock and read clock to maintain a consistent or multiple relationship, thereby enabling Ethernet ports of different rates to share a set of stamping processing logic, and each Ethernet port supports high-precision stamping processing. It also improves the scope of application of the
  • each of the PTP packets received by the network node into the Ethernet port has a first timestamp, including: the first time stamp of the plurality of PTP packets received by the network node on the Ethernet port One bit (bit) is entered into the first time stamp.
  • each of the PTP packets received by the network node with a first timestamp includes: a setting of the plurality of PTP packets received by the Ethernet port by the network node Enter a first timestamp for a fixed bit; the network node determines that the multiple PTP packets correspond to the first one based on the distance between the set bit and the first bit respectively The first transmission time from bit to the set bit; the network node corrects the first timestamp value of the first timestamp into the plurality of PTP packets, and corrects it to the first timestamp value and the The difference in the first transmission duration corresponding to the PTP packet.
  • the stamping scheme of the network node is enriched, and it is convenient to select a suitable stamping scheme according to the network environment in which the network node is located.
  • the network node respectively inserts a first timestamp into a plurality of PTP messages received by the Ethernet port, including: the network node according to the measurement period, according to the current measurement period The respective time stamps corresponding to the lanes, and the first timestamps are respectively entered into the multiple PTP packets received by the Ethernet port; the network node respectively corresponds to the target of the first timestamps based on the multiple PTP packets the distance between the bit and the first bit to determine the second transmission duration of the multiple PTP packets corresponding to the first bit to the target bit with the first timestamp respectively; the network node reports the multiple PTP packets The first timestamp value of the first timestamp is respectively entered in the text and corrected to the difference between the first timestamp value and the second transmission time length corresponding to the PTP message.
  • the stamping scheme of the network node is enriched, and it is convenient to select a suitable stamping scheme according to the network environment in which the network node is located.
  • the first timestamp values of the first timestamps in the plurality of PTP messages are updated to the targets corresponding to the target PTP messages in the plurality of PTP messages
  • the timestamp value includes: the time difference between the first timestamp value entered by the network node according to the first timestamp in the plurality of PTP packets and the delay of the lane receiving the PTP packet relative to the target lane And, update the first timestamp value of the first timestamp respectively entered in the multiple PTP packets; wherein the delay difference of multiple lanes relative to the target lane is based on ,
  • the second timestamp value of the second timestamp is entered into the set bit of the PTP message received by the target lane, and the second timestamp is entered into the set bit of the PTP message received by the multiple lanes, respectively
  • the difference of the second timestamp value is determined. In this way, there is no need to identify the target PTP message each time the stamping process is performed, which simplifies the process of the stamping process.
  • the process of determining the target lane includes: when the network node establishes a link with the Ethernet port, the third time when the multiple PTP messages received by the Ethernet port are respectively entered into the network node In the third time stamp value of the time stamp, the lane corresponding to the target PTP packet with the maximum time stamp value or the target PTP packet with the minimum time stamp value is determined as the target lane. In this way, it helps to accurately determine the target lane and helps to ensure the accuracy of the stamping process.
  • the present application provides a stamping processing device that has the function of implementing the above-described first aspect and any possible design method.
  • the function can be realized by hardware, or can also be realized by hardware executing corresponding software.
  • the hardware or software includes one or more modules corresponding to the above functions.
  • the device may be a chip or an integrated circuit.
  • the device includes a transceiver and a processor, and the processor is used to execute a set of programs.
  • the device may execute the above-mentioned first aspect and any of the possible designs. method.
  • the device further includes a memory for storing the program executed by the processor.
  • the device is a network node.
  • the present application provides a computer storage medium that stores a computer program, the computer program including instructions for performing the method of the first aspect or any one of the possible designs in the first aspect.
  • the present application provides a computer program product containing instructions that, when run on a network node, cause the network node to perform the method in the first aspect or any possible design of the first aspect.
  • a chip is provided, the chip being connected to a memory for reading and executing a software program stored in the memory to implement the first aspect or any possible design of the first aspect Methods.
  • FIG. 1 is a schematic diagram of a delay request response mechanism in an embodiment of this application
  • FIG. 2 is a schematic diagram of the deskew fifo mechanism of lane in the embodiment of the present application
  • FIG. 3A is a first schematic diagram of the communication system architecture in the embodiment of the present application.
  • 3B is a second schematic diagram of the communication system architecture in the embodiment of the present application.
  • FIG. 4 is a third schematic diagram of the communication system architecture in the embodiment of the present application.
  • FIG. 5 is a schematic diagram of a stamping process in an embodiment of this application.
  • FIG. 6 is a schematic structural diagram of a network node in an embodiment of this application.
  • FIG. 7 is a second structural diagram of a network node in an embodiment of this application.
  • the present application provides a method and device for stamping processing to improve the accuracy of stamping processing to ensure the accuracy of delay measurement between network nodes.
  • the method and equipment are based on the same invention concept. Due to the method and equipment The principle of solving the problem is similar, so the implementation of the device and method can refer to each other, and the repetition is not repeated here.
  • the embodiments of the present invention relate to network nodes.
  • a network system composed of independent but interconnected computers, workstations, servers, terminals, network devices, etc.
  • each device with its own unique network address can be called a network node.
  • the network nodes may be switches, routers, computers, tablet computers, PDAs, mobile phones, and so on.
  • PTP protocol is issued by Institute of Electrical and Electronic Engineers (IEEE), also known as IEEE1588 protocol, which is used to synchronize the clocks of network nodes in the network.
  • IEEE1588 protocol also known as IEEE1588 protocol.
  • the time delay between the two network nodes is measured by time stamping t1, t2, t3 and t4 on the sending and receiving positions of the two network nodes in the Ethernet port respectively.
  • the slave node sends the synchronization message (sync) t1 timestamp according to the master node, the slave node receives the sync t2 timestamp, and the slave node sends a delay request message (delay_request )'S t3 timestamp, the master node receives the delay_request t4 timestamp to determine the delay between the master node and the slave node.
  • delay_request delay request message
  • the master After the master sends sync, it will record the sync sending timestamp (t1 timestamp) following message (follow_up) is sent to the slave node.
  • the delay request response message (delay_respone) carries the t4 timestamp of the master node receiving delay_request sent by the slave node.
  • the delay (path) between master and slave is (t2-t1) or (t4-t3), and the average delay (mean path) is [(t2-t1)+(t4-t3)]/ 2 or [(t2-t3)+(t4-t1)]/2, usually, in order to ensure the accuracy of delay measurement, mean time path delay is often used in delay measurement.
  • the time stamp values of the time stamps of the PTP messages received by multiple lanes are compensated to the time stamp values of the time stamps of the PTP messages received on the reference lane
  • the timestamp of any lane receiving PTP message can be used as the timestamp of receiving PTP message when measuring the delay.
  • Time stamp also called timestamp
  • Timestamp is usually a sequence of characters that uniquely identifies the time of a certain moment.
  • the time stamp value involved in this application is the time of a certain moment identified by the time stamp, such as November 2018 17:45:32 on the 23rd.
  • the transmission time of the PTP message and the reception time of the PTP message refers to the time of sending the first bit of the PTP message; the reception time of the PTP message, also known as the PTP message.
  • the arrival time of the message refers to the time to receive the first bit of the PTP message.
  • the deskew of the lane refers to aligning the PTP messages received by multiple lanes according to the lane with the longest delay.
  • the serial data stream to be transmitted is 123456789, and three lanes are established at the transmitting (transport, tx) end and the receiving (receive, rx) end, respectively lane 0, lane 1 and lane 2, corresponding to lane 0.
  • Send data that is, PTP message is 147, tx data corresponding to lane1 is 258, tx data corresponding to lane2 is 369, lane0, lane1 and lane2 at the tx end send PTP messages 147, 258 and 369, tx at the same time Timestamping events at the end and at the rx end occur on the first bit of the PTP message, for example, the first bit "2" of the PTP message 258.
  • the rx end receives PTP packets 147, 258, and 369 on lane0, lane1, and lane2, respectively.
  • the rx end receives PTP messages on lane0, lane1, and lane2.
  • the reception time of the text is different.
  • the rx end writes the PTP received by each lane to deskewfifo, and caches the received PTP message through deskewfifo. deskewfifo will receive the PTP message for each lane that has received the PTP message.
  • the time is aligned with the receiving time of the latest PTP packet received by the lane. As shown in FIG. 2, the latest received PTP message is lane2, and the reception time of each lane to receive the PTP message is aligned with the reception time of lane2 to receive the PTP message.
  • the deskew fifo of the lane can also calculate the delay difference between the lanes. For example, the sending time of each lane’s PTP message is 0, then the receiving time of each lane’s PTP message is the lane’s time. linkdelay.
  • the implementation of deskew fifo will cause the buffer delay of each lane to increase by 3, which is caused by the deskew fifo implementation and needs to be eliminated.
  • FIG. 3A is a communication system architecture applicable to a stamping process provided by an embodiment of the present application.
  • the communication system includes: a network node 1 and a network node 2, and an Ethernet port 1 of the network node 1 passes
  • the physical media dependent layer interface (PMD) of the network node 1 establishes a link via the PMD of the network node 2 and the Ethernet port of the network node 2, as shown in FIG. 3A, the network node 1 and the network node 2 are established together From 0 to N, there are N+1 lanes in total.
  • the Ethernet ports of the network nodes include: MAC, physical coding layer (PCS), physical media connection layer (physical medium attachment, PMA).
  • the path between network node 1 and network node 2 is (t2-t1-cf1) or (t4-t3-cf2), and the mean path delay is [(t2-t1-CF1)+(t4 -t3-CF2)]/2 or [(t2-t3)+(t4-t1)–(CF1+CF2)]/2, where cf1 is the transmission of PTP report between network node 1 and network node 2 caused by tcnode The delay caused by the text (sync), cf2 is the delay caused by the transmission of the PTP message (delay_request) between the network node 1 and the network node 2 caused by tcnode.
  • FIG. 3A taking network node 1 as the tx end and network node 2 as the rx end, perform one on the N+1 lanes established between Ethernet port 1 and Ethernet port 2 of network node 1 and network node 2 Take the stamping process of sending and receiving PTP packets (such as sync, delay_request, etc.) as an example to illustrate, where the number of PTP packets in one beat is the same as the number of lanes, and each lane transmits one in the same beat PTP message.
  • PTP packets such as sync, delay_request, etc.
  • Ethernet port 1 of network node 1 simultaneously sends PTP messages on lane 0 ⁇ N, each lane sends a PTP message, and generates a transmission time stamp (such as t1 time stamp, t3 time stamp, etc.) on the PMA of Ethernet port 1 ;
  • Ethernet port 2 of network node 2 receives multiple PTP messages sent by network node 1 through lane0 ⁇ N, and before the PTP message received by each lane crosses the clock domain, that is, the PTP received by each lane Before the message is written to deskew fifo, enter the first timestamp for the PTP message received by each lane.
  • deskew fifo is located in the PCS of the Ethernet port, in this application, you can pass the PMA and its neighbors. Enter the first timestamp for the received PTP message to achieve the timestamp when the PTP message crosses the time domain. For example, in the vicinity of the PMA serializer/deserializer (serializer/deserializer, serdes) entrance, a first timestamp is entered for each received PTP, and the entered first timestamp is accompanied by the transmission of the PTP message.
  • serializer/deserializer serializer/deserializer, serdes
  • network node 2 After receiving multiple PTP messages sent by network node 1 across the clock domain, network node 2 receives the multiple PTP messages written in deskew fifo, and then outputs it through deskew fifo after receiving the multiple PTP messages.
  • the first timestamp value of the first timestamp is entered in each PTP message, and updated to the target timestamp value corresponding to the target PTP message in the multiple PTP messages, so as to realize the PTP message received by each lane Delay difference alignment.
  • the target PTP message is a PTP message received by the target lane among the multiple lanes, and the target lane is the lane with the shortest delay or the lane with the longest delay.
  • the network node 2 may update the first time stamp value of the first time stamp in the PTP message received by each lane, and update it to the number received by the network node 2
  • the first timestamp value of the first timestamp value of the first timestamp is entered in a PTP message; in the same way, if the target lane is the lane with the shortest delay among lane0 ⁇ N, network node 2 can The first timestamp value entered into the first timestamp in the PTP message received by the lane is updated to the smallest first timestamp value entered into the first timestamp among the multiple PTP messages received by the network node 2 Timestamp value, to achieve the timestamp value of the timestamp received by each lane to receive PTP packets,
  • the network node 2 updates the first timestamp value (target timestamp value) of the first timestamp according to the updated first timestamp of the PTP message received by any lane and the time when the network node 1 sends multiple PTP messages.
  • the difference of the time stamp value can determine the delay between the network node 1 and the network node 2.
  • the network node 2 can send through the network node 1 After multiple PTP messages are sent, the following message that carries the sending timestamp of the multiple PTP messages is learned.
  • the reception time of B and network node 1 to receive PTP message 1 is 19:23:1.02 seconds on November 23, 2018, which is the PTP message.
  • the first timestamp is entered in the text 1, and the first timestamp value of the first timestamp is 19:23:1.02 seconds on November 23, 2018.
  • the first timestamp After the first timestamp is entered in the PTP message 1, it is written to deskewfifo The delay difference of multiple lanes is aligned; when C, deskewfifo outputs a PTP message, the first timestamp value of the first timestamp of PTP message 1 is updated to the first time of the target PTP message received by the target lane The first timestamp value of the stamp is still 19:23:1.02 seconds on November 23, 2018. Referring to the communication system architecture of the existing stamping process shown in FIG.
  • the prior art stamps “B” to the PTP message received by each lane which occurs after the PTP message is written to deskewfifo, because of the Ethernet
  • the wr_clk of the port that is, the external PTP packet input clock (such as the serdes clock) is different from the rd_clk, that is, the internal clock of the Ethernet port, resulting in the inaccurate timestamp value of the received timestamp determined by the network node for each lane, as determined
  • the first timestamp value of the first timestamp of PTP message 1 is 19:23:1.03 seconds on November 23, 2018, which in turn leads to inaccurate measurement of the delay between network nodes.
  • the PTP message is stamped "B", which occurs before the PTP message is written to deskewfifo.
  • the PTP message does not cross the clock domain when it is stamped, ensuring the accuracy of the PTP message received by each lane. , To ensure the accuracy of delay measurement between network nodes.
  • the network node 1 and the network node 2 can receive each lane of the Ethernet port 2 when the Ethernet port 1 and the Ethernet port 2 are initialized to establish a chain, or when the chain is re-established.
  • the network node 1 sends the PTP packet sent via Ethernet port 1 into the third timestamp respectively. If the target lane is the lane with the smallest delay, the PTP packet with the smallest third timestamp value will be entered into the third timestamp.
  • the lane is determined to be the target lane; if the target lane is the lane with the largest delay, the lane of the PTP packet with the third timestamp with the largest third timestamp value is determined as the target lane.
  • the network node 2 when the chain is initialized or re-established, the network node 2 enters a third timestamp for the PTP message received by each lane of the Ethernet port 2, which can occur before the PTP message is written to deskewfifo, or It can happen after the PTP message is written to deskew fifo.
  • the network node 2 respectively inserting the first timestamp into multiple PTP packets received by the Ethernet port 2 may include the following manners:
  • the network node 2 enters a first timestamp respectively into the first bit of the multiple PTP packets received by the Ethernet port 2.
  • the network node 2 For each lane of the Ethernet port 2, before receiving the PTP message across the clock domain, the network node 2 adds a first time stamp to the PTP message. Because the timestamp value of the first timestamp entered in the first bit of the PTP message can truly reflect the receiving time of the PTP message, there is no need to correct the timestamp value of the first timestamp of the PTP message. Simplified the stamping process.
  • the network node 2 enters the first time stamp into the setting bits of the multiple PTP packets received by the Ethernet port 2 respectively.
  • the setting bit may be the first bit, the third bit, the seventh bit, etc. of the PTP packet.
  • the setting bit is located in the PTP packet header (sop bit).
  • the network node 2 For each lane of the Ethernet port 2, before receiving the PTP message across the clock domain, the network node 2 adds a first time stamp to the PTP message.
  • the setting bit can be the third bit, the seventh bit, etc.
  • the first timestamp value of the first timestamp is entered into the setting bit of the PTP message, which cannot truly reflect the reception time of the PTP message.
  • the network node 2 also needs to correct the time stamp value of the first time stamp in each received PTP message to the reception time of the first bit of the PTP message.
  • the network node 2 determines that the PTP message is transmitted from the first bit to the set bit in the network node based on the distance between the set bit of the PTP and the first bit.
  • the first transmission time is the same, because the set bit is the same for each lane, and the PTP packet received by each lane is transmitted from the first bit to the set bit.
  • the first transmission time is the same, and the network node 2 reports the PTP message.
  • the first timestamp value of the first timestamp is entered in the text and corrected to the difference between the first timestamp value and the first transmission duration.
  • the network node 2 corrects the timestamp value of the first timestamp in each received PTP message to the reception time of the first bit of the PTP message, which can cross the clock domain in the PTP message Before, it can also be achieved after the PTP message crosses the clock domain, before updating the first time stamp value into the first time stamp in the PTP message to the target time stamp value corresponding to the target PTP message.
  • the first time stamp value of the first time stamp entered in PTP message 3 is 19:23 on November 23, 2018 Minute 1.05 seconds
  • the first transmission time of PTP message 3 from the first bit to the seventh bit is "0.1 seconds”
  • the first timestamp value of the first timestamp of PTP message 3 after correction is 2018 November 23, 19:23:1.04 seconds.
  • the network node 2 according to the measurement period, according to the corresponding stamping time of the multiple lanes of the Ethernet port 2 in the current measurement period, before the PTP message crosses the clock domain, the multiple PTP messages received by the Ethernet port 2 are respectively entered into the first A time stamp.
  • the measurement period for the delay measurement between the network node 1 and the network node 2 is known, and the network node 2 can know the time period during which each lane of the Ethernet port 2 must receive the PTP message in the current measurement period, and can Each lane must be able to receive a PTP message in the current measurement period, and determine the current measurement period of Ethernet port 2.
  • the current measurement period of the Ethernet port 2 The first timestamp entered by each lane for the time stamped by the received PTP message is located in the header of the PTP message received by each lane.
  • the network node 2 adds a first time stamp to the PTP message received by each lane of the Ethernet port 2 according to the time when the Ethernet port 2 of the Ethernet port 2 stamps the received PTP message.
  • the target bit of the first timestamp in the PTP message may be the first bit of the PTP message, it may also be the second bit, the fifth bit, etc., which cannot truly reflect the reception time of the PTP message.
  • the network node 2 is also required to correct the time stamp value of the first time stamp entered in each received PTP message to the reception time of the first bit of the PTP message.
  • the network node 2 determines, based on the distance between the target bit of the PTP that hits the first timestamp and the first bit, that the PTP message in the network node is determined by the first bit transmission to the second transmission duration of the target bit with the first timestamp, the network node 2 corrects the first timestamp value into the first timestamp in the PTP message, and corrects it to the first timestamp value and the first timestamp value A difference in transmission time.
  • the network node 2 corrects the timestamp value of the first timestamp in each received PTP message to the reception time of the first bit of the PTP message, which can cross the clock domain in the PTP message Previously, after the PTP crossed the clock domain, as long as the first timestamp value into the first timestamp in the PTP message was updated to the target timestamp value corresponding to the target PTP message, it may be implemented.
  • the network node 2 updates the first timestamp value of the first timestamp in the multiple PTP messages received by the Ethernet port 2 to the corresponding value of the target PTP message in the received multiple PTP messages
  • the sum of the delay differences updates the first timestamp value of the first timestamp entered in the PTP message.
  • the network node 1 may send a beat PTP message in advance to lane 0 to N of the Ethernet port 1, and the Ethernet port 2 of the network node 2 before the PTP message received by each lane of the Ethernet port 2 crosses the clock domain, Enter a second timestamp to the bit of the PTP message received by each lane, according to the second timestamp value of the second timestamp of the PTP message received by each lane and the second timestamp of the PTP message received by the target lane The difference of the second time stamp value of the stamp determines the delay difference of each lane relative to the target lane.
  • each Ethernet port shares resources such as MAC/PCS/forward error correction (FEC) and each Ethernet port.
  • the working clock frequency (the internal clock frequency of the Ethernet port) is different from the clock frequency of the external PTP message input (such as the serdes clock frequency of the PMA position), but because the stamping process of this application is to cross the clock before the PTP message. Poke, so it is also applicable to a variety of Ethernet port comb scenarios.
  • an embodiment of the present application provides a stamping processing method, and specific steps include:
  • S501 The network node respectively inserts a first timestamp into multiple PTP packets received on the Ethernet port.
  • the Ethernet port has multiple lanes, and the multiple PTP packets are received by the network node through the multiple lanes.
  • the network node updates the first timestamp values of the first timestamps in the multiple PTP messages to update the multiple PTPs
  • the target timestamp value corresponding to the target PTP packet in the packet is a PTP message received by the target lane among the multiple lanes, and the target lane is the lane with the shortest delay or the lane with the longest delay;
  • the network node determines the network node and the network node that sent the plurality of PTP messages according to the difference between the target timestamp value and the timestamp value of the sending timestamp of the multiple PTP messages Time delay.
  • FIG. 6 is a network node 600 provided by this application, including: a processor 601 and a transceiver 602;
  • the processor 601 is further configured to update the first timestamp value of the first timestamp in the multiple PTP packets when the deskew fifo outputs the multiple PTPs, and update the first timestamp value to the multiple Target time stamp value corresponding to the target PTP message in the PTP messages; wherein, the target PTP message is the PTP message received by the target lane in the multiple lanes, and the target lane is the lane with the shortest delay or The lane with the longest delay;
  • the processor 601 is further configured to determine the network node and send the multiple PTP messages according to the difference between the target time stamp value and the time stamp value of the sending time stamp of the multiple PTP messages The delay between the network nodes. .
  • the processor 601 is specifically configured to use the transceiver 602 to write a plurality of PTP packets received on the Ethernet port before writing to the deskew fifo of the Ethernet port.
  • the first timestamp is entered for each bit.
  • the processor 601 is specifically configured to use the transceiver 602 to set the multiple PTP packets before the multiple PTP packets received on the Ethernet port are written to the deskew fifo of the Ethernet port
  • the first timestamp is entered into each bit; based on the distance between the set bit and the first bit corresponding to the multiple PTP packets, it is determined that the multiple PTP packets respectively correspond to the first bit to the set bit
  • the first transmission time correct the first timestamp value of the first timestamp in each of the multiple PTP messages to the first transmission time length corresponding to the first timestamp value and the PTP message The difference.
  • the processor 601 is specifically configured to, according to the measurement period, according to the respective stamping times of the multiple lanes of the Ethernet port in the current measurement period, receive multiple PTP packets on the Ethernet port through the transceiver 602 Before writing to the deskew fifo of the Ethernet port, the first timestamps are respectively entered into the plurality of PTP packets; the target bit and the first one corresponding to the first timestamps are respectively entered based on the plurality of PTP packets the distance of the bit, to determine the second transmission duration of the multiple PTP packets corresponding to the first bit to the target bit with the first timestamp respectively; to insert the first timestamp respectively into the multiple PTP packets The first timestamp value of is corrected to the difference between the first timestamp value and the second transmission duration corresponding to the PTP packet.
  • the processor 601 is specifically configured to input a first timestamp value into the plurality of PTP packets, and the value of the lane receiving the PTP packet relative to the target lane The sum of the delay difference updates the first timestamp value of the first timestamp respectively entered in the multiple PTP packets; where the delay difference of multiple lanes relative to the target lane is based on Before writing to deskewfifo of the Ethernet port, enter the second timestamp value of the second timestamp into the setting bit of the PTP message received by the target lane, respectively, and the PTP message received by the multiple lanes The set bit is determined by the difference of the second time stamp value into the second time stamp.
  • the processor 601 is specifically configured to, when a link is established on the Ethernet port, enter a third timestamp value of a third timestamp respectively into a plurality of PTP packets received by the Ethernet port.
  • the lane corresponding to the target PTP packet with the maximum time stamp value or the target PTP packet with the minimum time stamp value is determined as the target lane.
  • embodiments of the present application also provide a network node.
  • the network node 700 includes a memory 701, a processor 702 and a transceiver 703.
  • the memory 701, the processor 702, and the transceiver 703 are linked by a bus.
  • the memory 701 is used to store computer-executed instructions.
  • the processor 702 executes the computer-executed instructions stored in the memory 701 through the transceiver 703, so that the network node 700 implements any of the above stamping processing methods.
  • An embodiment of the present application provides a computer storage medium that stores a computer program, and the computer program includes instructions for executing the stamping processing method described in the foregoing method embodiment.
  • Embodiments of the present application provide a computer program product containing instructions that, when run on a network node, enable the network node to implement the stamping processing method described in the foregoing method embodiment.
  • An embodiment of the present application provides a chip that is connected to a memory and used to read and execute a software program stored in the memory to implement the stamping processing method described in the foregoing method embodiments.
  • the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Moreover, the present application may take the form of a computer program product implemented on one or more computer usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer usable program code.
  • computer usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
  • These computer program instructions may also be stored in a computer readable memory that can guide a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, the instructions
  • the device implements the functions specified in one block or multiple blocks of the flowchart one flow or multiple flows and/or block diagrams.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operating steps are performed on the computer or other programmable device to produce computer-implemented processing, which is executed on the computer or other programmable device
  • the instructions provide steps for implementing the functions specified in one block or multiple blocks of the flowchart one flow or multiple flows and/or block diagrams.

Abstract

The present application relates to the technical field of communications, and disclosed therein are a method and device for stamping processing, which are used to improve the accuracy of stamping processing, thereby ensuring the accuracy of delay measurement. The method is: a network node entering a first timestamp separately on a plurality of PTP messages received by an Ethernet port, wherein the Ethernet port has a plurality of lanes, and the plurality of PTP messages are received by the network node by means of the plurality of lanes; once the plurality of PTP messages cross a clock domain, the network node updating a first timestamp value of the first timestamp separately entered on the plurality of PTP messages to a target timestamp value corresponding to a target PTP message received by a target lane among the plurality of lanes; and according to the difference between the target timestamp value and a timestamp value of a sending timestamp of the plurality of PTP messages, the network node determining the delay between the network node and a network node sending the plurality of PTP messages.

Description

一种打戳处理方法及装置Stamping processing method and device 技术领域Technical field
本申请涉及通信技术领域,特别涉及一种打戳处理方法及装置。The present application relates to the field of communication technology, and in particular, to a stamping processing method and device.
背景技术Background technique
随着以太端口速率的不断提升,需要支持精确时间同步协议(precision time protocol,PTP)的以太端口的带宽也越来越高,如100千兆以太网(gigabit ethernet,GE)、200GE和400GE等,当前单数据通路(lane)的以太端口已不足以支撑PTP协议功能的部署,需要在多lane的以太端口部署PTP协议功能。在多lane以太端口应用PTP报文测量两网络节点之间的延时时,对于发送方向,PTP协议要求同一以太端口的多个lane一定要对齐发送,即同一以太端口的多个lane同一拍的多个PTP报文发送的时戳的时戳值相同,受多个lane的传输环境的影响,如多个lane的光纤传输等,多个lane无法保证延时一致,因此PTP协议定义,在接收方向,需要把多个lane接收PTP报文的时戳的时戳值,补偿对齐到同一基准lane上,当前定义的基准lane为延时最长的lane。As the speed of Ethernet ports continues to increase, the bandwidth of Ethernet ports that need to support precise time synchronization (PTP) protocols is also getting higher and higher, such as 100 gigabit Ethernet (GE), 200GE, and 400GE. The current single data path (lane) Ethernet port is no longer sufficient to support the deployment of PTP protocol functions, and the PTP protocol function needs to be deployed on multiple lane Ethernet ports. When multi-lane Ethernet ports use PTP packets to measure the delay between two network nodes, for the sending direction, the PTP protocol requires that multiple lanes of the same Ethernet port must be aligned, that is, multiple lanes of the same Ethernet port are shot at the same time. The timestamp value of multiple PTP messages is the same, and is affected by the transmission environment of multiple lanes, such as the optical transmission of multiple lanes. Multiple lanes cannot guarantee the same delay. Therefore, the PTP protocol defines that In the direction, it is necessary to align the timestamp values of the timestamps of multiple lanes to receive PTP packets to the same reference lane. The currently defined reference lane is the lane with the longest delay.
现有技术中,在接收方向,网络节点将以太端口每个lane接收的PTP报文通过延时差对齐缓冲器(deskew fifo)进行延时差对齐,其所述fifo指先进先出缓冲器(first input first output),网络节点通过deskew fifo将每个lane接收的PTP报文缓存后,通过deskew fifo读出缓存的每个lane接收的PTP报文,用以实现将各lane接收的PTP报文的延时差对齐,网络节点根据每个lane接收的PTP报文读出的时间,与PTP报文在deskew fifo中缓存的时长的差值,生成接收PTP报文的时戳,并根据多个lane相对于基准lane的延时差异,将多个lane接收PTP报文的时戳的时戳值,补偿至基准lane接收PTP报文的时戳的时戳值,以便对网络节点间的延时进行测量。In the prior art, in the receiving direction, the network node performs delay difference alignment on the PTP message received by each lane of the Ethernet port through a delay difference alignment buffer (deskew fifo), where the fifo refers to a first-in first-out buffer ( first input) First, the network node caches the PTP messages received by each lane through deskewfifo, and then reads out the cached PTP messages received by each lane through deskewfifo, so as to realize the PTP messages received by each lane The delay difference is aligned. The network node generates a timestamp for receiving the PTP message according to the difference between the read time of the PTP message received by each lane and the length of the PTP message buffered in deskew fifo. The delay of the lane relative to the reference lane compensates the timestamp value of the timestamp of multiple lanes receiving PTP packets to the timestamp value of the timestamp of the baseline lane receiving PTP packets, in order to delay the network nodes Take measurements.
然而,在多种场景下会出现异步deskew fifo的情况,如在多速率以太端口混用同一组介质访问控制层(media access control,MAC)逻辑时,网络节点的以太端口中出现deskew fifo写入PTP报文所遵循的写时钟(wr_clk)和读取PTP报文所遵循的读时钟(rd_clk)不同,为异步deskew fifo,PTP报文在deskew fifo过程中跨过了时钟域,因wr_clk和rd_clk的频率和/或相位不同,导致网络节点生成的接收PTP报文的时戳不准确。示例性的,以lane1接收的PTP报文1为例,网络节点根据wr_clk在deskew fifo写入PTP报文1的时间为2018年11月23日19时23分1.02秒,因为rd_clk和wr_clk的频率和/或相位不同,网络节点读出的deskew fifo缓存PTP报文1的时长为0.1秒,在deskew fifo读出PTP报文1的时间为2018年11月23日19时23分1.13秒,导致计算出的PTP报文1的时戳的时戳值为2018年11月23日19时23分1.03秒,与2018年11月23日19时23分1.02秒存在着误差,进而导致网络节点间延时测量不准确。However, asynchronous deskew fifo may occur in various scenarios. For example, when multi-rate Ethernet ports are mixed with the same set of media access control (MAC) logic, deskew fifo writes PTP in the Ethernet ports of network nodes The write clock (wr_clk) followed by the message is different from the read clock (rd_clk) followed by the PTP message. It is an asynchronous deskew fifo. The PTP message crosses the clock domain during the deskew fifo process. Because of the wr_clk and rd_clk Different frequencies and/or phases result in inaccurate timestamps generated by network nodes to receive PTP messages. Exemplarily, taking PTP message 1 received by lane1 as an example, the time that the network node writes PTP message 1 in deskew fifo according to wr_clk is 19:23:1.02 seconds on November 23, 2018 because of the frequency of rd_clk and wr_clk Different from the phase, the duration of deskew fifo cached PTP message 1 read by the network node is 0.1 seconds, and the time of deskew fifo read PTP message 1 is 19:23:1.13 seconds on November 23, 2018, resulting in The calculated time stamp value of PTP packet 1 is 19:23:1.03 seconds on November 23, 2018, and there is an error from 19:23:1.02 seconds on November 23, 2018, which leads to a gap between network nodes Delay measurement is not accurate.
发明内容Summary of the invention
本申请提供一种打戳处理方法及装置,用以解决现有技术中存在的因打戳处理不准确,导致网络节点间延时测量不准确的问题。The present application provides a stamping processing method and device to solve the problem of inaccurate delay measurement between network nodes due to inaccurate stamping processing in the prior art.
第一方面,本申请提供了一种打戳处理方法,该方法可以通过网络节点实现,该方法 包括:网络节点对以太端口接收到的多个PTP报文分别打入第一时戳;其中,所述以太端口具有多个lane,所述多个PTP报文为所述网络节点通过所述多个lane接收的;所述网络节点在所述多个PTP报文跨过时钟域后,将所述多个PTP报文中分别打入第一时戳的第一时戳值,更新为所述多个PTP报文中目标PTP报文对应的目标时戳值;其中,所述目标PTP报文为所述多个lane中目标lane接收的PTP报文,所述目标lane为延时最短的lane或延时最长的lane;所述网络节点根据所述目标时戳值与所述多个PTP报文的发送时戳的时戳值的差值,确定所述网络节点与发送所述多个PTP报文的网络节点间的延时。在本申请中,网络节点在以太端口每个lane接收的PTP报文跨时钟域之前,即在每个lane接收的PTP报文写入deskew fifo之前进行打戳,在所述多个PTP报文跨过时钟域后,即在deskew fifo输出所述多个PTP报文时,将每个lane接收的PTP报文打戳的时戳值补偿到指定的目标lane接收的PTP报文的时戳值,实现延时差对齐,避免了异步deskew fifo导致的误差,提高了打戳处理的准确性,保证了网络节点间延时确定的准确性;同时因打戳发生在PTP报文写入deskew fifo之前,无需deskew fifo的写时钟与读时钟的频率保持一致或倍数关系,进而可以使不同速率的以太端口可以共享一套打戳处理逻辑,且每个以太端口都支持高精度的打戳处理,也提高了打戳处理的适用范围。In the first aspect, the present application provides a method for processing a stamp. The method may be implemented by a network node. The method includes: the network node respectively punches a plurality of PTP messages received by an Ethernet port into a first time stamp; wherein, The Ethernet port has multiple lanes, and the multiple PTP packets are received by the network node through the multiple lanes; after the multiple PTP packets cross the clock domain, the network node sends all The first timestamp value of the first timestamp respectively entered in the multiple PTP messages is updated to the target timestamp value corresponding to the target PTP message in the multiple PTP messages; wherein, the target PTP message It is a PTP message received by a target lane among the multiple lanes, where the target lane is the lane with the shortest delay or the lane with the longest delay; the network node according to the target timestamp value and the multiple PTPs The difference between the time stamp value of the sending time stamp of the message determines the delay between the network node and the network node that sends the multiple PTP messages. In this application, the network node performs a stamp before the PTP message received by each lane of the Ethernet port crosses the clock domain, that is, before the PTP message received by each lane is written to deskewfifo, and the multiple PTP messages After crossing the clock domain, that is, when deskew fifo outputs the multiple PTP messages, the time stamp value of the PTP message received by each lane is compensated to the time stamp value of the PTP message received by the specified target lane To achieve delay difference alignment, avoid errors caused by asynchronous deskew fifo, improve the accuracy of stamping processing, and ensure the accuracy of delay determination between network nodes; at the same time, because the stamping occurs when PTP messages are written to deskew fifo Previously, there was no need for deskew fifo's write clock and read clock to maintain a consistent or multiple relationship, thereby enabling Ethernet ports of different rates to share a set of stamping processing logic, and each Ethernet port supports high-precision stamping processing. It also improves the scope of application of the stamping process.
在一种可能的设计中,所述网络节点对以太端口接收到的多个PTP报文分别打入第一时戳,包括:所述网络节点对以太端口接收到的多个PTP报文的第一个比特(bit)分别打入第一时戳。通过这种方式,便于在延时差对齐时,快速将每个lane接收的PTP报文打入的时戳的时戳值补偿到目标lane接收的目标PTP报文打入时戳的时戳值。In a possible design, each of the PTP packets received by the network node into the Ethernet port has a first timestamp, including: the first time stamp of the plurality of PTP packets received by the network node on the Ethernet port One bit (bit) is entered into the first time stamp. In this way, when the delay difference is aligned, it is easy to quickly compensate the time stamp value of the time stamp entered in the PTP message received by each lane to the time stamp value of the time stamp entered in the target PTP message received by the target lane .
在一种可能的设计中,所述网络节点对以太端口接收到的多个PTP报文分别打入第一时戳,包括:所述网络节点对以太端口接收到的多个PTP报文的设定bit分别打入第一时戳;所述网络节点基于所述多个PTP报文分别对应所述设定bit与第一个bit的距离,确定所述多个PTP报文分别对应第一个bit至设定bit的第一传输时长;所述网络节点将所述多个PTP报文中分别打入第一时戳的第一时戳值,校正为所述第一时戳值与所述PTP报文对应的第一传输时长的差值。通过这种方式,丰富了网络节点的打戳方案,便于根据网络节点所处的网络环境,选择适合的打戳方案。In a possible design, each of the PTP packets received by the network node with a first timestamp includes: a setting of the plurality of PTP packets received by the Ethernet port by the network node Enter a first timestamp for a fixed bit; the network node determines that the multiple PTP packets correspond to the first one based on the distance between the set bit and the first bit respectively The first transmission time from bit to the set bit; the network node corrects the first timestamp value of the first timestamp into the plurality of PTP packets, and corrects it to the first timestamp value and the The difference in the first transmission duration corresponding to the PTP packet. In this way, the stamping scheme of the network node is enriched, and it is convenient to select a suitable stamping scheme according to the network environment in which the network node is located.
在一种可能的设计中,所述网络节点对以太端口接收到的多个PTP报文分别打入第一时戳,包括:所述网络节点按照测量周期,根据当前测量周期以太端口的多个lane分别对应的打戳时间,对所述以太端口接收的多个PTP报文分别打入第一时戳;所述网络节点基于所述多个PTP报文分别对应打入第一时戳的目标bit与第一个bit的距离,确定所述多个PTP报文分别对应第一个bit至打入第一时戳的目标bit的第二传输时长;所述网络节点将所述多个PTP报文中分别打入第一时戳的第一时戳值,校正为所述第一时戳值与所述PTP报文对应的第二传输时长的差值。通过这种方式,丰富了网络节点的打戳方案,便于根据网络节点所处的网络环境,选择适合的打戳方案。In a possible design, the network node respectively inserts a first timestamp into a plurality of PTP messages received by the Ethernet port, including: the network node according to the measurement period, according to the current measurement period The respective time stamps corresponding to the lanes, and the first timestamps are respectively entered into the multiple PTP packets received by the Ethernet port; the network node respectively corresponds to the target of the first timestamps based on the multiple PTP packets the distance between the bit and the first bit to determine the second transmission duration of the multiple PTP packets corresponding to the first bit to the target bit with the first timestamp respectively; the network node reports the multiple PTP packets The first timestamp value of the first timestamp is respectively entered in the text and corrected to the difference between the first timestamp value and the second transmission time length corresponding to the PTP message. In this way, the stamping scheme of the network node is enriched, and it is convenient to select a suitable stamping scheme according to the network environment in which the network node is located.
在一种可能的设计中,所述将所述多个PTP报文中分别打入第一时戳的第一时戳值,更新为所述多个PTP报文中目标PTP报文对应的目标时戳值,包括:所述网络节点根据所述多个PTP报文中分别打入第一时戳的第一时戳值与接收所述PTP报文的lane相对于目标lane的延时差异的和,对所述多个PTP报文中分别打入的第一时戳的第一时戳值进行更新;其中,多个lane分别相对于目标lane的延时差异,是根据在跨时钟域之前,对所述目标lane接收的PTP报文的设定bit打入第二时戳的第二时戳值,分别与所述多个lane接收的PTP报文的 设定bit打入第二时戳的第二时戳值的差确定的。通过这种方式,无需在每次打戳处理时对目标PTP报文进行识别,简化了打戳处理的流程。In a possible design, the first timestamp values of the first timestamps in the plurality of PTP messages are updated to the targets corresponding to the target PTP messages in the plurality of PTP messages The timestamp value includes: the time difference between the first timestamp value entered by the network node according to the first timestamp in the plurality of PTP packets and the delay of the lane receiving the PTP packet relative to the target lane And, update the first timestamp value of the first timestamp respectively entered in the multiple PTP packets; wherein the delay difference of multiple lanes relative to the target lane is based on , The second timestamp value of the second timestamp is entered into the set bit of the PTP message received by the target lane, and the second timestamp is entered into the set bit of the PTP message received by the multiple lanes, respectively The difference of the second timestamp value is determined. In this way, there is no need to identify the target PTP message each time the stamping process is performed, which simplifies the process of the stamping process.
在一种可能的设计中,所述确定目标lane的过程包括:所述网络节点在所述以太端口建链时,将对所述以太端口接收的多个PTP报文分别打入的第三时戳的第三时戳值中,最大时戳值的目标PTP报文所对应的lane或最小时戳值的目标PTP报文所述对应的lane,确定为目标lane。通过这种方式,有助于目标lane的准确确定,有助于保证打戳处理的准确性。In a possible design, the process of determining the target lane includes: when the network node establishes a link with the Ethernet port, the third time when the multiple PTP messages received by the Ethernet port are respectively entered into the network node In the third time stamp value of the time stamp, the lane corresponding to the target PTP packet with the maximum time stamp value or the target PTP packet with the minimum time stamp value is determined as the target lane. In this way, it helps to accurately determine the target lane and helps to ensure the accuracy of the stamping process.
第二方面,本申请提供了一种打戳处理装置,该装置具有实现上述第一方面和任一种可能的设计中方法的功能。所述功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。所述硬件或软件包括一个或多个与上述功能相对应的模块。In a second aspect, the present application provides a stamping processing device that has the function of implementing the above-described first aspect and any possible design method. The function can be realized by hardware, or can also be realized by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions.
在一个可能的设计中,该装置可以是芯片或者集成电路。In one possible design, the device may be a chip or an integrated circuit.
在一个可能的设计中,该装置包括收发器和处理器,处理器用于执行一组程序,当程序被执行时,所述装置可以执行上述第一方面和任一种可能的设计中所述的方法。In a possible design, the device includes a transceiver and a processor, and the processor is used to execute a set of programs. When the program is executed, the device may execute the above-mentioned first aspect and any of the possible designs. method.
在一个可能的设计中,该装置还包括存储器,用于存储所述处理器执行的程序。In a possible design, the device further includes a memory for storing the program executed by the processor.
在一个可能的设计中,该装置为网络节点。In one possible design, the device is a network node.
第三方面,本申请提供了一种计算机存储介质,存储有计算机程序,该计算机程序包括用于执行上述第一方面或者第一方面的任意一种可能的设计中方法的指令。In a third aspect, the present application provides a computer storage medium that stores a computer program, the computer program including instructions for performing the method of the first aspect or any one of the possible designs in the first aspect.
第四方面,本申请提供了一种包含指令的计算机程序产品,当其在网络节点上运行时,使得网络节点执行上述第一方面或者第一方面的任意一种可能的设计中的方法。In a fourth aspect, the present application provides a computer program product containing instructions that, when run on a network node, cause the network node to perform the method in the first aspect or any possible design of the first aspect.
第五方面,提供一种芯片,所述芯片与存储器相连,用于读取并执行所述存储器中存储的软件程序,以实现上述第一方面或上述第一方面的任意一种可能的设计中的方法。According to a fifth aspect, a chip is provided, the chip being connected to a memory for reading and executing a software program stored in the memory to implement the first aspect or any possible design of the first aspect Methods.
附图说明BRIEF DESCRIPTION
图1为本申请实施例中延时请求响应机制示意图;FIG. 1 is a schematic diagram of a delay request response mechanism in an embodiment of this application;
图2为本申请实施例中lane的deskew fifo机制示意图;2 is a schematic diagram of the deskew fifo mechanism of lane in the embodiment of the present application;
图3A为本申请实施例中通信系统架构示意图之一;FIG. 3A is a first schematic diagram of the communication system architecture in the embodiment of the present application;
图3B为本申请实施例中通信系统架构示意图之二;3B is a second schematic diagram of the communication system architecture in the embodiment of the present application;
图4为本申请实施例中通信系统架构示意图之三;4 is a third schematic diagram of the communication system architecture in the embodiment of the present application;
图5为本申请实施例中打戳处理过程示意图;FIG. 5 is a schematic diagram of a stamping process in an embodiment of this application;
图6为本申请实施例中网络节点的结构示意图之一;FIG. 6 is a schematic structural diagram of a network node in an embodiment of this application;
图7为本申请实施例中网络节点的结构示意图之二。7 is a second structural diagram of a network node in an embodiment of this application.
具体实施方式detailed description
本申请提供一种打戳处理方法及装置,用以提高打戳处理的准确性,以保证网络节点间延时测量的准确性,其中,方法和设备是基于同一发明构思的,由于方法及设备解决问题的原理相似,因此设备与方法的实施可以相互参见,重复之处不再赘述。The present application provides a method and device for stamping processing to improve the accuracy of stamping processing to ensure the accuracy of delay measurement between network nodes. The method and equipment are based on the same invention concept. Due to the method and equipment The principle of solving the problem is similar, so the implementation of the device and method can refer to each other, and the repetition is not repeated here.
以下,对本申请中的部分用语进行解释说明,以便与本领域技术人员理解。In the following, some terms in this application will be explained to understand with those skilled in the art.
本发明实施例涉及到网络节点,在由独立的、但相互连接起来的计算机、工作站、服务器、终端、网络设备等组成网络系统中,每一个拥有自己唯一网络地址的设备均可以称为一个网络节点。目前网络节点可以是交换机、路由器、计算机、平板电脑、掌上电脑、 手机(mobile phone)等。The embodiments of the present invention relate to network nodes. In a network system composed of independent but interconnected computers, workstations, servers, terminals, network devices, etc., each device with its own unique network address can be called a network node. At present, the network nodes may be switches, routers, computers, tablet computers, PDAs, mobile phones, and so on.
PTP协议,是由电子电器工程师协会(institute of electrical and electronics engineers,IEEE)发布的,又称IEEE1588协议,用于对网络中网络节点的时钟进行同步。通过对网络中两网络节点在以太端口的发送和接收的位置分别打上t1、t2、t3和t4等时戳,以测量两网络节点之间的延时。如图1所示,从节点(slave node)根据主节点(master node)发送同步报文(sync)的t1时戳,slave node接收sync的t2时戳,slave node发送延时请求报文(delay_request)的t3时戳,master node接收delay_request的t4时戳,确定master node和slave node之间的延时,其中为了便于slave node对master node发送的报文的时戳的获知,master node在发送报文后,还可以再通过记录有报文发送时戳的跟随报文告知slave node报文的发送时戳,如master node发送sync后,将记录sync发送时戳(t1时戳)的跟随报文(follow_up)发送给slave node,另外,延迟请求响应报文(delay_respone)中携带有master node接收slave node发送delay_request的t4时戳。master node和slave node之间的延时(path delay)为(t2-t1)或(t4-t3),平均延时(mean path delay)为[(t2-t1)+(t4-t3)]/2或[(t2-t3)+(t4-t1)]/2,通常,为了保证延时测量的准确性,延时测量时多采用mean path delay。现有技术,在多lane的以太端口中,在接收方向,把多个lane接收PTP报文的时戳的时戳值,补偿对齐到基准lane上接收的PTP报文的时戳的时戳值后,任一lane接收PTP报文的时戳均可作为测量延时时接收PTP报文的时戳。PTP protocol is issued by Institute of Electrical and Electronic Engineers (IEEE), also known as IEEE1588 protocol, which is used to synchronize the clocks of network nodes in the network. The time delay between the two network nodes is measured by time stamping t1, t2, t3 and t4 on the sending and receiving positions of the two network nodes in the Ethernet port respectively. As shown in Figure 1, the slave node sends the synchronization message (sync) t1 timestamp according to the master node, the slave node receives the sync t2 timestamp, and the slave node sends a delay request message (delay_request )'S t3 timestamp, the master node receives the delay_request t4 timestamp to determine the delay between the master node and the slave node. In order to facilitate the slave node's knowledge of the timestamp of the message sent by the master node, the master node sends the report After the text, you can also tell the slave node to send the timestamp by following the message with the message sending timestamp. For example, after the master sends sync, it will record the sync sending timestamp (t1 timestamp) following message (follow_up) is sent to the slave node. In addition, the delay request response message (delay_respone) carries the t4 timestamp of the master node receiving delay_request sent by the slave node. The delay (path) between master and slave is (t2-t1) or (t4-t3), and the average delay (mean path) is [(t2-t1)+(t4-t3)]/ 2 or [(t2-t3)+(t4-t1)]/2, usually, in order to ensure the accuracy of delay measurement, mean time path delay is often used in delay measurement. In the prior art, in an Ethernet port with multiple lanes, in the receiving direction, the time stamp values of the time stamps of the PTP messages received by multiple lanes are compensated to the time stamp values of the time stamps of the PTP messages received on the reference lane After that, the timestamp of any lane receiving PTP message can be used as the timestamp of receiving PTP message when measuring the delay.
时戳,又称之为时间戳(timestamp),通常是一个字符序列,唯一地标识某一刻的时间,本申请涉及的时戳值,为时戳标识的某一刻的时间,如2018年11月23日17时45分32秒。Time stamp, also called timestamp, is usually a sequence of characters that uniquely identifies the time of a certain moment. The time stamp value involved in this application is the time of a certain moment identified by the time stamp, such as November 2018 17:45:32 on the 23rd.
PTP报文的发送时间和PTP报文的接收时间,在本申请中PTP报文的发送时间,是指发送PTP报文第一个bit的时间;PTP报文的接收时间,也称为PTP报文的到达时间,是指接收PTP报文的第一个bit的时间。The transmission time of the PTP message and the reception time of the PTP message, in this application, the transmission time of the PTP message refers to the time of sending the first bit of the PTP message; the reception time of the PTP message, also known as the PTP message The arrival time of the message refers to the time to receive the first bit of the PTP message.
lane的deskew fifo,即数据通道的延时差对齐,指将多个lane分别接收的PTP报文,依据延时最长的lane进行对齐。示例性的,如图2所示,需要传输的串行数据流为123456789,发送(transport,tx)端和接收(receive,rx)端建立有3个lane分别为lane0、lane1和lane2,lane0对应的发送数据(tx data),即PTP报文为147、lane1对应的tx data为258、lane2对应的tx data为369,tx端的lane0、lane1和lane2同时发送PTP报文147、258和369,tx端和rx端的时戳事件(timestamping event)均发生在PTP报文的第一个bit上,例如PTP报文258的第一个bit“2”上。rx端在lane0、lane1和lane2上分别接收PTP报文147、258和369,因为lane0、lane1和lane2对应的链路延时(link delay)不同,导致rx端在lane0、lane1和lane2接收PTP报文的接收时间不同,rx端将每个lane接收到的PTP写入deskew fifo,通过deskew fifo缓存接收到的PTP报文,deskew fifo将已接收到PTP报文的每个lane接收PTP报文的时间,与最新接收PTP报文的lane接收PTP报文的接收时间进行对齐。如图2所示,最新接收到PTP报文的为lane2,将各lane接收PTP报文的接收时间,与lane2接收PTP报文的接收时间进行对齐。The deskew of the lane, that is, the delay difference alignment of the data channel, refers to aligning the PTP messages received by multiple lanes according to the lane with the longest delay. Exemplarily, as shown in FIG. 2, the serial data stream to be transmitted is 123456789, and three lanes are established at the transmitting (transport, tx) end and the receiving (receive, rx) end, respectively lane 0, lane 1 and lane 2, corresponding to lane 0. Send data (tx data), that is, PTP message is 147, tx data corresponding to lane1 is 258, tx data corresponding to lane2 is 369, lane0, lane1 and lane2 at the tx end send PTP messages 147, 258 and 369, tx at the same time Timestamping events at the end and at the rx end occur on the first bit of the PTP message, for example, the first bit "2" of the PTP message 258. The rx end receives PTP packets 147, 258, and 369 on lane0, lane1, and lane2, respectively. Because the link delays corresponding to lane0, lane1, and lane2 are different, the rx end receives PTP messages on lane0, lane1, and lane2. The reception time of the text is different. The rx end writes the PTP received by each lane to deskewfifo, and caches the received PTP message through deskewfifo. deskewfifo will receive the PTP message for each lane that has received the PTP message. The time is aligned with the receiving time of the latest PTP packet received by the lane. As shown in FIG. 2, the latest received PTP message is lane2, and the reception time of each lane to receive the PTP message is aligned with the reception time of lane2 to receive the PTP message.
通过lane的deskew fifo,也能计算各lane间的延时差异,例如:每个lane的PTP报文的发送时间均为0,则每个lane的PTP报文的接收时间,则为该lane的link delay。deskew fifo的实现,会导致每个lane的缓存延时(deskew buffer delay)增加3,这是deskew fifo实现导致的,需要消除。rx端通过deskew fifo读取到的lane2的总延时(total delay)为108, lane2的link delay为108-3=105,同理lane0的link delay为100、lane1的link delay为103,lane0与lane2的延时差异为8-3=5,lane1与lane2的延时差异为5-3=2,但上述都是基于deskew fifo的wr_clk和rd_clk的完全一致实现的,但实际上以太端口的wr_clk和rd_clk不同,导致的确定的total delay和/或deskew buffer delay存在误差,进而导致各lane的link delay计算不准确,即各lane接收PTP报文的接收时间计算不准确,根据接收时间生成的时戳的时戳值也不准确。The deskew fifo of the lane can also calculate the delay difference between the lanes. For example, the sending time of each lane’s PTP message is 0, then the receiving time of each lane’s PTP message is the lane’s time. linkdelay. The implementation of deskew fifo will cause the buffer delay of each lane to increase by 3, which is caused by the deskew fifo implementation and needs to be eliminated. The total delay of lane2 read by deskew fifo at rx end is 108, the link delay of lane2 is 108-3=105, the link delay of lane0 is 100, the linkdelay of lane1 is 103, lane0 and The delay difference of lane2 is 8-3=5, and the delay difference of lane1 and lane2 is 5-3=2, but the above are all implemented based on the wr_clk and rd_clk of deskew fifo, but actually the wr_clk of the Ethernet port Unlike rd_clk, there is an error in the determined total delay and/or deskew buffer delay, which in turn leads to inaccurate calculation of the link delay of each lane, that is, the calculation of the reception time of the PTP message received by each lane is inaccurate. The time stamp value of the stamp is also inaccurate.
另外,需要理解的是,本申请中所涉及的多个,是指两个或两个以上;本申请的描述中,“第一”、“第二”等词汇,仅用于区分描述的目的,而不能理解为指示或暗示相对重要性,也不能理解为指示或暗示顺序。In addition, it should be understood that the multiples referred to in this application refer to two or more than two; in the description of this application, the words "first" and "second" are only used to distinguish the description , And cannot be understood as indicating or implying relative importance, nor can it be understood as indicating or implying order.
下面将结合附图,对本申请实施例进行详细描述。The embodiments of the present application will be described in detail below with reference to the drawings.
图3A为本申请实施例提供的一种打戳处理适用的一种通信系统架构,如图3A所示,所述通信系统包括:网络节点1和网络节点2,网络节点1的以太端口1通过网络节点1的物理介质关联层接口(physical media dependent,PMD),经网络节点2的PMD与网络节点2的以太端口建链,如图3A所示,网络节点1和网络节点2之间共建立了0~N,共N+1个lane。其中网络节点的以太端口包括:MAC、物理编码层(physical coding sublayer,PCS)、物理媒介连接层(physical medium attachment,PMA)。FIG. 3A is a communication system architecture applicable to a stamping process provided by an embodiment of the present application. As shown in FIG. 3A, the communication system includes: a network node 1 and a network node 2, and an Ethernet port 1 of the network node 1 passes The physical media dependent layer interface (PMD) of the network node 1 establishes a link via the PMD of the network node 2 and the Ethernet port of the network node 2, as shown in FIG. 3A, the network node 1 and the network node 2 are established together From 0 to N, there are N+1 lanes in total. The Ethernet ports of the network nodes include: MAC, physical coding layer (PCS), physical media connection layer (physical medium attachment, PMA).
应当理解本申请实施例还可以适用于其他通信系统,还适用于网络节点1和网络节点2之间存在第三方节点的情况,如图4所示,网络节点1和网络节点2之间存在透传节点(tc node)。其中,如果网络节点1和网络节点2之间存在第三方节点,在确定网络节点1和网络节点2之间的延时时,需要去除第三方节点导致的延时。参见图4所示,网络节点1和网络节点2之间的path delay为(t2-t1-cf1)或(t4-t3-cf2),mean path delay为[(t2-t1-CF1)+(t4-t3-CF2)]/2或[(t2-t3)+(t4-t1)–(CF1+CF2)]/2,其中cf1为tc node导致的网络节点1和网络节点2之间传输PTP报文(sync)产生的延时,cf2为tc node导致的网络节点1和网络节点2之间传输PTP报文(delay_request)产生的延时。It should be understood that the embodiments of the present application can also be applied to other communication systems, and also to the case where there is a third-party node between network node 1 and network node 2. As shown in FIG. 4, there is a transparent connection between network node 1 and network node 2. Transmission node (tcnode). Among them, if there is a third-party node between the network node 1 and the network node 2, when determining the delay between the network node 1 and the network node 2, the delay caused by the third-party node needs to be removed. As shown in FIG. 4, the path between network node 1 and network node 2 is (t2-t1-cf1) or (t4-t3-cf2), and the mean path delay is [(t2-t1-CF1)+(t4 -t3-CF2)]/2 or [(t2-t3)+(t4-t1)–(CF1+CF2)]/2, where cf1 is the transmission of PTP report between network node 1 and network node 2 caused by tcnode The delay caused by the text (sync), cf2 is the delay caused by the transmission of the PTP message (delay_request) between the network node 1 and the network node 2 caused by tcnode.
仍以图3A为例,以网络节点1为tx端,网络节点2为rx端,在网络节点1和网络节点2的以太端口1和以太端口2之间建立的N+1个lane上进行一拍PTP报文(如sync、delay_request等)的发送和接收进行打戳处理为例进行说明,其中所述一拍PTP报文的数量与lane的数量相同,在同一拍中,每个lane传输一个PTP报文。Still taking FIG. 3A as an example, taking network node 1 as the tx end and network node 2 as the rx end, perform one on the N+1 lanes established between Ethernet port 1 and Ethernet port 2 of network node 1 and network node 2 Take the stamping process of sending and receiving PTP packets (such as sync, delay_request, etc.) as an example to illustrate, where the number of PTP packets in one beat is the same as the number of lanes, and each lane transmits one in the same beat PTP message.
A、网络节点1的以太端口1同时在lane0~N发送PTP报文,每个lane发送一个PTP报文,并在以太端口1的PMA生成发送时戳(如t1时戳、t3时戳等);B、网络节点2的以太端口2通过lane0~N接收网络节点1发送的多个PTP报文,并在每个lane接收的PTP报文跨过时钟域之前,即在每个lane接收的PTP报文写入deskew fifo之前,对每个lane接收的PTP报文打入第一时戳,具体的,因为deskew fifo位于以太端口的PCS中,在本申请中,可以通过在PMA及其临近位置为接收到的PTP报文打入第一时戳,实现在PTP报文跨过时间域之间进行打戳。如:在PMA的串行器/解串器(serializer/deserializer,serdes)入口附近为接收的多个PTP分别打入第一时戳,打入的第一时戳伴随着PTP报文传输。 A. Ethernet port 1 of network node 1 simultaneously sends PTP messages on lane 0 ~ N, each lane sends a PTP message, and generates a transmission time stamp (such as t1 time stamp, t3 time stamp, etc.) on the PMA of Ethernet port 1 ; B. Ethernet port 2 of network node 2 receives multiple PTP messages sent by network node 1 through lane0 ~ N, and before the PTP message received by each lane crosses the clock domain, that is, the PTP received by each lane Before the message is written to deskew fifo, enter the first timestamp for the PTP message received by each lane. Specifically, because deskew fifo is located in the PCS of the Ethernet port, in this application, you can pass the PMA and its neighbors. Enter the first timestamp for the received PTP message to achieve the timestamp when the PTP message crosses the time domain. For example, in the vicinity of the PMA serializer/deserializer (serializer/deserializer, serdes) entrance, a first timestamp is entered for each received PTP, and the entered first timestamp is accompanied by the transmission of the PTP message.
C、网络节点2在lane0~N接收网络节点1发送的多个PTP报文跨过时钟域后,即接收的多个PTP报文写入deskew fifo后,经deskew fifo输出时,将接收的多个PTP报文中分别打入第一时戳的第一时戳值,更新为所述多个PTP报文中目标PTP报文对应的目标时戳值,实现对各lane接收的PTP报文的延时差对齐。C. After receiving multiple PTP messages sent by network node 1 across the clock domain, network node 2 receives the multiple PTP messages written in deskew fifo, and then outputs it through deskew fifo after receiving the multiple PTP messages. The first timestamp value of the first timestamp is entered in each PTP message, and updated to the target timestamp value corresponding to the target PTP message in the multiple PTP messages, so as to realize the PTP message received by each lane Delay difference alignment.
其中,所述目标PTP报文为所述多个lane中目标lane接收的PTP报文,所述目标lane为延时最短的lane或延时最长的lane。Wherein, the target PTP message is a PTP message received by the target lane among the multiple lanes, and the target lane is the lane with the shortest delay or the lane with the longest delay.
具体的,如果目标lane为lane0~N中延时最长的lane,则网络节点2接收的多个PTP报文中打入第一时戳的第一时戳值最大的PTP报文,为lane0~N中延时最长的lane接收的PTP报文,网络节点2可以将每个lane接收的PTP报文中打入第一时戳的第一时戳值,更新为网络节点2接收的多个PTP报文中打入第一时戳的第一时戳值中最大的第一时戳值;同理,如果目标lane为lane0~N中延时最短的lane,网络节点2可以将每个lane接收的PTP报文中打入第一时戳的第一时戳值,更新为网络节点2接收的多个PTP报文中打入第一时戳的第一时戳值中最小的第一时戳值,实现将每个lane接收PTP报文的时戳的时戳值,补偿对齐到同一目标lane上,并且本申请的目标lane兼容现有协议的基准lane,即延时最长的lane。更新后,网络节点2根据任一lane接收的PTP报文更新后的第一时戳的第一时戳值(目标时戳值)与网络节点1发送多个PTP报文的发送时戳的时戳值的差,即可确定网络节点1和网络节点2之间的延时,其中对于网络节点1发送多个PTP报文的发送时戳的时戳值,网络节点2可以通过网络节点1发送多个PTP报文后,发送的携带所述多个PTP报文的发送时戳的跟随报文获知。Specifically, if the target lane is the lane with the longest delay from lane0 to N, the PTP message with the largest first timestamp value among the multiple PTP messages received by network node 2 is lane0. ~ The PTP message received by the lane with the longest delay in N, the network node 2 may update the first time stamp value of the first time stamp in the PTP message received by each lane, and update it to the number received by the network node 2 The first timestamp value of the first timestamp value of the first timestamp is entered in a PTP message; in the same way, if the target lane is the lane with the shortest delay among lane0~N, network node 2 can The first timestamp value entered into the first timestamp in the PTP message received by the lane is updated to the smallest first timestamp value entered into the first timestamp among the multiple PTP messages received by the network node 2 Timestamp value, to achieve the timestamp value of the timestamp received by each lane to receive PTP packets, to align the compensation to the same target lane, and the target lane of this application is compatible with the benchmark lane of the existing protocol, that is, the lane with the longest delay . After updating, the network node 2 updates the first timestamp value (target timestamp value) of the first timestamp according to the updated first timestamp of the PTP message received by any lane and the time when the network node 1 sends multiple PTP messages. The difference of the time stamp value can determine the delay between the network node 1 and the network node 2. For the time stamp value of the transmission time stamp of the network node 1 sending multiple PTP packets, the network node 2 can send through the network node 1 After multiple PTP messages are sent, the following message that carries the sending timestamp of the multiple PTP messages is learned.
以lane1为目标lane,网络节点2通过lane1接收的PTP报文1为例,B、网络节点1接收PTP报文1的接收时间为2018年11月23日19时23分1.02秒,为PTP报文1打入第一时戳,第一时戳的第一时戳值为2018年11月23日19时23分1.02秒,PTP报文1打入第一时戳后,写入deskew fifo进行多个lane的延时差对齐;C、deskew fifo输出PTP报文时,将PTP报文1的第一时戳的第一时戳值,更新为目标lane接收的目标PTP报文的第一时戳的第一时戳值,仍为2018年11月23日19时23分1.02秒。参照如图4所示的现有打戳处理的通信系统架构可知,现有技术对每个lane接收的PTP报文进行打戳“B”,发生在PTP报文写入deskew fifo之后,因以太端口的wr_clk,即外部PTP报文输入的时钟(如serdes时钟)与rd_clk,即以太端口的内部时钟不同,导致网络节点确定的每个lane的接收时戳的时戳值不准确,如确定的PTP报文1的第一时戳的第一时戳值为2018年11月23日19时23分1.03秒,进而导致网络节点间延时的测量不准确,而本申请在对每个lane接收的PTP报文进行打戳“B”,发生在PTP报文写入deskew fifo之前,打戳时PTP报文没有跨过时钟域,保证了对每个lane接收的PTP报文打戳的准确性,保证了网络节点间延时测量的准确性。Take lane1 as the target lane, and PTP message 1 received by network node 2 through lane1 as an example. The reception time of B and network node 1 to receive PTP message 1 is 19:23:1.02 seconds on November 23, 2018, which is the PTP message. The first timestamp is entered in the text 1, and the first timestamp value of the first timestamp is 19:23:1.02 seconds on November 23, 2018. After the first timestamp is entered in the PTP message 1, it is written to deskewfifo The delay difference of multiple lanes is aligned; when C, deskewfifo outputs a PTP message, the first timestamp value of the first timestamp of PTP message 1 is updated to the first time of the target PTP message received by the target lane The first timestamp value of the stamp is still 19:23:1.02 seconds on November 23, 2018. Referring to the communication system architecture of the existing stamping process shown in FIG. 4, it can be known that the prior art stamps “B” to the PTP message received by each lane, which occurs after the PTP message is written to deskewfifo, because of the Ethernet The wr_clk of the port, that is, the external PTP packet input clock (such as the serdes clock) is different from the rd_clk, that is, the internal clock of the Ethernet port, resulting in the inaccurate timestamp value of the received timestamp determined by the network node for each lane, as determined The first timestamp value of the first timestamp of PTP message 1 is 19:23:1.03 seconds on November 23, 2018, which in turn leads to inaccurate measurement of the delay between network nodes. The PTP message is stamped "B", which occurs before the PTP message is written to deskewfifo. The PTP message does not cross the clock domain when it is stamped, ensuring the accuracy of the PTP message received by each lane. , To ensure the accuracy of delay measurement between network nodes.
可选的,对于目标lane的确认,可以在网络节点1和网络节点2的以太端口1和以太端口2在初始化建链,或者重新建链时,网络节点2将以太端口2的每个lane接收的网络节点1通过以太端口1发送的PTP报文分别打入第三时戳,如果目标lane为延时最小的lane,则将打入第三时戳的第三时戳值最小的PTP报文的lane确定为目标lane;如果目标lane为延时最大的lane,则将打入第三时戳的第三时戳值最大的PTP报文的lane确定为目标lane。其中,在初始化建链,或者重新建链时,网络节点2对以太端口2的每个lane接收的PTP报文分别打入第三时戳,可以发生在PTP报文写入deskew fifo之前,也可以发生在PTP报文写入deskew fifo之后。Optionally, for the confirmation of the target lane, the network node 1 and the network node 2 can receive each lane of the Ethernet port 2 when the Ethernet port 1 and the Ethernet port 2 are initialized to establish a chain, or when the chain is re-established. The network node 1 sends the PTP packet sent via Ethernet port 1 into the third timestamp respectively. If the target lane is the lane with the smallest delay, the PTP packet with the smallest third timestamp value will be entered into the third timestamp. The lane is determined to be the target lane; if the target lane is the lane with the largest delay, the lane of the PTP packet with the third timestamp with the largest third timestamp value is determined as the target lane. Among them, when the chain is initialized or re-established, the network node 2 enters a third timestamp for the PTP message received by each lane of the Ethernet port 2, which can occur before the PTP message is written to deskewfifo, or It can happen after the PTP message is written to deskew fifo.
可选的,在跨过时钟域之前,网络节点2对以太端口2接收的多个PTP报文分别打入第一时戳的可以包括以下方式:Optionally, before crossing the clock domain, the network node 2 respectively inserting the first timestamp into multiple PTP packets received by the Ethernet port 2 may include the following manners:
方式一:method one:
网络节点2对以太端口2接收到的多个PTP报文的第一个bit分别打入第一时戳。The network node 2 enters a first timestamp respectively into the first bit of the multiple PTP packets received by the Ethernet port 2.
具体的,网络节点2针对以太端口2的每个lane,在该lane接收到PTP报文跨过时钟域之前,对该PTP报文打入第一时戳。因对PTP报文的第一个bit打入的第一时戳的时戳值,能真实反映PTP报文的接收时间,因此无需对PTP报文的第一时戳的时戳值进行校正,简化了打戳处理流程。Specifically, for each lane of the Ethernet port 2, before receiving the PTP message across the clock domain, the network node 2 adds a first time stamp to the PTP message. Because the timestamp value of the first timestamp entered in the first bit of the PTP message can truly reflect the receiving time of the PTP message, there is no need to correct the timestamp value of the first timestamp of the PTP message. Simplified the stamping process.
方式二:Method 2:
网络节点2对以太端口2接收到的多个PTP报文的设定bit分别打入第一时戳。其中设定bit可以为PTP报文的第一个bit、第三个bit、第七个bit等,可选的,设定bit位于PTP的报文头(sop bit)中。The network node 2 enters the first time stamp into the setting bits of the multiple PTP packets received by the Ethernet port 2 respectively. The setting bit may be the first bit, the third bit, the seventh bit, etc. of the PTP packet. Optionally, the setting bit is located in the PTP packet header (sop bit).
具体的,网络节点2针对以太端口2的每个lane,在该lane接收到PTP报文跨过时钟域之前,对该PTP报文打入第一时戳。Specifically, for each lane of the Ethernet port 2, before receiving the PTP message across the clock domain, the network node 2 adds a first time stamp to the PTP message.
因设定bit可以是第三个bit、第七个bit等,对PTP报文的设定bit打入第一时戳的第一时戳值,不能真实反映PTP报文的接收时间,在本申请中,还需要网络节点2将接收的每个PTP报文中打入第一时戳的时戳值校正至该PTP报文的第一个bit的接收时间。具体的,网络节点2针对每个lane接收的PTP报文,基于该PTP的设定bit与第一个bit的距离,确定在网络节点中该PTP报文由第一个bit传输至设定bit的第一传输时长,由于设定bit相对于每个lane都相同,每个lane接收的PTP报文由第一个bit传输至设定bit的第一传输时长相同,网络节点2将该PTP报文中打入第一时戳的第一时戳值,校正为该第一时戳值与第一传输时长的差值。可选的,网络节点2将接收的每个PTP报文中打入第一时戳的时戳值校正至该PTP报文的第一个bit的接收时间,可以在PTP报文跨过时钟域之前,也可以在PTP报文跨过时钟域之后,只要在将PTP报文中打入第一时戳的第一时戳值更新为目标PTP报文对应的目标时戳值之前实现即可。Since the setting bit can be the third bit, the seventh bit, etc., the first timestamp value of the first timestamp is entered into the setting bit of the PTP message, which cannot truly reflect the reception time of the PTP message. In the application, the network node 2 also needs to correct the time stamp value of the first time stamp in each received PTP message to the reception time of the first bit of the PTP message. Specifically, for the PTP message received by each lane, the network node 2 determines that the PTP message is transmitted from the first bit to the set bit in the network node based on the distance between the set bit of the PTP and the first bit The first transmission time is the same, because the set bit is the same for each lane, and the PTP packet received by each lane is transmitted from the first bit to the set bit. The first transmission time is the same, and the network node 2 reports the PTP message. The first timestamp value of the first timestamp is entered in the text and corrected to the difference between the first timestamp value and the first transmission duration. Optionally, the network node 2 corrects the timestamp value of the first timestamp in each received PTP message to the reception time of the first bit of the PTP message, which can cross the clock domain in the PTP message Before, it can also be achieved after the PTP message crosses the clock domain, before updating the first time stamp value into the first time stamp in the PTP message to the target time stamp value corresponding to the target PTP message.
示例性的,以lane3接收的PTP报文3、设定bit为第个7bit为例,PTP报文3中打入第一时戳的第一时戳值为2018年11月23日19时23分1.05秒,PTP报文3由第一个bit传输至第七个bit的第一传输时长为“0.1秒”,则校正后PTP报文3的第一时戳的第一时戳值为2018年11月23日19时23分1.04秒。Exemplarily, taking PTP message 3 received by lane 3 and setting bit as the first 7 bit as an example, the first time stamp value of the first time stamp entered in PTP message 3 is 19:23 on November 23, 2018 Minute 1.05 seconds, the first transmission time of PTP message 3 from the first bit to the seventh bit is "0.1 seconds", then the first timestamp value of the first timestamp of PTP message 3 after correction is 2018 November 23, 19:23:1.04 seconds.
方式三:Method 3:
网络节点2按照测量周期,根据当前测量周期以太端口2的多个lane分别对应的打戳时间,在PTP报文跨过时钟域之前,对以太端口2接收的多个PTP报文分别打入第一时戳。The network node 2 according to the measurement period, according to the corresponding stamping time of the multiple lanes of the Ethernet port 2 in the current measurement period, before the PTP message crosses the clock domain, the multiple PTP messages received by the Ethernet port 2 are respectively entered into the first A time stamp.
网络节点1和网络节点2之间进行延时测量的测量周期是已知的,网络节点2可以获知以太端口2每个lane在当前测量周期必然可以接收到PTP报文的时间段,并可以根据每个lane在当前测量周期必然可以接收到PTP报文的时间段,确定当前测量周期以太端口2每个lane对接收的PTP报文打戳的打戳时间,可选的,当前测量周期以太端口2每个lane对接收的PTP报文打戳的打戳时间打入的第一时戳,位于每个lane接收的PTP报文的报文头中。网络节点2根据当前测量周期以太端口2每个lane对接收的PTP报文进行打戳的打戳时间,对以太端口2每个lane接收的PTP报文打入第一时戳。The measurement period for the delay measurement between the network node 1 and the network node 2 is known, and the network node 2 can know the time period during which each lane of the Ethernet port 2 must receive the PTP message in the current measurement period, and can Each lane must be able to receive a PTP message in the current measurement period, and determine the current measurement period of Ethernet port 2. The time for each lane to stamp the received PTP message. Optionally, the current measurement period of the Ethernet port 2 The first timestamp entered by each lane for the time stamped by the received PTP message is located in the header of the PTP message received by each lane. The network node 2 adds a first time stamp to the PTP message received by each lane of the Ethernet port 2 according to the time when the Ethernet port 2 of the Ethernet port 2 stamps the received PTP message.
因PTP报文中打入第一时戳的目标bit可能是PTP报文的第一个bit,也可能是第二个bit、第五个bit等,不能真实反映PTP报文的接收时间,在本申请中,还需要网络节点2将接收的每个PTP报文中打入第一时戳的时戳值校正至该PTP报文的第一个bit的接收时间。具体的,网络节点2针对每个lane接收的PTP报文,基于该PTP的打入第一时戳的 目标bit与第一个bit的距离,确定在网络节点中该PTP报文由第一个bit传输至打入第一时戳的目标bit的第二传输时长,网络节点2将该PTP报文中打入第一时戳的第一时戳值,校正为该第一时戳值与第一传输时长的差值。可选的,网络节点2将接收的每个PTP报文中打入第一时戳的时戳值校正至该PTP报文的第一个bit的接收时间,可以在PTP报文跨过时钟域之前,也可以在PTP跨过时钟域之后,只要在将PTP报文中打入第一时戳的第一时戳值更新为目标PTP报文对应的目标时戳值之前实现即可。Because the target bit of the first timestamp in the PTP message may be the first bit of the PTP message, it may also be the second bit, the fifth bit, etc., which cannot truly reflect the reception time of the PTP message. In this application, the network node 2 is also required to correct the time stamp value of the first time stamp entered in each received PTP message to the reception time of the first bit of the PTP message. Specifically, for the PTP message received by each lane, the network node 2 determines, based on the distance between the target bit of the PTP that hits the first timestamp and the first bit, that the PTP message in the network node is determined by the first bit transmission to the second transmission duration of the target bit with the first timestamp, the network node 2 corrects the first timestamp value into the first timestamp in the PTP message, and corrects it to the first timestamp value and the first timestamp value A difference in transmission time. Optionally, the network node 2 corrects the timestamp value of the first timestamp in each received PTP message to the reception time of the first bit of the PTP message, which can cross the clock domain in the PTP message Previously, after the PTP crossed the clock domain, as long as the first timestamp value into the first timestamp in the PTP message was updated to the target timestamp value corresponding to the target PTP message, it may be implemented.
当然了,网络节点2在将以太端口2接收的多个PTP报文中分别打入的第一时戳的第一时戳值,更新为接收的多个PTP报文中目标PTP报文对应的目标时戳值时,还可以通过,针对接收的每个PTP报文,根据该PTP报文打入第一时戳的第一时戳值,与接收该PTP报文的lane相对于目标lane的延时差异的和,对该PTP报文中打入的第一时戳的第一时戳值进行更新。Of course, the network node 2 updates the first timestamp value of the first timestamp in the multiple PTP messages received by the Ethernet port 2 to the corresponding value of the target PTP message in the received multiple PTP messages When the target timestamp value, you can also pass, for each PTP message received, according to the PTP message into the first timestamp value of the first timestamp, and the received lane of the PTP message relative to the target lane The sum of the delay differences updates the first timestamp value of the first timestamp entered in the PTP message.
具体的,网络节点1可以预先在以太端口1的lane0~N发送一拍PTP报文,网络节点2的以太端口2,在以太端口2的每个lane接收的PTP报文跨过时钟域之前,对每个lane接收的PTP报文的bit打入第二时戳,根据每个lane接收的PTP报文的第二时戳的第二时戳值与目标lane接收的PTP报文的第二时戳的第二时戳值的差值,确定每个lane相对于目标lane的延时差异。Specifically, the network node 1 may send a beat PTP message in advance to lane 0 to N of the Ethernet port 1, and the Ethernet port 2 of the network node 2 before the PTP message received by each lane of the Ethernet port 2 crosses the clock domain, Enter a second timestamp to the bit of the PTP message received by each lane, according to the second timestamp value of the second timestamp of the PTP message received by each lane and the second timestamp of the PTP message received by the target lane The difference of the second time stamp value of the stamp determines the delay difference of each lane relative to the target lane.
通过本申请的打戳处理方法,还可以适用于多种以太端口组合(comb)场景,此时各以太端口共享MAC/PCS/前向纠错(forward error correction,FEC)等资源,各以太端口的工作时钟频率(以太端口的内部时钟频率)和外部PTP报文输入的时钟频率(如PMA位置的serdes时钟频率)不同,但是因为本申请的打戳处理是在PTP报文跨时钟与之前打戳,因此也适用于多种以太端口comb的场景。Through the stamping processing method of the present application, it can also be applied to a variety of Ethernet port combination (comb) scenarios. In this case, each Ethernet port shares resources such as MAC/PCS/forward error correction (FEC) and each Ethernet port. The working clock frequency (the internal clock frequency of the Ethernet port) is different from the clock frequency of the external PTP message input (such as the serdes clock frequency of the PMA position), but because the stamping process of this application is to cross the clock before the PTP message. Poke, so it is also applicable to a variety of Ethernet port comb scenarios.
基于上述实施例,如图5所示,本申请实施例提供了一种打戳处理方法,具体步骤包括:Based on the above embodiment, as shown in FIG. 5, an embodiment of the present application provides a stamping processing method, and specific steps include:
S501:网络节点对以太端口接收到的多个PTP报文分别打入第一时戳。其中,所述以太端口具有多个lane,所述多个PTP报文为所述网络节点通过所述多个lane接收的。S501: The network node respectively inserts a first timestamp into multiple PTP packets received on the Ethernet port. Wherein, the Ethernet port has multiple lanes, and the multiple PTP packets are received by the network node through the multiple lanes.
S502:所述网络节点在所述多个PTP报文跨过时钟域后,将所述多个PTP报文中分别打入第一时戳的第一时戳值,更新为所述多个PTP报文中目标PTP报文对应的目标时戳值。其中,所述目标PTP报文为所述多个lane中目标lane接收的PTP报文,所述目标lane为延时最短的lane或延时最长的lane;S502: After the multiple PTP messages cross the clock domain, the network node updates the first timestamp values of the first timestamps in the multiple PTP messages to update the multiple PTPs The target timestamp value corresponding to the target PTP packet in the packet. Wherein, the target PTP message is a PTP message received by the target lane among the multiple lanes, and the target lane is the lane with the shortest delay or the lane with the longest delay;
S503:所述网络节点根据所述目标时戳值与所述多个PTP报文的发送时戳的时戳值的差值,确定所述网络节点与发送所述多个PTP报文的网络节点间的延时。S503: The network node determines the network node and the network node that sent the plurality of PTP messages according to the difference between the target timestamp value and the timestamp value of the sending timestamp of the multiple PTP messages Time delay.
基于相同的构思,图6为本申请提供的一种网络节点600,包括:处理器601和收发器602;Based on the same concept, FIG. 6 is a network node 600 provided by this application, including: a processor 601 and a transceiver 602;
处理器601通过收发器602在以太端口接收到的多个PTP报文写入所述以太端口的deskew fifo之前,对所述多个PTP报文分别打入第一时戳;其中,所述以太端口具有多个lane,所述多个PTP报文为所述网络节点通过所述多个lane接收的;The processor 601, through the transceiver 602, before the multiple PTP messages received on the Ethernet port are written to the deskew fifo of the Ethernet port, respectively, the first timestamps are added to the multiple PTP messages; wherein, the Ethernet The port has multiple lanes, and the multiple PTP packets are received by the network node through the multiple lanes;
所述处理器601,还用于在所述deskew fifo输出所述多个PTP时,将所述多个PTP报文中分别打入第一时戳的第一时戳值,更新为所述多个PTP报文中目标PTP报文对应的目标时戳值;其中,所述目标PTP报文为所述多个lane中目标lane接收的PTP报文,所述目标lane为延时最短的lane或延时最长的lane;The processor 601 is further configured to update the first timestamp value of the first timestamp in the multiple PTP packets when the deskew fifo outputs the multiple PTPs, and update the first timestamp value to the multiple Target time stamp value corresponding to the target PTP message in the PTP messages; wherein, the target PTP message is the PTP message received by the target lane in the multiple lanes, and the target lane is the lane with the shortest delay or The lane with the longest delay;
所述处理器601,还用于根据所述目标时戳值与所述多个PTP报文的发送时戳的时戳值的差值,确定所述网络节点与发送所述多个PTP报文的网络节点间的延时。。The processor 601 is further configured to determine the network node and send the multiple PTP messages according to the difference between the target time stamp value and the time stamp value of the sending time stamp of the multiple PTP messages The delay between the network nodes. .
可选的,所述处理器601,具体用于通过收发器602在以太端口接收到的多个PTP报文写入所述以太端口的deskew fifo之前,对所述多个PTP报文的第一个bit分别打入第一时戳。Optionally, the processor 601 is specifically configured to use the transceiver 602 to write a plurality of PTP packets received on the Ethernet port before writing to the deskew fifo of the Ethernet port. The first timestamp is entered for each bit.
可选的,所述处理器601,具体用于通过收发器602在以太端口接收到的多个PTP报文写入所述以太端口的deskew fifo之前,对所述多个PTP报文的设定bit分别打入第一时戳;基于所述多个PTP报文分别对应所述设定bit与第一个bit的距离,确定所述多个PTP报文分别对应第一个bit至设定bit的第一传输时长;将所述多个PTP报文中分别打入第一时戳的第一时戳值,校正为所述第一时戳值与所述PTP报文对应的第一传输时长的差值。Optionally, the processor 601 is specifically configured to use the transceiver 602 to set the multiple PTP packets before the multiple PTP packets received on the Ethernet port are written to the deskew fifo of the Ethernet port The first timestamp is entered into each bit; based on the distance between the set bit and the first bit corresponding to the multiple PTP packets, it is determined that the multiple PTP packets respectively correspond to the first bit to the set bit The first transmission time; correct the first timestamp value of the first timestamp in each of the multiple PTP messages to the first transmission time length corresponding to the first timestamp value and the PTP message The difference.
可选的,所述处理器601,具体用于按照测量周期,根据当前测量周期以太端口的多个lane分别对应的打戳时间,通过收发器602在所述以太端口接收的多个PTP报文写入所述以太端口的deskew fifo之前,对所述多个PTP报文分别打入第一时戳;基于所述多个PTP报文分别对应打入第一时戳的目标bit与第一个bit的距离,确定所述多个PTP报文分别对应第一个bit至打入第一时戳的目标bit的第二传输时长;将所述多个PTP报文中分别打入第一时戳的第一时戳值,校正为所述第一时戳值与所述PTP报文对应的第二传输时长的差值。Optionally, the processor 601 is specifically configured to, according to the measurement period, according to the respective stamping times of the multiple lanes of the Ethernet port in the current measurement period, receive multiple PTP packets on the Ethernet port through the transceiver 602 Before writing to the deskew fifo of the Ethernet port, the first timestamps are respectively entered into the plurality of PTP packets; the target bit and the first one corresponding to the first timestamps are respectively entered based on the plurality of PTP packets the distance of the bit, to determine the second transmission duration of the multiple PTP packets corresponding to the first bit to the target bit with the first timestamp respectively; to insert the first timestamp respectively into the multiple PTP packets The first timestamp value of is corrected to the difference between the first timestamp value and the second transmission duration corresponding to the PTP packet.
可选的,所述处理器601,具体用于根据所述多个PTP报文中分别打入第一时戳的第一时戳值,与接收所述PTP报文的lane相对于目标lane的延时差异的和,对所述多个PTP报文中分别打入的第一时戳的第一时戳值进行更新;其中,多个lane分别相对于目标lane的延时差异,是根据在写入所述以太端口的deskew fifo之前,对所述目标lane接收的PTP报文的设定bit打入第二时戳的第二时戳值,分别与所述多个lane接收的PTP报文的设定bit打入第二时戳的第二时戳值的差确定的。Optionally, the processor 601 is specifically configured to input a first timestamp value into the plurality of PTP packets, and the value of the lane receiving the PTP packet relative to the target lane The sum of the delay difference updates the first timestamp value of the first timestamp respectively entered in the multiple PTP packets; where the delay difference of multiple lanes relative to the target lane is based on Before writing to deskewfifo of the Ethernet port, enter the second timestamp value of the second timestamp into the setting bit of the PTP message received by the target lane, respectively, and the PTP message received by the multiple lanes The set bit is determined by the difference of the second time stamp value into the second time stamp.
可选的,所述处理器601,具体用于在所述以太端口建链时,将对所述以太端口接收的多个PTP报文分别打入的第三时戳的第三时戳值中,最大时戳值的目标PTP报文所对应的lane或最小时戳值的目标PTP报文所述对应的lane,确定为目标lane。Optionally, the processor 601 is specifically configured to, when a link is established on the Ethernet port, enter a third timestamp value of a third timestamp respectively into a plurality of PTP packets received by the Ethernet port The lane corresponding to the target PTP packet with the maximum time stamp value or the target PTP packet with the minimum time stamp value is determined as the target lane.
基于相同的构思,本申请实施例还提供了一种网络节点。Based on the same concept, embodiments of the present application also provide a network node.
如图7所示,网络节点700包括存储器701、处理器702和收发器703。存储器701、处理器702和收发器703通过总线链接。存储器701用于存储计算机执行指令,当网络节点700运行时,处理器702通过收发器703执行存储器701中存储的计算机执行指令,以使网络节点700实现上述任一项打戳处理方法,可参考上文及其附图的相关描述,在此不做赘述。As shown in FIG. 7, the network node 700 includes a memory 701, a processor 702 and a transceiver 703. The memory 701, the processor 702, and the transceiver 703 are linked by a bus. The memory 701 is used to store computer-executed instructions. When the network node 700 is running, the processor 702 executes the computer-executed instructions stored in the memory 701 through the transceiver 703, so that the network node 700 implements any of the above stamping processing methods. The relevant descriptions of the above and the accompanying drawings are not repeated here.
本申请实施例提供了一种计算机存储介质,存储有计算机程序,该计算机程序包括用于执行上述方法实施例描述的打戳处理方法的指令。An embodiment of the present application provides a computer storage medium that stores a computer program, and the computer program includes instructions for executing the stamping processing method described in the foregoing method embodiment.
本申请实施例提供了一种包含指令的计算机程序产品,当其在网络节点上运行时,使得网络节点实现上述方法实施例描述的打戳处理方法。Embodiments of the present application provide a computer program product containing instructions that, when run on a network node, enable the network node to implement the stamping processing method described in the foregoing method embodiment.
本申请实施例提供了一种芯片,所述芯片与存储器相连,用于读取并执行所述存储器中存储的软件程序,以实现上述方法实施例描述的打戳处理方法。An embodiment of the present application provides a chip that is connected to a memory and used to read and execute a software program stored in the memory to implement the stamping processing method described in the foregoing method embodiments.
本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实 施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art should understand that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Moreover, the present application may take the form of a computer program product implemented on one or more computer usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer usable program code.
本申请是参照根据本申请实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。This application is described with reference to flowcharts and/or block diagrams of methods, devices (systems), and computer program products according to embodiments of the application. It should be understood that each flow and/or block in the flowchart and/or block diagram and a combination of the flow and/or block in the flowchart and/or block diagram may be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, special-purpose computer, embedded processing machine, or other programmable data processing device to produce a machine that enables the generation of instructions executed by the processor of the computer or other programmable data processing device A device for realizing the functions specified in one block or multiple blocks of one flow or multiple flows of a flowchart and/or one block or multiple blocks of a block diagram.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer readable memory that can guide a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, the instructions The device implements the functions specified in one block or multiple blocks of the flowchart one flow or multiple flows and/or block diagrams.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operating steps are performed on the computer or other programmable device to produce computer-implemented processing, which is executed on the computer or other programmable device The instructions provide steps for implementing the functions specified in one block or multiple blocks of the flowchart one flow or multiple flows and/or block diagrams.
尽管已描述了本申请的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例作出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本申请范围的所有变更和修改。Although the preferred embodiments of the present application have been described, those skilled in the art can make additional changes and modifications to these embodiments once they learn the basic inventive concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.
显然,本领域的技术人员可以对本申请实施例进行各种改动和变型而不脱离本申请实施例的精神和范围。这样,倘若本申请实施例的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。Obviously, those skilled in the art can make various modifications and variations to the embodiments of the present application without departing from the spirit and scope of the embodiments of the present application. In this way, if these modifications and variations of the embodiments of the present application fall within the scope of the claims of the present application and their equivalent technologies, the present application is also intended to include these modifications and variations.

Claims (16)

  1. 一种打戳处理方法,其特征在于,所述方法包括:A stamping processing method, characterized in that the method includes:
    网络节点对以太端口接收到的多个精确时间同步协议PTP报文分别打入第一时戳;其中,所述以太端口具有多个数据通路lane,所述多个PTP报文为所述网络节点通过所述多个lane接收的;The network node respectively inserts a first timestamp into multiple precision time synchronization protocol PTP messages received by the Ethernet port; wherein the Ethernet port has multiple data path lanes, and the multiple PTP messages are the network node Received through the multiple lanes;
    所述网络节点在所述多个PTP报文跨过时钟域后,将所述多个PTP报文中分别打入第一时戳的第一时戳值,更新为所述多个PTP报文中目标PTP报文对应的目标时戳值;其中,所述目标PTP报文为所述多个lane中目标lane接收的PTP报文,所述目标lane为延时最短的lane或延时最长的lane;After the multiple PTP messages cross the clock domain, the network node updates the first timestamp values of the first timestamps in the multiple PTP messages to update the multiple PTP messages The target timestamp value corresponding to the target PTP message in; where the target PTP message is the PTP message received by the target lane in the multiple lanes, and the target lane is the lane with the shortest delay or the longest delay Lane
    所述网络节点根据所述目标时戳值与所述多个PTP报文的发送时戳的时戳值的差值,确定所述网络节点与发送所述多个PTP报文的网络节点间的延时。The network node determines the difference between the network node and the network node sending the plurality of PTP messages according to the difference between the target time stamp value and the time stamp value of the sending time stamp of the multiple PTP messages Delay.
  2. 如权利要求1所述的方法,其特征在于,所述网络节点对以太端口接收到的多个PTP报文分别打入第一时戳,包括:The method according to claim 1, wherein the network node respectively entering a first timestamp into a plurality of PTP messages received by the Ethernet port includes:
    所述网络节点对以太端口接收到的多个PTP报文的第一个比特bit分别打入第一时戳。The network node respectively inserts a first timestamp into the first bit of multiple PTP messages received by the Ethernet port.
  3. 如权利要求1所述的方法,其特征在于,所述网络节点对以太端口接收到的多个PTP报文分别打入第一时戳,包括:The method according to claim 1, wherein the network node respectively entering a first timestamp into a plurality of PTP messages received by the Ethernet port includes:
    所述网络节点对以太端口接收到的多个PTP报文的设定bit分别打入第一时戳;The network node respectively inserts a first timestamp into the setting bits of multiple PTP packets received by the Ethernet port;
    所述网络节点基于所述多个PTP报文分别对应所述设定bit与第一个bit的距离,确定所述多个PTP报文分别对应第一个bit至设定bit的第一传输时长;The network node determines, based on the distances between the set bit and the first bit that the multiple PTP packets respectively correspond to the first bit, the first transmission duration corresponding to the first bit to the set bit ;
    所述网络节点将所述多个PTP报文中分别打入第一时戳的第一时戳值,校正为所述第一时戳值与所述PTP报文对应的第一传输时长的差值。The network node corrects the first timestamp value of the first timestamp into the plurality of PTP messages, respectively, and corrects the difference to the first timestamp value and the first transmission time length corresponding to the PTP message value.
  4. 如权利要求1所述的方法,其特征在于,所述网络节点对以太端口接收到的多个PTP报文分别打入第一时戳,包括:The method according to claim 1, wherein the network node respectively entering a first timestamp into a plurality of PTP messages received by the Ethernet port includes:
    所述网络节点按照测量周期,根据当前测量周期以太端口的多个lane分别对应的打戳时间,对所述以太端口接收的多个PTP报文分别打入第一时戳;According to the measurement period, according to the measurement period, according to the respective stamping times of the multiple lanes of the Ethernet port of the current measurement period, the first timestamps are respectively inserted into the multiple PTP packets received by the Ethernet port;
    所述网络节点基于所述多个PTP报文分别对应打入第一时戳的目标bit与第一个bit的距离,确定所述多个PTP报文分别对应第一个bit至打入第一时戳的目标bit的第二传输时长;The network node determines that the plurality of PTP packets correspond to the first bit to the first bit, respectively, based on the distance between the target bit and the first bit corresponding to the first timestamp respectively entered into the plurality of PTP packets Timestamp of the second transmission duration of the target bit;
    所述网络节点将所述多个PTP报文中分别打入第一时戳的第一时戳值,校正为所述第一时戳值与所述PTP报文对应的第二传输时长的差值。The network node corrects the first timestamp value of the first timestamp into the plurality of PTP messages, respectively, and corrects it to the difference between the first timestamp value and the second transmission duration corresponding to the PTP message value.
  5. 如权利要求1所述的方法,其特征在于,所述将所述多个PTP报文中分别打入第一时戳的第一时戳值,更新为所述多个PTP报文中目标PTP报文对应的目标时戳值,包括:The method according to claim 1, wherein the first timestamp value into which the first timestamp is respectively entered in the plurality of PTP packets is updated to the target PTP in the plurality of PTP packets The target timestamp value corresponding to the message includes:
    所述网络节点根据所述多个PTP报文中分别打入第一时戳的第一时戳值,与接收所述PTP报文的lane相对于目标lane的延时差异的和,对所述多个PTP报文中分别打入的第一时戳的第一时戳值进行更新;The network node adds the first timestamp value of the first timestamp to the plurality of PTP packets, and the difference between the delay of the lane receiving the PTP packet relative to the target lane. Update the first timestamp value of the first timestamp respectively entered in multiple PTP packets;
    其中,多个lane分别相对于目标lane的延时差异,是根据在跨时钟域之前,对所述目标lane接收的PTP报文的设定bit打入第二时戳的第二时戳值,分别与所述多个lane接收的PTP报文的设定bit打入第二时戳的第二时戳值的差确定的。Wherein, the delay difference of multiple lanes relative to the target lane is based on the second timestamp value of the second timestamp entered into the setting bit of the PTP message received by the target lane before crossing the clock domain, It is determined by the difference between the second timestamp value of the second timestamp and the set bit of the PTP message received by the multiple lanes respectively.
  6. 如权利要求1所述的方法,其特征在于,所述确定目标lane的过程包括:The method of claim 1, wherein the process of determining a target lane includes:
    所述网络节点在所述以太端口建链时,将对所述以太端口接收的多个PTP报文分别打入的第三时戳的第三时戳值中,最大时戳值的目标PTP报文所对应的lane或最小时戳值的目标PTP报文所述对应的lane,确定为目标lane。When the Ethernet node establishes a link with the Ethernet port, the third timestamp value of the third timestamp respectively entered into the plurality of PTP messages received by the Ethernet port, the target PTP message with the maximum timestamp value The corresponding lane of the target PTP packet with the minimum timestamp value or the corresponding lane is determined as the target lane.
  7. 一种网络节点,其特征在于,包括:处理器和收发器;A network node, characterized by comprising: a processor and a transceiver;
    处理器通过收发器在以太端口接收到的多个精确时间同步协议PTP报文写入所述以太端口的延时差对齐缓冲器deskew fifo之前,对所述多个PTP报文分别打入第一时戳;其中,所述以太端口具有多个数据通路lane,所述多个PTP报文为所述网络节点通过所述多个lane接收的;Before the multiple delay time synchronization protocol PTP messages received by the Ethernet port are written into the Ethernet port delay difference alignment buffer deskew fifo through the transceiver, the processor enters the multiple PTP messages respectively into the first Time stamp; wherein, the Ethernet port has multiple data path lanes, and the multiple PTP packets are received by the network node through the multiple lanes;
    所述处理器,还用于在所述deskew fifo输出所述多个PTP报文时,将所述多个PTP报文中分别打入第一时戳的第一时戳值,更新为所述多个PTP报文中目标PTP报文对应的目标时戳值;其中,所述目标PTP报文为所述多个lane中目标lane接收的PTP报文,所述目标lane为延时最短的lane或延时最长的lane;The processor is further configured to update the first timestamp value of the first timestamp in the multiple PTP messages when the deskew fifo outputs the multiple PTP messages, and update the value to the A target timestamp value corresponding to a target PTP message in multiple PTP messages; wherein, the target PTP message is a PTP message received by a target lane in the multiple lanes, and the target lane is the lane with the shortest delay Or the lane with the longest delay;
    所述处理器,还用于根据所述目标时戳值与所述多个PTP报文的发送时戳的时戳值的差值,确定所述网络节点与发送所述多个PTP报文的网络节点间的延时。The processor is further configured to determine, based on the difference between the target timestamp value and the timestamp value of the sending timestamp of the plurality of PTP messages, the network node and the number of sending the plurality of PTP messages Delay between network nodes.
  8. 如权利要求7所述的网络节点,其特征在于,所述处理器,具体用于通过收发器在以太端口接收到的多个PTP报文写入所述以太端口的deskew fifo之前,对所述多个PTP报文的第一个比特bit分别打入第一时戳。The network node according to claim 7, wherein the processor is specifically configured to write a plurality of PTP messages received on the Ethernet port through the transceiver before writing to deskewfifo of the Ethernet port. The first timestamp of the first bit of multiple PTP packets is respectively entered.
  9. 如权利要求7所述的网络节点,其特征在于,所述处理器,具体用于通过收发器在以太端口接收到的多个PTP报文写入所述以太端口的deskew fifo之前,对所述多个PTP报文的设定bit分别打入第一时戳;基于所述多个PTP报文分别对应所述设定bit与第一个bit的距离,确定所述多个PTP报文分别对应第一个bit至设定bit的第一传输时长;将所述多个PTP报文中分别打入第一时戳的第一时戳值,校正为所述第一时戳值与所述PTP报文对应的第一传输时长的差值。The network node according to claim 7, wherein the processor is specifically configured to write a plurality of PTP messages received on the Ethernet port through the transceiver before writing to deskewfifo of the Ethernet port. The setting bits of multiple PTP packets are respectively entered with a first time stamp; based on the distances between the set bits and the first bit corresponding to the multiple PTP packets, it is determined that the multiple PTP packets respectively correspond The first transmission time from the first bit to the set bit; the first timestamp value of the first timestamp respectively entered in the multiple PTP packets, corrected to the first timestamp value and the PTP The difference in the first transmission duration corresponding to the packet.
  10. 如权利要求7所述的网络节点,其特征在于,所述处理器,具体用于按照测量周期,根据当前测量周期以太端口的多个lane分别对应的打戳时间,通过收发器在所述以太端口接收的多个PTP报文写入所述以太端口的deskew fifo之前,对所述多个PTP报文分别打入第一时戳;基于所述多个PTP报文分别对应打入第一时戳的目标bit与第一个bit的距离,确定所述多个PTP报文分别对应第一个bit至打入第一时戳的目标bit的第二传输时长;将所述多个PTP报文中分别打入第一时戳的第一时戳值,校正为所述第一时戳值与所述PTP报文对应的第二传输时长的差值。The network node according to claim 7, wherein the processor is specifically configured to, according to the measurement period, according to the respective stamping times of multiple lanes of the Ethernet port of the current measurement period, pass the transceiver in the Ethernet Before writing multiple PTP messages received on the port to the deskew fifo of the Ethernet port, the first timestamps are respectively entered into the multiple PTP messages; the first time is entered based on the multiple PTP messages respectively The distance between the target bit of the stamp and the first bit to determine the second transmission duration of the multiple PTP packets corresponding to the first bit to the target bit with the first time stamp respectively; the multiple PTP packets The first timestamp value of the first timestamp respectively entered in is corrected to the difference between the first timestamp value and the second transmission duration corresponding to the PTP message.
  11. 如权利要求7所述的网络节点,其特征在于,所述处理器,具体用于根据所述多个PTP报文中分别打入第一时戳的第一时戳值,与接收所述PTP报文的lane相对于目标lane的延时差异的和,对所述多个PTP报文中分别打入的第一时戳的第一时戳值进行更新;其中,多个lane分别相对于目标lane的延时差异,是根据在写入所述以太端口的deskew fifo之前,对所述目标lane接收的PTP报文的设定bit打入第二时戳的第二时戳值,分别与所述多个lane接收的PTP报文的设定bit打入第二时戳的第二时戳值的差确定的。The network node according to claim 7, wherein the processor is specifically configured to input a first timestamp value into the plurality of PTP packets and receive the PTP The sum of the delay difference of the lane of the message relative to the target lane updates the first timestamp value of the first timestamp respectively entered in the multiple PTP packets; wherein multiple lanes are respectively relative to the target The delay difference of the lane is based on the second timestamp value entered into the second timestamp of the setting bit of the PTP message received by the target lane before writing to the deskewfifo of the Ethernet port, respectively. The setting bit of the PTP message received by the multiple lanes is determined by the difference between the second timestamp value of the second timestamp.
  12. 如权利要求7所述的网络节点,其特征在于,所述处理器,具体用于在所述以太端口建链时,将对所述以太端口接收的多个PTP报文分别打入的第三时戳的第三时戳值中,最大时戳值的目标PTP报文所对应的lane或最小时戳值的目标PTP报文所述对应的lane,确定为目标lane。The network node according to claim 7, wherein the processor is specifically configured to, when the Ethernet port establishes a link, respectively enter a plurality of PTP messages received on the Ethernet port into a third In the third timestamp value of the timestamp, the lane corresponding to the target PTP packet with the largest timestamp value or the corresponding lane of the target PTP packet with the smallest timestamp value is determined as the target lane.
  13. 一种网络节点,其特征在于,包括处理器、收发器和存储器;A network node, characterized by comprising a processor, a transceiver and a memory;
    所述存储器,存储有计算机程序;The memory stores a computer program;
    所述收发器,用于进行数据发送和接收;The transceiver is used for data transmission and reception;
    所述处理器,用于调用所述存储器中存储的计算机程序,通过所述收发器来执行如权利要求1-7任一项所述的方法。The processor is configured to call a computer program stored in the memory and execute the method according to any one of claims 1-7 through the transceiver.
  14. 一种计算机存储介质,其特征在于,所述计算机可读存储介质包括计算机程序,当计算机程序在网络节点上运行时,使得所述网络节点执行如权利要求1-7任一项所述的方法。A computer storage medium, characterized in that the computer-readable storage medium includes a computer program, which causes the network node to execute the method according to any one of claims 1-7 when the computer program runs on the network node .
  15. 一种计算机程序产品,其特征在于,当网络节点读取并执行所述计算机程序产品时,使得网络节点执行如权利要求1-7任一项所述的方法。A computer program product, characterized in that, when a network node reads and executes the computer program product, the network node is caused to perform the method according to any one of claims 1-7.
  16. 一种芯片,其特征在于,所述芯片与存储器相连,用于读取并执行所述存储器中存储的软件程序,以实现如权利要求1-7任一项所述的方法。A chip, characterized in that the chip is connected to a memory for reading and executing a software program stored in the memory to implement the method according to any one of claims 1-7.
PCT/CN2018/123226 2018-12-24 2018-12-24 Method and device for stamping processing WO2020132834A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201880100455.7A CN113228564B (en) 2018-12-24 2018-12-24 Stamping processing method and device
PCT/CN2018/123226 WO2020132834A1 (en) 2018-12-24 2018-12-24 Method and device for stamping processing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2018/123226 WO2020132834A1 (en) 2018-12-24 2018-12-24 Method and device for stamping processing

Publications (1)

Publication Number Publication Date
WO2020132834A1 true WO2020132834A1 (en) 2020-07-02

Family

ID=71129469

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/123226 WO2020132834A1 (en) 2018-12-24 2018-12-24 Method and device for stamping processing

Country Status (2)

Country Link
CN (1) CN113228564B (en)
WO (1) WO2020132834A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114221733B (en) * 2021-12-27 2023-11-07 深圳市紫光同创电子有限公司 Error compensation method for synchronizing time stamps

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105680973A (en) * 2011-02-15 2016-06-15 通用电气公司 A method of time synchronization of free running nodes in an avionics network
US20170288801A1 (en) * 2016-04-01 2017-10-05 Khalifa University Of Science, Technology And Research Methods and systems for estimating offset and skew using linear programming
CN108880723A (en) * 2017-05-16 2018-11-23 深圳市中兴软件有限责任公司 A kind of method and apparatus that clock is synchronous
US20180343183A1 (en) * 2017-05-26 2018-11-29 Solarflare Communications, Inc. Time Stamping Network Device

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104113517A (en) * 2013-04-22 2014-10-22 华为技术有限公司 Timestamp generation method, device and system
CN103580846B (en) * 2013-08-23 2017-03-01 北京东土科技股份有限公司 A kind of method and system across non-1588 network transmission precision interval clock messages
JP2017098694A (en) * 2015-11-20 2017-06-01 富士通株式会社 Communication apparatus and time synchronizing method therefor
CN106788842B (en) * 2016-11-30 2019-03-26 瑞斯康达科技发展股份有限公司 A kind of processing method and SOC of PTP message

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105680973A (en) * 2011-02-15 2016-06-15 通用电气公司 A method of time synchronization of free running nodes in an avionics network
US20170288801A1 (en) * 2016-04-01 2017-10-05 Khalifa University Of Science, Technology And Research Methods and systems for estimating offset and skew using linear programming
CN108880723A (en) * 2017-05-16 2018-11-23 深圳市中兴软件有限责任公司 A kind of method and apparatus that clock is synchronous
US20180343183A1 (en) * 2017-05-26 2018-11-29 Solarflare Communications, Inc. Time Stamping Network Device

Also Published As

Publication number Publication date
CN113228564B (en) 2022-12-30
CN113228564A (en) 2021-08-06

Similar Documents

Publication Publication Date Title
US8370675B2 (en) Precise clock synchronization
KR102031268B1 (en) Method and apparatus for communicating time information between time-aware devices
US10931391B2 (en) One-step time stamping of synchronization packets for networked devices
KR101749202B1 (en) Method, apparatus, and system for generating timestamp
JP5518191B2 (en) Method and system for optical transmission network carrying time synchronization protocol
US20070268938A1 (en) Network time protocol precision timestamping service
US20080183899A1 (en) Server time protocol messages and methods
US11424902B2 (en) System and method for synchronizing nodes in a network device
JP6351889B1 (en) Communication system and slave device
US11349587B2 (en) Generating a timestamp
US20220248353A1 (en) Synchronization method and device
JP6227888B2 (en) Communication system, synchronization system, and communication method
WO2015131626A1 (en) Time synchronization method and apparatus for network devices and time synchronization server
CN103647614A (en) Method for reliably improving time synchronization precision based on IEEE1588 protocol
WO2020132834A1 (en) Method and device for stamping processing
CN113381832B (en) Precise time synchronization method based on FPGA platform
US11757614B2 (en) Accurate timestamp correction
US11606156B1 (en) Clock synchronization
CN114138054A (en) Timestamp obtaining method and device, electronic equipment and storage medium
CN114884605A (en) Method for realizing time synchronization of network nodes based on FPGA
CN112564838A (en) Time-sensitive Ethernet communication system and method based on carry chain
CN117220817B (en) Method and system for time synchronization monitoring of multi-core processor
US20240089021A1 (en) System and methods for network data processing
WO2024054912A1 (en) System and methods for network data processing
CN111865467A (en) Clock synchronization system and method between distributed chassis board cards for time delay test

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18945209

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18945209

Country of ref document: EP

Kind code of ref document: A1