Commit 9772efb9 authored by Stephen Hemminger's avatar Stephen Hemminger Committed by David S. Miller
Browse files

[TCP]: Appropriate Byte Count support



This is an updated version of the RFC3465 ABC patch originally
for Linux 2.6.11-rc4 by Yee-Ting Li. ABC is a way of counting
bytes ack'd rather than packets when updating congestion control.

The orignal ABC described in the RFC applied to a Reno style
algorithm. For advanced congestion control there is little
change after leaving slow start.

Signed-off-by: default avatarStephen Hemminger <shemminger@osdl.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7faffa1c
Loading
Loading
Loading
Loading
+5 −0
Original line number Original line Diff line number Diff line
@@ -78,6 +78,11 @@ inet_peer_gc_maxtime - INTEGER


TCP variables: 
TCP variables: 


tcp_abc - INTEGER
	Controls Appropriate Byte Count defined in RFC3465. If set to
	0 then does congestion avoid once per ack. 1 is conservative
	value, and 2 is more agressive.

tcp_syn_retries - INTEGER
tcp_syn_retries - INTEGER
	Number of times initial SYNs for an active TCP connection attempt
	Number of times initial SYNs for an active TCP connection attempt
	will be retransmitted. Should not be higher than 255. Default value
	will be retransmitted. Should not be higher than 255. Default value
+1 −0
Original line number Original line Diff line number Diff line
@@ -390,6 +390,7 @@ enum
	NET_TCP_BIC_BETA=108,
	NET_TCP_BIC_BETA=108,
	NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR=109,
	NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR=109,
	NET_TCP_CONG_CONTROL=110,
	NET_TCP_CONG_CONTROL=110,
	NET_TCP_ABC=111,
};
};


enum {
enum {
+1 −0
Original line number Original line Diff line number Diff line
@@ -326,6 +326,7 @@ struct tcp_sock {
	__u32	snd_up;		/* Urgent pointer		*/
	__u32	snd_up;		/* Urgent pointer		*/


	__u32	total_retrans;	/* Total retransmits for entire connection */
	__u32	total_retrans;	/* Total retransmits for entire connection */
	__u32	bytes_acked;	/* Appropriate Byte Counting - RFC3465 */


	unsigned int		keepalive_time;	  /* time before keep alive takes place */
	unsigned int		keepalive_time;	  /* time before keep alive takes place */
	unsigned int		keepalive_intvl;  /* time interval between keep alive probes */
	unsigned int		keepalive_intvl;  /* time interval between keep alive probes */
+19 −0
Original line number Original line Diff line number Diff line
@@ -218,6 +218,7 @@ extern int sysctl_tcp_low_latency;
extern int sysctl_tcp_nometrics_save;
extern int sysctl_tcp_nometrics_save;
extern int sysctl_tcp_moderate_rcvbuf;
extern int sysctl_tcp_moderate_rcvbuf;
extern int sysctl_tcp_tso_win_divisor;
extern int sysctl_tcp_tso_win_divisor;
extern int sysctl_tcp_abc;


extern atomic_t tcp_memory_allocated;
extern atomic_t tcp_memory_allocated;
extern atomic_t tcp_sockets_allocated;
extern atomic_t tcp_sockets_allocated;
@@ -770,6 +771,23 @@ static inline __u32 tcp_current_ssthresh(const struct sock *sk)
 */
 */
static inline void tcp_slow_start(struct tcp_sock *tp)
static inline void tcp_slow_start(struct tcp_sock *tp)
{
{
	if (sysctl_tcp_abc) {
		/* RFC3465: Slow Start
		 * TCP sender SHOULD increase cwnd by the number of
		 * previously unacknowledged bytes ACKed by each incoming
		 * acknowledgment, provided the increase is not more than L
		 */
		if (tp->bytes_acked < tp->mss_cache)
			return;

		/* We MAY increase by 2 if discovered delayed ack */
		if (sysctl_tcp_abc > 1 && tp->bytes_acked > 2*tp->mss_cache) {
			if (tp->snd_cwnd < tp->snd_cwnd_clamp)
				tp->snd_cwnd++;
		}
	}
	tp->bytes_acked = 0;

	if (tp->snd_cwnd < tp->snd_cwnd_clamp)
	if (tp->snd_cwnd < tp->snd_cwnd_clamp)
		tp->snd_cwnd++;
		tp->snd_cwnd++;
}
}
@@ -804,6 +822,7 @@ static inline void tcp_enter_cwr(struct sock *sk)
	struct tcp_sock *tp = tcp_sk(sk);
	struct tcp_sock *tp = tcp_sk(sk);


	tp->prior_ssthresh = 0;
	tp->prior_ssthresh = 0;
	tp->bytes_acked = 0;
	if (inet_csk(sk)->icsk_ca_state < TCP_CA_CWR) {
	if (inet_csk(sk)->icsk_ca_state < TCP_CA_CWR) {
		__tcp_enter_cwr(sk);
		__tcp_enter_cwr(sk);
		tcp_set_ca_state(sk, TCP_CA_CWR);
		tcp_set_ca_state(sk, TCP_CA_CWR);
+8 −0
Original line number Original line Diff line number Diff line
@@ -645,6 +645,14 @@ ctl_table ipv4_table[] = {
		.proc_handler	= &proc_tcp_congestion_control,
		.proc_handler	= &proc_tcp_congestion_control,
		.strategy	= &sysctl_tcp_congestion_control,
		.strategy	= &sysctl_tcp_congestion_control,
	},
	},
	{
		.ctl_name	= NET_TCP_ABC,
		.procname	= "tcp_abc",
		.data		= &sysctl_tcp_abc,
		.maxlen		= sizeof(int),
		.mode		= 0644,
		.proc_handler	= &proc_dointvec,
	},


	{ .ctl_name = 0 }
	{ .ctl_name = 0 }
};
};
Loading