# Fine-grained TCP Retransmissions

## Safe and Effective Fine-grained TCP Retransmissions for Datacenter Communication

### 引言

TCP中对于超时重传的时间处理上，为了避免虚假的超时重传，设置来一个最小的超时时间。在Linux上，这个是时间一般是200ms。在广域网上，这个最低的值设置是有意义的。但是在延时很低的数据中心内部，设个时间限制就可能导致一些问题，特别是incast的情况(就是多台机器与一台机器同时通信)。 这篇Paper就讨论了减小这个RTO带来的影响，发现可以通过将这个RTO的最小值设置的很小也能保证安全和效率，同时解决存在的问题。

### 问题分析

RTO = SRTT + (4 × RTTVAR)


timeout = RTO × 2 ^ backoff


Paper中的在实际情况中的测试，也显示出减小RTOmin对性能的影响。

Despite these differences, the real world results show the need to reduce the RTO to at least 1ms to avoid throughput degradation at scales of up to 16 servers.


timeout = (RTO + (rand(0.5) × RTO)) × 2 ^ backoff


### 实现

With the TCP timestamp option enabled, RTT estimates are calculated based on the difference between the timestamp option in an earlier packet and the corresponding ACK. We convert the time from nanoseconds to microseconds and store the value in the TCP timestamp option.2 This change can be accomplished entirely on the sender—receivers already echo back the value in the TCP timestamp option.


### 安全否?

As a result, wide-area “packet delays [are] not mathematically [or] operationally steady”, which confirms the Allman and Paxson observation that RTO estimation involves a fundamental tradeoff between rapid retransmission and spurious retransmissions..


Delayed ACK确实可能对器有一些影响，但是，这个情况可以被TCP的新功能和能产生影响的有限的条件缓和。说了好大的一堆，就是说没啥影响。

In practice, these two potential consequences are mitigated by newer TCP features and by the limited circumstances in which they occur, as we explore in the next two sections. We find that eliminating the RTOmin has little impact on bulk data transfer performance for wide- area flows, and that in the datacenter, delayed ACK causes only a small, though noticeable drop in throughput when the RTOmin is set below the delayed ACK threshold.


## 参考

1. Safe and Effective Fine-grained TCP Retransmissions for Datacenter Communication, SIGCOMM 2009.