From owner-freebsd-net Sun Mar 7 5:27:59 1999 Delivered-To: freebsd-net@freebsd.org Received: from picalon.gun.de (picalon.gun.de [194.77.0.18]) by hub.freebsd.org (Postfix) with ESMTP id 63E4114D52 for ; Sun, 7 Mar 1999 05:27:45 -0800 (PST) (envelope-from andreas@klemm.gtn.com) Received: from klemm.gtn.com (pppak04.gtn.com [194.231.123.169]) by picalon.gun.de (8.8.6/8.8.6) with ESMTP id OAA07467; Sun, 7 Mar 1999 14:27:16 +0100 (MET) Received: (from andreas@localhost) by klemm.gtn.com (8.9.2/8.9.2) id OAA05352; Sun, 7 Mar 1999 14:26:18 +0100 (CET) (envelope-from andreas) Date: Sun, 7 Mar 1999 14:26:18 +0100 From: Andreas Klemm To: julian@whistle.com Cc: freebsd-net@FreeBSD.ORG Subject: ALTQ 1.1.3, support for FreeBSD 3.1-STABLE, started the work Message-ID: <19990307142618.A4807@titan.klemm.gtn.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="lrZ03NoBR/3+SXJZ" X-Mailer: Mutt 0.95.3i X-Disclaimer: A free society is one where it is safe to be unpopular X-Operating-System: FreeBSD 3.1-STABLE SMP Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org --lrZ03NoBR/3+SXJZ Content-Type: text/plain; charset=us-ascii Hi Julian (and the others on the list), I started to port your ALTQ 1.1.3 patches for FreeBSD 3.0 to FreeBSD-3.1. Patching the sys dir went very smoothly after bumping patch's Fuzz factor up to 100. A smaller value might be ok as well, but I didn't want to waste time by playing around with different parameters. With a Fuzz of 100 only 2 rejects occurred: ./net/if_ethersubr.c.rej --- applied manually... For this a Fuzz of ~300 would have been needed ./pci/if_en_pci.c.rej --- most or all of the changes went already into the driver, when browsing through it. So I simply ignored it. Well, so far so good (I hope ;-). But the ALTQ kernel doesn't compile well and I'm lacking of experience how to handle with the remaining errors. Managing the first problem was trivial. if_spppsubr.c has a define of it's own for TIMEOUT and UNTIMEOUT, which is already defined by an altq file. Solution is a wrapper like this: --- if_spppsubr.c.orig Sun Dec 27 22:30:44 1998 +++ if_spppsubr.c Sun Mar 7 13:55:59 1999 @@ -100,9 +104,11 @@ #include #if defined(__FreeBSD__) && __FreeBSD__ >= 3 +#if !defined (ALTQ) # define UNTIMEOUT(fun, arg, handle) untimeout(fun, arg, handle) # define TIMEOUT(fun, arg1, arg2, handle) handle = timeout(fun, arg1, arg2) # define IOCTL_CMD_T u_long +#endif ...but the remaining compilation errors scare me a bit. Could you or somebody else please have a look into this ?! root{434} /sys/compile/TITANALTQ make cc -c -O -pipe -Wreturn-type -Wcomment -Wredundant-decls -Wimplicit -Wnested-ex terns -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wunini tialized -Wformat -Wunused -fformat-extensions -ansi -g -nostdinc -I- -I. -I../ .. -I../../../include -DKERNEL -DVM_STACK -include opt_global.h -elf ../../net /if_spppsubr.c ../../net/if_spppsubr.c:629: parameter `pr_hdr' has just a forward declaration ../../net/if_spppsubr.c:627: parameter `m' has just a forward declaration ../../net/if_spppsubr.c:627: parameter `ifp' has just a forward declaration ../../net/if_spppsubr.c:632: conflicting types for `sppp_output' ../../net/if_spppsubr.c:299: previous declaration of `sppp_output' ../../net/if_spppsubr.c: In function `sppp_output': ../../net/if_spppsubr.c:635: warning: `ifq' might be used uninitialized in this function ../../net/if_spppsubr.c: In function `sppp_attach': ../../net/if_spppsubr.c:856: warning: assignment from incompatible pointer type ../../net/if_spppsubr.c: At top level: ../../net/if_spppsubr.c:999: parse error before `IOCTL_CMD_T' ../../net/if_spppsubr.c: In function `sppp_ioctl': ../../net/if_spppsubr.c:1000: number of arguments doesn't match prototype ../../net/if_sppp.h:168: prototype declaration ../../net/if_spppsubr.c:1001: `data' undeclared (first use this function) ../../net/if_spppsubr.c:1001: (Each undeclared identifier is reported only once ../../net/if_spppsubr.c:1001: for each function it appears in.) ../../net/if_spppsubr.c:1002: `ifp' undeclared (first use this function) ../../net/if_spppsubr.c:1007: `cmd' undeclared (first use this function) *** Error code 1 Fine would be to get a working set of patches, to get FreeBSD 3.1 support for ALTQ 1.1.3. In the attachement is my new set of diffs... Andreas /// P.S.: I just read about yout netgraph work, so I don't know if you have time for this (so Cc'd to freebsd-net). BTW, just curious, did you or somebody else play with WFQ ? The authors say in the docu, WFQ isn't well maintained and is missing hashing ... Do you thing using ALTQ brings advantages like Cisco's implementation does ? All I want is, to get better telnet / ssh performance over a 64 KBit ISDN line if UUCP/ftp sessions saturate the link. -- Andreas Klemm http://www.FreeBSD.ORG/~andreas What gives you 90% more speed, for example, in kernel compilation ? http://www.FreeBSD.ORG/~fsmp/SMP/akgraph-a/graph1.html "NT = Not Today" (Maggie Biggs) ``powered by FreeBSD SMP'' --lrZ03NoBR/3+SXJZ Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="FreeBSD-3.1-990306.diff" --- ./conf/files.orig Sun Jan 24 06:11:31 1999 +++ ./conf/files Sun Mar 7 12:58:10 1999 @@ -387,6 +387,7 @@ net/bpf_filter.c optional bpfilter net/bridge.c optional bridge net/bsd_comp.c optional ppp_bsdcomp +net/altq_conf.c optional altq #net/hostcache.c standard net/if.c standard net/if_atmsubr.c optional atm @@ -498,6 +499,15 @@ netatm/uni/unisig_subr.c optional atm_uni atm_core netatm/uni/unisig_util.c optional atm_uni atm_core netatm/uni/unisig_vc_state.c optional atm_uni atm_core +netinet/altq_afmap.c optional altq +netinet/altq_cbq.c optional altq +netinet/altq_fifoq.c optional altq +netinet/altq_localq.c optional altq +netinet/altq_red.c optional altq +netinet/altq_rio.c optional altq +netinet/altq_rmclass.c optional altq +netinet/altq_subr.c optional altq +netinet/altq_wfq.c optional altq netinet/fil.c optional ipfilter inet netinet/if_atm.c optional atm netinet/if_ether.c optional ether --- ./conf/options.orig Mon Feb 8 20:05:55 1999 +++ ./conf/options Sun Mar 7 12:58:10 1999 @@ -182,6 +182,22 @@ MAXDSIZ opt_rlimit.h # Net stuff. +# altq stuff +ALTQ opt_global.h +ALTQ_ECN opt_global.h +CBQ opt_altq.h +WFQ opt_altq.h +AFMAP opt_altq.h +FIFOQ opt_altq.h +RED opt_altq.h +FLOWVALVE opt_altq.h +CBQ_RED opt_altq.h +RIO opt_altq.h +CBQ_RIO opt_altq.h +ALTQ_ACCOUNT opt_altq.h +ALTQ_IPSEC opt_altq.h +LOCALQ opt_altq.h + BOOTP opt_bootp.h BOOTP_COMPAT opt_bootp.h BOOTP_NFSROOT opt_bootp.h --- ./dev/en/midway.c.orig Fri Dec 4 23:54:45 1998 +++ ./dev/en/midway.c Sun Mar 7 12:58:10 1999 @@ -164,6 +164,10 @@ #include #endif +#if defined(ALTQ) && defined(AFMAP) +#include +#endif + #if !defined(sparc) && !defined(__FreeBSD__) #include #endif @@ -323,6 +327,12 @@ static int en_txspeed2pcr __P((int)); #endif +#if defined(ALTQ) && defined(AFMAP) +static int en_flowmap_add __P((struct en_softc *, struct atm_flowmap *)); +static int en_flowmap_delete __P((struct en_softc *, int, int)); +static int en_flowmap_get __P((struct en_softc *, struct atm_flowmap *)); +#endif + /* * macros/inline */ @@ -757,6 +767,9 @@ ifp->if_ioctl = en_ioctl; ifp->if_output = atm_output; ifp->if_start = en_start; +#ifdef ALTQ + ifp->if_altqflags |= ALTQF_READY; +#endif /* ALTQ */ /* * init softc @@ -854,6 +867,9 @@ #if NBPFILTER > 0 BPFATTACH(ifp, DLT_ATM_RFC1483, sizeof(struct atmllc)); #endif +#if defined(ALTQ) && defined(AFMAP) + afm_alloc(ifp); +#endif } @@ -1288,6 +1304,43 @@ #endif /* ATM_PVCEXT */ +#if defined(ALTQ) && defined(AFMAP) + case AFM_ADDFMAP: + do { + struct afm *afm = afm_top(ifp); + error = en_flowmap_add(sc, (struct atm_flowmap *)data); + if (afm == NULL && error == 0) + ifp->if_altqflags |= ALTQF_DRIVER1; + } while (0); + break; + + case AFM_DELFMAP: + do { + struct atm_flowmap *fmap = (struct atm_flowmap *)data; + error = en_flowmap_delete(sc, fmap->af_vpi, fmap->af_vci); + + if (afm_top(ifp) == NULL) + ifp->if_altqflags &= ~ALTQF_DRIVER1; + + } while (0); + break; + + case AFM_CLEANFMAP: + do { + struct afm *afm; + while ((afm = afm_top(ifp)) != NULL) + en_flowmap_delete(sc, afm->afm_vpi, afm->afm_vci); + + ifp->if_altqflags &= ~ALTQF_DRIVER1; + } while (0); + break; + + case AFM_GETFMAP: + error = en_flowmap_get(sc, (struct atm_flowmap *)data); + break; + +#endif /* ALTQ && AFMAP */ + default: error = EINVAL; break; @@ -1464,6 +1517,14 @@ m_freem(m); } +#ifdef ALTQ + do { + struct ifnet *ifp = &sc->enif; + + if (ALTQ_IS_ON(ifp)) + (void)(*ifp->if_altqdequeue)(ifp, ALTDQ_FLUSH); + } while (0); +#endif /* ALTQ */ sc->txslot[lcv].mbsize = 0; } @@ -1629,6 +1690,33 @@ while (1) { +#ifdef ALTQ + if (ALTQ_IS_ON(ifp)) { + struct mbuf *tmp; + /* + * when altq is used, don't dequeue the packet until we + * know we have enough buffer space. this makes packet + * dropping is done in altq_enqueue. + * also make the internal buffer smaller (20KB instead of 64KB) + * to keep packets remaining in altq. + */ + m = (*ifp->if_altqdequeue)(ifp, ALTDQ_PEEK); + if (m != NULL) { + ap = mtod(m, struct atm_pseudohdr *); + atm_vci = ATM_PH_VCI(ap); + txchan = sc->txvc2slot[atm_vci]; + if (sc->txslot[txchan].mbsize > 20*1024) { + EN_COUNT(sc->txmbovr); /* this isn't a right stat counter */ + return; + } + + tmp = (*ifp->if_altqdequeue)(ifp, ALTDQ_DEQUEUE); + if (tmp != m) + panic("en_start: different mbuf dequeued!"); + } + } + else +#endif IF_DEQUEUE(ifq, m); if (m == NULL) return; /* EMPTY: >>> exit here <<< */ @@ -1765,6 +1853,35 @@ txchan = sc->txvc2slot[atm_vci]; if (sc->txslot[txchan].mbsize > EN_TXHIWAT) { +#ifdef ALTQ_ACCOUNT + /* + * special process for altq drop accounting. + * re-extract flow and do drop-accounting here. + */ + struct pr_hdr pr_hdr; + int size; + + pr_hdr.ph_family = AF_INET; /* XXX */ + if (ifp->if_altqflags & ALTQF_ACCOUNTING) { + size = sizeof(struct atm_pseudohdr); + if (atm_flags & ATM_PH_LLCSNAP) + size += 8; /* sizeof snap == 8 */ + if (atm_flags & EN_OBHDR) + size += MID_TBD_SIZE; + if (m->m_len >= size + 20) + /* ip header in the first mbuf */ + pr_hdr.ph_hdr = mtod(m, caddr_t) + size; + else if (m->m_len == size && m->m_next->m_len >= 20) + /* ip header is in the second mbuf */ + pr_hdr.ph_hdr = mtod(m->m_next, caddr_t); + else + /* give up otherwise */ + pr_hdr.ph_hdr = NULL; + } + else + pr_hdr.ph_hdr = NULL; + ALTQ_ACCOUNTING(ifp, m, &pr_hdr, ALTEQ_ACCDROP); +#endif EN_COUNT(sc->txmbovr); m_freem(m); #ifdef EN_DEBUG @@ -2847,6 +2964,12 @@ sc->vtrash += MID_VTRASH(reg); #endif +#ifdef ALTQ + /* when altq is used, better try to dequeue the next packet. */ + if (ALTQ_IS_ON(&sc->enif) && kick) + en_start(&sc->enif); +#endif + EN_INTR_RET(1); /* for us */ } @@ -3708,5 +3831,98 @@ } #endif /* ATM_PVCEXT */ + +#if defined(ALTQ) && defined(AFMAP) + +static int en_flowmap_add(sc, fmap) + struct en_softc *sc; + struct atm_flowmap *fmap; +{ + struct afm *afm; + struct atm_pseudoioctl api; + int error = 0; + + afm = afm_lookup(&sc->enif, fmap->af_vpi, fmap->af_vci); + if (afm) + /* already in use */ + return (EEXIST); + + if ((error = afm_add(&sc->enif, fmap))) + return error; + + /* enable rx */ + ATM_PH_FLAGS(&api.aph) = ATM_PH_AAL5 | ATM_PH_LLCSNAP; + ATM_PH_VPI(&api.aph) = fmap->af_vpi; + ATM_PH_SETVCI(&api.aph, fmap->af_vci); + api.rxhand = NULL; +#ifdef ATM_PVCEXT + if (fmap->af_ifname[0] == 'p' && fmap->af_ifname[1] == 'v' && + fmap->af_ifname[2] == 'c') { + struct ifnet *shadow; + + if ((shadow = ifunit(fmap->af_ifname)) == NULL) + return (EINVAL); + ATM_PH_FLAGS(&api.aph) |= ATM_PH_PVCSIF; + api.rxhand = shadow; + } +#endif + error = en_rxctl(sc, &api, 1); + if (error) + return error; + error = en_txctl(sc, fmap->af_vci, 0, fmap->af_pcr); + return error; +} + +static int en_flowmap_delete(sc, vpi, vci) + struct en_softc *sc; + int vpi, vci; +{ + struct afm *afm; + struct atm_pseudoioctl api; + int error = 0; + + afm = afm_lookup(&sc->enif, vpi, vci); + if (afm == NULL) + return (ENOENT); + + afm_remove(afm); + + /* disable rx */ + ATM_PH_FLAGS(&api.aph) = 0; + ATM_PH_VPI(&api.aph) = vpi; + ATM_PH_SETVCI(&api.aph, vci); + api.rxhand = NULL; + error = en_rxctl(sc, &api, 0); + + return error; +} + +static int en_flowmap_get(sc, fmap) + struct en_softc *sc; + struct atm_flowmap *fmap; +{ + struct afm *afm; + int error = 0; + + afm = afm_lookup(&sc->enif, fmap->af_vpi, fmap->af_vci); + if (afm == NULL) + return (ENOENT); + + bcopy(&afm->afm_flowinfo, &fmap->af_flowinfo, sizeof(struct flowinfo)); + + /* get pcr value */ + if (sc->txspeed[fmap->af_vci] != 0) + fmap->af_pcr = en_txspeed2pcr(sc->txspeed[fmap->af_vci]); + else + fmap->af_pcr = 0; + + /* get stats */ + fmap->afs_packets = afm->afms_packets; + fmap->afs_bytes = afm->afms_bytes; + + return error; +} + +#endif /* ALTQ && AFMAP */ #endif /* NEN > 0 || !defined(__FreeBSD__) */ --- ./dev/vx/if_vx.c.orig Tue Jan 12 03:09:31 1999 +++ ./dev/vx/if_vx.c Sun Mar 7 12:58:10 1999 @@ -212,6 +212,9 @@ ifp->if_init = vxinit; ifp->if_watchdog = vxwatchdog; ifp->if_softc = sc; +#ifdef ALTQ + ifp->if_altqflags |= ALTQF_READY; +#endif if_attach(ifp); ether_ifattach(ifp); @@ -453,6 +456,11 @@ startagain: /* Sneak a peek at the next packet */ +#ifdef ALTQ + if (ALTQ_IS_ON(ifp)) + m0 = (*ifp->if_altqdequeue)(ifp, ALTDQ_PEEK); + else +#endif m0 = ifp->if_snd.ifq_head; if (m0 == 0) { return; @@ -472,6 +480,14 @@ if (len + pad > ETHER_MAX_LEN) { /* packet is obviously too large: toss it */ ++ifp->if_oerrors; +#ifdef ALTQ + if (ALTQ_IS_ON(ifp)) { + struct mbuf *tmp = (*ifp->if_altqdequeue)(ifp, ALTDQ_DEQUEUE); + if (tmp != m0) + panic("vxstart: different mbuf dequeued!"); + } + else +#endif IF_DEQUEUE(&ifp->if_snd, m0); m_freem(m0); goto readcheck; @@ -487,6 +503,14 @@ } } outw(BASE + VX_COMMAND, SET_TX_AVAIL_THRESH | (8188 >> 2)); +#ifdef ALTQ + if (ALTQ_IS_ON(ifp)) { + struct mbuf *tmp = (*ifp->if_altqdequeue)(ifp, ALTDQ_DEQUEUE); + if (tmp != m0) + panic("vxstart: different mbuf dequeued!"); + } + else +#endif IF_DEQUEUE(&ifp->if_snd, m0); if (m0 == 0) { /* not really needed */ return; --- ./i386/conf/ALTQ.orig Sun Mar 7 12:58:10 1999 +++ ./i386/conf/ALTQ Sun Mar 7 12:58:10 1999 @@ -0,0 +1,219 @@ +# +# GENERIC -- Generic machine with WD/AHx/NCR/BTx family disks +# +# For more information read the handbook part System Administration -> +# Configuring the FreeBSD Kernel -> The Configuration File. +# The handbook is available in /usr/share/doc/handbook or online as +# latest version from the FreeBSD World Wide Web server +# +# +# An exhaustive list of options and more detailed explanations of the +# device lines is present in the ./LINT configuration file. If you are +# in doubt as to the purpose or necessity of a line, check first in LINT. +# +# $Id: GENERIC,v 1.125 1998/10/16 01:30:11 obrien Exp $ + +machine "i386" +cpu "I386_CPU" +cpu "I486_CPU" +cpu "I586_CPU" +cpu "I686_CPU" +ident GENERIC +maxusers 32 + +options MATH_EMULATE #Support for x87 emulation +options INET #InterNETworking +options FFS #Berkeley Fast Filesystem +options FFS_ROOT #FFS usable as root device [keep this!] +options MFS #Memory Filesystem +options MFS_ROOT #MFS usable as root device, "MFS" req'ed +options NFS #Network Filesystem +options NFS_ROOT #NFS usable as root device, "NFS" req'ed +options MSDOSFS #MSDOS Filesystem +options "CD9660" #ISO 9660 Filesystem +options "CD9660_ROOT" #CD-ROM usable as root. "CD9660" req'ed +options PROCFS #Process filesystem +options "COMPAT_43" #Compatible with BSD 4.3 [KEEP THIS!] +options SCSI_DELAY=15000 #Be pessimistic about Joe SCSI device +options UCONSOLE #Allow users to grab the console +options FAILSAFE #Be conservative +options USERCONFIG #boot -c editor +options VISUAL_USERCONFIG #visual boot -c editor + +options NMBCLUSTERS=2048 +options MROUTING # Multicast routing +options NATM #native mode atm + +options ALTQ #alternate queueing +options CBQ #class based queueing +options WFQ #weighted fair queueing +options FIFOQ #fifo queueing +options RED #random early detection +options FLOWVALVE #flowvalve for RED (needs RED) +options CBQ_RED #red for cbq (needs CBQ and RED) +options RIO #twin red for diffserv (needs RED) +options CBQ_RIO #rio for cbq (needs CBQ, RIO, RED, CBQ_RED) +options LOCALQ #local use +options ALTQ_ACCOUNT #altq accounting +options ALTQ_ECN #ecn extention to tcp + +config kernel root on wd0 + +controller isa0 +controller eisa0 +controller pci0 + +controller fdc0 at isa? port "IO_FD1" bio irq 6 drq 2 vector fdintr +disk fd0 at fdc0 drive 0 +disk fd1 at fdc0 drive 1 +# Unless you know very well what you're doing, leave ft0 at drive 2, or +# remove the line entirely if you don't need it. Trying to configure +# it on another unit might cause surprises, see PR kern/7176. +tape ft0 at fdc0 drive 2 + +options "CMD640" # work around CMD640 chip deficiency +controller wdc0 at isa? port "IO_WD1" bio irq 14 vector wdintr +disk wd0 at wdc0 drive 0 +disk wd1 at wdc0 drive 1 + +controller wdc1 at isa? port "IO_WD2" bio irq 15 vector wdintr +disk wd2 at wdc1 drive 0 +disk wd3 at wdc1 drive 1 + +options ATAPI #Enable ATAPI support for IDE bus +options ATAPI_STATIC #Don't do it as an LKM +device wcd0 #IDE CD-ROM +device wfd0 #IDE Floppy (e.g. LS-120) + +# A single entry for any of these controllers (ncr, ahb, ahc, amd) is +# sufficient for any number of installed devices. +controller ncr0 +#controller amd0 +controller ahb0 +controller ahc0 +controller isp0 + +# This controller offers a number of configuration options, too many to +# document here - see the LINT file in this directory and look up the +# dpt0 entry there for much fuller documentation on this. +controller dpt0 + +controller adv0 at isa? port ? cam irq ? +controller adw0 +controller bt0 at isa? port ? cam irq ? +controller aha0 at isa? port ? cam irq ? +#controller uha0 at isa? port "IO_UHA0" bio irq ? drq 5 vector uhaintr +#controller aic0 at isa? port 0x340 bio irq 11 vector aicintr +#controller nca0 at isa? port 0x1f88 bio irq 10 vector ncaintr +#controller nca1 at isa? port 0x350 bio irq 5 vector ncaintr +#controller sea0 at isa? bio irq 5 iomem 0xc8000 iosiz 0x2000 vector seaintr + +controller scbus0 + +device da0 + +device sa0 + +device pass0 + +device cd0 #Only need one of these, the code dynamically grows + +device wt0 at isa? port 0x300 bio irq 5 drq 1 vector wtintr +device mcd0 at isa? port 0x300 bio irq 10 vector mcdintr + +controller matcd0 at isa? port 0x230 bio + +device scd0 at isa? port 0x230 bio + +# syscons is the default console driver, resembling an SCO console +device sc0 at isa? port "IO_KBD" conflicts tty irq 1 vector scintr +# Enable this and PCVT_FREEBSD for pcvt vt220 compatible console driver +#device vt0 at isa? port "IO_KBD" conflicts tty irq 1 vector pcrint +#options XSERVER # support for X server +#options FAT_CURSOR # start with block cursor +# If you have a ThinkPAD, uncomment this along with the rest of the PCVT lines +#options PCVT_SCANSET=2 # IBM keyboards are non-std + +device npx0 at isa? port "IO_NPX" irq 13 vector npxintr + +# +# Laptop support (see LINT for more options) +# +device apm0 at isa? disable flags 0x31 # Advanced Power Management + +# PCCARD (PCMCIA) support +#controller card0 +#device pcic0 at card? +#device pcic1 at card? + +device sio0 at isa? port "IO_COM1" flags 0x10 tty irq 4 vector siointr +device sio1 at isa? port "IO_COM2" tty irq 3 vector siointr +device sio2 at isa? disable port "IO_COM3" tty irq 5 vector siointr +device sio3 at isa? disable port "IO_COM4" tty irq 9 vector siointr + +device lpt0 at isa? port? tty irq 7 vector lptintr + +device psm0 at isa? port "IO_KBD" conflicts tty irq 12 vector psmintr + +# Order is important here due to intrusive probes, do *not* alphabetize +# this list of network interfaces until the probes have been fixed. +# Right now it appears that the ie0 must be probed before ep0. See +# revision 1.20 of this file. +device de0 +device fxp0 +device tl0 +device tx0 +device vx0 +device xl0 + +# ATM (en*) support +device en0 +device en1 + +device ed0 at isa? port 0x280 net irq 10 iomem 0xd8000 vector edintr +device ie0 at isa? port 0x300 net irq 10 iomem 0xd0000 vector ieintr +device ep0 at isa? port 0x300 net irq 10 vector epintr +device ex0 at isa? port? net irq? vector exintr +device fe0 at isa? port 0x300 net irq ? vector feintr +device le0 at isa? port 0x300 net irq 5 iomem 0xd0000 vector le_intr +device lnc0 at isa? port 0x280 net irq 10 drq 0 vector lncintr +device ze0 at isa? port 0x300 net irq 10 iomem 0xd8000 vector zeintr +device zp0 at isa? port 0x300 net irq 10 iomem 0xd8000 vector zpintr +device cs0 at isa? port 0x300 net irq ? vector csintr + +pseudo-device loop +pseudo-device ether +pseudo-device atm +pseudo-device sl 1 +pseudo-device ppp 1 +pseudo-device tun 1 +pseudo-device pty 16 +pseudo-device gzip # Exec gzipped a.out's + +# +# Enable the kernel debugger. +# +options DDB + +# +# Don't drop into DDB for a panic. Intended for unattended operation +# where you may want to drop to DDB from the console, but still want +# the machine to recover from a panic +# +#options DDB_UNATTENDED + +# KTRACE enables the system-call tracing facility ktrace(2). +# This adds 4 KB bloat to your kernel, and slightly increases +# the costs of each syscall. +options KTRACE #kernel tracing + +# This provides support for System V shared memory. +# +options SYSVSHM + +# The `bpfilter' pseudo-device enables the Berkeley Packet Filter. Be +# aware of the legal and administrative consequences of enabling this +# option. The number of devices determines the maximum number of +# simultaneous BPF clients programs runnable. +pseudo-device bpfilter 4 #Berkeley packet filter + --- ./i386/conf/LINT.orig Sun Feb 21 22:12:26 1999 +++ ./i386/conf/LINT Sun Mar 7 12:58:10 1999 @@ -1929,6 +1929,22 @@ options SPX_HACK options VFS_BIO_DEBUG +# ALTQ options +options ALTQ #alternate queueing +options CBQ #class based queueing +options WFQ #weighted fair queueing +options AFMAP #atm flow mapping +options FIFOQ #fifo queueing +options RED #random early detection +options CBQ_RED #red for cbq (needs CBQ and RED) +options RIO #twin red for diffserv (needs RED) +options CBQ_RIO #rio for cbq (needs CBQ, RIO, RED, CBQ_RED) +options LOCALQ #local use +options ALTQ_ACCOUNT #altq accounting +options ALTQ_ECN #ecn extention to tcp (needs RED) +options ALTQ_IPSEC #check ipsec in IPv4 +options ALTQ_PPP #sio modification for userland ppp + # The 'dpt' driver provides support for DPT controllers (http://www.dpt.com/). # These have hardware RAID-{0,1,5} support, and do multi-initiator I/O. # The DPT controllers are commonly re-licensed under other brand-names - --- ./i386/isa/if_ar.c.orig Wed Dec 16 19:42:38 1998 +++ ./i386/isa/if_ar.c Sun Mar 7 12:58:10 1999 @@ -346,6 +346,9 @@ ifp->if_ioctl = arioctl; ifp->if_start = arstart; ifp->if_watchdog = arwatchdog; +#ifdef ALTQ + ifp->if_altqflags |= ALTQF_READY; +#endif sc->ifsppp.pp_flags = PP_KEEPALIVE; --- ./i386/isa/if_cx.c.orig Wed Dec 16 19:42:38 1998 +++ ./i386/isa/if_cx.c Sun Mar 7 12:58:10 1999 @@ -281,6 +281,9 @@ c->ifp->if_ioctl = cxsioctl; c->ifp->if_start = (start_func_t) cxstart; c->ifp->if_watchdog = (watchdog_func_t) cxwatchdog; +#ifdef ALTQ + c->ifp->if_altqflags |= ALTQF_READY; +#endif /* Init routine is never called by upper level? */ sppp_attach (c->ifp); if_attach (c->ifp); --- ./i386/isa/if_ed.c.orig Tue Jan 19 01:21:38 1999 +++ ./i386/isa/if_ed.c Sun Mar 7 12:58:10 1999 @@ -1684,6 +1684,9 @@ ifp->if_flags = (IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST); +#ifdef ALTQ + ifp->if_altqflags |= ALTQF_READY; +#endif /* * Attach the interface */ @@ -2071,6 +2074,12 @@ ifp->if_flags |= IFF_OACTIVE; return; } +#ifdef ALTQ + if (ALTQ_IS_ON(ifp)) { + m = (*ifp->if_altqdequeue)(ifp, ALTDQ_DEQUEUE); + } + else +#endif IF_DEQUEUE(&ifp->if_snd, m); if (m == 0) { --- ./i386/isa/if_ep.c.orig Tue Jan 19 01:21:39 1999 +++ ./i386/isa/if_ep.c Sun Mar 7 12:58:10 1999 @@ -615,6 +615,9 @@ ifp->if_start = epstart; ifp->if_ioctl = epioctl; ifp->if_watchdog = epwatchdog; +#ifdef ALTQ + ifp->if_altqflags |= ALTQF_READY; +#endif if (!attached) { if_attach(ifp); @@ -810,6 +813,11 @@ } startagain: /* Sneak a peek at the next packet */ +#ifdef ALTQ + if (ALTQ_IS_ON(ifp)) + m = (*ifp->if_altqdequeue)(ifp, ALTDQ_PEEK); + else +#endif m = ifp->if_snd.ifq_head; if (m == 0) { splx(s); @@ -828,6 +836,14 @@ if (len + pad > ETHER_MAX_LEN) { /* packet is obviously too large: toss it */ ++ifp->if_oerrors; +#ifdef ALTQ + if (ALTQ_IS_ON(ifp)) { + m = (*ifp->if_altqdequeue)(ifp, ALTDQ_DEQUEUE); + if (m != top) + panic("epstart: different mbuf dequeued!"); + } + else +#endif IF_DEQUEUE(&ifp->if_snd, m); m_freem(m); goto readcheck; @@ -842,6 +858,14 @@ return; } } +#ifdef ALTQ + if (ALTQ_IS_ON(ifp)) { + m = (*ifp->if_altqdequeue)(ifp, ALTDQ_DEQUEUE); + if (m != top) + panic("epstart: different mbuf dequeued!"); + } + else +#endif IF_DEQUEUE(&ifp->if_snd, m); outw(BASE + EP_W1_TX_PIO_WR_1, len); --- ./i386/isa/if_lnc.c.orig Sun Jan 31 01:57:46 1999 +++ ./i386/isa/if_lnc.c Sun Mar 7 12:58:10 1999 @@ -1240,6 +1240,9 @@ sc->arpcom.ac_if.if_type = IFT_ETHER; sc->arpcom.ac_if.if_addrlen = ETHER_ADDR_LEN; sc->arpcom.ac_if.if_hdrlen = ETHER_HDR_LEN; +#ifdef ALTQ + sc->arpcom.ac_if.if_altqflags |= ALTQF_READY; +#endif /* * XXX -- should check return status of if_attach @@ -1646,6 +1649,11 @@ do { +#ifdef ALTQ + if (ALTQ_IS_ON(ifp)) + head = (*ifp->if_altqdequeue)(ifp, ALTDQ_DEQUEUE); + else +#endif IF_DEQUEUE(&sc->arpcom.ac_if.if_snd, head); if (!head) return; --- ./i386/isa/if_sr.c.orig Mon Jan 18 22:27:03 1999 +++ ./i386/isa/if_sr.c Sun Mar 7 12:58:10 1999 @@ -825,6 +825,9 @@ ifp->if_ioctl = srioctl; ifp->if_start = srstart; ifp->if_watchdog = srwatchdog; +#ifdef ALTQ + ifp->if_altqflags |= ALTQF_READY; +#endif printf("sr%d: Adapter %d, port %d.\n", sc->unit, hc->cunit, sc->subunit); @@ -1173,7 +1176,13 @@ * hardcoded. A packet can't be larger than 3 buffers (3 x * 512). */ +#if 0 /* defined(ALTQ) */ + /* XXX use 6KB buffer instead of 16KB to reduce latency */ + /* quick dirty hack, but very effective! */ + if ((i + 3) >= (blkp->txmax * 6 / 16)) { /* enough remains? */ +#else if ((i + 3) >= blkp->txmax) { /* enough remains? */ +#endif #if BUGGY > 9 printf("sr%d.srstart: i=%d (%d pkts); card full.\n", sc->unit, i, pkts); --- ./net/if.h.orig Sat Mar 21 14:36:20 1998 +++ ./net/if.h Sun Mar 7 12:58:11 1999 @@ -44,6 +44,9 @@ #ifndef KERNEL #include #endif +#if 1 /* ALTQ */ +#include +#endif /* * Structure describing information about an interface --- ./net/if_atmsubr.c.orig Fri Dec 4 23:54:52 1998 +++ ./net/if_atmsubr.c Sun Mar 7 12:58:11 1999 @@ -35,6 +35,9 @@ /* * if_atmsubr.c */ +#ifdef ALTQ +#include "opt_altq.h" +#endif #include "opt_inet.h" #include "opt_natm.h" @@ -64,6 +67,10 @@ #include #endif +#if defined(ALTQ) && defined(AFMAP) +#include +#endif + #ifndef ETHERTYPE_IPV6 #define ETHERTYPE_IPV6 0x86dd #endif @@ -100,10 +107,25 @@ struct atmllc *atmllc; struct atmllc *llc_hdr = NULL; u_int32_t atm_flags; +#ifdef ALTQ + struct pr_hdr pr_hdr; +#endif if ((ifp->if_flags & (IFF_UP|IFF_RUNNING)) != (IFF_UP|IFF_RUNNING)) senderr(ENETDOWN); +#ifdef ALTQ + /* + * save a pointer to the protocol level header before adding + * link headers. + */ + if (dst) + pr_hdr.ph_family = dst->sa_family; + else + pr_hdr.ph_family = AF_UNSPEC; + pr_hdr.ph_hdr = mtod(m, caddr_t); +#endif /* ALTQ */ + /* * check route */ @@ -161,6 +183,17 @@ */ bcopy(dst->sa_data, &atmdst, sizeof(atmdst)); llc_hdr = (struct atmllc *)(dst->sa_data + sizeof(atmdst)); +#ifdef ALTQ + /* modify pr_hdr to have a correct family */ + switch (ATM_LLC_TYPE(llc_hdr)) { + case ETHERTYPE_IP: + pr_hdr.ph_family = AF_INET; + break; + case ETHERTYPE_IPV6: + pr_hdr.ph_family = AF_INET6; + break; + } +#endif break; default: @@ -174,6 +207,29 @@ senderr(EAFNOSUPPORT); } +#if defined(ALTQ) && defined(AFMAP) + if (ifp->if_altqflags & ALTQF_DRIVER1) { + /* try to map flow to vpi/vci. */ + struct flowinfo flow; + struct afm *afm; + + altq_extractflow(m, &pr_hdr, &flow, FIMB_ALL); + if ((afm = afm_match(ifp, &flow)) != NULL) { + /* matching entry found. overwrite vpi:vci. */ +#if 0 + printf("%s%d: atm_output:afmap vci %d -> %d\n", + ifp->if_name, ifp->if_unit, + ATM_PH_VCI(&atmdst), afm->afm_vci); +#endif + ATM_PH_VPI(&atmdst) = afm->afm_vpi; + ATM_PH_SETVCI(&atmdst, afm->afm_vci); + + afm->afms_packets++; + afm->afms_bytes = m->m_pkthdr.len; + } + } +#endif /* ALTQ && AFMAP */ + /* * must add atm_pseudohdr to data */ @@ -202,14 +258,37 @@ * Queue message on interface, and start output if interface * not yet active. */ +#ifdef ALTQ + if (ALTQ_IS_ON(ifp)) { + s = splimp(); + error = (*ifp->if_altqenqueue)(ifp, m, &pr_hdr, ALTEQ_NORMAL); + splx(s); + if (error) { + IF_DROP(&ifp->if_snd); + } + else { + ifp->if_obytes += m->m_pkthdr.len; + if (m->m_flags & M_MCAST) + ifp->if_omcasts++; + } + return (error); + } +#endif /* ALTQ */ + s = splimp(); if (IF_QFULL(&ifp->if_snd)) { IF_DROP(&ifp->if_snd); +#ifdef ALTQ_ACCOUNT + ALTQ_ACCOUNTING(ifp, m, &pr_hdr, ALTEQ_ACCDROP); +#endif splx(s); senderr(ENOBUFS); } ifp->if_obytes += m->m_pkthdr.len; IF_ENQUEUE(&ifp->if_snd, m); +#ifdef ALTQ_ACCOUNT + ALTQ_ACCOUNTING(ifp, m, &pr_hdr, ALTEQ_ACCOK); +#endif if ((ifp->if_flags & IFF_OACTIVE) == 0) (*ifp->if_start)(ifp); splx(s); --- ./net/if_ethersubr.c.orig Tue Jan 12 13:07:00 1999 +++ ./net/if_ethersubr.c Sun Mar 7 13:17:40 1999 @@ -33,6 +33,9 @@ * @(#)if_ethersubr.c 8.1 (Berkeley) 6/10/93 * $Id: if_ethersubr.c,v 1.54 1999/01/12 12:07:00 eivind Exp $ */ +#ifdef ALTQ +#include "opt_altq.h" +#endif #include "opt_atalk.h" #include "opt_inet.h" @@ -139,6 +142,9 @@ int off, len = m->m_pkthdr.len, loop_copy = 0; int hlen; /* link layer header lenght */ struct arpcom *ac = (struct arpcom *)ifp; +#ifdef ALTQ + struct pr_hdr pr_hdr; +#endif if ((ifp->if_flags & (IFF_UP|IFF_RUNNING)) != (IFF_UP|IFF_RUNNING)) senderr(ENETDOWN); @@ -167,6 +173,15 @@ time_second < rt->rt_rmx.rmx_expire) senderr(rt == rt0 ? EHOSTDOWN : EHOSTUNREACH); } +#ifdef ALTQ + /* + * save a pointer to the protocol level header before adding + * link headers. + */ + pr_hdr.ph_family = dst->sa_family; + pr_hdr.ph_hdr = mtod(m, caddr_t); +#endif /* ALTQ */ + hlen = ETHER_HDR_LEN; switch (dst->sa_family) { #ifdef INET @@ -397,10 +412,16 @@ */ if (IF_QFULL(&ifp->if_snd)) { IF_DROP(&ifp->if_snd); +#ifdef ALTQ_ACCOUNT + ALTQ_ACCOUNTING(ifp, m, &pr_hdr, ALTEQ_ACCDROP); +#endif splx(s); senderr(ENOBUFS); } IF_ENQUEUE(&ifp->if_snd, m); +#ifdef ALTQ_ACCOUNT + ALTQ_ACCOUNTING(ifp, m, &pr_hdr, ALTEQ_ACCOK); +#endif if ((ifp->if_flags & IFF_OACTIVE) == 0) (*ifp->if_start)(ifp); splx(s); @@ -643,6 +664,22 @@ #endif /* ISO || LLC || NETATALK */ } +#ifdef ALTQ + if (ALTQ_IS_ON(ifp)) { + s = splimp(); + error = (*ifp->if_altqenqueue)(ifp, m, &pr_hdr, ALTEQ_NORMAL); + splx(s); + if (error) { + IF_DROP(&ifp->if_snd); + } + else { + ifp->if_obytes += len + sizeof (struct ether_header); + if (m->m_flags & M_MCAST) + ifp->if_omcasts++; + } + return (error); + } +#endif /* ALTQ */ s = splimp(); if (IF_QFULL(inq)) { IF_DROP(inq); --- ./net/if_loop.c.orig Sun Jul 12 18:46:52 1998 +++ ./net/if_loop.c Sun Mar 7 12:58:11 1999 @@ -91,6 +91,9 @@ static void lortrequest __P((int, struct rtentry *, struct sockaddr *)); static void loopattach __P((void *)); +#ifdef ALTQ +static void lo_altqstart __P((struct ifnet *)); +#endif PSEUDO_SET(loopattach, if_loop); static int looutput __P((struct ifnet *ifp, @@ -120,6 +123,10 @@ ifp->if_ioctl = loioctl; ifp->if_output = looutput; ifp->if_type = IFT_LOOP; +#ifdef ALTQ + ifp->if_start = lo_altqstart; + ifp->if_altqflags |= ALTQF_READY; +#endif if_attach(ifp); #if NBPFILTER > 0 bpfattach(ifp, DLT_NULL, sizeof(u_int)); @@ -230,6 +237,36 @@ m_adj(m, hlen); } +#ifdef ALTQ + /* + * altq for loop is just for debugging. + * only used when called for loop interface (not for + * a simplex interface). + */ + if (ALTQ_IS_ON(ifp) && ifp->if_start == lo_altqstart) { + struct pr_hdr pr_hdr; + int32_t *afp; + int error; + + pr_hdr.ph_family = dst->sa_family; + pr_hdr.ph_hdr = mtod(m, caddr_t); + + M_PREPEND(m, sizeof(int32_t), M_DONTWAIT); + if (m == 0) + return(ENOBUFS); + afp = mtod(m, int32_t *); + *afp = (int32_t)dst->sa_family; + + s = splimp(); + error = (*ifp->if_altqenqueue)(ifp, m, &pr_hdr, ALTEQ_NORMAL); + splx(s); + if (error) { + IF_DROP(&ifp->if_snd); + } + return (error); + } +#endif /* ALTQ */ + switch (dst->sa_family) { #ifdef INET case AF_INET: @@ -280,6 +317,84 @@ splx(s); return (0); } + +#ifdef ALTQ +static void +lo_altqstart(ifp) + struct ifnet *ifp; +{ + struct ifqueue *ifq; + struct mbuf *m; + int32_t af, *afp; + int s, isr; + + if (!ALTQ_IS_ON(ifp)) + return; + + while (1) { + s = splimp(); + m = (*ifp->if_altqdequeue)(ifp, ALTDQ_DEQUEUE); + splx(s); + + if (m == NULL) + return; + + afp = mtod(m, int32_t *); + af = *afp; + m_adj(m, sizeof(int32_t)); + + switch (af) { +#ifdef INET + case AF_INET: + ifq = &ipintrq; + isr = NETISR_IP; + break; +#endif +#ifdef IPX + case AF_IPX: + ifq = &ipxintrq; + isr = NETISR_IPX; + break; +#endif +#ifdef NS + case AF_NS: + ifq = &nsintrq; + isr = NETISR_NS; + break; +#endif +#ifdef ISO + case AF_ISO: + ifq = &clnlintrq; + isr = NETISR_ISO; + break; +#endif +#ifdef NETATALK + case AF_APPLETALK: + ifq = &atintrq2; + isr = NETISR_ATALK; + break; +#endif NETATALK + default: + printf("lo_altqstart: can't handle af%d\n", af); + m_freem(m); + return; + } + + s = splimp(); + if (IF_QFULL(ifq)) { + IF_DROP(ifq); + m_freem(m); + splx(s); + return; + } + IF_ENQUEUE(ifq, m); + schednetisr(isr); + ifp->if_ipackets++; + ifp->if_ibytes += m->m_pkthdr.len; + splx(s); + } +} +#endif /* ALTQ */ /* ARGSUSED */ static void --- ./net/if_sl.c.orig Wed Jul 15 04:32:23 1998 +++ ./net/if_sl.c Sun Mar 7 12:58:11 1999 @@ -68,6 +68,10 @@ #include "sl.h" #if NSL > 0 +#ifdef ALTQ +#include "opt_altq.h" +#endif + #include "bpfilter.h" #include "opt_inet.h" @@ -225,6 +229,7 @@ sc->sc_fastq.ifq_maxlen = 32; sc->sc_if.if_linkmib = sc; sc->sc_if.if_linkmiblen = sizeof *sc; + sc->sc_if.if_altqflags |= ALTQF_READY; if_attach(&sc->sc_if); #if NBPFILTER > 0 bpfattach(&sc->sc_if, DLT_SLIP, SLIP_HDRLEN); @@ -473,6 +478,12 @@ register struct ip *ip; register struct ifqueue *ifq; int s; +#ifdef ALTQ + struct pr_hdr pr_hdr; + + pr_hdr.ph_family = dst->sa_family; + pr_hdr.ph_hdr = mtod(m, caddr_t); +#endif /* * `Cannot happen' (see slioctl). Someday we will extend @@ -503,14 +514,37 @@ if (ip->ip_tos & IPTOS_LOWDELAY) ifq = &sc->sc_fastq; s = splimp(); +#ifdef ALTQ + if (ALTQ_IS_ON(ifp)) { + int error; + + error = (*ifp->if_altqenqueue)(ifp, m, &pr_hdr, ALTEQ_NORMAL); + if (error) { + splx(s); + IF_DROP(&sc->sc_if.if_snd); + sc->sc_if.if_oerrors++; + return (error); + } + } + else { +#endif /* ALTQ */ if (IF_QFULL(ifq)) { IF_DROP(ifq); +#ifdef ALTQ_ACCOUNT + ALTQ_ACCOUNTING(ifp, m, &pr_hdr, ALTEQ_ACCDROP); +#endif m_freem(m); splx(s); sc->sc_if.if_oerrors++; return (ENOBUFS); } IF_ENQUEUE(ifq, m); +#ifdef ALTQ_ACCOUNT + ALTQ_ACCOUNTING(ifp, m, &pr_hdr, ALTEQ_ACCOK); +#endif +#ifdef ALTQ + } +#endif if (sc->sc_ttyp->t_outq.c_cc == 0) slstart(sc->sc_ttyp); splx(s); @@ -562,11 +596,20 @@ * Get a packet and send it to the interface. */ s = splimp(); +#ifdef ALTQ + if (ALTQ_IS_ON(&sc->sc_if)) + m = (*sc->sc_if.if_altqdequeue)(&sc->sc_if, + ALTDQ_DEQUEUE); + else { +#endif IF_DEQUEUE(&sc->sc_fastq, m); if (m) sc->sc_if.if_omcasts++; /* XXX */ else IF_DEQUEUE(&sc->sc_if.if_snd, m); +#ifdef ALTQ + } +#endif splx(s); if (m == NULL) return 0; --- ./net/if_spppsubr.c.orig Sun Dec 27 22:30:44 1998 +++ ./net/if_spppsubr.c Sun Mar 7 12:58:11 1999 @@ -20,6 +20,10 @@ * $Id: if_spppsubr.c,v 1.52 1998/12/27 21:30:44 phk Exp $ */ +#ifdef ALTQ +#include "opt_altq.h" +#endif + #include #if defined(__FreeBSD__) && __FreeBSD__ >= 3 @@ -619,6 +623,9 @@ */ static int sppp_output(struct ifnet *ifp, struct mbuf *m, +#ifdef ALTQ + struct pr_hdr pr_hdr; +#endif struct sockaddr *dst, struct rtentry *rt) { struct sppp *sp = (struct sppp*) ifp; @@ -647,6 +654,18 @@ s = splimp(); } +#ifdef ALTQ + /* + * save a pointer to the protocol level header before adding + * link headers. + */ + pr_hdr.ph_family = dst->sa_family; + pr_hdr.ph_hdr = mtod(m, caddr_t); +#endif /* ALTQ */ + +#ifdef ALTQ + if (!ALTQ_IS_ON(ifp)) { +#endif ifq = &ifp->if_snd; #ifdef INET if (dst->sa_family == AF_INET) { @@ -693,6 +712,9 @@ ifq = &sp->pp_fastq; } #endif +#ifdef ALTQ + } +#endif /* * Prepend general data packet PPP header. For now, IP only. @@ -767,18 +789,39 @@ return (EAFNOSUPPORT); } +#ifdef ALTQ + if (ALTQ_IS_ON(ifp)) { + int error, len; + len = m->m_pkthdr.len; + error = (*ifp->if_altqenqueue)(ifp, m, &pr_hdr, ALTEQ_NORMAL); + if (error) { + IF_DROP (&ifp->if_snd); + } + else + ifp->if_obytes += len + 3; + splx(s); + return (error); + } +#endif /* ALTQ */ + /* * Queue message on interface, and start output if interface * not yet active. */ if (IF_QFULL (ifq)) { IF_DROP (&ifp->if_snd); +#ifdef ALTQ_ACCOUNT + ALTQ_ACCOUNTING(ifp, m, &pr_hdr, ALTEQ_ACCDROP); +#endif m_freem (m); ++ifp->if_oerrors; splx (s); return (rv? rv: ENOBUFS); } IF_ENQUEUE (ifq, m); +#ifdef ALTQ_ACCOUNT + ALTQ_ACCOUNTING(ifp, m, &pr_hdr, ALTEQ_ACCOK); +#endif if (! (ifp->if_flags & IFF_OACTIVE)) (*ifp->if_start) (ifp); @@ -858,6 +901,12 @@ { struct sppp *sp = (struct sppp*) ifp; +#ifdef ALTQ + if (ALTQ_IS_ON(ifp)) { + (void)(*ifp->if_altqdequeue)(ifp, ALTDQ_FLUSH); + return; + } +#endif sppp_qflush (&sp->pp_if.if_snd); sppp_qflush (&sp->pp_fastq); sppp_qflush (&sp->pp_cpq); @@ -873,6 +922,11 @@ int empty, s; s = splimp(); +#ifdef ALTQ + if (ALTQ_IS_ON(ifp)) + empty = ((*ifp->if_altqdequeue)(ifp, ALTDQ_PEEK) == NULL); + else +#endif empty = !sp->pp_fastq.ifq_head && !sp->pp_cpq.ifq_head && !sp->pp_if.if_snd.ifq_head; splx(s); @@ -890,6 +944,13 @@ int s; s = splimp(); +#ifdef ALTQ + if (ALTQ_IS_ON(ifp)) { + m = (*ifp->if_altqdequeue)(ifp, ALTDQ_DEQUEUE); + splx(s); + return (m); + } +#endif /* ALTQ */ /* * Process only the control protocol queue until we have at * least one NCP open. @@ -1071,6 +1132,11 @@ if (ifp->if_flags & IFF_UP) { if_down (ifp); sppp_qflush (&sp->pp_cpq); +#ifdef ALTQ + if (ALTQ_IS_ON(ifp)) + (void)(*ifp->if_altqdequeue) + (ifp, ALTDQ_FLUSH); +#endif } } ++sp->pp_loopcnt; @@ -1206,6 +1272,22 @@ sppp_print_bytes ((u_char*) (lh+1), len); addlog(">\n"); } +#ifdef ALTQ + if (ALTQ_IS_ON(ifp)) { + struct pr_hdr pr_hdr; + int error, len; + + len = m->m_pkthdr.len; + altq_mkctlhdr(&pr_hdr); /* fake a control type header */ + error = (*ifp->if_altqenqueue)(ifp, m, &pr_hdr, ALTEQ_NORMAL); + if (error) { + IF_DROP (&ifp->if_snd); + } + else + ifp->if_obytes += len + 3; + return; + } +#endif /* ALTQ */ if (IF_QFULL (&sp->pp_cpq)) { IF_DROP (&sp->pp_fastq); IF_DROP (&ifp->if_snd); @@ -1514,6 +1596,10 @@ if_down (ifp); sppp_qflush (&sp->pp_cpq); +#ifdef ALTQ + if (ALTQ_IS_ON(ifp)) + (void)(*ifp->if_altqdequeue) (ifp, ALTDQ_FLUSH); +#endif /* Shut down the PPP link. */ /* XXX */ lcp.Down(sp); @@ -2027,6 +2113,11 @@ if_down(ifp); sppp_qflush(&sp->pp_cpq); /* XXX ? */ +#ifdef ALTQ + if (ALTQ_IS_ON(ifp)) + (void)(*ifp->if_altqdequeue) + (ifp, ALTDQ_FLUSH); +#endif lcp.Down(sp); lcp.Up(sp); } @@ -3764,6 +3855,22 @@ sppp_print_bytes((u_char*) (lh+1), len); addlog(">\n"); } +#ifdef ALTQ + if (ALTQ_IS_ON(ifp)) { + struct pr_hdr pr_hdr; + int error, len; + + len = m->m_pkthdr.len; + altq_mkctlhdr(&pr_hdr); /* fake a control type header */ + error = (*ifp->if_altqenqueue)(ifp, m, &pr_hdr, ALTEQ_NORMAL); + if (error) { + IF_DROP (&ifp->if_snd); + } + else + ifp->if_obytes += len + 3; + return; + } +#endif /* ALTQ */ if (IF_QFULL (&sp->pp_cpq)) { IF_DROP (&sp->pp_fastq); IF_DROP (&ifp->if_snd); @@ -3822,6 +3929,10 @@ printf (SPP_FMT "down\n", SPP_ARGS(ifp)); if_down (ifp); sppp_qflush (&sp->pp_cpq); +#ifdef ALTQ + if (ALTQ_IS_ON(ifp)) + (void)(*ifp->if_altqdequeue)(ifp, ALTDQ_FLUSH); +#endif if (! (sp->pp_flags & PP_CISCO)) { /* XXX */ /* Shut down the PPP link. */ --- ./net/if_var.h.orig Wed Dec 16 19:30:43 1998 +++ ./net/if_var.h Sun Mar 7 12:58:11 1999 @@ -138,6 +138,16 @@ __P((struct ifnet *, struct sockaddr **, struct sockaddr *)); struct ifqueue if_snd; /* output queue */ struct ifqueue *if_poll_slowq; /* input queue for slow devices */ +#if 1 /* ALTQ */ + /* alternate queueing related stuff */ + int if_altqtype; /* queueing scheme id */ + int if_altqflags; /* altq flags (e.g. ready, in-use) */ + void *if_altqp; /* queue state */ + int (*if_altqenqueue) + __P((struct ifnet *, struct mbuf *, struct pr_hdr *, int)); + struct mbuf *(*if_altqdequeue) + __P((struct ifnet *, int)); +#endif /* ALTQ */ }; typedef void if_init_f_t __P((void *)); --- ./netinet/in.h.orig Mon Dec 14 19:09:13 1998 +++ ./netinet/in.h Sun Mar 7 12:58:11 1999 @@ -424,6 +424,9 @@ { "fastforwarding", CTLTYPE_INT }, \ } +#if 1 /* ALTQ */ +#include +#endif #ifdef KERNEL struct ifnet; struct mbuf; /* forward declarations for Standard C */ --- ./netinet/ip.h.orig Sun Jun 7 14:00:13 1998 +++ ./netinet/ip.h Sun Mar 7 12:58:11 1999 @@ -89,6 +89,11 @@ #define IPTOS_THROUGHPUT 0x08 #define IPTOS_RELIABILITY 0x04 #define IPTOS_MINCOST 0x02 +#if 1 /* ALTQ_ECN */ +/* ECN bits proposed by Sally Floyd */ +#define IPTOS_CE 0x01 /* congestion experienced */ +#define IPTOS_ECT 0x02 /* ECN-capable transport */ +#endif /* * Definitions for IP precedence (also in ip_tos) (hopefully unused) --- ./netinet/ip_input.c.orig Tue Jan 12 13:25:00 1999 +++ ./netinet/ip_input.c Sun Mar 7 12:58:11 1999 @@ -1513,9 +1513,19 @@ break; case ENOBUFS: +#ifdef ALTQ + /* + * don't generate ICMP_SOURCEQUENCH + * (RFC1812 Requirements for IP Version 4 Routers) + */ + if (mcopy) + m_freem(mcopy); + return; +#else type = ICMP_SOURCEQUENCH; code = 0; break; +#endif } icmp_error(mcopy, type, code, dest, destifp); } --- ./netinet/ip_mroute.c.orig Mon Jan 18 03:06:57 1999 +++ ./netinet/ip_mroute.c Sun Mar 7 12:58:11 1999 @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -2128,6 +2129,12 @@ static struct sockaddr_in rsvp_src = { sizeof rsvp_src, AF_INET }; register int s; struct ifnet *ifp; +#ifdef ALTQ + /* support IP_RECVIF used by rsvpd rel4.2a1 */ + struct inpcb *inp; + struct socket *so; + struct mbuf *opts; +#endif if (rsvpdebug) printf("rsvp_input: rsvp_on %d\n",rsvp_on); @@ -2180,7 +2187,11 @@ if (rsvpdebug) printf("rsvp_input: check socket\n"); +#ifdef ALTQ + if ((so = viftable[vifi].v_rsvpd) == NULL) { +#else if (viftable[vifi].v_rsvpd == NULL) { +#endif /* drop packet, since there is no specific socket for this * interface */ if (rsvpdebug) @@ -2195,12 +2206,33 @@ printf("rsvp_input: m->m_len = %d, sbspace() = %ld\n", m->m_len,sbspace(&(viftable[vifi].v_rsvpd->so_rcv))); +#ifdef ALTQ + opts = NULL; + inp = (struct inpcb *)so->so_pcb; + if (inp->inp_flags & INP_CONTROLOPTS || + inp->inp_socket->so_options & SO_TIMESTAMP) + ip_savecontrol(inp, &opts, ip, m); + if (sbappendaddr(&so->so_rcv, + (struct sockaddr *)&rsvp_src,m, opts) == 0) { + m_freem(m); + if (opts) + m_freem(opts); + if (rsvpdebug) + printf("rsvp_input: Failed to append to socket\n"); + } + else { + sorwakeup(so); + if (rsvpdebug) + printf("rsvp_input: send packet up\n"); + } +#else /* !ALTQ */ if (socket_send(viftable[vifi].v_rsvpd, m, &rsvp_src) < 0) if (rsvpdebug) printf("rsvp_input: Failed to append to socket\n"); else if (rsvpdebug) printf("rsvp_input: send packet up\n"); +#endif /* !ALTQ */ splx(s); } --- ./netinet/ip_output.c.orig Fri Feb 19 19:56:58 1999 +++ ./netinet/ip_output.c Sun Mar 7 12:58:11 1999 @@ -372,6 +372,12 @@ #endif /* IPFIREWALL_FORWARD */ } #endif /* notdef */ +#ifdef ALTQ + /* + * disable packet drop hack. + * packetdrop should be done by queueing. + */ +#else /* !ALTQ */ /* * Verify that we have any chance at all of being able to queue * the packet or packet fragments @@ -381,6 +387,7 @@ error = ENOBUFS; goto bad; } +#endif /* !ALTQ */ /* * Look for broadcast address and --- ./netinet/tcp.h.orig Mon Jul 13 13:09:51 1998 +++ ./netinet/tcp.h Sun Mar 7 12:58:11 1999 @@ -64,7 +64,13 @@ #define TH_PUSH 0x08 #define TH_ACK 0x10 #define TH_URG 0x20 +#if 1 /* ALTQ_ECN */ +#define TH_ECNECHO 0x40 /* ecn echo */ +#define TH_CWR 0x80 /* congestion window reduced */ +#define TH_FLAGS (TH_FIN|TH_SYN|TH_RST|TH_ACK|TH_URG|TH_ECNECHO|TH_CWR) +#else #define TH_FLAGS (TH_FIN|TH_SYN|TH_RST|TH_ACK|TH_URG) +#endif u_short th_win; /* window */ u_short th_sum; /* checksum */ --- ./netinet/tcp_input.c.orig Thu Dec 3 21:23:20 1998 +++ ./netinet/tcp_input.c Sun Mar 7 12:58:11 1999 @@ -88,6 +88,19 @@ SYSCTL_INT(_net_inet_tcp, OID_AUTO, delayed_ack, CTLFLAG_RW, &tcp_delack_enabled, 0, ""); +#ifdef ALTQ_ECN +/* + * experimental ECN support based on + * draft-kksjf-ecn-03.txt and http://www-nrg.ee.lbl.gov/floyd/ECN-IP.txt + * + * NOTE: this is an experimental implementation. + * + */ +int tcp_ecn = 1; +SYSCTL_INT(_net_inet_tcp, TCPCTL_ECN, ecn, + CTLFLAG_RW, &tcp_ecn , 0, ""); +#endif /* ALTQ_ECN */ + u_long tcp_now; struct inpcbhead tcb; struct inpcbinfo tcbinfo; @@ -275,6 +288,9 @@ struct tcpopt to; /* options in this segment */ struct rmxp_tao *taop; /* pointer to our TAO cache entry */ struct rmxp_tao tao_noncached; /* in case there's no cached entry */ +#ifdef ALTQ_ECN + u_char ip_tos; +#endif #ifdef TCPDEBUG short ostate = 0; #endif @@ -297,6 +313,10 @@ ti = mtod(m, struct tcpiphdr *); } +#ifdef ALTQ_ECN + /* save ip_tos before clearing it for checksum */ + ip_tos = ((struct ip *)ti)->ip_tos; +#endif /* * Checksum extended TCP header and data. */ @@ -502,6 +522,11 @@ if (tp->t_state != TCPS_LISTEN) tcp_dooptions(tp, optp, optlen, ti, &to); +#ifdef ALTQ_ECN + /* if congestion experienced, set ECN bit in the next output. */ + if ((ip_tos & (IPTOS_ECT|IPTOS_CE)) == (IPTOS_ECT|IPTOS_CE)) + tp->t_flags |= TF_RCVD_CE; +#endif /* * Header prediction: check for the two common cases * of a uni-directional data xfer. If the packet has @@ -520,7 +545,11 @@ * be TH_NEEDSYN. */ if (tp->t_state == TCPS_ESTABLISHED && +#ifdef ALTQ_ECN + (tiflags & (TH_SYN|TH_FIN|TH_RST|TH_URG|TH_ECNECHO|TH_CWR|TH_ACK)) == TH_ACK && +#else (tiflags & (TH_SYN|TH_FIN|TH_RST|TH_URG|TH_ACK)) == TH_ACK && +#endif ((tp->t_flags & (TF_NEEDSYN|TF_NEEDFIN)) == 0) && ((to.to_flag & TOF_TS) == 0 || TSTMP_GEQ(to.to_tsval, tp->ts_recent)) && @@ -567,6 +596,11 @@ tcpstat.tcps_rcvackbyte += acked; sbdrop(&so->so_snd, acked); tp->snd_una = ti->ti_ack; +#ifdef ALTQ_ECN + /* sync snc_rcvr with snd_una */ + if (SEQ_GT(tp->snd_una, tp->snd_rcvr)) + tp->snd_rcvr = tp->snd_una; +#endif m_freem(m); /* @@ -702,6 +736,18 @@ tp->irs = ti->ti_seq; tcp_sendseqinit(tp); tcp_rcvseqinit(tp); +#ifdef ALTQ_ECN + tp->snd_rcvr = tp->snd_una; + /* + * if both ECNECHO and CWR flag bits are set, + * peer is ECN capable + */ + if (tcp_ecn && + (tiflags & (TH_ECNECHO|TH_CWR)) == (TH_ECNECHO|TH_CWR)) { + tp->t_flags |= TF_REQ_ECN; + tiflags &= ~(TH_ECNECHO|TH_CWR); + } +#endif /* * Initialization of the tcpcb for transaction; * set SND.WND = SEG.WND, @@ -833,6 +879,23 @@ tp->irs = ti->ti_seq; tcp_rcvseqinit(tp); +#ifdef ALTQ_ECN + tp->snd_rcvr = tp->snd_una; + /* + * peer is ECN capable + * - if ECNECHO is set but CWR is not set for SYN-ACK + * - if both ECNECHO and CWR are set for simultaneous open + */ + if (tcp_ecn) { + if ((tiflags & (TH_ACK|TH_ECNECHO|TH_CWR)) + == (TH_ACK|TH_ECNECHO) || + (tiflags & (TH_ACK|TH_ECNECHO|TH_CWR)) + == (TH_ECNECHO|TH_CWR)) { + tp->t_flags |= TF_REQ_ECN; + tiflags &= ~(TH_ECNECHO|TH_CWR); + } + } +#endif if (tiflags & TH_ACK) { /* * Our SYN was acked. If segment contains CC.ECHO @@ -1320,6 +1383,37 @@ case TCPS_LAST_ACK: case TCPS_TIME_WAIT: +#ifdef ALTQ_ECN + /* + * if we receive ECN notify and we are not already in + * receovery phase, reduce cwnd by half but don't slow- + * start. + */ + if (tcp_ecn && (tiflags & TH_ECNECHO)) { + if (SEQ_GEQ(tp->snd_una, tp->snd_rcvr)) { + u_int win = min(tp->snd_wnd, tp->snd_cwnd) / 2 / + tp->t_maxseg; + if (win < 2) + win = 2; + tp->snd_ssthresh = win * tp->t_maxseg; + tp->snd_cwnd = tp->snd_ssthresh; + tp->t_flags |= TF_SENDCWR; + /* + * advance snd_rcvr to snd_max not to + * reduce cwnd again until all outstanding + * packets are acked. + */ + tp->snd_rcvr = tp->snd_max; + } + } + /* + * if we receive CWR, we know that the peer has reduced + * its congestion window. stop sending ecn-echo. + */ + if (tiflags & TH_CWR) + tp->t_flags &= ~TF_RCVD_CE; +#endif /* ALTQ_ECN */ + if (SEQ_LEQ(ti->ti_ack, tp->snd_una)) { if (ti->ti_len == 0 && tiwin == tp->snd_wnd) { tcpstat.tcps_rcvdupack++; @@ -1352,6 +1446,17 @@ tp->t_dupacks = 0; else if (++tp->t_dupacks == tcprexmtthresh) { tcp_seq onxt = tp->snd_nxt; +#ifdef ALTQ_ECN + if (SEQ_LT(tp->snd_una, tp->snd_rcvr)) { + /* + * we are in recovery phase + * and have already halved + * cwnd within a roundtrip. + * don't reduce cwnd again. + */ + } + else { +#endif /* ALTQ_ECN */ u_int win = min(tp->snd_wnd, tp->snd_cwnd) / 2 / tp->t_maxseg; @@ -1359,6 +1464,12 @@ if (win < 2) win = 2; tp->snd_ssthresh = win * tp->t_maxseg; +#ifdef ALTQ_ECN + tp->t_flags |= TF_SENDCWR; + /* mark we are in recovery phase */ + tp->snd_rcvr = tp->snd_max; + } +#endif tp->t_timer[TCPT_REXMT] = 0; tp->t_rtt = 0; tp->snd_nxt = ti->ti_ack; @@ -1476,6 +1587,11 @@ } sowwakeup(so); tp->snd_una = ti->ti_ack; +#ifdef ALTQ_ECN + /* sync snc_rcvr with snd_una */ + if (SEQ_GT(tp->snd_una, tp->snd_rcvr)) + tp->snd_rcvr = tp->snd_una; +#endif if (SEQ_LT(tp->snd_nxt, tp->snd_una)) tp->snd_nxt = tp->snd_una; --- ./netinet/tcp_output.c.orig Wed Jan 20 18:31:59 1999 +++ ./netinet/tcp_output.c Sun Mar 7 12:58:11 1999 @@ -542,6 +542,30 @@ panic("tcp_output"); (void)memcpy(ti, tp->t_template, sizeof (struct tcpiphdr)); +#ifdef ALTQ_ECN + if (tcp_ecn) { + /* + * if we have received congestion experienced segs, + * set ECNECHO bit. + * if this is a SYN seg, set ECNECHO and CWR for a pure SYN, + * set only ECNECHO for SYN-ACK. + */ + if (tp->t_flags & TF_RCVD_CE) + flags |= TH_ECNECHO; + if ((flags & (TH_SYN|TH_ACK)) == TH_SYN) + flags |= (TH_ECNECHO|TH_CWR); + else if ((flags & (TH_SYN|TH_ACK)) == (TH_SYN|TH_ACK)) + flags |= TH_ECNECHO; + /* + * if we have reduced the congestion window, notify + * the peer by setting CWR bit. + */ + if (tp->t_flags & TF_SENDCWR) { + flags |= TH_CWR; + tp->t_flags &= ~TF_SENDCWR; + } + } +#endif /* * Fill in fields, remembering maximum advertised * window for use in delaying messages about window sizes. @@ -679,6 +703,14 @@ ((struct ip *)ti)->ip_len = m->m_pkthdr.len; ((struct ip *)ti)->ip_ttl = tp->t_inpcb->inp_ip_ttl; /* XXX */ ((struct ip *)ti)->ip_tos = tp->t_inpcb->inp_ip_tos; /* XXX */ +#ifdef ALTQ_ECN + /* + * if peer is ECN capable and this is not a pure ack seg, + * set ECN capable bit in IP header. + */ + if ((tp->t_flags & TF_REQ_ECN) && len > 0) + ((struct ip *)ti)->ip_tos |= IPTOS_ECT; +#endif #if 1 /* * See if we should do MTU discovery. We do it only if the following --- ./netinet/tcp_timer.c.orig Fri Apr 24 11:25:35 1998 +++ ./netinet/tcp_timer.c Sun Mar 7 12:58:11 1999 @@ -291,6 +291,10 @@ tp->snd_cwnd = tp->t_maxseg; tp->snd_ssthresh = win * tp->t_maxseg; tp->t_dupacks = 0; +#ifdef ALTQ_ECN + tp->t_flags |= TF_SENDCWR; + tp->snd_rcvr = tp->snd_max; +#endif } (void) tcp_output(tp); break; --- ./netinet/tcp_var.h.orig Wed Jan 20 18:32:00 1999 +++ ./netinet/tcp_var.h Sun Mar 7 12:58:11 1999 @@ -70,6 +70,11 @@ #define TF_REQ_CC 0x02000 /* have/will request CC */ #define TF_RCVD_CC 0x04000 /* a CC was received in SYN */ #define TF_SENDCCNEW 0x08000 /* send CCnew instead of CC in SYN */ +#ifdef ALTQ_ECN +#define TF_REQ_ECN 0x10000 /* peer is ECN capable */ +#define TF_RCVD_CE 0x20000 /* send ECN in next seg */ +#define TF_SENDCWR 0x40000 /* send CWR in next seg */ +#endif #define TF_MORETOCOME 0x10000 /* More data to be appended to sock */ int t_force; /* 1 if forcing out a byte */ @@ -85,6 +90,9 @@ tcp_seq iss; /* initial send sequence number */ tcp_seq irs; /* initial receive sequence number */ +#ifdef ALTQ_ECN + tcp_seq snd_rcvr; /* outstanding seg at fastrecovery */ +#endif tcp_seq rcv_nxt; /* receive next */ tcp_seq rcv_adv; /* advertised window */ u_long rcv_wnd; /* receive window */ @@ -305,7 +313,12 @@ #define TCPCTL_RECVSPACE 9 /* receive buffer space */ #define TCPCTL_KEEPINIT 10 /* receive buffer space */ #define TCPCTL_PCBLIST 11 /* list of all outstanding PCBs */ -#define TCPCTL_MAXID 12 +#ifdef ALTQ_ECN +#define TCPCTL_ECN 12 /* explicit congestion notification */ +#define TCPCTL_MAXID 13 +#else +#define TCPCTL_MAXID 13 +#endif #define TCPCTL_NAMES { \ { 0, 0 }, \ @@ -365,7 +378,9 @@ extern struct pr_usrreqs tcp_usrreqs; extern u_long tcp_sendspace; extern u_long tcp_recvspace; - +#ifdef ALTQ_ECN +extern int tcp_ecn; +#endif #endif /* KERNEL */ #endif /* _NETINET_TCP_VAR_H_ */ --- ./pci/if_de.c.orig Mon Mar 1 18:03:24 1999 +++ ./pci/if_de.c Sun Mar 7 12:58:12 1999 @@ -4243,6 +4243,11 @@ #else struct mbuf *m0; #endif +#ifdef ALTQ + struct ifnet *ifp = &sc->tulip_if; + struct mbuf *ombuf = m; + int compressed = 0; +#endif #if defined(TULIP_DEBUG) if ((sc->tulip_cmdmode & TULIP_CMD_TXRUN) == 0) { @@ -4393,6 +4398,28 @@ * entries that we can use for one packet, so we have * recopy it into one mbuf and then try again. */ +#ifdef ALTQ + if (ALTQ_IS_ON(ifp)) { + struct mbuf *tmp; + /* + * tulip_mbuf_compress() frees the original mbuf. + * thus, we have to remove the mbuf from the queue + * before calling it. + * we don't have to worry about space shortage + * after compressing the mbuf since the compressed + * mbuf will take only two segs. + */ + if (compressed) { + /* should not happen */ + printf("tulip_txput: compress called twice!\n"); + goto finish; + } + tmp = (*ifp->if_altqdequeue)(ifp, ALTDQ_DEQUEUE); + if (tmp != ombuf) + panic("tulip_txput: different mbuf dequeued!"); + compressed = 1; + } +#endif m = tulip_mbuf_compress(m); if (m == NULL) goto finish; @@ -4448,6 +4475,18 @@ * The descriptors have been filled in. Now get ready * to transmit. */ +#ifdef ALTQ + if (ALTQ_IS_ON(ifp)) { + if (!compressed && (sc->tulip_flags & TULIP_TXPROBE_ACTIVE) == 0) { + /* remove the mbuf from the queue */ + struct mbuf *tmp; + tmp = (*ifp->if_altqdequeue)(ifp, ALTDQ_DEQUEUE); + if (tmp != ombuf) + panic("tulip_txput: different mbuf dequeued!"); + } + } +#endif + IF_ENQUEUE(&sc->tulip_txq, m); m = NULL; @@ -4516,6 +4555,16 @@ /* * switch back to the single queueing ifstart. */ +#ifdef ALTQ + if (ALTQ_IS_ON(ifp)) { + /* + * de driver is too clever that it doesn't call if_start + * when it thinks it doesn't need to, but altq needs it! + */ + sc->tulip_flags |= TULIP_WANTTXSTART; + } + else +#endif sc->tulip_flags &= ~TULIP_WANTTXSTART; if (sc->tulip_txtimer == 0) sc->tulip_txtimer = TULIP_TXTIMER; @@ -4841,6 +4890,14 @@ return error; } +#ifdef ALTQ +/* + * the original dequeueing policy is dequeue-and-prepend if something + * goes wrong. when altq is used, it is changed to peek-and-dequeue. + * the modification becomes a bit complicated since tulip_txput() might + * copy and modify the mbuf passed. + */ +#endif /* * These routines gets called at device spl (from ether_output). This might * pose a problem for TULIP_USE_SOFTINTR if ether_output is called at @@ -4859,6 +4916,21 @@ if ((sc->tulip_flags & (TULIP_WANTSETUP|TULIP_TXPROBE_ACTIVE)) == TULIP_WANTSETUP) tulip_txput_setup(sc); +#ifdef ALTQ + if (ALTQ_IS_ON(ifp)) { + struct mbuf *m, *m0; + while ((m = (*ifp->if_altqdequeue)(ifp, ALTDQ_PEEK)) != NULL) { + if ((m0 = tulip_txput(sc, m)) != NULL) { + /* txput failed */ + if (m0 != m) + /* should not happen */ + printf("tulip_if_start: bad mbuf dequeued!\n"); + break; + } + } + } + else +#endif /* ALTQ */ while (sc->tulip_if.if_snd.ifq_head != NULL) { struct mbuf *m; IF_DEQUEUE(&sc->tulip_if.if_snd, m); @@ -4881,6 +4953,21 @@ TULIP_PERFSTART(ifstart_one) tulip_softc_t * const sc = TULIP_IFP_TO_SOFTC(ifp); +#ifdef ALTQ + if (ALTQ_IS_ON(ifp)) { + struct mbuf *m, *m0; + if ((sc->tulip_if.if_flags & IFF_RUNNING) + && ((m = (*ifp->if_altqdequeue)(ifp, ALTDQ_PEEK)) != NULL)) { + if ((m0 = tulip_txput(sc, m)) != NULL) { + /* txput tailed! */ + if (m0 != m) + /* should not happen */ + printf("tulip_if_start: bad mbuf dequeued!\n"); + } + } + } + else +#endif /* !ALTQ */ if ((sc->tulip_if.if_flags & IFF_RUNNING) && sc->tulip_if.if_snd.ifq_head != NULL) { struct mbuf *m; @@ -5080,6 +5167,9 @@ tulip_reset(sc); +#ifdef ALTQ + ifp->if_altqflags |= ALTQF_READY; +#endif #if defined(__bsdi__) && _BSDI_VERSION >= 199510 sc->tulip_pf = printf; TULIP_ETHER_IFATTACH(sc); --- ./pci/if_fxp.c.orig Mon Feb 15 09:47:10 1999 +++ ./pci/if_fxp.c Sun Mar 7 12:58:19 1999 @@ -570,6 +570,9 @@ ifp->if_ioctl = fxp_ioctl; ifp->if_start = fxp_start; ifp->if_watchdog = fxp_watchdog; +#ifdef ALTQ + ifp->if_altqflags |= ALTQF_READY; +#endif /* * Attach the interface. @@ -812,14 +815,28 @@ * NOTE: One TxCB is reserved to guarantee that fxp_mc_setup() can add * a NOP command when needed. */ +#ifdef ALTQ + while (sc->tx_queued < FXP_NTXCB - 1) { +#else while (ifp->if_snd.ifq_head != NULL && sc->tx_queued < FXP_NTXCB - 1) { +#endif struct mbuf *m, *mb_head; int segment; /* * Grab a packet to transmit. */ +#ifdef ALTQ + if (ALTQ_IS_ON(ifp)) { + mb_head = (*ifp->if_altqdequeue)(ifp, ALTDQ_DEQUEUE); + } + else + IF_DEQUEUE(&ifp->if_snd, mb_head); + if (mb_head == NULL) + break; +#else IF_DEQUEUE(&ifp->if_snd, mb_head); +#endif /* * Get pointer to next available tx desc. @@ -969,6 +986,11 @@ /* * Try to start more packets transmitting. */ +#ifdef ALTQ + if (ALTQ_IS_ON(ifp)) + fxp_start(ifp); + else +#endif if (ifp->if_snd.ifq_head != NULL) fxp_start(ifp); } --- ./pci/if_tl.c.orig Mon Feb 1 22:32:52 1999 +++ ./pci/if_tl.c Sun Mar 7 12:58:19 1999 @@ -1718,6 +1718,9 @@ ifp->if_watchdog = tl_watchdog; ifp->if_init = tl_init; ifp->if_mtu = ETHERMTU; +#ifdef ALTQ + ifp->if_altqflags |= ALTQF_READY; +#endif ifp->if_snd.ifq_maxlen = TL_TX_LIST_CNT - 1; callout_handle_init(&sc->tl_stat_ch); @@ -2241,6 +2244,12 @@ CMD_PUT(sc, TL_CMD_ACK | r | type); } +#ifdef ALTQ + if (ALTQ_IS_ON(ifp)) { + tl_start(ifp); + } + else +#endif if (ifp->if_snd.ifq_head != NULL) tl_start(ifp); @@ -2410,6 +2419,12 @@ start_tx = sc->tl_cdata.tl_tx_free; while(sc->tl_cdata.tl_tx_free != NULL) { +#ifdef ALTQ + if (ALTQ_IS_ON(ifp)) { + m_head = (*ifp->if_altqdequeue)(ifp, ALTDQ_DEQUEUE); + } + else +#endif IF_DEQUEUE(&ifp->if_snd, m_head); if (m_head == NULL) break; @@ -2439,6 +2454,13 @@ bpf_mtap(ifp, cur_tx->tl_mbuf); #endif } +#ifdef ALTQ /* fix imported from 1.16.2.5 1998/12/05 */ + /* + * If there are no packets queued, bail. + */ + if (cur_tx == NULL) + return; +#endif /* * If there are no packets queued, bail. --- ./pci/if_tx.c.orig Mon Dec 14 07:32:56 1998 +++ ./pci/if_tx.c Sun Mar 7 12:58:20 1999 @@ -227,6 +227,12 @@ epic_softc_t *sc = (epic_softc_t*)self; struct pci_attach_args *pa = aux; pci_chipset_tag_t pc = pa->pa_pc; +#ifdef ALTQ + if (ALTQ_IS_ON(ifp)) { + m0 = (*ifp->if_altqdequeue)(ifp, ALTDQ_FLUSH); + return; + } +#endif pci_intr_handle_t ih; const char *intrstr = NULL; struct ifnet *ifp; @@ -242,6 +248,11 @@ printf(": can't find i/o space\n"); return; } +#ifdef ALTQ + if (ALTQ_IS_ON(ifp)) + m0 = (*ifp->if_altqdequeue)(ifp, ALTDQ_DEQUEUE); + else +#endif if( bus_space_map(iot, iobase, iosize, 0, &sc->sc_sh)) { printf(": can't map i/o space\n"); return; @@ -492,6 +503,13 @@ #else ifp->if_flags |= IFF_LINK2; #endif +#ifdef ALTQ + if (ALTQ_IS_ON(&sc->epic_if)) { + epic_ifstart( &sc->epic_if ); + } + else + +#endif } else { printf(", 10Mbps "); #if !defined(EPIC_NOIFMEDIA) @@ -613,6 +631,12 @@ break; } #endif +#ifdef ALTQ + if (ALTQ_IS_ON(ifp)) { + epic_ifstart(&sc->epic_if); + } + else +#endif default: epic_stop(sc); epic_init(sc); @@ -688,6 +712,9 @@ */ static int epic_common_attach( +#ifdef ALTQ + ifp->if_altqflags |= ALTQF_READY; +#endif epic_softc_t *sc) { int i; --- ./pci/if_xl.c.orig Fri Feb 26 09:40:39 1999 +++ ./pci/if_xl.c Sun Mar 7 12:58:20 1999 @@ -1462,6 +1462,9 @@ ifp->if_init = xl_init; ifp->if_baudrate = 10000000; ifp->if_snd.ifq_maxlen = XL_TX_LIST_CNT - 1; +#ifdef ALTQ + ifp->if_altqflags |= ALTQF_READY; +#endif /* * Figure out the card type. 3c905B adapters have the @@ -2058,6 +2061,12 @@ XL_SEL_WIN(7); +#ifdef ALTQ + if (ALTQ_IS_ON(ifp)) { + xl_start(ifp); + } + else +#endif if (ifp->if_snd.ifq_head != NULL) { xl_start(ifp); } @@ -2228,6 +2237,12 @@ start_tx = sc->xl_cdata.xl_tx_free; while(sc->xl_cdata.xl_tx_free != NULL) { +#ifdef ALTQ + if (ALTQ_IS_ON(ifp)) { + m_head = (*ifp->if_altqdequeue)(ifp, ALTDQ_DEQUEUE); + } + else +#endif IF_DEQUEUE(&ifp->if_snd, m_head); if (m_head == NULL) break; @@ -2257,6 +2272,13 @@ bpf_mtap(ifp, cur_tx->xl_mbuf); #endif } +#ifdef ALTQ /* fix imported from 1.5.2.14 1998/12/05 */ + /* + * If there are no packets queued, bail. + */ + if (cur_tx == NULL) + return; +#endif /* * If there are no packets queued, bail. --lrZ03NoBR/3+SXJZ Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=mkdiff /usr/src/sys-altq find . -name "*.orig" | awk '{ print "diff -u ",$1,$1 }' | sed -e 's/.orig$//' | awk '{ print $0, ">> xxx/FreeBSD-3.1-990306.diff" }' | sh -x --lrZ03NoBR/3+SXJZ-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Sun Mar 7 18:58: 3 1999 Delivered-To: freebsd-net@freebsd.org Received: from widefw.csl.sony.co.jp (widefw.csl.sony.co.jp [133.138.1.1]) by hub.freebsd.org (Postfix) with ESMTP id 8543C14D9E for ; Sun, 7 Mar 1999 18:58:00 -0800 (PST) (envelope-from kjc@csl.sony.co.jp) Received: from hotaka.csl.sony.co.jp (root@hotaka.csl.sony.co.jp [43.27.98.57]) by widefw.csl.sony.co.jp (8.8.8/3.6W) with ESMTP id LAA19055; Mon, 8 Mar 1999 11:57:41 +0900 (JST) Received: from localhost (kjc@[127.0.0.1]) by hotaka.csl.sony.co.jp (8.8.8/3.6W/hotaka/98122515) with ESMTP id LAA21793; Mon, 8 Mar 1999 11:57:40 +0900 (JST) Message-Id: <199903080257.LAA21793@hotaka.csl.sony.co.jp> To: Andreas Klemm Cc: julian@whistle.com, freebsd-net@FreeBSD.ORG Subject: Re: ALTQ 1.1.3, support for FreeBSD 3.1-STABLE, started the work In-reply-to: Your message of "Sun, 07 Mar 1999 14:26:18 +0100." <19990307142618.A4807@titan.klemm.gtn.com> Date: Mon, 08 Mar 1999 11:57:40 +0900 From: Kenjiro Cho Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Andreas, >> I started to port your ALTQ 1.1.3 patches for FreeBSD 3.0 >> to FreeBSD-3.1. The ALTQ patch for FreeBSD-3.1-RELEASE is already available from http://www.csl.sony.co.jp/person/kjc/software.html >> BTW, just curious, did you or somebody else play with WFQ ? >> The authors say in the docu, WFQ isn't well maintained and >> is missing hashing ... Do you thing using ALTQ brings advantages >> like Cisco's implementation does ? All I want is, to get better >> telnet / ssh performance over a 64 KBit ISDN line if UUCP/ftp >> sessions saturate the link. I believe that CBQ provides much better control over WFQ since WFQ is not capable of controlling the peak rate of a flow. See the following report by George Uhl at NASA. http://corn.eos.nasa.gov/qos/qos_results_summary_july98.html --Kenjiro To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Mon Mar 8 5:13: 0 1999 Delivered-To: freebsd-net@freebsd.org Received: from IPv6.ITB.ac.id (ipv6.ITB.ac.id [167.205.22.116]) by hub.freebsd.org (Postfix) with ESMTP id 1F42F14BEB for ; Mon, 8 Mar 1999 05:11:54 -0800 (PST) (envelope-from jky@itb.ac.id) Received: from localhost (jky@localhost) by IPv6.ITB.ac.id (8.9.0/8.9.0) with SMTP id UAA01542; Mon, 8 Mar 1999 20:11:17 +0700 (JAVT) X-Authentication-Warning: IPv6.ITB.ac.id: jky owned process doing -bs Date: Mon, 8 Mar 1999 20:11:17 +0700 (JAVT) From: Joko Y To: Kenjiro Cho Cc: freebsd-net@FreeBSD.ORG Subject: Re: ALTQ 1.1.3, support for FreeBSD 3.1-STABLE, started the work In-Reply-To: <199903080257.LAA21793@hotaka.csl.sony.co.jp> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On Mon, 8 Mar 1999, Kenjiro Cho wrote: > I believe that CBQ provides much better control over WFQ since WFQ is > not capable of controlling the peak rate of a flow. > See the following report by George Uhl at NASA. > http://corn.eos.nasa.gov/qos/qos_results_summary_july98.html Mr. Cho, what do you think about W2FQ? I found it in URL below: http://www.cs.cmu.edu/People/hzhang/ TIA, -jky- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Mon Mar 8 8:30:50 1999 Delivered-To: freebsd-net@freebsd.org Received: from itsdsv1.enc.edu (fw1.enc.edu [207.95.42.127]) by hub.freebsd.org (Postfix) with ESMTP id 7EDEB14D9B for ; Mon, 8 Mar 1999 08:30:33 -0800 (PST) (envelope-from owensc@enc.edu) Received: from enc.edu ([10.1.20.106]) by itsdsv1.enc.edu (8.7.5/8.7.3) with ESMTP id LAA11780 for ; Mon, 8 Mar 1999 11:25:53 -0500 (EST) Message-ID: <36E3F920.AE6722DE@enc.edu> Date: Mon, 08 Mar 1999 11:21:52 -0500 From: Charles Owens Organization: Eastern Nazarene College X-Mailer: Mozilla 4.5 [en] (Win95; I) X-Accept-Language: en MIME-Version: 1.0 To: freebsd-net@freebsd.org Subject: help with nak'd MAGICNUM on ppp link Content-Type: multipart/mixed; boundary="------------9B4D64ADB1600D4F783A3612" Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org This is a multi-part message in MIME format. --------------9B4D64ADB1600D4F783A3612 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Howdy, Currently in place is a ppp link on a dedicated line... the server runs Linux 2.0.33 while the client runs Linux 2.0.30. I'm trying to replace the client with a new box running FreeBSD_3.0-stable but am running into some trouble getting the ppp link up. It appears that the connection setup is failing during the negotiation of the "magic number". Any ideas as to why this is happenning? What is the Linux server expecting here? (I don't have access to the server side of the connection). Could my enabling of LQR be the problem? I'm going to try using "set enddisc" to change the what Magic number the client suggests, but testing is slow as the system is several continents away. Any help would be most appreciated! Please cc: me directly. Thanks much! Here's the /var/log/ppp.log output from the unhappy FreeBSD box. Mar 7 14:02:49 s1 ppp[279]: tun0: Command: rom-client: set device /dev/cuaa1 Mar 7 14:02:49 s1 ppp[279]: tun0: Command: rom-client: set speed 115200 Mar 7 14:02:49 s1 ppp[279]: tun0: Command: rom-client: set dial ABORT BUSY ABOR T NO\sCARRIER ABORT Invalid\sLogin TIMEOUT 5 "" AT OK-AT-OK ATE1Q0&d3x1s7=120 OK \dATDP\T TIMEOUT 125 CONNECT Mar 7 14:02:49 s1 ppp[279]: tun0: Command: rom-client: set timeout 0 Mar 7 14:02:49 s1 ppp[279]: tun0: Command: rom-client: set lqrperiod 10 Mar 7 14:02:49 s1 ppp[279]: tun0: Command: rom-client: set log Phase Chat LQM L CP IPCP CCP tun command Mar 7 14:02:49 s1 ppp[279]: tun0: Command: rom-client: set ifaddr 193.231.160.3 3/24 193.231.160.65/24 Mar 7 14:02:49 s1 ppp[279]: tun0: Command: rom-client: enable lqr Mar 7 14:02:49 s1 ppp[279]: tun0: Command: rom-client: accept lqr Mar 7 14:02:49 s1 ppp[287]: tun0: Phase: PPP Started (dedicated mode). Mar 7 14:02:49 s1 ppp[287]: tun0: Phase: bundle: Establish Mar 7 14:02:49 s1 ppp[287]: tun0: Phase: deflink: closed -> opening Mar 7 14:02:49 s1 ppp[287]: tun0: Phase: deflink: Connected! Mar 7 14:02:49 s1 ppp[287]: tun0: Phase: deflink: opening -> lcp Mar 7 14:02:49 s1 ppp[287]: tun0: LCP: FSM: Using "deflink" as a transport Mar 7 14:02:49 s1 ppp[287]: tun0: LCP: deflink: State change Initial --> Closed Mar 7 14:02:49 s1 ppp[287]: tun0: LCP: deflink: State change Closed --> Stopped Mar 7 14:02:50 s1 ppp[287]: tun0: LCP: deflink: LayerStart Mar 7 14:02:50 s1 ppp[287]: tun0: LCP: deflink: SendConfigReq(1) state = Stoppe d Mar 7 14:02:50 s1 ppp[287]: tun0: LCP: ACFCOMP[2] Mar 7 14:02:50 s1 ppp[287]: tun0: LCP: PROTOCOMP[2] Mar 7 14:02:50 s1 ppp[287]: tun0: LCP: ACCMAP[6] 0x00000000 Mar 7 14:02:50 s1 ppp[287]: tun0: LCP: MRU[4] 1500 Mar 7 14:02:50 s1 ppp[287]: tun0: LCP: MAGICNUM[6] 0x4e42605b Mar 7 14:02:50 s1 ppp[287]: tun0: LCP: QUALPROTO[8] proto c025, interval 10000 ms Mar 7 14:02:50 s1 ppp[287]: tun0: LCP: deflink: State change Stopped --> Req-Se nt Mar 7 14:02:50 s1 ppp[287]: tun0: LCP: deflink: RecvConfigReq(1) state = Req-Se nt Mar 7 14:02:50 s1 ppp[287]: tun0: LCP: ACFCOMP[2] Mar 7 14:02:50 s1 ppp[287]: tun0: LCP: PROTOCOMP[2] Mar 7 14:02:50 s1 ppp[287]: tun0: LCP: ACCMAP[6] 0x00000000 Mar 7 14:02:50 s1 ppp[287]: tun0: LCP: MRU[4] 1500 Mar 7 14:02:50 s1 ppp[287]: tun0: LCP: MAGICNUM[6] 0x4e42605b Mar 7 14:02:50 s1 ppp[287]: tun0: LCP: Magic is same (4e42605b) - 1 times Mar 7 14:02:51 s1 ppp[287]: tun0: LCP: QUALPROTO[8] proto c025, interval 10000 ms Mar 7 14:02:51 s1 ppp[287]: tun0: LCP: deflink: SendConfigNak(1) state = Req-Se nt Mar 7 14:02:51 s1 ppp[287]: tun0: LCP: MAGICNUM[6] 0x4e42605b Mar 7 14:02:51 s1 ppp[287]: tun0: LCP: deflink: RecvConfigNak(1) state = Req-Sent Mar 7 14:02:51 s1 ppp[287]: tun0: LCP: MAGICNUM[6] 0x4e42605b Mar 7 14:02:51 s1 ppp[287]: tun0: LCP: Magic 0x4e42605b is NAKed! Mar 7 14:02:51 s1 ppp[287]: tun0: LCP: deflink: SendConfigReq(2) state = Req-Se nt Mar 7 14:02:51 s1 ppp[287]: tun0: LCP: ACFCOMP[2] Mar 7 14:02:51 s1 ppp[287]: tun0: LCP: PROTOCOMP[2] Mar 7 14:02:51 s1 ppp[287]: tun0: LCP: ACCMAP[6] 0x00000000 Mar 7 14:02:51 s1 ppp[287]: tun0: LCP: MRU[4] 1500 Mar 7 14:02:51 s1 ppp[287]: tun0: LCP: MAGICNUM[6] 0x1db3f26f Mar 7 14:02:51 s1 ppp[287]: tun0: LCP: QUALPROTO[8] proto c025, interval 10000 ms Mar 7 14:02:51 s1 ppp[287]: tun0: LCP: deflink: RecvConfigReq(2) state = Req-Sent Mar 7 14:02:51 s1 ppp[287]: tun0: LCP: ACFCOMP[2] Mar 7 14:02:51 s1 ppp[287]: tun0: LCP: PROTOCOMP[2] Mar 7 14:02:51 s1 ppp[287]: tun0: LCP: ACCMAP[6] 0x00000000 Mar 7 14:02:51 s1 ppp[287]: tun0: LCP: MRU[4] 1500 Mar 7 14:02:51 s1 ppp[287]: tun0: LCP: MAGICNUM[6] 0x1db3f26f Mar 7 14:02:51 s1 ppp[287]: tun0: LCP: Magic is same (1db3f26f) - 2 times Mar 7 14:02:52 s1 ppp[287]: tun0: LCP: QUALPROTO[8] proto c025, interval 10000 ms Mar 7 14:02:52 s1 ppp[287]: tun0: LCP: deflink: SendConfigNak(2) state = Req-Sent Mar 7 14:02:52 s1 ppp[287]: tun0: LCP: MAGICNUM[6] 0x1db3f26f Mar 7 14:02:52 s1 ppp[287]: tun0: LCP: deflink: RecvConfigNak(2) state = Req-Sent Mar 7 14:02:52 s1 ppp[287]: tun0: LCP: MAGICNUM[6] 0x1db3f26f Mar 7 14:02:52 s1 ppp[287]: tun0: LCP: Magic 0x1db3f26f is NAKed! Mar 7 14:02:52 s1 ppp[287]: tun0: LCP: deflink: SendConfigReq(3) state = Req-Sent [... keeps trying 6 more times ...] Mar 7 14:03:12 s1 ppp[287]: tun0: LCP: deflink: SendTerminateReq(10) state = Re q-Sent Mar 7 14:03:12 s1 ppp[287]: tun0: LCP: deflink: State change Req-Sent --> Closi ng Mar 7 14:03:12 s1 ppp[287]: tun0: LCP: deflink: RecvTerminateReq(10) state = Cl osing Mar 7 14:03:12 s1 ppp[287]: tun0: LCP: deflink: SendTerminateAck(10) state = Cl osing Mar 7 14:03:12 s1 ppp[287]: tun0: LCP: deflink: RecvTerminateAck(10) state = Cl osing Mar 7 14:03:12 s1 ppp[287]: tun0: LCP: deflink: LayerFinish Mar 7 14:03:12 s1 ppp[287]: tun0: LCP: deflink: State change Closing --> Closed Mar 7 14:03:12 s1 ppp[287]: tun0: LCP: deflink: State change Closed --> Initial Mar 7 14:03:12 s1 ppp[287]: tun0: Phase: deflink: Disconnected! Mar 7 14:03:12 s1 ppp[287]: tun0: LCP: FSM: Using "deflink" as a transport Mar 7 14:03:12 s1 ppp[287]: tun0: LCP: deflink: State change Initial --> Closed Mar 7 14:03:12 s1 ppp[287]: tun0: LCP: deflink: State change Closed --> Stopped Mar 7 14:03:13 s1 ppp[287]: tun0: LCP: deflink: LayerStart Mar 7 14:03:13 s1 ppp[287]: tun0: LCP: deflink: SendConfigReq(11) state = Stopp ed [... then tries some more...] Mar 7 14:03:13 s1 ppp[287]: tun0: LCP: ACFCOMP[2] Mar 7 14:03:13 s1 ppp[287]: tun0: LCP: PROTOCOMP[2] Mar 7 14:03:13 s1 ppp[287]: tun0: LCP: ACCMAP[6] 0x00000000 Mar 7 14:03:13 s1 ppp[287]: tun0: LCP: MRU[4] 1500 Mar 7 14:03:13 s1 ppp[287]: tun0: LCP: MAGICNUM[6] 0x67b941bf Mar 7 14:03:13 s1 ppp[287]: tun0: LCP: QUALPROTO[8] proto c025, interval 10000 [ etc...] -- --- ------------------------------------------------------------------------- Charles N. Owens Email: owensc@enc.edu http://www.enc.edu/~owensc Network & Systems Administrator Information Technology Services "Outside of a dog, a book is a man's Eastern Nazarene College best friend. Inside of a dog it's too dark to read." - Groucho Marx ------------------------------------------------------------------------- --------------9B4D64ADB1600D4F783A3612 Content-Type: text/x-vcard; charset=us-ascii; name="owensc.vcf" Content-Transfer-Encoding: 7bit Content-Description: Card for Charles Owens Content-Disposition: attachment; filename="owensc.vcf" begin:vcard n:Owens;Charles tel;fax:617-745-7907 tel;work:617-745-3725 x-mozilla-html:FALSE url:http://www.enc.edu/~owensc org:Eatern Nazarene College;Information Technology Services adr:;;23 East Elm Avenue;Quincy;MA;02170;USA version:2.1 email;internet:owensc@enc.edu title:Network & Systems Coordinator x-mozilla-cpt:;0 fn:Charles N. Owens end:vcard --------------9B4D64ADB1600D4F783A3612-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Mon Mar 8 9:17:31 1999 Delivered-To: freebsd-net@freebsd.org Received: from databus.databus.com (databus.databus.com [198.186.154.34]) by hub.freebsd.org (Postfix) with SMTP id 29B4F14EAC for ; Mon, 8 Mar 1999 09:17:27 -0800 (PST) (envelope-from barney@databus.databus.com) From: Barney Wolff To: freebsd-net@FreeBSD.ORG Date: Mon, 8 Mar 1999 12:15 EST Subject: Re: help with nak'd MAGICNUM on ppp link Content-Length: 234 Content-Type: text/plain Message-ID: <36e406140.4309@databus.databus.com> Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Getting a matching magic-number means it's all but certain that the modem link has died and you're talking to yourself. Or you're talking to something that just echoes, rather than processing PPP. Barney Wolff To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Mon Mar 8 18:46:28 1999 Delivered-To: freebsd-net@freebsd.org Received: from gateway.newtoy.com (snowfox.pr.mcs.net [205.164.44.72]) by hub.freebsd.org (Postfix) with ESMTP id 067EA14FD7 for ; Mon, 8 Mar 1999 18:46:26 -0800 (PST) (envelope-from snowfox@snowfox.net) Received: from milk ([192.168.2.1]) by gateway.newtoy.com (8.8.8/8.8.8) with SMTP id UAA00285 for ; Mon, 8 Mar 1999 20:49:02 -0600 (CST) (envelope-from snowfox@snowfox.net) Message-ID: <001c01be69d7$634b0aa0$0102a8c0@milk.newtoy.com> From: "SnowFox" To: Subject: dhconfig and two 3C509Bs Date: Mon, 8 Mar 1999 20:49:01 -0600 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.3155.0 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3155.0 Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org I've got two 3Com cards - xl0 and xl1 xl0 is configured for the local network - 192.168/16 xl1 is for a cable modem. When I run "dhclient xl1" to fetch the address, gateway, etc for the second, the first stops working though the second then works. Any idea why the first card would stop working? To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Mon Mar 8 18:58: 6 1999 Delivered-To: freebsd-net@freebsd.org Received: from khavrinen.lcs.mit.edu (khavrinen.lcs.mit.edu [18.24.4.193]) by hub.freebsd.org (Postfix) with ESMTP id F0A8014FE6 for ; Mon, 8 Mar 1999 18:58:02 -0800 (PST) (envelope-from wollman@khavrinen.lcs.mit.edu) Received: (from wollman@localhost) by khavrinen.lcs.mit.edu (8.9.1/8.9.1) id VAA21463; Mon, 8 Mar 1999 21:57:44 -0500 (EST) (envelope-from wollman) Date: Mon, 8 Mar 1999 21:57:44 -0500 (EST) From: Garrett Wollman Message-Id: <199903090257.VAA21463@khavrinen.lcs.mit.edu> To: dg@root.com, net@freebsd.org Subject: TCP Timer scaleability (with patch) Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org One of the problems with the BSD-style TCP is that, for a machine with large numbers of outstanding TCP connections, TCP timer processing can take a significant amount of overhead, and -- what's worse -- often results in an ``avalanache'' of outgoing traffic as many connections trigger some sort of response at the same time. The following patch eliminates much of this behavior. Note that this is still very, very preliminary, but it does look promising -- at least, the TCP connection I'm using right now to type this message is operational. There is still one big chunk missing in this patch, which is the conversion of the RTT estimator and related clunkery to measure in timer ticks rather than slow-timer ticks. Once this is done, it should eliminate all the locations where slow run-time multiplies and divides are done in the patch below. I expect this to have a significant beneficial effect on large servers like wcarchive; for smaller machines, it's probably a bit of a wash: slightly slower TCP over fast links versus much faster retransmission over lossy links. The other thing I'm not quite sure about is where I've found all of the right locations to set t_starttime (the inverse of t_duration in -current TCP). I think it should be set whenever the connection hits or crosses ESTABLISHED, and left zero otherwise, but there may be other places where it is needed. (The old code would increment t_duration in any state other than LISTEN, but I don't think that's right -- some of the T/TCP code, for example, cared about the actual duration, and not how long this particular socket was sitting idle before the connection began.) -GAWollman ------------------------------------ ? tcp.patch ? sys/compile/GENERIC ? sys/compile/FORLENNH Index: sys/net/if_vlan.c =================================================================== RCS file: /home/cvs/src/sys/net/if_vlan.c,v retrieving revision 1.4 diff -u -r1.4 if_vlan.c --- if_vlan.c 1998/12/04 22:54:52 1.4 +++ if_vlan.c 1999/03/09 02:09:58 @@ -48,7 +48,9 @@ #include #include +#include #include +#include #include #include #include @@ -69,6 +71,7 @@ #include #endif +SYSCTL_DECL(_net_link); /* XXX */ SYSCTL_NODE(_net_link, IFT_8021_VLAN, vlan, CTLFLAG_RW, 0, "IEEE 802.1Q VLAN"); SYSCTL_NODE(_net_link_vlan, PF_LINK, link, CTLFLAG_RW, 0, "for consistency"); Index: sys/netinet/tcp_input.c =================================================================== RCS file: /home/cvs/src/sys/netinet/tcp_input.c,v retrieving revision 1.84 diff -u -r1.84 tcp_input.c --- tcp_input.c 1999/02/06 00:47:45 1.84 +++ tcp_input.c 1999/03/09 02:10:08 @@ -491,9 +491,9 @@ * Segment received on connection. * Reset idle time and keep-alive timer. */ - tp->t_idle = 0; + tp->t_rcvtime = ticks; if (TCPS_HAVEESTABLISHED(tp->t_state)) - tp->t_timer[TCPT_KEEP] = tcp_keepidle; + callout_reset(tp->tt_keep, tcp_keepidle, tcp_timer_keep, tp); /* * Process options if not in LISTEN state, @@ -559,9 +559,11 @@ if ((to.to_flag & TOF_TS) != 0) tcp_xmit_timer(tp, tcp_now - to.to_tsecr + 1); - else if (tp->t_rtt && + else if (tp->t_rtttime && SEQ_GT(ti->ti_ack, tp->t_rtseq)) - tcp_xmit_timer(tp, tp->t_rtt); + tcp_xmit_timer(tp, 1 + + TCPT_SLOWHZ(ticks + - tp->t_rtttime)); acked = ti->ti_ack - tp->snd_una; tcpstat.tcps_rcvackpack++; tcpstat.tcps_rcvackbyte += acked; @@ -579,9 +581,11 @@ * decide between more output or persist. */ if (tp->snd_una == tp->snd_max) - tp->t_timer[TCPT_REXMT] = 0; - else if (tp->t_timer[TCPT_PERSIST] == 0) - tp->t_timer[TCPT_REXMT] = tp->t_rxtcur; + callout_stop(tp->tt_rexmt); + else if (!callout_pending(tp->tt_persist)) + callout_reset(tp->tt_rexmt, + tp->t_rxtcur, + tcp_timer_rexmt, tp); sowwakeup(so); if (so->so_snd.sb_cc) @@ -728,6 +732,7 @@ taop->tao_cc != 0 && CC_GT(to.to_cc, taop->tao_cc)) { taop->tao_cc = to.to_cc; + tp->t_starttime = ticks; tp->t_state = TCPS_ESTABLISHED; /* @@ -751,7 +756,8 @@ tp->rcv_adv += min(tp->rcv_wnd, TCP_MAXWIN); tcpstat.tcps_connects++; soisconnected(so); - tp->t_timer[TCPT_KEEP] = tcp_keepinit; + callout_reset(tp->tt_keep, tcp_keepinit, + tcp_timer_keep, tp); dropsocket = 0; /* committed to socket */ tcpstat.tcps_accepts++; goto trimthenstep6; @@ -770,7 +776,7 @@ */ tp->t_flags |= TF_ACKNOW; tp->t_state = TCPS_SYN_RECEIVED; - tp->t_timer[TCPT_KEEP] = tcp_keepinit; + callout_reset(tp->tt_keep, tcp_keepinit, tcp_timer_keep, tp); dropsocket = 0; /* committed to socket */ tcpstat.tcps_accepts++; goto trimthenstep6; @@ -878,13 +884,15 @@ * SYN_SENT --> ESTABLISHED * SYN_SENT* --> FIN_WAIT_1 */ + tp->t_starttime = ticks; if (tp->t_flags & TF_NEEDFIN) { tp->t_state = TCPS_FIN_WAIT_1; tp->t_flags &= ~TF_NEEDFIN; tiflags &= ~TH_SYN; } else { tp->t_state = TCPS_ESTABLISHED; - tp->t_timer[TCPT_KEEP] = tcp_keepidle; + callout_reset(tp->tt_keep, tcp_keepidle, + tcp_timer_keep, tp); } } else { /* @@ -897,7 +905,7 @@ * If there was no CC option, clear cached CC value. */ tp->t_flags |= TF_ACKNOW; - tp->t_timer[TCPT_REXMT] = 0; + callout_stop(tp->tt_rexmt); if (to.to_flag & TOF_CC) { if (taop->tao_cc != 0 && CC_GT(to.to_cc, taop->tao_cc)) { @@ -907,12 +915,16 @@ * SYN-SENT* -> FIN-WAIT-1* */ taop->tao_cc = to.to_cc; + tp->t_starttime = ticks; if (tp->t_flags & TF_NEEDFIN) { tp->t_state = TCPS_FIN_WAIT_1; tp->t_flags &= ~TF_NEEDFIN; } else { tp->t_state = TCPS_ESTABLISHED; - tp->t_timer[TCPT_KEEP] = tcp_keepidle; + callout_reset(tp->tt_keep, + tcp_keepidle, + tcp_timer_keep, + tp); } tp->t_flags |= TF_NEEDSYN; } else @@ -971,7 +983,7 @@ if ((tiflags & TH_SYN) && (to.to_flag & TOF_CC) && tp->cc_recv != 0) { if (tp->t_state == TCPS_TIME_WAIT && - tp->t_duration > TCPTV_MSL) + (ticks - tp->t_starttime) > TCPTV_MSL) goto dropwithreset; if (CC_GT(to.to_cc, tp->cc_recv)) { tp = tcp_close(tp); @@ -1287,12 +1299,14 @@ * SYN-RECEIVED -> ESTABLISHED * SYN-RECEIVED* -> FIN-WAIT-1 */ + tp->t_starttime = ticks; if (tp->t_flags & TF_NEEDFIN) { tp->t_state = TCPS_FIN_WAIT_1; tp->t_flags &= ~TF_NEEDFIN; } else { tp->t_state = TCPS_ESTABLISHED; - tp->t_timer[TCPT_KEEP] = tcp_keepidle; + callout_reset(tp->tt_keep, tcp_keepidle, + tcp_timer_keep, tp); } /* * If segment contains data or ACK, will call tcp_reass() @@ -1347,7 +1361,7 @@ * to keep a constant cwnd packets in the * network. */ - if (tp->t_timer[TCPT_REXMT] == 0 || + if (!callout_pending(tp->tt_rexmt) || ti->ti_ack != tp->snd_una) tp->t_dupacks = 0; else if (++tp->t_dupacks == tcprexmtthresh) { @@ -1359,8 +1373,8 @@ if (win < 2) win = 2; tp->snd_ssthresh = win * tp->t_maxseg; - tp->t_timer[TCPT_REXMT] = 0; - tp->t_rtt = 0; + callout_stop(tp->tt_rexmt); + tp->t_rtttime = 0; tp->snd_nxt = ti->ti_ack; tp->snd_cwnd = tp->t_maxseg; (void) tcp_output(tp); @@ -1428,8 +1442,9 @@ */ if (to.to_flag & TOF_TS) tcp_xmit_timer(tp, tcp_now - to.to_tsecr + 1); - else if (tp->t_rtt && SEQ_GT(ti->ti_ack, tp->t_rtseq)) - tcp_xmit_timer(tp,tp->t_rtt); + else if (tp->t_rtttime && SEQ_GT(ti->ti_ack, tp->t_rtseq)) + tcp_xmit_timer(tp, + 1 + TCPT_SLOWHZ(ticks - tp->t_rtttime)); /* * If all outstanding data is acked, stop retransmit @@ -1438,10 +1453,11 @@ * timer, using current (possibly backed-off) value. */ if (ti->ti_ack == tp->snd_max) { - tp->t_timer[TCPT_REXMT] = 0; + callout_stop(tp->tt_rexmt); needoutput = 1; - } else if (tp->t_timer[TCPT_PERSIST] == 0) - tp->t_timer[TCPT_REXMT] = tp->t_rxtcur; + } else if (!callout_pending(tp->tt_persist)) + callout_reset(tp->tt_rexmt, tp->t_rxtcur, + tcp_timer_rexmt, tp); /* * If no data (only SYN) was ACK'd, @@ -1497,7 +1513,8 @@ */ if (so->so_state & SS_CANTRCVMORE) { soisdisconnected(so); - tp->t_timer[TCPT_2MSL] = tcp_maxidle; + callout_reset(tp->tt_2msl, tcp_maxidle, + tcp_timer_2msl, tp); } tp->t_state = TCPS_FIN_WAIT_2; } @@ -1515,11 +1532,14 @@ tcp_canceltimers(tp); /* Shorten TIME_WAIT [RFC-1644, p.28] */ if (tp->cc_recv != 0 && - tp->t_duration < TCPTV_MSL) - tp->t_timer[TCPT_2MSL] = - tp->t_rxtcur * TCPTV_TWTRUNC; + (ticks - tp->t_starttime) < TCPTV_MSL) + callout_reset(tp->tt_2msl, + tp->t_rxtcur * + TCPTV_TWTRUNC, + tcp_timer_2msl, tp); else - tp->t_timer[TCPT_2MSL] = 2 * TCPTV_MSL; + callout_reset(tp->tt_2msl, 2*TCPTV_MSL, + tcp_timer_2msl, tp); soisdisconnected(so); } break; @@ -1543,7 +1563,8 @@ * it and restart the finack timer. */ case TCPS_TIME_WAIT: - tp->t_timer[TCPT_2MSL] = 2 * TCPTV_MSL; + callout_reset(tp->tt_2msl, 2 * TCPTV_MSL, + tcp_timer_2msl, tp); goto dropafterack; } } @@ -1679,6 +1700,7 @@ * enter the CLOSE_WAIT state. */ case TCPS_SYN_RECEIVED: + tp->t_starttime = ticks; case TCPS_ESTABLISHED: tp->t_state = TCPS_CLOSE_WAIT; break; @@ -1701,14 +1723,16 @@ tcp_canceltimers(tp); /* Shorten TIME_WAIT [RFC-1644, p.28] */ if (tp->cc_recv != 0 && - tp->t_duration < TCPTV_MSL) { - tp->t_timer[TCPT_2MSL] = - tp->t_rxtcur * TCPTV_TWTRUNC; + (ticks - tp->t_starttime) < TCPTV_MSL) { + callout_reset(tp->tt_2msl, + tp->t_rxtcur * TCPTV_TWTRUNC, + tcp_timer_2msl, tp); /* For transaction client, force ACK now. */ tp->t_flags |= TF_ACKNOW; } else - tp->t_timer[TCPT_2MSL] = 2 * TCPTV_MSL; + callout_reset(tp->tt_2msl, 2 * TCPTV_MSL, + tcp_timer_2msl, tp); soisdisconnected(so); break; @@ -1716,7 +1740,8 @@ * In TIME_WAIT state restart the 2 MSL time_wait timer. */ case TCPS_TIME_WAIT: - tp->t_timer[TCPT_2MSL] = 2 * TCPTV_MSL; + callout_reset(tp->tt_2msl, 2 * TCPTV_MSL, + tcp_timer_2msl, tp); break; } } @@ -1997,7 +2022,7 @@ tp->t_srtt = rtt << TCP_RTT_SHIFT; tp->t_rttvar = rtt << (TCP_RTTVAR_SHIFT - 1); } - tp->t_rtt = 0; + tp->t_rtttime = 0; tp->t_rxtshift = 0; /* @@ -2011,8 +2036,12 @@ * statistical, we have to test that we don't drop below * the minimum feasible timer (which is 2 ticks). */ - TCPT_RANGESET(tp->t_rxtcur, TCP_REXMTVAL(tp), - max(tp->t_rttmin, rtt + 2), TCPTV_REXMTMAX); + { + int newrxt; + TCPT_RANGESET(newrxt, TCP_REXMTVAL(tp), + max(tp->t_rttmin, rtt + 2), TCPTV_REXMTMAX); + tp->t_rxtcur = TCPT_TICKS(newrxt); + } /* * We received an ack for a packet that wasn't retransmitted; @@ -2119,10 +2148,14 @@ /* default variation is +- 1 rtt */ tp->t_rttvar = tp->t_srtt * TCP_RTTVAR_SCALE / TCP_RTT_SCALE; + } + { + int newrxt; + TCPT_RANGESET(newrxt, + ((tp->t_srtt >> 2) + tp->t_rttvar) >> 1, + tp->t_rttmin, TCPTV_REXMTMAX); + tp->t_rxtcur = TCPT_TICKS(newrxt); } - TCPT_RANGESET(tp->t_rxtcur, - ((tp->t_srtt >> 2) + tp->t_rttvar) >> 1, - tp->t_rttmin, TCPTV_REXMTMAX); } /* * if there's an mtu associated with the route, use it Index: sys/netinet/tcp_output.c =================================================================== RCS file: /home/cvs/src/sys/netinet/tcp_output.c,v retrieving revision 1.32 diff -u -r1.32 tcp_output.c --- tcp_output.c 1999/01/20 17:31:59 1.32 +++ tcp_output.c 1999/03/09 02:10:11 @@ -40,6 +40,7 @@ #include #include +#include #include #include #include @@ -93,7 +94,7 @@ * to send, then transmit; otherwise, investigate further. */ idle = (tp->snd_max == tp->snd_una); - if (idle && tp->t_idle >= tp->t_rxtcur) + if (idle && (ticks - tp->t_rcvtime) >= tp->t_rxtcur) /* * We have been idle for "a while" and no acks are * expected to clock out any data we send -- @@ -143,7 +144,7 @@ flags &= ~TH_FIN; win = 1; } else { - tp->t_timer[TCPT_PERSIST] = 0; + callout_stop(tp->tt_persist); tp->t_rxtshift = 0; } } @@ -194,10 +195,10 @@ */ len = 0; if (win == 0) { - tp->t_timer[TCPT_REXMT] = 0; + callout_stop(tp->tt_rexmt); tp->t_rxtshift = 0; tp->snd_nxt = tp->snd_una; - if (tp->t_timer[TCPT_PERSIST] == 0) + if (!callout_pending(tp->tt_persist)) tcp_setpersist(tp); } } @@ -285,11 +286,11 @@ * persisting to move a small or zero window * (re)transmitting and thereby not persisting * - * tp->t_timer[TCPT_PERSIST] - * is set when we are in persist state. + * callout_pending(tp->tt_persist) + * is true when we are in persist state. * tp->t_force * is set when we are called to send a persist packet. - * tp->t_timer[TCPT_REXMT] + * callout_pending(tp->tt_rexmt) * is set when we are retransmitting * The output side is idle when both timers are zero. * @@ -299,8 +300,8 @@ * if window is nonzero, transmit what we can, * otherwise force out a byte. */ - if (so->so_snd.sb_cc && tp->t_timer[TCPT_REXMT] == 0 && - tp->t_timer[TCPT_PERSIST] == 0) { + if (so->so_snd.sb_cc && !callout_pending(tp->tt_rexmt) && + !callout_pending(tp->tt_persist)) { tp->t_rxtshift = 0; tcp_setpersist(tp); } @@ -563,7 +564,8 @@ * case, since we know we aren't doing a retransmission. * (retransmit and persist are mutually exclusive...) */ - if (len || (flags & (TH_SYN|TH_FIN)) || tp->t_timer[TCPT_PERSIST]) + if (len || (flags & (TH_SYN|TH_FIN)) + || callout_pending(tp->tt_persist)) ti->ti_seq = htonl(tp->snd_nxt); else ti->ti_seq = htonl(tp->snd_max); @@ -609,7 +611,7 @@ * In transmit state, time the transmission and arrange for * the retransmit. In persist state, just set snd_max. */ - if (tp->t_force == 0 || tp->t_timer[TCPT_PERSIST] == 0) { + if (tp->t_force == 0 || !callout_pending(tp->tt_persist)) { tcp_seq startseq = tp->snd_nxt; /* @@ -630,8 +632,8 @@ * Time this transmission if not a retransmission and * not currently timing anything. */ - if (tp->t_rtt == 0) { - tp->t_rtt = 1; + if (tp->t_rtttime == 0) { + tp->t_rtttime = ticks; tp->t_rtseq = startseq; tcpstat.tcps_segstimed++; } @@ -645,11 +647,12 @@ * Initialize shift counter which is used for backoff * of retransmit time. */ - if (tp->t_timer[TCPT_REXMT] == 0 && + if (!callout_pending(tp->tt_rexmt) && tp->snd_nxt != tp->snd_una) { - tp->t_timer[TCPT_REXMT] = tp->t_rxtcur; - if (tp->t_timer[TCPT_PERSIST]) { - tp->t_timer[TCPT_PERSIST] = 0; + callout_reset(tp->tt_rexmt, tp->t_rxtcur, + tcp_timer_rexmt, tp); + if (callout_pending(tp->tt_persist)) { + callout_stop(tp->tt_persist); tp->t_rxtshift = 0; } } @@ -742,16 +745,17 @@ tcp_setpersist(tp) register struct tcpcb *tp; { - register int t = ((tp->t_srtt >> 2) + tp->t_rttvar) >> 1; + int t = ((tp->t_srtt >> 2) + tp->t_rttvar) >> 1; + int tt; - if (tp->t_timer[TCPT_REXMT]) - panic("tcp_output REXMT"); + if (callout_pending(tp->tt_rexmt)) + panic("tcp_setpersist: retransmit pending"); /* * Start/restart persistance timer. */ - TCPT_RANGESET(tp->t_timer[TCPT_PERSIST], - t * tcp_backoff[tp->t_rxtshift], - TCPTV_PERSMIN, TCPTV_PERSMAX); + TCPT_RANGESET(tt, t * tcp_backoff[tp->t_rxtshift], + TCPTV_PERSMIN, TCPTV_PERSMAX); + callout_reset(tp->tt_persist, TCPT_TICKS(tt), tcp_timer_persist, tp); if (tp->t_rxtshift < TCP_MAXRXTSHIFT) tp->t_rxtshift++; } Index: sys/netinet/tcp_subr.c =================================================================== RCS file: /home/cvs/src/sys/netinet/tcp_subr.c,v retrieving revision 1.52 diff -u -r1.52 tcp_subr.c --- tcp_subr.c 1999/02/04 03:27:43 1.52 +++ tcp_subr.c 1999/03/09 02:10:14 @@ -39,13 +39,14 @@ #include #include +#include #include -#include #include #include +#include #include #include -#include +#include #include @@ -117,6 +118,7 @@ char align[(sizeof(struct inpcb) + ALIGNM1) & ~ALIGNM1]; } inp_tp_u; struct tcpcb tcb; + struct callout inp_tp_rexmt, inp_tp_persist, inp_tp_keep, inp_tp_2msl; }; #undef ALIGNMENT #undef ALIGNM1 @@ -132,6 +134,12 @@ tcp_iss = random(); /* wrong, but better than a constant */ tcp_ccgen = 1; tcp_cleartaocache(); + + tcp_keepinit = TCPTV_KEEP_INIT; + tcp_keepidle = TCPTV_KEEP_IDLE; + tcp_keepintvl = TCPTV_KEEPINTVL; + tcp_maxpersistidle = TCPTV_KEEP_IDLE; + LIST_INIT(&tcb); tcbinfo.listhead = &tcb; if (!(getenv_int("net.inet.tcp.tcbhashsize", &hashsize))) @@ -145,6 +153,7 @@ &tcbinfo.porthashmask); tcbinfo.ipi_zone = zinit("tcpcb", sizeof(struct inp_tp), maxsockets, ZONE_INTERRUPT, 0); + if (max_protohdr < sizeof(struct tcpiphdr)) max_protohdr = sizeof(struct tcpiphdr); if (max_linkhdr + sizeof(struct tcpiphdr) > MHLEN) @@ -299,6 +308,12 @@ tp->t_segq = NULL; tp->t_maxseg = tp->t_maxopd = tcp_mssdflt; + /* Set up our timeouts. */ + callout_init(tp->tt_rexmt = &it->inp_tp_rexmt); + callout_init(tp->tt_persist = &it->inp_tp_persist); + callout_init(tp->tt_keep = &it->inp_tp_keep); + callout_init(tp->tt_2msl = &it->inp_tp_2msl); + if (tcp_do_rfc1323) tp->t_flags = (TF_REQ_SCALE|TF_REQ_TSTMP); if (tcp_do_rfc1644) @@ -312,7 +327,7 @@ tp->t_srtt = TCPTV_SRTTBASE; tp->t_rttvar = ((TCPTV_RTOBASE - TCPTV_SRTTBASE) << TCP_RTTVAR_SHIFT) / 4; tp->t_rttmin = TCPTV_MIN; - tp->t_rxtcur = TCPTV_RTOBASE; + tp->t_rxtcur = TCPT_TICKS(TCPTV_RTOBASE); tp->snd_cwnd = TCP_MAXWIN << TCP_MAX_WINSHIFT; tp->snd_ssthresh = TCP_MAXWIN << TCP_MAX_WINSHIFT; inp->inp_ip_ttl = ip_defttl; @@ -362,6 +377,15 @@ int dosavessthresh; /* + * Make sure that all of our timers are stopped before we + * delete the PCB. + */ + callout_stop(tp->tt_rexmt); + callout_stop(tp->tt_persist); + callout_stop(tp->tt_keep); + callout_stop(tp->tt_2msl); + + /* * If we got enough samples through the srtt filter, * save the rtt and rttvar in the routing entry. * 'Enough' is arbitrarily defined as the 16 samples. @@ -693,7 +717,7 @@ tp->t_maxseg = mss; tcpstat.tcps_mturesent++; - tp->t_rtt = 0; + tp->t_rtttime = 0; tp->snd_nxt = tp->snd_una; tcp_output(tp); } Index: sys/netinet/tcp_timer.c =================================================================== RCS file: /home/cvs/src/sys/netinet/tcp_timer.c,v retrieving revision 1.28 diff -u -r1.28 tcp_timer.c --- tcp_timer.c 1998/04/24 09:25:35 1.28 +++ tcp_timer.c 1999/03/09 02:10:15 @@ -63,15 +63,15 @@ #include #endif -int tcp_keepinit = TCPTV_KEEP_INIT; +int tcp_keepinit; SYSCTL_INT(_net_inet_tcp, TCPCTL_KEEPINIT, keepinit, CTLFLAG_RW, &tcp_keepinit , 0, ""); -int tcp_keepidle = TCPTV_KEEP_IDLE; +int tcp_keepidle; SYSCTL_INT(_net_inet_tcp, TCPCTL_KEEPIDLE, keepidle, CTLFLAG_RW, &tcp_keepidle , 0, ""); -static int tcp_keepintvl = TCPTV_KEEPINTVL; +int tcp_keepintvl; SYSCTL_INT(_net_inet_tcp, TCPCTL_KEEPINTVL, keepintvl, CTLFLAG_RW, &tcp_keepintvl , 0, ""); @@ -81,7 +81,7 @@ static int tcp_keepcnt = TCPTV_KEEPCNT; /* max idle probes */ -static int tcp_maxpersistidle = TCPTV_KEEP_IDLE; +int tcp_maxpersistidle; /* max idle time in persist */ int tcp_maxidle; @@ -120,7 +120,6 @@ { register struct inpcb *ip, *ipnxt; register struct tcpcb *tp; - register int i; int s; #ifdef TCPDEBUG int ostate; @@ -143,29 +142,6 @@ tp = intotcpcb(ip); if (tp == 0 || tp->t_state == TCPS_LISTEN) continue; - for (i = 0; i < TCPT_NTIMERS; i++) { - if (tp->t_timer[i] && --tp->t_timer[i] == 0) { -#ifdef TCPDEBUG - ostate = tp->t_state; -#endif - tp = tcp_timers(tp, i); - if (tp == NULL) - goto tpgone; -#ifdef TCPDEBUG - if (tp->t_inpcb->inp_socket->so_options - & SO_DEBUG) - tcp_trace(TA_USER, ostate, tp, - (struct tcpiphdr *)0, - PRU_SLOWTIMO); -#endif - } - } - tp->t_idle++; - tp->t_duration++; - if (tp->t_rtt) - tp->t_rtt++; -tpgone: - ; } tcp_iss += TCP_ISSINCR/PR_SLOWHZ; /* increment iss */ #ifdef TCP_COMPAT_42 @@ -183,10 +159,10 @@ tcp_canceltimers(tp) struct tcpcb *tp; { - register int i; - - for (i = 0; i < TCPT_NTIMERS; i++) - tp->t_timer[i] = 0; + callout_stop(tp->tt_2msl); + callout_stop(tp->tt_persist); + callout_stop(tp->tt_keep); + callout_stop(tp->tt_rexmt); } int tcp_backoff[TCP_MAXRXTSHIFT + 1] = @@ -197,175 +173,242 @@ /* * TCP timer processing. */ -struct tcpcb * -tcp_timers(tp, timer) - register struct tcpcb *tp; - int timer; -{ - register int rexmt; - switch (timer) { +void +tcp_timer_2msl(xtp) + void *xtp; +{ + struct tcpcb *tp = xtp; +#ifdef TCPDEBUG + int ostate; + ostate = tp->t_state; +#endif /* * 2 MSL timeout in shutdown went off. If we're closed but * still waiting for peer to close and connection has been idle * too long, or if 2MSL time is up from TIME_WAIT, delete connection * control block. Otherwise, check again in a bit. */ - case TCPT_2MSL: - if (tp->t_state != TCPS_TIME_WAIT && - tp->t_idle <= tcp_maxidle) - tp->t_timer[TCPT_2MSL] = tcp_keepintvl; - else - tp = tcp_close(tp); - break; + if (tp->t_state != TCPS_TIME_WAIT && + (ticks - tp->t_rcvtime) <= tcp_maxidle) + callout_reset(tp->tt_2msl, tcp_keepintvl, + tcp_timer_2msl, tp); + else + tp = tcp_close(tp); +#ifdef TCPDEBUG + if (tp && (tp->t_inpcb->inp_socket->so_options & SO_DEBUG)) + tcp_trace(TA_USER, ostate, tp, (struct tcpiphdr *)0, + PRU_SLOWTIMO); +#endif +} + +void +tcp_timer_keep(xtp) + void *xtp; +{ + struct tcpcb *tp = xtp; +#ifdef TCPDEBUG + int ostate; + + ostate = tp->t_state; +#endif /* - * Retransmission timer went off. Message has not - * been acked within retransmit interval. Back off - * to a longer retransmit interval and retransmit one segment. + * Keep-alive timer went off; send something + * or drop connection if idle for too long. */ - case TCPT_REXMT: - if (++tp->t_rxtshift > TCP_MAXRXTSHIFT) { - tp->t_rxtshift = TCP_MAXRXTSHIFT; - tcpstat.tcps_timeoutdrop++; - tp = tcp_drop(tp, tp->t_softerror ? - tp->t_softerror : ETIMEDOUT); - break; - } - tcpstat.tcps_rexmttimeo++; - rexmt = TCP_REXMTVAL(tp) * tcp_backoff[tp->t_rxtshift]; - TCPT_RANGESET(tp->t_rxtcur, rexmt, - tp->t_rttmin, TCPTV_REXMTMAX); - tp->t_timer[TCPT_REXMT] = tp->t_rxtcur; - /* - * If losing, let the lower level know and try for - * a better route. Also, if we backed off this far, - * our srtt estimate is probably bogus. Clobber it - * so we'll take the next rtt measurement as our srtt; - * move the current srtt into rttvar to keep the current - * retransmit times until then. - */ - if (tp->t_rxtshift > TCP_MAXRXTSHIFT / 4) { - in_losing(tp->t_inpcb); - tp->t_rttvar += (tp->t_srtt >> TCP_RTT_SHIFT); - tp->t_srtt = 0; - } - tp->snd_nxt = tp->snd_una; - /* - * Force a segment to be sent. - */ - tp->t_flags |= TF_ACKNOW; + tcpstat.tcps_keeptimeo++; + if (tp->t_state < TCPS_ESTABLISHED) + goto dropit; + if ((always_keepalive || + tp->t_inpcb->inp_socket->so_options & SO_KEEPALIVE) && + tp->t_state <= TCPS_CLOSING) { + if ((ticks - tp->t_rcvtime) >= tcp_keepidle + tcp_maxidle) + goto dropit; /* - * If timing a segment in this window, stop the timer. + * Send a packet designed to force a response + * if the peer is up and reachable: + * either an ACK if the connection is still alive, + * or an RST if the peer has closed the connection + * due to timeout or reboot. + * Using sequence number tp->snd_una-1 + * causes the transmitted zero-length segment + * to lie outside the receive window; + * by the protocol spec, this requires the + * correspondent TCP to respond. */ - tp->t_rtt = 0; + tcpstat.tcps_keepprobe++; +#ifdef TCP_COMPAT_42 /* - * Close the congestion window down to one segment - * (we'll open it by one segment for each ack we get). - * Since we probably have a window's worth of unacked - * data accumulated, this "slow start" keeps us from - * dumping all that data as back-to-back packets (which - * might overwhelm an intermediate gateway). - * - * There are two phases to the opening: Initially we - * open by one mss on each ack. This makes the window - * size increase exponentially with time. If the - * window is larger than the path can handle, this - * exponential growth results in dropped packet(s) - * almost immediately. To get more time between - * drops but still "push" the network to take advantage - * of improving conditions, we switch from exponential - * to linear window opening at some threshhold size. - * For a threshhold, we use half the current window - * size, truncated to a multiple of the mss. - * - * (the minimum cwnd that will give us exponential - * growth is 2 mss. We don't allow the threshhold - * to go below this.) + * The keepalive packet must have nonzero length + * to get a 4.2 host to respond. */ - { - u_int win = min(tp->snd_wnd, tp->snd_cwnd) / 2 / tp->t_maxseg; - if (win < 2) - win = 2; - tp->snd_cwnd = tp->t_maxseg; - tp->snd_ssthresh = win * tp->t_maxseg; - tp->t_dupacks = 0; - } - (void) tcp_output(tp); - break; + tcp_respond(tp, tp->t_template, (struct mbuf *)NULL, + tp->rcv_nxt - 1, tp->snd_una - 1, 0); +#else + tcp_respond(tp, tp->t_template, (struct mbuf *)NULL, + tp->rcv_nxt, tp->snd_una - 1, 0); +#endif + callout_reset(tp->tt_keep, tcp_keepintvl, tcp_timer_keep, tp); + } else + callout_reset(tp->tt_keep, tcp_keepidle, tcp_timer_keep, tp); + +#ifdef TCPDEBUG + if (tp->t_inpcb->inp_socket->so_options & SO_DEBUG) + tcp_trace(TA_USER, ostate, tp, (struct tcpiphdr *)0, + PRU_SLOWTIMO); +#endif + return; + +dropit: + tcpstat.tcps_keepdrops++; + tp = tcp_drop(tp, ETIMEDOUT); +#ifdef TCPDEBUG + if (tp && (tp->t_inpcb->inp_socket->so_options & SO_DEBUG)) + tcp_trace(TA_USER, ostate, tp, (struct tcpiphdr *)0, + PRU_SLOWTIMO); +#endif +} + +void +tcp_timer_persist(xtp) + void *xtp; +{ + struct tcpcb *tp = xtp; +#ifdef TCPDEBUG + int ostate; + + ostate = tp->t_state; +#endif + /* * Persistance timer into zero window. * Force a byte to be output, if possible. */ - case TCPT_PERSIST: - tcpstat.tcps_persisttimeo++; - /* - * Hack: if the peer is dead/unreachable, we do not - * time out if the window is closed. After a full - * backoff, drop the connection if the idle time - * (no responses to probes) reaches the maximum - * backoff that we would use if retransmitting. - */ - if (tp->t_rxtshift == TCP_MAXRXTSHIFT && - (tp->t_idle >= tcp_maxpersistidle || - tp->t_idle >= TCP_REXMTVAL(tp) * tcp_totbackoff)) { - tcpstat.tcps_persistdrop++; - tp = tcp_drop(tp, ETIMEDOUT); - break; - } - tcp_setpersist(tp); - tp->t_force = 1; - (void) tcp_output(tp); - tp->t_force = 0; - break; - + tcpstat.tcps_persisttimeo++; /* - * Keep-alive timer went off; send something - * or drop connection if idle for too long. + * Hack: if the peer is dead/unreachable, we do not + * time out if the window is closed. After a full + * backoff, drop the connection if the idle time + * (no responses to probes) reaches the maximum + * backoff that we would use if retransmitting. */ - case TCPT_KEEP: - tcpstat.tcps_keeptimeo++; - if (tp->t_state < TCPS_ESTABLISHED) - goto dropit; - if ((always_keepalive || - tp->t_inpcb->inp_socket->so_options & SO_KEEPALIVE) && - tp->t_state <= TCPS_CLOSING) { - if (tp->t_idle >= tcp_keepidle + tcp_maxidle) - goto dropit; - /* - * Send a packet designed to force a response - * if the peer is up and reachable: - * either an ACK if the connection is still alive, - * or an RST if the peer has closed the connection - * due to timeout or reboot. - * Using sequence number tp->snd_una-1 - * causes the transmitted zero-length segment - * to lie outside the receive window; - * by the protocol spec, this requires the - * correspondent TCP to respond. - */ - tcpstat.tcps_keepprobe++; -#ifdef TCP_COMPAT_42 - /* - * The keepalive packet must have nonzero length - * to get a 4.2 host to respond. - */ - tcp_respond(tp, tp->t_template, (struct mbuf *)NULL, - tp->rcv_nxt - 1, tp->snd_una - 1, 0); -#else - tcp_respond(tp, tp->t_template, (struct mbuf *)NULL, - tp->rcv_nxt, tp->snd_una - 1, 0); -#endif - tp->t_timer[TCPT_KEEP] = tcp_keepintvl; - } else - tp->t_timer[TCPT_KEEP] = tcp_keepidle; - break; - dropit: - tcpstat.tcps_keepdrops++; + if (tp->t_rxtshift == TCP_MAXRXTSHIFT && + ((ticks - tp->t_rcvtime) >= tcp_maxpersistidle || + (ticks - tp->t_rcvtime) + >= TCPT_TICKS(TCP_REXMTVAL(tp) * tcp_totbackoff))) { + tcpstat.tcps_persistdrop++; tp = tcp_drop(tp, ETIMEDOUT); - break; + goto out; + } + tcp_setpersist(tp); + tp->t_force = 1; + (void) tcp_output(tp); + tp->t_force = 0; + +out: +#ifdef TCPDEBUG + if (tp->t_inpcb->inp_socket->so_options & SO_DEBUG) + tcp_trace(TA_USER, ostate, tp, (struct tcpiphdr *)0, + PRU_SLOWTIMO); +#endif +} + +void +tcp_timer_rexmt(xtp) + void *xtp; +{ + struct tcpcb *tp = xtp; + int rexmt; +#ifdef TCPDEBUG + int ostate; + + ostate = tp->t_state; +#endif + + /* + * Retransmission timer went off. Message has not + * been acked within retransmit interval. Back off + * to a longer retransmit interval and retransmit one segment. + */ + if (++tp->t_rxtshift > TCP_MAXRXTSHIFT) { + tp->t_rxtshift = TCP_MAXRXTSHIFT; + tcpstat.tcps_timeoutdrop++; + tp = tcp_drop(tp, tp->t_softerror ? + tp->t_softerror : ETIMEDOUT); + goto out; + } + tcpstat.tcps_rexmttimeo++; + rexmt = TCP_REXMTVAL(tp) * tcp_backoff[tp->t_rxtshift]; + { + int newrxt; + TCPT_RANGESET(newrxt, rexmt, + tp->t_rttmin, TCPTV_REXMTMAX); + tp->t_rxtcur = TCPT_TICKS(newrxt); + callout_reset(tp->tt_rexmt, tp->t_rxtcur, tcp_timer_rexmt, tp); + } + /* + * If losing, let the lower level know and try for + * a better route. Also, if we backed off this far, + * our srtt estimate is probably bogus. Clobber it + * so we'll take the next rtt measurement as our srtt; + * move the current srtt into rttvar to keep the current + * retransmit times until then. + */ + if (tp->t_rxtshift > TCP_MAXRXTSHIFT / 4) { + in_losing(tp->t_inpcb); + tp->t_rttvar += (tp->t_srtt >> TCP_RTT_SHIFT); + tp->t_srtt = 0; + } + tp->snd_nxt = tp->snd_una; + /* + * Force a segment to be sent. + */ + tp->t_flags |= TF_ACKNOW; + /* + * If timing a segment in this window, stop the timer. + */ + tp->t_rtttime = 0; + /* + * Close the congestion window down to one segment + * (we'll open it by one segment for each ack we get). + * Since we probably have a window's worth of unacked + * data accumulated, this "slow start" keeps us from + * dumping all that data as back-to-back packets (which + * might overwhelm an intermediate gateway). + * + * There are two phases to the opening: Initially we + * open by one mss on each ack. This makes the window + * size increase exponentially with time. If the + * window is larger than the path can handle, this + * exponential growth results in dropped packet(s) + * almost immediately. To get more time between + * drops but still "push" the network to take advantage + * of improving conditions, we switch from exponential + * to linear window opening at some threshhold size. + * For a threshhold, we use half the current window + * size, truncated to a multiple of the mss. + * + * (the minimum cwnd that will give us exponential + * growth is 2 mss. We don't allow the threshhold + * to go below this.) + */ + { + u_int win = min(tp->snd_wnd, tp->snd_cwnd) / 2 / tp->t_maxseg; + if (win < 2) + win = 2; + tp->snd_cwnd = tp->t_maxseg; + tp->snd_ssthresh = win * tp->t_maxseg; + tp->t_dupacks = 0; } - return (tp); + (void) tcp_output(tp); + +out: +#ifdef TCPDEBUG + if (tp && (tp->t_inpcb->inp_socket->so_options & SO_DEBUG)) + tcp_trace(TA_USER, ostate, tp, (struct tcpiphdr *)0, + PRU_SLOWTIMO); +#endif } Index: sys/netinet/tcp_timer.h =================================================================== RCS file: /home/cvs/src/sys/netinet/tcp_timer.h,v retrieving revision 1.13 diff -u -r1.13 tcp_timer.h --- tcp_timer.h 1997/09/07 05:26:48 1.13 +++ tcp_timer.h 1999/03/09 02:10:16 @@ -38,17 +38,6 @@ #define _NETINET_TCP_TIMER_H_ /* - * Definitions of the TCP timers. These timers are counted - * down PR_SLOWHZ times a second. - */ -#define TCPT_NTIMERS 4 - -#define TCPT_REXMT 0 /* retransmit */ -#define TCPT_PERSIST 1 /* retransmit persistence */ -#define TCPT_KEEP 2 /* keep alive */ -#define TCPT_2MSL 3 /* 2*msl quiet time timer */ - -/* * The TCPT_REXMT timer is used to force retransmissions. * The TCP has the TCPT_REXMT timer set whenever segments * have been sent for which ACKs are expected but not yet @@ -87,7 +76,7 @@ /* * Time constants. */ -#define TCPTV_MSL ( 30*PR_SLOWHZ) /* max seg lifetime (hah!) */ +#define TCPTV_MSL ( 30*hz) /* max seg lifetime (hah!) */ #define TCPTV_SRTTBASE 0 /* base roundtrip time; if 0, no idea yet */ #define TCPTV_RTOBASE ( 3*PR_SLOWHZ) /* assumed RTO if no info */ @@ -96,9 +85,9 @@ #define TCPTV_PERSMIN ( 5*PR_SLOWHZ) /* retransmit persistence */ #define TCPTV_PERSMAX ( 60*PR_SLOWHZ) /* maximum persist interval */ -#define TCPTV_KEEP_INIT ( 75*PR_SLOWHZ) /* initial connect keep alive */ -#define TCPTV_KEEP_IDLE (120*60*PR_SLOWHZ) /* dflt time before probing */ -#define TCPTV_KEEPINTVL ( 75*PR_SLOWHZ) /* default probe interval */ +#define TCPTV_KEEP_INIT ( 75*hz) /* initial connect keepalive */ +#define TCPTV_KEEP_IDLE (120*60*hz) /* dflt time before probing */ +#define TCPTV_KEEPINTVL ( 75*hz) /* default probe interval */ #define TCPTV_KEEPCNT 8 /* max probes before drop */ #define TCPTV_MIN ( 1*PR_SLOWHZ) /* minimum allowable value */ @@ -118,20 +107,36 @@ /* * Force a time value to be in a certain range. */ -#define TCPT_RANGESET(tv, value, tvmin, tvmax) { \ +#define TCPT_RANGESET(tv, value, tvmin, tvmax) do { \ (tv) = (value); \ if ((u_long)(tv) < (u_long)(tvmin)) \ (tv) = (tvmin); \ else if ((u_long)(tv) > (u_long)(tvmax)) \ (tv) = (tvmax); \ -} +} while(0) +/* + * Convert slow-timeout ticks to timer ticks. We don't really want to do + * this as it is rather expensive, so this is only a transitional stage + * until we are able to update all the code which counts timer ticks. + */ +#define TCPT_TICKS(stt) ((stt) * hz / PR_SLOWHZ) +#define TCPT_SLOWHZ(tt) (((tt) * PR_SLOWHZ) / hz) + #ifdef KERNEL extern int tcp_keepinit; /* time to establish connection */ extern int tcp_keepidle; /* time before keepalive probes begin */ +extern int tcp_keepintvl; /* time between keepalive probes */ extern int tcp_maxidle; /* time to drop after starting probes */ +extern int tcp_maxpersistidle; extern int tcp_ttl; /* time to live for TCP segs */ extern int tcp_backoff[]; -#endif -#endif +void tcp_timer_2msl __P((void *xtp)); +void tcp_timer_keep __P((void *xtp)); +void tcp_timer_persist __P((void *xtp)); +void tcp_timer_rexmt __P((void *xtp)); + +#endif /* KERNEL */ + +#endif /* !_NETINET_TCP_TIMER_H_ */ Index: sys/netinet/tcp_usrreq.c =================================================================== RCS file: /home/cvs/src/sys/netinet/tcp_usrreq.c,v retrieving revision 1.40 diff -u -r1.40 tcp_usrreq.c --- tcp_usrreq.c 1999/01/20 17:31:59 1.40 +++ tcp_usrreq.c 1999/03/09 02:10:18 @@ -514,7 +514,7 @@ if (oinp) { if (oinp != inp && (otp = intotcpcb(oinp)) != NULL && otp->t_state == TCPS_TIME_WAIT && - otp->t_duration < TCPTV_MSL && + (ticks - otp->t_starttime) < TCPTV_MSL && (otp->t_flags & TF_RCVD_CC)) otp = tcp_close(otp); else @@ -540,7 +540,7 @@ soisconnecting(so); tcpstat.tcps_connattempt++; tp->t_state = TCPS_SYN_SENT; - tp->t_timer[TCPT_KEEP] = tcp_keepinit; + callout_reset(tp->tt_keep, tcp_keepinit, tcp_timer_keep, tp); tp->iss = tcp_iss; tcp_iss += TCP_ISSINCR/2; tcp_sendseqinit(tp); @@ -787,7 +787,8 @@ soisdisconnected(tp->t_inpcb->inp_socket); /* To prevent the connection hanging in FIN_WAIT_2 forever. */ if (tp->t_state == TCPS_FIN_WAIT_2) - tp->t_timer[TCPT_2MSL] = tcp_maxidle; + callout_reset(tp->tt_2msl, tcp_maxidle, + tcp_timer_2msl, tp); } return (tp); } Index: sys/netinet/tcp_var.h =================================================================== RCS file: /home/cvs/src/sys/netinet/tcp_var.h,v retrieving revision 1.50 diff -u -r1.50 tcp_var.h --- tcp_var.h 1999/02/16 10:49:52 1.50 +++ tcp_var.h 1999/03/09 02:10:20 @@ -49,7 +49,10 @@ int t_dupacks; /* consecutive dup acks recd */ struct tcpiphdr *t_template; /* skeletal packet for transmit */ - int t_timer[TCPT_NTIMERS]; /* tcp timers */ + struct callout *tt_rexmt; /* retransmit timer */ + struct callout *tt_persist; /* retransmit persistence */ + struct callout *tt_keep; /* keepalive */ + struct callout *tt_2msl; /* 2*msl TIME_WAIT timer */ struct inpcb *t_inpcb; /* back pointer to internet pcb */ int t_state; /* state of this connection */ @@ -98,12 +101,12 @@ */ u_int t_maxopd; /* mss plus options */ - u_int t_idle; /* inactivity time */ - u_long t_duration; /* connection duration */ - int t_rtt; /* round trip time */ + u_long t_rcvtime; /* inactivity time */ + u_long t_starttime; /* time connection was established */ + int t_rtttime; /* round trip time */ tcp_seq t_rtseq; /* sequence number being timed */ - int t_rxtcur; /* current retransmit value */ + int t_rxtcur; /* current retransmit value (ticks) */ u_int t_maxseg; /* maximum segment size */ int t_srtt; /* smoothed round-trip time */ int t_rttvar; /* variance in round-trip time */ Index: sys/sys/callout.h =================================================================== RCS file: /home/cvs/src/sys/sys/callout.h,v retrieving revision 1.12 diff -u -r1.12 callout.h --- callout.h 1999/03/06 04:46:20 1.12 +++ callout.h 1999/03/09 02:10:22 @@ -75,7 +75,8 @@ #define callout_fired(c) ((c)->c_flags & CALLOUT_FIRED) void callout_init __P((struct callout *)); -#define callout_pending(c) (((c)->c_flags & CALLOUT_PENDING) ? \ +#define callout_pending(c) ((c)->c_flags & CALLOUT_PENDING) +#define callout_pending_at(c) (((c)->c_flags & CALLOUT_PENDING) ? \ ((c)->c_time - ticks) : 0) void callout_reset __P((struct callout *, int, void (*)(void *), void *)); void callout_stop __P((struct callout *)); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Mon Mar 8 19:25:47 1999 Delivered-To: freebsd-net@freebsd.org Received: from widefw.csl.sony.co.jp (widefw.csl.sony.co.jp [133.138.1.1]) by hub.freebsd.org (Postfix) with ESMTP id CB63E14FD7 for ; Mon, 8 Mar 1999 19:25:41 -0800 (PST) (envelope-from kjc@csl.sony.co.jp) Received: from hotaka.csl.sony.co.jp (root@hotaka.csl.sony.co.jp [43.27.98.57]) by widefw.csl.sony.co.jp (8.8.8/3.6W) with ESMTP id MAA27291; Tue, 9 Mar 1999 12:25:23 +0900 (JST) Received: from localhost (kjc@[127.0.0.1]) by hotaka.csl.sony.co.jp (8.8.8/3.6W/hotaka/98122515) with ESMTP id MAA27488; Tue, 9 Mar 1999 12:25:22 +0900 (JST) Message-Id: <199903090325.MAA27488@hotaka.csl.sony.co.jp> To: Joko Y Cc: freebsd-net@FreeBSD.ORG Subject: Re: ALTQ 1.1.3, support for FreeBSD 3.1-STABLE, started the work In-reply-to: Your message of "Mon, 08 Mar 1999 20:11:17 +0700." Date: Tue, 09 Mar 1999 12:25:21 +0900 From: Kenjiro Cho Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >> Mr. Cho, what do you think about W2FQ? I found it in URL below: >> http://www.cs.cmu.edu/People/hzhang/ As I understand it, WF2Q has evolved a lot since then. WF2Q --> WF2Q+ --> H-WF2Q+ --> H-FSC H-FSC is more theoretical than CBQ and has nice properties. You can find a comparison of H-FSC and CBQ in their SIGCOMM97 paper. Actually, I'm going to visit CMU this week to learn more from Hui Zhang. --Kenjiro To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Mon Mar 8 20:40:30 1999 Delivered-To: freebsd-net@freebsd.org Received: from shell6.ba.best.com (shell6.ba.best.com [206.184.139.137]) by hub.freebsd.org (Postfix) with ESMTP id 8BC4415082 for ; Mon, 8 Mar 1999 20:40:12 -0800 (PST) (envelope-from jkb@shell6.ba.best.com) Received: (from jkb@localhost) by shell6.ba.best.com (8.9.3/8.9.2/best.sh) id UAA01898 for freebsd-net@freebsd.org; Mon, 8 Mar 1999 20:39:31 -0800 (PST) Message-ID: <19990308203931.B972@best.com> Date: Mon, 8 Mar 1999 20:39:31 -0800 From: "Jan B. Koum " To: freebsd-net@freebsd.org Subject: Max number of arp entries? Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.93.2i Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Hi all, I could not find the limit in the kernel on the max number of arp entries. I bet I am not looking in the right place :( Is there a limit? -- Yan To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Mon Mar 8 23:44: 5 1999 Delivered-To: freebsd-net@freebsd.org Received: from gateway.newtoy.com (snowfox.pr.mcs.net [205.164.44.72]) by hub.freebsd.org (Postfix) with ESMTP id 3A31014D42 for ; Mon, 8 Mar 1999 23:43:44 -0800 (PST) (envelope-from snowfox@snowfox.net) Received: from milk ([192.168.2.1]) by gateway.newtoy.com (8.8.8/8.8.8) with SMTP id BAA00294 for ; Tue, 9 Mar 1999 01:46:20 -0600 (CST) (envelope-from snowfox@snowfox.net) Message-ID: <000601be6a00$ecbce820$0102a8c0@milk.newtoy.com> From: "SnowFox" To: Subject: re: dhconfig and two 3C509Bs Date: Tue, 9 Mar 1999 01:46:20 -0600 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.3155.0 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3155.0 Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org The culprit seems to have been including ifconfig xl1= in rc.conf - this worked fine for tun0 where user mode PPP fills in the details later. Not so for dhclient. I needed to have -no- entry at all, save xl1 listed in network_interfaces. -----Original Message----- From: SnowFox To: freebsd-net@FreeBSD.ORG Date: Monday, March 08, 1999 8:49 PM Subject: dhconfig and two 3C509Bs >I've got two 3Com cards - xl0 and xl1 > >xl0 is configured for the local network - 192.168/16 > >xl1 is for a cable modem. > >When I run "dhclient xl1" to fetch the address, gateway, etc for the second, >the first stops working though the second then works. > >Any idea why the first card would stop working? > > > > >To Unsubscribe: send mail to majordomo@FreeBSD.org >with "unsubscribe freebsd-net" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Mon Mar 8 23:51:32 1999 Delivered-To: freebsd-net@freebsd.org Received: from gateway.newtoy.com (snowfox.pr.mcs.net [205.164.44.72]) by hub.freebsd.org (Postfix) with ESMTP id 6941714D7F for ; Mon, 8 Mar 1999 23:51:20 -0800 (PST) (envelope-from snowfox@snowfox.net) Received: from milk ([192.168.2.1]) by gateway.newtoy.com (8.8.8/8.8.8) with SMTP id BAA00319 for ; Tue, 9 Mar 1999 01:53:49 -0600 (CST) (envelope-from snowfox@snowfox.net) Message-ID: <000c01be6a01$f9b73e80$0102a8c0@milk.newtoy.com> From: "SnowFox" To: Subject: Source-based routing - ? Date: Tue, 9 Mar 1999 01:53:48 -0600 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.3155.0 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3155.0 Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Given two gateways, each on a different interface: Is it possible to choose a gateway & interface based on the source IP? ie - tun0 = PPP/ISDN - ip 1.1.1.1 xl0 = cablemodem - ip 2.2.2.2 Somebody pings 1.1.1.1 and it comes through tun0 - I want to respond via tun0 Somebody pings 2.2.2.2 and it comes through xl0 - I want to respond via xl0 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Tue Mar 9 7:14:27 1999 Delivered-To: freebsd-net@freebsd.org Received: from ausmail1.austin.ibm.com (ausmail1.austin.ibm.com [192.35.232.12]) by hub.freebsd.org (Postfix) with ESMTP id 02266150A9 for ; Tue, 9 Mar 1999 07:14:23 -0800 (PST) (envelope-from marquard@austin.ibm.com) Received: from netmail.austin.ibm.com (netmail.austin.ibm.com [9.53.250.98]) by ausmail1.austin.ibm.com (8.9.1/8.8.5) with ESMTP id JAA15042 for ; Tue, 9 Mar 1999 09:08:42 -0600 Received: from mojave.austin.ibm.com (mojave.austin.ibm.com [9.53.150.76]) by netmail.austin.ibm.com (8.8.5/8.8.5) with ESMTP id JAA79124 for ; Tue, 9 Mar 1999 09:14:05 -0600 Received: (from marquard@localhost) by mojave.austin.ibm.com (AIX4.3/UCB 8.8.8/8.7-client1.01) id JAA38378; Tue, 9 Mar 1999 09:14:01 -0600 To: freebsd-net@freebsd.org Subject: Re: Max number of arp entries? References: <19990308203931.B972@best.com> From: Dave Marquardt Date: 09 Mar 1999 09:14:01 -0600 In-Reply-To: "Jan B. Koum "'s message of "Mon, 8 Mar 1999 20:39:31 -0800" Message-ID: Lines: 12 X-Mailer: Gnus v5.6.2/Emacs 19.34 Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org "Jan B. Koum " writes: > I could not find the limit in the kernel on the max number of arp > entries. I bet I am not looking in the right place :( > > Is there a limit? Nope. ARP is part of the routing table, and the routing table grows dynamically, mostly without bound. Yeah, you could run out of kernel malloc() space, but that limit is in malloc(), not the route table management code. -Dave To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Tue Mar 9 9:55:55 1999 Delivered-To: freebsd-net@freebsd.org Received: from fw3.dsccc.com (fw3.dsccc.com [192.245.102.13]) by hub.freebsd.org (Postfix) with ESMTP id 74C2C14FF1 for ; Tue, 9 Mar 1999 09:55:29 -0800 (PST) (envelope-from fnasser@usa.alcatel.com) Received: (from uucp@localhost) by fw3.dsccc.com (8.8.8/8.8.8) id LAA01066 for ; Tue, 9 Mar 1999 11:55:04 -0600 (CST) Received: from mailrelay2.dsccc.com(10.17.101.27) by fw3 via smap (V2.0) id xma001028; Tue, 9 Mar 99 11:54:34 -0600 Received: from nsmail.optilink.dsccc.com (nsmail.optilink.dsccc.com [10.12.12.49]) by relay2.usa.alcatel.com (8.8.8/8.8.8) with ESMTP id LAA15295 for ; Tue, 9 Mar 1999 11:55:34 -0600 (CST) Received: from usa.alcatel.com ([10.12.20.219]) by nsmail.optilink.dsccc.com (Netscape Messaging Server 3.6) with ESMTP id AAA6760 for ; Tue, 9 Mar 1999 09:50:55 -0800 Message-ID: <36E56024.F9053624@usa.alcatel.com> Date: Tue, 09 Mar 1999 09:53:40 -0800 From: "Fadi Nasser" Organization: Alcatel USA X-Mailer: Mozilla 4.5 [en] (WinNT; U) X-Accept-Language: en MIME-Version: 1.0 To: freebsd-net@freebsd.org Subject: PPPoE server or client Unix implementation? Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Hi all I read somewhere that somebody has posted the source code to a PPP-over- Ethernet server (or client) to a FreeBSD newsgroup. I have not had much luck finding the source code (or anything remotely related to PPPoE) yet in any of the BSD groups. Would those of you who are aware of such implementations please set me on the right track. Your help is much appreciated. Regards. -- +++++++++++++++++++++++++++++++++++++ Fadi Nasser Software Engineer Alcatel USA (707)665 8049 FAX (707)792 7807 Fadi.Nasser@usa.alcatel.com ++++++++++++++++++++++++++++++++++++++ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Tue Mar 9 9:56: 0 1999 Delivered-To: freebsd-net@freebsd.org Received: from exchange.worldmediaco.net (unknown [207.252.122.245]) by hub.freebsd.org (Postfix) with ESMTP id 8DA0314FEB for ; Tue, 9 Mar 1999 09:55:22 -0800 (PST) (envelope-from cwatson@worldmediaco.net) Received: from nt-trash (192.168.1.61 [192.168.1.61]) by exchange.worldmediaco.net with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.1960.3) id FWLS4TY7; Tue, 9 Mar 1999 11:54:12 -0600 Message-ID: <001901be6a56$3aa2c4b0$3d01a8c0@nt-trash.omaha.com> Reply-To: "Chris Watson" From: "Chris Watson" To: Subject: Route add question Date: Tue, 9 Mar 1999 11:56:54 -0600 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.3110.5 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org I was trying to figure out today how to add a default route to an interface that is in a box with another interface that has a default route. I.e 3 nic cards in a box. xl0 fxp0 fxp1 If xl0 is ifconfig'd first then it gets the default route on bootup correct? What I was trying to do was assign the default route to fxp0 after bootup after xl0 was configured. I thought ifconfig xl0 delete might work. Then I could assign a the same default route to fxp0 that *was* assigned to xl0. But it kept useing xl0 as the interface. Is there a way to assign multiple default gateways on different interfaces on the same box? Like the above 2 interfaces each have their own default gateway? Just curious. Chris To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Tue Mar 9 10:29:51 1999 Delivered-To: freebsd-net@freebsd.org Received: from i.caniserv.com (i.caniserv.com [139.142.95.1]) by hub.freebsd.org (Postfix) with SMTP id AC69115027 for ; Tue, 9 Mar 1999 10:29:23 -0800 (PST) (envelope-from Darcy@ok-connect.com) Received: (qmail 6506 invoked from network); 9 Mar 1999 18:29:01 -0000 Received: from ccliii.caniserv.com (HELO dbitech) (darcyb@139.142.95.253) by 139.142.95.10 with SMTP; 9 Mar 1999 18:29:01 -0000 Message-Id: <3.0.32.19990309103010.03499320@mail.ok-connect.com> X-Sender: darcyb@mail.ok-connect.com X-Mailer: Windows Eudora Pro Version 3.0 (32) Date: Tue, 09 Mar 1999 10:30:10 -0800 To: freebsd-net@FreeBSD.ORG From: Darcy Buskermolen Subject: IP_DUMMYNET in a large network Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org I have a pair of questions both relating to IP_DUMMYNET. 1st what is a good inexpensive PCI 100FX card to use in a 3.1 machine that is going to be a large DUNNYNET/NATd box. 2nd how much CPU/RAM would be needed to do lets say 50 DUMMYNET pipes ranging from 64kb -> 45Mb as well as doing both static NAT as well as dynamic NAT on 6 Class C's ? Any/all help would be helpful. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Tue Mar 9 10:34:53 1999 Delivered-To: freebsd-net@freebsd.org Received: from whizzo.transsys.com (whizzo.TransSys.COM [144.202.42.10]) by hub.freebsd.org (Postfix) with ESMTP id D22B414F82 for ; Tue, 9 Mar 1999 10:34:49 -0800 (PST) (envelope-from louie@whizzo.transsys.com) Received: from whizzo.transsys.com (localhost.transsys.com [127.0.0.1]) by whizzo.transsys.com (8.9.3/8.9.1) with ESMTP id NAA75886; Tue, 9 Mar 1999 13:34:05 -0500 (EST) (envelope-from louie@whizzo.transsys.com) Message-Id: <199903091834.NAA75886@whizzo.transsys.com> X-Mailer: exmh version 2.0.2 2/24/98 X-Exmh-Isig-CompType: repl X-Exmh-Isig-Folder: inbox/freebsd To: "Fadi Nasser" Cc: freebsd-net@FreeBSD.ORG From: "Louis A. Mamakos" Subject: Re: PPPoE server or client Unix implementation? References: <36E56024.F9053624@usa.alcatel.com> In-reply-to: Your message of "Tue, 09 Mar 1999 09:53:40 PST." <36E56024.F9053624@usa.alcatel.com> Mime-Version: 1.0 Content-Type: text/plain Date: Tue, 09 Mar 1999 13:34:05 -0500 Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org > I read somewhere that somebody has posted the source code to a > PPP-over- Ethernet server (or client) to a FreeBSD newsgroup. I have > not had much luck finding the source code (or anything remotely > related to PPPoE) yet in any of the BSD groups. Would those of you > who are aware of such implementations please set me on the right > track. Your help is much appreciated. You might have seen a reference to a comment that I made. One of the Whistle folks had recently added (or was planning to?) netgraph support to if_ether.c, and I had commented that this now made it possible to do an efficient kernel-level implemention of PPP-over-Ethernet (PPPoE). At my "day job" at UUNET, we did a user-space implemention of PPPoE of both the "ciient" and "server" ends based upon the pppd code to implement the PPP state machine, etc. The TTY-specific code was replaced with code that used BPF to get ethernet frames on and off the network interface. This implementation was done as a proof-of-concept and testing vehicle during the development of the protocol spec (which was just recently published as an Informational RFC, RFC 2516, by the IETF). We wanted to be able to verify the protocol, and test against some vendor implementions, including in the Redback Networks access router and with the RouterWare client for Windows. Since this was a user-space implementation, built for comfort and not speed, we never intended it for real production use and thus haven't released it. Since with netgraph you can do the re-encapsulation in the kernel without context switches, you could get reasonable performance. This seems like a very promising implementation approach if you wanted to support megabit-per-second sorts of performance on a PPP session. We (UUNET) haven't pursued doing this implementation. Given a working netgraph-based kernel implementation of PPP with the control machinary to configure and operate it, the additional work required to do the PPPoE tunneling encapsulation should be pretty simple. As a quick aside: I'm sure there are those of you wondering why on earth you'd want to run PPP over Ethernet frames? Imagine that you have an Ethernet LAN at home or small business. You're using private IP addresses and doing whatever on that network. You'd like to get high-speed Internet connectivity, or perhaps telecommuting access using ADSL. You'd like to do this without breaking your existing network (renumbering, etc.) So, you get your ADSL CPE device, which is an ethernet bridge. You can now establish one or more PPP sessions by bridging encapsulated PPP frames (using their own Ethernet type, different than IP) to the thing at the other end of the ADSL wire. Each PPP session might have vastly different characteristics (performance, public Internet vs. corporate connectivity, etc.) You can think of it as very lightweight L2TP, but where the tunnel endpoints are not addressed using IP. See the RFC for more details if interested. louie (aka louie@UU.NET) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Tue Mar 9 10:41:34 1999 Delivered-To: freebsd-net@freebsd.org Received: from Homer.Web-Ex.com (homer.web-ex.com [209.54.66.254]) by hub.freebsd.org (Postfix) with ESMTP id 3DE5D14F29 for ; Tue, 9 Mar 1999 10:41:19 -0800 (PST) (envelope-from jim@web-ex.com) Received: from localhost (jim@localhost) by Homer.Web-Ex.com (8.9.1/8.9.1) with ESMTP id NAA02485; Tue, 9 Mar 1999 13:36:01 -0500 (EST) (envelope-from jim@web-ex.com) X-Authentication-Warning: Homer.Web-Ex.com: jim owned process doing -bs Date: Tue, 9 Mar 1999 13:36:01 -0500 (EST) From: Jim Cassata To: Chris Watson Cc: freebsd-net@FreeBSD.ORG Subject: Re: Route add question In-Reply-To: <001901be6a56$3aa2c4b0$3d01a8c0@nt-trash.omaha.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On Tue, 9 Mar 1999, Chris Watson wrote: > I was trying to figure out today how to add a default route to an interface > that is in a box with another interface that has a default route. > > I.e > > 3 nic cards in a box. > > xl0 > fxp0 > fxp1 > If xl0 is ifconfig'd first then it gets the default route on bootup correct? Incorrect. Think about what a default route or a route is. You are telling the machine where to deliver packets. The machine can only speak to an interface to which it is directly connected. The default route simply says "If I have packets addressed to destinations that are not in my route table (and so I don't know where they go) give them to this interface" It will do this for one interface only. > What I was trying to do was assign the default route to fxp0 after bootup > after xl0 was configured. > I thought ifconfig xl0 delete might work. Then I could assign a the same > default route to fxp0 that *was* assigned to xl0. > But it kept useing xl0 as the interface. > The default route is going to be routed through the interface that directly connects to the default gateway. take for example: route add default 209.100.100.1 if I have ed0 ifconfig'ed for 209.100.100.5 with a netmask of 255.255.255.0 then this will be the interface used. Jim Cassata 516.421.6000 jim@web-ex.com Web Express 20 Broadhollow Road Suite 3011 Melville, NY 11747 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Tue Mar 9 10:45:12 1999 Delivered-To: freebsd-net@freebsd.org Received: from labinfo.iet.unipi.it (labinfo.iet.unipi.it [131.114.9.5]) by hub.freebsd.org (Postfix) with SMTP id 7EB7F1506F for ; Tue, 9 Mar 1999 10:45:05 -0800 (PST) (envelope-from luigi@labinfo.iet.unipi.it) Received: from localhost (luigi@localhost) by labinfo.iet.unipi.it (8.6.5/8.6.5) id RAA06532; Tue, 9 Mar 1999 17:25:48 +0100 From: Luigi Rizzo Message-Id: <199903091625.RAA06532@labinfo.iet.unipi.it> Subject: Re: IP_DUMMYNET in a large network To: Darcy@ok-connect.com (Darcy Buskermolen) Date: Tue, 9 Mar 1999 17:25:47 +0100 (MET) Cc: freebsd-net@FreeBSD.ORG In-Reply-To: <3.0.32.19990309103010.03499320@mail.ok-connect.com> from "Darcy Buskermolen" at Mar 9, 99 10:29:51 am X-Mailer: ELM [version 2.4 PL23] Content-Type: text Content-Length: 1417 Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org > I have a pair of questions both relating to IP_DUMMYNET. > > 1st what is a good inexpensive PCI 100FX card to use in a 3.1 machine that > is going to be a large DUNNYNET/NATd box. any supported 100mbit card should do... i have heard good things about the "fxp" cards, the "de" cards are slightly less performant and now discontinued. But i have no idea if any of those comes with fiber connector... perhaps you can use a media converter together with a 100baseTX card ? > 2nd how much CPU/RAM would be needed to do lets say 50 DUMMYNET pipes > ranging from 64kb -> 45Mb as well as doing both static NAT as well as > dynamic NAT on 6 Class C's ? i'd say 64MB is more than enough for all practical needs. The amount of memory used by dummynet is the sum of sizes of all queues. Because you never want more than say 1s of data queued except perhaps at the slowest speeds i think you'll never have more than 100-200Mbits queued in your pipes meaning some 16MB for the buffers (NMBCLUSTERS=8192). warning: i have never used such a large dummynet/nat box, although i have heard contrasting report from people, some using 100+ pipes with success, some having long term (several days) stability problems when dummynet runs together with busy web/proxy servers. Hard to tell who is at fault when a machine is stressed so severely, could be just a combination of things that triggers some unrelated bug. cheers luigi To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Tue Mar 9 11:18:44 1999 Delivered-To: freebsd-net@freebsd.org Received: from xylan.com (postal.xylan.com [208.8.0.248]) by hub.freebsd.org (Postfix) with ESMTP id 1AF3E14BDD for ; Tue, 9 Mar 1999 11:18:41 -0800 (PST) (envelope-from wes@softweyr.com) Received: from mailhub.xylan.com by xylan.com (8.8.7/SMI-SVR4 (xylan-mgw 2.2 [OUT])) id LAA23742; Tue, 9 Mar 1999 11:18:18 -0800 (PST) Received: from utah.XYLAN.COM by mailhub.xylan.com (SMI-8.6/SMI-SVR4 (mailhub 2.1 [HUB])) id LAA14629; Tue, 9 Mar 1999 11:18:18 -0800 Received: from softweyr.com by utah.XYLAN.COM (SMI-8.6/SMI-SVR4 (xylan utah [SPOOL])) id MAA24044; Tue, 9 Mar 1999 12:18:14 -0700 Message-ID: <36E57402.685D3039@softweyr.com> Date: Tue, 09 Mar 1999 12:18:26 -0700 From: Wes Peters Organization: Softweyr LLC X-Mailer: Mozilla 4.5 [en] (X11; U; FreeBSD 2.2.7-RELEASE i386) X-Accept-Language: en MIME-Version: 1.0 To: Chris Watson Cc: freebsd-net@FreeBSD.ORG Subject: Re: Route add question References: <001901be6a56$3aa2c4b0$3d01a8c0@nt-trash.omaha.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Chris Watson wrote: > > I was trying to figure out today how to add a default route to an interface > that is in a box with another interface that has a default route. > > I.e > > 3 nic cards in a box. > > xl0 > fxp0 > fxp1 > If xl0 is ifconfig'd first then it gets the default route on bootup correct? > What I was trying to do was assign the default route to fxp0 after bootup > after xl0 was configured. > I thought ifconfig xl0 delete might work. Then I could assign a the same > default route to fxp0 that *was* assigned to xl0. > But it kept useing xl0 as the interface. > > Is there a way to assign multiple default gateways on different interfaces > on the same box? Like the above 2 interfaces each have their own default > gateway? No, you can only have one default route, that's what "default" means. If you have multiple gateways via multiple interfaces to the same network resource, I.e. the corporate backbone or the internet, you need to use a routing daemon to manage your routing table. You'll need to talk to your network manager to find what routing protocols are in use, and choose a routing daemon that supports those protocols. Your choices are basically routed and gated; if routed supports the protocol(s) you need, use it. If not, if for instance you're using BGP4, used gated. -- Where am I, and what am I doing in this handbasket? Wes Peters +1.801.915.2061 Softweyr LLC wes@softweyr.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Tue Mar 9 11:43:54 1999 Delivered-To: freebsd-net@freebsd.org Received: from exchange.worldmediaco.net (unknown [207.252.122.245]) by hub.freebsd.org (Postfix) with ESMTP id 882861537C for ; Tue, 9 Mar 1999 11:43:51 -0800 (PST) (envelope-from cwatson@worldmediaco.net) Received: from nt-trash (192.168.1.61 [192.168.1.61]) by exchange.worldmediaco.net with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.1960.3) id FWLS4T59; Tue, 9 Mar 1999 13:42:37 -0600 Reply-To: From: "Chris Watson" To: "Wes Peters" Cc: Subject: RE: Route add question Date: Tue, 9 Mar 1999 13:45:23 -0600 Message-ID: <000101be6a65$5f34ce90$3d01a8c0@nt-trash.omaha.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0 Importance: Normal In-Reply-To: <36E57402.685D3039@softweyr.com> X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org -----Original Message----- From: wpeters@softweyr.com [mailto:wpeters@softweyr.com] On Behalf Of Wes Peters Sent: Tuesday, March 09, 1999 1:18 PM To: Chris Watson Cc: freebsd-net@FreeBSD.ORG Subject: Re: Route add question Chris Watson wrote: > > I was trying to figure out today how to add a default route to an interface > that is in a box with another interface that has a default route. No, you can only have one default route, that's what "default" means. If you have multiple gateways via multiple interfaces to the same network resource, I.e. the corporate backbone or the internet, you need to use a routing daemon to manage your routing table. I hate routing :) Ok let me explain my real problem then: I am try to replace a cisco 7206 that needs to be moved with a FreeBSD box. The cisco has one interface n1 going out to a 4700 out to the net. N1 has an IP of 207.252.133.200 and a netmask of 255.255.255.252 The 7206 also has several other interfaces. N2 n3 n4 ... Each of these cards in IOS I guess has a primary IP and a multiple secondary IP's. N2 has a primary ip of 207.252.121.10 and a netmask of 255.255.255.252 N2 has a secondary ip of 207.252.122.250 and a netmask of 255.255.255.0 N2 has a third secondary ip of 207.252.120.30 and a netmask of 255.255.255.240 This n2 card plugs into a switch which has 3 mail servers on it. Each of the mail servers uses the primary ip of n2 as the default gateway. Another switch is cascaded off of the mail server switch which houses web servers. These web servers point to the secondary ip of 207.252.122.250 as a default gateway. Basically it looks like this: Internet-----4700-------------------7206--------------------------------swit ch one-------switch 2--------------switch 3 Primary: 207.252.121.10 Secondary: 207.252.122.250 Basically the 7206 has mutiple virtual ip's being used as default gateways. How do I accomplish the same thing? How can I assign a single interface multiple IP's each virtual being a default gateway for different machines on a single switch, li.e switch one using the primary ip as a default gateway and switch 2 machines using the 2nd virtual ip as a default gateway. -- Where am I, and what am I doing in this handbasket? Wes Peters +1.801.915.2061 Now Softweyr LLC wes@softweyr.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Tue Mar 9 16: 4:53 1999 Delivered-To: freebsd-net@freebsd.org Received: from bubba.whistle.com (s205m7.whistle.com [207.76.205.7]) by hub.freebsd.org (Postfix) with ESMTP id DD4EB14E6E for ; Tue, 9 Mar 1999 16:04:50 -0800 (PST) (envelope-from archie@whistle.com) Received: (from archie@localhost) by bubba.whistle.com (8.9.2/8.9.2) id QAA86065; Tue, 9 Mar 1999 16:04:00 -0800 (PST) From: Archie Cobbs Message-Id: <199903100004.QAA86065@bubba.whistle.com> Subject: Re: PPPoE server or client Unix implementation? In-Reply-To: <36E56024.F9053624@usa.alcatel.com> from Fadi Nasser at "Mar 9, 99 09:53:40 am" To: fnasser@usa.alcatel.com (Fadi Nasser) Date: Tue, 9 Mar 1999 16:04:00 -0800 (PST) Cc: freebsd-net@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL38 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Fadi Nasser writes: > Hi all > I read somewhere that somebody has posted the source code to a > PPP-over- Ethernet server (or client) to a FreeBSD newsgroup. I > have not had much luck finding the source code (or anything remotely > related to PPPoE) yet in any of the BSD groups. Would those of you > who are aware of such implementations please set me on the right > track. Your help is much appreciated. Netgraph is available at ftp://ftp.whistle.com/pub/archie/netgraph/index.html. This version includes support for netgraph-enabling Ethernet drivers. With the latest mpd port (net/mpd) you can do PPP over netgraph. However, the specifics of PPP over Ethernet described in the draft RFC are not implemented, ie, this would be like PPP inside raw Ethernet frames. But one could easily write a PPPoE netgraph node type (hmmm :) -Archie ___________________________________________________________________________ Archie Cobbs * Whistle Communications, Inc. * http://www.whistle.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Wed Mar 10 9:27:43 1999 Delivered-To: freebsd-net@freebsd.org Received: from arthur.axion.bt.co.uk (arthur.axion.bt.co.uk [132.146.5.4]) by hub.freebsd.org (Postfix) with ESMTP id A96C915153 for ; Wed, 10 Mar 1999 09:27:37 -0800 (PST) (envelope-from graeme.brown@bt-sys.bt.co.uk) Received: from rambo (actually rambo.futures.bt.co.uk) by arthur (local) with SMTP; Wed, 10 Mar 1999 17:26:57 +0000 Received: from maczebedee (actually macsmtp) by rambo with SMTP (PP); Wed, 10 Mar 1999 17:28:04 +0000 Message-ID: Date: 10 Mar 1999 17:31:22 +0100 From: Graeme Brown Subject: ALTQ-1.1.3 and ENI-155 ATM Nics To: "FreeBSD-Net (FreeBSD.Org) List" X-Mailer: Mail*Link SMTP for Quarterdeck Mail; Version 4.0.0 Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Has anyone one on the list seen anything like this with ALTQ-1.1.3 ? hi kenjiro kjc>SUNI is the phys device (UTP for your case) and the driver doesn't kjc>touch the phys device settings. So, it seems to be a problem of the kjc>phys device or the cable. I have four PC routers running FBSD-2.2.6 each with with two ENI 155 ATM cards (UTP media) running ALTQ-1.1.3. I ran ENI DOS diagnostics on two cards in one paticular PC router and they appear OK. kjc>If I remember correctly, an ENI card comes with a DOS based diag kjc>program that initializes the phys device (and possibly tests it). I have four PC routers running FBSD-2.2.6 each with with two ENI 155 ATM cards (UTP media) running ALTQ-1.1.3. I ran ENI DOS diagnostics on two cards in one paticular PC router and they appear OK. On this PC router I have kernel debug options compilede in options DDB options DDB_UNATTENDED I find this PC is continuously generating a kernel trap to the debugger. On the console I see db> continue NMI ... going to debugger kernel: type 19 trap, code=0 Stopped at _en_service+0x215: mov1 %eax,%ebx db> continue NMI ... going to debugger kernel: type 19 trap, code=0 Stopped at _en_service+0x215: mov1 %eax,%ebx and so on. I'm starting to believe that this is more driver related. Is there any further info I can get for you ? regards graeme brown bt laboratories, uk email: graeme.brown@bt-sys.bt.co.uk To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Wed Mar 10 10:47: 4 1999 Delivered-To: freebsd-net@freebsd.org Received: from poboxer.pobox.com (unknown [208.149.16.4]) by hub.freebsd.org (Postfix) with ESMTP id E7D671516E for ; Wed, 10 Mar 1999 10:46:17 -0800 (PST) (envelope-from alk@poboxer.pobox.com) Received: (from alk@localhost) by poboxer.pobox.com (8.9.3/8.9.1) id MAA03311; Wed, 10 Mar 1999 12:45:19 -0600 (CST) (envelope-from alk) From: Tony Kimball MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Wed, 10 Mar 1999 12:45:19 -0600 (CST) X-Face: \h9Jg:Cuivl4S*UP-)gO.6O=T]]@ncM*tn4zG);)lk#4|lqEx=*talx?.Gk,dMQU2)ptPC17cpBzm(l'M|H8BUF1&]dDCxZ.c~Wy6-j,^V1E(NtX$FpkkdnJixsJHE95JlhO 5\M3jh'YiO7KPCn0~W`Ro44_TB@&JuuqRqgPL'0/{):7rU-%.*@/>q?1&Ed Reply-To: alk@sun.com To: graeme.brown@bt-sys.bt.co.uk Cc: freebsd-net@FreeBSD.ORG Subject: ALTQ-1.1.3 and ENI-155 ATM Nics References: X-Mailer: VM 6.43 under 20.4 "Emerald" XEmacs Lucid Message-ID: <14054.48471.744263.62383@avalon.east> Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Quoth Graeme Brown on , 10 March: : Has anyone one on the list seen anything like this with ALTQ-1.1.3 ? ... : db> continue : NMI ... going to debugger : kernel: type 19 trap, code=0 : Stopped at _en_service+0x215: mov1 %eax,%ebx : db> continue : NMI ... going to debugger : kernel: type 19 trap, code=0 : Stopped at _en_service+0x215: mov1 %eax,%ebx I know nothing of ALTQ and don't know but what that someone is using NMI for some other purpose of which I am ignorant, but NMI, to me, screams "bad memory module!". To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Wed Mar 10 12:12:42 1999 Delivered-To: freebsd-net@freebsd.org Received: from pmo1.pmo.ualberta.ca (pmo1.pmo.ualberta.ca [129.128.191.28]) by hub.freebsd.org (Postfix) with ESMTP id D75F71534D for ; Wed, 10 Mar 1999 12:12:27 -0800 (PST) (envelope-from Barry.Hannigan@ualberta.ca) Received: by pmo1.pmo.ualberta.ca with Internet Mail Service (5.5.2232.9) id ; Wed, 10 Mar 1999 13:11:52 -0700 Message-ID: <100BBD696002D211BACF00805FFE985359FD74@pmo1.pmo.ualberta.ca> From: Barry Hannigan To: "'freebsd-net@freebsd.org'" Subject: Date: Wed, 10 Mar 1999 13:11:51 -0700 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2232.9) Content-Type: text/plain; charset="iso-8859-1" Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org subscribe To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Wed Mar 10 12:12:43 1999 Delivered-To: freebsd-net@freebsd.org Received: from pmo1.pmo.ualberta.ca (pmo1.pmo.ualberta.ca [129.128.191.28]) by hub.freebsd.org (Postfix) with ESMTP id D4C7915353 for ; Wed, 10 Mar 1999 12:12:37 -0800 (PST) (envelope-from Barry.Hannigan@ualberta.ca) Received: by pmo1.pmo.ualberta.ca with Internet Mail Service (5.5.2232.9) id ; Wed, 10 Mar 1999 13:12:03 -0700 Message-ID: <100BBD696002D211BACF00805FFE985359FD75@pmo1.pmo.ualberta.ca> From: Barry Hannigan To: "'freebsd-net@freebsd.org'" Subject: Date: Wed, 10 Mar 1999 13:12:02 -0700 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2232.9) Content-Type: text/plain; charset="iso-8859-1" Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org help To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Thu Mar 11 8: 3:15 1999 Delivered-To: freebsd-net@freebsd.org Received: from hugin.odin-corporation.com (fredriks-1.pr.mcs.net [205.164.50.241]) by hub.freebsd.org (Postfix) with ESMTP id EBC47153E1 for ; Thu, 11 Mar 1999 08:03:11 -0800 (PST) (envelope-from lars@odin-corporation.com) Received: from odin-corporation.com (localhost [127.0.0.1]) by hugin.odin-corporation.com (8.9.2/8.9.1) with ESMTP id KAA83303; Thu, 11 Mar 1999 10:01:57 -0600 (CST) (envelope-from lars@odin-corporation.com) Message-ID: <36E7E8F4.F2925E18@odin-corporation.com> Date: Thu, 11 Mar 1999 10:01:57 -0600 From: Lars Fredriksen Organization: Odin Corporation X-Mailer: Mozilla 4.5 [en] (X11; I; FreeBSD 4.0-CURRENT i386) X-Accept-Language: no, en MIME-Version: 1.0 To: paulo@nlink.com.br, freebsd-net@freebsd.org Subject: pppd and missing UI [was Problems with Trumpet winsock] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Hi, I am seeing the same problem if I use the current pppd (this is on current also) when I try to connect with my ISP. However using a pppd from Feb last year: fredriks-1# ident /usr/sbin/pppd /usr/sbin/pppd: $Id: main.c,v 1.15 1997/10/10 09:28:37 peter Exp $ $Id: magic.c,v 1.6 1997/08/19 17:52:42 peter Exp $ $Id: fsm.c,v 1.7 1997/08/19 17:52:37 peter Exp $ $Id: lcp.c,v 1.7 1997/08/19 17:52:40 peter Exp $ $Id: ipcp.c,v 1.10 1997/08/22 12:03:54 peter Exp $ $Id: upap.c,v 1.7 1997/08/19 17:52:47 peter Exp $ $Id: chap.c,v 1.8 1997/08/19 17:52:34 peter Exp $ $Id: ccp.c,v 1.7 1997/08/19 17:52:33 peter Exp $ $Id: demand.c,v 1.3 1997/08/19 17:52:36 peter Exp $ $Id: auth.c,v 1.21 1997/12/13 05:27:29 jdp Exp $ $Id: options.c,v 1.16 1997/10/10 09:28:37 peter Exp $ $Id: sys-bsd.c,v 1.12 1998/01/16 17:38:53 bde Exp $ $Id: cbcp.c,v 1.3 1997/08/19 17:52:31 peter Exp $ it works fine. If you dump the packet as it comes in: ppp0 input: ff 03 00 21 21 45 45 00 00 00 00 fa fa dd dd d0 You see the 0xff wich is the broadcast address, the 0x3 wich is the UI, the compression flag 0x0 and the protocol identifier 0x21. It appears that somehow the pppinput() routine gets its sc_ilen reset to 1 for some reason sometime after it has already processed the ppp header. I don't know yet as to why the older pppd doesn't trigger the bug. Lars To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Thu Mar 11 12: 6:30 1999 Delivered-To: freebsd-net@freebsd.org Received: from pau-amma.whistle.com (s205m64.whistle.com [207.76.205.64]) by hub.freebsd.org (Postfix) with ESMTP id 1F1B215132 for ; Thu, 11 Mar 1999 12:06:25 -0800 (PST) (envelope-from dhw@whistle.com) Received: (from dhw@localhost) by pau-amma.whistle.com (8.9.2/8.9.2) id MAA93490; Thu, 11 Mar 1999 12:06:07 -0800 (PST) Date: Thu, 11 Mar 1999 12:06:07 -0800 (PST) From: David Wolfskill Message-Id: <199903112006.MAA93490@pau-amma.whistle.com> To: freebsd-net@FreeBSD.ORG, stanb@awod.com Subject: Re: SOCKS In-Reply-To: <19990306212804.E7DA7151BF@hub.freebsd.org> Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Date: Sat, 6 Mar 1999 16:27:44 -0500 (EST) >From: "Stan Brown" > I find myself behind a corporate firewall. It is a SOCKS based proxy > server. So far all I have been able to make work is Netscape! How can I > make ftp, telnet and ping work from behind this firewall? > Pointers to info greatly appreciated. Last time I worked with SOCKS, it was SOCKS 4 (SOCKS 5 was in beta, at best; this was a few years ago). At that time, there were some client programs that were provided with the SOCKS sources for FTP, TELNET, and WHOIS clients. (They were "rftp", "rtelnet", and "rwhois", respectively.) I believe I've heard that with SOCKS 5, there's a way to dynamically "SOCKSify" just about any executable; since I haven't used it, though, I don't have much information on it. Cheers, david -- David Wolfskill UNIX System Administrator dhw@whistle.com voice: (650) 577-7158 pager: (650) 371-4621 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Thu Mar 11 13: 6:16 1999 Delivered-To: freebsd-net@freebsd.org Received: from mail.amicapital.com (smtp.amicapital.com [208.207.126.35]) by hub.freebsd.org (Postfix) with ESMTP id 5A3841521A for ; Thu, 11 Mar 1999 13:06:03 -0800 (PST) (envelope-from tarrowsmith@amicapital.com) Received: from tarrowsm ([192.168.4.230]) by mail.amicapital.com (8.8.7/8.8.7) with SMTP id QAA12475; Thu, 11 Mar 1999 16:01:49 -0500 (EST) (envelope-from tarrowsmith@amicapital.com) From: "T.J. Arrowsmith" To: "David Wolfskill" , , Subject: RE: SOCKS Date: Thu, 11 Mar 1999 16:04:38 -0500 Message-ID: <000f01be6c02$c6005ec0$e604a8c0@tarrowsm.amicapital.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0 Importance: Normal In-Reply-To: <199903112006.MAA93490@pau-amma.whistle.com> X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Go to: http://www.socks.nec.com/ And download the SocksCap program. You should be able to use it with any program that doesn't have built-in SOCKS proxy support. Works very well. T.J. Arrowsmith tarrowsmith@amicapital.com > -----Original Message----- > From: owner-freebsd-net@FreeBSD.ORG > [mailto:owner-freebsd-net@FreeBSD.ORG]On Behalf Of David Wolfskill > Sent: Thursday, March 11, 1999 3:06 PM > To: freebsd-net@FreeBSD.ORG; stanb@awod.com > Subject: Re: SOCKS > > > >Date: Sat, 6 Mar 1999 16:27:44 -0500 (EST) > >From: "Stan Brown" > > > I find myself behind a corporate firewall. It is a SOCKS based proxy > > server. So far all I have been able to make work is > Netscape! How can I > > make ftp, telnet and ping work from behind this firewall? > > > Pointers to info greatly appreciated. > > Last time I worked with SOCKS, it was SOCKS 4 (SOCKS 5 was in beta, at > best; this was a few years ago). At that time, there were some client > programs that were provided with the SOCKS sources for FTP, TELNET, and > WHOIS clients. (They were "rftp", "rtelnet", and "rwhois", respectively.) > > I believe I've heard that with SOCKS 5, there's a way to dynamically > "SOCKSify" just about any executable; since I haven't used it, though, I > don't have much information on it. > > Cheers, > david > -- > David Wolfskill UNIX System Administrator > dhw@whistle.com voice: (650) 577-7158 pager: > (650) 371-4621 > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-net" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Thu Mar 11 18:18: 5 1999 Delivered-To: freebsd-net@freebsd.org Received: from ns10.nokia.com (ns10.nokia.com [131.228.6.229]) by hub.freebsd.org (Postfix) with ESMTP id AC54714D2B for ; Thu, 11 Mar 1999 18:17:59 -0800 (PST) (envelope-from hao.wang@nokia.com) Received: from msgws01ntc.ntc.nokia.com (msgws01ntc.ntc.nokia.com [131.228.59.181]) by ns10.nokia.com (8.8.8/8.6.9) with ESMTP id EAA12392 for ; Fri, 12 Mar 1999 04:17:37 +0200 (EET) Message-Id: <199903120217.EAA12392@ns10.nokia.com> Received: by msgws01ntc.ntc.nokia.com with Internet Mail Service (5.5.2232.9) id ; Fri, 12 Mar 1999 04:16:32 +0200 From: "Wang Hao (Nokia/Beijing)" To: "net list(SMTP/FreeBSD)" Subject: speed of packet transmit Date: Fri, 12 Mar 1999 10:17:00 +0200 Importance: high X-Priority: 1 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2232.9) Content-Type: text/plain Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Hi, folks I will very appreciate if someone could tell me how to calculate the speed (cast time) of a packet transmitted over the NIC on ethernet. Best Regard Howard Wong 1999.3.12 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Fri Mar 12 1:15:56 1999 Delivered-To: freebsd-net@freebsd.org Received: from mail.ftf.dk (mail.ftf.net [129.142.64.2]) by hub.freebsd.org (Postfix) with ESMTP id 9AE4815266 for ; Fri, 12 Mar 1999 01:15:23 -0800 (PST) (envelope-from regnauld@deepo.prosa.dk) Received: from mail.prosa.dk ([192.168.100.254]) by mail.ftf.dk (8.9.3/8.9.3/gw-ftf-1.2) with ESMTP id KAA11722 for ; Fri, 12 Mar 1999 10:15:04 +0100 (CET) X-Authentication-Warning: mail.ftf.dk: Host [192.168.100.254] claimed to be mail.prosa.dk Received: from deepo.prosa.dk (deepo.prosa.dk [192.168.100.10]) by mail.prosa.dk (8.8.8/8.8.5/prosa-1.1) with ESMTP id KAA11017 for ; Fri, 12 Mar 1999 10:17:27 +0100 (CET) Received: (from regnauld@localhost) by deepo.prosa.dk (8.8.8/8.8.5/prosa-1.1) id KAA21021; Fri, 12 Mar 1999 10:15:03 +0100 (CET) Message-ID: <19990312101503.08429@deepo.prosa.dk> Date: Fri, 12 Mar 1999 10:15:03 +0100 From: Philippe Regnauld To: freebsd-net@freebsd.org Subject: Routing strangeness (route / netstat) Reply-To: pr@s44.eu.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.88e X-Operating-System: FreeBSD 2.2.8-RELEASE i386 Phone: +45 3336 4148 Address: Ahlefeldtsgade 16, 1359 Copenhagen K, Denmark Organization: PROSA Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org I made (this is both valid for 2.2.8 and 3.1) the following routing change, with a wrong syntax: [root]% route add -net 10.10.0.0 255.255.0.0 192.168.1.12 add net 10.10.0.0: gateway 255.255.0.0 ... which is in itself a mistake, but even then, running netstat -rn gives: 0.8&0xc0a8010c 255.255.0.0 UGSc 0 0 ep0 Do undo this, I had to do: [root]# route get 10.10.0.0 route to: 10.10.0.0 destination: 0.8.0.0 mask: 192.168.1.12 gateway: 255.255.0.0 interface: ep0 flags: recvpipe sendpipe ssthresh rtt,msec rttvar hopcount mtu expire 0 0 0 0 0 0 1500 0 ... and do [root]# route delete 0.8.0.0 delete host 0.8.0.0 This worked. What's strange is that: [root]# route add -net 10.10.0.0 255.255.0.0 add net 10.10.0.0: gateway 255.255.0.0 ... even though also wrong, Gives: 10.10/16 255.255.0.0 UGSc 0 0 ep0 ... which is "valid". What is the reason for the first bogus interpretation ? Arg parsing in route ? -- -[ Phil Regnauld / sysadmin / regnauld@deepo.prosa.dk / +55.4N +12.3 E ]- -[ Member of the BSD-Dk User Group / http://hotel.prosa.dk/bsd-dk/ ] - "The Internet is busy. Please try again later." -- telcos To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Fri Mar 12 11:26: 4 1999 Delivered-To: freebsd-net@freebsd.org Received: from sumatra.americantv.com (sumatra.americantv.com [207.170.17.37]) by hub.freebsd.org (Postfix) with ESMTP id E76E4153F8 for ; Fri, 12 Mar 1999 11:25:39 -0800 (PST) (envelope-from jlemon@americantv.com) Received: from right.PCS (right.PCS [148.105.10.31]) by sumatra.americantv.com (8.8.5/8.8.5) with ESMTP id NAA28492 for ; Fri, 12 Mar 1999 13:25:19 -0600 (CST) Received: (from jlemon@localhost) by right.PCS (8.6.13/8.6.4) id NAA15326; Fri, 12 Mar 1999 13:24:49 -0600 Message-ID: <19990312132448.41478@right.PCS> Date: Fri, 12 Mar 1999 13:24:48 -0600 From: Jonathan Lemon To: freebsd-net@freebsd.org Subject: oddity with "netstat -m" Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.61.1 Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On a 3.1-STABLE machine, last cvs'upd Feb 20th, I have: 5404/46880 mbufs in use: 839 mbufs allocated to data 4565 mbufs allocated to packet headers 766/17438/16384 mbuf clusters in use (current/peak/max) 40736 Kbytes allocated to network (5% in use) 0 requests for memory denied 0 requests for memory delayed 0 calls to protocol drain routines Note the "peak" entry in mbuf clusters. How can the machine have a "peak" greater than the max number of entries? -- Jonathan To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Fri Mar 12 12:11:19 1999 Delivered-To: freebsd-net@freebsd.org Received: from sierrahill.com (unknown [209.198.135.2]) by hub.freebsd.org (Postfix) with ESMTP id D692C1526F; Fri, 12 Mar 1999 12:11:12 -0800 (PST) (envelope-from rjoe@sierrahill.com) Received: (from rjoe@localhost) by sierrahill.com (8.8.8/8.8.8) id OAA23622; Fri, 12 Mar 1999 14:13:46 -0600 (CST) (envelope-from rjoe) From: Joe Schwartz Message-Id: <199903122013.OAA23622@sierrahill.com> Subject: rjoe To: freebsd-net@freebsd.org, freebsd-questions@freebsd.org Date: Fri, 12 Mar 1999 14:13:45 -0600 (CST) X-Mailer: ELM [version 2.4 PL23] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Folks, I've a chance to move an ISP's e-mail server off of NT to FreeBSD. They have about 3000 e-mail accounts. I can get a text file from an Excel spread sheet which has account info in it. (I haven't seen it yet) Does anyone know of an easy way to create all these accounts? or has anyone done something similar? Perhaps a combination of perl & expect? Thanks, Joe Schwartz To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Fri Mar 12 12:47:14 1999 Delivered-To: freebsd-net@freebsd.org Received: from poboxer.pobox.com (unknown [208.149.16.4]) by hub.freebsd.org (Postfix) with ESMTP id C3AB4152F7; Fri, 12 Mar 1999 12:46:50 -0800 (PST) (envelope-from alk@poboxer.pobox.com) Received: (from alk@localhost) by poboxer.pobox.com (8.9.3/8.9.1) id OAA28231; Fri, 12 Mar 1999 14:45:39 -0600 (CST) (envelope-from alk) From: Anthony Kimball - High Performance Computing MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Fri, 12 Mar 1999 14:45:39 -0600 (CST) X-Face: \h9Jg:Cuivl4S*UP-)gO.6O=T]]@ncM*tn4zG);)lk#4|lqEx=*talx?.Gk,dMQU2)ptPC17cpBzm(l'M|H8BUF1&]dDCxZ.c~Wy6-j,^V1E(NtX$FpkkdnJixsJHE95JlhO 5\M3jh'YiO7KPCn0~W`Ro44_TB@&JuuqRqgPL'0/{):7rU-%.*@/>q?1&Ed Reply-To: alk@pobox.com To: rjoe@sierrahill.com Subject: rjoe References: <199903122013.OAA23622@sierrahill.com> X-Mailer: VM 6.43 under 20.4 "Emerald" XEmacs Lucid Message-ID: <14057.31652.830722.892332@avalon.east> Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Quoth Joe Schwartz on Fri, 12 March: : They have about 3000 e-mail accounts. I can get a text file from an : Excel spread sheet which has account info in it. (I haven't seen it yet) : : Does anyone know of an easy way to create all these accounts? or has : anyone done something similar? /usr/sbin/adduser *is* a perl script. Presumably you just change The calls to &new_users_name et filia in the inner loop so that they read from the text file format instead of prompting at the tty. This is pretty basic perl stuff. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Fri Mar 12 13:18: 8 1999 Delivered-To: freebsd-net@freebsd.org Received: from mailb.telia.com (mailb.telia.com [194.22.194.6]) by hub.freebsd.org (Postfix) with ESMTP id B370215511 for ; Fri, 12 Mar 1999 13:17:46 -0800 (PST) (envelope-from lahna@ollbox.com) Received: from d1o71.telia.com (root@d1o71.telia.com [194.237.172.245]) by mailb.telia.com (8.8.8/8.8.8) with ESMTP id WAA04943 for ; Fri, 12 Mar 1999 22:17:26 +0100 (CET) Received: from k9d4 (k9d4.isdn-adv.telia.com [195.198.192.68]) by d1o71.telia.com (8.8.8/8.8.5) with SMTP id WAA19200 for ; Fri, 12 Mar 1999 22:17:20 +0100 (MET) From: "Lennart Blomstrom" To: Subject: vlan Date: Fri, 12 Mar 1999 22:20:39 +0100 Message-ID: <001101be6cce$2d8f9580$44c0c6c3@k9d4.isdn-adv.telia.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook 8.5, Build 4.71.2232.26 In-Reply-To: <000601be6a00$ecbce820$0102a8c0@milk.newtoy.com> Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Hi I've tried to use vlan (if_vlan.c ) on 3.0 and 3.1 release . I've made a "hack" to set "parent" and "vlan#" via SIOCSETVLAN and I have changed pci/id_de.c to accept mtu > 1500. I've set MTU to 1504 on de1, used it as parent if. I'm useing an Compaq 3322 sw . It works well with ICMP and UDP and frames up to 1500 bytes, but when I try TCP (telnet or http) I get a panic. Trap 12 supervisor read, page not present. Anybody got vlan working for TCP sessions ? Am I completle off ? Please help and give me a hint where to go on. /lahna To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Fri Mar 12 13:29:14 1999 Delivered-To: freebsd-net@freebsd.org Received: from frmug.org (frmug-gw.frmug.org [193.56.58.252]) by hub.freebsd.org (Postfix) with ESMTP id BDC4B14D1C for ; Fri, 12 Mar 1999 13:28:58 -0800 (PST) (envelope-from roberto@keltia.freenix.fr) Received: (from uucp@localhost) by frmug.org (8.9.1/frmug-2.3/nospam) with UUCP id WAA18272 for freebsd-net@FreeBSD.ORG; Fri, 12 Mar 1999 22:28:30 +0100 (CET) (envelope-from roberto@keltia.freenix.fr) Received: by keltia.freenix.fr (Postfix, from userid 101) id 00F1A883F; Fri, 12 Mar 1999 22:22:51 +0100 (CET) Date: Fri, 12 Mar 1999 22:22:51 +0100 From: Ollivier Robert To: freebsd-net@FreeBSD.ORG Subject: Re: rjoe Message-ID: <19990312222251.A17758@keltia.freenix.fr> Mail-Followup-To: freebsd-net@FreeBSD.ORG References: <199903122013.OAA23622@sierrahill.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii User-Agent: Mutt/0.95.3i In-Reply-To: <199903122013.OAA23622@sierrahill.com>; from Joe Schwartz on Fri, Mar 12, 1999 at 02:13:45PM -0600 X-Operating-System: FreeBSD 4.0-CURRENT/ELF ctm#5130 AMD-K6 MMX @ 200 MHz Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org According to Joe Schwartz: > Does anyone know of an easy way to create all these accounts? or has > anyone done something similar? > > Perhaps a combination of perl & expect? It should be fairly easy to take the file and feed everything to pw(8) in a loop... pw(8) is your friend. -- Ollivier ROBERT -=- FreeBSD: The Power to Serve! -=- roberto@keltia.freenix.fr FreeBSD keltia.freenix.fr 4.0-CURRENT #70: Sat Feb 27 09:43:08 CET 1999 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Fri Mar 12 13:50:40 1999 Delivered-To: freebsd-net@freebsd.org Received: from khavrinen.lcs.mit.edu (khavrinen.lcs.mit.edu [18.24.4.193]) by hub.freebsd.org (Postfix) with ESMTP id D901F14CD4 for ; Fri, 12 Mar 1999 13:50:37 -0800 (PST) (envelope-from wollman@khavrinen.lcs.mit.edu) Received: (from wollman@localhost) by khavrinen.lcs.mit.edu (8.9.1/8.9.1) id QAA06967; Fri, 12 Mar 1999 16:50:02 -0500 (EST) (envelope-from wollman) Date: Fri, 12 Mar 1999 16:50:02 -0500 (EST) From: Garrett Wollman Message-Id: <199903122150.QAA06967@khavrinen.lcs.mit.edu> To: "Lennart Blomstrom" Cc: Subject: vlan In-Reply-To: <001101be6cce$2d8f9580$44c0c6c3@k9d4.isdn-adv.telia.com> References: <000601be6a00$ecbce820$0102a8c0@milk.newtoy.com> <001101be6cce$2d8f9580$44c0c6c3@k9d4.isdn-adv.telia.com> Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org < said: > I've tried to use vlan (if_vlan.c ) on 3.0 and 3.1 release . > I've made a "hack" to set "parent" and "vlan#" via SIOCSETVLAN and I have > changed pci/id_de.c to accept mtu > 1500. Don't do this. Instead, increase the advertised header length by four. > Trap 12 > supervisor read, page not present. > Anybody got vlan working for TCP sessions ? There is nothing special about TCP as far as the network interface layer is concerned. You haven't come close to giving us enough information to debug this problem. For starters, how about a stack backtrace? Kernel configuration? Are you using BPF? (If so, there was a serious bug in the BPF handling of the vlan driver which may not be fixed in 3.x.) -GAWollman -- Garrett A. Wollman | O Siem / We are all family / O Siem / We're all the same wollman@lcs.mit.edu | O Siem / The fires of freedom Opinions not those of| Dance in the burning flame MIT, LCS, CRS, or NSA| - Susan Aglukark and Chad Irschick To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Fri Mar 12 13:59:23 1999 Delivered-To: freebsd-net@freebsd.org Received: from cyberus.ca (mail.cyberus.ca [209.195.95.1]) by hub.freebsd.org (Postfix) with ESMTP id 4390215389 for ; Fri, 12 Mar 1999 13:59:21 -0800 (PST) (envelope-from waynem@cyberus.ca) Received: from tytus (tytus.blackgate.com [209.195.67.253]) by cyberus.ca (8.8.8/Cyberus Online Inc) with SMTP id QAA18127 for ; Fri, 12 Mar 1999 16:59:02 -0500 (EST) From: "Wayne MacLaurin" To: Subject: Problem with mpd2.0b1 Date: Fri, 12 Mar 1999 17:01:46 -0500 Message-ID: <004101be6cd3$ebcc8120$fd43c3d1@tytus.blackgate.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook 8.5, Build 4.71.2232.26 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Importance: Normal Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Hi... We are having two separate problem with mpd2.0b1 running on FreeBSD 2.1.7. We have two systems with four internal USR 33.6 Sportster modems. 1) If we build a bundle with more than two modems, when the systems connect both ends simultaneously dump core (segv). 2) Not matter how many modems (1 or 2) we try to connect and no matter what "Connect" speed is reported back by the chat script, the "bandwidth" report is always 9600. Even when it does connect with two modems, the bandwidth is always 9600. I've seen Connect messages of 14400, 21600 and various others... Also, a "ping" between the units is always around 150ms regardless of the number of modems that have actually linked. Any ideas ???? ____________________ Wayne MacLaurin Cyberus Online Inc. waynem@cyberus.ca To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Fri Mar 12 15: 0: 9 1999 Delivered-To: freebsd-net@freebsd.org Received: from at.dotat.com (zed.dotat.com [203.2.134.254]) by hub.freebsd.org (Postfix) with ESMTP id 9E6B014C1B for ; Fri, 12 Mar 1999 15:00:01 -0800 (PST) (envelope-from hart@at.dotat.com) Received: from at.dotat.com (localhost.dotat.com [127.0.0.1]) by at.dotat.com (8.8.8/8.8.8) with ESMTP id JAA06858; Sat, 13 Mar 1999 09:29:32 +1030 (CST) Message-Id: <199903122259.JAA06858@at.dotat.com> To: "Wayne MacLaurin" Cc: freebsd-net@FreeBSD.ORG Subject: Re: Problem with mpd2.0b1 In-reply-to: Your message of "Fri, 12 Mar 1999 17:01:46 CDT." <004101be6cd3$ebcc8120$fd43c3d1@tytus.blackgate.com> Date: Sat, 13 Mar 1999 09:29:32 +1030 From: Leigh Hart Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Hi Wayne, "Wayne MacLaurin" wrote: > > We are having two separate problem with mpd2.0b1 running on FreeBSD 2.1.7. > We have two systems with four internal USR 33.6 Sportster modems. > > 1) If we build a bundle with more than two modems, when the systems connect > both ends simultaneously dump core (segv). Never had that problem, then again, all the machines I've used are running FreeBSD 2.2.5 or later - have you considered upgrading, or at least trying mpd on a FreeBSD-more-recent-release? > 2) Not matter how many modems (1 or 2) we try to connect and no matter what > "Connect" speed is reported back by the chat script, the "bandwidth" report > is always 9600. Even when it does connect with two modems, the bandwidth is > always 9600. I've seen Connect messages of 14400, 21600 and various > others... That's wierd. I'd check your config carefully again, email me off-list if this persists, I can dig up an old working config from a customer's server at work (only two modems per end, but it certainly reports the bandwidth at a much higher rate than you describe). > Also, a "ping" between the units is always around 150ms regardless of the > number of modems that have actually linked. MPPP increases bandWIDTH, not transmission time. The pipes still have the same speed characteristics (round trip time, latency, call it what you will), there's just more of them to carry data in parallel. Cheers Leigh -- | "By the time they had diminished | Leigh Hart, | | from 50 to 8, the other dwarves | Dotat Communications Pty Ltd | | began to suspect 'Hungry' ..." | GPO Box 487 Adelaide SA 5001 | | -- Gary Larson, "The Far Side" | http://www.dotat.com/hart/ | To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Fri Mar 12 17:58: 8 1999 Delivered-To: freebsd-net@freebsd.org Received: from redbox.venux.net (redbox.venux.net [216.47.238.10]) by hub.freebsd.org (Postfix) with ESMTP id DB2AA152FC for ; Fri, 12 Mar 1999 17:58:06 -0800 (PST) (envelope-from matthew@venux.net) Received: from thunder (net177138.hcv.com [209.153.177.138]) by redbox.venux.net (Postfix) with SMTP for id 362FB2E20E; Fri, 12 Mar 1999 20:58:31 -0500 (EST) Message-Id: <4.1.19990312205138.00a4edc0@mail.venux.net> X-Sender: mhagerty@mail.venux.net X-Mailer: QUALCOMM Windows Eudora Pro Version 4.1 Date: Fri, 12 Mar 1999 20:57:53 -0500 To: freebsd-net@freebsd.org From: Matthew Hagerty Subject: UPD wildward for natd? Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Greetings, Is there a way to set all UDP ports to go to a single machine? I am finding out that any kind of streaming and/or personal messaging programs don't work so well behind a natd server. I was wondering if something like this would work: natd -permanent_link udp 10.0.0.12:0 0.0.0.0:0 0 -n ed1 The man page says that zeros are wildcards. I tried this, natd does not complain, but it does not seem to work either. Also, is there an RFC for natd? Thanks, Matthew To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Fri Mar 12 18:20:33 1999 Delivered-To: freebsd-net@freebsd.org Received: from mail.dynamixweb.com (host01.dynamixweb.com [209.47.109.194]) by hub.freebsd.org (Postfix) with ESMTP id 1B3E915389 for ; Fri, 12 Mar 1999 18:20:25 -0800 (PST) (envelope-from svetzal@icom.ca) Received: from blazer (cr609409-a.pr1.on.wave.home.com [24.112.98.34]) by mail.dynamixweb.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2232.9) id GV5GLGBD; Fri, 12 Mar 1999 21:24:26 -0500 From: "Steven Vetzal" To: Subject: RE: UPD wildward for natd? Date: Fri, 12 Mar 1999 21:21:56 -0500 Message-ID: <000001be6cf8$44929960$80fea8c0@blazer.pr1.on.wave.home.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0 In-Reply-To: <4.1.19990312205138.00a4edc0@mail.venux.net> Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4 Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Hi Matthew, > Is there a way to set all UDP ports to go to a single machine? I am > finding out that any kind of streaming and/or personal > messaging programs > don't work so well behind a natd server. I was wondering if I'm wondering what you mean there - I've been doing a lot with RealVideo and other technologies through natd on FreeBSD since about 2.2.7 (currently 3.0) on my own firewall. I've even used inbound redirection to serve Real content from my internal NT server through the firewall to the outside world. Mind you, I didn't put much time into testing. I haven't been able to fully get ICQ working, however, I believe because it's trying to make direct connections between remote hosts and hosts inside my firewall. Any know if I can just open up some inbound ports to my internal host? I haven't had a chance to trace it yet to figure things out... That would cause problems if you had multiple internal hosts running messaging software like ICQ. Too much admin to do, too little time 8^) Steve To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Fri Mar 12 18:23: 9 1999 Delivered-To: freebsd-net@freebsd.org Received: from mail.dynamixweb.com (host01.dynamixweb.com [209.47.109.194]) by hub.freebsd.org (Postfix) with ESMTP id 03FDC14D54 for ; Fri, 12 Mar 1999 18:23:07 -0800 (PST) (envelope-from svetzal@icom.ca) Received: from blazer (cr609409-a.pr1.on.wave.home.com [24.112.98.34]) by mail.dynamixweb.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2232.9) id GV5GLGBF; Fri, 12 Mar 1999 21:27:09 -0500 From: "Steven Vetzal" To: Subject: GRE/PPTP through NATD Date: Fri, 12 Mar 1999 21:24:42 -0500 Message-ID: <000101be6cf8$a7ef0020$80fea8c0@blazer.pr1.on.wave.home.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0 Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4 Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Greetings, Does anyone know of any efforts out there to get GRE or PPTP working (either through proxy or other methods) through natd on FreeBSD? I've seen some proxy methods documented for Linux, but their IP masquerading doesn't seem as complete as our natd, so I'd rather not switch platforms. Steve To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Sat Mar 13 23:43:50 1999 Delivered-To: freebsd-net@freebsd.org Received: from tch.org (tacostand.tch.org [199.74.220.9]) by hub.freebsd.org (Postfix) with ESMTP id E326014F33 for ; Sat, 13 Mar 1999 23:43:48 -0800 (PST) (envelope-from ser@tch.org) Received: (from ser@localhost) by tch.org (8.9.1/8.9.1) id XAA00764; Sat, 13 Mar 1999 23:43:29 -0800 (PST) (envelope-from ser) Date: Sat, 13 Mar 1999 23:43:29 -0800 From: Steve Rubin To: Jesse Cc: freebsd-net@freebsd.org Subject: Re: routing based on source address Message-ID: <19990313234328.A758@tch.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.3i In-Reply-To: ; from Jesse on Fri, Feb 26, 1999 at 01:53:50AM -0800 Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Paul Vixie has a hack for this for NetBSD I beleive, you might want to dig around on his ftp server (ftp.vix.com) for it. On Fri, Feb 26, 1999 at 01:53:50AM -0800, Jesse wrote: > > Hi, > > I have a box hooked up to a network with access to two seperate lines > going to two seperate networks (206.x.x.x for link #1 and 207.x.x.x for > link #2). The machine has IP addresses on both IP ranges. The default > gateway is 207.x.x.1. > > I'm running a server which is bound to a 206.x.x.x IP. However, since my > default gateway is 207.x.x.1, it sends all data out on link #2 but > receives incoming data over link #1. This means that if either link #1 or > link #2 is down, I'm effectively dead in the water. > > Is there any way to tell my box that for all data going out of it with a > /source/ address of 206.x.x.x should be sent through the 206.x.x.1 > gateway? I know I can do this based on destination, but I have no clue how > to do it based on source (and unfortunately I can't predict the addresses > of all the clients I'll be communicating with). > > Hope someone has some ideas. Thanks in advance. > > --- > Jesse > http://www.lumiere.net/ > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-net" in the body of the message -- Steve Rubin ser@tch.org TCH Network Services http://www.tch.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message