TCP Timeout and Retransmission(3)

Example

The first line of Figure 14-7 (number 40) indicates the first time ACK 23801 is received

The window update at time 0.853 is an ACK with a duplicate sequence number (because no data is being carried) but contains a change to the TCP flow control window.

Thus, it is not counted toward the three-duplicate-ACK threshold required to initiate a fast retransmit.

The packets arriving at times 0.890, 0.926, and 0.964 are all duplicate ACKs for sequence number 23801.

The arrival of the third of these duplicate ACKs triggers the fast retransmit of segment 23801 at time 0.993.

The second retransmission(at 1.326s) is somewhat different from the first.

When the first retransmission takes place, the sending TCP notes the highest sequence num- ber it had sent just before it performed the retransmission

(43401 + 1400 = 44801). This is called the recovery point.

TCP is considered to be recovering from loss after a retransmission until it receives an ACK that matches or exceeds the sequence number of the recovery point.

In this example, the ACKs at times 1.322 and 1.321 are not for 44801, but instead for 26601.

This number is larger than the previous highest ACK value seen (23801), but not enough to meet or exceed the recovery point (44801).

This type of ACK is called a partial ACK for this reason.

When par- tial ACKs arrive, the sending TCP immediately sends the segment that appears to be missing (26601 in this case) and

continues this way until the recovery point is matched or exceeded by an arriving ACK.

If permitted by congestion control pro- cedures (see Chapter 16), it may also send new data it has not yet sent.

Retransmission with Selective Acknowledgments

Data with sequence numbers beyond the holes are called out-of-sequence data because that data is not contiguous,

in terms of its sequence numbers, with the other data the receiver has already received.

In many circumstances, the properly operating SACK sender is able to fill these holes more quickly and with fewer unnecessary retransmissions than

a comparable non-SACK sender because it does not have to wait an entire RTT to learn about additional holes.

With three distinct blocks, up to three holes can be reported to the sender.

If not limited by congestion control (see Chapter 16), all three could be filled within one round-trip time using a SACK-capable sender.

SACK Receiver Behavior

The receiver places in the first SACK block the sequence number range con- tained in the segment it has most recently received.

Because the space in a SACK option is limited, it is best to ensure that the most recent information is always provided to the sending TCP, if possible.

Other SACK blocks are listed in the order in which they appeared as first blocks in previous SACK options.

That is, they are filled in by repeating the most recently sent SACK blocks (in other segments) that are not subsets of another block about to be placed in the option being constructed.

The purpose of including more than one SACK block in a SACK option and repeating these blocks across multiple SACKs is to provide some redundancy in the case where SACKs are lost.

...Unfortunately, SACKs and regular ACKs are sometimes lost and are not retrans- mitted by TCP unless they contain data (or the SYN or FIN control bit fields are turned on).

SACK Sender Behavior

One way it can do this is to keep a “SACKed” indication for each segment in its retransmission buffer

that is set whenever a corresponding range of sequence numbers arrives in a SACK.

The simplest approach is to have the sender first fill the holes at the receiver and then move on to send more new data [RFC3517]

if the congestion control pro- cedures allow. This is the most common approach.

There is one exception to this behavior.

In [RFC2018], the current specification for SACK options, SACK blocks are considered advisory.

This means that a receiver could provide a SACK to the sender indicating that some sequence numbers have been received successfully and then change its mind later (“renege”).

Because of this, the SACK sender is not able to free its retransmission buffer of data it has received only a SACK for;

it is permitted to free a block of data only once the regu- lar TCP ACK number of the receiver has passed by the highest sequence number of this data.

Example

These options(SACK-Permitted option)are present only at connection setup, and thus they only ever appear in segments with the SYN bit field set.

Here we see that the ACK for 23801 contains a SACK block of [25201,26601](this is the out-of-order block), indicating a hole at the receiver.

The receiver is missing the sequence number range [23801,25200], which corresponds to the single 1400-byte packet starting with sequence number 23801.

Note that this SACK is a window update and is not counted as a duplicate ACK for the reasons discussed earlier(?).

It does not trigger fast retransmit.

The SACK arriving at time 0.967 contains two SACK blocks: [28001,29401] and [25201,26601].

Recall that the first SACK blocks from previous SACKs are repeated in later positions in subsequent SACKs for robustness against ACK loss.

This SACK is a duplicate ACK for sequence number 23801 and suggests that the receiver now requires two full-size segments starting with sequence numbers 23801 and 26601.

The sender reacts immediately by initiating fast retransmit, but because of conges- tion control procedures (see Chapter 16), the sender sends only one retransmis- sion, for segment 23801.

With the arrival of two additional ACKs, the sender is permitted to send its second retransmission, for segment 26601.

A TCP SACK sender uses the recovery point idea introduced with NewReno.

In this example, the highest sequence number sent prior to the retransmission is 43400, which is lower than in the NewReno example from Figure 14-5.

For this implementation of SACK fast retransmit, three duplicate ACKs are not required;

the TCP initiates its retransmission earlier. The recovery exit is essentially the same, though.

Once the ACK for sequence number 43401 is received at time 1.3958, recovery is complete.

The benefits of SACKs are more pronounced when the RTT is large and packet loss is severe.

Under such circumstances, the benefits of being able to fill more than one hole per RTT are likely to be more significant.

原文地址:https://www.cnblogs.com/geeklove01/p/9744759.html

时间: 2024-07-30 00:28:21

TCP Timeout and Retransmission(3)的相关文章

TCP Timeout and Retransmission(2)

Retransmission Ambiguity and Karn's Algorithm A problem measuring an RTT sample can occur when a packet is retransmitted. Say a packet is transmitted, a timeout occurs, the packet is retransmitted, and an acknowledgment is received for it. Is the ACK

TCP Timeout and Retransmission(4)

Spurious Timeouts and Retransmissions Under a number of circumstances, TCP may initiate a retransmission even when no data has been lost. Such undesirable retransmissions are called spurious retrans- missions and are caused by spurious timeouts (time

TCP Timeout and Retransmission(5)

Destination Metrics Repacketization When TCP times out and retransmits, it does not have to retransmit the identi- cal segment. Instead, TCP is allowed to perform repacketization, sending a bigger segment, which can increase performance. (Naturally,

tcp/ip协议listen函数中backlog参数的含义与php-fpm的502 Bad Gateway

To understand the backlog argument, we must realize that for a given listening socket, the kernel maintains two queues :要明白backlog参数的含义,我们必须明白对于一个listening socket,kernel维护者两个队列: 1.An incomplete connection queue, which contains an entry for each SYN t

TCP/IP Illustrated 第一章 Introduction

Introduction 在这一章节,作者大致地进行了 TCP/IP 的 whirlwind tour, 讲解了数据传输的四层, link layer, network layer, transport layer 和 application layer, 并且对其中的每一层进行了区分.同时,作者也讲述了这四层之间执行协同工作的方式,即 encapsulation 和 demultiplexinginternet 是众多 network 的集合,它们通过 IP address 和 port nu

(转)RTSP - RTP over TCP

Normally, RTSP provide streaming over UDP. By nature, UDP is a better choice as it provides robust streaming capability for media. However, it is unlikely to use UDP for streaming over the Internet. 通常来说,RTSP提供UDP方式发送RTP流.当然,发送流媒体时,UDP往往是更好的选择.但是,在互联

RTSP - RTP over TCP

Normally, RTSP provide streaming over UDP. By nature, UDP is a better choice as it provides robust streaming capability for media. However, it is unlikely to use UDP for streaming over the Internet. 通常来说,RTSP提供UDP方式发送RTP流.当然,发送流媒体时,UDP往往是更好的选择.但是,在互联

nginx tcp代理模块nginx_tcp_proxy_module

nginx tcp代理功能由nginx_tcp_proxy_module模块提供,同时监测后端主机状态.该模块包括的模块有: ngx_tcp_module, ngx_tcp_core_module, ngx_tcp_upstream_module, ngx_tcp_proxy_module, ngx_tcp_upstream_ip_hash_module. 安装 https://github.com/yaoweibin/nginx_tcp_proxy_module/archive/master.

Nginx Tcp反向代理

nginx tcp代理功能由nginx_tcp_proxy_module模块提供,同时监测后端主机状态.该模块包括的模块有: ngx_tcp_module, ngx_tcp_core_module, ngx_tcp_upstream_module, ngx_tcp_proxy_module, ngx_tcp_upstream_ip_hash_module. 1. 安装 # wget http://nginx.org/download/nginx-1.4.4.tar.gz # tar zxvf n