Method, apparatus and system for detecting internal links of switch ports
By detecting individual service ports of a switch and performing group mutual testing, the problems of inaccurate and inefficient internal link detection of switch ports in existing technologies are solved, and efficient internal link detection of ports is achieved.
Patent Information
- Application Number
- CN202411396286.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-08
- Publication Date
- 2026-01-27
- Estimated Expiration
- 2044-10-08
AI Technical Summary
Existing technologies cannot accurately detect internal links within switch ports, resulting in a cumbersome and inefficient detection process.
The first test result is obtained by performing a test on a single service port of the switch. Then, all service ports are grouped, and the service ports within each group are tested against each other. The internal link configuration of all service ports is determined by combining the first and second test results.
It enables accurate detection of internal links of all service ports, simplifies the detection process, and improves detection efficiency.
Smart Images

Figure CN119363620B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of switch testing, and in particular to a method, apparatus and system for detecting internal links in a switch port. Background Technology
[0002] With the rapid development of data center business and the rise of AI technology, the amount of data transmitted over the network is increasing, and the bandwidth of a single chip in the switching chip of the network switch is also increasing. This leads to a higher density of high-speed links and a more diversified configuration of switching chips in the switch. Therefore, the requirements for the correct configuration of high-speed links in network data transmission are also increasing.
[0003] In existing technologies, methods for detecting the correct configuration of high-speed links mainly include loopback detection methods and test equipment-based detection methods. Loopback detection methods use a loopback detection module to short-circuit the internal link of the port under test, and determine the correct configuration of the internal link by checking if the input and output data of the port under test are consistent. Test equipment-based detection methods require using a DAC cable or optical module to connect the test equipment and the port under test, and determine the correct configuration of the internal link of the port under test by checking if the input and output data between the port under test and the test equipment are consistent.
[0004] However, existing detection methods cannot obtain accurate detection results of the internal links of the port. Detection methods based on test equipment require multiple connection and plug-in tests, which are cumbersome and have low detection efficiency. Summary of the Invention
[0005] This application provides a method, apparatus, and system for detecting internal links in switch ports, which enables the detection of all ports to be completed with only one single-port detection and one group mutual test. This simplifies the detection process of internal links in switch ports and improves the detection efficiency of internal links in switch ports while ensuring the detection accuracy of internal links.
[0006] In a first aspect, embodiments of this application provide a method for detecting internal links of a switch port. According to a received detection instruction, a reference port is determined from multiple service ports of the switch, and the internal links of the reference port are detected for the first time to obtain a first detection result; wherein, the switch includes multiple service ports.
[0007] The multiple service ports are grouped to obtain multiple non-overlapping grouping results, wherein each grouping result includes two service ports; each service port is assigned to two of the grouping results.
[0008] Link mutual testing is performed using two service ports of each of the group results to obtain a second detection result, wherein the second detection result includes the link mutual testing results corresponding to each of the multiple group results;
[0009] Based on the first detection result and the second detection result, the detection results of the internal links of the multiple service ports are determined.
[0010] In one possible implementation, the first detection of the internal link of the reference port and the determination of the first detection result include:
[0011] According to the preset splitting rules, the reference port is split into multiple sub-ports, wherein each sub-port is interconnected with the test device to form a first data link;
[0012] For each sub-port, acquire the first transmit / receive data between the sub-port and the test device generated through the first data link;
[0013] The first detection result is determined based on the first transmit and receive data corresponding to each sub-port.
[0014] In one possible implementation, the step of performing link mutual testing on the two service ports using each of the grouping results to obtain a second detection result includes:
[0015] For each grouping result, according to the preset splitting rules, the first service port in the grouping result is split into multiple first service sub-ports, and the second service port in the grouping result is split into multiple second service sub-ports; wherein, each first service sub-port corresponds to one second service sub-port;
[0016] Establish a second data link between each of the first service sub-ports and its corresponding second service sub-port;
[0017] For each of the first service sub-ports, obtain the second transmit / receive data between the first service sub-port and the corresponding second service sub-port generated through the second data link;
[0018] Based on the second transmit / receive data corresponding to each of the first service sub-ports, determine the link mutual test result corresponding to the group result.
[0019] In one possible implementation, for each of the first service sub-ports, acquiring the second transmit / receive data between the first service sub-port and the corresponding second service sub-port generated via the second data link includes:
[0020] For each first service sub-port, an instruction is sent to the first service sub-port so that the first service sub-port sends a first data packet to the corresponding second service sub-port through the second data link, and the second data packet received by the corresponding second service sub-port is obtained.
[0021] Send an instruction to the corresponding second service sub-port so that the corresponding second service sub-port can send a third data packet to the first service sub-port through the second data link; obtain the fourth data packet received by the first service sub-port;
[0022] The step of determining the link mutual test result corresponding to the group result based on the second transmit / receive data corresponding to each of the first service sub-ports includes:
[0023] The link mutual test result is determined based on the first data packet, the second data packet, the third data packet, and the fourth data packet.
[0024] In one possible implementation, determining the link mutual test result based on the first data packet, the second data packet, the third data packet, and the fourth data packet includes:
[0025] If the first data packet and the second data packet are identical, and the third data packet and the fourth data packet are identical, then there is no abnormality between the internal link of the second service sub-port and the internal link of the first service sub-port.
[0026] If the first data packet and the second data packet are inconsistent, or the third data packet and the fourth data packet are inconsistent, then the internal link of the first service sub-port or the internal link of the second service sub-port is abnormal.
[0027] In one possible implementation, determining the detection results of the internal links of the plurality of service ports based on the first detection result and the second detection result includes:
[0028] If the first detection result indicates that there is no abnormality in the internal link of the reference port, and the second detection result indicates that there is no abnormality in the mutual test result of the internal link of the multiple group results, it is determined that there is no abnormality in the internal link of the multiple service ports;
[0029] Otherwise, the internal links of the multiple service ports will be abnormal.
[0030] In one possible implementation, if an internal link anomaly is detected in the plurality of service ports, a first anomaly alert message is issued.
[0031] In one possible implementation, the service port includes one of the following: a port consisting of a single channel, a port consisting of two channels, a port consisting of four channels, or a port consisting of eight channels.
[0032] Secondly, embodiments of this application provide a device for detecting internal links within a switch port, comprising:
[0033] The first detection unit is used to determine a reference port from multiple service ports of the switch according to the received detection command, perform a first detection on the internal link of the reference port, and obtain a first detection result; wherein, the switch includes multiple service ports;
[0034] A grouping unit is used to group the plurality of service ports to obtain multiple non-overlapping grouping results, wherein each grouping result includes two service ports; each service port is assigned to two of the grouping results;
[0035] The second detection unit is used to perform link mutual testing on two service ports using each of the group results to obtain a second detection result, wherein the second detection result includes the link mutual testing results corresponding to each of the multiple group results;
[0036] The determining unit is used to determine the detection result of the internal link of the plurality of service ports based on the first detection result and the second detection result.
[0037] Thirdly, embodiments of this application provide a detection system for internal links within a switch port, comprising: a control unit, a switch, and at least one testing device.
[0038] The switch includes multiple service ports, one of which is a reference port; the test device establishes a first data link with the reference port, and the test device is used to detect the internal links of the reference port to obtain a first detection result; wherein, the detection of the internal links of the multiple service ports of the switch is achieved by the following steps:
[0039] The first service port is grouped to obtain multiple non-overlapping grouping results. Each grouping result includes two service ports, and each service port is assigned to two grouping results. The control unit controls the link mutual testing of the two service ports in each grouping result to obtain a second detection result. Based on the first detection result and the second detection result, the link detection result of the multiple service ports is determined.
[0040] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the aforementioned detection method.
[0041] This application provides a method, apparatus, and system for detecting internal links in switch ports. First, the internal links of a single service port are detected once to obtain a first detection result. Then, all service ports are grouped, and the service ports within each group perform mutual testing to obtain a second detection result. Finally, the detection results of the internal links of all service ports are determined based on the first and second detection results. This achieves the effect of detecting the internal links of all service ports separately by performing only one single-port detection and one group mutual testing. The above scheme simplifies the detection process of internal links in switch ports and improves the detection efficiency. Attached Figure Description
[0042] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0043] Figure 1 A schematic diagram illustrating the correct configuration of the internal links of the ports provided in this application;
[0044] Figure 2 This application provides a schematic diagram of the structure of internal link cross-connection mismatch within the port.
[0045] Figure 3 A flowchart illustrating the switch port internal link detection method provided in this application;
[0046] Figure 4 A schematic diagram of the connection structure between the split service port 1 and the split service port 2 provided for this application;
[0047] Figure 5 A schematic diagram of the switch port internal link detection device provided in this application.
[0048] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0049] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of methods and systems consistent with some aspects of this application as detailed in the appended claims.
[0050] First, let me explain the terms used in this application:
[0051] SerDes: refers to Serializer / Deserializer, a circuit used to convert parallel data into serial data and serial data into parallel data.
[0052] DAC: Direct Attach Copper, is a cable solution for short-distance, high-speed data transmission.
[0053] In network communication, switches achieve efficient data transmission by forwarding data packets between network devices. Internally, switches connect to different ports via internal links, and these ports exchange data with external devices, thus enabling data forwarding. Each port of a switch typically contains one or more SerDes, and each SerDes includes multiple channels (lanes). Each channel is an independent serial data path that can transmit data independently, while multiple channels can transmit data in parallel.
[0054] Based on the switch chip hardware design, the channel mapping (laneswap) and polarity flip of each SerDes can be configured in the software. Correct channel mapping ensures no cross-connection errors within the port's internal links and the correct order of multiple parallel channels, guaranteeing accurate data transmission from the sender to the receiver. Each internal link includes a pair of transmit and receive lines: the transmit line Tx (Transmit) for sending data and the receive line Rx (Receive) for receiving data. Correct polarity flip configuration ensures the link functions correctly as either a sender or receiver. For any given internal link, data can only be correctly forwarded when both channel mapping and polarity flip are configured correctly.
[0055] With the rapid development of data center services and the rise of artificial intelligence technology, the amount of data transmitted over networks is increasing, and the bandwidth of a single chip in a network switch is also increasing. This leads to a higher density of high-speed links and more diverse configurations of switch chips. Only by correctly configuring the internal links of the switch to the ports can the correct transmission of network data be guaranteed. Therefore, it is necessary to detect the internal links of the ports.
[0056] Taking a port consisting of 4 channels as an example, such as Figure 1 This is a schematic diagram illustrating the correct configuration of internal links within a port provided in this application. Internal link 101 of port 100 is configured to channel 111, internal link 102 to channel 112, internal link 103 to channel 113, and internal link 104 to channel 114. For example... Figure 2 The diagram below illustrates the cross-connection mismatch structure of the internal links provided in this application. Internal link 101 of port 100 is configured to channel 111, internal link 102 is configured to channel 114, internal link 103 is configured to channel 113, and internal link 104 is configured to channel 112. The cross-connection mismatch between internal links 102 and internal link 104 will result in data transmission errors.
[0057] Generally, there are two methods to test the internal links of a port. One method uses a loopback detection module to short-circuit the internal links of the port under test. By analyzing whether the data sent and received by the port under test is consistent, the correctness of the internal link configuration can be determined. The other method is based on testing equipment. A DAC cable or optical module is used to connect the testing equipment and the port under test. Each test determines whether the data sent and received between the port under test and the testing equipment is consistent, thus determining whether the internal link configuration of the port under test is correct. Existing technologies require a test process for each port tested. Furthermore, when testing a port consisting of four channels, data is evenly distributed across the four channels at the data transmitting end. Which channel the data is sent from the transmitting end to the receiving end does not affect the receiving end's reception of data. Cross-link mismatch within the port does not affect the data received by the data receiving end, resulting in existing testing methods failing to obtain accurate results for the internal links of the port.
[0058] The method provided in this application obtains a first detection result by performing a single-port internal link test; then, all service ports are grouped, and the service ports within each group perform mutual tests to obtain a second detection result; finally, the first and second detection results are used to determine whether the internal link configuration of all service ports is correct. This achieves the effect of detecting the internal links of all ports with only one single-port test and one group mutual test. This solves the problem of cumbersome detection process and low detection efficiency in existing technologies for detecting switch ports.
[0059] The technical solution of this application and how it solves the above-mentioned technical problems will be described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will be described below with reference to the accompanying drawings.
[0060] Figure 3 A flowchart illustrating the switch port internal link detection method provided in this application is shown below. Figure 3 As shown, the method includes the following steps:
[0061] S301: Based on the received detection command, determine the reference port from the multiple service ports of the switch, perform the first detection on the internal link of the reference port, and obtain the first detection result; wherein, the switch includes multiple service ports.
[0062] The execution subject of the above-mentioned switch port internal link detection method can be an electronic device, such as a computer or other device that can perform switch port testing.
[0063] The switch under test exchanges data with external devices through multiple service ports. The reference port is one of the aforementioned service ports. The channel mapping and polarity reversal configurations of the test device ports are correct.
[0064] The internal link of the reference port is tested using the test equipment to obtain the first test result. This first test result is used to determine whether the reference port and the test equipment can accurately send and receive data, thus confirming whether their internal link configurations match. If both the channel mapping configuration and polarity reversal configuration of the internal links of the reference port and the test equipment match, then their internal link configurations are considered to be compatible.
[0065] S302: Group multiple service ports to obtain multiple non-overlapping group results, where each group result includes two service ports; each service port is assigned to two group results.
[0066] In this step, all service ports of the switch under test are grouped, resulting in multiple grouping results. Each grouping result includes two service ports, and the multiple grouping results are non-overlapping. Simultaneously, each service port is assigned to two grouping results, ensuring that for any service port in any grouping result, another grouping result containing that service port can be found. Two grouping results containing the same port are cross-linked through a shared service port, thus allowing all grouping results to be cross-linked.
[0067] S303: Use the two service ports of each group result to perform link mutual testing to obtain the second detection result, wherein the second detection result includes the link mutual testing results corresponding to each of the multiple group results.
[0068] In this step, for all the packet results obtained in step S302, the two service ports within each packet result perform mutual testing to obtain a mutual test result. The mutual test result indicates whether the two service ports can accurately send and receive data, thereby determining whether the internal link configurations of the two service ports match.
[0069] S304: Based on the first and second detection results, determine the detection results of the internal links of multiple service ports.
[0070] In this step, the first detection result determines whether the internal link configuration of the reference port is correct. The second detection result includes a link interoperability test result from a first group result, which is the link interoperability test result between the reference port and a service port X. This link interoperability test result determines whether the internal link configurations of the reference port and service port X match. It also includes a link interoperability test result from a second group result, which is the link interoperability test result between the aforementioned service port X and another service port Y. This link interoperability test result determines whether the internal link configurations of service port X and service port Y match. Similarly, it determines whether the internal link configurations of service port Y and another service port Z match, and so on, until it is determined whether the internal link configurations of the two service ports in all group results match. Since the reference port has been detected by the detection device, the detection result of the internal link of the reference port can be used as a reference detection result. Furthermore, since multiple group results are interconnected, the detection results of all other service ports can be determined from the detection results of the reference port.
[0071] The method for detecting internal links of switch ports provided in this application involves selecting a reference port, performing a single detection on the internal links of the reference port to obtain a first detection result, then grouping all service ports, and performing mutual testing on the service ports within each group to obtain multiple second detection results, and finally determining whether the internal link configuration of all service ports is correct based on the first and second detection results. This achieves the effect of detecting the internal links of all service ports by performing only one single-port detection and one group mutual testing.
[0072] The method for detecting internal links in a switch port provided in this application is applicable to switches with various common ports. A switch port can be a port consisting of 1 channel, a port consisting of 2 channels, a port consisting of 4 channels, or a port consisting of 8 channels.
[0073] The following example, using a switch under test with a port consisting of four channels, further illustrates the implementation of the switch port internal link detection method of this application.
[0074] The maximum bandwidth of the switch under test is 51.2TB / s. The chip used in the system has 64 SerDes, each SerDes includes 8 channels, extending to a total of 512 channels. Every 4 channels form a service port, for a total of 128 service ports.
[0075] Before conducting the first and second tests, the data transmission rate of all service port channels can be reduced. Since the correctness of the internal link configuration of the switch port under test is irrelevant to the data transmission rate of the switch port channels, to save bandwidth and for testing convenience, the data transmission rate of all service port channels can be reduced so that the data transmission rate of a single service port channel is the same as the data transmission rate supported by the test equipment. Specifically, the data transmission rate of the service port channels can be reduced to 100G or 200G.
[0076] In one specific implementation, the internal link of the reference port is first detected, and the first detection result is determined, including:
[0077] First, the reference port is split according to the preset splitting rules to obtain multiple sub-ports. Each sub-port is interconnected with the test device to form the first data link.
[0078] Secondly, for each sub-port, acquire the first transmit and receive data between the sub-port and the test device generated through the first data link;
[0079] Finally, the first detection result is determined based on the first transmitted and received data corresponding to each sub-port.
[0080] The selected reference port is service port 1. The preset splitting rule is to split the service port based on a single channel, meaning that each split service sub-port contains one channel. Service port 1 is split into 4 service sub-ports, each corresponding to an internal link. Optical modules or DAC cables are used to connect the reference port to the port of the test equipment. Each service sub-port is interconnected with its corresponding port on the test equipment to form a first data link.
[0081] The first data transmission and reception between the service sub-port and the corresponding port of the test device can be generated through the first data link. That is, the aforementioned executing entity sends an instruction to the service sub-port to send a first reference data packet through the first data link, obtaining a second reference data packet received by the corresponding port of the test device; and sends an instruction to the corresponding port of the test device to send a third reference data packet through the first data link, obtaining a fourth reference data packet received by the service sub-port. The first, second, third, and fourth reference data packets constitute the first data transmission and reception.
[0082] The first test result is as follows:
[0083] If the first reference data packet matches the second reference data packet and the third reference data packet matches the fourth reference data packet, the first detection result indicates that data can be accurately transmitted between the service sub-port and the corresponding port of the test equipment, indicating that the channel mapping configuration and polarity reversal configuration of the internal link between the service sub-port and the corresponding port of the test equipment match. Since the internal link configuration of the test equipment port is correct, it is determined that the internal link configuration of the service sub-port is also correct.
[0084] If the first reference data packet is inconsistent with the second reference data packet, or the third reference data packet is inconsistent with the fourth reference data packet, the first detection result indicates that the service sub-port and the corresponding port of the test device cannot transmit data correctly. If the second or fourth reference data packet cannot be obtained, it indicates that the polarity reversal configuration of the internal link of the service sub-port is abnormal, causing it to malfunction as a sender or receiver. If the second and fourth reference data packets are obtained, but the first reference data packet is inconsistent with the second reference data packet, or the third reference data packet is inconsistent with the fourth reference data packet, it indicates that the channel mapping configuration of the internal link of the service sub-port is abnormal, causing it to cross-match with the internal links of other service sub-ports.
[0085] In some implementations of this embodiment, the above-mentioned link mutual testing using the two service ports of each group result to obtain the second detection result includes the following sub-steps:
[0086] First, for each grouping result, according to the preset splitting rules, the first service port in the grouping result is split into multiple first service sub-ports, and the second service port in the grouping result is split into multiple second service sub-ports; wherein, each first service sub-port corresponds to one second service sub-port.
[0087] The example will still be a switch with 128 service ports, each with 4 channels.
[0088] The aforementioned execution entity can group the 128 service ports, grouping service port 1 and service port 2 into one group, service port 3 and service port 4 into another group, and so on, until service port 127 and service port 128 are grouped together; at the same time, service port 128 and service port 1 are grouped together, service port 2 and service port 3 are grouped together, and so on, until service port 126 and service port 127 are grouped together, thus completing the grouping.
[0089] For each grouping result, based on the preset splitting rules of a single channel, the first service port in the grouping result is split into 4 first service sub-ports; the second service port in the grouping result is split into 4 second service sub-ports; each first service sub-port corresponds to one second service sub-port. For example, for the grouping result composed of service port 1 and service port 2, service port 1 is split into first service sub-port 11, first service sub-port 12, first service sub-port 13 and first service sub-port 14; service port 2 is split into second service sub-port 21, second service sub-port 22, second service sub-port 23 and second service sub-port 24; first service sub-port 11 corresponds to second service sub-port 21, first service sub-port 12 corresponds to second service sub-port 22, first service sub-port 13 corresponds to second service sub-port 23, and first service sub-port 14 corresponds to second service sub-port 24.
[0090] Secondly, a second data link is established between each first service sub-port and its corresponding second service sub-port. This second data link is established via a DAC cable. Using service port 1 and service port 2 as an example again... Figure 4 A schematic diagram illustrating the connection structure between the split service port 1 and the split service port 2 provided in this application. Figure 4 As shown, the first service sub-port 11 and the second service sub-port 21 are connected to form a second data link, the first service sub-port 12 and the second service sub-port 22 are connected to form a second data link, the first service sub-port 13 and the second service sub-port 23 are connected to form a second data link, and the first service sub-port 14 and the second service sub-port 24 are connected to form a second data link.
[0091] Then, for each first service sub-port, the second transmit / receive data between the first service sub-port and the corresponding second service sub-port generated through the second data link is obtained.
[0092] Finally, based on the second transmit and receive data corresponding to each of the first service sub-ports, the link mutual test result corresponding to the group result is determined.
[0093] In some implementations of this embodiment, the above-mentioned acquisition of the second transmit / receive data between the first service sub-port and the corresponding second service sub-port generated through the second data link for each first service sub-port includes the following sub-steps:
[0094] First, for each first service sub-port, an instruction is sent to that first service sub-port to send a first data packet to the corresponding second service sub-port via the second data link, and the second data packet received by the corresponding second service sub-port is obtained.
[0095] For any first service sub-port, the aforementioned execution entity may send an instruction to the first service sub-port so that the first service sub-port may send a first data packet through the second data link; the aforementioned execution entity may receive the second data packet received by the corresponding second service sub-port.
[0096] Secondly, an instruction is sent to the corresponding second service sub-port to send a third data packet to the first service sub-port via the second data link; and the fourth data packet received by the first service sub-port is obtained.
[0097] The aforementioned execution entity can send instructions to the corresponding second service sub-port so that the corresponding second service sub-port can send a third data packet through the second data link; the aforementioned execution entity can receive the fourth data packet received by the first service sub-port.
[0098] In some implementations of this embodiment, determining the link mutual test result corresponding to the group result based on the second transmit and receive data corresponding to each first service sub-port includes: determining the link mutual test result based on the first data packet, the second data packet, the third data packet, and the fourth data packet.
[0099] In some implementations of this embodiment, determining the link mutual test result based on the first data packet, the second data packet, the third data packet, and the fourth data packet includes:
[0100] If the first data packet is identical to the second data packet and the third data packet is identical to the fourth data packet, then there is no abnormality between the internal link of the second service sub-port and the internal link of the first service sub-port; this mutual test result indicates that the first service sub-port and the corresponding second service sub-port can accurately transmit data, indicating that the configuration of the internal link of the first service sub-port and the corresponding second service sub-port matches.
[0101] If the first data packet is inconsistent with the second data packet, or the third data packet is inconsistent with the fourth data packet, then the internal link of the first service sub-port or the internal link of the second service sub-port is abnormal. This mutual test result indicates that the first service sub-port and the corresponding second service sub-port cannot transmit data correctly. If the second or fourth data packet cannot be obtained, it means that the polarity inversion configuration of the internal link of the first service sub-port and the corresponding second service sub-port is mismatched, resulting in data transmission failure. If the second and fourth data packets are obtained, but the first data packet is inconsistent with the second packet, or the third data packet is inconsistent with the fourth data packet, it means that the channel mapping configuration of the internal link of the first service sub-port and the corresponding second service sub-port is mismatched, resulting in cross-matching of the internal link of the first service sub-port or the corresponding second service sub-port with other service sub-ports.
[0102] In some implementations of this embodiment, determining the link detection results of multiple service ports based on the first detection result and the second detection result includes:
[0103] If the first detection result indicates that there is no abnormality in the internal link of the reference port, and the second detection result indicates that there is no abnormality in the mutual test results of the internal links of multiple group results, it is determined that there is no abnormality in the internal links of multiple service ports.
[0104] If the first test result indicates that there is no abnormality in the internal link of the reference port, it is determined that the internal link configuration of the reference port is correct.
[0105] The second detection result indicates that the internal link mutual test results of multiple group results are normal. That is, for any group result, its mutual test result indicates that the configuration of the internal link between the first service port and the second service port in that group result matches. Specifically, this means that the internal link configuration of any first service sub-port of the first service port of that group result matches the configuration of the second service sub-port of the corresponding second service port. Let's take a group result consisting of service port 1 as the first service port and service port 2 as the second service port as an example for further explanation. When the first data packet sent by the first service sub-port 11 matches the second data packet received by the second service sub-port 21; and the third data packet sent by the second service sub-port 21 matches the fourth data packet received by the first service sub-port 11; when the first data packet sent by the first service sub-port 12 matches the second data packet received by the second service sub-port 22; and the third data packet sent by the second service sub-port 22 matches the fourth data packet received by the first service sub-port 12; when the first data packet sent by the first service sub-port 13 matches the second data packet received by the second service sub-port 23; and the third data packet sent by the second service sub-port 23 matches the fourth data packet received by the first service sub-port 13; when the first data packet sent by the first service sub-port 14 matches the second data packet received by the second service sub-port 24; and the third data packet sent by the second service sub-port 24 matches the fourth data packet received by the first service sub-port 14, it can be determined that the internal link configurations of service port 1 and service port 2 are matched.
[0106] To determine that the internal links of multiple service ports are not abnormal, a grouping result is obtained from service port 1 and service port 2. The second detection result shows that the internal link configurations of service port 1 and service port 2 match. Since service port 1 is the reference port, and the internal link configuration of the reference port is correct, it is determined that the internal link configuration of service port 2 is correct. A grouping result is obtained from service port 2 and service port 3. The second detection result shows that the internal link configurations of service port 2 and service port 3 match. Since the internal link configuration of service port 2 is correct, it is determined that the internal link configuration of service port 3 is correct. And so on, service port 3 determines that the internal link configuration of service port 4 is correct, until service port 127 determines that the internal link configuration of service port 128 is correct, thus determining that the internal link configurations of all service ports are correct.
[0107] Otherwise, the internal links of multiple service ports are abnormal. If the first detection result indicates that the internal link of the reference port is abnormal, or the second detection result indicates that the internal link of multiple service ports is abnormal, a first abnormality prompt message will be issued, prompting the reference port or the service ports within the multiple packet results to be corrected.
[0108] The method for detecting internal links in switch ports provided in this application embodiment achieves accurate detection of internal links in service ports by splitting all service ports based on a preset splitting rule for a single channel; a first detection result is obtained by detecting the internal links of a reference port; then, all service ports are grouped, and the service ports within each group are mutually tested to obtain a second detection result; finally, the correctness of the internal link configuration of all service ports is determined by the first and second detection results; thereby, while accurately detecting the internal links of service ports, the detection process of internal links in switch ports is simplified and the detection efficiency of internal links in switch ports is improved.
[0109] Corresponding to Figure 3 The present application also provides a device for detecting internal links in a switch port, in addition to the method for detecting internal links in a switch port shown in the embodiment. Figure 5 This is a schematic diagram of the switch port internal link detection device provided in this application, as shown below. Figure 5 As shown, the device 50 includes:
[0110] The first detection unit 501 is used to determine a reference port from multiple service ports of the switch according to the received detection command, perform a first detection on the internal link of the reference port, and obtain a first detection result; wherein the switch includes multiple service ports.
[0111] Grouping unit 502 is used to group multiple service ports to obtain multiple non-overlapping grouping results, wherein each grouping result includes two service ports; each service port is assigned to two grouping results.
[0112] The second detection unit 503 is used to perform link mutual testing on two service ports using each group result to obtain a second detection result, wherein the second detection result includes the link mutual testing results corresponding to each of the multiple group results.
[0113] The determining unit is used to determine the detection results of the internal links of multiple service ports based on the first detection result and the second detection result.
[0114] In one specific implementation, the first detection unit 501 is specifically used for:
[0115] According to the preset splitting rules, the reference port is split into multiple sub-ports. Each sub-port is interconnected with the test device to form a first data link. For each sub-port, the first transmit and receive data between the sub-port and the test device generated through the first data link is acquired. Based on the first transmit and receive data corresponding to each sub-port, the first detection result is determined.
[0116] In some implementations of this embodiment, the grouping unit 502 is specifically used for:
[0117] For each grouping result, according to the preset splitting rules, the first service port in the grouping result is split into multiple first service sub-ports, and the second service port in the grouping result is split into multiple second service sub-ports; wherein, each first service sub-port corresponds to one second service sub-port; and a second data link is established between each first service sub-port and its corresponding second service sub-port.
[0118] In some implementations of this embodiment, the second detection unit 503 is specifically used for: for each first service sub-port, acquiring second transmit / receive data between the first service sub-port and the corresponding second service sub-port generated through the second data link; for each first service sub-port, sending an instruction to the first service sub-port to send a first data packet to the corresponding second service sub-port through the second data link, acquiring the second data packet received by the corresponding second service sub-port; sending an instruction to the corresponding second service sub-port to send a third data packet to the first service sub-port through the second data link; and acquiring the fourth data packet received by the first service sub-port.
[0119] In some implementations of this embodiment, the determining unit 504 is specifically used for:
[0120] Based on the second transmit and receive data corresponding to each first service sub-port, determine the link mutual test result corresponding to the group result: determine the link mutual test result based on the first data packet, the second data packet, the third data packet, and the fourth data packet; if the first data packet and the second data packet are consistent, and the third data packet and the fourth data packet are consistent, then there is no abnormality between the internal link of the second service sub-port and the internal link of the first service sub-port; if the first data packet and the second data packet are inconsistent, or the third data packet and the fourth data packet are inconsistent, then there is an abnormality in the internal link of the first service sub-port or the internal link of the second service sub-port.
[0121] Based on the first and second detection results, determine the link detection results of multiple service ports: if the first detection result indicates that there is no abnormality in the internal link of the reference port, and the second detection result indicates that there is no abnormality in the mutual test results of the internal links of multiple groups, it is determined that there is no abnormality in the internal links of multiple service ports; otherwise, the internal links of multiple service ports are abnormal.
[0122] If internal link anomalies are detected in multiple service ports, the first anomaly alert message will be issued.
[0123] This application also provides a system for detecting internal links in a switch port. The system provided in this embodiment includes:
[0124] Control unit, switch, at least one test device,
[0125] The switch includes multiple service ports, one of which is a reference port. A test device establishes a first data link with the reference port. The test device is used to detect the internal links of the reference port and obtain a first detection result. The detection of the internal links of the multiple service ports of the switch is achieved through the following steps:
[0126] The first service port is grouped to obtain multiple non-overlapping group results. Each group result includes two service ports, and each service port is assigned to two group results. The control unit controls the link mutual test of the two service ports of each group result to obtain a second detection result. Based on the first detection result and the second detection result, the link detection result of multiple service ports is determined.
[0127] This application also provides a computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the above-described method.
[0128] Finally, it should be noted that other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein, and is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of the invention is limited only by the appended claims.
Claims
1. A method for detecting internal links in a switch port, characterized in that, include: Based on the received detection command, a reference port is determined from multiple service ports of the switch, and the internal links of the reference port are detected for the first time to obtain a first detection result; wherein, the switch includes multiple service ports; The multiple service ports are grouped to obtain multiple grouping results; each grouping result includes two service ports; each service port is assigned to two different grouping results. Link mutual testing is performed using two service ports of each of the group results to obtain a second detection result, wherein the second detection result includes the link mutual testing results corresponding to each of the multiple group results; Based on the first detection result and the second detection result, the detection results of the internal links of the multiple service ports are determined.
2. The method according to claim 1, characterized in that, The first detection of the internal link of the reference port to obtain the first detection result includes: According to the preset splitting rules, the reference port is split into multiple sub-ports, wherein each sub-port is interconnected with the test device to form a first data link; For each sub-port, acquire the first transmit / receive data between the sub-port and the test device generated through the first data link; The first detection result is determined based on the first transmit and receive data corresponding to each sub-port.
3. The method according to claim 1, characterized in that, The link mutual test is performed using the two service ports of each group result to obtain the second detection result, including: For each grouping result, according to the preset splitting rules, the first service port in the grouping result is split into multiple first service sub-ports, and the second service port in the grouping result is split into multiple second service sub-ports; wherein, each first service sub-port corresponds to one second service sub-port; Establish a second data link between each of the first service sub-ports and its corresponding second service sub-port; For each of the first service sub-ports, obtain the second transmit / receive data between the first service sub-port and the corresponding second service sub-port generated through the second data link; Based on the second transmit / receive data corresponding to each of the first service sub-ports, determine the link mutual test result corresponding to the group result.
4. The method according to claim 3, characterized in that, For each of the first service sub-ports, acquiring the second transmit / receive data between the first service sub-port and the corresponding second service sub-port generated through the second data link includes: For each first service sub-port, an instruction is sent to the first service sub-port so that the first service sub-port sends a first data packet to the corresponding second service sub-port through the second data link, and the second data packet received by the corresponding second service sub-port is obtained. Send an instruction to the corresponding second service sub-port so that the corresponding second service sub-port can send a third data packet to the first service sub-port through the second data link; obtain the fourth data packet received by the first service sub-port; The step of determining the link mutual test result corresponding to the group result based on the second transmit / receive data corresponding to each of the first service sub-ports includes: The link mutual test result is determined based on the first data packet, the second data packet, the third data packet, and the fourth data packet.
5. The method according to claim 4, characterized in that, Determining the link mutual test result based on the first data packet, the second data packet, the third data packet, and the fourth data packet includes: If the first data packet and the second data packet are identical, and the third data packet and the fourth data packet are identical, then there is no abnormality between the internal link of the second service sub-port and the internal link of the first service sub-port. If the first data packet and the second data packet are inconsistent, or the third data packet and the fourth data packet are inconsistent, then the internal link of the first service sub-port or the internal link of the second service sub-port is abnormal.
6. The method according to any one of claims 1-5, characterized in that, The step of determining the detection results of the internal links of the multiple service ports based on the first detection result and the second detection result includes: If the first detection result indicates that there is no abnormality in the internal link of the reference port, and the second detection result indicates that there is no abnormality in the mutual test result of the internal link of the multiple group results, it is determined that there is no abnormality in the internal link of the multiple service ports; Otherwise, the internal links of the multiple service ports will be abnormal.
7. The method according to claim 6, characterized in that, The method further includes: If an internal link anomaly is detected in the multiple service ports, a first anomaly alert message will be issued.
8. The method according to any one of claims 1-7, characterized in that, The service port includes one of the following: a port consisting of a single channel, a port consisting of two channels, a port consisting of four channels, or a port consisting of eight channels.
9. A device for detecting internal links in a switch port, characterized in that, include: The first detection unit is used to determine a reference port from multiple service ports of the switch according to the received detection command, perform a first detection on the internal link of the reference port, and obtain a first detection result; wherein, the switch includes multiple service ports; A grouping unit is used to group the multiple service ports to obtain multiple grouping results; wherein each grouping result includes two service ports; each service port is assigned to two different grouping results; The second detection unit is used to perform link mutual testing using two service ports of each of the group results to obtain a second detection result, wherein the second detection result includes the link mutual testing results corresponding to each of the multiple group results; The determining unit is used to determine the detection result of the internal link of the plurality of service ports based on the first detection result and the second detection result.
10. A detection system for internal links within a switch port, characterized in that, include: Control unit, switch, at least one test device, The switch includes multiple service ports, one of which is a reference port; The test device establishes a first data link with the reference port, and the test device is used to detect the internal link of the reference port to obtain a first detection result; wherein, the detection of the internal link of multiple service ports of the switch is achieved by the following steps: The multiple service ports are grouped to obtain multiple grouping results. Each grouping result includes two service ports, and each service port is assigned to two different grouping results. The control unit controls the link mutual test of the two service ports of each grouping result to obtain a second detection result. Based on the first detection result and the second detection result, the detection result of the internal link of the multiple service ports is determined.
11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, implement the method as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Method for testing port connectivity of switch
CN102664774A
Method for detecting chain circuit cross misconnection
CN1531229A