linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ben Greear <greearb@candelatech.com>
To: Adrian Chadd <adrian@freebsd.org>
Cc: Sam Leffler <sleffler@google.com>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Subject: Re: Bridging wired to STA interfaces.
Date: Thu, 25 Aug 2011 11:17:55 -0700	[thread overview]
Message-ID: <4E5691D3.6060800@candelatech.com> (raw)
In-Reply-To: <CAJ-VmomygMyc-DxP7btY7yitiZ4Esw17goEo0BXcC8Bj_toqbQ@mail.gmail.com>

On 08/11/2011 01:48 AM, Adrian Chadd wrote:
> On 11 August 2011 15:14, Ben Greear<greearb@candelatech.com>  wrote:
>
>> I think I'll just force user to create an STA with matching MAC (for the
>> MAC of the PC/whatever to be bridged).  Ath9k and ath5k can support at
>> least 128 stations, so that will be plenty for our uses...
>>
>> We saw some problems changing MAC on STA after they were created, but
>> it seems to be ok if we just create it with correct STA the first time,
>> and we'll try to figure out why changing MAC was acting weird as well.
>
> Oh wow, that's a cool use of multi-STA support. Now I want to get it
> working in FreeBSD.
>
> I think I may need to corner you sometime and sort out exactly how
> this works. Nice thinking Ben!

Just to follow up on this, I believe I now have this working
with a user-space bridge.  It's part of my proprietary app, but
here's the basic algorithm in case someone else wants to try
this:

Network setup:

server -- AP {{{}}} station-bridge  -- clients

For each client, create a virtual station on the station-bridge machine
with the same MAC as the client.

Packets coming in a station interface are sent out the wired interface
unless they are 802.1X frames (0x888e ethernet type).  These
are just dropped.  If destination MAC is broadcast, it is changed
to be that of the STA's MAC.  This is probably not required, but seems
a good optimization and I cannot think of any reason not to...I may be
wrong however.

Packets coming in the ethernet interface are mapped onto the STA that
matches the source MAC of the ethernet frame.  Packets that do not match
are silently discarded.

You have to explicitly disable IPv4/6 routing on the bridge interfaces
or the OS might try to route them.  You should also disable ARP and such.
You must remove all IP addresses from the bridge interfaces.  You should
probably disable LRO and such as well.  In general, the idea is to make
the packet socket the only active consumer of the packets so that the OS
doesn't muck with things and toss un-expected packets onto the network.

Use packet sockets to read/write the packets.


This could all be done in the kernel, but aside from saving some packet
copies to/from user-space, it seems like a user-space app is sufficient.

I tested this with ath9k in the AP and virtual station machines.  The
pertinent bits should be available in standard upstream kernels,
but we're using our hacked kernels.

If anyone writes a stand-alone app to do this, I'm interested to know.

Thanks,
Ben


-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com


      reply	other threads:[~2011-08-25 18:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-03  5:33 Bridging wired to STA interfaces Ben Greear
2011-08-03  9:16 ` Adrian Chadd
2011-08-03 16:37   ` Ben Greear
2011-08-03 22:37 ` Sam Leffler
2011-08-04  0:44   ` Ben Greear
2011-08-09 18:11     ` Sam Leffler
2011-08-11  7:14       ` Ben Greear
2011-08-11  8:48         ` Adrian Chadd
2011-08-25 18:17           ` Ben Greear [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E5691D3.6060800@candelatech.com \
    --to=greearb@candelatech.com \
    --cc=adrian@freebsd.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=sleffler@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).