Networking Forums

Networking Forums > Computer Networking > Linux Networking > Bridging problems when working in Ad-Hoc mode [PROBLEM]

Reply
Thread Tools Display Modes

Bridging problems when working in Ad-Hoc mode [PROBLEM]

 
 
Slaytanic
Guest
Posts: n/a

 
      03-13-2007, 04:19 PM
Hi,
I'm doing some tests with two access points with Atheros 5212 802.11a/
b/g/h
wireless cards and I'm having some problems with bridging which I
explain below..

LAPTOP <-ethernet-> AP1 <-wireless-> AP2

I configured AP1 in Master mode and then AP2 in Managed mode, then I
bridged the
Ethernet and Atheros interfaces on AP1 (and also on AP2, even if it is
not
connected via ethernet): AP2 is able to ping LAPTOP without any
problem and also
the opposite works. If I configure AP1 and AP2 wireless interfaces in
Ad-hoc
mode, then AP2 is no more able to ping LAPTOP: the broadcast ARP
Request sent by
AP2 is correctly forwarded by br0 on AP1 and it is received by LAPTOP;
then also
the unicast ARP Reply is received by AP2, but AP2 still does not ping
LAPTOP. I
saw also that AP2 continuously repeat the following "cycle": it sends
three
unicast ARP requests to the MAC address of LAPTOP (maybe to refresh
the ARP
cache..), which receive no answers, and then it sends another
broadcast ARP
request, which receives the correct reply (but ping doesn't start to
work).

Now comes the strange thing: I wanted to understand what was happening
and so I
created another virtual interface on the wireless interface of AP1
(the
AP-in-the-middle) and set it into Monitor mode (I though it could have
been
useful to sniff also the unicast frames not directed to AP1). As soon
as the
monitor interface is created, AP2 starts pinging LAPTOP O_o
I repeated the test twice and bridging between AP2 and LAPTOP starts
working
correctly as soon as I execute "wlanconfig mon0 create wlandev wifi0
wlanmode
monitor" (it happened that ping stopped working, and a simple
"ifconfig mon0
0.0.0.0" on AP1 made it work again).

This trick does not completely solve my problem: when AP1 and AP2 are
configured
in Master/Managed modes, respectively, iperf gives me about 28Mbps on
the
wireless link and 8Mbps between AP1 and LAPTOP and between AP2 and
LAPTOP (the
ethernet link is the bottleneck since I'm using a 10Mbit Ethernet
PCMCIA adapter
on the laptopm but it is not a problem); when AP2 and AP1 are
configured in
ad-hoc mode (and after the monitor trick), iperf still gives 28Mbps on
the
wireless link, while if the communication goes over the wired link
(AP1-LAPTOP
or AP2-LAPTOP) we have less than 1Mbps, which is really bad..

I must precise that if I configure the AP-in-the-middle (AP1) in
Managed mode
and AP2 in Master mode, bridging has the same problems as with the Ad-
hoc
problem.. So, in practice, bridging works without any trick only if
the wireless
interface which is bridged is working in Master or in WDS (Repeater)
mode.

This is how I create the wireless interface in ad-hoc mode on both APs
(the
second half of the script is the interesting part):

#!/bin/sh

WIFI_ON=$(iwconfig 2>&1 | grep wifi0 -c)

if [[ ${WIFI_ON} -eq 0 ]] ; then
echo "No wifi0 found.. creating wireless devices.."
/usr/bin/my_scripts/create_wifidevs.sh
fi

MY_ADDR=$(ifconfig wifi0 | head -n 1 | sed "s:.*HWaddr \
(..-..-..-..-..-..\).*:\1:g" | sed "s:-:\::g")

if [[ ${MY_ADDR} == "00:0B:6B:4D:64:1F" ]] ; then
REMOTE_ADDR="00:0B:6B:4E:99:74"
IP="192.168.3.100"
elif [[ ${MY_ADDR} == "00:0B:6B:4E:99:74" ]] ; then
REMOTE_ADDR="00:0B:6B:4D:64:1F"
IP="192.168.3.101"
else
echo "BUG.."
exit
fi

echo "Creating ad-hoc interface.."
wlanconfig ath0 create wlandev wifi0 wlanmode adhoc
iwconfig ath0 essid "test-adhoc"
iwpriv ath0 mode 11a
iwconfig ath0 channel 36
iwpriv ath0 wds 1
iwconfig ath0 txpower 0

echo "${MY_ADDR} --> ${REMOTE_ADDR}"
echo "Setting ath0 ip to ${IP}"
ifconfig ath0 ${IP} up



And this is how I bridge the ath0 (wireless) and ixp0 (Ethernet)
interfaces:

#!/bin/sh

WIFI_ON=$(iwconfig 2>&1 | grep wifi0 -c)

if [[ ${WIFI_ON} -eq 0 ]] ; then
echo "No wifi0 found.. creating wireless devices.."
/usr/bin/my_scripts/create_wifidevs.sh
fi

MY_ADDR=$(ifconfig wifi0 | head -n 1 | sed "s:.*HWaddr \
(..-..-..-..-..-..\).*:\1:g" | sed "s:-:\::g")

if [[ ${MY_ADDR} == "00:0B:6B:4D:64:1F" ]] ; then
#REMOTE_ADDR="00:0B:6B:4E:99:74"
IP="192.168.2.100"
elif [[ ${MY_ADDR} == "00:0B:6B:4E:99:74" ]] ; then
#REMOTE_ADDR="00:0B:6B:4D:64:1F"
IP="192.168.2.101"
else
echo "BUG.."
exit
fi

echo "Bridging interfaces under br0 with ip ${IP}"

ifconfig ath0 0.0.0.0
ifconfig ixp0 0.0.0.0
brctl addbr br0
brctl addif br0 ath0
brctl addif br0 ixp0
ifconfig br0 ${IP} up


Some info from DMESG:
<6>ath_hal: 0.9.17.1 (AR5212, RF5111, RF5112, RF2413, RF5413,
PRIVATE_DIAG)
<6>wlan: 0.8.4.2 (svn r1995)
<6>ath_rate_sample: 1.2 (svn r1995)
<6>ath_pci: 0.9.4.5 (svn r1995)
<4>PCI: enabling device 0000:00:01.0 (0340 -> 0342)
<4>wifi0: 11a rates: 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps
54Mbps
<4>wifi0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps
<4>wifi0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps
18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
<4>wifi0: turboG rates: 6Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps
54Mbps
<4>wifi0: H/W encryption support: WEP AES AES_CCM TKIP
<4>wifi0: mac 5.9 phy 4.3 radio 3.6 country 380
<4>wifi0: Use hw queue 1 for WME_AC_BE traffic
<4>wifi0: Use hw queue 0 for WME_AC_BK traffic
<4>wifi0: Use hw queue 2 for WME_AC_VI traffic
<4>wifi0: Use hw queue 3 for WME_AC_VO traffic
<4>wifi0: Use hw queue 8 for CAB traffic
<4>wifi0: Use hw queue 9 for beacons
<6>wifi0: Atheros 5212: mem=0x48000000, irq=28




Can you explain me why the monitor trick on AP1 makes AP2 start
pinging LAPTOP
and why the performance is so bad when I do the trick and bridging
starts
working?

Thank you in advance for any suggestion,
Gianni

 
Reply With Quote
 
 
 
 
Slaytanic
Guest
Posts: n/a

 
      03-14-2007, 07:52 AM
On 13 Mar, 18:19, "Slaytanic" <gianni.costa...@gmail.com> wrote:
>
> I must precise that if I configure the AP-in-the-middle (AP1) in
> Managed mode
> and AP2 in Master mode, bridging has the same problems as with the Ad-
> hoc
> problem.. So, in practice, bridging works without any trick only if
> the wireless
> interface which is bridged is working in Master or in WDS (Repeater)
> mode.


Correction: the AP-in-the-middle did not work as bridge if configured
in Managed mode because I didn't enable the 4-address format (iwpriv
ath0 wds 1).. If I enable it, it works fine.. so, maybe, the driver
does not handle the 4-address format of the frames when working in ad-
hoc mode..

 
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Wireless Output Status while D-Link 2640b is in Bridging Mode GlowingBlueMist Network Routers 4 03-03-2011 02:03 AM
Bridging mode.... wifi security? lilmansplaces Broadband Hardware 5 12-16-2004 05:10 PM
Bridging mode in Belkin or Netgear Access point? Steevo@my-deja.com Wireless Internet 0 05-25-2004 10:10 PM
Setting up WEP in Bridging Mode Brandon Broadband Hardware 6 01-24-2004 05:36 PM
Problems Bridging/Firewalling.. CHARLES THOLEN Linux Networking 2 01-18-2004 06:05 AM



1 2 3 4 5 6 7 8 9 10 11