How to troubleshoot TCP retransmission, reordering and duplication?

A data retransmission

  • TCP retransmission provides two mechanisms, one is based on retransmission timeout time, one is based on the receiving end of the fast retransmission feedback message. In contrast the former uses less network bandwidth, but inefficient. While the latter is the opposite. Let's look at specific implementation of these two mechanisms.

  • Retransmission timeout
    name suggests, if the transmitting side waits for ACK sent by the receiver exceeds the RTO TCP set, then the time will be transmitting end retransmits the data packet just sent. In general, TCP will timeout packet retransmission very seriously, when this happens, TCP will reduce the current rate of the sender to send data to achieve a rapid response to the event. Let's look at an example:

    Assume that the sending end is marked as number three incoming packet 123, but at this time the receiving terminal receives only the packet receiving terminal 13 this time went to the crossroads, it may choose not to send the ACK, and the like dead 2 packet. But probably because of timeout packets 3 facing the fate of being retransmitted.

  • Fast retransmission
    and retransmission timeout except that the fast retransmission wait timer goes time-out will not, if it is found out of order or lost data packets will immediately ACK, ACK number is repeated more than once sender receives duplicate ACK threshold (generally 3), it will induce the fast retransmission mechanism. Let's look at an example:

    Assume that the sending end is sent to the serial number marked four packets ** 1234 **, but at this time the receiving terminal receives only the packet 13, the packet at this time appeared out of order, the receiving side immediately ACK 2, sender sends a request packet 2, when packet 4 also reaches the receiving end, the receiving end will still immediately ACK2. When the packet and the packet 2 reaches 34 not timed out, then the receiving end will respond ACK 5, or when other data packet arrives but does not reach the packet 2 will always have a receiving end ACK 2.

II. Scrambled and duplicate packets

  • TCP will own the datagram is passed to the IP layer, IP layer does not provide a solution but a packet duplication, loss of function and disorder problems. It is responsible for planning specific IP path between hosts. TCP is a reliable byte stream protocol, it never will-of-order data segments to the upper layer applications, TCP implementation will consider a variety of details.

  • Scrambled
    front also mentioned, because of the different packet routing links of the IP layer results in the planned order of transmission order received data packet will be different. Moreover, because TCP is a full-duplex protocol, disorder may occur in the forward link, may also occur in the reverse link, the impact of these two different cases brought to the TCP will be slightly different.

    Forward link out of order:
    at this time will not determine the TCP packet is lost or out of order, out of order due to packet loss and can lead to the receiver receives packets out of order, causing the data receiving end empty. TCP is tentatively scheduled for this case will be out of order packets, because the disorder is a matter of time (probably late packet), and packet loss means retransmission. When TCP packets out of order aware of the situation occurs, an immediate ACK, TSEV TSER portion of the ACK value included will record the current time of the receiver receives the ordered segment. This causes the sample values RTT packet is increased, further resulting in prolonged RTO. This TCP is undoubtedly beneficial because TCP sufficient time to determine the packet is out of order or lost in the end to prevent unnecessary data retransmission. Of course, serious disorder then let the sender once thought it was a duplicate ACK packet loss exceeds the threshold of TCP retransmission timeout is triggered, and solving this problem.

    Reverse link (ACK) scrambled:
    As the name suggests, if this happens, it will lead to fast forward the transmitting side window, which leads back to the transmitting end unnecessary traffic bursts, network bandwidth.

  • Packet Repeat
    to repeat, TCP packet approach is inevitable that some simple and crude. First, we know that each data packet is marked with a corresponding head via a data transport layer will, in general, the head of the fixed 20-byte TCP, there is a 4-byte sequence number to represent the data segment in bytes stream offset for the purposes of receiving terminal, this field may help themselves directly discard duplicate packets or reassembly of data packets and then transmitted to the upper layer.

Published 70 original articles · won praise 4 · Views 6337

Guess you like

Origin blog.csdn.net/qq_44837912/article/details/104778916