A bit transition detection method and device, electronic equipment and storage medium
Patent Information
- Application Number
- CN202611191906.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-06
- Publication Date
- 2026-10-16
AI Technical Summary
然而,上述方法仍存在仅覆盖存储部件而漏检总线路径,因校验值被转发设备重算而失效,只能将故障粗粒度定位于服务器间而无法精确至具体设备与端口等问题
[0020]本公开实施例提供的比特跳变检测方法,根据待测网络设备的设备信息,生成至少一个检测报文;将所述至少一个检测报文发送至所述待测网络设备;接收所述待测网络设备发送的至少一个转发报文;从所述转发报文中获取第二内容载荷;比对相对应的所述第一内容载荷和第二内容载荷,得到第一检测结果。该方法基于报文设计使得发向待测网络设备的检测报文经转发回到本地设备,进而通过比较前后内容载荷的差异对待测网络设备是否存在比特跳变问题进行主动检测。通过该方法可以提前发现网络设备中所存在的比特跳变问题,防止对数据中心正常业务造成影响。
Smart Images

Figure CN122933474A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of communication technology, and more specifically, to a bit transition detection method, apparatus, electronic device, computer program product, and storage medium. Background Technology
[0002] During network data forwarding, factors such as hardware aging, cosmic ray radiation, electromagnetic interference, or electrostatic discharge can cause single or multiple bit flips in the internal storage components of the switch chip (such as SRAM, TCAM, MMU, etc.) and even in the communication bus circuit, leading to unexpected changes in the data packet content. This phenomenon is called bit switching. Such errors can cause the data packet content to be silently tampered with along the forwarding path. Traditional error correction coding (such as ECC) has blind spots for multi-bit flips and parity checks for even-numbered bit flips, preventing erroneous data from being detected in time. This allows the erroneous data to continue flowing to the server, triggering serious consequences such as upper-layer business logic anomalies and task interruptions.
[0003] Currently, the industry generally relies on methods such as in-chip soft error rate detection, Frame Check Sequence (FCS) hop-by-hop recalculation, TCP / IP checksums, and passive statistics or ICMP probing for post-incident detection and location. However, these methods still have drawbacks, including only covering storage components and missing bus paths, invalidation due to checksum recalculation by forwarding devices, and only being able to locate faults coarsely between servers rather than precisely to specific devices and ports. More importantly, existing solutions are mostly passive, typically requiring intervention only after services have been affected or abnormal indicators have appeared. This results in long fault response and isolation times, making it difficult to meet the timeliness requirements of data centers for network recovery. Therefore, there is an urgent need for a method to actively detect bit transitions. Summary of the Invention
[0004] This disclosure provides a bit transition detection method, apparatus, electronic device, computer program product, and storage medium.
[0005] According to a first aspect of the present disclosure, a bit transition detection method is provided, comprising: generating at least one detection message based on device information of a network device under test; the detection message including at least a first message header and a first content payload; sending the at least one detection message to the network device under test; receiving at least one forwarded message sent by the network device under test; the forwarded message being the detection message forwarded via the network device under test; obtaining a second content payload from the forwarded message; and comparing the corresponding first content payload and second content payload to obtain a first detection result.
[0006] In some exemplary embodiments of this disclosure, generating at least one detection message based on the device information of the network device under test further includes: obtaining the device information of the network device under test; the device information includes: bus width and / or memory information; and determining the size of the first content payload based on the bus width and / or memory information.
[0007] In some exemplary embodiments of this disclosure, generating at least one detection message based on the device information of the network device under test further includes: obtaining one or more byte sequences from a sequence pattern library; the sequence pattern library includes multiple preset byte sequences; and generating the first content payload based on the one or more byte sequences.
[0008] In some exemplary embodiments of this disclosure, the byte sequence is a sequence segment set according to a preset bit alternation pattern.
[0009] In some exemplary embodiments of this disclosure, the sequence pattern library includes at least one byte sequence selected from 0x0F, 0xFF, 0x00, 0xF0, 0x5A, and 0xA5.
[0010] In some exemplary embodiments of this disclosure, the at least one detection message includes the first content payload generated based on different byte sequences.
[0011] In some exemplary embodiments of this disclosure, generating at least one detection packet based on the device information of the network device under test includes: obtaining the first MAC address and local IP address of the local device and the second MAC address of the network device under test; and setting the source MAC address, destination MAC address and destination IP address in the first packet header to the first MAC address, the second MAC address and the local IP address, respectively.
[0012] In some exemplary embodiments of this disclosure, receiving at least one forwarded message sent by the network device under test further includes: obtaining a second header of the forwarded message; and determining the detection message corresponding to the forwarded message based on the second header.
[0013] In some exemplary embodiments of this disclosure, the step of comparing the corresponding first content payload and second content payload to obtain a first detection result includes: comparing the corresponding first content payload and second content payload; determining that the network device under test has not experienced a bit transition in response to the first content payload and the second content payload having the same content; and determining that the network device under test has experienced a bit transition in response to the first content payload and the second content payload having the same content.
[0014] In some exemplary embodiments of this disclosure, the step of determining that the network device under test has experienced a bit transition in response to the inconsistency between the first content payload and the second content payload further includes: performing a byte-based comparison of the first content payload and the second content payload to obtain a comparison result; generating a detection report based on the comparison result; the detection report includes at least: identification information of the network device under test, information on the number of transition bits, and / or information on the position of the transition bits.
[0015] In some exemplary embodiments of this disclosure, the method further includes: determining a first number of packets based on at least one detection packet sent to the network device under test; determining a second number of packets based on at least one forwarding packet received from the network device under test; and obtaining a second detection result by comparing the first number of packets and the second number of packets.
[0016] According to a second aspect of the present disclosure, a bit transition detection apparatus is provided, comprising: a detection message generation module configured to generate at least one detection message based on device information of a network device under test; the detection message including at least a first message header and a first content payload; a detection message sending module configured to send the at least one detection message to the network device under test; a forwarding message receiving module configured to receive at least one forwarding message sent by the network device under test; the forwarding message being the detection message forwarded via the network device under test; a content payload extraction module configured to obtain a second content payload from the forwarding message; and a content payload comparison module configured to compare the corresponding first content payload and second content payload to obtain a first detection result.
[0017] According to a third aspect of the present disclosure, an electronic device is provided, characterized in that it includes: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to execute the executable instructions to implement any of the bit transition detection methods described in the present disclosure.
[0018] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided, wherein when instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform any of the bit transition detection methods described in the present disclosure.
[0019] According to a fifth aspect of the present disclosure, a computer program product is provided, including a computer program that is executed by a processor using any of the bit transition detection methods described in the present disclosure.
[0020] The bit transition detection method provided in this disclosure generates at least one detection message based on the device information of the network device under test; sends the at least one detection message to the network device under test; receives at least one forwarded message sent by the network device under test; obtains a second content payload from the forwarded message; and compares the corresponding first content payload and second content payload to obtain a first detection result. This method is based on a message design that allows detection messages sent to the network device under test to be forwarded back to the local device, thereby proactively detecting whether the network device under test has bit transition problems by comparing the differences in the content payloads before and after. This method can detect bit transition problems in network devices in advance, preventing impact on normal data center operations.
[0021] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0022] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure. It is obvious that the drawings described below are merely some embodiments of this disclosure, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.
[0023] Figure 1 A schematic diagram of an exemplary system architecture to which the methods of embodiments of this disclosure can be applied is shown.
[0024] Figure 2 This is a flowchart illustrating a bit transition detection method according to an exemplary embodiment.
[0025] Figure 3 This is a schematic diagram illustrating the bit transition detection message interaction process as shown in the example.
[0026] Figure 4 This is a flowchart illustrating a method for determining the content payload size according to an exemplary embodiment.
[0027] Figure 5 This is a flowchart illustrating a content payload generation method according to an exemplary embodiment.
[0028] Figure 6 This is a flowchart illustrating a content payload comparison method according to an exemplary embodiment.
[0029] Figure 7 This is a flowchart illustrating a second detection result determination method according to an exemplary embodiment.
[0030] Figure 8This is a block diagram illustrating a bit transition detection device according to an exemplary embodiment.
[0031] Figure 9 This is a schematic diagram illustrating the structure of an electronic device suitable for implementing exemplary embodiments of the present disclosure, according to an exemplary embodiment. Detailed Implementation
[0032] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the embodiments set forth herein; rather, they are provided so that this disclosure will be thorough and complete, and will fully convey the concept of the exemplary embodiments to those skilled in the art. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted.
[0033] The features, structures, or characteristics described in this disclosure can be combined in any suitable manner in one or more embodiments. Numerous specific details are provided in the following description to give a thorough understanding of embodiments of this disclosure. However, those skilled in the art will recognize that the technical solutions of this disclosure can be practiced with one or more specific details omitted, or other methods, components, apparatuses, steps, etc., can be employed. In other instances, well-known methods, apparatuses, implementations, or operations are not shown or described in detail to avoid obscuring various aspects of this disclosure.
[0034] The accompanying drawings are merely illustrative of this disclosure, and the same reference numerals in the drawings denote the same or similar parts, thus omitting repeated descriptions of them. Some block diagrams shown in the drawings do not necessarily correspond to physically or logically independent entities. These functional entities may be implemented in software, in at least one hardware module or integrated circuit, or in different network and / or processor devices and / or microcontroller devices.
[0035] The flowchart shown in the accompanying drawings is merely illustrative and does not necessarily include all content and steps, nor does it require execution in the described order. For example, some steps may be broken down, while others may be combined or partially combined; therefore, the actual execution order may change depending on the specific circumstances.
[0036] In this specification, the terms “a,” “an,” “the,” “the,” and “at least one” are used to indicate the presence of at least one element / component / etc.; the terms “comprising,” “including,” and “having” are used to indicate an open-ended inclusion and to mean that there may be other elements / components / etc. in addition to the listed elements / components / etc.; the terms “first,” “second,” and “third,” etc., are used only as markings and are not a limitation on the number of objects.
[0037] Figure 1 A schematic diagram of an exemplary system architecture to which the methods of embodiments of this disclosure can be applied is shown.
[0038] like Figure 1 As shown, the system architecture may include server 101, network 102, terminal device 103, terminal device 104, and terminal device 105. Network 102 serves as the medium for providing a communication link between terminal device 103, terminal device 104, or terminal device 105 and server 101. Network 102 may include various connection types, such as wired or wireless communication links or fiber optic cables, etc.
[0039] Server 101 can be a server that provides various services, such as a back-end management server that supports the devices operated by users using terminal devices 103, 104, or 105. The back-end management server can analyze and process received requests and other data, and feed back the processing results to terminal devices 103, 104, or 105.
[0040] Terminal devices 103, 104, and 105 can be smartphones, tablets, laptops, desktop computers, smart speakers, wearable smart devices, virtual reality devices, augmented reality devices, etc., but are not limited to these.
[0041] It should be understood that Figure 1 The number of terminal devices 103, 104, 105, network 102, and server 101 in the diagram is merely illustrative. Server 101 can be a single physical server, a server cluster consisting of multiple servers, or a cloud server. Depending on actual needs, it can have any number of terminal devices, networks, and servers.
[0042] The steps of the method in the exemplary embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings and examples.
[0043] Figure 2 This is a flowchart illustrating a bit transition detection method according to an exemplary embodiment. Figure 2 The method provided in the embodiments can be executed by any electronic device, such as those described above. Figure 1 Terminal devices in or Figure 1 The server in, or Figure 1 The terminal devices and servers in the process are executed together, but this disclosure does not limit this.
[0044] In step S210, at least one detection message is generated based on the device information of the network device under test; the detection message includes at least a first message header and a first content payload.
[0045] In related technologies, during data forwarding, network devices may experience unexpected bit flips in their internal storage components (such as MMU, SRAM, TCAM) or data bus circuits due to factors like hardware aging, cosmic ray radiation, or electromagnetic interference. This can lead to unintended alterations to the content of forwarded data packets, a phenomenon known as bit transitions. Once this error occurs, verification mechanisms such as FCS (Frame Check Sequence) recalculation after erroneous data recalculation cannot effectively detect it, resulting in a continuous flow of corrupted data to the server and serious consequences such as business data corruption. Currently, the industry generally relies on methods such as in-chip soft error rate detection, Frame Check Sequence (FCS) hop-by-hop recalculation, TCP / IP checksums, and passive statistics or ICMP probing for post-incident detection and location. However, these methods still have limitations, including only covering storage components and missing bus paths, invalidating checksums due to recalculation by forwarding devices, and only providing coarse-grained fault location between servers rather than pinpointing specific devices and ports. More importantly, existing solutions are mostly passive, typically requiring intervention only after services are affected or abnormal indicators appear. This results in lengthy fault response and isolation times, failing to meet the data center's requirements for timely network recovery.
[0046] In this embodiment of the disclosure, the local device (i.e., the sender) periodically parses the ARP table to obtain entries that are active in the network, thereby identifying other network devices to be tested in the network. The ARP table is the Address Resolution Protocol (ARP) table, used to record the mapping relationship between corresponding MAC addresses indexed by IP addresses in the network.
[0047] In this embodiment, the local device obtains the device information of the network device under test (DUT) and generates a detection message corresponding to the DUT. This detection message is used to detect whether the DUT exhibits bit transitions. The detection message includes at least a first header and a first payload. The first header carries control information necessary for addressing and forwarding the message in the network, ensuring that the message is correctly sent from the source device to the DUT along a preset path and triggering the latter to execute a standard Layer 3 forwarding process. The first payload carries preset data content, which serves as the basis for detection and judgment in subsequent steps.
[0048] In an exemplary embodiment, the local device may generate a single detection message for a specific network device under test, or it may generate a message group comprising multiple detection messages for the same network device under test. The first content payload carried by these multiple detection messages may contain the same data content or different data content.
[0049] In an exemplary embodiment, the local device first obtains its first MAC address (denoted as SMAC) and local IP address (denoted as IP_self). Simultaneously, it obtains the second MAC address (denoted as DMAC) of the network device under test (i.e., the peer network device) by resolving the Address Resolution Protocol (ARP) table. In the first header information of the detection packet, the source MAC address is set to SMAC and the destination MAC address is set to DMAC at the Ethernet frame layer to ensure that the packet can be correctly sent from the local device and received by the network device under test. At the IP layer, the source IP address (SIP) is set to a preset, fixed IP address used for identification and filtering (e.g., 1.9.9.5), while the destination IP address is set to the local IP address (i.e., IP_self).
[0050] In step S220, the at least one detection message is sent to the network device under test.
[0051] In this embodiment of the disclosure, the local device sends at least one generated detection packet to the corresponding network device under test via the network. Specifically, the MAC address (i.e., the second MAC address) of the network device under test can be obtained by parsing the ARP table. In the first header information of the detection packet, the source MAC address is set to the first MAC address, and the destination MAC address is set to the second MAC address.
[0052] like Figure 3 As shown, with the aforementioned first header design, the detection message is sent to the physical interface of the network device under test (DUT) through the physical interface of the local device. This detection message carries a first payload. Since the detection message sets the destination IP to the local IP address, and the DUT's local routing table does not contain a directly connected route entry for that IP, the DUT will not recognize this detection message as a control message destined for itself. Instead, it will treat it as a cross-segment Layer 3 unicast message and forward it accordingly. After performing a longest prefix match (LPM) lookup in its Layer 3 routing table, the DUT finds that the next hop for the destination IP points to the sending device (i.e., the local device). Therefore, after processing the detection message through its complete hardware forwarding pipeline, it forwards the detection message back to the local device through the DUT's physical interface, thus forwarding the message. This forwarded message, processed by the DUT's Layer 3 routing, may have its first payload data content altered due to bit transitions within the device, thus forming a second payload. In this way, the detection packet completes the hardware forwarding path with the actual service on the network device under test, thereby enabling the detection of bit transitions on the packet forwarding path of the network device under test.
[0053] In step S230, at least one forwarded message sent by the network device under test is received; the forwarded message is the detection message forwarded by the network device under test.
[0054] In this embodiment, the detection packet, after being processed by the Layer 3 routing of the network device under test, is forwarded to the local device because its destination IP address is set to the local IP address of the local device. It is worth emphasizing that these forwarded packets have undergone the complete hardware processing flow of the network device under test, including but not limited to: inbound FCS verification, IP header validity check, longest prefix match (LPM) route lookup, access control list (ACL) policy matching, MMU buffer queue enqueueing and scheduling, outbound TTL decrementing, and outbound FCS recalculation. This path is completely consistent with the forwarding path of actual service packets.
[0055] In this embodiment of the disclosure, the local device receives at least one forwarded message forwarded by the network device under test. This forwarded message corresponds one-to-one with the detection message sent to the network device under test in step S210. Corresponding to the detection message, the forwarded message includes at least a second header and a second content payload.
[0056] In an exemplary embodiment, the local device initiates an asynchronous packet capture thread on a designated physical interface to receive various network packets, including forwarded packets sent by the network device under test. Based on the information carried in the second header of the forwarded packet, the local device determines the relay packet corresponding to the detection packet from among the various network packets. This specifically includes the following steps.
[0057] Obtain the second header of the forwarded message; Based on the second message header, the detection message corresponding to the forwarded message is determined.
[0058] In an exemplary embodiment, packet filtering conditions are pre-set based on the detection packets generated in step S210. These filtering conditions are typically set based on relevant information in the first header of the detection packets. For example, the transport layer protocol, fixed source and destination port numbers, and a fixed source IP address (i.e., a preset SIP, such as 1.9.9.5). By setting these filtering conditions, forwarded packets corresponding to the detection packets are filtered from various received network packets, and the correspondence between each forwarded packet and the detection packet is determined, providing a basis for subsequent payload comparison.
[0059] In step S240, the second content payload is obtained from the forwarded message.
[0060] In this embodiment of the disclosure, data is extracted from the received forwarded message to obtain the payload information carried within it, which has undergone the complete forwarding path processing of the network device under test, i.e., the second content payload. Since the received forwarded message is essentially a direct forwarded message of the original detection message without processing, the content of its payload should theoretically not change, unless a bit transition occurs during the hardware forwarding process.
[0061] In step S250, the corresponding first content payload and second content payload are compared to obtain the first detection result.
[0062] In this embodiment, the first content payload in the detection message recorded in step S210 is compared one-to-one with the second content payload in the corresponding forwarding message extracted in step S240. If no bit transition occurs on the forwarding path and network transmission line of the network device under test, theoretically, the data content of the first and second content payloads should be consistent. Conversely, if the data content of the first and second content payloads is inconsistent, it indicates that bit flipping due to bit transitions may occur on the forwarding path or network transmission line of the network device under test. Therefore, based on the comparison result of the first and second content payloads, a first detection result characterizing whether a bit transition exists in the network device under test can be obtained.
[0063] The bit transition detection method provided in this disclosure generates at least one detection message based on the device information of the network device under test; sends the at least one detection message to the network device under test; receives at least one forwarded message sent by the network device under test; obtains a second content payload from the forwarded message; and compares the corresponding first content payload and second content payload to obtain a first detection result. This method is based on a message design that allows detection messages sent to the network device under test to be forwarded back to the local device, thereby proactively detecting whether the network device under test has bit transition problems by comparing the differences in the content payloads before and after. This method can detect bit transition problems in network devices in advance, preventing impact on normal data center operations.
[0064] Figure 4 This is a flowchart illustrating a method for determining the content payload size according to an exemplary embodiment. For example... Figure 4 As shown in the embodiments of this disclosure, step S210 may further include the following steps.
[0065] In step S410, the device information of the network device under test is obtained; the device information includes: bus width and / or memory information.
[0066] In this embodiment, the method detects bit transitions in the network device under test (DUT) by forwarding the detection message through Layer 3 routing. Therefore, the size of the first content payload in the detection message determines the efficiency and completeness of the detection. For example, if the bus width of the DUT is 512 bits, and the first content payload in the detection message is only 64 bytes, it will only cover a portion of the bus width and will not be able to scan the entire bus width of the DUT. Similarly, the cache space in the DUT varies in size depending on its memory specifications. The size of the first content payload in the detection message also determines whether it can cover the cache space in the DUT.
[0067] Based on this, in addition to obtaining the network address information of the network device under test by resolving the ARP table, the local device can further obtain the bus width and / or memory information of the network device under test. Bus width indicates the transmission bus width of the network device under test. Memory information indicates the memory specifications of the network device under test.
[0068] It should be noted that, depending on the actual application scenario, the local device may obtain only the bus width or memory information of the network device under test, or it may obtain both the bus width and memory information of the network device under test, both of which should be considered as being within the scope of protection of this disclosure.
[0069] In step S420, the size of the first content payload is determined based on the bus width and / or memory information.
[0070] In this embodiment of the disclosure, the size of the first content payload in the detection message is determined based on the obtained bus width and / or memory information. Specifically, the size of the first content payload should be greater than a threshold determined based on the bus width and / or memory information, so that the size of the first content payload can sufficiently cover the granularity of the bus width or memory.
[0071] It should be noted that in some implementation scenarios, it is not necessary to know the exact bus width and / or memory information of the network device under test. It is sufficient to set the first content payload to a size that is large enough to cover the bus width or memory.
[0072] Figure 5 This is a flowchart illustrating a content payload generation method according to an exemplary embodiment. For example... Figure 5 As shown in the embodiments of this disclosure, step S210 may further include the following steps.
[0073] In step S510, one or more byte sequences are obtained from the sequence pattern library; the sequence pattern library includes multiple preset byte sequences.
[0074] In this embodiment, the scheme detects bit transitions in the network device under test (DUT) by detecting the packet's forwarding through Layer 3 routing. If a bit transition exists in the DUT, it may trigger unexpected bit flips in the first content payload, such as flipping a "0" to a "1" or vice versa. Since different hardware circuits have varying sensitivities to different bit patterns, a single fixed byte sequence may not cover all types of flip scenarios. For example, some storage units may be more sensitive to flipping a "1" to a "0," while others may be less so. Therefore, how the specific data content of the first content payload is generated will affect the detection efficiency and sensitivity of the bit transition detection.
[0075] In this embodiment of the disclosure, a sequence pattern library comprising multiple preset byte sequences is pre-constructed. Each byte sequence has different bit arrangement characteristics. These sequences are not randomly selected, but are carefully designed based on mature experience in the field of hardware testing. According to the requirements of the detection scenario, one or more byte sequences are obtained from this sequence pattern library, thereby generating a first content payload based on the obtained byte sequences.
[0076] In an exemplary embodiment, each byte sequence in the sequence pattern library is a sequence segment set according to a preset bit alternation rule. This bit alternation rule is designed based on the sensitivity of different hardware circuits. For example, an 8-byte sequence segment is used. Corresponding repeatable sequence segments for each byte sequence are designed according to the bit alternation rule. Examples include "10101010", "00110011", and "01100110".
[0077] In an exemplary embodiment, the sequence pattern library includes at least one byte sequence selected from 0x0F, 0xFF, 0x00, 0xF0, 0x5A, and 0xA5. Specifically, 0x0F corresponds to binary "00001111"; 0xFF corresponds to binary "11111111"; 0x00 corresponds to binary "00000000"; 0xF0 corresponds to binary "11110000"; 0x5A corresponds to binary "01011010"; and 0xA5 corresponds to binary "10100101".
[0078] In step S520, the first content payload is generated based on the one or more byte sequences.
[0079] In this embodiment of the disclosure, based on one or more selected byte sequences, a complete first content payload of the detection message is generated by filling in according to preset rules, thereby constructing a payload data body with specific bit distribution characteristics.
[0080] In an exemplary embodiment, for a content payload that employs a single byte sequence, the byte sequence is cyclically filled throughout the entire payload length.
[0081] In an exemplary embodiment, for a payload consisting of multiple byte sequences, the selected byte sequences are cyclically filled by concatenating and combining them in a preset order. Alternatively, the entire payload can be divided into multiple consecutive data blocks, each filled with a different byte sequence. For example, the first third of the payload can be filled with 0xFF, the middle third with 0x00, and the last third with 0x5A, thereby achieving simultaneous coverage of multiple bit patterns in the same probe message.
[0082] Furthermore, the length of the content payload can be based on the aforementioned Figure 4 The illustrated implementation determines the size of the first content load.
[0083] In an exemplary embodiment, in addition to using a mixed padding method of multiple byte sequences in the first content payload of a single detection message, the first content payloads of the multiple detection messages generated in the aforementioned step S210 can also be generated based on different selected byte sequences for each of the respective detection messages. In this way, a set of detection messages generated based on different byte sequences can be sent simultaneously to a network device under test, thereby making full use of the characteristics of different byte sequences to efficiently detect whether the network device under test has bit transitions.
[0084] The bit transition detection method provided in this disclosure improves the detection efficiency of the detection message for the network device under test by designing the content and size of the first content payload in the detection message, thereby enabling more efficient and complete troubleshooting of the network device under test.
[0085] Figure 6 This is a flowchart illustrating a content payload comparison method according to an exemplary embodiment. Figure 6 As shown in the present embodiment, step S250 may include the following steps.
[0086] In step S610, the corresponding first content payload and second content payload are compared.
[0087] In this embodiment of the disclosure, the corresponding first content payload and second content payload are compared to determine whether their data contents are consistent. Since bit transitions are byte-level flip transitions, the first content payload and the second content payload also need to be compared byte-level to obtain the corresponding comparison results.
[0088] In an exemplary embodiment, a byte-by-byte XOR operation is performed on the first and second content payloads. If the two payloads are identical, the XOR result is zero, indicating that no bit flips have occurred on the network device under test. Conversely, if the XOR result is non-zero, it proves that a bit transition has occurred on the network device under test.
[0089] Furthermore, based on the byte-by-byte XOR operation of the first and second content payloads, the number of bytes that undergo bit flipping (the number of flipped bits) and their offset position in the content payload bytes (i.e., the position information of flipped bits) can be determined.
[0090] In step S620, in response to the consistency between the first content payload and the second content payload, it is determined that the network device under test has not experienced a bit transition.
[0091] In this embodiment of the disclosure, if the first content payload and the second content payload are identical (e.g., the XOR result is zero), it is determined that the network device under test has not experienced a bit transition.
[0092] In step S630, in response to the inconsistency between the first content payload and the second content payload, it is determined that a bit transition has occurred in the network device under test.
[0093] In this embodiment of the disclosure, if the contents of the first content payload and the second content payload are inconsistent (for example, the XOR result is non-zero), it is determined that the network device under test has undergone a bit transition.
[0094] In an exemplary embodiment, a corresponding detection report is generated based on the byte-by-byte comparison results described above. This detection report includes at least: the identification information of the network device under test, the number of transition bits, and / or the position information of the transition bits. The report content facilitates subsequent troubleshooting and analysis of the network device under test.
[0095] The bit transition detection method provided in this disclosure, by comparing the first content payload and the second content payload based on bytes, can not only determine whether the network device under test has a bit transition problem, but also further determine the number of transition bits and the position of the transition bits, which facilitates subsequent troubleshooting and analysis of the network device under test.
[0096] Figure 7 This is a flowchart illustrating a second detection result determination method according to an exemplary embodiment. Figure 7 As shown in the embodiments of this disclosure, the method may further include the following steps.
[0097] In step S710, the number of first messages is determined based on at least one detection message sent to the network device under test.
[0098] In this embodiment of the disclosure, during network data forwarding, in addition to bit flipping caused by bit transitions, network packet loss may occur due to other reasons. This disclosure can further detect network packet loss during the aforementioned bit transition detection process. During the process of the local device sending multiple detection messages to the network device under test, the number of detection messages sent is determined as the first message count.
[0099] In step S720, the number of second messages is determined based on receiving at least one forwarded message sent by the network device under test.
[0100] In this embodiment of the disclosure, during the process of the local device receiving multiple forwarded messages sent by the network device under test, the number of received forwarded messages is determined as the second message number.
[0101] In step S730, a second detection result is obtained by comparing the number of the first message and the number of the second message.
[0102] In this embodiment, forwarded packets are theoretically returned directly to the local device without being processed by the network device under test. Under normal network conditions, the number of the first packet and the number of the second packet should be the same. Based on this, comparing the number of the first packet and the number of the second packet allows for detection of current network packet loss, yielding a second detection result. This second detection result reflects the current network transmission status. If the number of the first packet and the number of the second packet are equal, it is determined that all sent detection packets were successfully received and forwarded, and the relevant network transmission path is normal. If the number of the first packet and the number of the second packet are not equal, it is determined that packet loss exists in the relevant network transmission path.
[0103] The bit transition detection method provided in this disclosure, in addition to detecting bit transition problems as described above, can also detect network packet loss problems based on the detection mechanism, thereby improving the efficiency of troubleshooting network problems.
[0104] The following are embodiments of the apparatus disclosed herein, which can be used to execute embodiments of the method disclosed herein. For details not disclosed in the apparatus embodiments of this disclosure, please refer to the embodiments of the method disclosed herein.
[0105] Figure 8 This is a block diagram illustrating a bit transition detection device according to an exemplary embodiment. (Refer to...) Figure 8 The device 800 may include: a detection message generation module 810, a detection message sending module 820, a forwarding message receiving module 830, a content payload extraction module 840, and a content payload comparison module 850.
[0106] The detection message generation module 810 is configured to generate at least one detection message based on the device information of the network device under test; the detection message includes at least a first message header and a first content payload.
[0107] The detection message sending module 820 is configured to send the at least one detection message to the network device under test.
[0108] The forwarding message receiving module 830 is configured to receive at least one forwarding message sent by the network device under test; the forwarding message is the detection message forwarded by the network device under test.
[0109] The content payload extraction module 840 is configured to obtain a second content payload from the forwarded message.
[0110] The content payload comparison module 850 is configured to compare the corresponding first content payload and second content payload to obtain a first detection result.
[0111] In some exemplary embodiments of this disclosure, the detection message generation module 810 is further configured to acquire device information of the network device under test; the device information includes: bus width and / or memory information; and determine the size of the first content payload based on the bus width and / or memory information.
[0112] In some exemplary embodiments of this disclosure, the detection message generation module 810 is further configured to obtain one or more byte sequences from a sequence pattern library; the sequence pattern library includes a plurality of preset byte sequences; and generate the first content payload based on the one or more byte sequences.
[0113] In some exemplary embodiments of this disclosure, the byte sequence is a sequence segment set according to a preset bit alternation pattern.
[0114] In some exemplary embodiments of this disclosure, the sequence pattern library includes at least one byte sequence selected from 0x0F, 0xFF, 0x00, 0xF0, 0x5A, and 0xA5.
[0115] In some exemplary embodiments of this disclosure, the at least one detection message includes the first content payload generated based on different byte sequences.
[0116] In some exemplary embodiments of this disclosure, the detection packet generation module 810 is further configured to obtain the first MAC address and local IP address of the local device and the second MAC address of the network device under test; and to set the source MAC address, destination MAC address and destination IP address in the first packet header to the first MAC address, the second MAC address and the local IP address, respectively.
[0117] In some exemplary embodiments of this disclosure, the forwarding message receiving module 830 is further configured to obtain the second message header of the forwarding message; and determine the detection message corresponding to the forwarding message based on the second message header.
[0118] In some exemplary embodiments of this disclosure, the content payload comparison module 850 is further configured to compare the corresponding first content payload and second content payload; in response to the first content payload and the second content payload being consistent, determine that the network device under test has not experienced a bit transition; in response to the first content payload and the second content payload being inconsistent, determine that the network device under test has experienced a bit transition.
[0119] In some exemplary embodiments of this disclosure, the content payload comparison module 850 is further configured to perform a byte-based comparison of the first content payload and the second content payload to obtain a comparison result; and generate a detection report based on the comparison result; the detection report includes at least: identification information of the network device under test, information on the number of transition bits, and / or information on the position of transition bits.
[0120] In some exemplary embodiments of this disclosure, the message count comparison module is configured to determine a first message count based on at least one detection message sent to the network device under test; determine a second message count based on at least one forwarded message received from the network device under test; and obtain a second detection result by comparing the first message count and the second message count.
[0121] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.
[0122] The following reference Figure 9 To describe an electronic device 900 according to such an embodiment of the present disclosure. Figure 9 The electronic device 900 shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments disclosed herein.
[0123] like Figure 9 As shown, the electronic device 900 is presented in the form of a general-purpose computing device. The components of the electronic device 900 may include, but are not limited to: at least one processing unit 910, at least one storage unit 920, a bus 930 connecting different system components (including storage unit 920 and processing unit 910), and a display unit 940.
[0124] The storage unit stores program code, which can be executed by the processing unit 910 to perform the steps described in the "Exemplary Methods" section of this specification according to various exemplary embodiments of this disclosure. For example, the processing unit 910 can perform actions such as... Figure 2 The steps shown.
[0125] For example, electronic devices can achieve such Figure 2 The steps shown.
[0126] Storage unit 920 may include readable media in the form of volatile storage units, such as random access memory (RAM) 921 and / or cache memory 922, and may further include read-only memory (ROM) 923.
[0127] Storage unit 920 may also include a program / utility 924 having a set (at least one) program module 925, such program module 925 including but not limited to: operating system, one or more application programs, other program modules and program data, each or some combination of these examples may include an implementation of a network environment.
[0128] Bus 930 can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any of the various bus structures.
[0129] Electronic device 900 can also communicate with one or more external devices 970 (e.g., keyboard, pointing device, Bluetooth device, etc.), and with one or more devices that enable a user to interact with electronic device 900, and / or with any device that enables electronic device 900 to communicate with one or more other computing devices (e.g., router, modem, etc.). This communication can be performed via input / output (I / O) interface 950. Furthermore, electronic device 900 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 960. As shown, network adapter 960 communicates with other modules of electronic device 900 via bus 930. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 900, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0130] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, terminal device, or network device, etc.) to execute the methods according to the embodiments of this disclosure.
[0131] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory including instructions that can be executed by a processor of the device to perform the described method. Optionally, the computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.
[0132] In an exemplary embodiment, a computer program product is also provided, including a computer program that, when executed by a processor, implements the methods described above.
[0133] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.
[0134] It should be understood that this disclosure 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 this disclosure is limited only by the appended claims.
Claims
1. A bit transition detection method, characterized in that, The method includes: Based on the device information of the network device under test, at least one detection message is generated; the detection message includes at least a first message header and a first content payload. Send the at least one detection message to the network device under test; Receive at least one forwarded message sent by the network device under test; the forwarded message is the detection message forwarded by the network device under test; Obtain the second content payload from the forwarded message; By comparing the corresponding first content payload and second content payload, a first detection result is obtained.
2. The method according to claim 1, characterized in that, The step of generating at least one detection message based on the device information of the network device under test further includes: Obtain the device information of the network device under test; the device information includes: bus width and / or memory information; The size of the first content payload is determined based on the bus width and / or memory information.
3. The method according to claim 1, characterized in that, The step of generating at least one detection message based on the device information of the network device under test further includes: Obtain one or more byte sequences from a sequence pattern library; the sequence pattern library includes multiple preset byte sequences. The first content payload is generated based on the one or more byte sequences.
4. The method according to claim 3, characterized in that, The byte sequence is a sequence segment set according to a preset bit alternation pattern.
5. The method according to claim 3, characterized in that, The sequence pattern library includes at least one byte sequence selected from 0x0F, 0xFF, 0x00, 0xF0, 0x5A, and 0xA5.
6. The method according to claim 3, characterized in that, The at least one detection message includes the first content payload generated based on different byte sequences.
7. The method according to claim 1, characterized in that, The step of generating at least one detection message based on the device information of the network device under test includes: Obtain the first MAC address and local IP address of the local device, as well as the second MAC address of the network device under test; Set the source MAC address, destination MAC address, and destination IP address in the first packet header to the first MAC address, the second MAC address, and the local IP address, respectively.
8. The method according to claim 1, characterized in that, The step of receiving at least one forwarded message sent by the network device under test further includes: Obtain the second header of the forwarded message; Based on the second message header, the detection message corresponding to the forwarded message is determined.
9. The method according to claim 1, characterized in that, The comparison of the corresponding first content payload and second content payload to obtain a first detection result includes: Compare the corresponding first content payload and second content payload; In response to the consistency between the first content payload and the second content payload, it is determined that no bit transition has occurred in the network device under test; In response to the inconsistency between the first content payload and the second content payload, it is determined that a bit transition has occurred in the network device under test.
10. The method according to claim 9, characterized in that, The step of determining that the network device under test has experienced a bit transition in response to the inconsistency between the first content payload and the second content payload further includes: The first content payload and the second content payload are compared byte-by-byte to obtain the comparison result; Based on the comparison results, a detection report is generated; the detection report includes at least: the identification information of the network device under test, the number of transition bits, and / or the position information of the transition bits.
11. The method according to claim 1, characterized in that, The method further includes: The number of first messages is determined based on at least one detection message sent to the network device under test; The number of second messages is determined based on at least one forwarded message received from the network device under test; The second detection result is obtained by comparing the number of the first message and the number of the second message.
12. A bit transition detection device, characterized in that, include: The detection message generation module is configured to generate at least one detection message based on the device information of the network device under test; The detection message includes at least a first message header and a first content payload; The detection message sending module is configured to send the at least one detection message to the network device under test; The forwarding message receiving module is configured to receive at least one forwarding message sent by the network device under test; the forwarding message is the detection message forwarded by the network device under test. The content payload extraction module is configured to obtain a second content payload from the forwarded message; The content payload comparison module is configured to compare the corresponding first content payload and second content payload to obtain a first detection result.
13. An electronic device, characterized in that, include: processor; Memory used to store the processor's executable instructions; The processor is configured to execute the executable instructions to implement the bit transition detection method as described in any one of claims 1 to 11.
14. A computer-readable storage medium, wherein instructions in the computer-readable storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the bit transition detection method as described in any one of claims 1 to 11.
15. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the bit transition detection method as described in any one of claims 1 to 11.