Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site wdl1.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!decvax!ittatc!dcdwest!sdcsvax!sdcrdcf!hplabs!fortune!wdl1!jbn From: jbn@wdl1.UUCP Newsgroups: net.bugs.4bsd Subject: TCP congestion fix Message-ID: <874@wdl1.UUCP> Date: Wed, 20-Nov-85 21:21:44 EST Article-I.D.: wdl1.874 Posted: Wed Nov 20 21:21:44 1985 Date-Received: Wed, 27-Nov-85 01:21:42 EST Sender: notes@wdl1.UUCP Organization: Ford Aerospace, Western Development Laboratories Lines: 63 Nf-ID: #N:wdl1:71800002:000:2056 Nf-From: wdl1!jbn Nov 20 12:57:00 1985 Index: ucb/netinet/tcp_output.c 4.2BSD Symptom: Very poor TELNET performance over non-local networks; broken network connections, gateway congestion, high dropped packet rates in gateways, etc. Description: TCP sends too many tiny packets over long-haul links, congesting networks, links, gateways, etc. Sites with a connection to the ARPANET or CSNET, Ethernet bridges, gateways, packet forwarders, DMC or DMR links, X.25 links, or any non-trivial network architecture need this fix. Any TELNET use of a low-speed net (<56Kb) by a 4.2 system without this fix will clog the net to the point of unusability. Sites with nothing but a local area net not connected to any other net do not need this fix, although it is harmless in such situations. There is a better solution in 4.3BSD but it is more complex. There is a related fix to the TCP retransmission timer which should also be installed in tcp_output.c but is not a mandatory prerequisite for this fix. See Mt. Xinu buglist. J. Nagle Cause: Poor TCP send policy in tcp_output.c. Fix: (Line numbers reference Mt. Xinu's 4.2BSD) *** tcp_output.c *** 76,77c76,77 < * Sender silly window avoidance. If can send all data, < * a maximum segment, at least 1/4 of window do it, --- > * Sender silly window and congestion avoidance. > * If a maximum segment, no outstanding data, 78a79,81 > * This is a simplified version of the technique described in > * ACM Computer Communications Review, October 1984, p. 11. > * J. Nagle 81c84 < if (len == tp->t_maxseg || off+len >= so->so_snd.sb_cc) --- > if (len == tp->t_maxseg) /* if max size seg */ 83c86 < if (len * 4 >= tp->snd_wnd) /* a lot */ --- > if (tp->snd_nxt == tp->snd_una) /* if no outstanding */ 99,100c102 < * next expected input.) If this is 35% or more of the < * maximum possible window, then want to send a segment to peer. --- > * next expected input.) 103,105d104 < if (win > 0 && < ((100*(win-(tp->rcv_adv-tp->rcv_nxt))/so->so_rcv.sb_hiwat) >= 35)) < goto send;