Transmission method for application layer protocol in internet of things
By introducing variable sliding windows and dynamic retransmission strategies into the CoAP protocol, the problems of poor adaptability and high power consumption of the CoAP protocol in complex network environments are solved, and flexible Qos design is realized to meet a variety of business needs.
Patent Information
- Application Number
- PCT/CN2023/083429
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-02-21
- Filing Date
- 2023-03-23
- Publication Date
- 2024-08-29
AI Technical Summary
The existing CoAP protocol has poor adaptability in complex and changeable network environments, resulting in high network power consumption and lack of flexible QoS design, making it difficult to cope with multiple business needs.
A variable sliding window mechanism is used to cache and confirm data, the window capacity and retransmission strategy are dynamically adjusted according to the packet loss rate, and the waiting time is optimized with random factors to achieve flexibility and reliability in the message confirmation and retransmission process.
It reduces network overhead and power consumption while ensuring reliability, adapts to complex network environments, and provides a variety of Qos designs to meet different business needs.
Smart Images

Figure CN2023083429_29082024_PF_FP_ABST
Abstract
Description
A method for transmitting application layer protocol of Internet of Things Technical Field
[0001] The present invention relates to the technical field of Internet of Things communications, and in particular to an Internet of Things application layer protocol transmission method. Background Art
[0002] CoAP (Constrained Application Protocol) is a computer protocol used in the Internet of Things (IoT) and based on the REST architecture. CoAP is an application layer protocol that runs over UDP rather than TCP like HTTP. CoAP is very compact, with the smallest packet size being only 4 bytes. CoAP is part of the TCP / IP protocol suite. Like HTTP, CoAP uses a request / response model. Typically, a client sends a CoAP request, and upon intercepting the request, the server returns a response code and content based on the request content.
[0003] The CoAP protocol can be summarized as follows: 1. Based on the message model; 2. The transport layer is based on the UDP protocol and supports restricted devices; 3. It uses a request / response model similar to HTTP requests. HTTP is in text format, while CoAP is in binary format and is more compact than HTTP; 4. It supports two-way communication; 5. It is lightweight and low power; 6. It supports reliable transmission, data retransmission, and block transmission to ensure reliable data arrival; 7. It supports IP multicast; 8. It supports observation mode; 9. It supports asynchronous communication.
[0004] The shortcomings of the existing technology include the following:
[0005] (1) The retransmission algorithm to ensure reliability is relatively simple and difficult to adapt to complex and changing network environments;
[0006] (2) The message model that ensures reliability can be further optimized in downlink reception, thereby saving network overhead and reducing power consumption;
[0007] (3) Lack of flexible QoS design to cope with various flexible business needs.
[0008] Summary of the Invention
[0009] The purpose of the present invention is to provide an Internet of Things application layer protocol transmission method, which can solve the problems of poor algorithm adaptability, high network power consumption, poor flexibility and so on in the prior art, thereby achieving the purpose of adapting to complex and changeable network environments, saving network overhead and reducing power consumption, and being able to cope with a variety of flexible business needs.
[0010] In order to solve the above problems, the technical solutions adopted by the present invention are as follows:
[0011] A method for transmitting an application layer protocol of the Internet of Things comprises the following steps: sending a message; caching the sent data using a variable sliding window; determining whether the capacity of the sliding window is full; executing a message confirmation process after the sliding window is full; after the message confirmation is completed, updating the sliding window according to a packet loss rate; and after the sliding window is updated, performing the next round of data sending tasks.
[0012] According to an Internet of Things application layer protocol transmission method provided by the present invention, if no confirmation message returned by the server is received within a predetermined time after each message is sent, it is deemed to have timed out; when the confirmation sending timeout occurs, the message needs to be sent again and the current retransmission count is increased by 1 to determine whether the maximum retransmission count limit is met. If the maximum retransmission count limit is reached, the message sending is forcibly terminated.
[0013] According to an Internet of Things application layer protocol transmission method provided by the present invention, during the message confirmation process, if a timeout occurs and no confirmation message is received, the last message sent is retransmitted; if a confirmation message is received, it is determined whether the ID carried by the confirmation message meets all confirmation requirements, wherein the ID carried by the confirmation message indicates which messages have been confirmed to be received and the next message expected with the ID increased by 1. If the ID carried by the confirmation message is the same as the ID of the last message sent, it indicates that all messages have been confirmed.
[0014] According to an Internet of Things application layer protocol transmission method provided by the present invention, the updating of the sliding window includes: determining whether to reduce or expand the sliding window capacity based on the statistically obtained packet loss rate and the estimated sliding window capacity; wherein, after the message confirmation is completed, the packet loss rate needs to be updated, which is expressed as formula (1): loss rate =0.75*loss rate +0.25*loss / send send=k+loss (1)
[0015] Among them, loss rate Indicates the recent packet loss rate; loss indicates the number of packet losses in this round of data transmission, specifically the number of additional transmissions during the message confirmation process; send indicates the cumulative number of data transmissions in this round, specifically the capacity of the current sliding window and the number of additional transmissions during the message confirmation process; k indicates the capacity of the current sliding window.
[0016] According to an Internet of Things application layer protocol transmission method provided by the present invention, when the packet loss rate is updated, the size of the sliding window for the next round is determined: first, whether the sliding window can be expanded is determined, which is expressed as formula (2): k*2*loss rate <1 (2)
[0017] Estimate whether packet loss will occur after doubling the sliding window capacity k. If the result is less than 1, it means that packet loss will not occur and the maximum capacity requirement is met, which can be expressed as formula (3): k*2≤k max (3)
[0018] Among them, k max Indicates the maximum capacity of the sliding window.
[0019] According to an Internet of Things application layer protocol transmission method provided by the present invention, after the sliding window is expanded, a reduction judgment is performed, which is expressed as formula (4): k*loss rate ≥1 (4)
[0020] If the number of packet losses estimated by the current sliding window capacity and the packet loss rate is greater than or equal to 1, the sliding window is reduced by 1 / 2, but the minimum capacity requirement must be met, which is expressed as formula (5):
[0021] Among them, k min Indicates the minimum capacity of the sliding window.
[0022] According to an Internet of Things application layer protocol transmission method provided by the present invention, a server is waited for to return a confirmation message within a predetermined time after sending a message, and a random value RTO within a certain range is generated by using a fixed value and combining a random factor within the predetermined time.
[0023] To update and obtain RTO, the basic RTO is updated after each confirmation message is received, which is expressed as formula (6): SRTT=0.875*SRTT+0.125*RTT (6)
[0024] SRTT represents the smoothed RTT mean, RTT represents the time from the client sending a message in the last round to receiving an ACK, and the initial value of SRTT is the first RTT obtained by detection.
[0025] According to an IoT application layer protocol transmission method provided by the present invention, the number of times each message is sent is marked, and the timestamp of the sending is recorded respectively. The message body carries a marking option, and the corresponding marking option is also carried when the confirmation message is returned. The corresponding timestamp is found according to the marking option, and the RTT elapsed time is calculated, which is expressed as formula (7): RTTVAR=0.75*RTTVAR+0.25*|RTT-SRTT| (7)
[0026] Among them, RTTVAR represents the RTT mean error, which is obtained by the absolute difference between RTT and SRTT. The initial value of RTTVAR is 1 / 2 of the first RTT obtained by detection, which is expressed as formula (8): RTO init=SRTT+4*RTTVAR (8)
[0027] Among them, RTO init represents the basic waiting time, SRTT represents the smoothed RTT mean, and RTTVAR represents the RTT mean error.
[0028] According to an Internet of Things application layer protocol transmission method provided by the present invention, before each waiting, a specific predetermined time needs to be determined, which is expressed as formula (9) based on the number of packet losses during the confirmation process: RTO over =RTO init *pow(2,loss) (9)
[0029] When loss<3, the above formula (9) is used for calculation. The loss is consistent with the above, which represents the number of packets lost during the confirmation process;
[0030] Among them, RTO over Indicates the waiting time after the comprehensive packet loss, and pow represents the power function. If loss = 0, that is, when there is no packet loss, it is equal to the basic waiting time. Otherwise, it increases by a multiple of 2.
[0031] According to an Internet of Things application layer protocol transmission method provided by the present invention, when loss ≥ 3, formula (10) is used to calculate: RTO over =RTO init *4+RTO init *(loss-2) (10)
[0032] After the number of packet losses reaches 3, the additive linear growth is used instead, which is expressed as formula (11): RTo final =random(RTO over ,RTO over *1.5) (11)
[0033] Among them, RTo final Indicates the final actual waiting time; random indicates a random function that randomly takes any value between 2 values; the final actual waiting time is between 1 and 1.5 times the RTO over Pick a random value from the interval.
[0034] It can be seen that compared with the prior art, the present invention has the following beneficial effects:
[0035] 1. The present invention can adjust data transmission and reception according to network transmission delay, reducing the number of uplink transmissions while ensuring reliability.
[0036] 2. The present invention reduces the number of downlink reception times while ensuring reliability.
[0037] 3. The present invention has multiple QoS designs to meet various business needs.
[0038] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] FIG1 is a flow chart of an embodiment of an Internet of Things application layer protocol transmission method according to the present invention.
[0040] FIG2 is a schematic diagram of a flow chart of data transmission and confirmation when the number of parallel unconfirmed messages is 1 in an embodiment of an Internet of Things application layer protocol transmission method of the present invention.
[0041] FIG3 is a flow chart of a method for transmitting an application layer protocol of the Internet of Things according to an embodiment of the present invention, in which a sliding window is used to cache recently transmitted data.
[0042] FIG4 is a flow chart of a message confirmation process in an embodiment of an Internet of Things application layer protocol transmission method of the present invention.
[0043] FIG5 is a flow chart of a sliding window update process in an embodiment of an Internet of Things application layer protocol transmission method according to the present invention.
[0044] FIG6 is a flow chart showing an embodiment of an Internet of Things application layer protocol transmission method according to the present invention, which includes adding an update and acquisition of an RTO. DETAILED DESCRIPTION
[0045] To make the objectives, technical solutions, and advantages of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the embodiments described are only some of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.
[0046] Referring to FIG1 , the present invention provides an Internet of Things application layer protocol transmission method, which includes the following steps:
[0047] Step S1, sending a message;
[0048] Step S2, using a variable sliding window to cache the sent data;
[0049] Step S3, determining whether the capacity of the sliding window is full;
[0050] Step S4: After the sliding window is full, the message confirmation process is executed;
[0051] Step S5: After the message is confirmed, the sliding window is updated according to the packet loss rate;
[0052] Step S6: After the sliding window update is completed, the next round of data sending task is carried out.
[0053] In this embodiment, if no confirmation message is received from the server within a predetermined time after each message is sent, it is considered a timeout.
[0054] When the confirmation sending timeout occurs, the message needs to be sent again and the current retransmission count is increased by 1 to determine whether the maximum retransmission count limit is met. If the maximum retransmission count limit is reached, the message sending is forced to end.
[0055] Specifically, the message model of the present invention targets CoAP protocol CON-type messages, i.e., messages that require confirmation. The CoAP protocol uses a one-request, one-ACK response method for confirmation, and by default limits the number of concurrent unconfirmed messages to one. The specific process of data transmission and confirmation is shown in Figure 2.
[0056] The CoAP protocol requires a certain amount of time after each message is sent. If no ACK is received from the server within the specified time, it is considered a timeout. If the timeout occurs, the message must be sent again, and the current retransmission count is increased by 1. However, it is necessary to determine whether the maximum retransmission count limit is met. If the maximum retransmission count limit is reached, the message is forcibly terminated. The default maximum retransmission count for the CoAP protocol is 4.
[0057] The waiting time for each message sent by the CoAP protocol is calculated based on a base value and a random factor. The specific calculation formula is as follows: RTO = random(t, t*f)
[0058] RTO stands for waiting time; t stands for base time, typically 2 seconds; f stands for random growth factor, typically 1.5; and random stands for a random function that takes any value between two values. By default, the waiting time in the CoAP protocol is a random value between 2 and 3 seconds. In the event of a timeout, the waiting time is calculated as follows: RTO = RTO * 2
[0059] The waiting time for a new round increases to twice the waiting time for the previous round.
[0060] During the message confirmation process, if a timeout occurs and no confirmation message ACK is received, the last message sent will be resent; if a confirmation message ACK is received, it will be determined whether the ID carried by the confirmation message ACK meets all confirmation requirements. The ID carried by the confirmation message ACK indicates which messages have been confirmed to be received and the next message expected with the ID increased by 1. If the ID carried by the confirmation message ACK is the same as the ID of the last message sent, it means that all messages have been confirmed.
[0061] To better adapt to the common data reporting services of the Internet of Things and further reduce the RF power consumption of terminal devices, the message model of one request and one confirmation is changed to multiple requests and centralized confirmation. During the request process, a variable sliding window is used to cache recently sent data for retransmission. The specific process is shown in Figure 3.
[0062] Before the capacity of the sliding window is full, the message is sent without confirmation. After the sliding window is full, the message confirmation process is started, as shown in Figure 4. After the message confirmation is completed, the sliding window is reduced or expanded according to the number of packet losses.
[0063] Specifically, the update of the sliding window mainly depends on the statistical packet loss rate. The packet loss rate and the estimated window capacity are used to determine whether to reduce or expand the window capacity. The packet loss rate needs to be updated after the message is confirmed.
[0064] In this embodiment, as shown in FIG5 , updating the sliding window includes:
[0065] The packet loss rate and the estimated sliding window capacity are used to determine whether to reduce or expand the sliding window capacity.
[0066] Among them, the packet loss rate needs to be updated after the message is confirmed, which is expressed as formula (1): loss rate =0.75*loss rate +0.25*loss / send send=k+loss (1)
[0067] Among them, loss rate Indicates the recent packet loss rate; loss indicates the number of packet losses in this round of data transmission, specifically the number of additional transmissions during the message confirmation process; send indicates the cumulative number of data transmissions in this round, specifically the capacity of the current sliding window and the number of additional transmissions during the message confirmation process; k indicates the capacity of the current sliding window.
[0068] In this embodiment, after the packet loss rate is updated, the size of the sliding window for the next round is determined:
[0069] First, determine whether the sliding window can be expanded, which can be expressed as formula (2): k*2*loss rate <1 (2)
[0070] Estimate whether packet loss will occur after doubling the sliding window capacity k. If the result is less than 1, it means that packet loss will not occur and the maximum capacity requirement is met, which can be expressed as formula (3): k*2≤k max (3)
[0071] Among them, k maxIndicates the maximum capacity of the sliding window. In this method, the default value is 8. The sliding window cannot exceed the set maximum capacity after expansion. If the above two conditions are met, the sliding window can be expanded by 2 times.
[0072] In this embodiment, after the sliding window is expanded, a reduction judgment is performed, which is expressed as formula (4): k*loss rate ≥1 (4)
[0073] If the number of packet losses estimated by the current sliding window capacity and the packet loss rate is greater than or equal to 1, the sliding window is reduced by 1 / 2, but the minimum capacity requirement must be met, which is expressed as formula (5):
[0074] Among them, k min Indicates the minimum capacity of the sliding window. In this embodiment, the default value is 1. After the sliding window is reduced, it cannot be less than the set minimum capacity. If the above two conditions are met, the sliding window can be reduced by 1 / 2.
[0075] Of course, the sliding window needs to be confirmed repeatedly until the above conditions are no longer met and the sliding window update is stopped. After the sliding window update is completed, the next round of data sending tasks can be carried out.
[0076] In this embodiment, a predetermined time is waited for the server to return a confirmation message after the message is sent, and a fixed value is used in combination with a random factor to generate a random value RTO within a certain range within the predetermined time.
[0077] To update and obtain RTO, the basic RTO is updated after each confirmation message is received, which is expressed as formula (6): SRTT=0.875*SRTT+0.125*RTT (6)
[0078] SRTT represents the smoothed RTT mean, RTT represents the time from the client sending a message in the last round to receiving an ACK, and the initial value of SRTT is the first RTT obtained by detection.
[0079] In this embodiment, the number of times each message is sent is marked, and the timestamp of the sending is recorded respectively. The message body carries the marking option, and the corresponding marking option is also carried when the confirmation message is returned. The corresponding timestamp is found according to the marking option, and the RTT elapsed time is calculated, which is expressed as formula (7): RTTVAR=0.75*RTTVAR+0.25*|RTT-SRTT| (7)
[0080] Among them, RTTVAR represents the RTT mean error, which is obtained by the absolute difference between RTT and SRTT. The initial value of RTTVAR is 1 / 2 of the first RTT obtained by detection, which is expressed as formula (8). init =SRTT+4*RTTVAR (8)
[0081] Among them, RTO init represents the basic waiting time, SRTT represents the smoothed RTT mean, and RTTVAR represents the RTT mean error.
[0082] In this embodiment, before each waiting, a specific predetermined time needs to be determined, which is expressed as formula (9) based on the number of packet losses during the confirmation process: RTO over =RTO init *pow(2,loss) (9)
[0083] When loss<3, the above formula (9) is used for calculation. The loss is consistent with the above, which represents the number of packets lost during the confirmation process;
[0084] Among them, RTO over Indicates the waiting time after the comprehensive packet loss, and pow represents the power function. If loss = 0, that is, when there is no packet loss, it is equal to the basic waiting time. Otherwise, it increases by a multiple of 2.
[0085] When loss ≥ 3, use formula (10) to calculate: RTO over =RTO init *4+RTO init *(loss-2) (10)
[0086] After the number of packet losses reaches 3, the additive linear growth is used instead, which is expressed as formula (11): RTO final =random(RTO over ,RTO over *1.5) (11)
[0087] Among them, RTO final Indicates the final actual waiting time; random indicates a random function that randomly takes any value between 2 values; the final actual waiting time is between 1 and 1.5 times the RTO over Pick a random value from the interval.
[0088] In a specific application, this embodiment further provides a reliability retransmission algorithm, which specifically includes:
[0089] After sending a message, the CoAP client waits for a random amount of time for the server to return an ACK. This waiting time is a fixed value combined with a random factor to generate a random value within a certain range. This embodiment uses a basic algorithm similar to the TCP protocol and employs a new fallback mechanism in the event of packet loss, setting an upper limit on the waiting time to prevent excessive waiting times. The overall message sending and acknowledgment process is shown in Figure 6.
[0090] As shown in Figure 6, the overall process of the retransmission algorithm provided in this embodiment is consistent with the message confirmation process, except that the RTO is updated and obtained. The basic RTO needs to be updated every time an ACK is received. The specific formula is as follows: SRTT = 0.875*SRTT + 0.125*RTT
[0091] As can be seen, the RTT statistical method is different from the TCP protocol. The TCP protocol does not record the RTT of repeatedly sent messages. This embodiment marks the number of times each message is sent, such as the first time it is sent and the second time it is repeated. The client records the timestamp of each transmission. The message body carries a marking option, and the ACK return also carries the corresponding marking option. The client finds the corresponding timestamp based on the marking option, thereby accurately calculating the RTT elapsed time. The specific formula is as follows: RTTVAR = 0.75*RTTVAR + 0.25*|RTT-SRTT|
[0092] The initial value of RTTVAR is 1 / 2 of the first RTT detected. The specific formula is as follows: RTO init =SRTT+4*RTTVAR
[0093] Before each wait, you need to determine the specific waiting time. There are many situations depending on the number of packet losses during the confirmation process. The specific formula is as follows: RTO over =RTO init *pow(2,loss)
[0094] When loss<3, the above formula is used for calculation. loss is the same as above, indicating the number of packets lost during the confirmation process. RTO over Indicates the waiting time after the total packet loss. pow represents a power function, which here represents the loss power of 2. If loss = 0, that is, when there is no packet loss, it is equal to the basic waiting time. Otherwise, it increases by a multiple of 2. The specific formula is as follows: RTO over =RTO init *4+RTO init *(loss-2)
[0095] When loss ≥ 3, the above formula is used for calculation. After the number of packet losses reaches 3, the addition linear growth is used to prevent the waiting time from increasing too quickly. The specific formula is as follows: RTO final =random(RTO over ,RTO over *1.5)
[0096] The actual waiting time is between 1 and 1.5 times the RTO. over Random value is taken from the interval value. The specific formula is as follows: RTO final =min(RTO final ,RTO max )
[0097] min means taking the minimum value from the two; RTO max Indicates the maximum waiting time. In this embodiment, it is 48 seconds, which is consistent with the typical upper limit of the CoAP protocol. To prevent the waiting time from increasing indefinitely, it is necessary to set a maximum waiting time and ensure that the final waiting time is less than or equal to the maximum value.
[0098] In practical applications, this embodiment also provides three QoS standards, including:
[0099] Qos1: sliding window capacity k max =1, the maximum number of message retransmits max =4; in this case, the difference from the original CoAP protocol is small. Only the waiting time algorithm during the message confirmation process is changed. The message confirmation process is also consistent with the original protocol. In this case, message confirmation is more frequent, with a certain degree of data transmission reliability, the overall data transmission latency is low, and the power consumption of the terminal device is higher.
[0100] Qos2: Sliding window capacity k max =8, maximum number of message retransmits max =4; adding the sliding window capacity reduces the number of message confirmations and the power consumption of the terminal device, but may increase some data transmission delays.
[0101] Qos3: Sliding window capacity k max =8, maximum number of message retransmits max = 32; Increases the maximum number of message retransmissions, further improving data transmission reliability but increasing device power consumption. This is suitable for scenarios with poor network conditions and emphasis on data transmission reliability.
[0102] In summary, the present invention improves the original reliability retransmission algorithm of the CoAP protocol to enable it to dynamically adapt to the changing network environment; the present invention improves the original reliability message model of the CoAP protocol to reduce the number of downlink receptions while ensuring reliability; the present invention combines the improved protocol with business scenarios to design multi-type and multi-stage QoS to meet various business needs.
[0103] Therefore, the present invention can adjust data transmission and reception according to network transmission delay, reducing the number of uplink transmissions while ensuring reliability; the present invention reduces the number of downlink receptions while ensuring reliability; the present invention has multiple QoS designs to meet multiple business needs.
[0104] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0105] The above embodiments are only preferred embodiments of the present invention and cannot be used to limit the scope of protection of the present invention. Any non-substantial changes and replacements made by technicians in this field on the basis of the present invention fall within the scope of protection required by the present invention.
Claims
1. A method for transmitting an application layer protocol of the Internet of Things, characterized in that: The method comprises the following steps: Send a message; Use a variable sliding window to cache the sent data; Determine whether the capacity of the sliding window is full; When the sliding window capacity is full, the message confirmation process is executed; After the message is confirmed, the sliding window is updated according to the packet loss rate; After the sliding window update is completed, the next round of data sending task is carried out.
2. The method according to claim 1, characterized in that: If no confirmation message is received from the server within the scheduled time after each message is sent, it is considered a timeout; When the confirmation sending timeout occurs, the message needs to be sent again and the current retransmission count is increased by 1 to determine whether the maximum retransmission count limit is met. If the maximum retransmission count limit is reached, the message sending is forced to end.
3. The method according to claim 2, characterized in that: During the message confirmation process, if a timeout occurs and no confirmation message is received, the last message sent will be resent; if a confirmation message is received, it will be determined whether the ID carried by the confirmation message meets all confirmation requirements. The ID carried by the confirmation message indicates which messages have been confirmed to be received and the next message expected with the ID plus 1. If the ID carried by the confirmation message is the same as the ID of the last message sent, it means all are confirmed.
4. The method according to claim 1, characterized in that: The updating of the sliding window includes: The packet loss rate and the estimated sliding window capacity are used to determine whether to reduce or expand the sliding window capacity. Among them, after the message confirmation is completed, the packet loss rate needs to be updated, which is expressed as formula (1): loss rate =0.75*loss rate +0.25*loss / send send=k+loss (1) Among them, loss rate Indicates the recent packet loss rate; loss indicates the number of packet losses in this round of data transmission, specifically the number of additional transmissions during the message confirmation process; send indicates the cumulative number of data transmissions in this round, specifically the capacity of the current sliding window and the number of additional transmissions during the message confirmation process; k indicates the capacity of the current sliding window.
5. The method according to claim 4, characterized in that: When the packet loss rate is updated, determine the size of the next sliding window: First, determine whether the sliding window can be expanded, expressed as formula (2): k*2*loss rate <1 (2) Estimate whether packet loss will occur after the sliding window capacity k is doubled. If the result is less than 1, it means that packet loss will not occur and the maximum capacity requirement is met, which is expressed as formula (3): k*2≤k max (3) Among them, k max Indicates the maximum capacity of the sliding window.
6. The method according to claim 5, characterized in that: After the sliding window is expanded, a reduction judgment is made, which is expressed as formula (4): k*loss rate ≥1 (4) If the number of packet losses estimated by the current sliding window capacity and the packet loss rate is greater than or equal to 1, the sliding window is reduced by 1 / 2, but the minimum capacity requirement must be met, which is expressed as formula (5): Among them, k min Indicates the minimum capacity of the sliding window.
7. The method according to claim 1, characterized in that: Wait for the server to return a confirmation message within the scheduled time after sending the message. A fixed value combined with a random factor generates a random value RTO within a certain range. To update and obtain RTO, the basic RTO is updated after each confirmation message is received, which is expressed as formula (6): SRTT=0.875*SRTT+0.125*RTT (6) Among them, SRTT represents the smoothed RTT mean, RTT represents the time from the client sending a message in the last round to receiving an ACK, and the initial value of SRTT is the first RTT obtained by detection.
8. The method according to claim 7, characterized in that: The number of times each message is sent is marked, and the timestamp of the sending is recorded respectively. The message body carries the marking option, and the corresponding marking option is also carried when the confirmation message is returned. The corresponding timestamp is found according to the marking option, and the RTT elapsed time is calculated, which is expressed as formula (7): RTTVAR=0.75*RTTVAR+0.25*|RTT-SRTT| (7) Among them, RTTVAR represents the RTT mean error, which is obtained by the absolute difference between RTT and SRTT. The initial value of RTTVAR is 1 / 2 of the first RTT obtained by detection, which is expressed as formula (8): RTO init =SRTT+4*RTTVAR (8) Among them, RTO init represents the basic waiting time, SRTT represents the smoothed RTT mean, and RTTVAR represents the RTT mean error.
9. The method according to claim 8, characterized in that: Before each waiting, the specific scheduled time needs to be determined, which is expressed as formula (9) based on the number of packet losses during the confirmation process: RTO over =RTO init *pow(2,loss) (9) When loss<3, the above formula (9) is used for calculation, and the loss is consistent with the above, indicating the number of packets lost during the confirmation process; Among them, RTO over represents the waiting time after the comprehensive packet loss, pow represents the power function; if When loss=0, that is, when there is no packet loss, it is equal to the basic waiting time, otherwise it increases by a multiple of 2.
10. The method according to claim 9, characterized in that: When loss ≥ 3, use formula (10) to calculate: RTO over =RTO init *4+RTO init *(loss-2) (10) After the number of packet losses reaches 3, additive linear growth is used instead, expressed as formula (11): RTO final =random(RTO over ,RTO over *1.5) (11) Among them, RTO final Indicates the final actual waiting time; random indicates a random function that randomly takes any value between 2 values; the final actual waiting time is between 1 and 1.5 times the RTO over Pick a random value from the interval.
Citation Information
Patent Citations
Receiver sliding window-based data transmission method in parallel computer system
CN104484295A
Data packet transmission rate adjusting method, device and equipment and readable storage medium
CN111314237A
Internet of Things application layer protocol transmission method
CN116471240A
Kind of congestion improvement method based on the QUIC protocol
US20170353386A1
Cited By
Quic-based data transmission method and system
CN119697100A
