tcp: RFC2988bis + taking RTT sample from 3WHS for the passive open side
This patch lowers the default initRTO from 3secs to 1sec per RFC2988bis. It falls back to 3secs if the SYN or SYN-ACK packet has been retransmitted, AND the TCP timestamp option is not on. It also adds support to take RTT sample during 3WHS on the passive open side, just like its active open counterpart, and uses it, if valid, to seed the initRTO for the data transmission phase. The patch also resets ssthresh to its initial default at the beginning of the data transmission phase, and reduces cwnd to 1 if there has been MORE THAN ONE retransmission during 3WHS per RFC5681. Signed-off-by: H.K. Jerry Chu <hkchu@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
aee80b54b2
commit
9ad7c049f0
@@ -486,7 +486,7 @@ struct sock *tcp_create_openreq_child(struct sock *sk, struct request_sock *req,
|
||||
* algorithms that we must have the following bandaid to talk
|
||||
* efficiently to them. -DaveM
|
||||
*/
|
||||
newtp->snd_cwnd = 2;
|
||||
newtp->snd_cwnd = TCP_INIT_CWND;
|
||||
newtp->snd_cwnd_cnt = 0;
|
||||
newtp->bytes_acked = 0;
|
||||
|
||||
@@ -720,6 +720,10 @@ struct sock *tcp_check_req(struct sock *sk, struct sk_buff *skb,
|
||||
NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPDEFERACCEPTDROP);
|
||||
return NULL;
|
||||
}
|
||||
if (tmp_opt.saw_tstamp && tmp_opt.rcv_tsecr)
|
||||
tcp_rsk(req)->snt_synack = tmp_opt.rcv_tsecr;
|
||||
else if (req->retrans) /* don't take RTT sample if retrans && ~TS */
|
||||
tcp_rsk(req)->snt_synack = 0;
|
||||
|
||||
/* OK, ACK is valid, create big socket and
|
||||
* feed this segment to it. It will repeat all
|
||||
|
Reference in New Issue
Block a user