From owner-freebsd-net Fri Sep 4 00:59:49 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id AAA19376 for freebsd-net-outgoing; Fri, 4 Sep 1998 00:59:49 -0700 (PDT) (envelope-from owner-freebsd-net@FreeBSD.ORG) Received: from labinfo.iet.unipi.it (labinfo.iet.unipi.it [131.114.9.5]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id AAA19348 for ; Fri, 4 Sep 1998 00:59:38 -0700 (PDT) (envelope-from luigi@labinfo.iet.unipi.it) Received: from localhost (luigi@localhost) by labinfo.iet.unipi.it (8.6.5/8.6.5) id GAA12680; Fri, 4 Sep 1998 06:17:27 +0200 Newsgroups: comp.unix.bsd.freebsd.misc Date: Fri, 4 Sep 1998 06:17:23 +0200 (MET DST) From: Luigi Rizzo cc: net@FreeBSD.ORG Subject: Re: FreeBSD router performance In-Reply-To: <6s9bnj$34e@walton.maths.tcd.ie> 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 [Cc to net@freebsd.org since i think it is somewhat interesting there] On 29 Aug 1998, David Malone wrote: > Subject: Re: FreeBSD router performance ... > >host and the router. However, when I measure throughput from one host to > >the other, I'm only getting ~200Kbps. The router is obviously the ... > You'd probably get a big improvement by buying two good PCI > ethernet cards. The Digital tulip cards and the Intel Etherexpress as others probably commented, in the above case there is some severe misconfiguration problem. This said, in the last days i have instrumented the networking code to see how long it takes to output a packet (roughtly the last part of ether_output() with the call to if_start, which is what you generally get). Measured in Pentium 90 timer ticks, here are the results: 1K pkt, NE2000-PCI ("ed" driver) 25.000 ticks 512B pkt, NE2000-PCI ("ed" driver) 15.000 ticks 1K pkt, LANCE-PCI ("lnc" driver) 5.000 ticks 1K pkt, DE21140-PCI 100Mbit ("de" driver) 1.000 ticks as a reference, a call to m_copy() on the same machine for a 1K pkt all in an mbuf cluster takes about 700ticks. On the "ed" driver, the driver itself has to make a copy of the packet to the card using outsw(), so the time scales approx. linearly with pkt size. The "lnc" driver is slightly better (although i am not sure if it used a shared memory buffer on the card or direct DMA). Finally, the 21140 uses direct dma from the mbuf so it saves a lot of the copy overhead. If i can put my hands on other cards I will try to produce more numbers. Assuming you can expect an equivalent number of ticks in the receive processing path and another 1000 or so ticks for forwarding (actually, for bridging i have measured a shorter time), you can derive that on a P5-90 you cannot expect to forward more than some 30.000 pkts/s (very optimistic) with a "de" card, and more like 8-9000 pkts/s with a LANCE (or a n "ed" and short pkts). A faster machine might improve performance but not certainly by more than 1 order of magnitude. cheers -----------------------------+-------------------------------------- Luigi Rizzo | Dip. di Ingegneria dell'Informazione email: luigi@iet.unipi.it | Universita' di Pisa tel: +39-50-568533 | via Diotisalvi 2, 56126 PISA (Italy) fax: +39-50-568522 | http://www.iet.unipi.it/~luigi/ _____________________________|______________________________________ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message