summaryrefslogtreecommitdiff
path: root/sys/netinet/tcp_timer.c
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix overflows in intermediate calculations in sysctl_msec_to_ticks().John Polstra2002-07-201-2/+2
| | | | | | | | | | At hz values of 1000 and above the overflows caused net.inet.tcp.keepidle to be reported as negative. MFC after: 3 days Notes: svn path=/head/; revision=100420
* Introduce two new sysctl's:Matthew Dillon2002-07-181-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | net.inet.tcp.rexmit_min (default 3 ticks equiv) This sysctl is the retransmit timer RTO minimum, specified in milliseconds. This value is designed for algorithmic stability only. net.inet.tcp.rexmit_slop (default 200ms) This sysctl is the retransmit timer RTO slop which is added to every retransmit timeout and is designed to handle protocol stack overheads and delayed ack issues. Note that the *original* code applied a 1-second RTO minimum but never applied real slop to the RTO calculation, so any RTO calculation over one second would have no slop and thus not account for protocol stack overheads (TCP timestamps are not a measure of protocol turnaround!). Essentially, the original code made the RTO calculation almost completely irrelevant. Please note that the 200ms slop is debateable. This commit is not meant to be a line in the sand, and if the community winds up deciding that increasing it is the correct solution then it's easy to do. Note that larger values will destroy performance on lossy networks while smaller values may result in a greater number of unnecessary retransmits. Notes: svn path=/head/; revision=100335
* Lock up inpcb.Jeffrey Hsu2002-06-101-0/+51
| | | | | | | Submitted by: Jennifer Yang <yangjihui@yahoo.com> Notes: svn path=/head/; revision=98102
* Back out my lats commit of locking down a socket, it conflicts with hsu's work.Seigo Tanimura2002-05-311-51/+17
| | | | | | | Requested by: hsu Notes: svn path=/head/; revision=97658
* Lock down a socket, milestone 1.Seigo Tanimura2002-05-201-17/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o Add a mutex (sb_mtx) to struct sockbuf. This protects the data in a socket buffer. The mutex in the receive buffer also protects the data in struct socket. o Determine the lock strategy for each members in struct socket. o Lock down the following members: - so_count - so_options - so_linger - so_state o Remove *_locked() socket APIs. Make the following socket APIs touching the members above now require a locked socket: - sodisconnect() - soisconnected() - soisconnecting() - soisdisconnected() - soisdisconnecting() - sofree() - soref() - sorele() - sorwakeup() - sotryfree() - sowakeup() - sowwakeup() Reviewed by: alfred Notes: svn path=/head/; revision=96972
* o Our currenty userland boot code (due to rc.conf and rc.network) alwaysRobert Watson2001-12-071-1/+1
| | | | | | | | enables TCP keepalives using the net.inet.tcp.always_keepalive by default. Synchronize the kernel default with the userland default. Notes: svn path=/head/; revision=87499
* Much delayed but now present: RFC 1948 style sequence numbersMike Silbersack2001-08-221-2/+0
| | | | | | | | | | | | | In order to ensure security and functionality, RFC 1948 style initial sequence number generation has been implemented. Barring any major crypographic breakthroughs, this algorithm should be unbreakable. In addition, the problems with TIME_WAIT recycling which affect our currently used algorithm are not present. Reviewed by: jesper Notes: svn path=/head/; revision=82122
* Temporary feature: Runtime tuneable tcp initial sequence numberMike Silbersack2001-07-081-0/+2
| | | | | | | | | | | | | | | | | | | | | generation scheme. Users may now select between the currently used OpenBSD algorithm and the older random positive increment method. While the OpenBSD algorithm is more secure, it also breaks TIME_WAIT handling; this is causing trouble for an increasing number of folks. To switch between generation schemes, one sets the sysctl net.inet.tcp.tcp_seq_genscheme. 0 = random positive increments, 1 = the OpenBSD algorithm. 1 is still the default. Once a secure _and_ compatible algorithm is implemented, this sysctl will be removed. Reviewed by: jlemon Tested by: numerous subscribers of -net Notes: svn path=/head/; revision=79413
* Eliminate the allocation of a tcp template structure for eachMike Silbersack2001-06-231-3/+9
| | | | | | | | | | | | | | | connection. The information contained in a tcptemp can be reconstructed from a tcpcb when needed. Previously, tcp templates required the allocation of one mbuf per connection. On large systems, this change should free up a large number of mbufs. Reviewed by: bmilekic, jlemon, ru MFC after: 2 weeks Notes: svn path=/head/; revision=78642
* Disable rfc1323 and rfc1644 TCP extensions if we havn't gotJesper Skriver2001-05-311-0/+9
| | | | | | | | | | | | | | | any response to our third SYN to work-around some broken terminal servers (most of which have hopefully been retired) that have bad VJ header compression code which trashes TCP segments containing unknown-to-them TCP options. PR: kern/1689 Submitted by: jesper Reviewed by: wollman MFC after: 2 weeks Notes: svn path=/head/; revision=77539
* Say goodbye to TCP_COMPAT_42Jesper Skriver2001-04-201-15/+0
| | | | | | | | Reviewed by: wollman Requested by: wollman Notes: svn path=/head/; revision=75733
* Randomize the TCP initial sequence numbers more thoroughly.Kris Kennaway2001-04-171-1/+1
| | | | | | | | Obtained from: OpenBSD Reviewed by: jesper, peter, -developers Notes: svn path=/head/; revision=75619
* Use more aggressive retransmit timeouts for the initial SYN packet.Jonathan Lemon2001-02-261-1/+7
| | | | | | | | As we currently drop the connection after 4 retransmits + 2 ICMP errors, this allows initial connection attempts to be dropped much faster. Notes: svn path=/head/; revision=73110
* If TCPDEBUG is defined, we could dereference a tp which was freed.Jonathan Lemon2000-10-021-1/+1
| | | | Notes: svn path=/head/; revision=66552
* It is possible for a TCP callout to be removed from the timing wheel,Jonathan Lemon2000-09-161-5/+5
| | | | | | | | | but have a network interrupt arrive and deactivate the timeout before the callout routine runs. Check for this case in the callout routine; it should only run if the callout is active and not on the wheel. Notes: svn path=/head/; revision=65906
* Previous commit changing SYSCTL_HANDLER_ARGS violated KNF.Poul-Henning Kamp2000-07-041-1/+1
| | | | | | | Pointed out by: bde Notes: svn path=/head/; revision=62573
* Style police catches up with rev 1.26 of src/sys/sys/sysctl.h:Poul-Henning Kamp2000-07-031-1/+1
| | | | | | | | | | | Sanitize SYSCTL_HANDLER_ARGS so that simplistic tools can grog our sources: -sysctl_vm_zone SYSCTL_HANDLER_ARGS +sysctl_vm_zone (SYSCTL_HANDLER_ARGS) Notes: svn path=/head/; revision=62454
* Implement TCP NewReno, as documented in RFC 2582. This allowsJonathan Lemon2000-05-061-0/+5
| | | | | | | | | | | better recovery for multiple packet losses in a single window. The algorithm can be toggled via the sysctl net.inet.tcp.newreno, which defaults to "on". Submitted by: Jayanth Vijayaraghavan <jayanth@yahoo-inc.com> Notes: svn path=/head/; revision=60067
* tcp updates to support IPv6.Yoshinobu Inoue2000-01-091-7/+18
| | | | | | | | | | also a small patch to sys/nfs/nfs_socket.c, as max_hdr size change. Reviewed by: freebsd-arch, cvs-committers Obtained from: KAME project Notes: svn path=/head/; revision=55679
* Simplify, and return an error if the user attempts to set a TCPJonathan Lemon1999-08-311-7/+3
| | | | | | | | | time value which results in < 1 tick. Suggested by: bde Notes: svn path=/head/; revision=50705
* Add a SYSCTL_PROC so that TCP timer values are now expressed toJonathan Lemon1999-08-311-10/+35
| | | | | | | | | the user in ms, while they are stored internally as ticks. Note that there probably are rounding bogons here, especially on the alpha. Notes: svn path=/head/; revision=50682
* Restructure TCP timeout handling:Jonathan Lemon1999-08-301-223/+287
| | | | | | | | | | | | | - eliminate the fast/slow timeout lists for TCP and instead use a callout entry for each timer. - increase the TCP timer granularity to HZ - implement "bad retransmit" recovery, as presented in "On Estimating End-to-End Network Path Properties", by Allman and Paxson. Submitted by: jlemon, wollmann Notes: svn path=/head/; revision=50673
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50477
* Add sysctl descriptions to many SYSCTL_XXXsBill Fumerola1999-05-031-3/+3
| | | | | | | | | | PR: kern/11197 Submitted by: Adrian Chadd <adrian@FreeBSD.org> Reviewed by: billf(spelling/style/minor nits) Looked at by: bde(style) Notes: svn path=/head/; revision=46381
* Ensure that TCP_REXMTVAL doesn't return a value less than t_rttmin. ThisDavid Greenman1998-04-241-12/+7
| | | | | | | | | | | | | | is believed to have been broken with the Brakmo/Peterson srtt calculation changes. The result of this bug is that TCP connections could time out extremely quickly (in 12 seconds). Also backed out jdp's partial fix for this problem in rev 1.17 of tcp_timer.c as it is obsoleted by this commit. Bug was pointed out by Kevin Lehey <kml@roller.nas.nasa.gov>. PR: 6068 Notes: svn path=/head/; revision=35419
* Remove the last traces of TUBA.Poul-Henning Kamp1998-04-061-8/+1
| | | | | | | Inspired by: PR kern/3317 Notes: svn path=/head/; revision=35056
* Changes to support the addition of a new sysctl variable:David Greenman1998-02-261-11/+12
| | | | | | | | | net.inet.tcp.delack_enabled Which defaults to 1 and can be set to 0 to disable TCP delayed-ack processing (i.e. all acks are immediate). Notes: svn path=/head/; revision=33846
* Make TCP_COMPAT_42 a new style option.Eivind Eklund1998-01-251-1/+2
| | | | Notes: svn path=/head/; revision=32752
* Make TCPDEBUG a new-style option.Joerg Wunsch1997-09-161-1/+3
| | | | Notes: svn path=/head/; revision=29514
* Removed unused #includes.Bruce Evans1997-08-021-7/+1
| | | | Notes: svn path=/head/; revision=27845
* Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are notPeter Wemm1997-02-221-1/+1
| | | | | | | ready for it yet. Notes: svn path=/head/; revision=22975
* Make the long-awaited change from $Id$ to $FreeBSD$Jordan K. Hubbard1997-01-141-1/+1
| | | | | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise. Notes: svn path=/head/; revision=21673
* Make the misnamed tcp initial keepalive timer value (which is really thePaul Traina1996-09-131-1/+5
| | | | | | | | | | | time, in seconds, that state for non-established TCP sessions stays about) a sysctl modifyable variable. [part 1 of two commits, I just realized I can't play with the indices as I was typing this commit message.] Notes: svn path=/head/; revision=18280
* Fixed two bugs in previous commit: be sure to include tcp_debug.h whenDavid Greenman1996-07-121-1/+4
| | | | | | | TCPDEBUG is defined, and fix typo in TCPDEBUG2() macro. Notes: svn path=/head/; revision=17138
* Modify the kernel to use the new pr_usrreqs interface rather than the oldGarrett Wollman1996-07-111-4/+16
| | | | | | | | | | | | | | | | | pr_usrreq mechanism which was poorly designed and error-prone. This commit renames pr_usrreq to pr_ousrreq so that old code which depended on it would break in an obvious manner. This commit also implements the new interface for TCP, although the old function is left as an example (#ifdef'ed out). This commit ALSO fixes a longstanding bug in the TCP timer processing (introduced by davidg on 1995/04/12) which caused timer processing on a TCB to always stop after a single timer had expired (because it misinterpreted the return value from tcp_usrreq() to indicate that the TCB had been deleted). Finally, some code related to polling has been deleted from if.c because it is not relevant t -current and doesn't look at all like my current code. Notes: svn path=/head/; revision=17096
* Fix a bug in the handling of the "persist" state which, under certainJohn Polstra1996-06-031-7/+12
| | | | | | | | | | | | | circumstances, caused perfectly good connections to be dropped. This happened for connections over a LAN, where the retransmit timer calculation TCP_REXMTVAL(tp) returned 0. If sending was blocked by flow control for long enough, the old code dropped the connection, even though timely replies were being received for all window probes. Reviewed by: W. Richard Stevens <rstevens@noao.edu> Notes: svn path=/head/; revision=16099
* Two fixes from Rich Stevens:David Greenman1996-04-151-2/+2
| | | | | | | | | | | | 1) Set the persist timer to help time-out connections in the CLOSING state. 2) Honor the keep-alive timer in the CLOSING state. This fixes problems with connections getting "stuck" due to incompletion of the final connection shutdown which can be a BIG problem on busy WWW servers. Notes: svn path=/head/; revision=15262
* Add a sysctl (net.inet.tcp.always_keepalive: 0) that when set will forcePoul-Henning Kamp1996-04-041-2/+7
| | | | | | | | | keepalive on all tcp sessions. Setsockopt(2) cannot override this setting. Maybe another one is needed that just changes the default for SO_KEEPALIVE ? Requested by: Joe Greco <jgreco@brasil.moneng.mei.com> Notes: svn path=/head/; revision=15039
* Move or add #include <queue.h> in preparation for upcoming struct socketDavid Greenman1996-03-111-2/+2
| | | | | | | changes. Notes: svn path=/head/; revision=14546
* Reverse the modification which caused the annoying m_copydata crash: setAndras Olah1996-01-041-1/+5
| | | | | | | | | the TF_ACKNOW flag when the REXMT timer goes off to force a retransmission. In certain situations pulling snd_nxt back to snd_una is not sufficient. Notes: svn path=/head/; revision=13229
* New style sysctl & staticize alot of stuff.Poul-Henning Kamp1995-11-141-6/+8
| | | | Notes: svn path=/head/; revision=12296
* Start adding new style sysctl here too.Poul-Henning Kamp1995-11-091-1/+9
| | | | Notes: svn path=/head/; revision=12172
* Setting the TF_ACKNOW flag was redundant in the REXMT timeout becauseAndras Olah1995-11-031-5/+1
| | | | | | | | | | tcp_output() checks for the condition snd_nxt == snd_una. Reviewed by: davidg, wollman, olah Suggested by: Richard Stevens Notes: svn path=/head/; revision=12046
* Finish 4.4-Lite-2 merge: randomize TCP initial sequence numbersGarrett Wollman1995-10-031-8/+16
| | | | | | | to make ISS-guessing spoofing attacks harder. Notes: svn path=/head/; revision=11150
* Add connection drop capability for persist timeouts.David Greenman1995-07-291-1/+17
| | | | | | | | Reviewed by: Andras Olah Obtained from: 4.4BSD-lite2 via W. Richard Stevens Notes: svn path=/head/; revision=9773
* Remove trailing whitespace.Rodney W. Grimes1995-05-301-2/+2
| | | | Notes: svn path=/head/; revision=8876
* Fixed bug I introduced when changing PCB list to use 4.4BSD style queueDavid Greenman1995-04-121-4/+3
| | | | | | | macros. Basically, detect 'tp' going away differently. Notes: svn path=/head/; revision=7770
* Implemented PCB hashing. Includes new functions in_pcbinshash, in_pcbrehash,David Greenman1995-04-091-14/+19
| | | | | | | and in_pcblookuphash. Notes: svn path=/head/; revision=7684
* Transaction TCP support now standard. Hack away!Garrett Wollman1995-02-161-5/+1
| | | | Notes: svn path=/head/; revision=6475
* Merge Transaction TCP, courtesy of Andras Olah <olah@cs.utwente.nl> andGarrett Wollman1995-02-091-1/+10
| | | | | | | | | | | | Bob Braden <braden@isi.edu>. NB: This has not had David's TCP ACK hack re-integrated. It is not clear what the correct solution to this problem is, if any. If a better solution doesn't pop up in response to this message, I'll put David's code back in (or he's welcome to do so himself). Notes: svn path=/head/; revision=6283