tcp_timer.h revision 28bcddec322ed1073dc7dbaf82c4c622aed468fd
662N/A * Copyright (C) 2006-2010 Oracle Corporation 662N/A * This file is part of VirtualBox Open Source Edition (OSE), as 662N/A * you can redistribute it and/or modify it under the terms of the GNU 662N/A * General Public License (GPL) as published by the Free Software 662N/A * Foundation, in version 2 as it comes in the "COPYING" file of the 662N/A * VirtualBox OSE distribution. VirtualBox OSE is distributed in the 662N/A * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. 873N/A * This code is based on: 662N/A * Copyright (c) 1982, 1986, 1993 662N/A * The Regents of the University of California. All rights reserved. 662N/A * Redistribution and use in source and binary forms, with or without 3231N/A * modification, are permitted provided that the following conditions 662N/A * 1. Redistributions of source code must retain the above copyright 1970N/A * notice, this list of conditions and the following disclaimer. 662N/A * 2. Redistributions in binary form must reproduce the above copyright 2086N/A * notice, this list of conditions and the following disclaimer in the 2086N/A * documentation and/or other materials provided with the distribution. 2086N/A * 3. All advertising materials mentioning features or use of this software 662N/A * must display the following acknowledgement: 662N/A * This product includes software developed by the University of 662N/A * California, Berkeley and its contributors. 662N/A * 4. Neither the name of the University nor the names of its contributors 662N/A * may be used to endorse or promote products derived from this software 662N/A * without specific prior written permission. 662N/A * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 662N/A * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 662N/A * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 662N/A * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 662N/A * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 662N/A * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 662N/A * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 662N/A * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 662N/A * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 662N/A * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 662N/A * Definitions of the TCP timers. These timers are counted 662N/A * down PR_SLOWHZ times a second. 2086N/A * The TCPT_REXMT timer is used to force retransmissions. 662N/A * The TCP has the TCPT_REXMT timer set whenever segments 662N/A * have been sent for which ACKs are expected but not yet 662N/A * received. If an ACK is received which advances tp->snd_una, 662N/A * then the retransmit timer is cleared (if there are no more 662N/A * outstanding segments) or reset to the base value (if there 2086N/A * are more ACKs expected). Whenever the retransmit timer goes off, 662N/A * we retransmit one unacknowledged segment, and do a backoff 662N/A * on the retransmit timer. 662N/A * The TCPT_PERSIST timer is used to keep window size information 662N/A * flowing even if the window goes shut. If all previous transmissions 662N/A * have been acknowledged (so that there are no retransmissions in progress), 662N/A * and the window is too small to bother sending anything, then we start 662N/A * the TCPT_PERSIST timer. When it expires, if the window is nonzero, 662N/A * we go to transmit state. Otherwise, at intervals send a single byte 662N/A * into the peer's window to force him to update our window information. 662N/A * We do this at most as often as TCPT_PERSMIN time intervals, 662N/A * but no more frequently than the current estimate of round-trip 2086N/A * packet time. The TCPT_PERSIST timer is cleared whenever we receive 662N/A * a window update from the peer. 662N/A * The TCPT_KEEP timer is used to keep connections alive. If an 662N/A * connection is idle (no segments received) for TCPTV_KEEP_INIT amount of time, 662N/A * but not yet established, then we drop the connection. Once the connection 662N/A * is established, if the connection is idle for TCPTV_KEEP_IDLE time 662N/A * (and keepalives have been enabled on the socket), we begin to probe 662N/A * the connection. We force the peer to send us a segment by sending: 662N/A * <SEQ=SND.UNA-1><ACK=RCV.NXT><CTL=ACK> 662N/A * This segment is (deliberately) outside the window, and should elicit 662N/A * an ack segment in response from the peer. If, despite the TCPT_KEEP 662N/A * initiated segments we cannot elicit a response from a peer in TCPT_MAXIDLE 662N/A * amount of time probing, then we drop the connection. 662N/A {
"REXMT",
"PERSIST",
"KEEP",
"2MSL" };
662N/A * Force a time value to be in a certain range.