[Ns-developers] bridging and wifi
Mathieu Lacage
mathieu.lacage at sophia.inria.fr
Mon Aug 25 13:58:25 PDT 2008
On Mon, 2008-08-25 at 21:48 +0100, Gustavo Carneiro wrote:
> For simplicity, let's say that wifi network is adhoc.
>
> This is an assumption with serious implications. I don't think this
> would ever work, conceptually, with wifi in adhoc mode because adhoc
> mode frames only use two addresses. It has to be in infrastructure
> mode, because then frames have 3 addresses.
ok
> At this point, I got a bit stomped and went back to some
> serious wifi
> spec reading and thinking but I still don't really know how
> that is
> expected to work. Gustavo, do you have any idea ?
>
> I think I have an idea.
>
> As I mentioned before, wifi has to be in infrastructure mode, adhoc
> won't work (incidentally trying to do bridging in Linux with cards in
> adhoc mode is a mistake I often used to make in the past).
>
> The 802.11 frame has a total of four addresses, which have the
> following meaning in infrastructure mode (this table comes from
> somewhere deep in the 802.11 standard):
>
>
> /*
> * To DS From DS Address 1 Address 2 Address 3
> Address 4
>
> *----------------------------------------------------------------------
> * 0 0 Destination Source BSSID N/A
> * 0 1 Destination BSSID Source N/A
> * 1 0 BSSID Source Destination N/A
> * 1 1 Receiver Transmitter Destination
> Source
> */
>
> The ARP response, as transmitted by node 3, is of the type ToDS=1,
> FromDS=0, therefore Address 1 is the BSSID (AP netdevice MAC), Address
> 2 is mac3, Address 3 is mac1, and Address 4 is not used. The Access
> Point (node2) will receive a frame whose BSSID is itself and so will
> send a Wifi ACK back to the source (Address 2 == mac3).
I more or less reached the same kind of conclusion here but, what
bothers me is that if I make node 3 be the AP and node 2 be a STA, it
won't work, right ?
> At this point, the promiscuous receive callback in node2 will send
> back to the BridgeNetDevice the original source and destination, i.e.
> Address 2 and 3. Likewise, when the AP (node2) sends a frame being
> bridged from node 1 to node 3, via the new SendFrom API, it should
> consider the ToDS=0, FromDS=1 line in the table above, and so in this
> example Address1=mac3, Address2=mac2, Address3=mac1.
More information about the Ns-developers
mailing list