CN117579233B - Message retransmission method and device - Google Patents

Message retransmission method and device Download PDF

Info

Publication number
CN117579233B
CN117579233B CN202410056150.8A CN202410056150A CN117579233B CN 117579233 B CN117579233 B CN 117579233B CN 202410056150 A CN202410056150 A CN 202410056150A CN 117579233 B CN117579233 B CN 117579233B
Authority
CN
China
Prior art keywords
message
data
server
network address
address translation
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202410056150.8A
Other languages
Chinese (zh)
Other versions
CN117579233A (en
Inventor
蓝维宇
程行峰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Youyun Technology Co ltd
Original Assignee
Hangzhou Youyun Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Youyun Technology Co ltd filed Critical Hangzhou Youyun Technology Co ltd
Priority to CN202410056150.8A priority Critical patent/CN117579233B/en
Publication of CN117579233A publication Critical patent/CN117579233A/en
Application granted granted Critical
Publication of CN117579233B publication Critical patent/CN117579233B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/12Arrangements for detecting or preventing errors in the information received by using return channel
    • H04L1/16Arrangements for detecting or preventing errors in the information received by using return channel in which the return channel carries supervisory signals, e.g. repetition request signals
    • H04L1/18Automatic repetition systems, e.g. Van Duuren systems
    • H04L1/1867Arrangements specially adapted for the transmitter end
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/12Arrangements for detecting or preventing errors in the information received by using return channel
    • H04L1/16Arrangements for detecting or preventing errors in the information received by using return channel in which the return channel carries supervisory signals, e.g. repetition request signals
    • H04L1/1607Details of the supervisory signal
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/25Mapping addresses of the same type
    • H04L61/2503Translation of Internet protocol [IP] addresses
    • H04L61/2514Translation of Internet protocol [IP] addresses between local and global IP addresses
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Communication Control (AREA)

Abstract

The embodiment of the specification provides a message retransmission method and device. The method may include: and transmitting a synchronization message to a server in response to receiving a first confirmation message sent by a terminal device, wherein the first confirmation message carries first data, the synchronization message is used for requesting to establish connection with the server, retransmitting the synchronization message to the server in response to receiving the first confirmation message retransmitted by the terminal device and not establishing connection with the server yet, until receiving a data confirmation message sent by the server, the data confirmation message is used for notifying the network address conversion device that the server has received the first data, and transmitting a third confirmation message to the terminal device in response to receiving the data confirmation message, wherein the third confirmation message is used for notifying the terminal device that the server has completely received the first data.

Description

Message retransmission method and device
Technical Field
The present disclosure relates to the field of network communications technologies, and in particular, to a method and an apparatus for retransmitting a message.
Background
Network address translation (Network Address Translation, NAT) is a technique for using private addresses in a local network, which in turn uses global internet protocol (Internet Protocol, IP) addresses when connecting to the internet. NAT aims at translating IP addresses by mapping one external IP address and port to a larger set of internal IP addresses.
When the NAT device is in proxy transmission control protocol (Transmission Control Protocol, TCP) protocol, the client and the NAT device establish connection through TCP three-way handshake. At this time, the NAT device performs verification and buffering on the data sent by the client, and then sends an Acknowledgement (ACK) message to the client, and timely confirms to the client that all the data sent before has been received, so as to avoid the client retransmitting the data sent before the client does not receive the corresponding acknowledgement message for a long time. Meanwhile, the NAT device can actively establish connection to the server through TCP three-way handshake, and the client and the server can mutually transmit data through the NAT device on the basis of the established connection.
In the above process, when the NAT device establishes a TCP connection with the server, if a Synchronization (SYN) message is sent to the server by the NAT device, a SYN message loss condition may occur due to a network or other reasons. In the current SYN message retransmission mode, a SYN retransmission timer is usually added in the NAT device, and the SYN retransmission timer is started when the NAT device sends the SYN message to the server. If the SYN message transmission is lost, the NAT device will resend the previous SYN message to the server after the SYN retransmission timer expires. And until the three-way handshake process is completed, the TCP connection is established successfully, and the client and the server conduct data transmission through the NAT equipment.
However, adding a SYN retransmission timer in the NAT device may cause a large overhead of system resources of the NAT device, and if a situation that multiple retransmissions are needed is encountered, the retransmission time interval needs to be changed according to a certain rule, so that the SYN retransmission policy is relatively complex; and setting a separate SYN retransmission timer for the TCP connection with each client in the NAT equipment, and when the number of newly built TCP connections is more, consuming more system resources in the NAT equipment, thereby limiting the speed of the newly built TCP connection.
Disclosure of Invention
In order to overcome the problems in the related art, the present specification provides a method and apparatus for retransmitting a message.
In a first aspect of any embodiment of the present specification, there is provided a method for retransmitting a message, the method being performed by a network address translation device, the method comprising:
Responding to the first confirmation message sent by the terminal equipment, and sending a synchronous message to a server; the first confirmation message carries first data, and the synchronization message is used for requesting to establish connection with the server;
in response to receiving the first confirmation message retransmitted by the terminal equipment and not establishing connection with the server, retransmitting the synchronous message to the server until receiving the synchronous confirmation message sent by the server, and simultaneously sending a fourth confirmation message and a data transmission message to the server, wherein the network address conversion equipment and the server are completely established in connection;
In response to receiving a first acknowledgement message retransmitted by the terminal equipment, and connection is established with the server, retransmitting the fourth acknowledgement message and a data transmission message to the server until receiving a data acknowledgement message sent by the server, wherein the data acknowledgement message is used for notifying the network address conversion equipment that the server has received the first data;
And sending a third confirmation message to the terminal equipment in response to receiving the data confirmation message, wherein the third confirmation message is used for notifying the terminal equipment that the server has received the first data.
In a second aspect of any embodiment of the present specification, there is provided another method for retransmitting a message, the method being performed by a terminal device, the method including:
sending a first confirmation message to network address translation equipment, wherein the first confirmation message carries first data;
and retransmitting the first confirmation message to the network address conversion equipment until receiving the third confirmation message sent by the network address conversion equipment, wherein the third confirmation message is used for indicating that the server has received the first data.
According to a third aspect of any embodiment of the present specification, there is provided a message retransmission apparatus, the apparatus being executed by a network address translation device, the apparatus comprising:
the synchronous message sending module is used for responding to the first confirmation message sent by the terminal equipment and sending the synchronous message to the server; the first confirmation message carries first data, and the synchronization message is used for requesting to establish connection with the server;
A synchronous message retransmission module, configured to retransmit, to the server, the synchronous message in response to receiving a first acknowledgement message retransmitted by the terminal device and not yet establishing a connection with the server, until receiving a data acknowledgement message sent by the server, where the data acknowledgement message is used to notify the network address translation device that the server has received the first data;
And the third confirmation message sending module is used for responding to the received data confirmation message and sending a third confirmation message to the terminal equipment, wherein the third confirmation message is used for informing the terminal equipment that the server has received the first data.
According to a fourth aspect of any embodiment of the present disclosure, there is provided another apparatus for retransmitting a message, the apparatus being executed by a terminal device, the apparatus comprising:
The first acknowledgement message sending module is used for sending a first acknowledgement message to the network address translation equipment, wherein the first acknowledgement message carries first data;
And the first acknowledgement message retransmission module is used for retransmitting the first acknowledgement message to the network address conversion equipment until receiving the third acknowledgement message sent by the network address conversion equipment in response to the fact that the third acknowledgement message sent by the network address conversion equipment is not received before the retransmission timer is overtime, wherein the third acknowledgement message is used for indicating that the server has received the first data.
According to a fifth aspect of any embodiment of the present specification, there is provided an electronic device comprising:
A processor;
A memory for storing processor-executable instructions;
Wherein the processor implements the methods described in any of the embodiments of the present specification by executing the executable instructions.
According to a sixth aspect of any of the embodiments of the present description, there is provided a computer readable storage medium having stored thereon computer instructions which when executed by a processor perform the steps of a method as described in any of the embodiments of the present description above.
The technical scheme provided by the embodiment of the specification can comprise the following beneficial effects:
According to the above embodiment, it can be known that, by responding to the first acknowledgement message sent by the terminal device, sending the synchronization message to the server, responding to the first acknowledgement message received by the terminal device and not yet establishing a connection with the server, retransmitting the synchronization message to the server until the data acknowledgement message sent by the server is received, according to the retransmission policy of the terminal device, the success rate of retransmitting the synchronization message can be improved, and the retransmission timer and the retransmission policy do not need to be set independently in the network address conversion device, so that the system resource in the network address conversion device is avoided being consumed additionally, the rate of newly-built connection of the network address conversion device is not affected, after receiving the data acknowledgement message, sending the third acknowledgement message to the terminal device, notifying the terminal device that the server has received the first data, so that the terminal device stops retransmitting the first acknowledgement message, and the realization process of retransmitting the synchronization message is simpler and lighter.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application.
FIG. 1 is a timing diagram of a NAT device proxy TCP protocol according to one exemplary embodiment shown in the present specification;
FIG. 2 is a timing diagram of a SYN message retransmission shown in the present specification according to an exemplary embodiment;
fig. 3 is a flow chart illustrating a method of message retransmission according to an exemplary embodiment of the present disclosure;
Fig. 4 is a timing diagram of a message retransmission method according to an exemplary embodiment of the present disclosure;
fig. 5 is a flow chart illustrating another method of message retransmission according to an exemplary embodiment of the present disclosure;
FIG. 6 is a timing diagram of a transmission of a second acknowledgement message according to an example embodiment of the present disclosure;
FIG. 7 is a timing diagram of a retransmission of a fourth acknowledgement message and first data according to an example embodiment of the present disclosure;
FIG. 8 is a schematic diagram of an electronic device according to an exemplary embodiment of the present disclosure;
fig. 9 is a block diagram of a message retransmission apparatus according to an exemplary embodiment of the present disclosure;
fig. 10 is a block diagram of another message retransmission apparatus according to an exemplary embodiment of the present disclosure.
Detailed Description
Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary examples do not represent all implementations consistent with the present specification. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present description as detailed in the accompanying claims.
The terminology used in the description presented herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the description. As used in this specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any or all possible combinations of one or more of the associated listed items.
It should be understood that although the terms first, second, third, etc. may be used in this specification to describe various information, these information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, the first information may also be referred to as second information, and similarly, the second information may also be referred to as first information, without departing from the scope of the present description. The word "if" as used herein may be interpreted as "at … …" or "at … …" or "in response to a determination" depending on the context.
When the NAT equipment is in proxy TCP protocol, the NAT equipment needs to respectively carry out three-way handshake with the client and the server to establish TCP connection. Fig. 1 shows a timing diagram of a NAT device proxy TCP protocol. As shown in fig. 1, the client and the NAT device first establish a connection through a TCP three-way handshake, and then the client sends an ACK message with a first sequence number seq=w and a data length len=r.
At this time, the NAT device performs data processing on the data, and then sends an ACK message with an acknowledgement number of ack=w+r and a data length len=0 to the client, so as to notify the client that the NAT device has received the ACK message.
Meanwhile, the NAT device can actively establish connection to the server through TCP three-way handshake, and the client and the server can mutually transmit data through the NAT device on the basis of the established connection.
In the above procedure, if the SYN message (e.g., SYN.
The current common SYN message retransmission method is to add a SYN retransmission timer corresponding to the client in the NAT device. Fig. 2 shows a timing diagram of SYN message retransmission, where, as shown in fig. 2, the client and the NAT device first establish a connection through a TCP three-way handshake.
After receiving the ACK message sent by the client, the NAT device starts a SYN retransmission timer in the NAT device when the NAT device sends the SYN message to the server. When the SYN message transmission is lost, the NAT device retransmits the SYN message to the server after the timer expires. And after the server receives the SYN message, the NAT equipment and the server continue the subsequent two-time handshake process, so that connection establishment is completed, and data transmission is performed.
However, adding a SYN retransmission timer in the NAT device requires customizing and maintaining a SYN retransmission policy, which may cause a large overhead of system resources of the NAT device; and setting a separate SYN retransmission timer for the TCP connection with each client in the NAT equipment, and when the number of newly built TCP connections is more, consuming more system resources in the NAT equipment, thereby limiting the speed of the newly built TCP connection.
In order to solve the above-mentioned problems, the embodiments of the present disclosure provide a method and an apparatus for retransmitting a message, and before introducing the method for retransmitting a message, in order to make the description of the method easier to understand, first, some concepts related to the following description of the embodiments of the present disclosure are explained:
1) TCP protocol
The TCP protocol is a transport protocol specifically designed to provide reliable end-to-end byte streams over unreliable internetworks. When in TCP communication, three handshakes are needed to be performed first to establish TCP connection before data packets can be sent. Four hand swings are required before the TCP connection is broken.
The actual application scene of the TCP protocol is divided into two modes of short connection and long connection. The short connection is a scene with large concurrency, such as http service of a web site, and the like, wherein the scene is mainly used for sending a data packet after the connection is established by three-way handshake, disconnecting the connection after the data communication is completed and releasing TCP connection resources. The long connection is a scene that the three-way handshake of the two parties is used for establishing connection, then the connection state is kept, data interaction is continuously carried out, the connection is disconnected only when the service is terminated, and the long connection is used for a scene that the concurrency is not large but frequent data interaction is needed by the two parties, such as most online games and the like.
2) Three-way handshake
In the TCP protocol, the three-way handshake is a process of exchanging three TCP segments between two communication parties in the process of establishing a TCP connection, taking the two communication parties as a client and a server as examples:
First handshake: when the connection is established, the client sends a SYN message to the server, and enters a SYN_SENT state to wait for confirmation of the server.
Second handshake: the server receives the SYN message, must confirm the SYN message of the client, and send a SYN message, namely syn+ack message, at the same time, the server enters into syn_recv state.
Third handshake: and the client receives the SYN+ACK message of the server, sends the ACK message to the server, and after the ACK message is sent, the client and the server enter an ESTABLISHED (TCP connection success) state to complete three-way handshake.
For further explanation of this specification, the following examples are provided:
Referring to fig. 3, fig. 3 is a flowchart illustrating a method for retransmitting a message according to an exemplary embodiment of the present disclosure. The method may be performed by a network address translation device (NAT device) that may be used to forward data in a terminal device request to a server, as applied to proxy TCP protocol scenarios.
Wherein the network address translation device is an edge device that connects an internal network and an external network that configures network address translation, such as: routers, firewalls, gateway devices, etc. The terminal device is a program that provides a local service to a client, for example: and clients such as mobile phones and computers. A server is a computer device that manages resources and provides network services to users, such as: web servers, database servers, etc.
The message retransmission method can comprise the following steps:
Step 302: responding to the first confirmation message sent by the terminal equipment, and sending a synchronous message to a server; the first confirmation message carries first data, and the synchronization message is used for requesting to establish connection with the server.
In this step, the terminal device performs a three-way handshake with the network address translation device, and establishes a TCP connection. The terminal device sends a first confirmation message to the network address translation device, and at the same time, the terminal device starts a retransmission timer in the terminal device.
The first acknowledgement message is used for transmitting first data to the network address translation device. The first acknowledgement message carries first data, where the first data is target data to be sent to the server by the terminal device through the network address translation device. The retransmission timer is used for monitoring the data of the sent but not received confirmation message, retransmitting the data if the retransmission timer is overtime and does not receive confirmation of the message, and resetting the retransmission timer.
The network address conversion equipment responds to the received first confirmation message sent by the terminal equipment, verifies the safety, the validity and the like of the first data carried by the first confirmation message, and caches the first data. The network address translation device requests to establish a connection with the server and sends a synchronization message to the server. The sending of the synchronization message is the first of the three-way handshake, and the synchronization message may be used to request a connection to be established with the server.
To further illustrate the first acknowledgement message, fig. 4 shows a timing diagram of a message retransmission method. As shown in fig. 4, the terminal device sends a SYN message to the network address translation device to request connection establishment, the network address translation device sends a syn_ack message to the terminal device, and after receiving the syn_ack message, the terminal device sends an ACK message to the network address translation device to complete establishment of a TCP connection between the terminal device and the network address translation device.
The terminal equipment sends a first confirmation message to the network address translation equipment, wherein the first confirmation message carries first data. The network address translation equipment caches the first data, sends a synchronous message to the server, and requests to establish TCP connection with the server.
It will be appreciated that the message retransmission process of the message retransmission method shown in fig. 4 is only an example, and other message retransmission processes may be adopted, so long as the message retransmission process can implement the method described in the embodiments of the present specification, which is not limited thereto.
Step 304: and in response to receiving the first confirmation message retransmitted by the terminal equipment, and not establishing connection with the server, retransmitting the synchronous message to the server until receiving the data confirmation message sent by the server, wherein the data confirmation message is used for notifying the network address conversion equipment that the server has received the first data.
In this step, if the synchronization message is lost due to network environment, server status abnormality, etc., the terminal device retransmits the first acknowledgement message to the network address translation device after the retransmission timer in the terminal device is overtime.
After receiving the first confirmation message retransmitted by the terminal equipment, the network address conversion equipment detects the connection state of the network address conversion equipment and the server. If the fact that the synchronous confirmation message sent by the server is not received is detected, the network address conversion equipment does not establish connection with the server yet. At this time, the network address translation device may retransmit the synchronization message to the server, and request to establish connection with the server again.
After retransmitting the first acknowledgement message, the terminal device restarts the retransmission timer. If the synchronous message retransmitted by the network address conversion equipment is lost again, the terminal equipment retransmits the first confirmation message to the network address conversion equipment again after the retransmission timer overtime again.
And the network address conversion equipment retransmits the synchronous message to the server again in response to receiving the first confirmation message retransmitted by the terminal equipment again. The network address conversion equipment continuously responds to the first confirmation message retransmitted by the terminal equipment and retransmits the synchronous message to the server until the data confirmation message sent by the server is received. The data confirmation message is used for notifying the network address translation equipment server that the first data has been received.
If the server receives the retransmitted synchronous message, the server sends a synchronous confirmation message to the network address conversion equipment. After receiving the synchronization confirmation message sent by the server, the network address conversion equipment sends an ACK message to the server, and the network address conversion equipment and the server are successfully connected.
After the network address translation device establishes a connection with the server, the network address translation device may send the first data to the server over the connection. The network address translation device may send a data transmission message to the server, where the data transmission message carries the first data. The data transmission message is used for transmitting the first data to the server. The data transmission message includes, but is not limited to: the sequence number and the data length of the first data are preset.
With continued reference to fig. 4, when the transmission of the synchronization message is lost, the terminal device retransmits the first acknowledgement message to the network address translation device after the retransmission timer in the terminal device expires. The network address translation device receives the first confirmation message retransmitted by the terminal device, and the network address translation device does not successfully establish connection with the server yet, and retransmits the synchronous message to the server.
The server receives the retransmitted synchronous message, sends a synchronous confirmation message to the network address conversion equipment, and after receiving the synchronous confirmation message, the network address conversion equipment sends an ACK message to the server to complete the establishment of TCP connection between the network address conversion equipment and the server.
After the network address translation device establishes a connection with the server, the network address translation device sends a data transmission message carrying the first data to the server through the connection. The preset sequence number in the data transmission message is shown as y, and the data length of the first data is shown as a. Sequence number seq=y in data transmission message, data length len=a.
And after receiving the data transmission message carrying the first data, the server sends a data confirmation message to the network address conversion equipment. Acknowledgement number ack=y+a in the data acknowledgement message, data length len=0.
Step 306: and sending a third confirmation message to the terminal equipment in response to receiving the data confirmation message, wherein the third confirmation message is used for notifying the terminal equipment that the server has received the first data.
In this step, after receiving the data confirmation message sent by the server, the network address conversion device verifies whether all the first data are received by the server according to the sequence number in the data confirmation message. If the confirmation number in the data confirmation message is equal to the sum of the preset serial number and the data length of the first data, the server receives all the first data.
The network address translation device may release the content and space for buffering the first data and send a third acknowledgement message to the terminal device, disabling the retransmission timer in the terminal device. The third confirmation message is used for notifying the terminal equipment server that the first data are received.
With continued reference to fig. 4, the network address translation device, in response to receiving the data confirmation message sent by the server, verifies that the sequence number in the data confirmation message is equal to the sum of the preset sequence number y and the data length a of the first data, releases the content and the space for caching the first data, and sends a third confirmation message to the terminal device, so as to notify the terminal device that the server has received the first data.
According to the message retransmission method, the synchronization message is sent to the server by responding to the first confirmation message sent by the terminal equipment, the synchronization message is retransmitted to the server by responding to the first confirmation message which is received and retransmitted by the terminal equipment and is not connected with the server, until the data confirmation message sent by the server is received, the success rate of retransmitting the synchronization message can be improved according to the retransmission strategy of the terminal equipment, and the retransmission timer and the retransmission strategy are not required to be independently set in the network address conversion equipment, so that the system resource in the network address conversion equipment is not consumed additionally, the rate of newly-built connection of the network address conversion equipment is not influenced, after the data confirmation message is received, the third confirmation message is sent to the terminal equipment, the terminal equipment server is informed of the fact that the first data is received, the terminal equipment stops retransmitting the first confirmation message, and the realization process of retransmitting the synchronization message is simpler and lighter.
Referring to fig. 5, fig. 5 is a flowchart illustrating another method for retransmitting a message according to an exemplary embodiment of the present disclosure. As shown in fig. 5, the method performed by the terminal device may include the steps of:
Step 502: and sending a first confirmation message to the network address translation equipment, wherein the first confirmation message carries first data.
In this step, the terminal device performs a three-way handshake with the network address translation device, and establishes a TCP connection. After the TCP connection is established successfully, the terminal equipment sends a first confirmation message to the network address translation equipment, and meanwhile, the terminal equipment starts a retransmission timer in the terminal equipment. The first confirmation message carries first data.
Step 504: and retransmitting the first confirmation message to the network address conversion equipment until receiving the third confirmation message sent by the network address conversion equipment, wherein the third confirmation message is used for indicating that the server has received the first data.
In this step, if the third acknowledgement message sent by the network address translation device is not received before the retransmission timer expires, the terminal device considers that the network address translation device does not receive the first acknowledgement message and the first data. And after the retransmission timer is overtime, the terminal equipment retransmits the first confirmation message to the network address conversion equipment.
After the terminal equipment retransmits the first acknowledgement message, the retransmission timer in the terminal equipment restarts to count. If the synchronous message retransmitted by the network address conversion equipment is lost again, the terminal equipment retransmits the first confirmation message to the network address conversion equipment again after the retransmission timer is overtime.
Until the terminal equipment receives the third confirmation message sent by the network address conversion equipment, the terminal equipment receives the notification that the server has received the first data, the retransmission timer in the terminal equipment is invalid, and the terminal equipment stops retransmitting the first confirmation message.
Further, the terminal device may record the retransmission times of the first acknowledgement message. And under the condition that the retransmission times of the first confirmation message reach a preset threshold value, the terminal equipment confirms that the first confirmation message cannot be normally transmitted and stops retransmitting the first confirmation message.
The preset threshold is the preset maximum retransmission times of the terminal equipment. The number of retransmissions reaches a preset threshold, for example, the number of retransmissions may be greater than or equal to the preset threshold, or the number of retransmissions may be greater than or equal to the preset threshold.
As described above, by stopping retransmitting the first acknowledgement message when the number of times of retransmission of the first acknowledgement message reaches the preset threshold, the terminal device is prevented from retransmitting the first acknowledgement message all the time under the condition that the first acknowledgement message cannot be normally transmitted, and resources of the terminal device and the network address conversion device are occupied.
According to the message retransmission method, the first acknowledgement message is sent to the network address conversion device, the first acknowledgement message carries first data, the first acknowledgement message is retransmitted to the network address conversion device in response to the fact that the third acknowledgement message sent by the network address conversion device is not received before the retransmission timer is overtime, retransmission is stopped after the third acknowledgement message sent by the network address conversion device is received, the realization process of retransmitting the synchronous message is simpler and lighter, the success rate of retransmitting the synchronous message can be improved according to the retransmission strategy of the terminal device, and the retransmission timer and the retransmission strategy are not required to be independently set in the network address conversion device, so that system resources in the network address conversion device are avoided being consumed, and the rate of newly-built connection of the network address conversion device is not affected.
In the foregoing embodiments, a message retransmission process in which a network address translation device proxies data communications between a terminal device and a server is described. In the following embodiments, a more detailed description will be made about how to determine the data length carried in the retransmitted first acknowledgement message, and may be applied to any of the embodiments as above.
In an embodiment, the network address translation device sends the second acknowledgement message to the terminal device in response to receiving the first acknowledgement message sent by the terminal device for the first time, so that the first acknowledgement message retransmitted by the terminal device only includes part of the data.
The second confirmation message is used for determining data in the first confirmation message retransmitted by the terminal equipment. The manner in which the second acknowledgement packet determines the retransmission data may be, for example, a length of the retransmission data set by transmission in the second acknowledgement packet, or may be that the retransmission data is carried in the second acknowledgement packet, which is not limited in this embodiment of the present disclosure.
As described above, the network address conversion device responds to the first acknowledgement message sent by the terminal device, and sends the second acknowledgement message to the terminal device, so that the retransmitted first acknowledgement message does not need to carry all the first data again, and only needs to carry part of the data, thereby saving the network bandwidth of the terminal device.
Correspondingly, the terminal equipment responds to the fact that the third confirmation message sent by the network address conversion equipment is not received before the retransmission timer is overtime, and retransmits the first confirmation message to the network address conversion equipment based on the received second confirmation message sent by the network address conversion equipment, wherein the first confirmation message only needs to contain part of data.
And stopping retransmitting the first confirmation message by the terminal equipment until the terminal equipment receives the third confirmation message sent by the network address conversion equipment.
As described above, by responding to that the third acknowledgement message sent by the network address translation device is not received before the retransmission timer times out, the first acknowledgement message is retransmitted to the network address translation device based on the received second acknowledgement message sent by the network address translation device, and all the first data are not required to be carried in the retransmitted first acknowledgement message again, and only part of the data are required to be carried, so that the network bandwidth of the terminal device is saved.
Further, the network address translation device receives a first acknowledgement message sent by the terminal device, which includes but is not limited to: the first sequence number and a first length value of the first data. The first sequence number may be used to track and confirm a receiving state of the first data, and the first length value is a data length of the first data.
The second acknowledgement message sent by the network address translation device to the terminal device includes, but is not limited to: a first acknowledgement number and a second length value. The first acknowledgement number is determined based on the first sequence number, the first length value and a preset value, and the second length value is 0.
The preset value may be a length of data in the retransmission first acknowledgement message, and the preset value may be any value selected from a range of one to one less than the first length value.
Taking the first acknowledgement number as the sum of the first serial number and the first length value minus the preset value as an example, the network address translation device sends a second acknowledgement message. The first acknowledgement number in the second acknowledgement message is subtracted by the preset value, and the terminal device receives the second acknowledgement message, so that the length of the data which is not received by the network address translation device is considered to be the preset value.
The terminal device may determine the length of the data carried in the retransmitted first acknowledgement message based on the first acknowledgement number in the received second acknowledgement message sent by the network address translation device after the retransmission timer times out, and retransmit the first acknowledgement message carrying part of the data to the network address translation device.
As described above, the preset value is set in the first acknowledgement number of the second acknowledgement message, so as to limit the data carried in the first acknowledgement message retransmitted by the terminal device, thereby saving the network bandwidth of the terminal device.
Correspondingly, the first acknowledgement message sent by the terminal device to the network address translation device includes, but is not limited to: the first sequence number and a first length value of the first data. The first sequence number may be used to track and confirm a receiving state of the first data, and the first length value is a data length of the first data.
The receiving, by the terminal device, the second acknowledgement packet sent by the network address translation device includes, but is not limited to: a first acknowledgement number and a second length value. The first acknowledgement number is determined based on the first sequence number, the first length value and a preset value, and the second length value is 0.
Taking the first confirmation number as the sum of the first serial number and the first length value and subtracting a preset value as an example, the terminal equipment receives a second confirmation message sent by the network address conversion equipment, and after receiving the second confirmation message, the terminal equipment considers the length of data which is not received by the network address conversion equipment as the preset value because the first confirmation number in the second confirmation message subtracts the preset value.
The terminal device does not receive the third acknowledgement message sent by the network address translation device before the retransmission timer times out. After the retransmission timer is overtime, the terminal device can determine the length of the data carried in the retransmitted first acknowledgement message based on the preset value of the second acknowledgement message sent by the network address conversion device, and retransmit the first acknowledgement message carrying part of the data to the network address conversion device.
Further, the network address translation device sends the second acknowledgement message to the terminal device, so that the terminal device can determine the length of the data carried in the retransmitted first acknowledgement message based on the preset value of the received second acknowledgement message. The first acknowledgement message of the retransmission received by the network address translation device carries the second data.
The second data is data included in a part of bytes of the first data, and the length of the second data is determined according to a preset value. The second data may be selected, for example, by selecting data of a preset value from the first byte of the first data, or by selecting data of a preset value from the last byte of the first data, which is not limited in this embodiment of the present disclosure.
As described above, by sending the second acknowledgement message to the terminal device, the terminal device may determine the length of the data carried in the retransmitted first acknowledgement message based on the preset value of the received second acknowledgement message, and receive the second data included in the partial byte of the first data carried in the retransmitted first acknowledgement message, thereby saving the network bandwidth of the terminal device.
Correspondingly, the terminal device may determine the length of the data carried in the retransmitted first acknowledgement packet based on the preset value of the second acknowledgement packet sent by the network address translation device, and carry the second data in the first acknowledgement packet retransmitted to the network address translation device.
The second data is data included in a part of bytes of the first data, and the length of the second data is determined according to a preset value.
As described above, by determining the length of the second data carried in the retransmitted first acknowledgement packet based on the preset value of the second acknowledgement packet sent by the network address translation device, the second data included in the partial byte carrying the first data is determined in the retransmitted first acknowledgement packet, and the partial byte in the first data is retransmitted, thereby saving the network bandwidth of the terminal device.
In another embodiment, the third acknowledgement message sent by the network address translation device to the terminal device includes the second acknowledgement number. The second acknowledgement number may be used to notify the terminal device that all the first data has been received, and the second acknowledgement number is determined based on the first sequence number and the first length value, and may be a sum of the first sequence number and the first length value.
As described above, by including the second acknowledgement number in the third acknowledgement message sent by the network address translation device to the terminal device, the terminal device server may be notified that all the first data has been received, so that the retransmission timer in the terminal device is disabled, thereby avoiding that the terminal device retransmits the first acknowledgement message again.
Correspondingly, the third confirmation message sent by the network address translation equipment is received by the terminal equipment and comprises the second confirmation number. The second acknowledgement number may be used to determine that the server has received all the first data, so that the terminal device stops retransmitting the first acknowledgement message.
As described above, by including the second acknowledgement number in the third acknowledgement message sent by the network address translation device received by the terminal device, the terminal device may receive a notification that all the first data has been received by the server, and set the retransmission timer in the terminal device to be invalid, so as to avoid the terminal device retransmitting the first acknowledgement message again.
To further illustrate the second acknowledgement message, fig. 6 shows a timing diagram for transmitting the second acknowledgement message. As shown in fig. 6, the terminal device performs three-way handshake with the network address translation device, and after the TCP connection is established successfully, the terminal device sends a first acknowledgement message carrying first data to the network address translation device. Illustratively, the first sequence number seq=x in the first acknowledgement message and the first length value len=a of the first data.
After the network address conversion equipment receives the first confirmation message for the first time, the network address conversion equipment verifies and caches the first data and sends a synchronous message to the server. And, a second acknowledgement message is sent to the terminal device, taking the preset value as 1 as an example, the first acknowledgement number ack=x+a-1 in the second acknowledgement message, and the second length value len=0.
The synchronous message is lost in the transmission process, after the retransmission timer is overtime, the terminal equipment retransmits the first confirmation message to the network address conversion equipment according to the received second confirmation message, and the retransmission timer restarts timing.
The second data carried in the retransmitted first acknowledgement message is the last byte data transmitted last time, the length of the second data is 1, the sequence number seq=x+a-1 in the retransmitted first acknowledgement message, and the length value len=1.
When the network address translation device does not establish TCP connection with the server, the network address translation device retransmits the synchronous message to the server in response to receiving the first confirmation message retransmitted by the terminal device.
After the network address translation device receives the first confirmation message retransmitted by the terminal device, the network address translation device does not need to send the second confirmation message to the terminal device again. If the terminal device does not receive the third acknowledgement message sent by the network address conversion device before the retransmission timer is overtime, the terminal device determines the data length carried in the retransmitted first acknowledgement message again based on the second acknowledgement message after the retransmission timer is overtime.
After receiving the retransmitted synchronous message and establishing TCP connection with the network address conversion equipment, the network address conversion equipment sends a data transmission message to the server, wherein the data transmission message carries first data cached by the network address conversion equipment. And after receiving the first data, the server sends a data confirmation message to the network address translation equipment.
And the network address conversion equipment responds to the received data confirmation message and sends a third confirmation message to the terminal equipment. The third acknowledgement message includes a second acknowledgement number ack=x+a, which is determined based on the first sequence number x and the first length value a.
In the foregoing embodiment, it is described that the network address translation device sends the second acknowledgement message to the terminal device, and determines the data length carried in the first acknowledgement message retransmitted by the terminal device. In the following embodiments, a more detailed description will be made on how to retransmit the first data, and may be applied to any of the above embodiments.
In one embodiment, the network address translation device sends a synchronization message to the server, and the server sends a synchronization confirmation message to the network address translation device after receiving the synchronization message. The network address conversion device responds to the synchronous confirmation message sent by the server, sends a fourth confirmation message to the server, completes the establishment of TCP connection with the server, and sends a data transmission message carrying first data to the server.
The fourth acknowledgement message is used to indicate that the synchronous acknowledgement message has been received, and is the third handshake in the three-way handshake of the TCP connection.
After receiving the first confirmation message retransmitted by the terminal equipment, the network address conversion equipment detects the connection state of the network address conversion equipment and the server. If the synchronous message is detected to be sent to the server and the synchronous confirmation message sent by the server is received, the fourth confirmation message and/or the data transmission message carrying the first data are/is confirmed to be lost.
And the network address conversion equipment retransmits a fourth confirmation message and a data transmission message carrying the first data to the server in response to receiving the first confirmation message retransmitted by the terminal equipment. Until the network address conversion equipment receives the data confirmation message sent by the server, the network address conversion equipment sends a third confirmation message to the terminal equipment so as to enable the terminal equipment to stop retransmitting the first confirmation message.
To further illustrate the retransmission of the fourth acknowledgement message and the first data, fig. 7 shows a timing diagram of the retransmission of the fourth acknowledgement message and the first data. As shown in fig. 7, the terminal device performs three-way handshake with the network address translation device, and after the TCP connection is established successfully, the terminal device sends a first acknowledgement message carrying first data to the network address translation device. After receiving the first confirmation message, the network address conversion equipment verifies and caches the first data and sends a synchronous message to the server.
The synchronous message is lost in the transmission process, and the terminal equipment retransmits the first confirmation message to the network address conversion equipment after the retransmission timer is overtime. The network address translation device responds to the received first confirmation message, and detects the connection state of the network address translation device and the server.
The network address translation device detects that the synchronization confirmation message sent by the server has not been received, and the network address translation device has not established a connection with the server. The network address translation device retransmits the synchronization message to the server.
And after receiving the synchronization message retransmitted by the network address conversion equipment, the server sends a synchronization confirmation message to the network address conversion equipment. The network address conversion equipment responds to the received synchronous confirmation message, sends a fourth confirmation message to the server, completes the establishment of TCP connection, and sends a data transmission message carrying first data to the server.
In the transmission process, the fourth acknowledgement message and the data transmission message are lost. And the terminal equipment still does not receive the third acknowledgement message before the retransmission timer is overtime again, and retransmits the first acknowledgement message to the network address conversion equipment after the retransmission timer is overtime.
The network address translation device detects a connection state of the network address translation device and the server in response to receiving the retransmitted first acknowledgement message. The network address translation device detects that a synchronization message has been sent to the server and that a synchronization confirmation message sent by the server has been received. The network address translation device retransmits the fourth acknowledgement message and the data transmission message carrying the first data to the server.
After receiving the fourth confirmation message and the data transmission message carrying the first data, the server sends the data confirmation message to the network address conversion equipment. The network address conversion equipment receives the data confirmation message, sends a third confirmation message to the terminal equipment, informs the terminal equipment server that the first data is received, and the terminal equipment stops retransmitting the first confirmation message.
As described above, by sending the fourth acknowledgement message and the first data to the server in response to receiving the synchronization acknowledgement message sent by the server, retransmitting the fourth acknowledgement message and the first data to the server according to the retransmission policy of the terminal device based on the received retransmitted first acknowledgement message, until the data acknowledgement message sent by the server is received, without separately setting a retransmission timer and a retransmission policy in the network address conversion device, so as to retransmit the lost fourth acknowledgement message and the first data.
Fig. 8 is a schematic structural view of an electronic device according to an exemplary embodiment of the present specification. Referring to fig. 8, at the hardware level, the electronic device includes a processor 802, an internal bus 804, a network interface 806, memory 808, and non-volatile storage 810, although other hardware required for other services is also possible. The processor 802 reads the corresponding computer program from the nonvolatile memory 810 into the memory 808 and then runs to form a message retransmission device at a logic level. Of course, other implementations, such as logic devices or combinations of hardware and software, are not excluded from the present application, that is, the execution subject of the following processing flows is not limited to each logic unit, but may be hardware or logic devices.
Fig. 9 is a block diagram of a message retransmission apparatus according to an exemplary embodiment of the present disclosure. Referring to fig. 9, the apparatus may include: a synchronous message sending module 902, a synchronous message retransmitting module 904, and a third acknowledgement message sending module 906, wherein:
the synchronous message sending module 902 is configured to send a synchronous message to a server in response to receiving a first acknowledgement message sent by a terminal device; the first confirmation message carries first data, and the synchronization message is used for requesting to establish connection with the server.
The synchronous message retransmission module 904 is configured to retransmit, in response to receiving a first acknowledgement message retransmitted by the terminal device and not yet establishing a connection with the server, the synchronous message to the server until receiving a data acknowledgement message sent by the server, where the data acknowledgement message is used to notify the network address translation device that the server has received the first data.
The third acknowledgement message sending module 906 is configured to send a third acknowledgement message to the terminal device in response to receiving the data acknowledgement message, where the third acknowledgement message is used to notify the terminal device that the server has received the first data.
In one example, the synchronous message sending module 902 is further configured to send a second acknowledgement message to the terminal device in response to receiving the first acknowledgement message sent by the terminal device for the first time; the second confirmation message is used for determining data in the first confirmation message retransmitted by the terminal equipment.
In one example, the synchronous message retransmission module 904, before being configured to receive the data acknowledgement message, further includes: transmitting a fourth acknowledgement message and the first data to the server in response to receiving the synchronization acknowledgement message transmitted by the server; the fourth confirmation message is used for indicating that the synchronous confirmation message is received; and retransmitting the fourth acknowledgement message and the first data to the server in response to receiving the first acknowledgement message retransmitted by the terminal equipment until receiving the data acknowledgement message sent by the server.
In one example, the synchronous message retransmission module 904, before being configured to receive the data acknowledgement message, further includes: after establishing a connection with the server, the first data is sent to the server over the connection.
In one example, the first acknowledgement message includes a first sequence number and a first length value of the first data, the second acknowledgement message includes a first acknowledgement number and a second length value, the first acknowledgement number is determined based on the first sequence number, the first length value and a preset value, and the second length value is 0.
In one example, the retransmitted first acknowledgement message carries second data, where the second data is data included in a partial byte of the first data.
In one example, the third acknowledgement message includes a second acknowledgement number, where the second acknowledgement number is determined based on the first sequence number and the first length value.
Fig. 10 is a block diagram of another message retransmission apparatus according to an exemplary embodiment of the present disclosure. Referring to fig. 10, the apparatus may include: a first acknowledgement message sending module 1002 and a first acknowledgement message retransmitting module 1004, wherein:
The first acknowledgement message sending module 1002 is configured to send a first acknowledgement message to the network address translation device, where the first acknowledgement message carries first data.
The first acknowledgement message retransmission module 1004 is configured to retransmit, to the network address translation device, the first acknowledgement message until receiving a third acknowledgement message sent by the network address translation device, where the third acknowledgement message is used for the server to have received the first data, in response to the retransmission timer not receiving the third acknowledgement message sent by the network address translation device before timeout.
In one example, the first acknowledgement message retransmission module 1004, when configured to retransmit the first acknowledgement message to the network address translation device in response to a retransmission timer not receiving the third acknowledgement message sent by the network address translation device before timeout, until receiving the third acknowledgement message sent by the network address translation device, includes: in response to the fact that the retransmission timer does not receive the third acknowledgement message sent by the network address translation device before overtime, retransmitting the first acknowledgement message to the network address translation device based on the fact that the second acknowledgement message sent by the network address translation device is received until the third acknowledgement message sent by the network address translation device is received; the second confirmation message is used for determining data in the first confirmation message retransmitted by the terminal equipment.
In an example, the first acknowledgement message retransmission module 1004 is further configured to stop retransmitting the first acknowledgement message if the number of retransmissions of the first acknowledgement message reaches a preset threshold.
In one example, the first acknowledgement message includes a first sequence number and a first length value of the first data, the second acknowledgement message includes a first acknowledgement number and a second length value, the first acknowledgement number is determined based on the first sequence number, the first length value and a preset value, and the second length value is 0.
In one example, the retransmitted first acknowledgement message carries second data, where the second data is data included in a partial byte of the first data.
In one example, the third acknowledgement message includes a second acknowledgement number, where the second acknowledgement number is determined based on the first sequence number and the first length value.
The implementation process of the functions and roles of each unit in the above device is specifically shown in the implementation process of the corresponding steps in the above method, and will not be described herein again.
For the device embodiments, reference is made to the description of the method embodiments for the relevant points, since they essentially correspond to the method embodiments. The apparatus embodiments described above are merely illustrative, wherein the modules illustrated as separate components may or may not be physically separate, and the components shown as modules may or may not be physical, i.e., may be located in one place, or may be distributed over a plurality of network modules. Some or all of the modules may be selected according to actual needs to achieve the purposes of the present description. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
In an exemplary embodiment, a non-transitory computer readable storage medium is also provided, such as a memory, comprising instructions executable by a processor of a message retransmission apparatus to implement a method as described in any of the above embodiments.
Wherein the non-transitory computer readable storage medium may be a ROM, random-access memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc., and the application is not limited thereto.
The foregoing describes specific embodiments of the present disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims can be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
Other embodiments of the present description will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This specification is intended to cover any variations, uses, or adaptations of the specification following, in general, the principles of the specification and including such departures from the present disclosure as come within known or customary practice within the art to which the specification pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the specification being indicated by the following claims.
It is to be understood that the present description is not limited to the precise arrangements and instrumentalities shown in the drawings, which have been described above, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present description is limited only by the appended claims.
The foregoing description of the preferred embodiments is provided for the purpose of illustration only, and is not intended to limit the scope of the disclosure, since any modifications, equivalents, improvements, etc. that fall within the spirit and principles of the disclosure are intended to be included within the scope of the disclosure.

Claims (17)

1. A method of retransmitting a message, the method performed by a network address translation device, the method comprising:
Responding to the first confirmation message sent by the terminal equipment, and sending a synchronous message to a server; the first confirmation message carries first data, and the synchronization message is used for requesting to establish connection with the server; the first confirmation message is sent after the terminal equipment and the network address translation equipment perform three-way handshake; the first data is target data to be transmitted to the server by the terminal device through the network address translation device;
in response to receiving a first acknowledgement message retransmitted by the terminal equipment, and not establishing connection with the server, retransmitting the synchronous message to the server until receiving a data acknowledgement message sent by the server, wherein the data acknowledgement message is used for notifying the network address translation equipment that the server has received the first data;
And sending a third confirmation message to the terminal equipment in response to receiving the data confirmation message, wherein the third confirmation message is used for notifying the terminal equipment that the server has received the first data.
2. The method according to claim 1, wherein the method further comprises:
Responding to the first receiving of the first confirmation message sent by the terminal equipment, and sending a second confirmation message to the terminal equipment; the second confirmation message is used for determining data in the first confirmation message retransmitted by the terminal equipment.
3. The method of claim 1, wherein prior to receiving the data confirmation message, the method further comprises:
transmitting a fourth acknowledgement message and the first data to the server in response to receiving the synchronization acknowledgement message transmitted by the server; the fourth confirmation message is used for indicating that the synchronous confirmation message is received;
And retransmitting the fourth acknowledgement message and the first data to the server in response to receiving the first acknowledgement message retransmitted by the terminal equipment until receiving the data acknowledgement message sent by the server.
4. The method of claim 1, wherein prior to receiving the data confirmation message, the method further comprises:
after establishing a connection with the server, the first data is sent to the server over the connection.
5. The method of claim 2, wherein the first acknowledgement message includes a first sequence number and a first length value of the first data, the second acknowledgement message includes a first acknowledgement number and a second length value, the first acknowledgement number is determined based on the first sequence number, the first length value, and a preset value, and the second length value is 0.
6. The method of claim 5, wherein the retransmitted first acknowledgment message carries second data, the second data being data included in a partial byte of the first data.
7. The method of claim 5, wherein the third acknowledgment message includes a second acknowledgment number, the second acknowledgment number being determined based on the first sequence number and the first length value.
8. A method for retransmitting a message, the method being performed by a terminal device, the method comprising:
Sending a first confirmation message to network address translation equipment, wherein the first confirmation message carries first data; the first confirmation message is sent after the terminal equipment and the network address translation equipment perform three-way handshake; the first data is target data to be transmitted to a server by the terminal device through the network address translation device;
And retransmitting the first acknowledgement message to the network address translation equipment in response to that the third acknowledgement message sent by the network address translation equipment is not received before the retransmission timer is overtime, so that a synchronous message is retransmitted to the server when the network address translation equipment is not connected with the server, until the terminal equipment receives the third acknowledgement message sent by the network address translation equipment, wherein the third acknowledgement message is used for indicating that the server has received the first data, and the synchronous message is used for requesting to establish connection with the server.
9. The method of claim 8, wherein retransmitting the first acknowledgement message to the network address translation device until receiving the third acknowledgement message sent by the network address translation device in response to the retransmission timer not receiving the third acknowledgement message sent by the network address translation device having expired comprises:
In response to the fact that the third acknowledgement message sent by the network address translation device is not received before the retransmission timer is overtime, retransmitting the first acknowledgement message to the network address translation device based on the fact that the second acknowledgement message sent by the network address translation device is received until the third acknowledgement message sent by the network address translation device is received; the second confirmation message is used for determining data in the first confirmation message retransmitted by the terminal equipment.
10. The method of claim 8, wherein the method further comprises:
And stopping retransmitting the first confirmation message under the condition that the retransmission times of the first confirmation message reach a preset threshold value.
11. The method of claim 9, wherein the first acknowledgement message includes a first sequence number and a first length value of the first data, the second acknowledgement message includes a first acknowledgement number and a second length value, the first acknowledgement number is determined based on the first sequence number, the first length value, and a preset value, and the second length value is 0.
12. The method of claim 11, wherein the retransmitted first acknowledgment message carries second data, the second data being data included in a partial byte of the first data.
13. The method of claim 11, wherein the third acknowledgment message includes a second acknowledgment number, the second acknowledgment number being determined based on the first sequence number and the first length value.
14. A message retransmission apparatus, the apparatus being performed by a network address translation device, the apparatus comprising:
the synchronous message sending module is used for responding to the first confirmation message sent by the terminal equipment and sending the synchronous message to the server; the first confirmation message carries first data, and the synchronization message is used for requesting to establish connection with the server; the first confirmation message is sent after the terminal equipment and the network address translation equipment perform three-way handshake; the first data is target data to be transmitted to the server by the terminal device through the network address translation device;
A synchronous message retransmission module, configured to retransmit, to the server, the synchronous message in response to receiving a first acknowledgement message retransmitted by the terminal device and not yet establishing a connection with the server, until receiving a data acknowledgement message sent by the server, where the data acknowledgement message is used to notify the network address translation device that the server has received the first data;
And the third confirmation message sending module is used for responding to the received data confirmation message and sending a third confirmation message to the terminal equipment, wherein the third confirmation message is used for informing the terminal equipment that the server has received the first data.
15. A message retransmission apparatus, wherein the apparatus is executed by a terminal device, the apparatus comprising:
The first acknowledgement message sending module is used for sending a first acknowledgement message to the network address translation equipment, wherein the first acknowledgement message carries first data; the first confirmation message is sent after the terminal equipment and the network address translation equipment perform three-way handshake; the first data is target data to be transmitted to a server by the terminal device through the network address translation device;
And the first acknowledgement message retransmission module is used for retransmitting the first acknowledgement message to the network address translation equipment in response to the fact that the third acknowledgement message sent by the network address translation equipment is not received before the retransmission timer is overtime, so that the synchronous message is retransmitted to the server when the network address translation equipment does not establish connection with the server until the terminal equipment receives the third acknowledgement message sent by the network address translation equipment, wherein the third acknowledgement message is used for indicating that the server has received the first data, and the synchronous message is used for requesting to establish connection with the server.
16. An electronic device, comprising:
A processor;
A memory for storing processor-executable instructions;
Wherein the processor is configured to implement the method of any one of claims 1-13 by executing the executable instructions.
17. A computer readable storage medium having stored thereon computer instructions which, when executed by a processor, implement the steps of the method of any of claims 1-13.
CN202410056150.8A 2024-01-15 2024-01-15 Message retransmission method and device Active CN117579233B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410056150.8A CN117579233B (en) 2024-01-15 2024-01-15 Message retransmission method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410056150.8A CN117579233B (en) 2024-01-15 2024-01-15 Message retransmission method and device

Publications (2)

Publication Number Publication Date
CN117579233A CN117579233A (en) 2024-02-20
CN117579233B true CN117579233B (en) 2024-04-23

Family

ID=89888491

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410056150.8A Active CN117579233B (en) 2024-01-15 2024-01-15 Message retransmission method and device

Country Status (1)

Country Link
CN (1) CN117579233B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2006077659A1 (en) * 2005-01-20 2006-07-27 Mitsubishi Denki Kabushiki Kaisha Network transmission device
CN101547210A (en) * 2009-05-14 2009-09-30 福建星网锐捷网络有限公司 Method and device for processing TCP connection
CN101771695A (en) * 2010-01-07 2010-07-07 福建星网锐捷网络有限公司 Transmission control protocol (TCP) connection processing method and system and synchronization (SYN) agent equipment
CN102025746A (en) * 2010-12-21 2011-04-20 北京星网锐捷网络技术有限公司 Method, device and network equipment for establishing transmission control protocol (TCP) connection
CN106302495A (en) * 2016-08-25 2017-01-04 北京神州绿盟信息安全科技股份有限公司 The means of defence of a kind of ACK Flood attack and intervening guard device
CN109639712A (en) * 2018-12-29 2019-04-16 北京神州绿盟信息安全科技股份有限公司 A kind of method and system for protecting DDOS attack
CN109981385A (en) * 2017-12-27 2019-07-05 华为技术有限公司 A kind of methods, devices and systems for realizing packet loss detection
CN115694742A (en) * 2021-07-22 2023-02-03 三星电子株式会社 Method and electronic device for transmitting acknowledgement signal in wireless communication system
CN116963175A (en) * 2022-04-14 2023-10-27 华为技术有限公司 Data transmission method, device and system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
AU2003230708A1 (en) * 2002-03-25 2003-10-13 Netli, Inc. System for fast recovery from losses for reliable data communication protocols

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2006077659A1 (en) * 2005-01-20 2006-07-27 Mitsubishi Denki Kabushiki Kaisha Network transmission device
CN101547210A (en) * 2009-05-14 2009-09-30 福建星网锐捷网络有限公司 Method and device for processing TCP connection
CN101771695A (en) * 2010-01-07 2010-07-07 福建星网锐捷网络有限公司 Transmission control protocol (TCP) connection processing method and system and synchronization (SYN) agent equipment
CN102025746A (en) * 2010-12-21 2011-04-20 北京星网锐捷网络技术有限公司 Method, device and network equipment for establishing transmission control protocol (TCP) connection
CN106302495A (en) * 2016-08-25 2017-01-04 北京神州绿盟信息安全科技股份有限公司 The means of defence of a kind of ACK Flood attack and intervening guard device
CN109981385A (en) * 2017-12-27 2019-07-05 华为技术有限公司 A kind of methods, devices and systems for realizing packet loss detection
CN109639712A (en) * 2018-12-29 2019-04-16 北京神州绿盟信息安全科技股份有限公司 A kind of method and system for protecting DDOS attack
CN115694742A (en) * 2021-07-22 2023-02-03 三星电子株式会社 Method and electronic device for transmitting acknowledgement signal in wireless communication system
CN116963175A (en) * 2022-04-14 2023-10-27 华为技术有限公司 Data transmission method, device and system

Also Published As

Publication number Publication date
CN117579233A (en) 2024-02-20

Similar Documents

Publication Publication Date Title
US7532577B2 (en) Managing transmission control protocol (TCP) connections
EP2638680B1 (en) Full-duplex bi-directional communication over a remote procedure call based communications protocol, and applications thereof
CN106210924B (en) Video network transmission control method and system
US9967193B2 (en) Method and system for increasing data flow transmission
US10530644B2 (en) Techniques for establishing a communication connection between two network entities via different network flows
KR101430032B1 (en) Method for improving a tcp data transmission process in case the physical transmission medium is disconnected
EP2899938A1 (en) Service download acceleration method and system, service state maintenance method and device
WO2018076580A1 (en) Two-sided acceleration transmission method and system for wireless network
EP2692115B1 (en) Sctp endpoint migration
CN110753035B (en) FPGA (field programmable Gate array) ultralow-delay communication transmission method based on TCP (Transmission control protocol)
CN108092993B (en) Network data transmission control method and system
US8762449B2 (en) Method of downloading large size data to a large number of networked client machines from a single server
WO2013152614A1 (en) System and method for network access based on application layer data
CN117579233B (en) Message retransmission method and device
CN116599953A (en) File uploading method, device, system, equipment and readable storage medium
CN111314447B (en) Proxy server and method for processing access request thereof
Chakravarthi et al. M2M Communication Protocols
JP4805072B2 (en) Communications system
EP3367599B1 (en) Method and system for transferring data within a layered architecture of network components
KR100756183B1 (en) Network transmission apparatus having fake-ack layer and tcp packet sending/receiving method using there of
US11528338B2 (en) Methods, systems, and computer readable media for providing for reliable service based interface (SBI) message transport using zero event notification messages
CN115499484A (en) Message communication method, device, equipment and medium
CN109995724B (en) Communication method, client and communication system
CN105491057A (en) Data transmission method and device for preventing distributed reject service DDoS attack
JP3867896B2 (en) Router device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant