Reliable transmission method for passive retransmission

文档序号:1834489 发布日期:2021-11-12 浏览:4次 中文

阅读说明:本技术 一种被动重发的可靠传输方法 (Reliable transmission method for passive retransmission ) 是由 陈磊 于 2021-10-13 设计创作,主要内容包括:本发明公开了一种被动重发的可靠传输方法,发送方向接收方发出本次数据传输的数据量;接收方收到数据量后,根据自己能提供的缓冲区大小和发送方拟发送数据大小对比,开辟缓冲区;接收方向发送方发出请求消息,请求发送方发送数据,请求消息包含拟接收数据的起止序号;如果发送方在规定时间内没有收到接收方的请求消息,则发送方再次发送本次拟传输的数据量;发送方在收到接收方的发送请求之后,根据请求发送数据包;接收方在预定时间内如果没有收到请求的全部数据包,则发送新的请求消息,针对未收到的数据再次请求;发送方收到请求后,重发接收方所请求的丢失数据;直到收到全部数据后,接收方立刻将收到全部数据直接提交给应用程序进行处理。(The invention discloses a reliable transmission method of passive retransmission.A sender sends the data volume of the data transmission to a receiver; after receiving the data volume, the receiver opens up a buffer area according to the comparison between the size of the buffer area which can be provided by the receiver and the size of the data to be sent by the sender; the receiving side sends a request message to the sending side to request the sending side to send data, wherein the request message comprises a start-stop sequence number of the data to be received; if the sender does not receive the request message of the receiver within the specified time, the sender sends the data volume to be transmitted again; after receiving a sending request of a receiver, a sender sends a data packet according to the request; if the receiver does not receive all the requested data packets within the preset time, the receiver sends a new request message and requests for the data which is not received again; after receiving the request, the sender retransmits the lost data requested by the receiver; and immediately submitting all the received data to an application program for processing by the receiver after all the data are received.)

1. A method for reliable transmission of passive retransmissions, comprising: the method specifically comprises the following steps:

the method comprises the following steps: the data sending side sends the data volume to be sent and the initial data sequence number of the data transmission to the data receiving side, and sets preset time;

step two: after receiving the information, the receiver compares the size of the buffer area which can be provided by the receiver with the size of the data to be sent by the sender, opens up the buffer area and sets the preset time;

step three: the receiving side sends a request message to the sending side to request the sending side to send data, wherein the request message comprises a start-stop sequence number of the data to be received; if the sender does not receive the request of the receiver within the preset time, the sender resends the information of the first step;

step four: after receiving a sending request of a receiver, a sender sends a data packet according to the request;

step five: if the receiver does not receive all the requested data packets within the preset time, the receiver sends a new request data packet and requests for the data which is not received again;

Step six: after receiving the request, the sender retransmits the lost data packet requested by the receiver in the fifth step;

step seven: and the receiver receives all the data packets and then directly submits the data packets to an application program for processing.

2. A reliable transmission method of passive retransmission according to claim 1, characterized in that: in the fourth step, the receiver sets the preset receiving time and counts down when sending the request message; and when the countdown is finished, counting the data serial numbers which are not received, sending a request message to a data sending party, and requesting to send the lost data again until all the data arrive.

3. A reliable transmission method of passive retransmission according to claim 2, characterized in that: the data transmitting side does not count down and does not judge whether the transmitted data packet is lost, but passively retransmits the lost data according to the request message of the receiving side.

4. A reliable transmission method of passive retransmission according to claim 1, characterized in that: the receiver can know the data volume to be sent in the initial stage; therefore, whether all data is received can be judged by self, and the application program processing is submitted immediately after the data is received.

Technical Field

The invention relates to the field of computer network communication, in particular to a reliable transmission method of passive retransmission.

Background

In a computer network, data packets sent by a data sender are sometimes lost during transmission. In order to guarantee the reliability of transmission, the network transmission layer uses an acknowledgement mechanism and a timeout retransmission mechanism. Conventionally, after receiving a data packet, the receiving party sends an acknowledgement message to the sending party, indicating that the data has been received. If the sender does not receive the confirmation data packet sent by the receiver within the specified time, the data packet is considered to be lost in the transmission process, and the data packet is retransmitted.

Before starting data transmission, the receiver needs to inform the sender of the size of the buffer used for receiving data, so as to prevent the sender from sending data too fast to process. After the buffer is full or the transmission is complete, the receiver will pass the data to the upper layer application for processing.

A data transmission method as disclosed in application No. CN201711466513.1, comprising: the data transmitting end transmits a data packet with a number, the data receiving end receives the data packet and feeds back all received data packet numbers to the data transmitting end, the data transmitting end compares the transmitted data packet numbers with the data packet numbers fed back by the data receiving end to obtain the data packet numbers with lost packets, and the data packet numbers are retransmitted. The data sending end divides the data into data packets according to a certain byte number and numbers the data packets, then sends the data packets to the data receiving end according to the number sequence of the data packets, the data receiving end feeds the number of the received data packets back to the data sending end, and the data sending end judges the packet loss condition and retransmits the data with the packet loss according to the data packet number fed back by the data receiving end without depending on the accumulative acknowledgement of a plurality of DACKs or an ACK overtime timer to trigger the data retransmission.

In the prior art, whether data needs to be retransmitted or not is judged by a sender according to feedback of a receiver, so that the method is an active retransmission strategy and has the following disadvantages:

1. the data packets which have been successfully transmitted are repeatedly transmitted, which wastes communication resources and causes link congestion.

Channel resource shortage may also occur in the link of the receiving side to the transmitting side, thereby causing the acknowledgement packet to be lost during the transmission process. When the data packet sent by the sender reaches the receiver, the acknowledgement data packet sent by the receiver is lost, and the sender repeatedly sends the successfully sent data packet under the condition that the sender does not receive the acknowledgement. The repeated data packets are gradually increased, which may cause channel congestion, and the congested channel in turn causes more packet loss and retransmission, thereby consuming channel resources.

2. The receiver does not know the size of the data volume required to be sent by the sender, and the data volume is not immediately submitted to the application program for processing after all the data is received, but can be submitted to the application program for processing after the sender notifies that the sending is completed. Sometimes, the transmission completion notification of the transmission side does not arrive along with the last batch of data, resulting in an increase in the waiting time of the reception side.

3. The receiving party does not know the data volume to be sent by the sending party in the initial stage, and cannot reasonably plan the receiving buffer of the receiving party. The buffer area is too large, so that waste is caused, and resources of other processes are occupied; too small a buffer increases transmission delay.

Disclosure of Invention

Aiming at the problems, the scheme provides a reliable transmission method of passive retransmission; the problems that the existing active retransmission technology in the prior art wastes channel resources, has large transmission delay, and is unreasonable in buffer planning are solved; in the traditional active retransmission method, a sender judges a lost data packet in the transmission process according to the confirmation information fed back by a receiver and actively retransmits the data packet.

The scheme is realized as follows:

a reliable transmission method of passive retransmission specifically comprises the following steps:

the method comprises the following steps: the data sending side sends the data volume and the initial data sequence number of the data transmission to the data receiving side, and sets preset time;

step two: after receiving the information, the receiver compares the size of the buffer area which can be provided by the receiver with the size of the data to be sent by the sender, opens up the buffer area and sets the preset time;

step three: the receiving side sends a request data packet to the sending side to request the sending side to send data, and the request message contains a start-stop sequence number of the data to be received; if the sender does not receive the request of the receiver within the specified time, the sender resends the information of the first step;

Step four: after receiving a sending request of a receiver, a sender sends a data packet according to the request;

step five: if the receiver does not receive all the requested data packets within the preset time, the receiver sends a new request data packet and requests for the data which is not received again;

step six: after receiving the request, the sender retransmits the lost data packet requested by the receiver in the fifth step;

step seven: the receiver receives all the data and submits the data to the application program for processing.

In step four, the receiving party sets the predetermined receiving time and counts down while sending the request message. And when the countdown is finished, counting the data serial numbers which are not received, sending a request message to a data sending party, and requesting to send the lost data again until all the data arrive.

The data sender does not count down and judge whether the sent data packet is lost, but passively retransmits the lost data according to the request message of the receiver.

The receiver can know the data volume to be sent by the sender in the initial stage; therefore, whether all data is received can be judged by self, and the application program processing is submitted immediately after the data is received.

Compared with the prior art, the invention has the beneficial effects that:

1. the invention adopts a passive retransmission mechanism, sends the data volume and the start-stop data sequence number which are to be sent by the receiver and are reported by the receiver in the initial stage, and the receiver counts down, after the receiving is overtime, the receiver can judge the lost data in the transmission process according to the data volume and the sequence number, and resends the request according to the lost data, thereby avoiding the repeated sending caused by the loss of the confirmation message; channel resource waste can be reduced.

2. By this method, before the transmission starts, the sender informs the receiver of the amount of data that the sender will send. The receiving party can reasonably plan the use of the buffer area according to the data volume to be received, and the buffer area is prevented from being too large or too small. After receiving all data, the receiver submits the data to the application program for processing, and the processing time is saved.

3. Through the scheme, the invention is compared with the traditional TCP under the scene that the channel resources from the receiver to the sender are limited; the packet is easy to be lost due to the confirmation data packet sent by the receiver, so that the channel is blocked by the invalid retransmission of the TCP; setting the initial packet loss rate of a channel to be 0, and continuously increasing the packet loss rate along with the increase of the number of data packets waiting to be sent; in this scenario, the method is superior to the conventional TCP technique in terms of both transmission delay and transmission times 2.

Drawings

FIG. 1 is a schematic view of the overall flow structure of the present invention;

FIG. 2 is a comparison between the delay of the present invention in transmitting data packets and the delay of a conventional TCP;

fig. 3 is a graph comparing the transmission times (channel resource consumption) of the present invention and the conventional TCP in transmitting data packets.

Detailed Description

In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

In the description of the present invention, it is to be understood that the terms "length", "width", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", and the like, indicate orientations or positional relationships based on the orientations or positional relationships illustrated in the drawings, and are used merely for convenience in describing the present invention and for simplicity in description, and do not indicate or imply that the devices or elements referred to must have a particular orientation, be constructed in a particular orientation, and be operated, and thus, are not to be construed as limiting the present invention. Further, in the description of the present invention, "a plurality" means two or more unless specifically defined otherwise.

Example 1

Referring to fig. 1 to 3, the present invention provides a technical solution:

a reliable transmission method of passive retransmission specifically comprises the following steps:

the method comprises the following steps: the data sender firstly sends out the data transmission data volume and the data sequence number;

(unlike the conventional active retransmission method, the active retransmission does not provide the size of the data to be transmitted at this time in the initial stage);

step two: after receiving the information, the receiver opens up a buffer area according to the size of the buffer area which can be provided by the receiver and the size of the data to be sent by the sender; and setting a predetermined time;

step three: the receiving side sends a request data packet to the sending side to request the sending side to send data; if the sender does not receive the request of the receiver within the specified time, the information of the first step is retransmitted; in this step, the request message sent by the receiver contains the serial number of the data required to be sent by the other party;

step four: after receiving a sending request of a receiver, a sender sends a data packet according to the request;

step five: if the receiver does not receive all the requested data packets when the clock is over, the receiver sends a new request message and requests again for the data packets which are not received;

(unlike conventional active retransmission, in which the receiving side acknowledges the received data, the method calculates an unaccepted data packet based on the number range of the data packet provided from the transmitting side at the initial stage and re-requests the data that is not received.)

Step six: after receiving the request, the sender retransmits the lost data packet;

(in the conventional method, the acknowledgement information is not received, and then the retransmission is carried out, but the method defaults that the feedback of the receiver is not received, that is, the data all arrive, and the retransmission request is received);

step seven: and the receiver receives all the data packets and then directly submits the data packets to an application program for processing.

In the traditional method, the disconnection information of the sender or an immediate processing instruction is required to be processed by the application layer, and the time delay is larger in some cases.

By the scheme, the invention is compared with the traditional TCP under the condition that the channel resources from the receiver to the sender are less; because the acknowledgement data packet sent by the receiver is easy to lose the packet, the TCP repeatedly sends the successfully sent data packet, thereby causing invalid retransmission to block the channel; setting the initial packet loss rate of the channel to be 0, and enabling the packet loss rate to be continuously increased along with the increase of the number of data packets waiting to be sent, wherein in the scene, the method is superior to the traditional TCP technology in the aspects of transmission delay and sending times 2.

The present invention is not limited to the above preferred embodiments, and any modifications, equivalent substitutions and improvements made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

8页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种信号处理系统和方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类