WO2012092789A1 - 测量报文在以太交换设备中的延时的方法及以太交换设备 - Google Patents

测量报文在以太交换设备中的延时的方法及以太交换设备 Download PDF

Info

Publication number
WO2012092789A1
WO2012092789A1 PCT/CN2011/080801 CN2011080801W WO2012092789A1 WO 2012092789 A1 WO2012092789 A1 WO 2012092789A1 CN 2011080801 W CN2011080801 W CN 2011080801W WO 2012092789 A1 WO2012092789 A1 WO 2012092789A1
Authority
WO
WIPO (PCT)
Prior art keywords
message
packet
converted signal
preset
layer chip
Prior art date
Application number
PCT/CN2011/080801
Other languages
English (en)
French (fr)
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 华为技术有限公司
Publication of WO2012092789A1 publication Critical patent/WO2012092789A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements

Definitions

  • the present invention relates to an Ethernet switching device delay measurement technique, and more particularly to a method for measuring a delay of a message in an Ethernet switching device and an Ethernet switching device.
  • the delay of the packets passing through the switching device is as small as possible, and the Ethernet switching device buffers, looks up the table, modifies the headers, outputs the queues, outputs, etc. Processing.
  • the processing flow of the related packets in the Ethernet switching device is different for different services.
  • the traffic volume of the Ethernet switching device varies according to the traffic volume of the Ethernet switching device.
  • the network topology of the Ethernet switching device changes. This can cause fluctuations in the central processing unit (CPU) of the device.
  • CPU central processing unit
  • the processing delay of the packet in the EtherSwitch device is different. Therefore, the delay of the packet in the switching device needs to be measured.
  • test message is sent to a port of the tested EtherSwitch device through the test instrument, and the test instrument records the time at which the test packet is sent.
  • the measured Ethernet switching device forwards the detection message, and then sends the detection message to the test instrument from another port.
  • the test instrument receives the detection message from another port of the tested Ethernet switching device, and records the receiving time.
  • the test instrument compares the recorded time of sending the message with the time of receiving the message, and obtains the packet exchanged in the measured Ethernet. The delay in the device.
  • the CPU obtains the packet received by the forwarding module at the receiving end of the forwarding module of the Ethernet switching device, and records the time for obtaining the packet. After the forwarding process is complete, the forwarding module sends the packet to the port and the CPU at the same time. The CPU records the time when the packet is sent by the forwarding module, and then uses the time of the two records to obtain the delay of the packet in the forwarding module. The difference between this and the delay of the Ethernet switching device.
  • the embodiment of the invention provides a method for measuring the delay of a packet in an EtherSwitch device and an EtherSwitch device to improve the accuracy of the delay of the measurement packet in the EtherSwitch device.
  • the embodiment of the invention provides a method for measuring the delay of a packet in an Ethernet switching device, including: an Ethernet switching device (Media Access Control, MAC) layer chip and a physical layer (English: physical layer) PHY layer) triggers timing when the content of the specific location of the message received by the interface between the chips matches the preset message content;
  • an Ethernet switching device Media Access Control, MAC
  • a physical layer English: physical layer
  • the timer is stopped, and the delay of the packet in the EtherSwitch device is obtained.
  • the embodiment of the present invention further provides an Ethernet switching device, including a MAC layer chip and a PHY layer chip, and further includes a packet detecting module, where the packet detecting module is hanged on the MAC layer chip and the PHY layer chip.
  • an Ethernet switching device including a MAC layer chip and a PHY layer chip
  • a packet detecting module where the packet detecting module is hanged on the MAC layer chip and the PHY layer chip.
  • the delay of the measurement packet in the EtherSwitch device and the EtherSwitch device are used to test the packet delay of the interface between the MAC layer chip and the PHY layer chip in the EtherSwitch device in the actual working state. Time, because the delay in the packet PHY layer chip is fixed, the time for the packet to enter and leave the Ethernet switching device can be accurately measured, and the delay of the packet in the Ethernet switching device can be accurately obtained.
  • the technical solution provided in this embodiment improves the accuracy of the delay detection, not only avoids the extra consumption of the Ethernet switching device port, but also performs measurement in the actual use of the Ethernet switching device, thereby improving the accuracy of the delay detection.
  • FIG. 1 is a schematic diagram of a method for delaying a measurement packet in an Ethernet switching device
  • FIG. 2 is another schematic diagram of a method for delaying a normal measurement message in an Ethernet switching device
  • FIG. 3 is a flow chart of a method for measuring a delay of a packet in an Ethernet switching device according to an embodiment of the present invention
  • FIG. 4 is a flow chart of another method for measuring delay of a packet in an Ethernet switching device according to an embodiment of the present invention.
  • FIG. 5 is a schematic structural diagram of an input packet detecting circuit for implementing a method for detecting a delay of a packet in an Ethernet switching device according to an embodiment of the present disclosure
  • FIG. 6 is a schematic structural diagram of an output packet detecting circuit for implementing a method for detecting a delay of a packet in an Ethernet switching device according to an embodiment of the present invention
  • FIG. 7 is a schematic diagram of application of a packet detecting module in a method for implementing delay of detecting a packet in an Ethernet switching device according to an embodiment of the present disclosure
  • FIG. 8 is a schematic diagram of signal definition of a UI interface in a method for implementing delay of detecting a packet in an Ethernet switching device according to an embodiment of the present disclosure
  • FIG. 9 is a schematic diagram of a frame structure of an Ethernet message in a method for implementing a delay of detecting a delay in an Ethernet switching device according to an embodiment of the present invention.
  • FIG. 10 is a block diagram of an input packet detecting circuit and an output packet detecting circuit for implementing the delay of the foregoing packet in an Ethernet switching device according to an embodiment of the present invention
  • FIG. 11A is a schematic diagram of an embodiment of the present invention.
  • FIG. 11B is a schematic diagram of an embodiment of the present invention.
  • FIG. 12 is a schematic structural diagram of a system for measuring a delay of a packet in an Ethernet switching device according to an embodiment of the present invention.
  • FIG. 3 is a flow chart of a method for measuring a delay of a packet in an Ethernet switching device according to an embodiment of the present invention. As shown in Figure 3, the method includes:
  • Step 31 When the content of the specific location of the packet received by the Ethernet switching device on the interface between the MAC layer chip and the PHY layer chip matches the preset message content, the timing is triggered.
  • the method for determining that the content of the specific location of the received message matches the content of the preset message may include, that is, the foregoing step 31 may include:
  • the signals received by the interface between the MAC layer chip and the PHY layer chip are serial-to-parallel converted to obtain the first converted signal and identify the start position of the message. Comparing the first converted signal at a specific position after the start position of the message with the encoded value of the preset message content.
  • the method for identifying the starting position of the message may include:
  • the position at which the first converted signal matches the preset header code value is used as the header of the message to be detected, that is, the start position of the message is identified.
  • the Ethernet switching device triggers the timing component timing.
  • the timing component can be a CPU or timer in the Ethernet switching device, or a dedicated timer or oscilloscope outside the Ethernet switching device.
  • Step 32 When the content of the specific location of the packet sent by the interface matches the content of the preset packet, stop timing, and obtain a delay of the packet in the Ethernet switching device.
  • step 31 above can include:
  • the signals transmitted by the interface between the MAC layer chip and the PHY layer chip are serial-to-parallel converted to obtain a second converted signal and identify the start position of the message. Comparing the second converted signal at a specific position after the start position of the message with the encoded value of the preset message content.
  • the method for identifying the starting position of the message may include:
  • the position at which the second converted signal matches the preset header code value is used as the header of the message to be detected, that is, the start position of the message is identified.
  • the Ethernet switching device stops the timing component, and the timing component is the timing of the above-mentioned Ethernet switching device trigger timing. Parts.
  • the above steps 31 and 32 can be implemented by software or by hardware circuits.
  • the preset header and the content of the packet can be flexibly configured during the normal operation of the EtherSwitch device.
  • the packet used for measuring the delay can be flexibly configured before or during the operation of the EtherSwitch device. It can be configured through console command line mode or WEB mode.
  • the method of delay measurement using the CPU in the Ethernet switching device cannot obtain the delay of the message in the MAC layer chip, and the delay of the message in the MAC layer chip is not fixed.
  • the technical solution provided in this embodiment is to test the packet delay time on the interface between the MAC layer chip and the PHY layer chip in the Ethernet switching device in the actual working state, because the delay in the packet PHY layer chip is not fixed. Change, can accurately measure the time that the message enters and leaves the Ethernet switching device, and improves the accuracy of the delay detection. Compared with the test instrument usually used in the test environment, it not only avoids the extra consumption of the Ethernet switching device port, but also measures the actual use of the Ethernet switching device, which improves the accuracy of the delay detection. In addition, during the normal operation of the EtherSwitch device, the packets used to measure the delay can be flexibly configured.
  • FIG. 4 is a flow chart of another method for measuring delay of a packet in an Ethernet switching device according to an embodiment of the present invention.
  • the method is implemented by a hardware circuit.
  • the measurement methods include:
  • Step 41 In the EtherSwitch device, the input packet detecting circuit performs serial-to-parallel conversion on the signal received by the interface between the MAC layer chip and the PHY layer chip to obtain the first converted signal.
  • Step 42 Compare the first converted signal with a preset header encoded value.
  • the preset header is the header of the to-be-detected message, and the start position of the message is identified by comparing the received first converted signal with a preset encoded value.
  • Step 43 If the first converted signal matches the preset header encoding value, start counting, such as the number of bits or the number of clocks, to prepare to receive the content of the specific location of the message.
  • Step 44 When the count reaches a preset value, compare the first converted signal obtained by the subsequent serial-to-parallel conversion with the encoded value of the preset message content.
  • the preset message content is a pre-stored content of a certain field or a specific location in the to-be-detected message, and the first converted signal and the preset message content are compared after the preset value is compared.
  • the value that is, the content of the specific position of the received message and the content of the preset message are compared, and the received message is obtained as the to-be-detected message, and the time when the content of the packet enters the interface is regarded as the waiting time. Checks the time when the packet enters the Ethernet switching device.
  • Step 45 In the case that the first converted signal obtained by the subsequent serial-to-parallel conversion matches the encoded value of the preset message content, the timing is triggered, for example, the output pulse triggers the timing component to start timing.
  • the timing component can be too Change the CPU and timer in the device, or you can use a special timer or oscilloscope outside the Ethernet switching device.
  • Step 46 The output packet detecting circuit performs serial-to-parallel conversion on the signal sent by the interface between the MAC layer chip and the PHY layer chip to obtain a second converted signal.
  • Step 47 Compare the second converted signal with the preset header encoding value, where the preset header encoding value is the same as the header encoding value preset in step 42.
  • Step 48 Start counting when the second converted signal matches the preset header encoding value.
  • Step 49 When the count reaches the preset value, compare the second converted signal obtained by the subsequent serial-to-parallel conversion with the encoded value of the preset message content. Comparing the encoded value of the second converted signal and the preset message content after the preset value is reached, that is, comparing the content of the specific position of the transmitted message with the preset message content, and the transmitted message can be known. Whether the message is a packet to be detected, and the time at which the content of the packet is sent on the interface is used as the time when the packet to be detected leaves the Ethernet switching device.
  • the preset value is the same as the value preset in step 44, and the preset message content is the same as the coded value of the message content preset in step 44.
  • Step 410 If the second converted signal obtained by the subsequent serial-to-parallel conversion matches the encoded value of the preset message content, stop timing, for example, the output pulse triggers the timing component to stop timing, and obtains the timing value of the timing component.
  • the timing value is used as the delay of the message in the EtherSwitch device.
  • the Ethernet switching device in the actual working state tests the packet delay time between the MAC layer chip and the PHY layer chip through the built-in input packet detecting circuit and the output packet detecting circuit, and Since the delay in the message PHY layer chip is usually fixed, the time for the message to enter and leave the Ethernet switching device can be accurately measured. Moreover, when the hardware circuit is used for detection, the delay generated by itself is fixed, the execution speed is fast, and the measurement result is not affected. Therefore, the technical solution provided by the embodiment improves the delay detection with respect to the CPU detection. Accuracy, and measurement with the test instrument usually in the test environment, not only avoids the extra consumption of the Ethernet switching device port, but also measures the actual use of the Ethernet switching device, improving the accuracy of the delay detection.
  • the foregoing storage medium includes: a medium that can store program codes, such as a ROM, a RAM, a magnetic disk, or an optical disk.
  • FIG. 5 is a schematic structural diagram of an input packet detecting circuit for implementing a method for delaying a measurement message in an Ethernet switching device according to an embodiment of the present invention.
  • the input packet detection circuit that is, the input packet detection circuit in the foregoing method embodiment, is disposed in the EtherSwitch device and is hanged on the interface between the MAC layer chip and the PHY layer chip. As shown in FIG.
  • the input packet detecting circuit includes: a first serial-to-parallel conversion circuit 51, a first buffer 52, a first register 53, a first comparator 54, a counter 55, a second register 56, and a second serial-to-parallel conversion The circuit 57, the second buffer 58, the third register 59, and the second comparator 510.
  • the first serial-to-parallel conversion circuit 51 is connected to the receiving pin of the interface for serial-to-parallel conversion of the signal received by the interface to obtain a first converted signal. And synchronized with the clock of the interface to ensure that the conversion circuit can correctly sample the correct data.
  • An input of the first buffer 52 is coupled to the first serial to parallel conversion circuit for buffering the first converted signal.
  • the first register 53 is used to store a preset header encoded value.
  • An input of the first comparator 54 is coupled to the output of the first buffer and the first register for comparing the first converted signal with the preset header encoded value.
  • An enable terminal of the counter 55 is coupled to the output of the first comparator for starting counting if the first converted signal matches a preset header encoded value.
  • a second register 56 is coupled to the counter for storing preset values.
  • the second serial-to-parallel conversion circuit 57 is connected to the receiving pin of the interface, and the clock is synchronized for the MAC layer chip and
  • the signals received subsequently by the interface between the PHY layer chips are serial-to-parallel converted to obtain a first converted signal.
  • This partial serial-to-parallel conversion function can also be implemented by the first serial-to-parallel conversion circuit 51 to omit the second serial-to-parallel conversion circuit 57.
  • the input end of the second buffer 58 is connected to the second serial-to-parallel conversion circuit 57 or to the first serial-to-parallel conversion circuit 51 for buffering the first converted signal obtained by the subsequent serial-to-parallel conversion.
  • the third register 59 is used to store the encoded value of the preset message content.
  • the input end of the second comparator 510 is connected to the output end of the second buffer 58 and the third register 59, and the enable end is connected to the output end of the counter 55 for the subsequent serial-to-parallel conversion.
  • a pulse is output to trigger the timing component to start timing.
  • the input packet detecting circuit identifies the packet received by the Ethernet switching device at the receiving pin of the interface between the MAC layer chip and the PHY layer chip through the serial-to-parallel conversion circuit, the buffer, the register, the counter, and the comparator. And when it is tested that some or all of the packet enters the EtherSwitch device, the output pulse triggers the timing component timing, and accurately obtains the time point when the packet enters the EtherSwitch device, thereby delaying the packet in the EtherSwitch device. The measurement is more precise.
  • FIG. 6 is a schematic structural diagram of an output packet detecting circuit for implementing a method for delaying a measurement message in an Ethernet switching device according to an embodiment of the present invention.
  • the output packet detecting circuit is the method in the foregoing method embodiment.
  • the output packet detecting circuit is side-mounted on the interface between the MAC layer chip and the PHY layer chip.
  • the output packet detecting circuit is substantially the same as the input packet detecting circuit, and the transmitting pin of the connection interface includes: a first serial-to-parallel conversion circuit 61, a first buffer 62, a first register 63, and a first comparator. 64.
  • the first serial-to-parallel conversion circuit 61 is connected to the transmitting pin of the interface, and is clock-synchronized for serial-to-parallel conversion of the signal sent by the interface to obtain a second converted signal.
  • An input of the first buffer 62 is coupled to the first serial to parallel conversion circuit for buffering the second converted signal.
  • the first register 63 is used to store a preset header encoded value.
  • An input of the first comparator 64 is coupled to the output of the first buffer and the first register for comparing the second converted signal with the preset header encoded value.
  • An enable terminal of the counter 65 is coupled to the output of the first comparator for starting counting if the second converted signal matches a preset header encoded value.
  • a second register 66 is coupled to the counter for storing preset values.
  • a second serial-to-parallel conversion circuit 67 is coupled to the transmit pin of the interface and synchronized with the clock of the interface for
  • the signal subsequently transmitted by the interface between the MAC layer chip and the PHY layer chip is serial-to-parallel converted to obtain a second converted signal.
  • This partial serial-to-parallel conversion function can also be implemented by the first serial-to-parallel conversion circuit 61 to omit the second serial-to-parallel conversion circuit 67.
  • the input of the second buffer 68 is connected to the second serial-to-parallel conversion circuit 67 or the first serial-to-parallel conversion circuit 61 for buffering the second converted signal obtained by the subsequent serial-to-parallel conversion.
  • the third register 69 is for storing the encoded value of the preset message content.
  • the input end of the second comparator 610 is connected to the output end of the second buffer 68 and the third register 69, and the enable end is connected to the output end of the counter 65 for the subsequent serial-to-parallel conversion.
  • a pulse is output to trigger the timing component to stop timing.
  • the output packet detecting circuit identifies the packet sent by the Ethernet switching device at the transmitting pin of the interface between the MAC layer chip and the PHY layer chip through the serial-to-parallel conversion circuit, the buffer, the register, the counter, and the comparator. And when it is tested that some or all of the packet leaves the Ethernet switching device, the output pulse triggers the timing component to stop timing, and accurately acquires the time point when the packet leaves the Ethernet switching device, thereby delaying the packet in the Ethernet switching device. The measurement is more precise.
  • the packet detection module 71 is connected to the Mill interface to identify the packets sent and received by the interface.
  • the packet detecting module 71 includes the input packet detecting circuit and the output packet detecting circuit provided by the foregoing embodiments. After the input packet detecting circuit recognizes the message, the timing pulse is output to enable the external timing component to start timing; after the output packet detecting circuit recognizes the message, the stop timing pulse is output from the hardware pin to stop the external timing component. Timing, thereby obtaining the delay between the MAC layer chips of the message in the EtherSwitch device.
  • the signal definition of the ⁇ interface is shown in Figure 8, including the transmit signal TXD [3: 0], TX_ER, transmit pin enable signal TX_EN, transmit clock TX_CLK, receive signal RXD[3: 0], RX-ER, receive clock RX_CLK, CRS and RX—DV.
  • the frame structure of the Ethernet packet is as shown in Figure 9, including Preamble/SFD, destination MAC address DA, source MAC address SA, message length Ln, message data LLC data, and checksum FCS.
  • the Ethernet message is transmitted in half-byte serial on the TXD pin, where la indicates Preamble At the beginning of the first nibble, lb denotes the beginning of the first half of the SFD, and subsequently transmits the destination MAC address DA, the source MAC address SA, the message length Ln, the message data LLC data, and the checksum FCS.
  • the first serial-to-parallel conversion circuit 101 is configured to perform serial-to-parallel conversion on the data on the UI interface, and store the converted data in an 8-byte buffer (8-byte buffer 102).
  • the 8-byte buffer 102 is a buffer of 8 bytes in length.
  • the internal first register 103 is used to store preset header data such as P rea mble/SFD in the Ethernet message.
  • the first comparator 104 is for comparing the data buffered in the 8-byte buffer 102 with the header data stored in the first register 103.
  • the first serial-to-parallel conversion circuit 101 converts the data to the Ether.
  • the Preamble/SFD of the text is buffered in the 8-byte buffer 102.
  • the data buffered in the 8-byte buffer 102 is the same as the header data stored in the first register 103, and the first comparator 104 outputs A count-enabled (Counter-Enable) signal to counter 105 indicates that counter 105 can begin counting.
  • the second register 106 is used to store the length between the start position and the second comparison of the message, which is the count value to be reached by the counter 105.
  • the second register 106 is used to store the length between the start position and the second comparison of the message, which is the count value to be reached by the counter 105.
  • the distance from the SFD to the SFD is 6 bytes.
  • the output compare enable signal is high, indicating that the second comparator 1010 can compare the message.
  • the second serial-to-parallel conversion circuit 107 just converts the obtained data into the content AABBCC of the SA, and buffers it into the N-byte buffer 108.
  • the second comparator 1010 can be used to compare the content of any portion of the Ethernet message to determine when the Ethernet message is sent or received. Taking the comparison SA as an example, if it is necessary to detect that the SA is AABBCC, the AABBCC is stored in the third register 109, wherein the N-byte buffer 108 is the same buffer as the preset message content, and the SPN is The length of the preset message content. In this embodiment, N is 6, and the N byte buffer 108 is used to buffer 6 bytes of data.
  • the second comparator 1010 compares the message SA buffered in the N-byte buffer 108 with the message content AABBCC preset in the third register 109, if the two match, therefore, the second Comparator 1010 outputs a high pulse to the external timing component to cause the external timing component to begin timing or stop timing.
  • This pulse indicates the exact point in time at which the Ethernet message enters or leaves the device.
  • the pulse output from the second comparator 1010 causes the external timing unit to start counting; when Fig. 10 is the output packet detecting circuit, the pulse output from the second comparator 1010 causes the external timing unit to stop timing. Therefore, the timing component can accurately know the delay time of the message in the Ethernet switching device.
  • external timing components have many possibilities, such as CPU in Ethernet devices, external dedicated timers, and even oscilloscopes.
  • the first register, the second register, and the third register can be written by the network management system or by other means.
  • the type of the packet to be detected and the content of the packet can be written in the above register as needed to pass the detection packet. Any location, any length of content, to achieve the purpose of detecting the delay of the message in the Ethernet switching device.
  • FIG. 11 is a schematic structural diagram of an EtherSwitch device for implementing a method for delaying a measurement packet in an EtherSwitch device according to an embodiment of the present invention.
  • the Ethernet switching device includes a MAC layer chip 111, a PHY layer chip 112, and a message detecting module 110.
  • the message detecting module 110 is configured to receive an interface between the MAC layer chip 11 1 and the PHY layer chip 112.
  • the timing is triggered; and when the content of the specific location of the message sent by the interface matches the preset message content, The timing is stopped, and the delay of the message in the EtherSwitch device is obtained.
  • the message detecting module 110 may include an input packet detecting module and an output packet detecting module.
  • FIG. 11B is another schematic structural diagram of an EtherSwitch device for implementing the method for measuring the delay of the measurement packet in the EtherSwitch device according to the embodiment of the present invention.
  • the input packet detecting module 113 is hanged on the message receiving pin of the interface between the MAC layer chip 111 and the PHY layer chip 112, and is used between the MAC layer chip and the PHY layer chip.
  • the timing is triggered; and the signal received by the interface between the MAC layer chip and the PHY layer chip is serially converted and converted before the trigger timing is obtained.
  • the output packet detection module 114 is hanged on the message sending pin of the interface between the MAC layer chip 111 and the PHY layer chip 112, and is used for the packet sent on the interface and the preset message content. In the case of a match, the trigger timing is terminated to obtain the delay of the message in the EtherSwitch device; and is further used between the MAC layer chip and the PHY layer chip after the input packet detection module 113 triggers the timing.
  • the signal sent by the interface is serial-to-parallel converted to obtain a second converted signal, identifying a message start position of the second converted signal, and comparing the start position of the message to the specific position
  • the encoded value of the second converted signal and the preset message content is any one of the input packet detecting circuits provided by the above embodiment
  • the output packet detecting module 114 is any one of the output packet detecting circuits provided by the above embodiments.
  • the preset contents in the first register, the second register, and the third register in the input packet detecting module 113 are respectively preset in the first register, the second register, and the third register in the output packet detecting module 114.
  • the content is the same.
  • the Ethernet switching device provided by the embodiment of the present invention may further include a timing module, and the enabling end is connected to the output end of the packet detecting module for triggering timing, that is, connected to the output end of the input packet detecting module, to detect in the input packet.
  • the module outputs a pulse
  • timing is started, and the stop end is connected to the output end of the message detecting module for stopping the timing, that is, connected to the output end of the output packet detecting module, to output a pulse in the output packet detecting module.
  • the timing is stopped, and the delay of the message in the Ethernet switching device is obtained.
  • the Ethernet switching device tests the packet delay time on the interface between the MAC layer chip and the PHY layer chip through the packet detection module, and the delay in the packet PHY layer chip is fixed, and the accuracy can be accurately Measurement message
  • the technical solution improves the accuracy of the delay detection, and the measurement is performed in comparison with the test instrument in the test environment, which not only avoids the extra consumption of the Ethernet switching device port, but also improves the measurement in the actual use of the Ethernet switching device.
  • the accuracy of the delay detection can be flexibly configured.
  • FIG. 12 is a schematic structural diagram of a system for measuring a delay of a packet in an Ethernet switching device according to an embodiment of the present invention.
  • the system is used to implement the method for measuring the delay of the measurement message in the EtherSwitch device provided by the foregoing embodiment.
  • the system includes a timing component 121 and an Ethernet switching device 122.
  • the Ethernet switching device 122 can be any of the Ethernet switching devices provided by the above device embodiments.
  • the enable end of the timing component 121 is connected to the output of the second comparator in the input packet detecting circuit of the Ethernet switching device 122, and the second end of the output packet detecting circuit of the Ethernet switching device 122
  • the outputs of the comparators are connected.
  • the timing component can be a dedicated timer or oscilloscope outside the Ethernet switching device.
  • the system for measuring the delay of the message in the EtherSwitch device passes the timing component and the EtherSwitch device using the above input and output packet detection circuit, thereby improving the accuracy of the delay detection, as compared with the usual test.
  • the use of test instruments for measurement in the environment not only avoids the extra consumption of the Ethernet switching device port, but also performs measurement in the actual use of the Ethernet switching device, improving the accuracy of the delay detection.
  • the packets used for delay measurement can be flexibly configured.
  • the technical solution provided by the above embodiments can accurately test the delay of the message in the device, for example, in the Institute of Electrical and Electronics Engineers (Ins ti tut e of E ec tri ca l and E l ec t ron i In the Cs Eng ineer s, IEEE 1588 application, the Sync message has a specific encapsulation method. Please refer to the 1588 specification. Similar to the detection of the Ethernet message, the header can be used to identify the Sync message, and the content of a certain segment of the message can be detected to accurately test the time point at which the Sync message enters and leaves the device. In some devices with high requirements on delay accuracy, it is convenient to provide the delay test capability of the message in the device.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Mobile Radio Communication Systems (AREA)

Description

测量报文在以太交换设备中的延时的方法及以太交换设备
本申请要求于 2011年 1月 7日提交中国专利局、 申请号为 201110002864. 3、 发明 名称为 "测量报文在以太交换设备中的延时的方法及以太交换设备"的中国专利申请的 优先权, 其全部内容通过引用结合在本申请中。 技术领域 本发明涉及以太交换设备延时测量技术,尤其涉及一种测量报文在以太交换设备中 的延时的方法及以太交换设备。 背景技术 对数据通信网络的管理、 控制、 诊断时, 有时需要对系统中各个节点的报文延时、 线路传输延时做测量。 如对于证券公司等一些特殊应用场合, 需要报文通过交换设备的 延时越小越好, 而以太交换设备对接收的报文会进行缓存、 查表、 报文头修改、 输出排 队、 输出等处理过程。 并且, 对于不同的业务, 其相关报文在以太交换设备内部的处理 流程不一样; 以太交换设备各个端口不同的流量大小, 会造成以太交换设备内部缓存的 波动; 以太交换设备所在网络拓扑的变动会造成设备中央处理器 (英语: Central Processing Unit, CPU) 占有率的波动。 这些情况都会造成报文在以太交换设备中的处 理延时的差异, 因此需要对报文在交换设备中的延时进行测量。
通常, 测量报文在以太交换设备中的延时方法有两种。
一种方法如图 1所示, 在试验环境中, 通过测试仪器向被测的以太交换设备的一个 端口发送检测报文, 同时测试仪器记录发送检测报文的时间。 被测的以太交换设备对检 测报文做转发处理, 之后从另一个端口将检测报文发送到测试仪器。 测试仪器从被测的 以太交换设备的另一个端口接收该检测报文, 记录接收时间, 测试仪器通过比较记录的 发送报文的时间及接收报文的时间, 得到报文在被测的以太交换设备中的延时。
另一种方法如图 2所示,在实际使用中,利用以太交换设备中的 CPU进行延时测量。
CPU在以太交换设备的转发模块的接收端获取转发模块接收的报文, 并记录获取报文的 时间。 转发模块在转发处理完成后, 将此报文同时送出端口和 CPU, CPU记录转发模块 发送报文的时间, 然后利用两次记录的时间获得报文在转发模块中的延时, 即两次时间 之间的差值, 并以此作为该以太交换设备的延时。
通常存在的缺陷在于, 前一种方法测试的环境与以太交换设备实际运行的环境差异 较大, 因此测量的延时无法准确反映以太交换设备在实际使用中的真实延时情况。 后一 种方法测试中, CPU在忙时、 闲时对延时测量的处理优先级不同, 进一步导致测量结果 的准确性差。 发明内容
本发明实施例提出一种测量报文在以太交换设备中的延时的方法及以太交换设备, 以提高测量报文在以太交换设备中延时的准确性。
本发明实施例提供了一种测量报文在以太交换设备中的延时的方法, 包括: 以太交换设备在介质访问控制 (英语: Media Access Control , MAC) 层芯片与物 理层 (英语: physical layer, PHY layer) 芯片之间的接口接收的报文的特定位置的 内容与预置的报文内容匹配时, 触发计时;
所述接口发送的报文的所述特定位置的内容与所述预置的报文内容匹配时,停止计 时, 得到所述报文在所述以太交换设备中的延时。
本发明实施例还提供了一种以太交换设备, 包括 MAC层芯片及 PHY层芯片, 其中, 还 包括报文检测模块, 所述报文检测模块侧挂在所述 MAC层芯片与 PHY层芯片之间的接口 上,用于在 MAC层芯片与 PHY层芯片之间的接口接收的报文的特定位置的内容与预置的报 文内容匹配时, 触发计时; 并用于在所述接口发送的报文的所述特定位置的内容与所述 预置的报文内容匹配时, 停止计时, 得到所述报文在所述以太交换设备中的延时。
上述实施例提供的测量报文在以太交换设备中的延时的方法及以太交换设备,通过 在处于实际工作状态的以太交换设备中 MAC层芯片与 PHY层芯片之间的接口测试报文延 时时间, 由于报文 PHY层芯片中的延时固定不变, 从而可以精确的测量报文进入及离开 以太交换设备的时间, 准确得到报文在以太交换设备中的延时。 本实施例提供的技术方 案提高了延时检测的准确性, 不仅避免了以太交换设备端口的额外消耗, 且在以太交换 设备的实际使用中进行测量, 提高了延时检测的准确性。 另外, 在以太交换设备正常运 行的过程中, 可以灵活配置用于测量延时的报文。 附图说明 为了更清楚地说明本发明实施例或现有技术中的技术方案, 下面将对实施例或现有 技术描述中所需要使用的附图作简单地介绍, 显而易见地, 下面描述中的附图仅仅是本 发明的一些实施例, 对于本领域普通技术人员来讲, 在不付出创造性劳动性的前提下, 还可以根据这些附图获得其他的附图。
图 1为通常测量报文在以太交换设备中的延时方法的一种示意图;
图 2为通常测量报文在以太交换设备中的延时方法的另一种示意图;
图 3为本发明实施例提供的一种测量报文在以太交换设备中的延时的方法的流程 图;
图 4为本发明实施例提供的另一种测量报文在以太交换设备中的延时的方法的流程 图;
图 5为本发明实施例提供的用于实现上述测 j t报文在以太交换设备中的延时的方法 的输入包检测电路的结构示意图;
图 6为本发明实施例提供的用于实现上述测 j t报文在以太交换设备中的延时的方法 的输出包检测电路的结构示意图;
图 7为本发明实施例提供的用于实现上述测 j t报文在以太交换设备中的延时的方法 中报文检测模块的应用示意图;
图 8为本发明实施例提供的用于实现上述测 j t报文在以太交换设备中的延时的方法 中 ΜΠ接口的信号定义示意图;
图 9为本发明实施例提供的用于实现上述测 j t报文在以太交换设备中的延时的方法 中以太报文的帧结构示意图;
图 10为本发明实施例提供的用于实现上述泖匱报文在以太交换设备中的延时的方 法中输入包检测电路及输出包检测电路的框图;
图 11A为本发明实施例提供的用于实现上述
法的以太交换设备的一种结构示意图;
图 11B为本发明实施例提供的用于实现上述
法的以太交换设备的另一种结构示意图;
图 12为本发明实施例提供的测量报文在以太交换设备中的延时的系统的结构示意
具体实施方式 下面通过实施例对本发明的具体实现过程进行举例说明。 显然, 下面所描述的实施 例是本发明一部分实施例, 而不是全部的实施例。 基于本发明中的实施例, 本领域普通 技术人员在没有做出创造性劳动前提下所获得的所有其他实施例, 都属于本发明保护的 范围。
图 3为本发明实施例提供的一种测量报文在以太交换设备中的延时的方法的流程 图。 如图 3所示, 该方法包括:
步骤 31、 以太交换设备在 MAC层芯片与 PHY层芯片之间的接口接收的报文的特定位置 的内容与预置的报文内容匹配时, 触发计时。
判断接收的报文的特定位置的内容与预置的报文内容匹配的实现方法可包括, 即上 述步骤 31之前可包括:
对 MAC层芯片与 PHY层芯片之间的接口接收的信号进行串并转换, 获得第一被转换信 号并识别出报文起始位置。 比较该报文起始位置后特定位置的第一被转换信号和预置的 报文内容的编码值。
识别报文起始位置的方法可以包括:
将所述第一被转换信号与预置的报头编码值进行比较;
将所述第一被转换信号与预置的报头编码值匹配的位置作为待检测报文的报头, 即 识别出了报文起始位置。
以太交换设备触发计时部件计时, 计时部件可以是以太交换设备内的 CPU、 计时器, 也可以是以太交换设备外的专门的计时器或者示波器。
步骤 32、 所述接口发送的报文的所述特定位置的内容与所述预置的报文内容匹配 时, 停止计时, 得到所述报文在所述以太交换设备中的延时。
判断发送的报文的特定位置的内容与预置的报文内容匹配的实现方法和判断接收 的报文的特定位置的内容与预置的报文内容匹配的实现方法基本相同, 即上述步骤 31之 后可包括:
对 MAC层芯片与 PHY层芯片之间的接口发送的信号进行串并转换, 获得第二被转换信 号并识别出报文起始位置。 比较该报文起始位置后特定位置的第二被转换信号和预置的 报文内容的编码值。
识别报文起始位置的方法可以包括:
将所述第二被转换信号与预置的报头编码值进行比较;
将所述第二被转换信号与预置的报头编码值匹配的位置作为待检测报文的报头, 即 识别出了报文起始位置。
以太交换设备使计时部件停止计时, 计时部件是上述以太交换设备触发计时的计时 部件。
上述步骤 31、 步骤 32可通过软件实现, 也可通过硬件电路实现。 其中, 预置的报头 及报文内容可在以太交换设备正常运行的过程中灵活配置, 换句话说, 在以太交换设备 运行之前或者运行过程中可以灵活配置用于测量延时的报文, 如可通过控制台命令行方 式的或者 WEB方式等配置。
通常的利用以太交换设备中的 CPU进行延时测量的方法,无法得到报文在 MAC层芯片 中的延时, 而报文在 MAC层芯片中的延时并不是固定不变的。 本实施例提供的技术方案, 通过在处于实际工作状态的以太交换设备中的 MAC层芯片与 PHY层芯片之间的接口测试 报文延时时间, 由于报文 PHY层芯片中的延时固定不变, 可以精确的测量报文进入及离 开以太交换设备的时间, 提高了延时检测的准确性。 相对于通常在试验环境中采用测试 仪器进行测量, 不仅避免了以太交换设备端口的额外消耗, 且在以太交换设备的实际使 用中进行测量, 提高了延时检测的准确性。 另外, 在以太交换设备正常运行的过程中, 可以灵活配置用于测量延时的报文。
图 4为本发明实施例提供的另一种测量报文在以太交换设备中的延时的方法的流程 图。 该方法采用硬件电路实现。 如图 4所示, 测量方法包括:
步骤 41、 在以太交换设备中, 输入包检测电路对 MAC层芯片与 PHY层芯片之间的接口 接收的信号进行串并转换, 获得第一被转换信号。
步骤 42、 将所述第一被转换信号与预置的报头编码值进行比较。 预置的报头即待检 测报文的报头, 通过将接收的第一被转换信号与预置的编码值相比较, 识别出报文起始 位置。
步骤 43、 在所述第一被转换信号与预置的报头编码值匹配的情况下, 开始计数, 如 比特数或时钟数, 以准备接收报文特定位置的内容。
步骤 44、 在计数达到预置的数值的情况下, 将后续串并转换得到的第一被转换信号 与预置的报文内容的编码值进行比较。 其中, 预置的报文内容即预先保存的待检测报文 中某字段或某个特定位置的内容, 比较计数达到预置的数值后的第一被转换信号和预置 的报文内容的编码值, 即比较了接收的报文的特定位置的内容与预置的报文内容, 可以 获知接收的报文是否为待检测报文, 并以该报文的这部分内容进入接口的时刻作为待检 测报文进入以太交换设备的时刻。
步骤 45、在后续串并转换得到的第一被转换信号与预置的报文内容的编码值匹配的 情况下, 触发计时, 如输出脉冲触发计时部件开始计时。 其中, 计时部件可以是以太交 换设备内的 CPU、 计时器, 也可以是以太交换设备外的专门的计时器或者示波器。
步骤 46、输出包检测电路对 MAC层芯片与 PHY层芯片之间的接口发送的信号进行串并 转换获得第二被转换信号。
步骤 47、 将第二被转换信号与所述预置的报头编码值进行比较, 所述预置的报头编 码值与步骤 42中预置的报头编码值相同。
步骤 48、在所述第二被转换信号与所述预置的报头编码值匹配的情况下,开始计数。 步骤 49、 在计数达到所述预置的数值的情况下, 将后续串并转换得到的第二被转换 信号与所述预置的报文内容的编码值进行比较。 比较计数达到预置的数值后的第二被转 换信号和预置的报文内容的编码值, 即比较了发送的报文的特定位置的内容与预置的报 文内容, 可以获知发送的报文是否为待检测报文, 并以该报文的这部分内容在接口发送 的时刻作为待检测报文离开以太交换设备的时刻。 其中, 所述预置的数值和步骤 44中预 置的数值相同, 所述预置的报文内容和步骤 44中预置的报文内容的编码值相同。
步骤 410、 在后续串并转换得到的第二被转换信号与所述预置的报文内容的编码值 匹配的情况下,停止计时,如输出脉冲触发计时部件停止计时,获得计时部件的计时值, 将所述计时值作为报文在以太交换设备中的延时。
本实施例提供的技术方案中, 处于实际工作状态的以太交换设备通过内置的输入包 检测电路及输出包检测电路, 在 MAC层芯片与 PHY层芯片之间的接口测试报文延时时间, 且由于报文 PHY层芯片中的延时通常固定不变, 可以精确的测量报文进入及离开以太交 换设备的时间。 并且当采用硬件电路检测时, 其本身产生的延时固定, 执行速度较快, 不会对测量结果造成影响, 因此相对于通常利用 CPU检测, 本实施例提供的技术方案提 高了延时检测的准确性, 且相对于通常在试验环境中采用测试仪器进行测量, 不仅避免 了以太交换设备端口的额外消耗, 且在以太交换设备的实际使用中进行测量, 提高了延 时检测的准确性。
本领域普通技术人员可以理解: 实现上述方法实施例的全部或部分步骤可以通过程 序指令相关的硬件来完成, 前述的程序可以存储于一计算机可读取存储介质中, 该程序 在执行时, 执行包括上述方法实施例的步骤; 而前述的存储介质包括: R0M、 RAM, 磁碟 或者光盘等各种可以存储程序代码的介质。
图 5为本发明实施例提供的用于实现上述测量报文在以太交换设备中的延时的方法 的输入包检测电路的结构示意图。 本实施例中, 输入包检测电路即上述方法实施例中的 输入包检测电路,设置于以太交换设备中,侧挂在 MAC层芯片与 PHY层芯片之间的接口上, 如图 5所示, 输入包检测电路包括: 第一串并转换电路 51、 第一缓冲器 52、 第一寄存器 53、 第一比较器 54、 计数器 55、 第二寄存器 56、 第二串并转换电路 57、 第二缓冲器 58、 第三寄存器 59及第二比较器 510。
第一串并转换电路 51与所述接口的接收引脚相连,用于对所述接口接收的信号进行 串并转换, 获得第一被转换信号。 且与所述接口的时钟同步, 以保证转换电路可以正确 无误的采样到正确的数据。
第一缓冲器 52的输入端与所述第一串并转换电路相连,用于缓存所述第一被转换信 号。
第一寄存器 53用于存储预置的报头编码值。
第一比较器 54的输入端与所述第一缓冲器的输出端及所述第一寄存器相连,用于比 较所述第一被转换信号与所述预置的报头编码值。
计数器 55的使能端与所述第一比较器的输出端相连,用于在所述第一被转换信号与 预置的报头编码值匹配的情况下, 开始计数。
第二寄存器 56与所述计数器相连, 用于存储预置的数值。
第二串并转换电路 57与所述接口的接收引脚相连, 且时钟同步, 用于 MAC层芯片与
PHY层芯片之间的接口后续接收的信号进行串并转换, 得到第一被转换信号。 该部分串 并转换功能也可由第一串并转换电路 51实现, 以省去第二串并转换电路 57。
第二缓冲器 58的输入端与所述第二串并转换电路 57或与第一串并转换电路 51相连, 用于缓存后续串并转换得到的第一被转换信号。
第三寄存器 59用于存储预置的报文内容的编码值。
第二比较器 510的输入端与所述第二缓冲器 58的输出端及所述第三寄存器 59相连, 使能端与所述计数器 55输出端相连,用于在后续串并转换得到的第一被转换信号与所述 预置的报文内容的编码值匹配的情况下, 输出脉冲, 以触发计时部件开始计时。
本实施例中, 输入包检测电路通过串并转换电路、 缓冲器、 寄存器、 计数器及比较 器, 在 MAC层芯片与 PHY层芯片之间的接口的接收引脚识别出以太交换设备接收的报文, 并在测试到该报文某一部分或全部进入到以太交换设备时, 输出脉冲触发计时部件计 时, 准确地获取了报文进入以太交换设备的时间点, 从而使得以太交换设备中报文延时 的测量更加精确。
图 6为本发明实施例提供的用于实现上述测量报文在以太交换设备中的延时的方法 的输出包检测电路的结构示意图。 本实施例中, 输出包检测电路即上述方法实施例中的 输出包检测电路, 侧挂在 MAC层芯片与 PHY层芯片之间的接口上。 如图 6所示, 输出包检 测电路与输入包检测电路基本相同,连接接口的发送引脚,包括:第一串并转换电路 61、 第一缓冲器 62、 第一寄存器 63、 第一比较器 64、 计数器 65、 第二寄存器 66、 第二串并转 换电路 67、 第二缓冲器 68、 第三寄存器 69及第二比较器 610。
第一串并转换电路 61与所述接口的发送引脚相连, 且时钟同步, 用于对所述接口发 送的信号进行串并转换, 获得第二被转换信号。
第一缓冲器 62的输入端与所述第一串并转换电路相连,用于缓存所述第二被转换信 号。
第一寄存器 63用于存储预置的报头编码值。
第一比较器 64的输入端与所述第一缓冲器的输出端及所述第一寄存器相连,用于比 较所述第二被转换信号与所述预置的报头编码值。
计数器 65的使能端与所述第一比较器的输出端相连,用于在所述第二被转换信号与 预置的报头编码值匹配的情况下, 开始计数。
第二寄存器 66与所述计数器相连, 用于存储预置的数值。
第二串并转换电路 67与所述接口的发送引脚相连, 且与所述接口的时钟同步, 用于
MAC层芯片与 PHY层芯片之间的接口后续发送的信号进行串并转换, 得到第二被转换信 号。该部分串并转换功能也可由第一串并转换电路 61实现,以省去第二串并转换电路 67。
第二缓冲器 68的输入端与所述第二串并转换电路 67或第一串并转换电路 61相连,用 于缓存后续串并转换得到的第二被转换信号。
第三寄存器 69用于存储预置的报文内容的编码值。
第二比较器 610的输入端与所述第二缓冲器 68的输出端及所述第三寄存器 69相连, 使能端与所述计数器 65输出端相连,用于在后续串并转换得到的第二被转换信号与所述 预置的报文内容的编码值匹配的情况下, 输出脉冲, 以触发计时部件停止计时。
本实施例中, 输出包检测电路通过串并转换电路、 缓冲器、 寄存器、 计数器及比较 器, 在 MAC层芯片与 PHY层芯片之间的接口的发送引脚识别出以太交换设备发送的报文, 并在测试到该报文某一部分或全部离开以太交换设备时,输出脉冲触发计时部件停止计 时, 准确地获取了报文离开以太交换设备的时间点, 从而使得以太交换设备中报文延时 的测量更加精确。
以 100M以太的介质独立接口 (英语: Media Independent Interface, Mi l ) 为例, 对 PHY的 MI I接口处实现报文的延时测量进行说明。 如图 7所示, 报文检测模块 71侧挂在 Mil接口上, 对 ΜΠ接口发送、 接收的报文进行 识别。 其中报文检测模块 71包括上述实施例提供的输入包检测电路及输出包检测电路。 当输入包检测电路识别到报文后, 输出计时脉冲, 以使外部计时部件开始计时; 当输出 包检测电路识别到报文后, 从硬件管脚上输出停止计时脉冲, 以使外部计时部件停止计 时, 从而获得报文在以太交换设备中 MAC层芯片之间的延时。
ΜΠ接口的信号定义如图 8所示, 包括发送信号 TXD [3: 0]、 TX_ER、 发送引脚使能信 号 TX_EN、发送时钟 TX_CLK、接收信号 RXD[3: 0]、 RX— ER、接收时钟 RX_CLK、 CRS及 RX— DV。
以太报文的帧结构如图 9所示, 包括 Preamble/SFD、 目的 MAC地址 DA、 源 MAC地址 SA、 报文长度 Ln、 报文数据 LLC data及校验和 FCS。
其中, Preamble—共 7个字节 (Byte),二进制表示为: 101010101010101010101010 10101010101010101010101010101010; SFD—共一个 Byte, 二进制表示为: 10101011。 这样, Preamble+SFD体现在 ΜΠ接口的时序如表 1所示。
表 1被发送的 Preamble和 SFD
信号
TXDO X la 1 1 1 1 1 1 1 1 1 1 1 1 1 lb 1 DOc D4d
TXD1 X 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Dl D5
TXD2 X 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 D2 D6
TXD 3 X 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 D3 D7
TX-EN 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 由表 1可见, 以太报文在 TXD引脚上是以半个字节的串行传输, 其中 la表示 Preamble 的第 1个半字节的开始, lb表示 SFD的前半个字节的开始, 后续依次传输目的 MAC地址 DA、 源 MAC地址 SA、 报文长度 Ln、 报文数据 LLC data及校验和 FCS。
报文检测模块 71中, 输入包检测电路及输出包检测电路的框图均如图 10所示。 其中, 第一串并转换电路 101用于对 ΜΠ接口上的数据做串并转换, 将转换得到的数 据存储在 8 byte buffer (8字节缓冲器 102) 中。 8字节缓冲器 102是长度为 8字节的缓冲 器。 内部的第一寄存器 103用于存储预置的报头数据如以太报文中的 Preamble/SFD。 第 一比较器 104用于比较缓存在 8字节缓冲器 102中的数据及第一寄存器 103中存储的报头 数据。 当 8字节缓冲器 102中缓存的数据是 ΜΠ接口上的 Preamble/SFD时, 即当 ΜΠ接口接 收或发送以太报文的 Preamble/SFD时, 第一串并转换电路 101转换得到数据即以太报文 的 Preamble/SFD, 并被缓存在 8字节缓冲器 102中, 此时, 缓存在 8字节缓冲器 102中的数 据与第一寄存器 103中存储的报头数据相同, 第一比较器 104输出值为 1的计数使能 (Counter-Enable) 信号至计数器 105, 表示计数器 105可以开始计数。
第二寄存器 106用来存储报文需要第二次比较的开始位置与之间的长度, 是计数器 105所要达到的计数值。 假设需要比较以太报文的 SA, SA距离 SFD—共是 6Byte, 在 ΜΠ接 口上, 一个 Byte需要两个时钟周期, 这样就可通过控制台命令行方式的或者 WEB方式等 方式预先将 6X2=12填到第二寄存器 106中。 计数器 105计数到 12个半字节后, 输出比较 使能 (Compare Enable) 信号为高, 表示第二比较器 1010可以比较报文了。 此时, 第二 串并转换电路 107恰好转换得到的数据为 SA的内容 AABBCC, 并缓存至 N字节缓冲器 108中。
第二比较器 1010可以用来比较以太报文的任意一部分的内容, 以确定以太报文的发 送或接收的时刻。 以比较 SA为例, 假设需要检测 SA为 AABBCC的报文, 则将 AABBCC存储在 第三寄存器 109中, 其中 N字节缓冲器 108是与预置的报文内容长度相同的缓冲器, SPN为 预置的报文内容长度。 本实施例中, N为 6, N字节缓冲器 108用来缓存 6个字节数据。 当 比较使能信号为高时,第二比较器 1010比较 N字节缓冲器 108中缓存的报文 SA和第三寄存 器 109中预置的报文内容 AABBCC, 如果二者匹配, 因此, 第二比较器 1010输出一个高脉 冲至外部计时部件, 使外部计时部件开始计时或停止计时。 此脉冲表示以太报文进入或 者离开设备的准确时间点。 当图 10为输入包检测电路时, 第二比较器 1010输出的脉冲使 外部计时部件开始计时; 当图 10为输出包检测电路时, 第二比较器 1010输出的脉冲使外 部计时部件停止计时。 从而可通过计时部件准确获知报文在以太交换设备中的延时时 间。 其中, 外部的计时部件有很多可能, 比如以太网设备内的 CPU、 外部的专门的计时 器、 甚至示波器等。
上述第一寄存器、 第二寄存器及第三寄存器, 都可以通过网管配置或者其他方式写 入, 可以根据需要在上述寄存器中写入需要检测的报文的类型、 报文内容, 来通过检测 报文任何位置、 任何长度的内容, 达到检测报文在以太交换设备中延时的目的。
上述实施例以 100M PHY的 ΜΠ接口为例, 在 FE/GE PHY的 SMII、 GMII、 RGMII、 SGMII 等接口上都可以以类似的方法实现。 图 11A为本发明实施例提供的用于实现上述测量报文在以太交换设备中的延时的方 法的以太交换设备的一种结构示意图。 如图 11A所示, 以太交换设备包括 MAC层芯片 111、 PHY层芯片 112及报文检测模块 11 0, 报文检测模块 110用于在 MAC层芯片 11 1与 PHY层芯片 112之间的接口接收的报文的特定位置的内容与预置的报文内容匹配时, 触发计时; 并 用于在所述接口发送的报文的所述特定位置的内容与所述预置的报文内容匹配时,停止 计时, 得到所述报文在所述以太交换设备中的延时。
具体地, 报文检测模块 110可包括输入包检测模块及输出包检测模块。
图 11B为本发明实施例提供的用于实现上述测量报文在以太交换设备中的延时的方 法的以太交换设备的另一种结构示意图。 如图 11B所示, 所述输入包检测模块 11 3侧挂在 MAC层芯片 111与 PHY层芯片 112之间的接口的报文接收引脚上,用于在 MAC层芯片与 PHY层 芯片之间的接口接收的报文与预置的报文内容匹配时, 触发计时; 还用于在触发计时之 前, 对 MAC层芯片与 PHY层芯片之间的接口接收的所述信号进行串并转换, 获得第一被转 换信号, 识别所述第一被转换信号的报文起始位置, 并比较所述报文起始位置后所述特 定位置的第一被转换信号和预置的报文内容的编码值。 所述输出包检测模块 114侧挂在 MAC层芯片 111与 PHY层芯片 112之间的接口的报文发送引脚上,用于在所述接口发送的报 文与所述预置的报文内容匹配时, 触发计时终止, 以得到所述报文在所述以太交换设备 中的延时; 还用于在所述输入包检测模块 11 3触发计时之后, 对 MAC层芯片与 PHY层芯片 之间的接口发送的所述信号进行串并转换, 获得第二被转换信号, 识别所述第二被转换 信号的报文起始位置, 并比较所述报文起始位置后所述特定位置的第二被转换信号和预 置的报文内容的编码值。 输入包检测模块 11 3为上述实施例提供的任意一种输入包检测 电路, 输出包检测模块 114为上述实施例提供的任意一种输出包检测电路。 所述输入包 检测模块 11 3中的第一寄存器、 第二寄存器及第三寄存器中预置的内容分别与所述输出 包检测模块 114中第一寄存器、 第二寄存器及第三寄存器中预置的内容相同。
本发明实施例提供的以太交换设备还可包括计时模块, 使能端与报文检测模块用于 触发计时的输出端相连, 即与所述输入包检测模块的输出端相连, 以在输入包检测模块 输出脉冲的情况下开始计时, 停止端与所述报文检测模块用于停止计时的输出端相连, 即与所述输出包检测模块的输出端相连, 以在输出包检测模块输出脉冲的情况下停止计 时, 从而得到报文在以太交换设备中的延时。
本实施例中, 以太交换设备通过报文检测模块在 MAC层芯片与 PHY层芯片之间的接口 测试报文延时时间, 且由于报文 PHY层芯片中的延时固定不变, 可以精确的测量报文进 入及离开以太交换设备的时间, 并且当采用硬件电路检测时, 其本身产生的延时固定, 执行速度较快, 不会对测量结果造成影响, 因此相对于通常利用 CPU检测, 本实施例提 供的技术方案提高了延时检测的准确性,相对于通常在试验环境中采用测试仪器进行测 量, 不仅避免了以太交换设备端口的额外消耗, 且在以太交换设备的实际使用中进行测 量, 提高了延时检测的准确性。 另外, 在以太交换设备正常运行的过程中, 可以灵活配 置用于延时测量的报文。
图 12为本发明实施例提供的测量报文在以太交换设备中的延时的系统的结构示意 图。 该系统用于实现上述实施例提供的测量报文在以太交换设备中的延时的方法。 如图 12所示, 该系统包括计时部件 121及以太交换设备 122, 其中, 以太交换设备 122可为上 述设备实施例提供的任一种以太交换设备。 所述计时部件 121的使能端与所述以太交换 设备 122的输入包检测电路中的第二比较器的输出端相连, 停止端与所述以太交换设备 122的输出包检测电路中的第二比较器的输出端相连。 计时部件可以是以太交换设备外 的专门的计时器或者示波器
本实施例中,测量报文在以太交换设备中的延时的系统通过计时部件及采用了上述 输入、 输出包检测电路的以太交换设备, 提高了延时检测的准确性, 相对于通常在试验 环境中采用测试仪器进行测量, 不仅避免了以太交换设备端口的额外消耗, 且在以太交 换设备的实际使用中进行测量, 提高了延时检测的准确性。 另外, 在以太交换设备正常 运行的过程中, 可以灵活配置用于延时测量的报文。
采用上述实施例提供的技术方案可以精确地测试报文在设备中的延时, 例如, 在电 气电子工禾呈师协会 ( Ins t i tut e of E l ec t r i ca l and E l ec t ron i cs Eng ineer s , IEEE ) 1588应用中, Sync报文有特定的封装方式,请参考 1588规范。可以类似以太报文的检测, 利用报头识别 Sync报文, 并通过检测其某段报文内容以精确的测试 Sync报文进入和离开 设备的时间点。 在一些对延时精度的需求要求较高的设备中, 可以方便地提供报文在设 备中的延时测试能力。
以上所述, 仅为本发明较佳的具体实施方式, 但本发明的保护范围并不局限于此, 任何熟悉本技术领域的技术人员在本发明揭露的技术范围内, 可轻易想到的变化或替 换, 都应涵盖在本发明的保护范围之内。 因此, 本发明的保护范围应该以权利要求的保 护范围为准。

Claims

权利要求
1、 一种测量报文在以太交换设备中的延时的方法, 其特征在于, 包括: 以太交换设备在 MAC层芯片与 PHY层芯片之间的接口接收的报文的特定位置的内容 与预置的报文内容匹配时, 触发计时;
所述接口发送的报文的所述特定位置的内容与所述预置的报文内容匹配时,停止计 时, 得到所述报文在所述以太交换设备中的延时。
2、 根据权利要求 1所述的方法, 其特征在于, 所述以太交换设备在 MAC层芯片与 PHY 层芯片之间的接口接收的报文的特定位置的内容与预置的报文内容匹配时,触发计时之 前, 还包括:
对 MAC层芯片与 PHY层芯片之间的接口接收的所述信号进行串并转换, 获得第一被转 换信号;
识别所述第一被转换信号的报文起始位置;
比较所述报文起始位置后所述特定位置的第一被转换信号和预置的报文内容的编 码值。
3、 根据权利要求 2所述的方法, 其特征在于, 所述识别所述第一被转换信号的报文 起始位置, 包括:
比较所述第一被转换信号与预置的报头编码值;
将所述第一被转换信号与所述预置的报头编码值匹配的位置作为所述报文起始位 置。
4、 根据权利要求 1至 3任一所述的方法, 其特征在于, 在触发计时之后, 还包括: 对 MAC层芯片与 PHY层芯片之间的接口发送的所述信号进行串并转换, 获得第二被转 换信号;
识别所述第二被转换信号的报文起始位置;
比较所述报文起始位置后所述特定位置的第二被转换信号和预置的报文内容的编 码值。
5、 根据权利要求 4所述的方法, 其特征在于, 所述识别所述第二被转换信号的报文 起始位置, 包括:
比较所述第二被转换信号与所述预置的报头编码值;
将所述第二被转换信号与所述预置的报头编码值匹配的位置作为所述报文起始位 置。
6、 一种以太交换设备, 包括 MAC层芯片及 PHY层芯片, 其特征在于, 还包括报文检 测模块,所述报文检测模块侧挂在所述 MAC层芯片与 PHY层芯片之间的接口上,用于在 MAC 层芯片与 PHY层芯片之间的接口接收的报文的特定位置的内容与预置的报文内容匹配 时, 触发计时; 并用于在所述接口发送的报文的所述特定位置的内容与所述预置的报文 内容匹配时, 停止计时, 得到所述报文在所述以太交换设备中的延时。
7、 根据权利要求 6所述的以太交换设备, 其特征在于, 所述报文检测模块包括输入 包检测模块及输出包检测模块;
所述输入包检测模块侧挂在所述接口的报文接收引脚上, 用于在所述 MAC层芯片与 PHY层芯片之间的接口接收的报文的特定位置的内容与预置的报文内容匹配时, 触发计 时; 还用于在触发计时之前, 对 MAC层芯片与 PHY层芯片之间的接口接收的所述信号进行 串并转换, 获得第一被转换信号, 识别所述第一被转换信号的报文起始位置, 并比较所 述报文起始位置后所述特定位置的第一被转换信号和预置的报文内容的编码值;
所述输出包检测模块侧挂在所述接口的报文发送引脚上,用于在所述接口发送的报 文的特定位置的内容与所述预置的报文内容匹配时, 触发计时终止, 以得到所述报文在 所述以太交换设备中的延时; 还用于在所述输入包检测模块触发计时之后, 对 MAC层芯 片与 PHY层芯片之间的接口发送的所述信号进行串并转换, 获得第二被转换信号, 识别 所述第二被转换信号的报文起始位置, 并比较所述报文起始位置后所述特定位置的第二 被转换信号和预置的报文内容的编码值。
8、 根据权利要求 7所述的以太交换设备, 其特征在于, 所述输入包检测模块及输出 包检测模块均包括:
串并转换电路,与所述接口的接收引脚或发送引脚相连,且与所述接口的时钟同步, 用于对所述接口接收或发送的信号进行串并转换, 获得第一被转换信号或第二被转换信 号;
第一缓冲器, 输入端与所述串并转换电路相连, 用于缓存所述第一被转换信号或第 二被转换信号;
第一寄存器, 用于存储预置的报头编码值;
第一比较器, 输入端与所述第一缓冲器的输出端及所述第一寄存器相连, 用于比较 所述第一被转换信号或第二被转换信号与所述预置的报头编码值;
计数器, 使能端与所述第一比较器的输出端相连, 用于在所述第一被转换信号或第 二被转换信号与预置的报头编码值匹配的情况下, 开始计数; 第二寄存器, 与所述计数器相连, 用于存储预置的数值;
第二缓冲器, 输入端与所述串并转换电路相连, 用于缓存所述串并转换电路后续串 并转换得到的第一被转换信号或第二被转换信号;
第三寄存器, 用于存储预置的报文内容的编码值;
第二比较器, 输入端与所述第二缓冲器的输出端及所述第三寄存器相连, 使能端与 所述计数器输出端相连,用于在后续串并转换得到的第一被转换信号或第二被转换信号 与所述预置的报文内容的编码值匹配的情况下, 输出脉冲, 以触发计时部件开始计时或 停止计时;
所述输入包检测模块中第一寄存器、第二寄存器及第三寄存器中预置的内容分别与 所述输出包检测模块中第一寄存器、 第二寄存器及第三寄存器中预置的内容相同。
9、 根据权利要求 6-8任一项所述的以太交换设备, 其特征在于, 还包括计时模块, 使能端与所述报文检测模块用于触发计时的输出端相连,停止端与所述报文检测模块用 于停止计时的输出端相连。
PCT/CN2011/080801 2011-01-07 2011-10-14 测量报文在以太交换设备中的延时的方法及以太交换设备 WO2012092789A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201110002864.3 2011-01-07
CN2011100028643A CN102136968B (zh) 2011-01-07 2011-01-07 测量报文在以太交换设备中的延时的方法及以太交换设备

Publications (1)

Publication Number Publication Date
WO2012092789A1 true WO2012092789A1 (zh) 2012-07-12

Family

ID=44296629

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2011/080801 WO2012092789A1 (zh) 2011-01-07 2011-10-14 测量报文在以太交换设备中的延时的方法及以太交换设备

Country Status (2)

Country Link
CN (1) CN102136968B (zh)
WO (1) WO2012092789A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106817269A (zh) * 2015-12-01 2017-06-09 中国电信股份有限公司 网络层监测方法和系统以及相关设备

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102136968B (zh) * 2011-01-07 2013-04-24 华为技术有限公司 测量报文在以太交换设备中的延时的方法及以太交换设备
CN102571590A (zh) * 2012-01-18 2012-07-11 珠海市佳讯实业有限公司 一种降低网络时延的分路器及其实现方法
CN103973592B (zh) * 2014-05-16 2017-12-05 华为技术有限公司 信元处理方法及装置
CN105376115A (zh) * 2015-12-01 2016-03-02 北京博维亚讯技术有限公司 基于硬件的变电站互感器采样值时钟透传装置及方法
CN107769997B (zh) * 2017-10-27 2021-04-23 中国航空无线电电子研究所 Afdx交换产品交换技术延时指标测试装置
CN108200545B (zh) * 2017-12-20 2021-06-18 深圳市极致汇仪科技有限公司 一种wlan信令测试系统及测试方法
CN113810243B (zh) * 2020-06-17 2022-08-12 上海汽车集团股份有限公司 一种延时测试方法及装置

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1960242A (zh) * 2006-10-17 2007-05-09 中控科技集团有限公司 实现时钟同步的方法、装置、系统及分布式系统
CN1980181A (zh) * 2005-12-02 2007-06-13 北京润光泰力科技发展有限公司 基于以太网的节点间传输性能在线获取方法和装置
CN101547063A (zh) * 2009-04-30 2009-09-30 北京星网锐捷网络技术有限公司 一种转发延迟测试方法和系统
CN101814984A (zh) * 2010-04-09 2010-08-25 华为技术有限公司 获取不对称延迟时间的方法和装置
CN102136968A (zh) * 2011-01-07 2011-07-27 华为技术有限公司 测量报文在以太交换设备中的延时的方法及以太交换设备

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1980181A (zh) * 2005-12-02 2007-06-13 北京润光泰力科技发展有限公司 基于以太网的节点间传输性能在线获取方法和装置
CN1960242A (zh) * 2006-10-17 2007-05-09 中控科技集团有限公司 实现时钟同步的方法、装置、系统及分布式系统
CN101547063A (zh) * 2009-04-30 2009-09-30 北京星网锐捷网络技术有限公司 一种转发延迟测试方法和系统
CN101814984A (zh) * 2010-04-09 2010-08-25 华为技术有限公司 获取不对称延迟时间的方法和装置
CN102136968A (zh) * 2011-01-07 2011-07-27 华为技术有限公司 测量报文在以太交换设备中的延时的方法及以太交换设备

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106817269A (zh) * 2015-12-01 2017-06-09 中国电信股份有限公司 网络层监测方法和系统以及相关设备

Also Published As

Publication number Publication date
CN102136968B (zh) 2013-04-24
CN102136968A (zh) 2011-07-27

Similar Documents

Publication Publication Date Title
WO2012092789A1 (zh) 测量报文在以太交换设备中的延时的方法及以太交换设备
CN107483370B (zh) 一种在fc网络上传输ip和can业务的方法
CN103095607B (zh) 一种实时优先级以太网控制器实现方法
CN106375161B (zh) 一种万兆以太网测试装置
CN104144088A (zh) 一种提高时延测量精度的网络时延测量方法
KR20150050938A (ko) 패킷의 전송 방법과 이를 이용하는 장치들
CN111416752A (zh) 一种面向时间敏感网络数据帧调度的测试方法
WO2020038191A1 (zh) 测量时延的方法和网络设备
KR20220039799A (ko) 링크 계층 인터페이스에 대한 물리적 계층, 관련 시스템들, 방법들 및 디바이스들
US6470031B1 (en) Method and apparatus for accurate packet time stamping
CN109753392B (zh) 网络桥接装置、总线测试的方法及其系统
JP2011239469A (ja) 低遅延のデータパケット受信及び処理
US8929835B2 (en) Non-intrusive and operational communication system monitoring and diagnostics
US9118728B2 (en) Method and system for determining physical layer traversal time
CN103812797A (zh) 传输数据分组的方法及发送和接收数据分组的通信模块
CN113630326A (zh) 一种千兆以太网流量控制装置
CN102402494B (zh) Xgmii接口数据处理方法及装置以及芯片间双向握手的方法
CN111600809A (zh) 一种千兆单光口服务器适配器
WO2023124197A1 (zh) 一种时间戳同步的误差补偿方法、装置、电子设备以及存储介质
US11824657B2 (en) Frame processing method and apparatus
Depari et al. A new instrument for real-time Ethernet performance measurement
CN113765721B (zh) 一种基于fpga的以太网远程配置装置
CN102970622B (zh) 一种epon网络环路控制方法
US20030152073A1 (en) Inbound data stream controller with pre-recognition of frame sequence
KR20150050960A (ko) 패킷의 전송 순서를 재배열하는 방법과 이를 이용하는 장치들

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: 11854774

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: 11854774

Country of ref document: EP

Kind code of ref document: A1