From owner-freebsd-net@FreeBSD.ORG Thu Dec 15 19:21:54 2005 Return-Path: X-Original-To: freebsd-net@freebsd.org Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C9AE916A41F for ; Thu, 15 Dec 2005 19:21:54 +0000 (GMT) (envelope-from sam@errno.com) Received: from ebb.errno.com (ebb.errno.com [69.12.149.25]) by mx1.FreeBSD.org (Postfix) with ESMTP id C626843D68 for ; Thu, 15 Dec 2005 19:21:47 +0000 (GMT) (envelope-from sam@errno.com) Received: from [10.0.0.192] ([10.0.0.192]) (authenticated bits=0) by ebb.errno.com (8.12.9/8.12.6) with ESMTP id jBFJLgA8008313 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 15 Dec 2005 11:21:47 -0800 (PST) (envelope-from sam@errno.com) Message-ID: <43A1C208.5030309@errno.com> Date: Thu, 15 Dec 2005 11:20:40 -0800 From: Sam Leffler Organization: Errno Consulting User-Agent: Mozilla Thunderbird 1.0.7 (Macintosh/20050923) X-Accept-Language: en-us, en MIME-Version: 1.0 To: nielsen@memberwebs.com References: <20051215165651.DF16670DDA6@mail.npubs.com> In-Reply-To: <20051215165651.DF16670DDA6@mail.npubs.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-net@freebsd.org Subject: Re: Bridging atheros/ethernet seems incredibly slow X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Dec 2005 19:21:55 -0000 Nate Nielsen wrote: > Has anyone else seen a problem where bridging an Atheros wireless with > an ethernet interface has painfully slow throughput? > > I have two boxes sitting next to each other both running FreeBSD 6.0. > > BOX 1 BOX 2 > ---- A +++++++++++ B/C ----- > > Two Atheros (5213) 802.11a cards (A and B above) are connected to each > other using adhoc mode. I can get roughly 10+ Mbps of throughput between > A and B (measured using iperf, flood pings, simple tcp transfer). > > One box has it's wireless NIC (ie: B above) bridged with an ethernet > interface (ie: C above). Throughput to the ethernet nic is nice and > high (20+ Mbps). > > However when sending traffic through the bridge, the transfer rate drops > below 500Kbps. > > Non issues: > - The CPU's on neither box are being taxed. > - I've tried both bridge(4) and if_bridge(4). Same results. > - Locking down the wireless speed doesn't help (just a wild guess). adhoc mode is not intended for bridging; I'm a bit surprised it works at all (I've never tried it). There are special hacks in ieee80211_deliver_data specific to hostap. Andrew Atrens recently hit a similar problem in a similar config and diagnosed it as promiscuous mode causing retransmits over the wireless network (the bridge forces the interface into promiscuous mode). > > Interesting things: > > Running 'ifconfig ath0 list sta' on BOX 1 shows all sorts of mac > addresses on the BOX 2 side of the network. The first is the wireless > adhoc peer. Maybe that's to be expected: > > >>ADDR AID CHAN RATE RSSI IDLE TXSEQ RXSEQ CAPS ERP >>00:01:b4:02:0d:e7 0 52 6M 43 0 258 33072 I 0 >>00:30:48:76:55:4a 0 52 6M 43 15 7 32016 0 >>00:11:43:d1:07:7d 0 52 6M 43 15 0 32528 0 >>00:48:54:70:10:09 0 52 6M 44 45 0 26368 0 >>00:0e:a6:91:60:c1 0 52 6M 44 105 0 16576 0 >>00:a0:cc:5e:b0:b6 0 52 6M 43 15 0 31344 0 >>00:20:ed:60:58:ac 0 52 6M 43 180 0 5600 0 >>00:0b:db:a3:68:91 0 52 6M 42 150 0 10688 0 >>00:0d:61:37:3e:36 0 52 6M 43 120 0 14896 0 >>00:02:e3:08:8b:d1 0 52 6M 41 45 0 28112 0 sta/neighbor entries are created on demand due to traffic. This means each frame coming through the bridge and out the wireless interface will cause an entry to be created. > > > Doing a flood ping from BOX A to a machine bridged across the link is > not lossy, instead the send rate is limited. That is, the ping packets > are sent slowly. > > athstats on BOX 2 shows: > > >>13 tx management frames >>7 tx frames discarded prior to association >>544 tx failed 'cuz too many retries >>6014 long on-chip tx retries >>876 tx frames with no ack marked >>1952 rx failed 'cuz frame too short >>5129 rx failed 'cuz of PHY err >> 1524 OFDM timing >> 3605 OFDM illegal rate >>1 beacons transmitted >>91 periodic calibrations >>rssi of last ack: 36 >>avg recv rssi: 38 >>1 switched default/rx antenna >>Antenna profile: >>[1] tx 1192 rx 18513 >>[2] tx 68 rx 1 > > > Anyone have any ideas on where I should look for the problem? These are not the stats you want :) Look at the 802.11 layer. FWIW I recently reorgnized the tools and renamed them so the program you want is now called wlanstats and is found in tools/tools/net80211. Sam