bostic@OKEEFFE.BERKELEY.EDU (Keith Bostic) (04/06/88)
Subject: spp_timer.h for updated IP/TCP and XNS sources for 4.3BSD Index: sys/netns/spp_timer.h 4.3BSD Description: We forgot to post a copy of spp_timer.h with the updated IP/TCP and XNS sources for 4.3BSD. A shar containing a copy is attached. # This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # netns # netns/spp_timer.h # echo c - netns mkdir netns > /dev/null 2>&1 echo x - netns/spp_timer.h sed 's/^X//' >netns/spp_timer.h << 'END-of-netns/spp_timer.h' X/* X * Copyright (c) 1982, 1986, 1988 Regents of the University of California. X * All rights reserved. X * X * Redistribution and use in source and binary forms are permitted X * provided that this notice is preserved and that due credit is given X * to the University of California at Berkeley. The name of the University X * may not be used to endorse or promote products derived from this X * software without specific prior written permission. This software X * is provided ``as is'' without express or implied warranty. X * X * @(#)spp_timer.h 7.1 (Berkeley) 3/12/88 X */ X X/* X * Definitions of the SPP timers. These timers are counted X * down PR_SLOWHZ times a second. X */ X#define SPPT_NTIMERS 4 X X#define SPPT_REXMT 0 /* retransmit */ X#define SPPT_PERSIST 1 /* retransmit persistance */ X#define SPPT_KEEP 2 /* keep alive */ X#define SPPT_2MSL 3 /* 2*msl quiet time timer */ X X/* X * The SPPT_REXMT timer is used to force retransmissions. X * The SPP has the SPPT_REXMT timer set whenever segments X * have been sent for which ACKs are expected but not yet X * received. If an ACK is received which advances tp->snd_una, X * then the retransmit timer is cleared (if there are no more X * outstanding segments) or reset to the base value (if there X * are more ACKs expected). Whenever the retransmit timer goes off, X * we retransmit one unacknowledged segment, and do a backoff X * on the retransmit timer. X * X * The SPPT_PERSIST timer is used to keep window size information X * flowing even if the window goes shut. If all previous transmissions X * have been acknowledged (so that there are no retransmissions in progress), X * and the window is too small to bother sending anything, then we start X * the SPPT_PERSIST timer. When it expires, if the window is nonzero, X * we go to transmit state. Otherwise, at intervals send a single byte X * into the peer's window to force him to update our window information. X * We do this at most as often as SPPT_PERSMIN time intervals, X * but no more frequently than the current estimate of round-trip X * packet time. The SPPT_PERSIST timer is cleared whenever we receive X * a window update from the peer. X * X * The SPPT_KEEP timer is used to keep connections alive. If an X * connection is idle (no segments received) for SPPTV_KEEP amount of time, X * but not yet established, then we drop the connection. If the connection X * is established, then we force the peer to send us a segment by sending: X * <SEQ=SND.UNA-1><ACK=RCV.NXT><CTL=ACK> X * This segment is (deliberately) outside the window, and should elicit X * an ack segment in response from the peer. If, despite the SPPT_KEEP X * initiated segments we cannot elicit a response from a peer in SPPT_MAXIDLE X * amount of time, then we drop the connection. X */ X X#define SPP_TTL 30 /* default time to live for SPP segs */ X/* X * Time constants. X */ X#define SPPTV_MSL ( 15*PR_SLOWHZ) /* max seg lifetime */ X#define SPPTV_SRTTBASE 0 /* base roundtrip time; X if 0, no idea yet */ X#define SPPTV_SRTTDFLT ( 3*PR_SLOWHZ) /* assumed RTT if no info */ X X#define SPPTV_PERSMIN ( 5*PR_SLOWHZ) /* retransmit persistance */ X#define SPPTV_PERSMAX ( 60*PR_SLOWHZ) /* maximum persist interval */ X X#define SPPTV_KEEP ( 75*PR_SLOWHZ) /* keep alive - 75 secs */ X#define SPPTV_MAXIDLE ( 8*SPPTV_KEEP) /* maximum allowable idle X time before drop conn */ X X#define SPPTV_MIN ( 1*PR_SLOWHZ) /* minimum allowable value */ X#define SPPTV_REXMTMAX ( 64*PR_SLOWHZ) /* max allowable REXMT value */ X X#define SPP_LINGERTIME 120 /* linger at most 2 minutes */ X X#define SPP_MAXRXTSHIFT 12 /* maximum retransmits */ X X#ifdef SPPTIMERS Xchar *spptimers[] = X { "REXMT", "PERSIST", "KEEP", "2MSL" }; X#endif X X/* X * Force a time value to be in a certain range. X */ X#define SPPT_RANGESET(tv, value, tvmin, tvmax) { \ X (tv) = (value); \ X if ((tv) < (tvmin)) \ X (tv) = (tvmin); \ X else if ((tv) > (tvmax)) \ X (tv) = (tvmax); \ X} X X#ifdef KERNEL Xextern int spp_backoff[]; X#endif END-of-netns/spp_timer.h exit