TCP byte stream transport for how to handle retransmission it?

1 network protocol background concept

Layer 4 network transmission based on udp port

7-layer network protocol transmission is based on tcp port (tcp very high degree of complexity ..), and tcp is added on top of the session layer denotes an application layer

upd packet-oriented protocol, tcp surface byte stream protocol.

 

What is byte-oriented stream it?

 

2 TCP transfer communication procedure

byte stream oriented tcp, udp message oriented . That the byte stream tcp is what is it?

tcp is a point to point communications, data links established tcp two endpoints, the message is not transferred, is part of a piece of data , a read does not know how much data is sent and the number.

Tcp data to the layer, how much data is transmitted by a determined tcp, there are many conditions is determined, the transmission window, the congestion window, a maximum transmission unit (MTU) on the route, the total amount of data such as output queue.

 

FIG before transmitting data tcp, between applications and there is a protocol tcp tcp buffer queue which is not fixed byte size, the data to be transmitted is not fixed tcp byte size,

tcp is to send a part of the byte stream data,

And it has been carried out in this way of transmission. ? ? ? ? ? ? ?

Therefore, in the network transmission it can be seen that data segments, and a group of a group of data is delivered to the recipient.

 

Transmission error retransmission mechanism 3

If the sender sends the recipient 1234 received only 12 returns an acknowledgment ack 3, and then sent to the sender 4, we can not confirm reply ack 5, since the confirmation can not jump.

Thus, with the retransmission mechanism, there are two kinds:

3.1 retransmission timeout

I do not know the sender receives the case 345, the receiver has been in the other three, in this way there will be more serious problem.

The sender has two options:

  a, 3 a default transmission fails, re-transmission 3 

  B, 345 default transmission fails, the retransmission 345 

a way that only pass 3 may be slow, b way to pass 345 but quickly occupied bandwidth , timeout may be very long, these two are not the last resort.

3.2 fast retransmit

There is also a fast tcp retransmission algorithm, Fast-Retransmit, based on data-driven retransmissions, timeout is not time-driven.

How is data driven it?

That is, if received only 12 replies ack 3, then received a 45 but have not received 3, ack 4 5 3 3 also reply, so the sender will receive three different ack, will know that transport is a problem

This is the most data-driven tcp retransmission mechanism (what? Most tcp, in total there are several versions ..).

This way is not the best, but to solve the problem timeout, the number of return is still not resolved, such as once made a 20, do not know which three hair ack, and this needs to return 20 . .

3.3 sack retransmission

Selective retransmission, Selective Acknowledgemen T (SACK), TCP header will be more a SACK, still fast retransmission ACK.

Only fragments sack reply has arrived, so that the transmitting side can accurately know the retransmission portion of the byte stream. This field can be used tcp_sack turn on this feature in Linux, Linux version 2.4 default after the open.

 

Reference: https://tools.ietf.org/html/rfc2018   https://www.jianshu.com/p/69695f332a71

 

Remaining problem

tcp retransmission there are some problems, sack can not fully believe:

If the receiving terminal is saves the data until retransmission of the failed packet, the recipient will have received the data memory congestion discards chance.

 

Guess you like

Origin www.cnblogs.com/the-last/p/11524964.html