mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-24 07:31:41 +00:00
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:
parent
aee80b54b2
commit
9ad7c049f0
8 changed files with 55 additions and 27 deletions
|
@ -429,8 +429,8 @@ void tcp_v4_err(struct sk_buff *icmp_skb, u32 info)
|
|||
break;
|
||||
|
||||
icsk->icsk_backoff--;
|
||||
inet_csk(sk)->icsk_rto = __tcp_set_rto(tp) <<
|
||||
icsk->icsk_backoff;
|
||||
inet_csk(sk)->icsk_rto = (tp->srtt ? __tcp_set_rto(tp) :
|
||||
TCP_TIMEOUT_INIT) << icsk->icsk_backoff;
|
||||
tcp_bound_rto(sk);
|
||||
|
||||
skb = tcp_write_queue_head(sk);
|
||||
|
@ -1384,6 +1384,7 @@ int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
|
|||
isn = tcp_v4_init_sequence(skb);
|
||||
}
|
||||
tcp_rsk(req)->snt_isn = isn;
|
||||
tcp_rsk(req)->snt_synack = tcp_time_stamp;
|
||||
|
||||
if (tcp_v4_send_synack(sk, dst, req,
|
||||
(struct request_values *)&tmp_ext) ||
|
||||
|
@ -1458,6 +1459,10 @@ struct sock *tcp_v4_syn_recv_sock(struct sock *sk, struct sk_buff *skb,
|
|||
newtp->advmss = tcp_sk(sk)->rx_opt.user_mss;
|
||||
|
||||
tcp_initialize_rcv_mss(newsk);
|
||||
if (tcp_rsk(req)->snt_synack)
|
||||
tcp_valid_rtt_meas(newsk,
|
||||
tcp_time_stamp - tcp_rsk(req)->snt_synack);
|
||||
newtp->total_retrans = req->retrans;
|
||||
|
||||
#ifdef CONFIG_TCP_MD5SIG
|
||||
/* Copy over the MD5 key from the original socket */
|
||||
|
@ -1854,7 +1859,7 @@ static int tcp_v4_init_sock(struct sock *sk)
|
|||
* algorithms that we must have the following bandaid to talk
|
||||
* efficiently to them. -DaveM
|
||||
*/
|
||||
tp->snd_cwnd = 2;
|
||||
tp->snd_cwnd = TCP_INIT_CWND;
|
||||
|
||||
/* See draft-stevens-tcpca-spec-01 for discussion of the
|
||||
* initialization of these values.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue