Network message transmission error detection method, device, equipment and readable storage medium
By sending the first and second messages with corresponding relationships and comparing the messages returned by the destination node, accurately detecting network message transmission errors, solving the problem of difficult transmission errors and improving the stability of network tasks.
Patent Information
- Application Number
- CN202310105208.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-20
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2043-01-20
AI Technical Summary
In the prior art, network packets are prone to invert information bits due to abnormal factors during transmission, resulting in transmission errors but are difficult to detect and discover, which in turn causes task abnormalities.
By sending the first and second messages with corresponding relationships to the destination node, and comparing whether the message returned by the destination node is the same as the original message, it is determined whether there is a transmission error in the target link.
It realizes accurate detection of network message transmission errors, solves the problem that transmission errors are difficult to detect, and improves the stability of network tasks.
Smart Images

Figure CN116155776B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of message detection, and in particular to a method, device, equipment and readable storage medium for detecting network message transmission errors. Background Art
[0002] During the transmission of messages between hosts, they are typically forwarded by various network devices. During this process, message transmission errors can easily occur due to abnormal factors. In this case, the value of one or more information bits in the message payload may flip, for example, from 0 to 1 or vice versa. This can cause the message received by the destination to be inconsistent with the message sent by the source. Factors such as aging network device chips, high-energy particles in space, sunspot activity, power supply voltage fluctuations, and external attacks can cause message jumps, causing one or more information bits in the message to change, such as from 0 to 1 or from 1 to 0. Because message transmission errors are often hidden, they are difficult to detect and identify, and can easily lead to abnormal task processing.
[0003] In related technologies, network operation and maintenance engineers usually intervene to investigate the cause of the fault after the user discovers a task anomaly, which makes it difficult to easily detect and discover network message transmission error faults.
[0004] Therefore, there is a problem in the related art that message transmission error failures are difficult to detect and thus easily cause task abnormalities. In response to the above problem, no effective solution has been proposed yet.
[0005] The above information disclosed in the Background section is only intended to enhance the understanding of the background technology of the technology described herein. Therefore, the Background section may contain some information that does not form the known prior art for those skilled in the art. Summary of the Invention
[0006] The embodiments of the present invention provide a method, apparatus, device and readable storage medium for detecting network message transmission errors, so as to at least solve the technical problem in related technologies that message transmission error failures are difficult to detect and thus easily cause task abnormalities.
[0007] According to a first aspect of an embodiment of the present invention, a network message transmission error detection method is provided, comprising: receiving a detection command for a target link; in response to the detection command, sending a first message and a second message to a destination node via the target link, wherein the values of at least some information bits of the first message correspond to the values of corresponding information bits of the second message; receiving a third message and a fourth message returned by the destination node, wherein the third message is the first message received by the destination node, and the fourth message is the second message received by the destination node; determining whether the third message is the same as the first message, and determining whether the fourth message is the same as the second message; and determining that a message transmission error fault exists in the target link when the third message is different from the first message and / or the fourth message is different from the second message.
[0008] Furthermore, the sum of the values of at least part of the information bits of the first message and the values of corresponding information bits of the second message is 1.
[0009] Furthermore, the values of the information bits of the first message are all 0, and the values of the information bits of the second message are all 1; or, the values of the information bits of the first message are all 1, and the values of the information bits of the second message are all 0.
[0010] Furthermore, the first message and the second message are both User Datagram Protocol UDP messages, and the first message and the second message both include an Internet Protocol IP header and a UDP header, the IP header includes a source IP and a destination IP, the source is the node that sends the first message and the second message, the destination is the destination node, and the UDP header includes a destination port number, which is the port number used by the destination to receive the first message and the second message.
[0011] Furthermore, the destination port number is a port number that is not enabled at the destination end.
[0012] Furthermore, sending the first message and the second message to the destination node includes: bypassing the protocol stack of the source end and sending the first message and the second message to the destination node; wherein, the value of the checksum field of the UDP header of the first message and / or the second message is 0; and / or, receiving the third message and the fourth message returned by the destination node includes: bypassing the protocol stack of the source end and receiving the third message and the fourth message.
[0013] Furthermore, in the case where the target link includes a plurality of network devices connected in series, and the network devices are used to forward messages on the target link; after determining that a message transmission error fault exists in the target link, the network message transmission error detection method further includes: sending the first message and / or the second message again to the destination node through the target link, wherein, in the case where the third message is different from the first message, the first message is sent to the destination node, and in the case where the fourth message is different from the second message, the second message is sent to the destination node, and the survival time value in the IP header of the first message and / or the IP header of the second message is n, wherein n is a preset value less than or equal to m, and m is the total number of network devices; receiving the fifth message and / or the sixth message returned by the target network device, wherein the target network device is the nth network device according to the sending direction of the first message and / or the second message, the fifth message is the first message received by the target network device, and the sixth message is the second message received by the target network device; determining whether the sent message is the same as the message returned by the target network device; if the sent message is different from the message returned by the target network device, determining that the message transmission error failure occurs on the link before the target network device.
[0014] Furthermore, when the sent message is the same as the message returned by the target network device, the network message transmission error detection method also includes: after increasing the value of n in the first message and / or the second message, sending the first message and / or the second message again, and receiving the message returned by the target network device until the sent message is different from the message returned by the target network device; and determining that the message transmission error failure occurs on the link before the target network device.
[0015] According to a second aspect of an embodiment of the present invention, a network message transmission error detection device is also provided, including: a first receiving unit, used to receive a detection command for a target link; a first sending unit, used to send a first message and a second message to a destination node through the target link in response to the detection command, wherein the values of at least part of the information bits of the first message correspond to the values of corresponding information bits of the second message; a second receiving unit, used to receive a third message and a fourth message returned by the destination node, wherein the third message is the first message received by the destination node, and the fourth message is the second message received by the destination node; a first determining unit, used to determine whether the third message is the same as the first message, and whether the fourth message is the same as the second message; a second determining unit, used to determine that a message transmission error fault exists in the target link when the third message is different from the first message and / or the fourth message is different from the second message.
[0016] Furthermore, the sum of the values of at least part of the information bits of the first message and the values of corresponding information bits of the second message is 1;
[0017] The values of the information bits of the first message are all 0, and the values of the information bits of the second message are all 1; or the values of the information bits of the first message are all 1, and the values of the information bits of the second message are all 0;
[0018] The first message and the second message are both User Datagram Protocol (UDP) messages, and both the first message and the second message include an Internet Protocol (IP) header and a UDP header. The IP header includes a source IP address and a destination IP address. The source is a node that sends the first message and the second message, and the destination is a destination node. The UDP header includes a destination port number, which is a port number used by the destination to receive the first message and the second message.
[0019] The destination port number is not enabled on the destination end;
[0020] The first sending unit is configured to: bypass the protocol stack of the source end and send the first message and the second message to the destination node; wherein the value of the checksum field in the UDP header of the first message and / or the second message is 0; and / or the second receiving unit is configured to: bypass the protocol stack of the source end and receive the third message and the fourth message;
[0021] In the case where the target link includes multiple network devices connected in series, and the network devices are used to forward messages on the target link; the network message transmission error detection device includes: a second sending unit, which is used to send the first message and / or the second message again to the destination node through the target link after determining that a message transmission error failure exists in the target link, wherein, in the case that the third message is different from the first message, the first message is sent to the destination node, and in the case that the fourth message is different from the second message, the second message is sent to the destination node, and the survival time value in the IP header of the first message and / or the IP header of the second message is n, wherein n is less than or equal to a preset value of m, where m is the total number of network devices; a third receiving unit, configured to receive a fifth message and / or a sixth message returned by a target network device, wherein the target network device is the nth network device in the sending direction of the first message and / or the second message, the fifth message is the first message received by the target network device, and the sixth message is the second message received by the target network device; a third determining unit, configured to determine whether a sent message and a message returned by the target network device are the same; and a fourth determining unit, configured to determine that a message transmission error fault occurs on a link before the target network device when the sent message and the message returned by the target network device are different;
[0022] The network message transmission error detection device is also used to: when the sent message is the same as the message returned by the target network device, increase the value of n in the first message and / or the second message, send the first message and / or the second message again, and receive the message returned by the target network device until the sent message is different from the message returned by the target network device; determine that the message transmission error failure occurs on the link before the target network device.
[0023] According to a third aspect of an embodiment of the present invention, a readable storage medium is further provided, on which computer instructions are stored, wherein the computer instructions implement the above-mentioned network message transmission error detection method when executed by a processor.
[0024] According to the fourth aspect of an embodiment of the present invention, a network message transmission error detection device is also provided, including a memory and a processor, wherein computer instructions are stored in the memory, wherein the computer instructions implement the above-mentioned network message transmission error detection method when executed by the processor.
[0025] According to a fifth aspect of an embodiment of the present invention, a computer program is further provided, wherein the computer program implements the above-mentioned network message transmission error detection method when executed by a processor.
[0026] The network message transmission error detection method of an embodiment of the present invention, after receiving a detection command for a target link, will send a first message and a second message to the destination node via the target link. For example, the first message and the second message are sent to the destination node in sequence. After the destination node receives the first message and the second message, it will return a third message and a fourth message accordingly. The third message is the first message received by the destination node, that is, the content received by the destination node for the first message, and the fourth message is the second message received by the destination node, that is, the content received by the destination node for the second message. By determining whether the third message is the same as the first message and whether the fourth message is the same as the second message, it can be determined whether there is a message transmission error fault on the target link. When the third message is different from the first message and / or the fourth message is different from the second message, it indicates that there is a message transmission error fault on the target link. The values of at least some information bits of the first message have a corresponding relationship with the values of corresponding information bits of the second message. For any information bit, its value has two options. The so-called corresponding relationship means that the values of the corresponding information bits of the first message and the second message are different. For example, if the value of a certain information bit in the first message is a first value, then the value of the corresponding information bit in the second message is a second value. In this way, regardless of whether the change characteristic of any information bit in this portion of information bits changes from the first value to the second value or from the second value to the first value when the message passes through the target link, the change can be captured and retained in the third message and / or the fourth message. Furthermore, by comparing the information bits with the first and second messages, it can be accurately determined whether a message transmission error fault occurred during the message transmission process on the target link. This facilitates the detection of transmission error faults during network message transmission, resolving the problem in related technologies where task abnormalities are caused by the difficulty in detecting message transmission error faults. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0028] Figure 1 A flowchart of a method for detecting network message transmission errors provided by an embodiment of the present invention;
[0029] Figure 2 A schematic diagram of a network message transmission error detection device provided by an embodiment of the present invention;
[0030] Figure 3 A schematic diagram of a method for detecting a network message transmission error provided by an embodiment of the present invention, showing a process of detecting and locating a message transmission error fault;
[0031] Figure 4 The diagram below shows the transmission of network messages on a network link. DETAILED DESCRIPTION
[0032] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.
[0033] It should be noted that the terms "first", "second", etc. in the specification, claims and drawings of the present invention are used to distinguish different objects rather than to limit a specific order.
[0034] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0035] As mentioned above, during the process of network transmission, messages are prone to errors due to some abnormal factors. At this time, the value of one or more information bits in the message will be reversed, for example, from 0 to 1, or from 1 to 0. After research, the applicant found that for a specific network link, since the factors causing the abnormality are certain (such as chip failure, high-energy particle effects in space, sunspot activity, voltage anomalies, etc.), the message changes often have fixed characteristics. For example, due to a chip failure, when forwarding a message, one or several information bits of the message always change from 1 to 0. On this basis, the present application proposes a network message transmission error detection method to solve the above-mentioned problem of task abnormality caused by the difficulty in detecting message transmission error failures.
[0036] Figure 1 A method for detecting network message transmission errors according to an embodiment of the present invention is as follows. Figure 1 As shown, the method includes the following steps:
[0037] Step S102, receiving a detection command for a target link;
[0038] Step S104, in response to the detection command, sending a first message and a second message to the destination node via the target link, wherein the values of at least some information bits of the first message correspond to the values of corresponding information bits of the second message;
[0039] Step S106: receiving a third message and a fourth message returned by the destination node, wherein the third message is the first message received by the destination node, and the fourth message is the second message received by the destination node;
[0040] Step S108, determining whether the third message is the same as the first message, and determining whether the fourth message is the same as the second message;
[0041] Step S110: When the third message is different from the first message and / or the fourth message is different from the second message, it is determined that a message transmission error fault exists on the target link.
[0042] The network message transmission error detection method using this technical solution, after receiving a detection command for a target link, will send a first message and a second message to the destination node via the target link. For example, the first message and the second message are sent to the destination node in sequence. After the destination node receives the first message and the second message, it will return a third message and a fourth message accordingly. The third message is the first message received by the destination node, that is, the content received by the destination node for the first message, and the fourth message is the second message received by the destination node, that is, the content received by the destination node for the second message. By determining whether the third message is the same as the first message and whether the fourth message is the same as the second message, it can be determined whether there is a message transmission error fault on the target link. When the third message is different from the first message and / or the fourth message is different from the second message, it indicates that there is a message transmission error fault on the target link. The values of at least some information bits of the first message have a corresponding relationship with the values of corresponding information bits of the second message. For any information bit, its value has two options. The so-called corresponding relationship means that the values of the corresponding information bits of the first message and the second message are different. For example, if the value of a certain information bit in the first message is a first value, then the value of the corresponding information bit in the second message is a second value. In this way, regardless of whether the change characteristic of any information bit in this portion of information bits changes from the first value to the second value or from the second value to the first value when the message passes through the target link, the change can be captured and retained in the third message and / or the fourth message. Furthermore, by comparing the information bits with the first and second messages, it can be accurately determined whether a message transmission error fault occurred during the message transmission process on the target link. This facilitates the detection of transmission error faults during network message transmission, resolving the problem in related technologies where task abnormalities are caused by the difficulty in detecting message transmission error faults.
[0043] When determining whether a target link has a message transmission error, if the detection is performed only by sending and returning a message for comparison, the value of each information bit of the sent message is fixed. If the value of a certain information bit is the same as the value that changes according to the changing characteristics of the target link, the message will not change, and ultimately the target link transmission error failure cannot be detected. For example, due to a failure of a network device in the target link, it will change the second bit of the message information bit from the first value to the second value when forwarding the message. If the second bit of the message information bit of the sent message happens to be the second value, the message will not change when passing through the network device, and the target link message transmission error failure cannot be detected. However, when using the network message transmission error detection method of the embodiment of the present application, since there is a correspondence between the values of at least part of the information bits of the first message and the second message sent during the detection process, when the first message and the second message are forwarded through the network device, no matter whether the change characteristic of the value of the information bit changes from the first value to the second value, or from the second value to the first value, it will be recorded by one of the first message or the second message, so that it can be determined whether there is a message transmission error failure on the target link in the subsequent comparison process.
[0044] In a specific implementation, the target link can be the link between the sender of the first and second messages and the destination node. The target link can also be a longer link that includes the link between the sender of the first and second messages and the destination node. The target link may or may not have other intermediate devices. When comparing the third message with the first message, if the third message is different from the first message, it indicates that an error occurred during the transmission of the message between the sender and the destination node. Similarly, when comparing the fourth message with the second message, if the fourth message is different from the second message, it also indicates that an error occurred during the transmission of the message between the sender and the destination node. The third message being different from the first message means that the two messages are partially or completely different. Similarly, the fourth message being different from the second message means that the two messages are partially or completely different. The aforementioned end for sending the first and second messages is the source end, which can be any node with message sending, receiving, and comparison functions. The destination node is the destination end of the message, which can be any node with message sending and receiving functions. The information bit is the payload of the message.
[0045] In one specific embodiment, the sum of the values of at least some of the information bits of the first message and the values of the corresponding information bits of the second message is 1. In this case, the values of at least some of the information bits of the first message and the second message are symmetrical: for an information bit that is 1 in the first message, the corresponding information bit in the second message is 0. Similarly, for an information bit that is 0 in the first message, the corresponding information bit in the second message is 1. In actual implementation, the specific payload content of the first message and the second message can take various forms, as long as the combination of the two ensures that at least some of the information bits of the message include both 0 and 1 values.
[0046] For example, in an optional implementation, the first half of the information bits of the first message are 0, and the second half of the information bits are 1. Correspondingly, the first half of the information bits of the second message are 1, and the second half of the information bits are 0.
[0047] In a preferred embodiment, the information bits of the first message are all 0, and the information bits of the second message are all 1; or, the information bits of the first message are all 1, and the information bits of the second message are all 0. That is, in this embodiment, the information bits of the first message and the second message are all 0 or all 1. In this way, when the value of a certain bit changes, it can be more easily captured and detected, thereby reducing the possibility of missing network message transmission errors and improving the accuracy of network message transmission error detection. Moreover, this setting method can detect transmission errors with fixed change forms but random change positions. For example, during the process of transmitting a message on the target link, the change characteristic of the message is that the value of one or more random information bits changes from 1 to 0. In this case, when sending a message with all information bit values 1, the error will be captured, so that the transmission error fault can be detected later.
[0048] In this embodiment, the first message and the second message are both User Datagram Protocol (UDP) messages, and both the first message and the second message include an Internet Protocol (IP) header and a UDP header. The IP header includes a source IP and a destination IP. The source is the node that sends the first message and the second message, and the destination is the destination node. The UDP header includes a destination port number, which is the port number used by the destination to receive the first message and the second message. Since the first message and the second message also include an IP header and a UDP header, when analyzing the third message and the fourth message returned by the destination node, the IP header and the UDP header can be included in the detection range. When one or more bits of the IP header and / or the UDP header change during the transmission of the message on the target link, these can also be successfully detected, thereby making the message transmission error detection more comprehensive.
[0049] In a preferred embodiment, the destination port number is an unenabled port number of the destination end. In this embodiment, the destination node is a server, and the destination port numbers of the first message and the second message are set to unenabled port numbers of the destination end, i.e., idle ports. In this way, after the first message and the second message are sent to the destination node, since the destination port number is configured as an unenabled port, the port is unreachable at this time, and the destination node will default to returning an ICMP message indicating that the target is unreachable. This ICMP message is located under the subclass Code: 3 (Port unreachable) of the major class Type: 3 (Destination unreachable). Among them, the ICMP message is a message under the Internet Control Message Protocol (ICMP), which is a subprotocol of the TCP / IP protocol suite and is used to transmit control messages between IP hosts and routers. The returned message will carry all the contents of the message received by the destination node. Therefore, after the first message arrives at the destination node, the server will receive the message and send it back to the source end as the third message. After the second message reaches the destination node, the server receives it and sends it back to the source as the fourth message. By configuring the destination port numbers for the first and second messages, the third and fourth messages can be easily fed back without requiring additional configuration at the destination node, effectively facilitating network message transmission error detection.
[0050] In this embodiment, in response to the detection command, sending the first message and the second message to the destination node includes: bypassing the protocol stack of the source end and sending the first message and the second message to the destination node; wherein, the value of the checksum field of the UDP header of the first message and / or the second message is 0; and / or, receiving the third message and the fourth message returned by the destination node includes: bypassing the protocol stack of the source end and receiving the third message and the fourth message.
[0051] By setting the checksum field value of the UDP header of the first message and / or the second message to 0, when the destination node receives the first message and / or the second message with a checksum of 0, it will not check the message content, but will directly return the third message and / or the fourth message. This can prevent the first message and / or the second message from changing due to a change in one or more bits during transmission on the target link, thereby causing the destination node to not respond to them. This ensures that the destination node reliably returns the third message and / or the fourth message, thereby ensuring the smooth implementation of network message transmission error detection.
[0052] Since the value of the checksum field of the UDP header of the first message and / or the second message is set to 0, and in the process of sending the message, if it is processed by the protocol stack, the checksum will be recalculated, and the checksum may change at this time. In order to ensure that the value of the checksum field of the UDP header is 0, the first message and the second message are sent to the destination node by bypassing the protocol stack to ensure that the checksums of both are 0. In the process of receiving the third message and the fourth message, the third message and the fourth message may also change in the process of being returned by the destination node, so their checksums may also change. At this time, the message may be ignored when the source end protocol stack is used for processing, resulting in the failure to successfully receive the third message and the fourth message. Therefore, in order to ensure that the source end can successfully receive the third message and the fourth message, the protocol stack will be bypassed to receive the third message and the fourth message.
[0053] In specific implementations, the methods for determining whether the third message is identical to the first message, and determining whether the fourth message is identical to the second message, can be flexibly selected:
[0054] In an optional embodiment, determining whether the third message is the same as the first message includes: comparing the third message with the pre-stored first message to determine whether the third message is the same as the first message; determining whether the fourth message is the same as the second message includes: comparing the fourth message with the pre-stored second message to determine whether the fourth message is the same as the second message.
[0055] In another optional embodiment, determining whether the third message is the same as the first message includes: comparing the calculated MD5 value of the third message with the MD5 value of the first message to determine whether the third message is the same as the first message; determining whether the fourth message is the same as the second message includes: comparing the calculated MD5 value of the fourth message with the MD5 value of the second message to determine whether the fourth message is the same as the second message.
[0056] Among them, in the scheme of determining whether the messages are the same by comparing the MD5 values, there can also be different implementation methods. Taking the comparison of whether the first message and the third message are the same as an example, in one optional implementation, the MD5 values of the first message and the second message can be stored in a target location, and the MD5 values are obtained from the target location when the message comparison is required; in another optional implementation, the first message carries its own MD5 value, and similarly, the third message also carries the MD5 value of the first message. By extracting the MD5 value of the first message carried in the third message and comparing it with the MD5 value calculated for the third message, it can be determined whether the first message and the third message are the same. Among them, MD5 is Message Digest Algorithm 5 (Message-digest Algorithm 5 in English), which is used to ensure the integrity and consistency of information transmission.
[0057] like Figure 4 As shown, in this embodiment, when a message is sent from the source end to the destination node, it will be forwarded by multiple network devices. When the above-mentioned network message transmission error detection method is used to detect that a message transmission error fault exists in the target link, the source of the error may be any network device in the target link. The specific forms of the network devices can be various, such as network cards, switches, routers, firewalls, gateways, etc. On this basis, in order to locate the source of the error, in this embodiment, when the target link includes multiple network devices connected in series, and the network devices are used to forward messages on the target link; after determining that a message transmission error fault exists in the target link, the network message transmission error detection method also includes: sending the first message and / or the second message to the destination node again through the target link, wherein, when the third message is different from the first message, the first message is sent to the destination node, and when the fourth message is different from the second message, the second message is sent to the destination node, and the survival time value in the IP header of the first message and / or the IP header of the second message is n, wherein n is a preset value less than or equal to m, where m is the total number of network devices; receiving the fifth message and / or the sixth message returned by the target network device, where the target network device is the nth network device in the sending direction of the first message and / or the second message, the fifth message is the first message received by the target network device, i.e., the reception content of the first message by the target network device, and the sixth message is the second message received by the target network device, i.e., the reception content of the second message by the target network device; determining whether the sent message is the same as the message returned by the target network device; and if the sent message is different from the message returned by the target network device, determining that the message transmission error failure occurs on the link before the target network device.
[0058] In the event of a message transmission error on the target link, both the first message and the second message may generate errors during transmission on the target link, such as changes in one or more information bits. If an error occurs during transmission of the first message on the target link, the first message will be sent to the destination node. If an error occurs during transmission of the second message on the target link, the second message will be sent to the destination node. If both errors occur, the first message and the second message may be sent to the destination node. By setting the lifetime value of the sent message to n, the lifetime value of the message will be reduced by 1 each time it passes through a network device during transmission on the target link. When it reaches the nth network device, the lifetime value is reduced to 0. At this time, the nth network device (i.e., the target network device) will respond to the received first message and / or second message and return the fifth message and / or sixth message to the source end. For example, if the time-to-live value of a message is 0, the target network device will default to returning an ICMP message of the subclass Code: 0 (Time to live exceeded in transit) under the major class Type: 11 (Time-to-live exceeded). This message will carry the entire content of the message received by the target network device. By comparing the sent message with the returned message to see if they are identical, specifically, comparing whether the fifth message is identical to the first message and / or whether the sixth message is identical to the second message, it can be determined whether a message change has occurred on the link before the target network device. If the fifth message is different from the first message, it indicates that a transmission error occurred when the first message was transmitted on the link before the target network device. Similarly, if the sixth message is different from the second message, it indicates that a transmission error occurred when the second message was transmitted on the link before the target network device. This allows the scope of the message transmission error to be narrowed down to a specific link segment, facilitating troubleshooting. In actual implementation, the value of n can be flexibly set based on demand. Depending on the value of n, it is possible to determine whether links between different network devices have errors, thereby facilitating troubleshooting of message transmission errors. The message's time-to-live value, also known as the TimeToLive value (TTL value), is a preset value in the message's IP header and can be assigned a value during message transmission.
[0059] In this embodiment, when the sent message is the same as the message returned by the target network device, it means that no message transmission error failure has occurred on the link before this target network device, but since a message transmission error failure exists on the entire link, in order to further find out the root cause of the failure, in this embodiment, the network message transmission error detection method includes: increasing the value of n in the first message and / or the second message, and the increase in the value of n can be flexibly selected according to actual troubleshooting needs, for example, adding 1 each time, adding 5 each time, etc., and then sending the first message and / or the second message again, and receiving the message returned by the target network device until the sent message is different from the returned message; determining that the message transmission error failure occurs on the link before the target network device. By increasing the value of n, the target network device can be replaced with a network device further back in the link, and troubleshooting can be performed on the link before it. When n reaches a certain value, the message sent is different from the message returned, indicating that a message transmission error has occurred in the link before the nth network device. However, since there was no fault when n was last assigned a value, it can be further determined that the message transmission error occurred between the current target network device and the network device corresponding to the previous value of n. In a preferred embodiment, messages are sent and received cyclically in the order in which n is reached from small to large, so that it can be determined in turn along the target link whether a message transmission error has occurred before each network device, thereby conveniently finding the network device with the fault. For example, in a specific implementation, if troubleshooting is performed from the first network device, n can be increased starting from 1. When an error message is sent for the first time, n is set to 1, and when an error message is sent for the second time, n is set to 2, and so on, to implement troubleshooting for subsequent network devices.
[0060] In actual implementation, the network message transmission error detection method of the embodiment of the present invention can be implemented by any host in the network, such as Figure 3As shown, in an optional embodiment, the controller software runs on any host in the network, and the radar detector software runs on any one or more hosts in the network. It is a server for actively initiating detection of whether there is a data message jump (the value of one or more information bits changes) in the target link. The controller sends a task to the radar detector (or referred to as the detector). After receiving the task, the detector will start the message tampering scanning task. This task is used to determine whether a message transmission error occurs during the transmission of the target link. When this task is executed, the message transmission error detection method in steps S102 to S110 will be implemented to detect whether the message has been tampered with during the transmission of the target network link (i.e., whether the message has changed). If the message has not been tampered with, the above-mentioned scanning task will be repeated. At this time, the host to which the radar detector belongs is the source end. If the message has been tampered with, the detector will start the positioning task. When the positioning task is executed, the above-mentioned fault location steps will be implemented to locate which network device the fault occurred in. After the location is successful, an alarm information will be sent to the outside to facilitate network operation and maintenance personnel to repair the fault.
[0061] Secondly, if Figure 2As shown, an embodiment of the present invention also provides a network message transmission error detection device, including: a first receiving unit, used to receive a detection command for a target link; a first sending unit, used to send a first message and a second message to a destination node through the target link in response to the detection command, wherein the value of at least part of the information bits of the first message has a corresponding relationship with the value of the corresponding information bit of the second message; a second receiving unit, used to receive a third message and a fourth message returned by the destination node, the third message is the first message received by the destination node, and the fourth message is the second message received by the destination node; a first determining unit, used to determine whether the third message is the same as the first message, and whether the fourth message is the same as the second message; a second determining unit, used to determine that a message transmission error fault exists in the target link when the third message is different from the first message and / or the fourth message is different from the second message. In a network message transmission error detection device using this setting method, after the first receiving unit receives the detection command for the target link, the first sending unit will send the first message and the second message to the destination node through the target link. For example, the first message and the second message will be sent to the destination node in sequence. After the destination node receives the first message and the second message, it will return the third message and the fourth message accordingly, wherein the third message is the content received by the destination node for the first message, and the fourth message is the content received by the destination node for the second message. After the third message and the fourth message are received by the second receiving unit, the first determination unit is used to determine whether the third message is the same as the first message, and whether the fourth message is the same as the second message. Based on the determination results, the second determination unit can be used to determine whether there is a message transmission error fault in the target link. When the third message is different from the first message and / or the fourth message is different from the second message, it indicates that there is a message transmission error fault in the target link. The values of at least some of the information bits of the first message correspond to the values of corresponding information bits of the second message. For any information bit, there are two possible values. The existence of a corresponding relationship means that the values of the corresponding information bits of the first message and the second message are different. For example, if the value of a certain information bit of the first message is a first value, then the value of the corresponding information bit of the second message is a second value. In this way, regardless of whether the change characteristic of any information bit in this portion of information bits changes from the first value to the second value or from the second value to the first value when the message passes through the target link, the change can be captured and retained in the third message and / or the fourth message. Furthermore, by comparing the values with the first message and the second message, it can be accurately determined whether a message transmission error fault occurred during the message transmission process on the target link. This facilitates transmission error fault detection during network message transmission, resolving the problem in related technologies where task anomalies are caused by the difficulty in detecting message transmission error faults.
[0062] In this embodiment, the sum of the values of at least part of the information bits of the first message and the values of the corresponding information bits of the second message is 1;
[0063] In a preferred embodiment, the values of the information bits of the first message are all 0, and the values of the information bits of the second message are all 1; or the values of the information bits of the first message are all 1, and the values of the information bits of the second message are all 0;
[0064] The first message and the second message are both User Datagram Protocol (UDP) messages, and both the first message and the second message include an Internet Protocol (IP) header and a UDP header. The IP header includes a source IP address and a destination IP address. The source is a node that sends the first message and the second message, and the destination is a destination node. The UDP header includes a destination port number, which is a port number used by the destination to receive the first message and the second message.
[0065] The destination port number is not enabled on the destination end;
[0066] The first sending unit is configured to: bypass the protocol stack of the source end and send the first message and the second message to the destination node; wherein the value of the checksum field in the UDP header of the first message and / or the second message is 0; and / or the second receiving unit is configured to: bypass the protocol stack of the source end and receive the third message and the fourth message;
[0067] The first determining unit is configured to: compare the third message with the pre-stored first message to determine whether the third message is identical to the first message, and compare the fourth message with the pre-stored second message to determine whether the fourth message is identical to the second message; or compare the calculated MD5 value of the third message with the MD5 value of the first message to determine whether the third message is identical to the first message, and compare the calculated MD5 value of the fourth message with the MD5 value of the second message to determine whether the fourth message is identical to the second message;
[0068] In a case where a target link includes a plurality of network devices connected in series, and the network devices are used to forward messages on the target link; after determining that a message transmission error fault exists on the target link, the network message transmission error detection method includes: resending a first message and / or a second message to a destination node via the target link, wherein, if a third message is different from the first message, the first message is sent to the destination node, and if a fourth message is different from the second message, the second message is sent to the destination node, and a time-to-live value in an IP header of the first message and / or an IP header of the second message is n, wherein n is a preset value less than or equal to m, and m is the total number of network devices; receiving a fifth message and / or a sixth message returned by a target network device, where the target network device is the nth network device in the direction in which the first message and / or the second message is sent, the fifth message being the first message received by the target network device, and the sixth message being the second message received by the target network device; determining whether the sent message is identical to the message returned by the target network device; and if the sent message is different from the message returned by the target network device, determining that the message transmission error fault occurs on a link before the target network device;
[0069] In the case where a sent message is identical to a message returned by a target network device, the network message transmission error detection method includes: after increasing the value of n in the first message and / or the second message, sending the first message and / or the second message again, and receiving the message returned by the target network device until the sent message is different from the message returned by the target network device; and determining that the message transmission error failure occurs on the link before the target network device.
[0070] In addition, an embodiment of the present invention further provides a readable storage medium having computer instructions stored thereon, wherein the computer instructions implement the above-mentioned network message transmission error detection method when executed by a processor.
[0071] Again, an embodiment of the present invention further provides a network message transmission error detection device, comprising a memory and a processor, wherein the memory stores computer instructions, wherein the computer instructions implement the above-mentioned network message transmission error detection method when executed by the processor.
[0072] Finally, an embodiment of the present invention further provides a computer program, wherein the computer program implements the above-mentioned network message transmission error detection method when executed by a processor.
[0073] The serial numbers of the embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments. Moreover, the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system, such as a set of computer-executable instructions, and although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be performed in a different order than shown here.
[0074] In the above embodiments of the present invention, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0075] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only exemplary. For example, the division of the units can be a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0076] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0077] In addition, the functional units in the various embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0078] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program code.
[0079] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as within the scope of protection of the present invention.
Claims
1. A method for detecting network message transmission errors, comprising: receiving a detection command for a target link; In response to the detection command, sending a first message and a second message to the destination node through the target link, wherein values of at least some information bits of the first message correspond to values of corresponding information bits of the second message; receiving a third message and a fourth message returned by the destination node, wherein the third message is the first message received by the destination node, and the fourth message is the second message received by the destination node; Determining whether the third message is identical to the first message, and determining whether the fourth message is identical to the second message; In a case where the third message is different from the first message and / or the fourth message is different from the second message, it is determined that a message transmission error fault exists on the target link.
2. The method for detecting network message transmission errors according to claim 1, wherein: The sum of the values of at least part of the information bits of the first message and the values of the corresponding information bits of the second message is 1.
3. The method for detecting network message transmission errors according to claim 1, wherein: The values of the information bits of the first message are all 0, and the values of the information bits of the second message are all 1; or the values of the information bits of the first message are all 1, and the values of the information bits of the second message are all 0.
4. The method for detecting network message transmission errors according to claim 1, wherein: The first message and the second message are both User Datagram Protocol UDP messages, and the first message and the second message both include an Internet Protocol IP header and a UDP header, the IP header includes a source IP and a destination IP, the source is the node that sends the first message and the second message, the destination is the destination node, and the UDP header includes a destination port number, which is the port number used by the destination to receive the first message and the second message.
5. The method for detecting network message transmission errors according to claim 4, wherein: The destination port number is a port number that is not enabled on the destination end.
6. The method for detecting network message transmission errors according to claim 4, wherein: Sending the first message and the second message to the destination node includes: bypassing the protocol stack of the source end and sending the first message and the second message to the destination node; wherein the value of the checksum field of the UDP header of the first message and / or the second message is 0; and / or, Receiving the third message and the fourth message returned by the destination node includes: bypassing the protocol stack of the source end and receiving the third message and the fourth message.
7. The network message transmission error detection method according to any one of claims 1 to 6, wherein: In the case where the target link includes a plurality of network devices connected in series, and the network devices are used to forward messages on the target link; After determining that a message transmission error fault exists on the target link, the method further includes: Resending the first message and / or the second message to the destination node through the target link, wherein, if the third message is different from the first message, the first message is sent to the destination node, and if the fourth message is different from the second message, the second message is sent to the destination node, and the time to live value in the IP header of the first message and / or the IP header of the second message is n, where n is a preset value less than or equal to m, and m is the total number of the network devices; receiving a fifth message and / or a sixth message returned by a target network device, wherein the target network device is the nth network device in the sending direction of the first message and / or the second message, the fifth message is the first message received by the target network device, and the sixth message is the second message received by the target network device; Determining whether the sent message is identical to the message returned by the target network device; In a case where the sent message is different from the message returned by the target network device, it is determined that the message transmission error failure occurs on a link before the target network device.
8. The method for detecting network message transmission errors according to claim 7, wherein: In the case where the sent message is identical to the message returned by the target network device, the method includes: After increasing the value of n in the first message and / or the second message, sending the first message and / or the second message again, and receiving a message returned by the target network device until the sent message is different from the message returned by the target network device; It is determined that the message transmission error failure occurs on a link before the target network device.
9. A network message transmission error detection device, comprising: A first receiving unit, configured to receive a detection command for a target link; a first sending unit, configured to send, in response to the detection command, a first message and a second message to the destination node through the target link, wherein values of at least some information bits of the first message correspond to values of corresponding information bits of the second message; a second receiving unit, configured to receive a third message and a fourth message returned by the destination node, wherein the third message is the first message received by the destination node, and the fourth message is the second message received by the destination node; a first determining unit, configured to determine whether the third message is identical to the first message, and determine whether the fourth message is identical to the second message; The second determining unit is configured to determine that a message transmission error fault exists on the target link when the third message is different from the first message and / or the fourth message is different from the second message.
10. The network message transmission error detection device according to claim 9, wherein: The sum of the values of at least part of the information bits of the first message and the values of the corresponding information bits of the second message is 1; The information bits of the first message have values of 0, and the information bits of the second message have values of 1; Alternatively, the values of the information bits of the first message are all 1, and the values of the information bits of the second message are all 0; The first message and the second message are both User Datagram Protocol (UDP) messages, and both include an Internet Protocol (IP) header and a UDP header. The IP header includes a source IP address and a destination IP address. The source is a node that sends the first message and the second message, and the destination is the destination node. The UDP header includes a destination port number, which is a port number used by the destination to receive the first message and the second message. The destination port number is a port number that is not enabled on the destination end; The first sending unit is configured to: bypass the protocol stack of the source end and send the first message and the second message to the destination node; wherein the value of the checksum field of the UDP header of the first message and / or the second message is 0; and / or the second receiving unit is configured to: bypass the protocol stack of the source end and receive the third message and the fourth message; In the case where the target link includes multiple network devices connected in series, and the network devices are used to forward messages on the target link; the network message transmission error detection device includes: a second sending unit, which is used to send the first message and / or the second message again to the destination node through the target link after determining that there is a message transmission error failure on the target link, wherein, in the case that the third message is different from the first message, the first message is sent to the destination node, and in the case that the fourth message is different from the second message, the second message is sent to the destination node, and the survival time value in the IP header of the first message and / or the IP header of the second message is n, wherein n is a preset value less than or equal to m, where m is the total number of the network devices; a third receiving unit, configured to receive a fifth message and / or a sixth message returned by a target network device, wherein the target network device is the nth network device in the sending direction of the first message and / or the second message, the fifth message is the first message received by the target network device, and the sixth message is the second message received by the target network device; a third determining unit, configured to determine whether a sent message is the same as a message returned by the target network device; a fourth determining unit, configured to determine that the message transmission error fault occurs on a link before the target network device when the sent message is different from the message returned by the target network device; The network message transmission error detection device is also used to: when the sent message is the same as the message returned by the target network device, increase the value of n in the first message and / or the second message, send the first message and / or the second message again, and receive the message returned by the target network device until the sent message is different from the returned message; determine that the message transmission error failure occurs on the link before the target network device.
11. A readable storage medium having computer instructions stored thereon, wherein: When the computer instructions are executed by a processor, the network message transmission error detection method according to any one of claims 1 to 8 is implemented.
12. A network message transmission error detection device, comprising a memory and a processor, wherein the memory stores computer instructions, wherein: When the computer instructions are executed by the processor, the network message transmission error detection method according to any one of claims 1 to 8 is implemented.
13. A computer program product comprising a computer program, wherein When the computer program is executed by a processor, the network message transmission error detection method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Network topology detection method as well as device, base station controller and node thereof
CN101572900A
Rapid fault detection method based on ICMP message
CN106559288A