WO2017219840A1 - 设备端口的检测方法及装置 - Google Patents

设备端口的检测方法及装置 Download PDF

Info

Publication number
WO2017219840A1
WO2017219840A1 PCT/CN2017/086777 CN2017086777W WO2017219840A1 WO 2017219840 A1 WO2017219840 A1 WO 2017219840A1 CN 2017086777 W CN2017086777 W CN 2017086777W WO 2017219840 A1 WO2017219840 A1 WO 2017219840A1
Authority
WO
WIPO (PCT)
Prior art keywords
port
tester
vlan
bandwidth
test packet
Prior art date
Application number
PCT/CN2017/086777
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 WO2017219840A1 publication Critical patent/WO2017219840A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0805Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
    • 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/0823Errors, e.g. transmission errors
    • H04L43/0829Packet loss
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W84/00Network topologies
    • H04W84/02Hierarchically pre-organised networks, e.g. paging networks, cellular networks, WLAN [Wireless Local Area Network] or WLL [Wireless Local Loop]
    • H04W84/10Small scale networks; Flat hierarchical networks
    • H04W84/12WLAN [Wireless Local Area Networks]

Definitions

  • the present disclosure relates to the field of communications technologies, and, for example, to a method and apparatus for detecting a device port.
  • FIG. 1a a hardware connection diagram for testing a device of a 10 Gbps port in the related art
  • FIG. 1b a hardware connection diagram for testing a device of a 40 Gbps port in the related art
  • FIG. 2a a schematic diagram of data forwarding for testing a device of a 10 Gbps port in the related art
  • FIG. 2b is a schematic diagram of data forwarding for testing a device of a 40 Gbps port in the related art.
  • the present invention provides a method and a device for detecting a device port, which can solve the high cost, waste of resources, and high test port rate of a tester configured with a high rate in the related art, and has complicated configuration and reliable test when testing a port. Poor sex.
  • the embodiment of the invention provides a method for detecting a device port, which may include:
  • the packet loss rate of the packet determines whether the device port under test runs normally under the line speed bandwidth condition.
  • determining, according to the packet loss rate of the vlan test packet, whether the device to be tested is running normally under the condition of the online bandwidth including: determining the device to be tested when the packet loss rate of the vlan test packet is zero.
  • the port operates normally under the line speed bandwidth condition;
  • the switch chip determines that the data in the register corresponding to the port of the device under test is in a normal range, it determines that the device under test runs normally under the condition of the line speed bandwidth.
  • the virtual local area network vlan test packet sent by the tester and transmitted by the first device port and carrying the line rate bandwidth corresponding to the tester includes:
  • the vlan test packet sent by the tester sequentially passes through a first cable connected between the tester and a reference port, a vlan connection between the reference port and the first device port, and the After the second cable connected between the first device port and the device to be tested is transmitted, the vlan test packet sent by the tester is received and obtained.
  • the first preset quantity is a device to be tested.
  • the port type of the tester includes a first port and a second port whose line speed bandwidth is smaller than a line rate bandwidth of the first port, and a line rate bandwidth of the device port to be tested is the first port
  • the transmission of the vlan test packet between the first preset number of virtual ports pre-configured on the port of the device to be tested and the first device port includes:
  • the embodiment of the invention further provides another method for detecting a device port, which may include:
  • the packet loss rate of the vlan test packet it is determined whether the device port under test is running normally under the condition of the line speed bandwidth.
  • the embodiment of the invention further provides a device port detecting device, which may include:
  • the receiving module is configured to: receive a virtual local area network vlan test packet sent by the tester and forwarded by the first device port, and the line rate bandwidth corresponding to the tester is less than Measuring the line rate bandwidth of the device port;
  • the delivery module is configured to: transfer the vlan test packet between the first preset number of virtual ports pre-configured on the port of the device to be tested and the first device port;
  • the processing module is configured to: send the vlan test packet received after the first preset number of times of delivery to the tester, so that the tester detects the packet loss rate of the vlan test packet, And determining, according to the packet loss rate of the vlan test packet, whether the port of the device under test is running normally under the condition of the line speed bandwidth.
  • the processing module is configured to: when the packet loss rate of the vlan test packet is zero, determine that the device port under test is running normally under the condition of the online speed bandwidth, and the packet of the vlan test packet is lost.
  • the rate is not zero, the request command sent by the switch chip is received, and the data in the register corresponding to the port of the device to be tested is fed back to the switch chip according to the request command, so that the switch chip determines that the device port to be tested corresponds to When the data in the register is in the normal range, determine the device speed of the device to be tested. It works fine under wide conditions.
  • the receiving module is configured to:
  • the vlan test packet sent by the tester sequentially passes through a first cable connected between the tester and a reference port, a vlan connection between the reference port and the first device port, and the After the second cable connected between the first device port and the device to be tested is transmitted, the vlan test packet sent by the tester is received and obtained.
  • the first preset quantity is a device to be tested.
  • the delivery module includes:
  • the first submodule is configured to: obtain a first reference value after the rounding operation, the ratio of the line rate bandwidth of the device port under test to the line rate bandwidth of the first port;
  • the second sub-module is configured to: receive the vlan test packet sent by the tester, and perform the vlan test packet between the pre-configured first reference value virtual port and the first device port. transfer;
  • a third submodule configured to: obtain a first difference between a difference between a line rate bandwidth of the device port under test and a first reference value and a first line rate bandwidth of the first port;
  • a fourth submodule configured to: acquire a second reference value of a ratio of the first difference value to a line rate bandwidth of the second port, where the second reference value is an integer, and the first reference value is The sum of the second reference values is equal to the first preset number;
  • the fifth sub-module is configured to: receive the vlan test packet sent by the tester, and perform the vlan test packet between the pre-configured second reference value virtual port and the first device port. transfer.
  • the embodiment of the invention further provides another device port detecting device, which may include:
  • the sending module is configured to: send, by using the first device port, the virtual LAN vlan test packet carrying the line rate bandwidth corresponding to the tester to the device port to be tested, so that the vlan test packet is pre-configured on the device port to be tested. Passing between a first preset number of virtual ports and the first device port;
  • the receiving detection module is configured to: receive the vlan test packet that is sent after the first preset number of times of the transmission by the port of the device to be tested, and detect a packet loss rate of the vlan test packet;
  • the determining module is configured to: according to the packet loss rate of the vlan test packet, determine whether the device port under test is running normally under the condition of the line speed bandwidth.
  • the embodiment of the invention further provides a computer readable storage medium storing computer executable instructions for performing any of the above methods.
  • Embodiments of the present invention also provide an electronic device including one or more processors, a memory, and one or more programs, the one or more programs being stored in a memory when being processed by one or more processors When executed, perform any of the above methods.
  • Embodiments of the present invention also provide a computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions, when the program instructions are executed by a computer
  • the computer is caused to perform any of the above methods.
  • the embodiment of the invention can realize whether the low-rate test device detects whether the high-speed device port runs normally under the condition of the line-speed bandwidth, and does not need to purchase a test device with a large rate, thereby saving cost and realizing resource reuse.
  • FIG. 1a is a schematic diagram of hardware connection of a related art 10 Gbps device port detection
  • FIG. 1b is a schematic diagram of hardware connection of a related art 40 Gbps device port detection
  • 2a is a schematic diagram of data forwarding of a related art 10 Gbps device port detection
  • 2b is a schematic diagram of data forwarding of a related art 40 Gbps device port detection
  • FIG. 3 is a schematic diagram of a method for detecting a device port according to Embodiment 1 of the present invention.
  • FIG. 4 is a schematic diagram 1 of data forwarding of device port detection according to an embodiment of the present invention.
  • FIG. 5 is a schematic diagram of a method for detecting a device port according to Embodiment 2 of the present invention.
  • FIG. 6 is a second schematic diagram of data forwarding of device port detection according to an embodiment of the present invention.
  • FIG. 7 is a schematic diagram of a process of transmitting a vlan test packet according to Embodiment 2 of the present invention.
  • FIG. 8 is a schematic diagram of a method for detecting a device port according to Embodiment 3 of the present invention.
  • FIG. 9 is a first schematic diagram of a device port detecting apparatus according to Embodiment 4 of the present invention.
  • FIG. 10 is a second schematic diagram of a device port detecting apparatus according to Embodiment 4 of the present invention.
  • FIG. 11 is a third schematic diagram of a device port detecting apparatus according to Embodiment 4 of the present invention.
  • FIG. 12 is a schematic structural diagram of hardware of an electronic device according to Embodiment 4 of the present invention.
  • the method for detecting a device port according to the first embodiment of the present invention may be applied to a device port to be tested, and may include steps 110-130.
  • step 110 the virtual local area network vlan test packet sent by the tester and carried by the first device port and carrying the line rate bandwidth corresponding to the tester is received.
  • the line rate corresponding to the tester is smaller than the line rate bandwidth of the port of the device to be tested.
  • the test device can be connected to the device port to be tested through the first device port, and the first device port and the device port to be tested can be located on the same device, and the line rate bandwidth of the first device port and the device port under test are the same.
  • the tester sends the vlan test packet
  • the first device port obtains the vlan test packet according to the connection between the tester and the first device port
  • the first device port sends the vlan test packet to the device port to be tested
  • the vlan test packet carries the line rate bandwidth information corresponding to the tester.
  • the line rate corresponding to the tester is smaller than the line rate bandwidth of the device port under test.
  • the line speed bandwidth of the tester is 10 Gbps, and the 40 Gbps port and the 100 Gbps port are set on the device to be tested.
  • the line speed bandwidth corresponding to the tester is smaller than the line rate bandwidth of the device port to be tested, and the tester can be used to detect the test. Whether the device port runs normally under the online speed bandwidth condition.
  • the vlan test packet sent by the tester is a 64-byte data packet.
  • the vlan test packet can reflect the tester's line-speed bandwidth.
  • the first device port and the device to be tested may be ports on the same device, or may be ports of different devices.
  • the first device port and the device to be tested may be ports on the same switch. It can also be a port on a different switch.
  • the line rate bandwidth is for a single port. It can be understood as the maximum number of packets that the switch port can forward per second.
  • the size is 64 bytes.
  • the vlan test packet sent by the tester is set to a 64-byte packet, and the switch port is filled.
  • the port rate of the switch reaches the line-speed bandwidth of the port.
  • the port rate of the switch is also often said. 10Gbps, 40Gbps ports, etc.
  • step 120 the vlan test packet is transmitted between the first preset number of virtual ports pre-configured on the port of the device to be tested and the first device port.
  • the line-speed bandwidth of the first device port is the same as the line-speed bandwidth of the device port to be tested, and the first predetermined number of virtual ports are pre-configured on the device port, and the first device port is pre-configured with the first preset.
  • a number of virtual ports are used to transmit vlan test packets between the first device port and the device port to be tested through the first preset number of virtual ports.
  • the number of virtual ports on the first device port and the device port to be tested is the same, but the identifier of each virtual port is different.
  • Each virtual port can be divided into multiple identical or different vlans according to different configurations.
  • the line rate corresponding to the tester is 10 Gbps
  • the line rate bandwidth of the device port to be tested and the first device port are both 40 Gbps
  • the virtual port on the first device port and the device port to be tested are The number of virtual ports is four.
  • the virtual ports on the first device port are vlan113, vlan114, vlan115, and vlan116.
  • the virtual ports on the device ports to be tested are vlan114, vlan115, vlan116, and vlan117.
  • the tester sends a vlan113 test packet.
  • the vlan113 test packet passes through a 10Gbps port, that is, the 10G1 port shown in Figure 4, and reaches the first device port.
  • the first device port After receiving the vlan113 test packet, the first device port uses the first packet.
  • the vlan113 virtual port of the device port sends the vlan113 test packet to the device port to be tested through the connection between the first device port and the device port to be tested.
  • the device port to be tested is translated as vlan114 test packet after receiving the vlan113 test packet.
  • the vlan114 test packet is sent to the first device port by using the switch chip, and the vlan114 test packet is sent from the first device port by the first device port.
  • the switch chip may be an Ethernet chip (MAC chip), that is, a forwarding chip of the switch.
  • MAC chip Ethernet chip
  • the first device port uses its own vlan114 virtual port to send the vlan114 test packet to the device port to be tested through the connection between the first device port and the device port to be tested.
  • the test device port receives the vlan114 test packet,
  • the vlan115 test packet is translated to the vlan115, and the vlan115 test packet is sent to the first device port through the switch chip, and the vlan115 test packet is sent from the first device port by the first device port.
  • the first device port utilizes the vlan115 virtual port through the first device port with The connection between the ports of the device to be tested sends the vlan115 test packet to the port of the device to be tested. After receiving the vlan115 test packet, the device to be tested translates the packet to the vlan116 test packet and checks the vlan entry through the switch chip. The obtained vlan116 test packet is sent to the first device port, and the vlan116 test packet is sent from the first device port by the first device port.
  • the first device port uses the vlan116 virtual port to send the vlan116 test packet to the device port to be tested through the connection between the first device port and the device port to be tested.
  • the device port to be tested is translated to vlan117 after receiving the vlan116 test packet. Message.
  • the switch After the test device port translates the vlan116 test packet into a vlan117 test packet, the switch checks the vlan entry and sends the translated vlan117 test packet to the port configured as vlan117, that is, the 10G2 shown in Figure 4. Port, the vlan117 test is sent to the tester by the 10G2 port.
  • the vlan test packet received after the first predetermined number of times of delivery is sent to the tester, so that the tester detects the packet loss rate of the vlan test packet, and According to the packet loss rate of the vlan test packet, it is determined whether the device under test is running normally under the condition of the line speed bandwidth.
  • the first preset number is 4, and the number of times of transmission is the number of times that the first device port sends a vlan test packet to the port of the device to be tested.
  • the obtained vlan test packet is the vlan116 test packet
  • the device port to be tested receives the vlan116 test packet after receiving the vlan116 test packet.
  • the translation is a vlan117 test message, and the vlan117 test message is sent to the tester through the vlan entry of the switch chip.
  • the tester detects the number of data packets of the vlan 117 test packet according to the received vlan 117 test packet, and compares the number of data packets of the vlan 113 test packet that is started to be sent with the number of data packets of the vlan 117 test packet. According to the comparison result, it is determined whether the vlan test packet has a packet loss during the transmission process. When the packet loss rate of the vlan test packet is zero, it is determined that the device under test runs normally under the condition of the online speed bandwidth. When the device under test runs normally under the condition of the line-speed bandwidth, the device port to be tested has a 40 Gbps line-speed bandwidth in the inbound direction. That is, each time the device port of the device to be tested sends a vlan test packet, the device can accumulate 10 Gbps in the inbound direction of the device port. Line speed bandwidth.
  • the device port to be tested, the first device port, and the port of the tester are all configured in a relay mode (trunk mode), so that each port can support multiple vlan configurations, and can be configured differently.
  • the native vlan (Native Vlan) ensures that the data will not be broadcast.
  • the vlan of the port configuration of the high-speed line rate bandwidth device can contain all the vlans needed to copy the line-speed bandwidth to prevent data from being discarded.
  • the port of the high-speed line rate bandwidth device may be a port with a line rate of 40 Gbps, 100 Gbps, or a line rate.
  • the above-mentioned copy line rate bandwidth can be understood as the first device port and the device port under test in FIG. The test message forwarding process indicated by the dotted line.
  • the tester can send the vlan test packet to the first device port and the second device port through two physical ports with the same line rate bandwidth, where the second device port is the device to be tested.
  • the port in this case, can simultaneously detect whether the first device port and the second device port are operating normally under the line speed bandwidth condition.
  • an example is described to detect whether the device under test is running normally under the condition of a line speed bandwidth.
  • the vlan test packet carrying the line rate bandwidth corresponding to the tester and transmitted by the first device port is received by the test device, wherein the line speed bandwidth corresponding to the test device is smaller than the line speed of the device port under test.
  • Bandwidth After the vlan test packet is transmitted between the first preset number of virtual ports pre-configured on the port of the device to be tested and the first device port, the received test packet is sent to the tester to enable the tester to detect The packet loss rate of the vlan test packet is determined according to the packet loss rate of the vlan test packet.
  • the device test port detects the high-speed device port online speed bandwidth condition. Whether it runs normally or not, it does not need to purchase a large-rate test equipment, which saves costs and realizes the reuse of resources.
  • the method for detecting a device port according to the second embodiment of the present invention may be applied to a device port to be tested, and may include steps 210-240.
  • step 210 the virtual local area network vlan test packet sent by the tester and carried by the first device port and carrying the line rate bandwidth corresponding to the tester is received.
  • the line rate corresponding to the tester is smaller than the line rate bandwidth of the port of the device to be tested.
  • the line rate bandwidth of the first device port is the same as the line rate bandwidth of the device port to be tested.
  • the process of receiving the vlan test packet is as follows:
  • the vlan test packet sent by the tester passes through the first cable connected between the tester and the reference port, the vlan connection between the reference port and the first device port, and the first device port and the device to be tested. After the second cable connected between the ports is transmitted, the vlan test report sent by the tester is received and obtained. Text.
  • the reference port can be set on the same board as the device to be tested, and the reference port can be connected to the first device port and the device port to be tested on the device to be tested, and the line speed bandwidth of the reference port is greater than or equal to the line corresponding to the tester. Speed bandwidth.
  • the reference port is connected to the tester through a first cable, and the reference port is connected to the first device port through a virtual local area network.
  • the first device port is connected to the device port to be tested through a second cable.
  • the tester sends a vlan test packet, and sends a vlan test packet to the reference port according to the first cable between the tester and the reference port, and the vlan test report is sent according to the virtual local area network connection between the reference port and the first device port.
  • the message is sent to the first device port, and the vlan test packet is sent to the device port to be tested according to the second cable between the first device port and the device port to be tested.
  • the line rate bandwidth corresponding to the tester is 10 Gbps
  • the line rate bandwidth of the device port under test and the line rate bandwidth of the first device port are both 40 Gbps
  • the line rate bandwidth of the reference port is 10 Gbps
  • the reference port can be used with the device under test.
  • the port and the first device port are set on the same board, and the reference port is connected to the first device port through the virtual local area network.
  • the line speed bandwidth of the tester and the reference port is 10 Gbps.
  • the connector on both sides of the first cable connected between the tester and the reference port is connected to the line speed bandwidth. 10Gbps matching.
  • the second cable is connected to the first device port and the device port to be tested, and the connectors at both ends of the second cable are matched with the line rate of 40 Gbps of the first device port and the device port under test.
  • the vlan test packet enters the device port to be tested through the first cable, the virtual local area network between the reference port and the first device port, and the second cable.
  • the line rate bandwidth of the reference port is the same as the line rate bandwidth of the tester, but the line rate bandwidth of the reference port may be the same as or different from the line rate bandwidth of the tester.
  • the line rate bandwidth of the reference port may be greater than the test.
  • the line speed bandwidth of the instrument, the line rate bandwidth of the reference port can also be less than the line rate bandwidth of the tester.
  • the line rate bandwidth of the reference port is different from the line rate bandwidth of the tester, for example, the line rate bandwidth corresponding to the tester is 10 Gbps, and the line rate bandwidth of the device port under test and the line rate bandwidth of the first device port are both 40 Gbps.
  • the reference port has a line rate of 40 Gbps, and the reference port can be set on the same board as the device port to be tested and the first device port, and the reference port is connected to the first device port through the virtual local area network.
  • the line speed bandwidth of the tester is 10 Gbps
  • the line speed bandwidth of the reference port is 40 Gbps.
  • the first cable connecting the tester and the reference port can be a four-point connector.
  • the vlan test packet enters the device port to be tested through the first cable, the virtual local area network between the reference port and the first device port, and the second cable.
  • one of the four connector sides of the first cable can be connected to the tester, and a 40 Gbps wire-speed bandwidth connector on one connector side of the first cable is connected to the reference port.
  • step 220 the vlan test packet is transmitted between the first preset number of virtual ports pre-configured on the port of the device to be tested and the first device port.
  • a first preset number of virtual ports are pre-configured on the port of the device to be tested, and a first preset number of virtual ports are pre-configured on the first device port, and the first predetermined number of virtual ports are used in the first device port.
  • the vlan test packet is transmitted between the port and the device to be tested.
  • the first preset quantity is the line speed bandwidth of the device port to be tested and The ratio of the line rate bandwidth corresponding to the tester.
  • the line rate bandwidth of the device port under test is 40 Gbps
  • the tester includes a port
  • the line rate corresponding to the port is 10 Gbps.
  • the line rate bandwidth of the device port under test is the line speed corresponding to the tester.
  • the first preset number is the ratio of the line rate bandwidth of the device port under test to the line rate bandwidth corresponding to the tester.
  • the tester When the first preset number is 4, the tester is connected to the first device port through the reference port, and the process of transmitting the vlan test packet between the device port to be tested and the first device port is as shown in FIG. 6.
  • the line rate corresponding to the tester is 10 Gbps, and the line rate bandwidth of the device port to be tested and the first device port are both 40 Gbps.
  • the tester is connected to the first device port through a reference port, and the line rate corresponding to the reference port is 40 Gbps.
  • the reference port is connected to the tester through the first cable, and the reference port is connected to the first device port through the virtual local area network.
  • the number of virtual ports on the first device port and the virtual port on the device port under test are both four.
  • the first cable can be a one-four joint, that is, one side of the first cable is four connectors, each connector corresponding to a line speed of 10 Gbps, and the other side of the first cable For a connector, it corresponds to a line rate of 40Gbps.
  • the vlan test packet is sent on the tester side through the 10Gbps port of the tester. After the reference port is reached, the vlan test packet carries the test.
  • the line rate corresponding to the instrument is still 10Gbps.
  • the virtual ports on the port of the device are vlan113, vlan114, vlan115, and vlan116.
  • the virtual ports on the device port to be tested are vlan114, vlan115, vlan116, and vlan117.
  • the tester sends a vlan113 test packet, and the vlan113 test packet enters the reference port 40G0 through the first cable. In this case, the line rate bandwidth of the tester carried by the vlan113 test packet is still 10 Gbps.
  • the vlan113 test packet is sent to the first device port according to the virtual local area network connection between the reference port and the first device port.
  • the first device port uses the vlan113 virtual port to pass the first device port.
  • the second cable connection between the ports of the device to be tested sends the vlan113 test packet to the device port to be tested.
  • the device port is translated into a vlan114 test packet, and the vlan table is checked by the switch chip.
  • the vlan114 test packet is sent to the first device port, and the vlan114 test packet is sent from the first device port by the first device port.
  • the first device port uses the vlan114 virtual port to send the vlan114 test packet to the device port to be tested through the second cable connection between the first device port and the device port to be tested.
  • the device port to be tested receives the vlan114 test packet.
  • the vlan115 test packet is translated to the vlan115, and the vlan115 test packet is sent to the first device port through the switch chip, and the vlan115 test packet is sent from the first device port by the first device port.
  • the first device port uses the vlan115 virtual port to send the vlan115 test packet to the device port to be tested through the second cable connection between the first device port and the device port under test, and the device port under test is receiving.
  • the vlan115 test packet is translated to the vlan116 test packet
  • the vlan entry is sent to the first device port through the switch chip, and the vlan116 test packet is sent from the first device port.
  • a device port is issued.
  • the first device port uses the vlan116 virtual port to send the vlan116 test packet to the device port to be tested through the second cable connection between the first device port and the device port to be tested. After the test device port receives the vlan116 test packet, Translated into vlan117 test message.
  • the switch After the test device port translates the vlan116 test packet into a vlan117 test packet, the switch checks the vlan entry and sends the translated vlan117 test packet to the port configured as vlan117 in the reference port.
  • the reference port 40G3 is shown, and the vlan117 test message is sent to the tester by the reference port 40G3.
  • the line rate bandwidth of the device port to be tested is a non-line rate bandwidth of the first port.
  • the line rate bandwidth of the device port under test is 100 Gbps
  • the tester includes the first port and the second port
  • the first line speed corresponding to the first port is 40 Gbps
  • the second line speed corresponding to the second port The bandwidth is 10 Gbps.
  • the line rate bandwidth of the device port to be tested is 2.5 times the first line rate bandwidth of the first port.
  • the transmission process of the vlan test packet includes Step 2210 - Step 2250, as shown in FIG.
  • step 2210 the ratio of the line rate bandwidth of the device port under test to the line rate bandwidth of the first port is obtained as a first reference value after the rounding operation.
  • the software can be used to calculate the ratio of the line-speed bandwidth of the port of the device to be tested to the first line-speed bandwidth of the first port, and perform a rounding operation on the comparison value, that is, calculate the line rate bandwidth of the device port to be tested by 100 Gbps and the first line rate bandwidth.
  • the ratio of 40 Gbps is 2.5, and the rounding operation is performed on 2.5 to obtain the first reference value 2.
  • step 2220 the vlan test packet sent by the tester is received, and the vlan test packet is transmitted between the pre-configured first reference value virtual port and the first device port.
  • the device to be tested After receiving the vlan test packet, the device to be tested transmits the vlan test packet to the first device port through the two pre-configured virtual ports. After the delivery is complete, go to step 2230.
  • step 2230 a first difference between the line rate bandwidth of the device port under test and the product of the first reference value and the first line rate bandwidth of the first port is obtained.
  • the software can calculate the product of the first reference value 2 and the first line speed bandwidth of 40 Gbps, and the line rate bandwidth of the device port to be tested is 100 Gbps, and the product of the first reference value 2 and the first line rate bandwidth of 40 Gbps is 80 Gbps, and the first is obtained. A difference of 20Gbps.
  • step 2240 a second reference value of the ratio of the first difference value to the line rate bandwidth of the second port is obtained, where the second reference value is an integer, and the sum of the first reference value and the second reference value is the first preset. Quantity.
  • the ratio of the first difference value 20 Gbps to the second line speed bandwidth 10 Gbps may be calculated by using the software to obtain a second reference value 2, wherein the sum of the first reference value 2 and the second reference value 2 is the first preset number.
  • the first reference value and the second reference value may be equal or unequal.
  • step 2250 the vlan test packet sent by the tester is received, and the vlan test packet is transmitted between the pre-configured second reference value virtual port and the first device port.
  • the device to be tested After receiving the vlan test packet, the device to be tested passes the pre-configured 2 virtual ports and the first A device port performs the transmission of a vlan test packet, where the two virtual ports correspond to the second reference value.
  • the line rate bandwidth of the device port to be tested is a non-integer multiple of the line rate bandwidth corresponding to the tester, for example, the line rate bandwidth of the device port to be tested is 100 Gbps, and the line rate bandwidth corresponding to the tester is 40 Gbps.
  • a 10 Gbps port is set on the device to be tested, and the line rate bandwidth corresponding to the tester can be set to 10 Gbps to implement the transmission of the vlan test packet between the tester and the device under test, or a test can be performed by using one minute and four joints.
  • the line rate of the device output to the device under test is 10 Gbps, wherein one side of the first cable is 4 connectors, each connector corresponds to a line speed bandwidth of 10 Gbps, and the other side of the first cable is a connector, corresponding to The 40 Gbps line-speed bandwidth can connect one connector side of the first cable to the tester, and connect one of the four connector sides of the first cable to the reference port to send test packets to the test device port. Perform port testing.
  • the tester can include one port or two or more ports.
  • step 230 the vlan test packet received after the first predetermined number of times of transmission is sent to the tester, so that the tester detects the packet loss rate of the vlan test packet, and the packet loss rate of the vlan test packet. When it is zero, it is determined that the device under test runs normally under the condition of line speed bandwidth.
  • the device to be tested After the first device port and the device to be tested are delivered for the first predetermined number of times, the device to be tested sends the received vlan test packet to the tester, so that the tester obtains the vlan sent by the device port to be tested. After the test packet is received, the data packet of the vlan test packet is compared, and the data packet of the received vlan test packet is compared with the data packet of the vlan test packet sent before. When the two are equal, the vlan test packet is not If there is a packet loss, that is, when the packet loss rate is zero, it is determined that the device under test runs normally under the condition of the line speed bandwidth.
  • the tester receives the vlan117 test packet, and according to the received vlan117 test packet, detects the number of data packets of the vlan117 test packet, and starts the number of packets of the vlan113 test packet to be sent and vlan117. The number of data packets of the test packet is compared. If the packet loss rate of the vlan test packet is zero, the online speed bandwidth of the device to be tested is determined. It works fine under conditions. When the device under test runs normally under the condition of the line-speed bandwidth, the device port to be tested has a 40 Gbps line-speed bandwidth in the inbound direction. That is, the device port to be tested can accumulate 10 Gbps in the inbound direction of the device to be tested after sending a vlan test packet. Line speed bandwidth.
  • step 240 when the packet loss rate of the vlan test packet is not zero, the request command sent by the switch chip is received, and the data in the register corresponding to the port of the device to be tested is fed back to the switch chip according to the request command, so that the exchange is performed.
  • the chip determines that the data in the register corresponding to the port of the device under test is in a normal range, it determines that the device under test runs normally under the condition of the line speed bandwidth.
  • the vlan test packet passes through multiple ports and cannot be judged as the port of the device under test.
  • the device port to be tested needs to receive the request sent by the switch chip. The command, the device port to be tested feeds back the data in the register corresponding to the port of the device to be tested according to the request command, so that the data of the register is checked after receiving the data in the corresponding register fed back by the port of the device under test.
  • the normal range when it is determined that the data in the corresponding register fed back by the device port under test is within the normal range, it is determined that the device under test operates normally under the line speed bandwidth condition.
  • the tester After the vlan test packet received by the port of the device through the virtual port is sent to the tester, the tester sends the vlan test packet to the tester according to the received vlan test packet. Check whether the vlan test packet has packet loss during the delivery process. When the number of the data packets of the vlan test packet is the same as the number of the data packets of the received vlan test packet, it is determined that there is no packet loss in the vlan test packet, and the packet of the vlan test packet is sent. The number of packets in the vlan test packet is greater than the number of packets received by the vlan test packet.
  • the physical port that sends the vlan test packet to the tester belongs to a different port than the physical port that receives the vlan test packet, but the two ports have the same category.
  • the dotted line in the figure provided by the embodiment of the present invention indicates a virtual local area network connection, and the solid line indicates a cable connection.
  • the second embodiment of the present invention receives the vlan test packet of the line rate bandwidth corresponding to the tester that is sent by the test device and is forwarded by the first device port, where the line rate corresponding to the test device is smaller than the line speed of the device port to be tested.
  • the test packet sent by the vlan test packet after being transmitted between the first preset number of virtual ports pre-configured on the port of the device to be tested and the first device port is sent to the tester, so that the tester detects the vlan.
  • the packet loss rate of the test packet is determined. According to the packet loss rate of the vlan test packet, it is determined whether the device under test is running normally under the condition of the line speed bandwidth. The device can detect the high-speed device port under the line speed bandwidth condition. Whether it is running normally, there is no need to purchase a large rate of test equipment, saving costs and realizing the reuse of resources.
  • the method for detecting a device port according to Embodiment 3 of the present invention is applicable to a tester, and steps 310-330 are performed.
  • step 310 the virtual LAN vlan test packet carrying the line rate bandwidth corresponding to the tester is sent to the device port to be tested, and the first pre-configured vlan test packet is pre-configured on the device port to be tested.
  • a number of virtual ports are passed between the first device port and the first device port.
  • the tester sends a vlan test packet, so that the vlan test packet is transmitted to the device port to be tested through the first device port.
  • the tester is connected to the reference port through a cable, and the vlan test packet is sent to the reference port by using the cable, and the vlan test packet is transmitted to the first device by using the virtual local area network connection between the reference port and the first device port.
  • the port uses the cable connection between the first device port and the device port to be tested to deliver the vlan test packet to the device port to be tested.
  • the vlan test packet After the vlan test packet arrives at the port of the device under test, the first preset number of virtual ports pre-configured on the port of the device to be tested are transmitted between the first device port and the first device port.
  • the vlan test packet sent by the tester is a 64-byte data packet. In this case, the vlan test packet can reflect the line rate bandwidth of the tester.
  • step 320 the vlan test packet obtained after the first predetermined number of times of transmission by the port of the device to be tested is received, and the packet loss rate of the vlan test packet is detected.
  • the tester receives the vlan test packet sent by the port of the device to be tested, and detects whether there is a packet loss in the process of transmitting the vlan test packet according to the received vlan test packet and the transmitted vlan test packet.
  • the tester determines that there is no packet loss in the vlan test packet, and when the vlan test packet is sent, When the number of data packets is greater than the number of data packets received by the vlan test packet, the tester determines that the vlan test packet has packet loss.
  • step 330 according to the packet loss rate of the vlan test packet, it is determined whether the device port under test is running normally under the condition of the line speed bandwidth.
  • the vlan test packet is sent to the port of the device to be tested by the tester, and after the tester receives the vlan test packet obtained after the first predetermined number of times of transmission by the port of the device to be tested, the tester detects The packet loss rate of the vlan test packet.
  • the tester determines that the device under test runs normally under the condition of the online speed bandwidth, and can detect the high-speed device port by using the related test device. Whether it runs normally under the condition of line speed bandwidth, it does not need to purchase a large rate of test equipment, which saves costs and realizes the reuse of resources.
  • Embodiment 4 The following is a device port detecting apparatus provided in Embodiment 4 of the present invention.
  • the embodiment of the device is the same as the above-mentioned method embodiment, and the details of the device embodiment are not described in detail in the device embodiment.
  • the embodiment of the invention provides a device port detecting device, as shown in FIG. 9, which may include:
  • the receiving module 10 is configured to: receive a virtual local area network vlan test packet sent by the tester and forwarded by the first device port, and the line rate bandwidth corresponding to the tester is smaller than the device port to be tested. Line speed bandwidth;
  • the delivery module 20 is configured to: transmit a vlan test packet between the first preset number of virtual ports pre-configured on the port of the device to be tested and the first device port;
  • the processing module 30 is configured to: send the vlan test packet received after the first preset number of times of transmission to the tester, so that the tester detects the packet loss rate of the vlan test packet, and according to the vlan test packet, The packet loss rate determines whether the device port under test is running normally under the line speed bandwidth condition.
  • the processing module 30 is configured to: when the packet loss rate of the vlan test packet is zero, determine that the device to be tested is running normally under the condition of the online speed bandwidth, and the packet loss rate of the vlan test packet is not Zero hour,
  • the receiving module 10 is configured to:
  • the vlan test message sent by the tester passes through the first connection between the tester and the reference port. Receiving and obtaining a vlan test report sent by the tester after the cable, the vlan connection between the reference port and the first device port, and the second cable connected between the first device port and the device port to be tested are transmitted.
  • the first preset quantity is a line speed of the device port to be tested. The ratio of the bandwidth to the line rate bandwidth of the tester.
  • the delivery module 20 includes:
  • the first sub-module 21 is configured to: obtain a first reference value after the rounding operation, the ratio of the line rate bandwidth of the device port under test to the line rate bandwidth of the first port;
  • the second sub-module 23 is configured to: receive the vlan test packet sent by the tester, and transmit the vlan test packet between the pre-configured first reference value virtual port and the first device port;
  • the third sub-module 25 is configured to: obtain a first difference between a difference between a line rate bandwidth of the device port under test and a first reference value and a first line speed bandwidth of the first port;
  • the fourth sub-module 27 is configured to: obtain a second reference value of a ratio of the first difference value to the line rate bandwidth of the second port, where the second reference value is an integer, and the sum of the first reference value and the second reference value is equal to First preset quantity;
  • the fifth sub-module 29 is configured to: receive the vlan test packet sent by the tester, and transmit the vlan test packet between the pre-configured second reference value virtual port and the first device port.
  • Another embodiment of the present invention provides a device for detecting a device port, as shown in FIG.
  • the sending module 40 is configured to: send, by using the first device port, the virtual LAN vlan test packet carrying the line rate bandwidth corresponding to the tester to the device port to be tested, so that the vlan test packet is pre-configured on the device port to be tested. Passing between a preset number of virtual ports and the first device port;
  • the receiving detection module 50 is configured to: receive a vlan test packet that is received after the first preset number of times of transmission by the port of the device to be tested, and detect a packet loss rate of the vlan test packet;
  • the determining module 60 is configured to: determine, according to the packet loss rate of the vlan test packet, whether the device port under test is running normally under the line speed bandwidth condition.
  • the vlan test packet carrying the line rate bandwidth corresponding to the tester which is sent by the test device and transmitted by the first device port, is received, wherein the line rate corresponding to the tester is smaller than the device to be tested.
  • the line rate of the backup port is sent to the tester.
  • the test packet obtained by transmitting the vlan test packet between the first preset number of virtual ports pre-configured on the port of the device to be tested and the first device port is sent to the tester.
  • the tester detects the packet loss rate of the vlan test packet, and determines whether the device port under test is running normally under the online speed bandwidth condition according to the packet loss rate of the vlan test packet.
  • the device can detect the high rate device port online by using the low rate test device. Whether it runs normally under the condition of fast bandwidth, it does not need to purchase test equipment of large rate, which saves cost and realizes reuse of resources.
  • the embodiment further provides a computer readable storage medium storing computer executable instructions for performing a method for detecting a device port in any of the above embodiments.
  • FIG. 12 is a schematic diagram showing the hardware structure of an electronic device according to Embodiment 4 of the present invention. As shown in FIG. 12, the electronic device includes: one or more processors 410 and a memory 420. One processor 410 is taken as an example in FIG.
  • the electronic device may further include an input device 430 and an output device 440.
  • the processor 410, the memory 420, the input device 430, and the output device 440 in the electronic device may be connected by a bus or other means, and the bus connection is taken as an example in FIG.
  • the input device 430 can receive input numeric or character information
  • the output device 440 can include a display device such as a display screen.
  • the memory 420 is a computer readable storage medium that can be used to store software programs, computer executable programs, and modules.
  • the processor 410 executes a plurality of functional applications and data processing by executing software programs, instructions, and modules stored in the memory 420 to implement the detection method of any one of the device ports in the above embodiments.
  • the memory 420 may include a storage program area and an storage data area, wherein the storage program area may store an operating system, an application required for at least one function; the storage data area may store data created according to usage of the electronic device, and the like.
  • the memory may include volatile memory such as random access memory (RAM), and may also include non-volatile memory such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device.
  • Memory 420 can be a non-transitory computer storage medium or a transitory computer storage medium.
  • the non-transitory computer storage medium such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device.
  • memory 420 can optionally include memory remotely located relative to processor 410, which can be connected to the electronic device over a network. Examples of the above networks may include the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
  • Input device 430 can be used to receive input digital or character information and to generate key signal inputs related to user settings and function control of the electronic device.
  • Output device 440 can include a display device such as a display screen.
  • the electronic device of this embodiment may further include a communication device 450 that transmits information over the communication network.
  • a person skilled in the art can understand that all or part of the process of implementing the above embodiment method can be completed by executing related hardware by a computer program, and the program can be stored in a non-transitory computer readable storage medium.
  • the program when executed, may include the flow of an embodiment of the method as described above, wherein the non-transitory computer readable storage medium may be a magnetic disk, an optical disk, a read only memory (ROM), or a random access memory (RAM). Wait.
  • the present disclosure provides a method and a device for detecting a device port, which can be used to detect whether a high-speed device port runs normally under the condition of a line speed bandwidth, and does not need to purchase a large-rate test device, thereby saving costs and realizing resources. Re-use.

Landscapes

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

Abstract

一种设备端口的检测方法及装置,该方法包括:接收测试仪发送的、经第一设备端口转发的携带测试仪对应的线速带宽的虚拟局域网vlan测试报文,测试仪对应的线速带宽小于待测设备端口的线速带宽;将vlan测试报文在待测设备端口上预先配置的第一预设数量个虚拟端口与第一设备端口之间进行传递;将经过第一预设数量次的传递之后接收到的vlan测试报文发送至测试仪,使测试仪检测vlan测试报文的丢包率,并根据丢包率确定待测设备端口在线速带宽条件下是否运行正常。

Description

设备端口的检测方法及装置 技术领域
本公开涉及通信技术领域,例如涉及一种设备端口的检测方法及装置。
背景技术
在测试设备端口时,需要采用与被测设备端口同等速率的测试仪,比如:10Gbps、40Gbps和100Gbps端口的设备,测试时需要采用带宽为10Gbps的测试仪测试10Gbps端口,采用带宽为40Gbps的测试仪测试40Gbps端口,以及采用带宽为100Gbps的测试仪测试100Gbps端口。如图1a所示,为相关技术中对10Gbps端口的设备进行测试的硬件连接示意图;如图1b所示,为相关技术中对40Gbps端口的设备进行测试的硬件连接示意图。如图2a所示,为相关技术中对10Gbps端口的设备进行测试的数据转发示意图,如图2b所示,为相关技术中对40Gbps端口的设备进行测试的数据转发示意图。
但是,网络流量增长非常迅猛,设备端口将会朝着200Gbps,400Gbps甚至更大速率的端口发展,按照相关的测试方法,有如下缺陷:
(1)成本高:购买这些200Gbps,400Gbps甚至速率更大测试仪等测试设备,将会增加开支,并且如果小速率的端口不再被使用,那么小速率的模块和测试仪也将被遗弃,造成资源浪费。
(2)可靠性降低:测试端口速率越大,在测试端口时的配置越复杂,出错的可能性越大。
发明内容
本公开提供一种设备端口的检测方法及装置,可以解决相关技术中配置高速率的测试仪带来的高成本、资源浪费以及测试端口速率大、在对端口进行测试时配置复杂,且测试可靠性差的问题。
本发明实施例提供一种设备端口的检测方法,可以包括:
接收测试仪发送的、经第一设备端口转发的携带所述测试仪对应的线速带宽的虚拟局域网vlan测试报文,其中,所述测试仪对应的线速带宽小于待测设 备端口的线速带宽;
将所述vlan测试报文在待测设备端口上预先配置的第一预设数量个虚拟端口与所述第一设备端口之间进行传递;以及
将经过第一预设数量次的传递之后接收到的所述vlan测试报文发送至所述测试仪,使所述测试仪检测所述vlan测试报文的丢包率,并根据所述vlan测试报文的丢包率确定待测设备端口在线速带宽条件下是否运行正常。
可选地,根据所述vlan测试报文的丢包率确定待测设备端口在线速带宽条件下是否运行正常,包括:在所述vlan测试报文的丢包率为零时,确定待测设备端口在线速带宽条件下运行正常;以及
在所述vlan测试报文的丢包率不为零时,接收交换芯片发送的请求命令,并根据所述请求命令向所述交换芯片反馈待测设备端口对应的寄存器中的数据,使得所述交换芯片在判断出待测设备端口对应的寄存器中的数据处于正常范围时,确定待测设备端口在线速带宽条件下运行正常。
可选地,所述接收测试仪发送的、经第一设备端口转发的携带所述测试仪对应的线速带宽的虚拟局域网vlan测试报文,包括:
在所述测试仪发出的所述vlan测试报文依次经过所述测试仪与参考端口之间连接的第一线缆、所述参考端口与所述第一设备端口之间的vlan连接及所述第一设备端口与待测设备端口之间连接的第二线缆传输后,接收并获得所述测试仪发送的所述vlan测试报文。
可选地,当所述测试仪的端口种类为一种且待测设备端口的线速带宽是所述测试仪对应的线速带宽的整数倍时,所述第一预设数量为待测设备端口的线速带宽与所述测试仪对应的线速带宽的比值。
可选地,当所述测试仪的端口种类包括第一端口和线速带宽小于所述第一端口的线速带宽的第二端口、且待测设备端口的线速带宽是所述第一端口的线速带宽的非整数倍时,所述将所述vlan测试报文在待测设备端口上预先配置的第一预设数量个虚拟端口与所述第一设备端口之间进行传递包括:
获取待测设备端口的线速带宽与所述第一端口的线速带宽的比值在取整操作后的第一参考值;
接收所述测试仪发送的所述vlan测试报文,将所述vlan测试报文在预先配置的第一参考值个虚拟端口与所述第一设备端口之间进行传递;
获取待测设备端口的线速带宽与所述第一参考值和所述第一端口的第一线速带宽的乘积之差的第一差值;
获取所述第一差值与所述第二端口的线速带宽的比值的第二参考值,其中所述第二参考值为整数,所述第一参考值与所述第二参考值的和为所述第一预设数量;以及
接收所述测试仪发送的所述vlan测试报文,将所述vlan测试报文在预先配置的第二参考值个虚拟端口与所述第一设备端口之间进行传递。
本发明实施例还提供另一种设备端口的检测方法,可以包括:
经第一设备端口、向待测设备端口发送携带测试仪对应的线速带宽的虚拟局域网vlan测试报文,使得所述vlan测试报文在待测设备端口上预先配置的第一预设数量个虚拟端口与所述第一设备端口之间进行传递;
接收待测设备端口发送的经过所述第一预设数量次的传递之后得到的所述vlan测试报文,并检测所述vlan测试报文的丢包率;以及
根据所述vlan测试报文的丢包率,确定待测设备端口在线速带宽条件下是否运行正常。
本发明实施例还提供一种设备端口的检测装置,可以包括:
接收模块,设置为:接收测试仪发送的、经第一设备端口转发的携带所述测试仪对应的线速带宽的虚拟局域网vlan测试报文,其中,所述测试仪对应的线速带宽小于待测设备端口的线速带宽;
传递模块,设置为:将所述vlan测试报文在待测设备端口上预先配置的第一预设数量个虚拟端口与所述第一设备端口之间进行传递;以及
处理模块,设置为:将经过第一预设数量次的传递之后接收到的所述vlan测试报文发送至所述测试仪,使所述测试仪检测所述vlan测试报文的丢包率,并根据所述vlan测试报文的丢包率确定待测设备端口在线速带宽条件下是否运行正常。
可选地,所述处理模块是设置为:在所述vlan测试报文的丢包率为零时,确定待测设备端口在线速带宽条件下运行正常,在所述vlan测试报文的丢包率不为零时,接收交换芯片发送的请求命令,并根据所述请求命令向所述交换芯片反馈待测设备端口对应的寄存器中的数据,使得所述交换芯片在判断出待测设备端口对应的寄存器中的数据处于正常范围时,确定待测设备端口在线速带 宽条件下运行正常。
可选地,所述接收模块是设置为:
在所述测试仪发出的所述vlan测试报文依次经过所述测试仪与参考端口之间连接的第一线缆、所述参考端口与所述第一设备端口之间的vlan连接及所述第一设备端口与待测设备端口之间连接的第二线缆传输后,接收并获得所述测试仪发送的所述vlan测试报文。
可选地,当所述测试仪的端口种类为一种且待测设备端口的线速带宽是所述测试仪对应的线速带宽的整数倍时,所述第一预设数量为待测设备端口的线速带宽与所述测试仪对应的线速带宽的比值。
可选地,当所述测试仪的端口种类包括第一端口和线速带宽小于所述第一端口的线速带宽的第二端口、且待测设备端口的线速带宽是所述第一端口的线速带宽的非整数倍时,所述传递模块包括:
第一子模块,设置为:获取待测设备端口的线速带宽与所述第一端口的线速带宽的比值在取整操作后的第一参考值;
第二子模块,设置为:接收所述测试仪发送的所述vlan测试报文,将所述vlan测试报文在预先配置的第一参考值个虚拟端口与所述第一设备端口之间进行传递;
第三子模块,设置为:获取待测设备端口的线速带宽与所述第一参考值、所述第一端口的第一线速带宽的乘积之差的第一差值;
第四子模块,设置为:获取所述第一差值与所述第二端口的线速带宽的比值的第二参考值,其中所述第二参考值为整数,所述第一参考值与所述第二参考值的和等于所述第一预设数量;以及
第五子模块,设置为:接收所述测试仪发送的所述vlan测试报文,将所述vlan测试报文在预先配置的第二参考值个虚拟端口与所述第一设备端口之间进行传递。
本发明实施例还提供另一种设备端口的检测装置,可以包括:
发送模块,设置为:经第一设备端口、向待测设备端口发送携带测试仪对应的线速带宽的虚拟局域网vlan测试报文,使得所述vlan测试报文在待测设备端口上预先配置的第一预设数量个虚拟端口与所述第一设备端口之间进行传递;
接收检测模块,设置为:接收待测设备端口发送的经过所述第一预设数量次的传递之后接收到的所述vlan测试报文,并检测所述vlan测试报文的丢包率;以及
确定模块,设置为:根据所述vlan测试报文的丢包率,确定待测设备端口在线速带宽条件下是否运行正常。
本发明实施例还提供一种计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令用于执行上述任意一种方法。
本发明实施例还提供一种电子设备,该电子设备包括一个或多个处理器、存储器以及一个或多个程序,所述一个或多个程序存储在存储器中,当被一个或多个处理器执行时,执行上述任意一种方法。
本发明实施例还提供了一种计算机程序产品,所述计算机程序产品包括存储在非暂态计算机可读存储介质上的计算机程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,使所述计算机执行上述任意一种方法。
本发明实施例可以实现利用低速率测试设备检测高速率的设备端口在线速带宽条件下是否运行正常,不需要采购大速率的测试设备,节省了成本,实现资源的再次利用。
附图说明
图1a为相关技术10Gbps设备端口检测的硬件连接示意图;
图1b为相关技术40Gbps设备端口检测的硬件连接示意图;
图2a为相关技术10Gbps设备端口检测的数据转发示意图;
图2b为相关技术40Gbps设备端口检测的数据转发示意图;
图3为本发明实施例一提供的设备端口的检测方法示意图;
图4为本发明实施例设备端口检测的数据转发示意图一;
图5为本发明实施例二提供的设备端口的检测方法示意图;
图6为本发明实施例设备端口检测的数据转发示意图二;
图7为本发明实施例二vlan测试报文的传递过程示意图;
图8为本发明实施例三提供的设备端口的检测方法示意图;
图9为本发明实施例四提供的设备端口的检测装置示意图一;
图10为本发明实施例四提供的设备端口的检测装置示意图二;
图11为本发明实施例四提供的设备端口的检测装置示意图三;
图12为本发明实施例四提供的一种电子设备的硬件结构示意图。
具体实施方式
以下结合说明书附图对本公开的实施例进行说明,应当理解,此处所描述的实施例用于说明和解释本公开,并不用于限定本公开,并且在不冲突的情况下,本公开中的实施例及实施例中的特征可以相互组合。
实施例一
如图3所示,为本发明实施例一提供的设备端口的检测方法,该方法可以应用于待测设备端口,可以包括步骤110-步骤130。
在步骤110中,接收测试仪发送的、经第一设备端口转发的携带所述测试仪对应的线速带宽的虚拟局域网vlan测试报文。
其中,所述测试仪对应的线速带宽小于待测设备端口的线速带宽。
测试仪可以通过第一设备端口与待测设备端口实现连接,且第一设备端口和待测设备端口可以位于同一设备上,第一设备端口和待测设备端口的线速带宽相同。在测试仪发送vlan测试报文后,根据测试仪与第一设备端口之间的连接,第一设备端口获取vlan测试报文,第一设备端口将vlan测试报文发送至待测设备端口,且vlan测试报文中携带有测试仪对应的线速带宽信息,其中,测试仪对应的线速带宽小于待测设备端口的线速带宽。例如,测试仪对应的线速带宽为10Gbps,待测设备上设置有40Gbps端口和100Gbps端口,测试仪对应的线速带宽小于待测设备端口的线速带宽,可以实现利用测试仪来检测待测设备端口在线速带宽条件下是否运行正常。
可选地,测试仪发送的vlan测试报文是以64字节组成的数据包,在这种情况下的vlan测试报文可以体现测试仪的线速带宽。
本实施例中,第一设备端口和待测设备端可以为同一台设备上的端口,也可以为不同台设备的端口,例如,第一设备端口和待测设备端可以为同一交换机上的端口,也可以为不同台交换机上的端口。线速带宽是对单个端口而言的,可以理解为交换机端口每秒能转发的最大数据包的个数,以太网每个数据包最 小为64字节,将测试仪发送的vlan测试报文设置64字节的数据包,打满交换机端口,交换机的端口速率即达到该端口的线速带宽,交换机的端口速率也就是我们常说的10Gbps、40Gbps端口等。
在步骤120中,将vlan测试报文在待测设备端口上预先配置的第一预设数量个虚拟端口与第一设备端口之间进行传递。
第一设备端口的线速带宽和待测设备端口的线速带宽相同,且待测设备端口上预先配置有第一预设数量个虚拟端口,第一设备端口上也预先配置有第一预设数量个虚拟端口,通过第一预设数量个虚拟端口,在第一设备端口与待测设备端口之间进行vlan测试报文的传递。
第一设备端口和待测设备端口上的虚拟端口的数量相同,但是每个虚拟端口的标识有所区别,每个虚拟端口按照不同的配置,可以被划分在多个相同或者不同的vlan中。
如图4所示,例如:测试仪对应的线速带宽为10Gbps,待测设备端口和第一设备端口的线速带宽均为40Gbps,第一设备端口上的虚拟端口和待测设备端口上的虚拟端口的数量均为4个,第一设备端口上的虚拟端口为vlan113、vlan114、vlan115以及vlan116,待测设备端口上的虚拟端口为vlan114、vlan115、vlan116以及vlan117。测试仪发送的是vlan113测试报文,vlan113测试报文经过一个10Gbps端口,即图4所示的10G1端口,到达第一设备端口,第一设备端口在接收到vlan113测试报文之后,利用第一设备端口的vlan113虚拟端口通过第一设备端口与待测设备端口之间的连接将vlan113测试报文发送至待测设备端口,待测设备端口在接收到vlan113测试报文后翻译为vlan114测试报文,并且通过交换芯片检查vlan表项,将翻译得到的vlan114测试报文发送至第一设备端口,再由第一设备端口将vlan114测试报文从第一设备端口发出。其中,交换芯片可以为以太网芯片(MAC芯片),即交换机的转发芯片。
第一设备端口利用自身的vlan114虚拟端口,通过第一设备端口与待测设备端口之间的连接,将vlan114测试报文发送至待测设备端口,待测设备端口在接收到vlan114测试报文后翻译为vlan115测试报文,并且通过交换芯片检查vlan表项,将翻译得到的vlan115测试报文发送至第一设备端口,再由第一设备端口将vlan115测试报文从第一设备端口发出。
在这种情况下,第一设备端口利用vlan115虚拟端口通过第一设备端口与 待测设备端口之间的连接将vlan115测试报文发送至待测设备端口,待测设备端口在接收到vlan115测试报文后翻译为vlan116测试报文,并且通过交换芯片检查vlan表项,将翻译得到的vlan116测试报文发送至第一设备端口,再由第一设备端口将vlan116测试报文从第一设备端口发出。
第一设备端口利用vlan116虚拟端口通过第一设备端口与待测设备端口之间的连接将vlan116测试报文发送至待测设备端口,待测设备端口在接收到vlan116测试报文后翻译为vlan117测试报文。
待测设备端口将vlan116测试报文后翻译为vlan117测试报文之后,通过交换芯片检查vlan表项,将翻译得到的vlan117测试报文发送到被配置为vlan117的端口,即图4所示的10G2端口,由10G2端口将vlan117测试发送至测试仪。
在步骤130中,将经过第一预设数量次的传递之后接收到的所述vlan测试报文发送至所述测试仪,使所述测试仪检测所述vlan测试报文的丢包率,并根据所述vlan测试报文的丢包率确定待测设备端口在线速带宽条件下是否运行正常。
本实施例中以第一预设数量为4进行阐述,这里的传递次数可以理解为第一设备端口向待测设备端口发送vlan测试报文的次数。例如,在第一设备端口向待测设备端口发送4次vlan测试报文之后,得到的vlan测试报文为vlan116测试报文,待测设备端口在接收到vlan116测试报文后将vlan116测试报文翻译为vlan117测试报文,并通过交换芯片的vlan表项将vlan117测试报文发送至测试仪。
测试仪根据接收到的vlan117测试报文,检测vlan117测试报文的数据包的个数,并将开始发送的vlan113测试报文的数据包个数与vlan117测试报文的数据包的个数进行比较,根据比较结果判断vlan测试报文在传输过程中是否存在丢包,当vlan测试报文的丢包率为零时,确定待测设备端口在线速带宽条件下运行正常。当待测设备端口在线速带宽条件下运行正常时,待测设备端口有入方向的40Gbps线速带宽,即待测设备端口每发送一次vlan测试报文,可以累积待测设备端口入方向的10Gbps线速带宽。
可选地,待测设备端口、第一设备端口以及测试仪的端口均配置为中继模式(trunk模式),使得每个端口可以支持多个vlan配置,并且可以配置不同 的本征vlan(Native Vlan),保证数据不会被广播。而且高速率线速带宽设备的端口配置的vlan可以包含用于复制线速带宽时所需要的所有vlan,以防止数据被丢弃。其中,上述高速率线速带宽设备的端口可以为线速带宽为40Gbps、100Gbps或者线速带宽更大的端口,上述复制线速带宽可以理解为图4中第一设备端口与待测设备端口之间虚线表示的测试报文转发过程。
可选地,在通常情况下测试仪可以同时通过两个线速带宽相同的物理端口发送vlan测试报文至第一设备端口和第二设备端口,这里的第二设备端口为上述的待测设备端口,在这种情况下可以同时检测第一设备端口和第二设备端口在线速带宽条件下是否运行正常。本公开提供的多个实施例中以检测待测设备端口在线速带宽条件下是否运行正常为例进行阐述。
本发明实施例一,通过接收测试仪发送的、经第一设备端口转发的携带测试仪对应的线速带宽的vlan测试报文,其中测试仪对应的线速带宽小于待测设备端口的线速带宽;将vlan测试报文在待测设备端口上预先配置的第一预设数量个虚拟端口与第一设备端口之间进行传递后,接收到的测试报文发送至测试仪,使测试仪检测vlan测试报文的丢包率,并根据vlan测试报文的丢包率确定待测设备端口在线速带宽条件下是否运行正常,可以实现利用相关的测试设备检测高速率的设备端口在线速带宽条件下是否运行正常,不需要采购大速率的测试设备,节省了成本,实现资源的再次利用。
实施例二
如图5所示,为本发明实施例二提供的设备端口的检测方法,该方法可以应用于待测设备端口,可以包括步骤210-步骤240。
在步骤210中,接收测试仪发送的、经第一设备端口转发的携带测试仪对应的线速带宽的虚拟局域网vlan测试报文。
其中,测试仪对应的线速带宽小于待测设备端口的线速带宽。
其中,第一设备端口的线速带宽和待测设备端口的线速带宽相同,在接收vlan测试报文时的过程如下:
在测试仪发出的vlan测试报文依次经过测试仪与参考端口之间连接的第一线缆、所述参考端口与所述第一设备端口之间的vlan连接及第一设备端口与待测设备端口之间连接的第二线缆传输后,接收并获得测试仪发送的vlan测试报 文。
例如,参考端口可以与待测设备设置在同一单板上,参考端口可以与待测设备上的第一设备端口和待测设备端口连接,且参考端口的线速带宽大于等于测试仪对应的线速带宽。参考端口与测试仪之间通过第一线缆连接,参考端口与第一设备端口之间通过虚拟局域网连接,第一设备端口与待测设备端口通过第二线缆连接。
测试仪发送vlan测试报文,根据测试仪与参考端口之间的第一线缆将vlan测试报文发送至参考端口,根据参考端口与第一设备端口之间的虚拟局域网连接,将vlan测试报文发送至第一设备端口,根据第一设备端口与待测设备端口之间的第二线缆,将vlan测试报文发送至待测设备端口。
例如:测试仪对应的线速带宽为10Gbps,待测设备端口的线速带宽和第一设备端口的线速带宽均为40Gbps,参考端口的线速带宽为10Gbps,且参考端口可以与待测设备端口、第一设备端口设置在同一单板上,参考端口与第一设备端口通过虚拟局域网连接。在测试仪与参考端口连接时,测试仪与参考端口的线速带宽均为10Gbps,在这种情况下连接在测试仪与参考端口之间的第一线缆两侧的接头均与线速带宽10Gbps相匹配。第二线缆连接第一设备端口与待测设备端口,第二线缆两端的接头均与第一设备端口和待测设备端口的线速带宽40Gbps相匹配。vlan测试报文通过第一线缆、参考端口与第一设备端口之间的虚拟局域网以及第二线缆进入待测设备端口。在这种情况下,参考端口的线速带宽与测试仪的线速带宽相同,但参考端口的线速带宽与测试仪的线速带宽可以相同也可以不同,参考端口的线速带宽可以大于测试仪的线速带宽,参考端口的线速带宽也可以小于测试仪的线速带宽。
当参考端口的线速带宽与测试仪的线速带宽不相同时,例如,测试仪对应的线速带宽为10Gbps,待测设备端口的线速带宽和第一设备端口的线速带宽均为40Gbps,参考端口的线速带宽为40Gbps,且参考端口可以与待测设备端口、第一设备端口设置在同一单板上,参考端口与第一设备端口通过虚拟局域网连接。在测试仪与参考端口连接时,测试仪的线速带宽为10Gbps,参考端口的线速带宽为40Gbps,在这种情况下连接测试仪和参考端口的第一线缆可以采用一分四接头,即第一线缆的一侧为4个接头,每个接头对应10Gbps的线速带宽, 第一线缆的另一侧为一个接头,对应40Gbps的线速带宽。在测试仪一侧通过10Gbps的端口发出vlan测试报文,vlan测试报文到达参考端口之后,vlan测试报文所携带测试仪对应的线速带宽仍为10Gbps。第二线缆连接第一设备端口与待测设备端口,第二线缆两端的接头均与第一设备端口和待测设备端口的线速带宽40Gbps相匹配。vlan测试报文通过第一线缆、参考端口与第一设备端口之间的虚拟局域网以及第二线缆进入待测设备端口。其中,第一线缆4个接头一侧中的一个接头可以与测试仪连接,第一线缆一个接头一侧的40Gbps线速带宽接头与上述参考端口连接。
在步骤220中,将vlan测试报文在待测设备端口上预先配置的第一预设数量个虚拟端口与第一设备端口之间进行传递。
待测设备端口上预先配置有第一预设数量个虚拟端口,第一设备端口上也预先配置有第一预设数量个虚拟端口,通过第一预设数量个虚拟端口,在第一设备端口与待测设备端口之间进行vlan测试报文的传递。
可选地,当测试仪的端口种类为一种且待测设备端口的线速带宽是测试仪对应的线速带宽的整数倍时,第一预设数量为待测设备端口的线速带宽与测试仪对应的线速带宽的比值。
例如,待测设备端口的线速带宽为40Gbps,测试仪包括一种端口,且端口对应的线速带宽为10Gbps,在这种情况下待测设备端口的线速带宽是测试仪对应的线速带宽的4倍,第一预设数量为待测设备端口的线速带宽与测试仪对应的线速带宽的比值4。
当第一预设数量为4,测试仪与第一设备端口之间通过参考端口连接,vlan测试报文在待测设备端口与第一设备端口之间进行传递的流程如图6所示。
测试仪对应的线速带宽为10Gbps,待测设备端口和第一设备端口的线速带宽均为40Gbps,测试仪与第一设备端口之间通过参考端口连接,参考端口对应的线速带宽为40Gbps,参考端口与测试仪通过第一线缆连接,参考端口与第一设备端口通过虚拟局域网连接。第一设备端口上的虚拟端口和待测设备端口上的虚拟端口的数量均为4个。在这种情况下的第一线缆可以采用的是一分四接头,即第一线缆的一侧为4个接头,每个接头对应10Gbps的线速带宽,第一线缆的另一侧为一个接头,对应40Gbps的线速带宽。vlan测试报文在测试仪一侧通过测试仪10Gbps的端口发出,到达参考端口之后,vlan测试报文所携带测试 仪对应的线速带宽仍为10Gbps。
如图6所示,第一设备端口上的虚拟端口为vlan113、vlan114、vlan115以及vlan116,待测设备端口上的虚拟端口为vlan114、vlan115、vlan116以及vlan117。测试仪发送的是vlan113测试报文,vlan113测试报文通过第一线缆进入参考端口40G0,在这种情况下vlan113测试报文携带的测试仪对应的线速带宽仍为10Gbps。
根据参考端口与第一设备端口之间的虚拟局域网连接,将vlan113测试报文发送至第一设备端口,第一设备端口在接收到vlan113测试报文之后,利用vlan113虚拟端口通过第一设备端口与待测设备端口之间的第二线缆连接将vlan113测试报文发送至待测设备端口,待测设备端口在接收到vlan113测试报文后翻译为vlan114测试报文,并且通过交换芯片检查vlan表项,将翻译得到的vlan114测试报文发送至第一设备端口,再由第一设备端口将vlan114测试报文从第一设备端口发出。
第一设备端口利用vlan114虚拟端口通过第一设备端口与待测设备端口之间的第二线缆连接将vlan114测试报文发送至待测设备端口,待测设备端口在接收到vlan114测试报文后翻译为vlan115测试报文,并且通过交换芯片检查vlan表项,将翻译得到的vlan115测试报文发送至第一设备端口,再由第一设备端口将vlan115测试报文从第一设备端口发出。
在这种情况下,第一设备端口利用vlan115虚拟端口通过第一设备端口与待测设备端口之间的第二线缆连接将vlan115测试报文发送至待测设备端口,待测设备端口在接收到vlan115测试报文后翻译为vlan116测试报文,并且通过交换芯片检查vlan表项,将翻译得到的vlan116测试报文发送至第一设备端口,再由第一设备端口将vlan116测试报文从第一设备端口发出。
第一设备端口利用vlan116虚拟端口通过第一设备端口与待测设备端口之间的第二线缆连接将vlan116测试报文发送至待测设备端口,待测设备端口在接收到vlan116测试报文后翻译为vlan117测试报文。
待测设备端口将vlan116测试报文后翻译为vlan117测试报文之后,通过交换芯片检查vlan表项,将翻译得到的vlan117测试报文发送到参考端口中被配置为vlan117的端口,即图6所示的参考端口40G3,由参考端口40G3将vlan117测试报文发送至测试仪。
可选地,当测试仪的端口种类包括第一端口和线速带宽小于第一端口的线速带宽的第二端口,且待测设备端口的线速带宽是第一端口的线速带宽的非整数倍时,例如,待测设备端口的线速带宽为100Gbps,测试仪包括第一端口和第二端口,且第一端口对应的第一线速带宽为40Gbps,第二端口对应的第二线速带宽为10Gbps在这种情况下,待测设备端口的线速带宽是第一端口的第一线速带宽的2.5倍,在这种情况下在这种情况下,vlan测试报文的传递过程包括步骤2210-步骤2250,如图7所示。
在步骤2210中,获取待测设备端口的线速带宽与第一端口的线速带宽的比值在取整操作后的第一参考值。
可以利用软件计算待测设备端口的线速带宽与第一端口的第一线速带宽的比值,并对比值进行取整操作,即计算待测设备端口的线速带宽100Gbps与第一线速带宽40Gbps的比值,得到2.5,对2.5进行取整操作,获取第一参考值2。
在步骤2220中,接收测试仪发送的vlan测试报文,将vlan测试报文在预先配置的第一参考值个虚拟端口与第一设备端口之间进行传递。
待测设备端口接收到vlan测试报文后,通过预先配置的2个虚拟端口与第一设备端口进行vlan测试报文的传递,在传递完成后进行步骤2230。
在步骤2230中,获取待测设备端口的线速带宽与第一参考值和第一端口的第一线速带宽的乘积之差的第一差值。
可以利用软件计算第一参考值2与第一线速带宽40Gbps的乘积,将待测设备端口的线速带宽100Gbps与第一参考值2和第一线速带宽40Gbps的乘积80Gbps做差,获取第一差值20Gbps。
在步骤2240中,获取第一差值与第二端口的线速带宽的比值的第二参考值,其中第二参考值为整数,第一参考值与第二参考值的和为第一预设数量。
可以利用软件计算第一差值20Gbps与第二线速带宽10Gbps的比值,得到第二参考值2,其中第一参考值2与第二参考值2的和即为第一预设数量。第一参考值与第二参考值可以相等,也可以不等。
在步骤2250中,接收测试仪发送的vlan测试报文,将vlan测试报文在预先配置的第二参考值个虚拟端口与第一设备端口之间进行传递。
待测设备端口接收到vlan测试报文后,通过预先配置的2个虚拟端口与第 一设备端口进行vlan测试报文的传递,这里的2个虚拟端口与第二参考值相对应。
可选地,在待测设备端口的线速带宽是测试仪对应的线速带宽的非整数倍,例如:待测设备端口的线速带宽为100Gbps,测试仪对应的线速带宽为40Gbps时,待测设备上设置有10Gbps的端口,还可以将测试仪对应的线速带宽设置为10Gbps,实现测试仪与待测设备之间的vlan测试报文的传递,也可以采用一分四接头使得测试仪输出至待测设备的线速带宽为10Gbps,其中,第一线缆的一侧为4个接头,每个接头对应10Gbps的线速带宽,第一线缆的另一侧为一个接头,对应40Gbps的线速带宽,可以将第一线缆一个接头一侧与测试仪连接,将第一线缆4个接头一侧中的一个接头与参考端口连接,进而实现向测试设备端口发送测试报文进行端口测试。
其中,采用何种线缆,何种测试仪来实现vlan测试报文的传递,需要根据待测设备上的物理端口来确定。测试仪上可以包括一种端口,也可以包括两种或者多种端口。
在步骤230中,将经过第一预设数量次的传递之后接收到的vlan测试报文发送至测试仪,使测试仪检测vlan测试报文的丢包率,在vlan测试报文的丢包率为零时,确定待测设备端口在线速带宽条件下运行正常。
在第一设备端口与待测设备端口完成第一预设数量次的传递之后,待测试设备端口将接收到的vlan测试报文发送至测试仪,使得测试仪在获取待测试设备端口发送的vlan测试报文之后,统计vlan测试报文的数据包,将接收到的vlan测试报文的数据包与之前发送的vlan测试报文的数据包进行比较,当两者相等时,vlan测试报文不存在丢包,即丢包率为零时,确定待测设备端口在线速带宽条件下运行正常。
例如:测试仪接收到的是vlan117测试报文,根据接收到的vlan117测试报文,检测vlan117测试报文的数据包的个数,并将开始发送的vlan113测试报文的数据包个数与vlan117测试报文的数据包的个数进行比较,根据比较结果查看vlan测试报文在传输过程中是否存在丢包,当vlan测试报文的丢包率为零时,确定待测设备端口在线速带宽条件下运行正常。当待测设备端口在线速带宽条件下运行正常时,待测设备端口有入方向的40Gbps线速带宽,即待测设备端口每发送一次vlan测试报文后可以累积待测设备端口入方向的10Gbps 线速带宽。
在步骤240中,在vlan测试报文的丢包率不为零时,接收交换芯片发送的请求命令,并根据请求命令向所述交换芯片反馈待测设备端口对应的寄存器中的数据,使得交换芯片在判断出待测设备端口对应的寄存器中的数据处于正常范围时,确定待测设备端口在线速带宽条件下运行正常。
在vlan测试报文的丢包率不为零时,由于vlan测试报文在传递过程中经过多个端口,无法判断是不是待测设备端口的问题,需要待测设备端口接收交换芯片发送的请求命令,待测设备端口根据请求命令向交换芯片反馈待测设备端口对应的寄存器中的数据,使得交换芯片在接收到待测设备端口反馈的对应的寄存器中的数据后,查看寄存器中的数据是否处于正常范围内,在确定待测设备端口反馈的对应寄存器中的数据处于正常范围内时,确定待测设备端口在线速带宽条件下运行正常。
在待测设备端口通过虚拟端口接收到的vlan测试报文之后,将经过第一预设数量次的传递之后得到的vlan测试报文发送至测试仪,测试仪根据接收到的vlan测试报文来检测vlan测试报文在传递的过程中是否存在丢包的情况。在发送的vlan测试报文的数据包的个数与接收到的vlan测试报文的数据包的个数相等时,确定vlan测试报文不存在丢包,当发送的vlan测试报文的数据包的个数大于接收到的vlan测试报文的数据包的个数时,确定vlan测试报文存在丢包。其中,测试仪发送vlan测试报文的物理端口与接收vlan测试报文的物理端口属于不同的端口,但两个端口的类别相同。
其中,本发明实施例所提供的附图中虚线表示虚拟局域网连接,实线表示线缆连接。
本发明实施例二,通过接收测试仪发送的、经第一设备端口转发的携带测试仪对应的线速带宽的vlan测试报文,其中测试仪对应的线速带宽小于待测设备端口的线速带宽;将vlan测试报文在待测设备端口上预先配置的第一预设数量个虚拟端口与第一设备端口之间进行传递后接收到的测试报文发送至测试仪,使测试仪检测vlan测试报文的丢包率,并根据vlan测试报文的丢包率确定待测设备端口在线速带宽条件下是否运行正常,可以实现利用相关的测试设备检测高速率的设备端口在线速带宽条件下是否运行正常,不需要采购大速率的测试设备,节省了成本,实现资源的再次利用。
实施例三
如图8所示,为本发明实施例三提供的设备端口的检测方法,该方法可以应用于测试仪,步骤310-步骤330。
在步骤310中,经第一设备端口、向待测设备端口发送携带测试仪对应的线速带宽的虚拟局域网vlan测试报文,使得vlan测试报文在待测设备端口上预先配置的第一预设数量个虚拟端口与第一设备端口之间进行传递。
测试仪发送vlan测试报文,使得vlan测试报文通过第一设备端口传递至待测设备端口。例如,测试仪与参考端口通过线缆连接,利用线缆将vlan测试报文发送至参考端口,利用参考端口与第一设备端口之间的虚拟局域网连接,将vlan测试报文传递至第一设备端口,在利用第一设备端口与待测设备端口之间的线缆连接,将vlan测试报文传递至待测设备端口。
vlan测试报文到达待测设备端口之后,在待测设备端口上预先配置的第一预设数量个虚拟端口与第一设备端口之间进行传递。其中,测试仪发送的vlan测试报文是以64字节组成的数据包,在这种情况下的vlan测试报文可以体现测试仪的线速带宽。
在步骤320中,接收待测设备端口发送的经过第一预设数量次的传递之后得到的vlan测试报文,并检测vlan测试报文的丢包率。
测试仪接收待测设备端口发送的vlan测试报文,并根据接收到的vlan测试报文和发送的vlan测试报文来检测vlan测试报文在传递的过程中是否存在丢包的情况。当发送的vlan测试报文的数据包的个数与接收到的vlan测试报文的数据包的个数相等时,测试仪确定vlan测试报文不存在丢包,当发送的vlan测试报文的数据包的个数大于接收到的vlan测试报文的数据包的个数时,测试仪确定vlan测试报文存在丢包。
在步骤330中,根据所述vlan测试报文的丢包率,确定待测设备端口在线速带宽条件下是否运行正常。
当vlan测试报文在传递的过程中不存在丢包时,可以确定待测设备端口在线速带宽条件下运行正常,当vlan测试报文在传递的过程中存在丢包时,还需要利用交换芯片查看待测设备端口反馈的对应的寄存器中的数据,在待测设备端口向交换芯片反馈的对应寄存器中的数据处于正常范围内时,使得交换芯片 确定待测设备端口在线速带宽条件下运行正常。
本发明实施例三,通过测试仪向待测设备端口发送vlan测试报文,在测试仪接收到待测设备端口发送的经过第一预设数量次的传递之后得到的vlan测试报文之后,检测vlan测试报文的丢包率,在vlan测试报文的丢包率为零时,测试仪确定待测设备端口在线速带宽条件下运行正常,可以实现利用相关的测试设备检测高速率的设备端口在线速带宽条件下是否运行正常,不需要采购大速率的测试设备,节省了成本,实现资源的再次利用。
实施例四
以下为本发明实施例四提供的一种设备端口的检测装置。其中装置的实施例与上述的方法实施例属于同一构思,装置实施例中未详尽描述的细节内容,可以参考上述方法实施例。
本发明实施例提供一种设备端口的检测装置,如图9所示,可以包括:
接收模块10,设置为:接收测试仪发送的、经第一设备端口转发的携带测试仪对应的线速带宽的虚拟局域网vlan测试报文,其中,测试仪对应的线速带宽小于待测设备端口的线速带宽;
传递模块20,设置为:将vlan测试报文在待测设备端口上预先配置的第一预设数量个虚拟端口与第一设备端口之间进行传递;以及
处理模块30,设置为:将经过第一预设数量次的传递之后接收到的vlan测试报文发送至测试仪,使测试仪检测vlan测试报文的丢包率,并根据vlan测试报文的丢包率确定待测设备端口在线速带宽条件下是否运行正常。
可选地,所述处理模块30是设置为:在vlan测试报文的丢包率为零时,确定待测设备端口在线速带宽条件下运行正常,在vlan测试报文的丢包率不为零时,
接收交换芯片发送的请求命令,并根据请求命令向所述交换芯片反馈待测设备端口对应的寄存器中的数据,使得交换芯片在判断出待测设备端口对应的寄存器中的数据处于正常范围时,确定待测设备端口在线速带宽条件下运行正常。
可选地,所述接收模块10是设置为:
在测试仪发出的vlan测试报文依次经过测试仪与参考端口之间连接的第一 线缆、所述参考端口与所述第一设备端口之间的vlan连接及第一设备端口与待测设备端口之间连接的第二线缆传输后,接收并获得测试仪发送的vlan测试报文;
可选地,当测试仪的端口种类为一种且待测设备端口的线速带宽是测试仪对应的线速带宽的整数倍时,所述第一预设数量为待测设备端口的线速带宽与测试仪对应的线速带宽的比值。
可选地,当测试仪的端口种类包括第一端口和线速带宽小于第一端口的线速带宽的第二端口、且待测设备端口的线速带宽是第一端口的线速带宽的非整数倍时,如图10所示,传递模块20包括:
第一子模块21,设置为:获取待测设备端口的线速带宽与第一端口的线速带宽的比值在取整操作后的第一参考值;
第二子模块23,设置为:接收测试仪发送的vlan测试报文,将vlan测试报文在预先配置的第一参考值个虚拟端口与第一设备端口之间进行传递;
第三子模块25,设置为:获取待测设备端口的线速带宽与第一参考值、第一端口的第一线速带宽的乘积之差的第一差值;
第四子模块27,设置为:获取第一差值与第二端口的线速带宽的比值的第二参考值,其中第二参考值为整数,第一参考值与第二参考值的和等于第一预设数量;以及
第五子模块29,设置为:接收测试仪发送的vlan测试报文,将vlan测试报文在预先配置的第二参考值个虚拟端口与第一设备端口之间进行传递。
本发明实施例还提供另一种设备端口的检测装置,如图11所示,包括:
发送模块40,设置为:经第一设备端口、向待测设备端口发送携带测试仪对应的线速带宽的虚拟局域网vlan测试报文,使得vlan测试报文在待测设备端口上预先配置的第一预设数量个虚拟端口与第一设备端口之间进行传递;
接收检测模块50,设置为:接收待测设备端口发送的经过第一预设数量次的传递之后接收到的vlan测试报文,并检测vlan测试报文的丢包率;以及
确定模块60,设置为:根据vlan测试报文的丢包率确定待测设备端口在线速带宽条件下是否运行正常。
本发明实施例四,通过接收测试仪发送的、经第一设备端口转发的携带测试仪对应的线速带宽的vlan测试报文,其中测试仪对应的线速带宽小于待测设 备端口的线速带宽;将vlan测试报文在待测设备端口上预先配置的第一预设数量个虚拟端口与第一设备端口之间进行传递后得到的测试报文发送至测试仪,使测试仪检测vlan测试报文的丢包率,并根据vlan测试报文的丢包率确定待测设备端口在线速带宽条件下是否运行正常,可以实现利用低速率测试设备检测高速率的设备端口在线速带宽条件下是否运行正常,不需要采购大速率的测试设备,节省了成本,实现资源的再次利用。
本实施例还提供一种计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令用于执行上述实施例中的任意一种设备端口的检测方法。
图12表示本发明实施例四提供的一种电子设备的硬件结构示意图,如图12所示,该电子设备包括:一个或多个处理器410和存储器420。图12中以一个处理器410为例。
所述电子设备还可以包括:输入装置430和输出装置440。
所述电子设备中的处理器410、存储器420、输入装置430和输出装置440可以通过总线或者其他方式连接,图12中以通过总线连接为例。
输入装置430可以接收输入的数字或字符信息,输出装置440可以包括显示屏等显示设备。
存储器420作为一种计算机可读存储介质,可用于存储软件程序、计算机可执行程序以及模块。处理器410通过运行存储在存储器420中的软件程序、指令以及模块,从而执行多种功能应用以及数据处理,以实现上述实施例中的任意一种设备端口的检测方法。
存储器420可以包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需要的应用程序;存储数据区可存储根据电子设备的使用所创建的数据等。此外,存储器可以包括随机存取存储器(Random Access Memory,RAM)等易失性存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件或者其他非暂态固态存储器件。
存储器420可以是非暂态计算机存储介质或暂态计算机存储介质。该非暂态计算机存储介质,例如至少一个磁盘存储器件、闪存器件、或其他非易失性固态存储器件。在一些实施例中,存储器420可选包括相对于处理器410远程设置的存储器,这些远程存储器可以通过网络连接至电子设备。上述网络的实例可以包括互联网、企业内部网、局域网、移动通信网及其组合。
输入装置430可用于接收输入的数字或字符信息,以及产生与电子设备的用户设置以及功能控制有关的键信号输入。输出装置440可包括显示屏等显示设备。
本实施例的电子设备还可以包括通信装置450,通过通信网络传输信息。
本领域普通技术人员可理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来执行相关的硬件来完成的,该程序可存储于一个非暂态计算机可读存储介质中,该程序在执行时,可包括如上述方法的实施例的流程,其中,该非暂态计算机可读存储介质可以为磁碟、光盘、只读存储记忆体(ROM)或随机存储记忆体(RAM)等。
工业实用性
本公开提供一种设备端口的检测方法及装置,可以实现利用相关的测试设备检测高速率的设备端口在线速带宽条件下是否运行正常,不需要采购大速率的测试设备,节省了成本,实现资源的再次利用。

Claims (13)

  1. 一种设备端口的检测方法,包括:
    接收测试仪发送的、经第一设备端口转发的携带所述测试仪对应的线速带宽的虚拟局域网vlan测试报文,其中,所述测试仪对应的线速带宽小于待测设备端口的线速带宽;
    将所述vlan测试报文在待测设备端口上预先配置的第一预设数量个虚拟端口与所述第一设备端口之间进行传递;以及
    将经过第一预设数量次的传递之后接收到的所述vlan测试报文发送至所述测试仪,使所述测试仪检测所述vlan测试报文的丢包率,并根据所述vlan测试报文的丢包率确定待测设备端口在线速带宽条件下是否运行正常。
  2. 根据权利要求1所述的方法,根据所述vlan测试报文的丢包率确定待测设备端口在线速带宽条件下是否运行正常,包括:在所述vlan测试报文的丢包率为零时,确定待测设备端口在线速带宽条件下运行正常;以及
    在所述vlan测试报文的丢包率不为零时,接收交换芯片发送的请求命令,并根据所述请求命令向所述交换芯片反馈待测设备端口对应的寄存器中的数据,使得所述交换芯片在判断出待测设备端口对应的寄存器中的数据处于正常范围时,确定待测设备端口在线速带宽条件下运行正常。
  3. 根据权利要求1所述的方法,所述接收测试仪发送的、经第一设备端口转发的携带所述测试仪对应的线速带宽的虚拟局域网vlan测试报文,包括:
    在所述测试仪发出的所述vlan测试报文依次经过所述测试仪与参考端口之间连接的第一线缆、所述参考端口与所述第一设备端口之间的vlan连接及所述第一设备端口与待测设备端口之间连接的第二线缆传输后,接收并获得所述测试仪发送的所述vlan测试报文。
  4. 根据权利要求1所述的方法,当所述测试仪的端口种类为一种且待测设备端口的线速带宽是所述测试仪对应的线速带宽的整数倍时,所述第一预设数量为待测设备端口的线速带宽与所述测试仪对应的线速带宽的比值。
  5. 根据权利要求1所述的方法,其中,
    当所述测试仪的端口种类包括第一端口和线速带宽小于所述第一端口的线速带宽的第二端口、且待测设备端口的线速带宽是所述第一端口的线速带宽的非整数倍时,所述将所述vlan测试报文在待测设备端口上预先配置的第一预设数量个虚拟端口与所述第一设备端口之间进行传递包括:
    获取待测设备端口的线速带宽与所述第一端口的线速带宽的比值在取整操作后的第一参考值;
    接收所述测试仪发送的所述vlan测试报文,将所述vlan测试报文在预先配置的第一参考值个虚拟端口与所述第一设备端口之间进行传递;
    获取待测设备端口的线速带宽与所述第一参考值和所述第一端口的第一线速带宽的乘积之差的第一差值;
    获取所述第一差值与所述第二端口的线速带宽的比值的第二参考值,其中所述第二参考值为整数,所述第一参考值与所述第二参考值的和为所述第一预设数量;以及
    接收所述测试仪发送的所述vlan测试报文,将所述vlan测试报文在预先配置的第二参考值个虚拟端口与所述第一设备端口之间进行传递。
  6. 一种设备端口的检测方法,包括:
    经第一设备端口、向待测设备端口发送携带测试仪对应的线速带宽的虚拟局域网vlan测试报文,使得所述vlan测试报文在待测设备端口上预先配置的第一预设数量个虚拟端口与所述第一设备端口之间进行传递;
    接收待测设备端口发送的经过所述第一预设数量次的传递之后得到的所述vlan测试报文,并检测所述vlan测试报文的丢包率;以及
    根据所述vlan测试报文的丢包率,确定待测设备端口在线速带宽条件下是否运行正常。
  7. 一种设备端口的检测装置,包括:
    接收模块,设置为:接收测试仪发送的、经第一设备端口转发的携带所述测试仪对应的线速带宽的虚拟局域网vlan测试报文,其中,所述测试仪对应的线速带宽小于待测设备端口的线速带宽;
    传递模块,设置为:将所述vlan测试报文在待测设备端口上预先配置的第一预设数量个虚拟端口与所述第一设备端口之间进行传递;以及
    处理模块,设置为:将经过第一预设数量次的传递之后接收到的所述vlan测试报文发送至所述测试仪,使所述测试仪检测所述vlan测试报文的丢包率,并根据所述vlan测试报文的丢包率确定待测设备端口在线速带宽条件下是否运行正常。
  8. 根据权利要求7所述的装置,所述处理模块是设置为:在所述vlan测 试报文的丢包率为零时,确定待测设备端口在线速带宽条件下运行正常,在所述vlan测试报文的丢包率不为零时,接收交换芯片发送的请求命令,并根据所述请求命令向所述交换芯片反馈待测设备端口对应的寄存器中的数据,使得所述交换芯片在判断出待测设备端口对应的寄存器中的数据处于正常范围时,确定待测设备端口在线速带宽条件下运行正常。
  9. 根据权利要求7所述的装置,所述接收模块是设置为:
    在所述测试仪发出的所述vlan测试报文依次经过所述测试仪与参考端口之间连接的第一线缆、所述参考端口与所述第一设备端口之间的vlan连接及所述第一设备端口与待测设备端口之间连接的第二线缆传输后,接收并获得所述测试仪发送的所述vlan测试报文。
  10. 根据权利要求7所述的装置,当所述测试仪的端口种类为一种且待测设备端口的线速带宽是所述测试仪对应的线速带宽的整数倍时,所述第一预设数量为待测设备端口的线速带宽与所述测试仪对应的线速带宽的比值。
  11. 根据权利要求7所述的装置,当所述测试仪的端口种类包括第一端口和线速带宽小于所述第一端口的线速带宽的第二端口、且待测设备端口的线速带宽是所述第一端口的线速带宽的非整数倍时,所述传递模块包括:
    第一子模块,设置为:获取待测设备端口的线速带宽与所述第一端口的线速带宽的比值在取整操作后的第一参考值;
    第二子模块,设置为:接收所述测试仪发送的所述vlan测试报文,将所述vlan测试报文在预先配置的第一参考值个虚拟端口与所述第一设备端口之间进行传递;
    第三子模块,设置为:获取待测设备端口的线速带宽与所述第一参考值、所述第一端口的第一线速带宽的乘积之差的第一差值;
    第四子模块,设置为:获取所述第一差值与所述第二端口的线速带宽的比值的第二参考值,其中所述第二参考值为整数,所述第一参考值与所述第二参考值的和等于所述第一预设数量;以及
    第五子模块,设置为:接收所述测试仪发送的所述vlan测试报文,将所述vlan测试报文在预先配置的第二参考值个虚拟端口与所述第一设备端口之间进行传递。
  12. 一种设备端口的检测装置,包括:
    发送模块,设置为:经第一设备端口、向待测设备端口发送携带测试仪对应的线速带宽的虚拟局域网vlan测试报文,使得所述vlan测试报文在待测设备端口上预先配置的第一预设数量个虚拟端口与所述第一设备端口之间进行传递;
    接收检测模块,设置为:接收待测设备端口发送的经过所述第一预设数量次的传递之后接收到的所述vlan测试报文,并检测所述vlan测试报文的丢包率;以及
    确定模块,设置为:根据所述vlan测试报文的丢包率,确定待测设备端口在线速带宽条件下是否运行正常。
  13. 一种计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令用于执行权利要求1-5和权利要求6中任一项的方法。
PCT/CN2017/086777 2016-06-21 2017-06-01 设备端口的检测方法及装置 WO2017219840A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610451983.XA CN107528744A (zh) 2016-06-21 2016-06-21 一种设备端口的检测方法及装置
CN201610451983.X 2016-06-21

Publications (1)

Publication Number Publication Date
WO2017219840A1 true WO2017219840A1 (zh) 2017-12-28

Family

ID=60735081

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/086777 WO2017219840A1 (zh) 2016-06-21 2017-06-01 设备端口的检测方法及装置

Country Status (2)

Country Link
CN (1) CN107528744A (zh)
WO (1) WO2017219840A1 (zh)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111092782A (zh) * 2018-10-24 2020-05-01 迈普通信技术股份有限公司 被测通信设备、通信设备端口数据转发测试系统及方法
CN113114523A (zh) * 2021-03-04 2021-07-13 山东英信计算机技术有限公司 一种机架式网络交换机测试方法及系统
CN113872827A (zh) * 2021-09-10 2021-12-31 苏州浪潮智能科技有限公司 一种交换机蛇形测试失败的分析方法、装置及存储介质
CN114448856A (zh) * 2022-01-25 2022-05-06 南昌华勤电子科技有限公司 交换机流量转发性能验证方法及交换机
CN115426328A (zh) * 2022-07-29 2022-12-02 云尖信息技术有限公司 分流交换机和交换机的测试装置、系统及方法

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110460485B (zh) * 2018-05-07 2021-05-07 大唐移动通信设备有限公司 测试以太网接口性能的装置及方法
CN113507398B (zh) * 2021-07-08 2023-07-11 安天科技集团股份有限公司 网络拓扑状态检测方法、装置、计算设备及存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1996817A (zh) * 2006-12-13 2007-07-11 华为技术有限公司 一种通信产品高速通道测试的方法及装置
CN101146046A (zh) * 2007-11-05 2008-03-19 福建星网锐捷网络有限公司 一种吞吐量测试方法和测试系统
WO2012038684A1 (en) * 2010-09-22 2012-03-29 British Telecommunications Public Limited Company Testing of telecommunications equipment
CN103107924A (zh) * 2013-03-06 2013-05-15 深圳市新格林耐特通信技术有限公司 利用低速率端口测试高速率端口的网络设备性能测试方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1996817A (zh) * 2006-12-13 2007-07-11 华为技术有限公司 一种通信产品高速通道测试的方法及装置
CN101146046A (zh) * 2007-11-05 2008-03-19 福建星网锐捷网络有限公司 一种吞吐量测试方法和测试系统
WO2012038684A1 (en) * 2010-09-22 2012-03-29 British Telecommunications Public Limited Company Testing of telecommunications equipment
CN103107924A (zh) * 2013-03-06 2013-05-15 深圳市新格林耐特通信技术有限公司 利用低速率端口测试高速率端口的网络设备性能测试方法

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111092782A (zh) * 2018-10-24 2020-05-01 迈普通信技术股份有限公司 被测通信设备、通信设备端口数据转发测试系统及方法
CN111092782B (zh) * 2018-10-24 2022-04-05 迈普通信技术股份有限公司 被测通信设备、通信设备端口数据转发测试系统及方法
CN113114523A (zh) * 2021-03-04 2021-07-13 山东英信计算机技术有限公司 一种机架式网络交换机测试方法及系统
CN113114523B (zh) * 2021-03-04 2022-07-12 山东英信计算机技术有限公司 一种机架式网络交换机测试方法及系统
CN113872827A (zh) * 2021-09-10 2021-12-31 苏州浪潮智能科技有限公司 一种交换机蛇形测试失败的分析方法、装置及存储介质
CN114448856A (zh) * 2022-01-25 2022-05-06 南昌华勤电子科技有限公司 交换机流量转发性能验证方法及交换机
CN114448856B (zh) * 2022-01-25 2023-05-16 南昌华勤电子科技有限公司 交换机流量转发性能验证方法及交换机
CN115426328A (zh) * 2022-07-29 2022-12-02 云尖信息技术有限公司 分流交换机和交换机的测试装置、系统及方法
CN115426328B (zh) * 2022-07-29 2023-08-22 云尖信息技术有限公司 分流交换机和交换机的测试装置、系统及方法

Also Published As

Publication number Publication date
CN107528744A (zh) 2017-12-29

Similar Documents

Publication Publication Date Title
WO2017219840A1 (zh) 设备端口的检测方法及装置
US9762429B2 (en) Control protocol encapsulation
US8693343B2 (en) Relay apparatus, virtual machine system, and relay method
US9455916B2 (en) Method and system for changing path and controller thereof
CN109474495B (zh) 一种隧道检测方法及装置
US9014248B2 (en) BASE-T common mode testing in an Ethernet subsystem
CN105991358A (zh) 一种测试接口板流量的方法、装置、测试板及系统
CN107948063B (zh) 一种建立聚合链路的方法和接入设备
US11277299B2 (en) Method and device for anomaly detection in a vehicle
WO2016086890A1 (zh) 一种检测连通性的方法和装置
US10819615B2 (en) Network bridging device, bus test method and system thereof
US20200044964A1 (en) Defect detection in ip/mpls network tunnels
WO2016124117A1 (zh) 一种sdn中的链路保护方法、交换设备及网络控制器
CN108092922A (zh) 一种接口板传输报文的方法和装置
CN107547341B (zh) 虚拟扩展局域网vxlan的接入方法及装置
KR20120091359A (ko) 복수의 컴퓨팅 디바이스들로의 일대다 데이터 송신을 용이하게 하기 위한 방법 및 시스템
US9209928B2 (en) Transmission device and transmission method
CN109474588A (zh) 一种终端认证方法及装置
WO2019007139A1 (zh) 一种实现故障检测的方法、设备和系统
CN113806273B (zh) 快速周边组件互连数据传输控制系统
CN109067666B (zh) 一种报文传输的方法及装置
CN109327375A (zh) 用于建立vxlan隧道的方法、装置和系统
CN110971716B (zh) 地址配置方法、装置、系统和计算机可读存储介质
CN105337869B (zh) 一种rscn通知方法、系统及相关装置
JP2015139077A (ja) 通信装置、ネットワークシステム、及び、通信方法

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

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

Country of ref document: EP

Kind code of ref document: A1