diff -Naur linux-2.4.19/Documentation/Configure.help linux-2.4.19-hs_lss/Documentation/Configure.help --- linux-2.4.19/Documentation/Configure.help Fri Aug 2 19:39:42 2002 +++ linux-2.4.19-hs_lss/Documentation/Configure.help Sun Oct 13 17:33:04 2002 @@ -2766,6 +2766,7 @@ If you want to compile it as a module, say M here and read . If unsure, say `N'. + MAC address match support CONFIG_IP6_NF_MATCH_MAC mac matching allows you to match packets based on the source @@ -5106,6 +5107,16 @@ and you should also say Y to "Kernel/User network link driver", below. If unsure, say N. +AIMD Modifications +CONFIG_AIMD_MODS + A modification to TCP's congestion control mechanism for use with TCP connections with large congestion windows. + +Limited Slow Start +CONFIG_LSS + An optional mechanism for limiting the number of segments by which the congestion window is increased for one window + of data during slow-start, in order to improve performance for TCP connections with large congestion windows. + + TCP/IP networking CONFIG_INET These are the protocols used on the Internet and on most local diff -Naur linux-2.4.19/include/linux/sysctl.h linux-2.4.19-hs_lss/include/linux/sysctl.h --- linux-2.4.19/include/linux/sysctl.h Sun Oct 13 22:41:41 2002 +++ linux-2.4.19-hs_lss/include/linux/sysctl.h Sun Oct 13 18:37:05 2002 @@ -292,6 +292,13 @@ NET_IPV4_ICMP_RATELIMIT=89, NET_IPV4_ICMP_RATEMASK=90, NET_TCP_TW_REUSE=91, +#ifdef CONFIG_AIMD_MODS + NET_HSTCP, +#endif +#ifdef CONFIG_LSS + NET_TCP_LSS, + NET_MAX_SSTHRESH, +#endif #ifdef CONFIG_WEB100_DEF_WINSCALE NET_IPV4_WEB100_DEFAULT_WSCALE, #endif diff -Naur linux-2.4.19/include/net/tcp.h linux-2.4.19-hs_lss/include/net/tcp.h --- linux-2.4.19/include/net/tcp.h Sun Oct 13 22:41:42 2002 +++ linux-2.4.19-hs_lss/include/net/tcp.h Sun Oct 13 18:33:14 2002 @@ -466,6 +466,15 @@ extern int sysctl_tcp_app_win; extern int sysctl_tcp_adv_win_scale; extern int sysctl_tcp_tw_reuse; + +#ifdef CONFIG_AIMD_MODS +extern int sysctl_hstcp; +#endif +#ifdef CONFIG_LSS +extern int sysctl_tcp_lss; +extern int sysctl_max_ssthresh; +#endif + #ifdef CONFIG_WEB100_DEF_WINSCALE extern int sysctl_web100_default_wscale; #endif @@ -667,6 +676,12 @@ struct tcphdr *th, unsigned len); +#ifdef CONFIG_AIMD_MODS + +extern struct hstcp modified_aimd_values(__u32 cwnd); + +#endif + enum tcp_ack_state_t { TCP_ACK_SCHED = 1, diff -Naur linux-2.4.19/net/ipv4/Config.in linux-2.4.19-hs_lss/net/ipv4/Config.in --- linux-2.4.19/net/ipv4/Config.in Sun Oct 13 22:41:42 2002 +++ linux-2.4.19-hs_lss/net/ipv4/Config.in Sun Oct 13 17:26:29 2002 @@ -38,6 +38,8 @@ fi if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then bool ' IP: ARP daemon support (EXPERIMENTAL)' CONFIG_ARPD + bool ' IP: Sally Floyds AIMD Modifications (EXPERIMENTAL)' CONFIG_AIMD_MODS + bool ' IP: Sally Floyds Limited Slow Start (EXPERIMENTAL)' CONFIG_LSS fi bool ' IP: TCP Explicit Congestion Notification support' CONFIG_INET_ECN bool ' IP: TCP syncookie support (disabled per default)' CONFIG_SYN_COOKIES @@ -59,3 +61,4 @@ fi fi fi + diff -Naur linux-2.4.19/net/ipv4/sysctl_net_ipv4.c linux-2.4.19-hs_lss/net/ipv4/sysctl_net_ipv4.c --- linux-2.4.19/net/ipv4/sysctl_net_ipv4.c Sun Oct 13 22:41:42 2002 +++ linux-2.4.19-hs_lss/net/ipv4/sysctl_net_ipv4.c Sun Oct 13 18:32:11 2002 @@ -221,6 +221,16 @@ &sysctl_icmp_ratemask, sizeof(int), 0644, NULL, &proc_dointvec}, {NET_TCP_TW_REUSE, "tcp_tw_reuse", &sysctl_tcp_tw_reuse, sizeof(int), 0644, NULL, &proc_dointvec}, +#ifdef CONFIG_AIMD_MODS + {NET_HSTCP, "hstcp", + &sysctl_hstcp, sizeof(int), 0644, NULL, &proc_dointvec}, +#endif +#ifdef CONFIG_LSS + {NET_TCP_LSS, "tcp_lss", + &sysctl_tcp_lss, sizeof(int), 0644, NULL, &proc_dointvec}, + {NET_MAX_SSTHRESH, "max_ssthresh", + &sysctl_max_ssthresh, sizeof(int), 0644, NULL, &proc_dointvec}, +#endif #ifdef CONFIG_WEB100_DEF_WINSCALE {NET_IPV4_WEB100_DEFAULT_WSCALE, "web100_default_wscale", &sysctl_web100_default_wscale, sizeof(int), 0644, NULL, &proc_dointvec}, diff -Naur linux-2.4.19/net/ipv4/tcp_input.c linux-2.4.19-hs_lss/net/ipv4/tcp_input.c --- linux-2.4.19/net/ipv4/tcp_input.c Sun Oct 13 22:41:42 2002 +++ linux-2.4.19-hs_lss/net/ipv4/tcp_input.c Sun Oct 13 18:30:07 2002 @@ -87,6 +87,20 @@ int sysctl_tcp_rfc1337 = 0; int sysctl_tcp_max_orphans = NR_FILE; +#ifdef CONFIG_AIMD_MODS +int sysctl_hstcp = 1; +#else +int sysctl_hstcp = 0; +#endif + +#ifdef CONFIG_LSS +int sysctl_tcp_lss = 1; +int sysctl_max_ssthresh = 100; +#else +int sysctl_tcp_lss = 0; +#endif + + #define FLAG_DATA 0x01 /* Incoming frame contained data. */ #define FLAG_WIN_UPDATE 0x02 /* Incoming ACK was a window update. */ #define FLAG_DATA_ACKED 0x04 /* This ACK acknowledged new data. */ @@ -111,6 +125,117 @@ /* Adapt the MSS value used to make delayed ack decision to the * real world. */ + +#ifdef CONFIG_AIMD_MODS + +struct hstcp { + __u32 cwnd; + __u8 a; + __u8 b; +}; + +struct hstcp aimd_values[] = { +{41, 1, 126}, +{116, 2, 113}, +{217, 3, 104}, +{340, 4, 98}, +{483, 5, 94}, +{647, 6, 90}, +{829, 7, 86}, +{1030, 8, 84}, +{1249, 9, 81}, +{1486, 10, 79}, +{1741, 11, 77}, +{2015, 12, 75}, +{2306, 13, 73}, +{2616, 14, 71}, +{2944, 15, 70}, +{3290, 16, 68}, +{3656, 17, 67}, +{4040, 18, 65}, +{4443, 19, 64}, +{4866, 20, 63}, +{5308, 21, 62}, +{5771, 22, 61}, +{6254, 23, 60}, +{6758, 24, 59}, +{7284, 25, 58}, +{7831, 26, 57}, +{8401, 27, 56}, +{8993, 28, 55}, +{9609, 29, 54}, +{10249, 30, 53}, +{10913, 31, 52}, +{11603, 32, 51}, +{12318, 33, 51}, +{13061, 34, 50}, +{13830, 35, 49}, +{14628, 36, 48}, +{15456, 37, 47}, +{16313, 38, 47}, +{17202, 39, 46}, +{18123, 40, 45}, +{19078, 41, 45}, +{20067, 42, 44}, +{21092, 43, 43}, +{22155, 44, 43}, +{23257, 45, 42}, +{24399, 46, 41}, +{25584, 47, 41}, +{26813, 48, 40}, +{28088, 49, 40}, +{29412, 50, 39}, +{30786, 51, 38}, +{32215, 52, 38}, +{33700, 53, 37}, +{35244, 54, 37}, +{36852, 55, 36}, +{38527, 56, 35}, +{40273, 57, 35}, +{42095, 58, 34}, +{43999, 59, 34}, +{45990, 60, 33}, +{48075, 61, 32}, +{50261, 62, 32}, +{52559, 63, 31}, +{54977, 64, 31}, +{57528, 65, 30}, +{60225, 66, 29}, +{63086, 67, 29}, +{66130, 68, 28}, +{69383, 69, 27}, +{72873, 70, 27}, +{76641, 71, 26}, +{80738, 72, 25}, +{85231, 73, 25}, +{90219, 74, 24}, +{95845, 75, 23}, +{102342, 76, 22}, +{110131, 77, 21}, +{110131, 77, 21}, +{120146, 78, 20}, +{135785, 79, 19}, +}; + +static int max_aimd_entries = 79; + +struct hstcp modified_aimd_values(__u32 cwnd) +{ + short left = 0, right = max_aimd_entries, mid; + while (right > left) + { + mid = (left + right)>>1; + if (aimd_values[mid].cwnd < cwnd) + left = mid + 1; + else + right = mid; + } + return aimd_values[right]; +} + +#endif + + static __inline__ void tcp_measure_rcv_mss(struct tcp_opt *tp, struct sk_buff *skb) { unsigned int len, lss; @@ -1341,8 +1466,12 @@ int decr = tp->snd_cwnd_cnt + 1; tp->snd_cwnd_cnt = decr&1; - decr >>= 1; +#ifdef CONFIG_AIMD_MODS + decr = (int)(decr * (modified_aimd_values(tp->snd_cwnd).b>>8)); // value returned by this fn is b*256 so do >>8 to get b +#else + decr >>= 1; +#endif if (decr && tp->snd_cwnd > tp->snd_ssthresh/2) tp->snd_cwnd -= decr; @@ -1756,32 +1885,60 @@ */ static __inline__ void tcp_cong_avoid(struct tcp_opt *tp) { +#ifdef CONFIG_LSS + static int bytes; + int K; +#endif + +/* commented to get higher cwnd #ifdef CONFIG_WEB100_STATS if (tp->snd_cwnd > tp->snd_cwnd_clamp) { tp->snd_cwnd--; return; } #endif - +*/ +#ifdef CONFIG_LSS + if (tp->snd_cwnd <= tp->snd_ssthresh || tp->snd_cwnd <= sysctl_max_ssthresh) { +#else if (tp->snd_cwnd <= tp->snd_ssthresh) { +#endif /* In "safe" area, increase. */ tp->snd_cwnd++; WEB100_VAR_INC(tp, SlowStart); - } else { + } +#ifdef CONFIG_LSS + else if (tp->snd_cwnd > sysctl_max_ssthresh) + { + K = (2 * tp->snd_cwnd) / sysctl_max_ssthresh ; + bytes += K; + if (bytes > tp->mss_cache) + { + WEB100_VAR_INC(tp, SlowStart); + tp->snd_cwnd++; + } + } +#else + else { /* In dangerous area, increase slowly. * In theory this is tp->snd_cwnd += 1 / tp->snd_cwnd */ tp->snd_cwnd_cnt += 1<<3; - while (tp->snd_cwnd_cnt > tp->snd_cwnd<<3) { +#ifdef CONFIG_AIMD_MODS + while ((tp->snd_cwnd_cnt * modified_aimd_values(tp->snd_cwnd).a) > tp->snd_cwnd<<3) { +#else + while (tp->snd_cwnd_cnt > tp->snd_cwnd<<3) { +#endif tp->snd_cwnd_cnt -= tp->snd_cwnd<<3; tp->snd_cwnd++; } WEB100_VAR_INC(tp, CongAvoid); } - tp->snd_cwnd = min(tp->snd_cwnd, (__u32)tp->snd_cwnd_clamp); +#endif // for CONFIG_LSS +// tp->snd_cwnd = min(tp->snd_cwnd, (__u32)tp->snd_cwnd_clamp); commented to get high cwnd tp->snd_cwnd_stamp = tcp_time_stamp; } diff -Naur linux-2.4.19/net/netsyms.c linux-2.4.19-hs_lss/net/netsyms.c --- linux-2.4.19/net/netsyms.c Sun Oct 13 22:41:42 2002 +++ linux-2.4.19-hs_lss/net/netsyms.c Sun Oct 13 18:32:49 2002 @@ -401,6 +401,15 @@ EXPORT_SYMBOL(sysctl_max_syn_backlog); #endif +#ifdef CONFIG_AIMD_MODS +EXPORT_SYMBOL(hstcp); +#endif + +#ifdef CONFIG_LSS +EXPORT_SYMBOL(tcp_lss); +EXPORT_SYMBOL(max_ssthresh); +#endif + #if defined(CONFIG_WEB100_STATS) && defined(CONFIG_IPV6_MODULE) EXPORT_SYMBOL(web100_stats_create); EXPORT_SYMBOL(web100_stats_destroy);