Communication method and device
By carrying the identification and retransmission number in the CAPWAP header, the receiver can evaluate the link quality and automatically trigger the detection, solving the problem of additional network detection increasing burden and evaluation deviation, and achieving efficient link quality evaluation and fault analysis.
Patent Information
- Application Number
- CN202510256199.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-05
- Publication Date
- 2025-06-27
AI Technical Summary
Additional network detection increases network burden and cannot fully represent the current network link quality, resulting in bias in evaluation.
By carrying the identifier and the current number of retransmissions in the CAPWAP header, the receiver evaluates the link quality based on the current number of retryes, and automatically triggers further link detection in the case of poor link quality.
Without adding additional message overhead, this method provides a basis for fault analysis, reduces operation and maintenance difficulties, improves operation and maintenance efficiency, and solves the problems of increasing burden and evaluation deviations in network detection.
Smart Images

Figure CN120223246A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technologies, and in particular, to a communication method and apparatus. Background Art
[0002] With the increasing popularity of the use of Wireless Local Area Network (Wireless LAN, abbreviated as WLAN), wireless technologies have also become increasingly mature.
[0003] An Access Point (AP) and an Access Controller (AC) establish a CAPWAP tunnel through the Controlling and Provisioning of Wireless Access Point (CAPWAP) protocol to complete the registration and online of the AP to the AC.
[0004] The CAPWAP protocol is a tunnel protocol based on the User Datagram Protocol (UDP). Due to the unreliable transmission of the UDP protocol itself, after transmitting the CAPWAP request message through the CAPWAP tunnel, it is necessary to confirm through the CAPWAP response message, thereby improving the reliability of the CAPWAP tunnel.
[0005] The foregoing CAPWAP request message and CAPWAP response message complete the pairing function by carrying the "Seq Num" value in the "CAPWAP control header", and the "Seq Num" value is monotonically increasing. When the sending end does not receive the CAPWAP response message, it will attempt to resend the CAPWAP request message again. When the receiving end receives the CAPWAP request message carrying the "Seq Num" value, it will directly reply with the CAPWAP response message with the same "Seq Num" value.
[0006] For the scenario where the network link quality is poor and packet loss occurs, the receiving end only obtains the "Seq Num" value through the CAPWAP response message, but cannot know the retransmission times of the sending end, nor can it evaluate the network link quality. Therefore, in order to evaluate the network link quality, the sending end / receiving end needs to perform additional network detection regularly. For example, ping detection is used to evaluate the network link quality through information such as delay and packet loss times.
[0007] However, the additional network detection will increase the network burden and does not fully represent the current network link quality, and there are deviations in the evaluation. Summary of the Invention
[0008] In view of this, the present application provides a communication method and apparatus, which are used to solve the problems that additional network detection will increase the network burden and cannot fully represent the current network link quality, resulting in deviation in evaluation.
[0009] In a first aspect, the present application provides a communication method, which is applied to a sending end, and the method includes:
[0010] Sending a first message to a receiving end, where the first message includes a first sequence number;
[0011] Within a preset time, determining whether a second message sent by the receiving end according to the first message is received;
[0012] If the second message is not received within the preset time, sending a third message to the receiving end again, where the third message includes the first sequence number, a first identifier, and a first retransmission count, so that after receiving the third message, the receiving end determines, according to the first identifier, that the third message is a retransmission message of the first message, stores the first retransmission count in a first mapping relation entry that matches the first sequence number, and sends a fourth message corresponding to the third message to the sending end, where the fourth message includes the first sequence number.
[0013] In a second aspect, the present application provides a communication method, which is applied to a receiving end, and the method includes:
[0014] Receiving a first message sent by a sending end, where the first message includes a first sequence number, a first identifier, and a first retransmission count;
[0015] If the first identifier is a first value, determining that the first message is a retransmission message and storing the first retransmission count locally;
[0016] Sending a second message to the sending end, where the second message includes the first sequence number;
[0017] Wherein, the first message is sent after the sending end does not receive a message sent by the receiving end.
[0018] In a third aspect, the present application provides a communication apparatus, which is applied to a sending end, and the apparatus includes:
[0019] A sending unit, configured to send a first message to a receiving end, where the first message includes a first sequence number;
[0020] A first determination unit, configured to determine, within a preset time, whether a second message sent by the receiving end according to the first message is received;
[0021] The sending unit is further configured to, if the second message is not received within the preset time, send a third message to the receiving end again, where the third message includes the first sequence number, the first identifier, and the first retransmission count, so that after receiving the third message, the receiving end determines, according to the first identifier, that the third message is a retransmission message of the first message, stores the first retransmission count in the first mapping relation entry that matches the first sequence number, and sends a fourth message corresponding to the third message to the sending end, where the fourth message includes the first sequence number.
[0022] Fourthly, the present application provides a communication device, which is applied to a receiving end, and the device includes:
[0023] a receiving unit, configured to receive a first message sent by a sending end, where the first message includes a first sequence number, a first identifier, and a first retransmission count;
[0024] a first determining unit, configured to determine that if the first identifier is a first value, determine that the first message is a retransmission message, and store the first retransmission count locally;
[0025] a sending unit, configured to send a second message to the sending end, where the second message includes the first sequence number;
[0026] wherein, the first message is sent after the sending end does not receive the message sent by the receiving end.
[0027] Fifthly, the present application provides a network device, including a processor and a machine-readable storage medium, where the machine-readable storage medium stores machine-executable instructions that can be executed by the processor, and the processor is caused by the machine-executable instructions to execute the method provided in the first aspect of the present application.
[0028] Sixthly, the present application provides a network device, including a processor and a machine-readable storage medium, where the machine-readable storage medium stores machine-executable instructions that can be executed by the processor, and the processor is caused by the machine-executable instructions to execute the method provided in the second aspect of the present application.
[0029] Therefore, by applying the communication method and device provided in this application, the sending end sends a first message to the receiving end, and the first message includes a first sequence number; within a preset time, the sending end determines whether it has received a second message sent by the receiving end according to the first message; if the second message is not received within the preset time, the sending end sends a third message to the receiving end again, and the third message includes the first sequence number, a first identifier, and a first retransmission count, so that after receiving the third message, the receiving end determines, according to the first identifier, that the third message is a retransmission message of the first message, stores the first retransmission count in a first mapping table entry that matches the first sequence number, and sends a fourth message corresponding to the third message to the sending end, and the fourth message includes the first sequence number.
[0030] In this way, by carrying an identifier and the current retransmission count in the CAPWAP header, the receiving end can evaluate the link quality of the link with the sending end according to the current retry count, and automatically trigger further link detection in the case of poor link quality. The above process not only does not require additional message overhead, but also can provide a basis for fault analysis, reduce the operation and maintenance difficulty, and improve the operation and maintenance efficiency. At the same time, it also solves the problems that additional network detection will increase the network burden, and additional network detection cannot fully represent the current network link quality and there is a deviation in the evaluation. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 It is a flowchart of a communication method provided by an embodiment of this application;
[0032] Figure 2 It is a schematic diagram of the format of the CAPWAP header provided by an embodiment of this application;
[0033] Figure 3 It is a flowchart of another communication method provided by an embodiment of this application;
[0034] Figure 4 It is a signaling diagram of the interactive communication between the sending end and the receiving end provided by an embodiment of this application;
[0035] Figure 5 It is a structural diagram of a communication device provided by an embodiment of this application;
[0036] Figure 6 It is a structural diagram of another communication device provided by an embodiment of this application;
[0037] Figure 7 It is a hardware structure of a network device provided by an embodiment of this application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0038] Exemplary embodiments will be described in detail herein, and examples thereof are shown in the accompanying drawings. When the following description refers to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. On the contrary, they are merely examples of apparatuses and methods consistent with some aspects of the present application as detailed in the appended claims.
[0039] The terms used in the present application are for the purpose of describing specific embodiments only and are not intended to limit the present application. The singular forms "a", "said", and "the" used in the present application and the appended claims are also intended to include the plural forms unless the context clearly dictates otherwise. It should also be understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
[0040] It should be understood that although the terms first, second, third, etc. may be used in the present application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "when" or "while" or "in response to determining".
[0041] The communication method provided by the embodiments of the present application will be described in detail below. Refer to Figure 1 , Figure 1 which is a flowchart of a communication method provided by an embodiment of the present application. This method is applied to the sending end. The communication method provided by the embodiments of the present application may include the following steps.
[0042] Step 110: Send a first message to the receiving end, where the first message includes a first sequence number;
[0043] Specifically, a CAPWAP tunnel has been established between the sending end and the receiving end, and communication interactions are carried out through the CAPWAP tunnel. Among them, the sending end may be an AP, and the receiving end may be an AC; or, the sending end may be an AC, and the receiving end may be an AP. The messages exchanged between the two ends are all CAPWAP messages, and subsequent descriptions will be made in terms of messages.
[0044] When the sending end desires to send a message to the receiving end, the sending end generates and sends a first message to the receiving end, and the first message includes a first sequence number. When the sending end sends the first message to the receiving end, the first message may specifically be a CAPWAP Request message.
[0045] Optionally, the first message further includes a second identifier (distinguished from other identifiers by "second", which can also be "first", "third", etc. in practical applications) and a second retransmission count (distinguished from other retransmission counts by "second", which can also be "first", "third", etc. in practical applications). Among them, the value of the second identifier and the second retransmission count are set according to whether the first message is the first message corresponding to the first sequence number or a retransmitted message.
[0046] Further, when the first message is a non-first message corresponding to the first sequence number (i.e., a retransmitted message), the second identifier is a first value (for example, the first value is 1), and the second retransmission count is a third value (the third value is determined according to the retransmission count, and the maximum value is 3; for retransmission counts exceeding 3 times, it can be filled in according to 3 times first); when the first message is the first message corresponding to the first sequence number, the second identifier is a second value (for example, the second value is 0), and the second retransmission count is empty.
[0047] For example, the first sequence number is 1, and the first message is the first message corresponding to the first sequence number. At this time, the value of the second identifier is 0, and the second retransmission count is empty; the first sequence number is 1, and the first message is a non-first message corresponding to the first sequence number, that is, the sending end retransmits the first message with the sequence number 1. At this time, the value of the second identifier is 1, and the second retransmission count is 1, that is, the current is the first retransmission. Similarly, the value of the second identifier is 1, and the second retransmission count is 2, that is, the current is the second retransmission; the value of the second identifier is 1, and the second retransmission count is 3, that is, the current is the third retransmission.
[0048] In the embodiments of the present application, the maximum value of the retransmission count can also be set. For example, the maximum retransmission is set to 3 times. Of course, according to the actual networking situation, the maximum value of the retransmission count can also be set. For example, the maximum retransmission is set to 5 times, 8 times, 10 times, etc.
[0049] Optionally, in the embodiments of the present application, the first message includes a CAPWAP control (Control) header (Header), and the CAPWAP control header includes a sequence number field for carrying the first sequence number.
[0050] Optionally, in the embodiments of the present application, the first message further includes a CAPWAP header, and the CAPWAP header includes an R field and an RN field. As Figure 2 shown, Figure 2 is a schematic diagram of the format of the CAPWAP header provided by the embodiments of the present application. Among them, the R field is used to carry an identifier, for example, the second identifier, and the value of the identifier is used to indicate whether the message is a retransmitted message; the RN field is used to carry the retransmission count.
[0051] If the value of the identifier is the first value, it indicates that the message is a retransmitted message and the value of the RN field is valid; if the value of the identifier is the second value, it indicates that the message is not a retransmitted message and the value of the RN field is empty.
[0052] The valid values of the RN field are currently tentatively set to 01, 10, and 11, representing that the message is currently retransmitted 1 time, 2 times, and 3 times respectively. Of course, the RN field can also be changed and supplemented according to the actual networking situation in actual applications.
[0053] Among them, the CAPWAP header also includes other fields: CAPWAP preamble field, CAPWAP header length HLEN field, radio identifier RID field, wireless binding identifier WBID field, T field (format of the transmitted message, 1 indicates that the payload is of the type defined by WBID, 0 indicates that the payload is an 802.3 frame), F field (whether the current message is fragmented, 1 indicates that the current message is fragmented), L field (valid when the F field is set, 1 indicates that it is the last fragment, 0 indicates that there are more fragments later), W field (indicating whether the (optional) Wireless Specific Information field exists, 1 indicates existence), M field (whether the (optional) Radio MAC Address field exists), K field (indicating whether it is a keep-alive packet for the data channel), Fragment ID field (indicating the sequence number of each fragment when fragmenting), Fragment Offset field (indicating the offset of each fragment when fragmenting), (optional) Radio MAC Address field (retaining the MAC address of WTP when the message is an 802.3 frame), (optional) Wireless Specific Information field (wireless extension information), and Payload (payload) field. The above fields are all configured according to the regulations of the existing CAPWAP protocol.
[0054] Step 120: Determine whether the second message sent by the receiving end according to the first message is received within a preset time.
[0055] Specifically, according to the description of step 110, after the sending end sends the first message, a timer is started. The sending end determines whether the second message sent by the receiving end according to the first message is received within a preset time (for example, 5 seconds).
[0056] If the sending end does not receive the second message within the preset time, the sending end executes step 130.
[0057] Optionally, in the embodiments of the present application, the second message may specifically be a CAPWAP Response Message.
[0058] Optionally, in the embodiments of the present application, it further includes the process of the sending end receiving the second message within a preset time:
[0059] In one implementation manner, the first message is the first message corresponding to the first sequence number sent by the sending end, and this first message has been received by the receiving end. After receiving the first message, the receiving end generates a second message and sends it to the sending end. The second message includes a sequence number field, an R field, and an RN field, where the sequence number field carries the first sequence number, the value of the R field is the second value, and the RN field is empty.
[0060] In another implementation manner, the first message is a non-first message corresponding to the first sequence number sent by the sending end and the receiving end has sent a message including the first sequence number to the sending end. After the receiving end receives the first message again, it generates a second message again and sends it to the sending end. The second message also includes a sequence number field, an R field, and an RN field, where the sequence number field carries the first sequence number, the value of the R field is the first value, and the RN field carries the retransmission times.
[0061] It should be noted that since the first message is a non-first message, it means that the sending end has sent the first message before but has not received the response from the receiving end, and the sending end continues to retransmit the message. In this implementation manner, before receiving the first message, the receiving end has received other messages corresponding to the first sequence number, and at that time, the receiving end also generated a corresponding response and sent it. Therefore, the second message generated by the receiving end again is also a retransmission message, the value of the R field is the first value, indicating that the second message is a retransmission message, and the retransmission times carried by the RN field are determined according to the number of messages already sent recorded locally by the receiving end.
[0062] In another implementation manner, the first message is a non-first message corresponding to the first sequence number sent by the sending end and the receiving end has not sent a message including the first sequence number to the sending end. After the receiving end receives the first message again, it generates a second message and sends it to the sending end. The second message also includes a sequence number field, an R field, and an RN field, where the sequence number field carries the first sequence number, the value of the R field is the second value, and the RN field is empty.
[0063] In the foregoing multiple implementation manners, after the sending end receives the second message, it determines that the second message is the message corresponding to the first message according to the sequence number included in the second message. The sending end and the receiving end continue to initiate subsequent processes, for example, continue to send other CAPWAP Request Messages, CAPWAP Response Messages, etc.
[0064] Optionally, in the embodiments of the present application, the receiving end also counts the number of CAPWAP Response Messages sent, so that when the receiving end needs to reply to a message again when receiving a message with the same sequence number, the number of times of retransmission carried by the RN field is determined according to the counted number of CAPWAP Response Messages sent.
[0065] Step 130: If the second message is not received within the preset time, send a third message to the receiving end again. The third message includes the first sequence number, the first identifier, and the first number of retransmissions, so that after receiving the third message, the receiving end determines, according to the first identifier, that the third message is a retransmission message of the first message, stores the first number of retransmissions in the first mapping table entry matching the first sequence number, and sends a fourth message corresponding to the third message to the sending end. The fourth message includes the first sequence number.
[0066] Specifically, according to the description of step 120, after the sending end starts the timer, if the second message is not received within the preset time, the sending end generates a third message and sends the third message to the receiving end again. The third message also includes a sequence number field, an R field, and an RN field. The sequence number field carries the first sequence number, the R field carries the first identifier, the value of the first identifier is the first value, and the RN field carries the number of retransmissions, which can be determined according to the number of messages already sent recorded locally.
[0067] It should be noted that since the first message corresponding to the first sequence number has been sent previously, the third message generated again by the sending end is a retransmission message, and the value of the R field is the first value, indicating that the third message is a retransmission message.
[0068] After receiving the third message, the receiving end obtains the first sequence number, the first identifier, and the first number of retransmissions therefrom. According to the first identifier, the receiving end determines that the third message is a retransmission message of the first message. According to the first sequence number, the receiving end obtains or generates a first mapping table entry matching the first sequence number in the local mapping table and stores the first number of retransmissions in the first mapping table entry. At the same time, the receiving end also generates and sends a fourth message to the sending end. The fourth message includes a sequence number field, an R field, and an RN field.
[0069] It can be understood that the sequence number field included in the fourth message carries the first sequence number, and the R field and the RN field are filled according to whether the CAPWAP Request Message corresponding to the first sequence number has been sent.
[0070] Therefore, by applying the communication method provided in this application, the sending end sends a first message to the receiving end, and the first message includes a first sequence number; within a preset time, the sending end determines whether it has received a second message sent by the receiving end according to the first message; if the second message is not received within the preset time, the sending end sends a third message to the receiving end again, and the third message includes the first sequence number, a first identifier, and a first retransmission count, so that after receiving the third message, the receiving end determines, according to the first identifier, that the third message is a retransmission message of the first message, stores the first retransmission count in the first mapping relation entry that matches the first sequence number, and sends a fourth message corresponding to the third message to the sending end, and the fourth message includes the first sequence number.
[0071] In this way, by carrying the identifier and the current retransmission count in the CAPWAP header, the receiving end can evaluate the link quality of the link with the sending end according to the current retry count, and automatically trigger further link detection in the case of poor link quality. The above process neither requires additional message overhead nor can provide a basis for fault analysis, reduces the operation and maintenance difficulty, and improves the operation and maintenance efficiency. At the same time, it also solves the problems that additional network detection will increase the network burden and that additional network detection cannot fully represent the current network link quality and there is a deviation in the evaluation.
[0072] Optionally, in the embodiment of this application, after receiving the retransmission message, the sending end will also perform the process of recording the retransmission count and the number of messages corresponding to the retransmission count in the mapping relation entry that matches the sequence number.
[0073] Specifically, the receiving end generates and sends a fifth message to the sending end, and the fifth message includes a second sequence number, a third identifier, and a third retransmission count.
[0074] It should be noted that the fifth message is sent after the receiving end receives a sixth message that includes the second sequence number again, and the sixth message is sent by the sending end. That is, after the sending end sends the sixth message to the receiving end, the receiving end sends the fifth message to the sending end, but the sending end does not receive the first sent fifth message within the preset time and continues to send the sixth message to the receiving end. Subsequently, the fifth message re-sent by the receiving end is received by the sending end.
[0075] It can be understood that the second sequence number is the same as the sequence number included in the sixth message. The value of the third identifier is a first value to identify that the fifth message is a retransmission message, and the third retransmission count can be determined according to the number of messages that have been sent recorded locally.
[0076] After the sending end receives the fifth message, it obtains the second sequence number, the third identifier, and the third retransmission count therefrom. The sending end identifies the value of the third identifier. If the third identifier is the first value, the sending end determines that the fifth message is a retransmission message; according to the second sequence number, the sending end searches in the mapping relation table to find whether there is a second mapping relation entry that matches the second sequence number.
[0077] If there is no second mapping relation entry, the sending end determines that the fifth message received this time is the first retransmission message corresponding to the second sequence number. The sending end generates a second mapping relation entry, which includes the second sequence number, the third retransmission count, and the number of messages corresponding to the third retransmission count.
[0078] The above mapping relation table is shown in Table 1.
[0079] Table 1 Mapping Relation Table
[0080]
[0081] Optionally, in the embodiment of the present application, the sending end can also determine whether the link quality between it and the receiving end meets the preset communication policy according to the number of messages recorded in the mapping relation table.
[0082] Specifically, within a preset period (for example, 1 minute, which can also be set according to the actual tolerance of the network device or set by the administrator), the sending end obtains the number of messages corresponding to the second sequence number from the second mapping relation entry. The sending end determines whether the number of messages reaches a number threshold (for example, 5, or setting the total number of messages to reach 5% of the total number of messages, etc.); if it reaches, the sending end determines that the link quality between the sending end and the receiving end does not meet the preset communication policy, that is, the link quality is poor and there are many packet losses. Subsequently, the sending end and the receiving end can start to perform actual detection using CAPWAP messages with the same message size to confirm the actual packet loss and delay of the link.
[0083] In the above judgment process, the number of messages can specifically be the sum value of the number of messages of multiple retransmission counts, or the number of messages can specifically be the number of messages corresponding to a certain retransmission count. The number threshold can also be set to the same or different thresholds according to the number of messages calculated by the foregoing different calculation methods.
[0084] Optionally, in the embodiment of the present application, the sending end can also record the number of messages corresponding to a certain sequence number that has been sent to the receiving end. By comparing the number of messages with the retransmission count corresponding to the certain sequence number received, the link quality between it and the receiving end can be determined.
[0085] Further, for the message received by the sending end (this message is sent by the receiving end), according to the number of retransmissions corresponding to the sequence number included in this message, and the number of messages sent with the same sequence number recorded locally, compare whether these two numbers of messages are the same. If they are the same, the sending end determines that the receiving end has received all of them. However, if the sending end has not received all the messages sent by the receiving end, it means that the link quality between the receiving end and the sending end is unhealthy. If the number of messages is greater than the number of retransmissions, the sending end determines that the receiving end has not received all of them, which means that the link quality between the sending end and the receiving end is unhealthy. Next, a detailed description of the communication method provided in the embodiments of the present application will be given. Refer to Figure 3 , Figure 3 is a flowchart of another communication method provided in the embodiments of the present application. This method is applied to the receiving end. The communication method provided in the embodiments of the present application may include the following steps.
[0086] Step 310: Receive a first message sent by the sending end, where the first message includes a first sequence number, a first identifier, and a first number of retransmissions;
[0087] Specifically, a CAPWAP tunnel has been established between the sending end and the receiving end, and communication and interaction are carried out through the CAPWAP tunnel. Among them, the sending end may be an AP, and the receiving end may be an AC; or, the sending end may be an AC, and the receiving end may be an AP. The messages exchanged between the two ends are all CAPWAP messages, and subsequent descriptions will be based on messages.
[0088] When the sending end wants to send a message to the receiving end, the sending end generates and sends a first message to the receiving end. This first message includes a first sequence number. When the sending end sends the first message to the receiving end, the first message may specifically be a CAPWAP RequestMessage. This first message includes a first sequence number, a first identifier, and a first number of retransmissions. Among them, the value of the first identifier and the first number of retransmissions are set according to whether the first message is the first message corresponding to the first sequence number or the retransmission message of the nth time. The retransmission message of the nth time can be determined according to the number of messages already sent recorded locally.
[0089] Further, when the first message is not the first message (that is, the retransmission message) corresponding to the first sequence number (Sequence Number), the first identifier is the first value (for example, the first value is 1), and the first number of retransmissions is the fourth value (the fourth value is determined according to the number of retransmissions, and the maximum value is 3; for the number of retransmissions exceeding 3 times, it can be filled in according to 3 times first); when the first message is the first message corresponding to the first sequence number, the first identifier is the second value (for example, the second value is 0), and the second number of retransmissions is empty.
[0090] For example, if the first sequence number is 1 and the first message is the first message corresponding to the first sequence number, at this time, the value of the second identifier is 0 and the second retransmission count is empty; if the first sequence number is 1 and the first message is not the first message corresponding to the first sequence number, that is, the sender retransmits the first message with the sequence number 1, at this time, the value of the second identifier is 1 and the second retransmission count is 1, that is, the current is the first retransmission. Similarly, the value of the second identifier is 1 and the second retransmission count is 2, that is, the current is the second retransmission; the value of the second identifier is 1 and the second retransmission count is 3, that is, the current is the third retransmission.
[0091] In the embodiments of the present application, the maximum value of the retransmission count can also be set. For example, set the maximum retransmission to 3 times. Of course, according to the actual networking situation, the maximum value of the retransmission count can also be set. For example, set the maximum retransmission to 5 times, 8 times, 10 times, and so on.
[0092] Optionally, in the embodiments of the present application, the first message includes a CAPWAP Control (Control) Header (Header), and the CAPWAP control header includes a sequence number field for carrying the first sequence number.
[0093] Optionally, in the embodiments of the present application, the first message further includes a CAPWAP header, and the CAPWAP header includes an R field and an RN field. As Figure 2 shown. Among them, the R field is used to carry an identifier, for example, the first identifier, and the value of the identifier is used to indicate whether the message is a retransmitted message; the RN field is used to carry the retransmission count.
[0094] If the value of the identifier is the first value, it indicates that the message is a retransmitted message and the value of the RN field is valid; if the value of the identifier is the second value, it indicates that the message is not a retransmitted message and the value of the RN field is empty.
[0095] After the sender sends the first message, a timer is started. The sender determines whether the second message sent by the receiver according to the first message is received within a preset time (for example, 5 seconds).
[0096] After the receiver receives the first message, it obtains the first sequence number, the first identifier, and the first retransmission count therefrom.
[0097] Step 320, if the first identifier is the first value, determine that the first message is a retransmitted message and store the first retransmission count locally;
[0098] Specifically, according to the description of step 310, after the receiver obtains the first identifier, it identifies the first identifier.
[0099] In one case, if the first identifier is the first value, the receiver determines that the first message is a retransmitted message.
[0100] Optionally, after determining that the first message is a retransmission message, the receiving end looks up in the mapping relation table based on the first sequence number to check if there is a first mapping relation entry that matches the first sequence number; if there is a first mapping table entry, the receiving end determines that the retransmission message corresponding to the first sequence number has been received previously. The receiving end stores the first retransmission count and the number of messages corresponding to the first retransmission count in the first mapping relation entry.
[0101] If there is no first mapping relation entry, the receiving end determines that the first message received this time is the first retransmission message corresponding to the first sequence number. The receiving end generates a first mapping relation entry, which includes the first sequence number, the first retransmission count, and the number of messages corresponding to the first retransmission count.
[0102] In the embodiment of the present application, the first mapping relation entry can be as shown in Table 1 above and will not be repeated here.
[0103] Step 330: Send a second message to the sending end, where the second message includes the first sequence number;
[0104] Specifically, according to the description in step 320, regardless of whether the first message is the first message or a retransmission message corresponding to the first sequence number, the receiving end generates and sends a second message to the sending end after receiving the first message. The second message includes the first sequence number.
[0105] Optionally, in the embodiment of the present application, the second message can specifically be a CAPWAP Response Message.
[0106] Optionally, in the embodiment of the present application, the second message further includes a second identifier and a second retransmission count.
[0107] In one implementation, the first message is a non-first message corresponding to the first sequence number sent by the sending end and the receiving end has sent a message including the first sequence number to the sending end. After the receiving end receives the first message again, it generates a second message again and sends it to the sending end. The second message also includes a sequence number field, an R field, and an RN field, where the sequence number field carries the first sequence number, the value of the R field is the first value, and the RN field carries the retransmission count.
[0108] It should be noted that since the first message is not the first message, it means that the sender has previously sent a message including the first sequence number but has not received a response from the receiver, and the sender continues to retransmit the message. In this implementation method, before receiving the first message, the receiver has received other messages corresponding to the first sequence number, and at that time, the receiver also generated a corresponding response and sent it. Therefore, the second message re-generated by the receiver is also a retransmitted message, and the value of the R field is the first value, indicating that the second message is a retransmitted message, and the retransmission times carried by the RN field are determined according to the number of messages already sent recorded locally by the receiver.
[0109] In another implementation method, the first message is a non-first message corresponding to the first sequence number sent by the sender and the receiver has not sent a message including the first sequence number to the sender. After receiving the first message again, the receiver generates a second message and sends it to the sender. The second message also includes a sequence number field, an R field, and an RN field. Among them, the sequence number field carries the first sequence number, the value of the R field is the second value, and the RN field is empty.
[0110] Optionally, in the embodiments of the present application, when the receiver identifies the first identifier, there is also another situation: if the first identifier is the second value, the receiver determines that the first message is not a retransmitted message.
[0111] In another implementation method, the first message is the first message corresponding to the first sequence number sent by the sender, and the first message has been received by the receiver. After receiving the first message, the receiver generates a second message and sends it to the sender. The second message includes a sequence number field, an R field, and an RN field. Among them, the sequence number field carries the first sequence number, the value of the R field is the second value, and the RN field is empty.
[0112] In the foregoing multiple implementation methods, after receiving the second message, the sender determines that the second message is the message corresponding to the first message according to the sequence number included in the second message. The sender and the receiver continue to initiate subsequent processes, for example, continue to send other CAPWAP Request Message, CAPWAP Response Message, etc.
[0113] Optionally, in the embodiments of the present application, the receiver also counts the number of CAPWAP Response Message sent, so that when the receiver receives a message with the same sequence number again and needs to reply to the message again, the retransmission times carried by the RN field are determined according to the number of CAPWAP Response Message already sent recorded locally.
[0114] Optionally, in the embodiments of the present application, the receiving end may further determine whether the link quality between it and the sending end meets a preset communication policy according to the number of packets recorded in the mapping relationship table.
[0115] Specifically, within a preset period (for example, 1 minute, which can also be set according to the actual tolerance of the network device or by the administrator), from the first mapping relationship entry, the receiving end obtains the number of packets corresponding to the first sequence number. The receiving end determines whether the number of packets reaches a threshold number (for example, 10, or the total number of packets reaches 5% of the total number of packets, etc.); if it reaches, the receiving end determines that the link quality between itself and the sending end does not meet the preset communication policy, that is, the link quality is poor and there are many packet losses. Subsequently, the sending end and the receiving end can start to actually detect using CAPWAP packets carrying the same packet size to confirm the actual packet loss and delay of the link.
[0116] In the above judgment process, the number of packets can specifically be the sum value of the number of packets for multiple retransmission times, or the number of packets can specifically be the number of packets corresponding to a certain retransmission time. The threshold number can also be set to the same or different thresholds according to the number of packets calculated by the foregoing different calculation methods.
[0117] Optionally, in the embodiments of the present application, the receiving end may further record the number of packets corresponding to a certain sequence number that has been sent to the sending end. By comparing the number of packets with the retransmission times corresponding to the certain sequence number received, the link quality between it and the sending end can be determined.
[0118] Furthermore, for the packet received by the receiving end (this packet is sent by the sending end), according to the retransmission times corresponding to the sequence number included in the packet and the number of packets sent with the same sequence number recorded locally, compare whether these two numbers of packets are the same. If they are the same, the receiving end determines that all the packets sent by the sending end have been received, but the sending end has not received all the packets sent by the receiving end, and the link quality of the link between the receiving end and the sending end is unhealthy; if the number of packets is less than the retransmission times, the receiving end determines that it has not received all the packets sent by the sending end, and the link quality of the link between the sending end and the receiving end is unhealthy.
[0119] Therefore, by applying the communication method provided in the present application, the receiving end receives the first packet sent by the sending end, and the first packet includes a first sequence number, a first identifier, and a first retransmission time; if the first identifier is a first value, the receiving end determines that the first packet is a retransmitted packet and stores the first retransmission time locally; the receiving end sends a second packet to the sending end, and the second packet includes the first sequence number; wherein, the first packet is sent after the sending end does not receive the packet sent by the receiving end.
[0120] In this way, by carrying the identifier and the current retransmission count in the CAPWAP header, the receiving end can evaluate the link quality between the sending end and the receiving end according to the current retry count, and automatically trigger further link detection in the case of poor link quality. The above process not only does not require additional message overhead, but also can provide a basis for fault analysis, reduce the operation and maintenance difficulty, and improve the operation and maintenance efficiency. At the same time, it also solves the problems that additional network detection will increase the network burden, and additional network detection cannot fully represent the current network link quality, resulting in deviation in evaluation.
[0121] The communication method provided by the embodiments of the present application will be described in detail below. Refer to Figure 4 , Figure 4 which is a signaling diagram of the interaction communication between the sending end and the receiving end provided by the embodiments of the present application.
[0122] Step 400: The sending end sends a CAPWAP Request Message1 to the receiving end.
[0123] Specifically, a CAPWAP tunnel has been established between the sending end and the receiving end, and communication and interaction are carried out through the CAPWAP tunnel.
[0124] When the sending end wants to send a message to the receiving end, the sending end generates a CAPWAP Request Message1. The CAPWAP Request Message1 includes a sequence number field, an R field, and an RN field. Among them, the sequence number field carries sequence number 1, the value of the R field is 0, and the RN field is empty.
[0125] The sending end sends the CAPWAP Request Message1 to the receiving end.
[0126] After the sending end sends the CAPWAP Request Message1, it starts a timer. The sending end determines whether it receives a CAPWAP Response Message sent by the receiving end according to the CAPWAP Request Message1 within a preset time (for example, 5 seconds). At the same time, the sending end locally records that the number of messages including the first sequence number that have been sent is 1.
[0127] Step 410: The sending end sends a CAPWAP Request Message2 to the receiving end again.
[0128] Specifically, according to the description in step 400, if the sender does not receive a CAPWAP ResponseMessage within the preset time, the sender generates a CAPWAP Request Message2 again. The CAPWAP Request Message2 includes a sequence number field, an R field, and an RN field. Among them, the sequence number field carries sequence number 1, the value of the R field is 1, and the value of the RN field is 1 (the value of this RN field is determined according to the number of messages recorded by the sender in step 400).
[0129] The sender sends the CAPWAP Request Message2 to the receiver again.
[0130] After the sender sends the CAPWAP Request Message2, it starts a timer again. The sender determines whether it receives a CAPWAPResponse Message sent by the receiver according to the CAPWAP Request Message2 within the preset time (for example, 5 seconds). At the same time, the sender continues to record the number of messages including the first sequence number sent locally as 2.
[0131] Step 420: The receiver sends a CAPWAP Response Message1 to the sender.
[0132] Specifically, after the receiver receives the CAPWAP Request Message2, it obtains the sequence number 1, the value of the R field, and the value of the RN field from it.
[0133] According to the value of the R field, the receiver determines that the CAPWAP Request Message2 is a retransmitted message, and according to the value of the RN field, the receiver determines that the retransmission count of the CAPWAP Request Message is 1 time.
[0134] After the receiver determines that the CAPWAP Request Message2 is a retransmitted message, it looks up in the mapping relationship table whether there is a mapping relationship table entry 1 that matches the sequence number 1 according to the sequence number 1.
[0135] In the embodiment of the present application, there is no mapping relationship table entry 1 in the mapping relationship table. At this time, the receiver can also determine that it has not received the CAPWAP Request Message1 sent by the sender earlier. The receiver generates a mapping relationship table entry 1, and this mapping relationship table entry 1 includes the sequence number 1, RN = 1, and the number of messages 1 corresponding to RN = 1.
[0136] The receiving end also generates a CAPWAP Response Message1, which includes a sequence number field, an R field, and an RN field. Among them, the sequence number field carries sequence number 1, the value of the R field is 0, and the RN field is empty. At the same time, the receiving end locally records that the number of messages including the first sequence number that have been sent is 1.
[0137] The receiving end sends the CAPWAP Response Message1 to the sending end.
[0138] Step 430: The sending end sends the CAPWAP Request Message3 to the receiving end again.
[0139] Specifically, according to the description of step 410, if the sending end does not receive a CAPWAP Response Message within the preset time, the sending end generates a CAPWAP Request Message3 again. This CAPWAP Request Message3 includes a sequence number field, an R field, and an RN field. Among them, the sequence number field carries sequence number 1, the value of the R field is 1, and the value of the RN field is 2 (the value of this RN field is determined according to the number of messages recorded by the sending end in step 410).
[0140] The sending end sends the CAPWAP Request Message3 to the receiving end again.
[0141] After sending the CAPWAP Request Message3, the sending end starts a timer again. The sending end determines whether it receives a CAPWAP Response Message sent by the receiving end according to the CAPWAP Request Message3 within the preset time (for example, 5 seconds). At the same time, the sending end continues to locally record that the number of messages including the first sequence number that have been sent is 3.
[0142] Step 440: The sending end sends the CAPWAP Request Message4 to the receiving end again.
[0143] Specifically, according to the description of step 430, if the sending end does not receive a CAPWAP Response Message within the preset time, the sending end generates a CAPWAP Request Message4. This CAPWAP Request Message4 includes a sequence number field, an R field, and an RN field. Among them, the sequence number field carries sequence number 1, the value of the R field is 1, and the value of the RN field is 3 (the value of this RN field is determined according to the number of messages recorded by the sending end in step 430).
[0144] The sending end sends the CAPWAP Request Message4 to the receiving end again.
[0145] After the sending end sends the CAPWAP Request Message4, it starts a timer again. The sending end determines whether it has received the CAPWAP Response Message sent by the receiving end according to the CAPWAP Request Message4 within a preset time (for example, 5 seconds). At the same time, the sending end continues to locally record that the number of messages including the first sequence number that have been sent is 4.
[0146] Step 450: The receiving end sends the CAPWAP Response Message2 to the sending end.
[0147] Specifically, after receiving the CAPWAP Request Message4, the receiving end obtains the sequence number 1, the value of the R field, and the value of the RN field from it.
[0148] According to the value of the R field, the receiving end determines that the CAPWAP Request Message4 is a retransmission message, and according to the value of the RN field, the receiving end determines that the retransmission times of the CAPWAP Request Message is 3 times.
[0149] After the receiving end determines that the CAPWAP Request Message4 is a retransmission message, it looks up in the mapping relationship table whether there is a mapping relationship table entry 1 that matches the sequence number 1 according to the sequence number 1.
[0150] In the embodiment of the present application, there is a mapping relationship table entry 1 in the mapping relationship table. At this time, the receiving end can also determine that it has received the retransmission message of the CAPWAP Request Message previously sent by the sending end. The receiving end stores RN = 3 and the number of messages corresponding to RN = 3, which is 1, in the mapping relationship table entry 1.
[0151] The receiving end also generates the CAPWAP Response Message2 again. The CAPWAP Response Message2 includes a sequence number field, an R field, and an RN field. Among them, the sequence number field carries the sequence number 1, the value of the R field is 1, and the value of the RN field is 1 (the value of this RN field is determined according to the number of messages recorded by the sending end in step 420).
[0152] The receiving end sends the CAPWAP Response Message2 to the sending end again. At the same time, the receiving end locally records that the number of messages including the first sequence number that have been sent is 2.
[0153] Subsequently, if within a preset time, the sending end receives a CAPWAP Response Message2, obtain the sequence number 1, the value of the R field, and the value of the RN field from it.
[0154] According to the sequence number 1, the sending end can determine that this CAPWAP Response Message2 is the response message corresponding to the CAPWAP RequestMessage4, and determine that the receiving end has received the CAPWAP Request Message4.
[0155] The sending end can continue to generate a CAPWAP Request Message5. This CAPWAP Request Message5 includes a sequence number field, an R field, and an RN field. Among them, the sequence number field carries the sequence number 2, the value of the R field is 0, and the RN field is empty.
[0156] The sending end sends the CAPWAP Request Message5 to the receiving end again.
[0157] After the sending end sends the CAPWAP Request Message5, start a timer again. The sending end determines whether it receives a CAPWAPResponse Message sent by the receiving end according to the CAPWAP Request Message5 within a preset time (for example, 5 seconds). At the same time, the sending end locally records that the number of messages including the second sequence number that have been sent is 1.
[0158] The subsequent process can refer to the description of the foregoing steps 400 - step 450, and will not be repeated here.
[0159] Based on the same inventive concept, the embodiments of the present application also provide a communication device corresponding to the communication method. See Figure 5 , Figure 5 A communication device provided for an embodiment of the present application, the device is applied to the sending end, and the device includes:
[0160] A sending unit 510, configured to send a first message to the receiving end, where the first message includes a first sequence number;
[0161] A first determination unit 520, configured to determine whether to receive a second message sent by the receiving end according to the first message within a preset time;
[0162] The sending unit 510 is further configured to, if the second message is not received within the preset time, send a third message to the receiving end again, where the third message includes the first sequence number, the first identifier, and the first retransmission count, so that after receiving the third message, the receiving end determines, according to the first identifier, that the third message is a retransmission message of the first message, stores the first retransmission count in the first mapping table entry matching the first sequence number, and sends a fourth message corresponding to the third message to the sending end, where the fourth message includes the first sequence number.
[0163] Optionally, the value of the first identifier is a first value;
[0164] The first message further includes a second identifier and a second retransmission count;
[0165] When the first message is the first message corresponding to the first sequence number, the second identifier is a second value, and the second retransmission count is empty;
[0166] When the first message is a non-first message corresponding to the first sequence number, the second identifier is the first value, and the second retransmission count is a third value.
[0167] Optionally, the apparatus further includes:
[0168] A receiving unit (not shown in the figure), configured to receive a fifth message sent by the receiving end, where the fifth message includes a second sequence number, a third identifier, and a third retransmission count;
[0169] A first determination unit (not shown in the figure), configured to determine that the fifth message is a retransmission message if the third identifier is the first value;
[0170] A search unit (not shown in the figure), configured to search, according to the second sequence number, in the mapping table for whether there is a second mapping table entry matching the second sequence number;
[0171] A generation unit (not shown in the figure), configured to generate the second mapping table entry if not present, where the second mapping table entry includes the second sequence number, the third retransmission count, and the number of messages corresponding to the third retransmission count;
[0172] Wherein, the fifth message is sent after the receiving end receives a sixth message including the second sequence number again, and the sixth message is sent by the sending end.
[0173] Optionally, the apparatus further includes:
[0174] An obtaining unit (not shown in the figure) is configured to obtain, within a preset period, the number of packets corresponding to the second sequence number from the second mapping relation entry;
[0175] A second determination unit (not shown in the figure) is configured to determine whether the number of packets reaches a number threshold;
[0176] A second determination unit (not shown in the figure) is configured to, if it reaches, determine that the link quality between the sending end and the receiving end does not meet a preset communication policy.
[0177] Optionally, the packet includes an R field and an RN field; the R field is used to carry an identifier, and the value of the identifier is used to indicate whether the packet is a retransmitted packet; the RN field is used to carry the retransmission times;
[0178] If the value of the identifier is a first value, it indicates that the packet is a retransmitted packet, and the value of the RN field is valid;
[0179] If the value of the identifier is a second value, it indicates that the packet is not a retransmitted packet, and the value of the RN field is empty.
[0180] Therefore, by applying the communication device provided in the present application, the sending end sends a first packet to the receiving end, and the first packet includes a first sequence number; within a preset time, the sending end determines whether it receives a second packet sent by the receiving end according to the first packet; if the second packet is not received within the preset time, the sending end sends a third packet to the receiving end again, and the third packet includes the first sequence number, a first identifier, and a first retransmission times, so that after receiving the third packet, the receiving end determines, according to the first identifier, that the third packet is a retransmitted packet of the first packet, stores the first retransmission times in a first mapping relation entry matching the first sequence number, and sends a fourth packet corresponding to the third packet to the sending end, and the fourth packet includes the first sequence number.
[0181] In this way, by carrying the identifier and the current retransmission times in the CAPWAP header, the receiving end can evaluate the link quality of the link with the sending end according to the current retry times, and automatically trigger further link detection in the case of poor link quality. The above process not only does not require additional packet overhead, but also can provide a basis for fault analysis, reduce the operation and maintenance difficulty, and improve the operation and maintenance efficiency. At the same time, it also solves the problems that the additional network detection will increase the network burden, and the additional network detection cannot fully represent the current network link quality, and there is a deviation in the evaluation.
[0182] Based on the same inventive concept, an embodiment of the present application further provides a communication device corresponding to the communication method. Refer to Figure 6 , Figure 6Another communication device provided by an embodiment of this application. The device is applied to a receiving end and includes:
[0183] A receiving unit 610, configured to receive a first message sent by a sending end. The first message includes a first sequence number, a first identifier, and a first retransmission count;
[0184] A first determination unit 620, configured to determine that if the first identifier is a first value, determine that the first message is a retransmitted message, and store the first retransmission count locally;
[0185] A sending unit 630, configured to send a second message to the sending end. The second message includes the first sequence number;
[0186] Wherein, the first message is sent after the sending end fails to receive a message sent by the receiving end.
[0187] Optionally, the second message further includes a second identifier and a second retransmission count;
[0188] When the first message is a non-first received message corresponding to the first sequence number and the second message has been sent to the sending end, the second identifier is the first value, and the second retransmission count is a third value;
[0189] Wherein, the third value is determined by the number of messages that have been sent and recorded locally;
[0190] When the first message is a non-first received message corresponding to the first sequence number and the second message has not been sent to the sending end, the second identifier is a second value, and the second retransmission count is empty.
[0191] Optionally, the determination unit 620 is further configured to determine that the first message is a non-retransmitted message if the first identifier is a second value;
[0192] Wherein, the second message further includes a second identifier and a second retransmission count; when the first message is a first received message corresponding to the first sequence number, the second identifier is a second value, and the second retransmission count is empty.
[0193] Optionally, the device further includes:
[0194] A lookup unit (not shown in the figure), configured to look up, according to the first sequence number, in a mapping relationship table whether there is a first mapping relationship entry that matches the first sequence number;
[0195] An existence unit (not shown in the figure), configured to, if it exists, store the first retransmission count and the number of messages corresponding to the first retransmission count in the first mapping relationship entry;
[0196] A generating unit (not shown in the figure) is configured to generate the first mapping relation entry if it does not exist, where the first mapping relation entry includes the first sequence number, the first retransmission count, and the number of packets corresponding to the first retransmission count.
[0197] Optionally, the apparatus further includes:
[0198] An obtaining unit (not shown in the figure) is configured to obtain, within a preset period, the number of packets corresponding to the first sequence number from the first mapping relation table;
[0199] A determining unit (not shown in the figure) is configured to determine whether the number of packets reaches a threshold number;
[0200] A second determining unit (not shown in the figure) is configured to determine that the link quality between the receiving end and the sending end does not meet a preset communication policy if the threshold number is reached.
[0201] Optionally, the packet includes an R field and an RN field; the R field is used to carry an identifier, and the value of the identifier is used to indicate whether the packet is a retransmitted packet; the RN field is used to carry the retransmission count;
[0202] If the value of the identifier is a first value, it indicates that the packet is a retransmitted packet and the value of the RN field is valid;
[0203] If the value of the identifier is a second value, it indicates that the packet is not a retransmitted packet and the value of the RN field is invalid.
[0204] Therefore, by applying the communication method provided in this application, the receiving end receives a first packet sent by the sending end, where the first packet includes a first sequence number, a first identifier, and a first retransmission count; if the first identifier is the first value, the receiving end determines that the first packet is a retransmitted packet and stores the first retransmission count locally; the receiving end sends a second packet to the sending end, where the second packet includes the first sequence number; where the first packet is sent by the sending end after it does not receive the packet sent by the receiving end.
[0205] In this way, by carrying an identifier and the current retransmission count in the CAPWAP header, the receiving end can evaluate the link quality of the link with the sending end according to the current retry count, and automatically trigger further link detection in the case of poor link quality. The above process not only does not require additional packet overhead, but also can provide a basis for fault analysis, reduce the operation and maintenance difficulty, and improve the operation and maintenance efficiency. At the same time, it also solves the problems that additional network detection will increase the network burden, and additional network detection cannot fully represent the current network link quality and there is a deviation in the evaluation.
[0206] Based on the same inventive concept, an embodiment of the present application further provides a network device, such as Figure 7 shown, which includes a processor 710, a transceiver 720, and a machine-readable storage medium 730. The machine-readable storage medium 730 stores machine-executable instructions that can be executed by the processor 710. The processor 710 is prompted by the machine-executable instructions to execute the communication method provided by the embodiment of the present application. The foregoing Figure 5 , Figure 6 shown communication device can be implemented by using the hardware structure of the network device as Figure 7 shown.
[0207] The above-mentioned computer-readable storage medium 730 may include a random access memory (English: Random Access Memory, abbreviated as: RAM), and may also include a non-volatile memory (English: Non-volatile Memory, abbreviated as: NVM), such as at least one disk memory. Optionally, the computer-readable storage medium 730 may also be at least one storage device located far from the foregoing processor 710.
[0208] The above-mentioned processor 710 may be a general-purpose processor, including a central processing unit (English: Central Processing Unit, abbreviated as: CPU), a network processor (English: Network Processor, abbreviated as: NP), etc.; it may also be a digital signal processor (English: Digital Signal Processor, abbreviated as: DSP), an application-specific integrated circuit (English: Application Specific Integrated Circuit, abbreviated as: ASIC), a field-programmable gate array (English: Field-Programmable Gate Array, abbreviated as: FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0209] In an embodiment of the present application, the processor 710 reads the machine-executable instructions stored in the machine-readable storage medium 730, and is prompted by the machine-executable instructions to be able to implement the processor 710 itself and call the transceiver 720 to execute the communication method described in the foregoing embodiment of the present application.
[0210] In addition, an embodiment of the present application provides a machine-readable storage medium 730. The machine-readable storage medium 730 stores machine-executable instructions. When the machine-executable instructions are called and executed by the processor 710, the machine-executable instructions prompt the processor 710 itself and call the transceiver 720 to execute the communication method described in the foregoing embodiment of the present application.
[0211] For the implementation process of the functions and roles of each unit in the above device, please refer to the implementation process of the corresponding steps in the above method for details, which will not be elaborated here.
[0212] For the device embodiment, since it basically corresponds to the method embodiment, the relevant parts can be referred to the partial description of the method embodiment. The device embodiments described above are only illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this application. Those of ordinary skill in the art can understand and implement it without creative efforts.
[0213] For the communication device and machine-readable storage medium embodiments, since the method content involved is basically similar to the foregoing method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0214] The above are only the preferred embodiments of this application and are not intended to limit this application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of this application shall be included in the scope of protection of this application.
Claims
1. A communication method, characterized in that: The method is applied to a transmitting end, and the method comprises: Sending a first message to a receiving end, wherein the first message includes a first sequence number; Within a preset time, determining whether a second message sent by the receiving end according to the first message is received; If the second message is not received within the preset time, a third message is sent to the receiving end again, and the third message includes the first sequence number, the first identifier and the first retransmission number, so that after receiving the third message, the receiving end determines that the third message is a retransmission message of the first message according to the first identifier, stores the first retransmission number in a first mapping relationship table entry matching the first sequence number, and sends a fourth message corresponding to the third message to the sending end, and the fourth message includes the first sequence number.
2. The method according to claim 1, characterized in that The value of the first identifier is a first value; The first message also includes a second identifier and a second retransmission number; When the first message is the first message corresponding to the first sequence number, the second identifier is a second value, and the second number of retransmissions is empty; When the first message is not the first message corresponding to the first sequence number, the second identifier is the first value, and the second number of retransmissions is a third value.
3. The method according to claim 1, characterized in that The method further comprises: receiving a fifth message sent by the receiving end, wherein the fifth message includes a second sequence number, a third identifier, and a third number of retransmissions; If the third identifier is the first value, determining that the fifth message is a retransmission message; According to the second serial number, searching in the mapping relationship table whether there is a second mapping relationship table entry matching the second serial number; If not, generate the second mapping relationship table entry, where the second mapping relationship table entry includes the second sequence number, the third retransmission number, and the number of messages corresponding to the third retransmission number; The fifth message is sent by the receiving end after the receiving end receives the sixth message including the second sequence number again, and the sixth message is sent by the sending end.
4. The method according to claim 3, characterized in that The method further comprises: Within a preset period, obtaining the number of messages corresponding to the second sequence number from the second mapping relationship table entry; Determine whether the number of messages reaches a number threshold; If so, it is determined that the link quality between the transmitting end and the receiving end does not satisfy the preset communication strategy.
5. The method according to any one of claims 1 to 3, characterized in that: The message includes an R field and an RN field; the R field is used to carry an identifier, and the value of the identifier is used to indicate whether the message is a retransmission message; the RN field is used to carry the number of retransmissions; If the value of the identifier is the first value, it indicates that the message is a retransmission message and the value of the RN field is valid; If the value of the identifier is the second value, it indicates that the message is a non-retransmission message, and the value of the RN field is empty.
6. A communication method, characterized in that: The method is applied to a receiving end, and the method comprises: Receive a first message sent by a sending end, wherein the first message includes a first sequence number, a first identifier, and a first retransmission number; If the first identifier is a first value, determining that the first message is a retransmission message, and storing the first retransmission number locally; Sending a second message to the sending end, where the second message includes the first sequence number; The first message is sent by the sending end after the sending end does not receive the message sent by the receiving end.
7. The method according to claim 6, characterized in that The second message also includes a second identifier and a second retransmission number; When the first message is a message corresponding to the first sequence number and is not received for the first time and the second message has been sent to the sending end, the second identifier is the first value, and the second number of retransmissions is a third value; The third value is determined by the number of sent messages recorded locally; When the first message is a message corresponding to the first sequence number and is not received for the first time and the second message has not been sent to the sending end, the second identifier is a second value and the second number of retransmissions is empty.
8. The method according to claim 6, characterized in that The method further comprises: If the first identifier is a second value, determining that the first message is a non-retransmission message; The second message also includes a second identifier and a second number of retransmissions; when the first message is the first received message corresponding to the first sequence number, the second identifier is a second value, and the second number of retransmissions is empty.
9. The method according to claim 6, characterized in that Before locally storing the first number of retransmissions, the method further includes: According to the first sequence number, searching in a mapping relationship table whether there is a first mapping relationship table entry matching the first sequence number; If so, storing the first retransmission number and the number of messages corresponding to the first retransmission number in the first mapping relationship table entry; If not present, the first mapping relationship table entry is generated, where the first mapping relationship table entry includes the first sequence number, the first retransmission number, and the number of messages corresponding to the first retransmission number.
10. The method according to claim 9, characterized in that The method further comprises: Within a preset period, obtaining the number of messages corresponding to the first sequence number from the first mapping relationship table; Determine whether the number of messages reaches a number threshold; If so, it is determined that the link quality between the receiving end and the sending end does not satisfy a preset communication strategy.
11. The method according to any one of claims 6 to 8, characterized in that: The message includes an R field and an RN field; the R field is used to carry an identifier, and the value of the identifier is used to indicate whether the message is a retransmission message; the RN field is used to carry the number of retransmissions; If the value of the identifier is the first value, it indicates that the message is a retransmission message and the value of the RN field is valid; If the value of the identifier is the second value, it indicates that the message is a non-retransmission message and the value of the RN field is invalid.
12. A communication device, characterized in that: The device is applied to a transmitting end, and the device includes: A sending unit, configured to send a first message to a receiving end, wherein the first message includes a first sequence number; A first judgment unit, used to judge whether a second message sent by the receiving end according to the first message is received within a preset time; The sending unit is also used to send a third message to the receiving end again if the second message is not received within the preset time, and the third message includes the first sequence number, the first identifier and the first retransmission number, so that after receiving the third message, the receiving end determines that the third message is a retransmission message of the first message according to the first identifier, stores the first retransmission number in a first mapping relationship table entry matching the first sequence number, and sends a fourth message corresponding to the third message to the sending end, and the fourth message includes the first sequence number.
13. A communication device, characterized in that: The device is applied to a receiving end, and the device includes: A receiving unit, configured to receive a first message sent by a sending end, wherein the first message includes a first sequence number, a first identifier, and a first retransmission number; a first determining unit, configured to determine that if the first identifier is a first value, the first message is a retransmission message, and locally store the first retransmission number; A sending unit, configured to send a second message to the sending end, wherein the second message includes the first sequence number; The first message is sent by the sending end after the sending end does not receive the message sent by the receiving end.