2011-09-14 11:27:15

by Harshal Chhaya

[permalink] [raw]
Subject: Latency and connection problems with a carl9170-based AP

Hello,

I am working on a TI-OMAP3 + AR9170 based AP. The carl9170 driver is
version 1.9.2 and the firmware is version 1.9.4. The rest of the
system is a couple of months old compat-wireless configuration on a
2.6.37 kernel.

The network is pretty usable when no clients enable WLAN power save.
However, when power save is enabled, I see lots of disconnects and
instability in the system. The clients are using legacy power save
mechanisms (using 'null' packets to indicate going in and coming out
of power save to the AP).

Most of the disconnects seem to be caused by beacons that update the
TIM IE but not the overall length. The result is a corrupted RSN IE
(e.g. the IE length says 20 bytes but the IE is only 19 bytes in size)
which causes the clients to disconnect. This problem lasts for only
one beacon (i.e. the next beacon has the right size) but it is enough
to cause the clients to disconnect. Is there a way to fix this?

Another problem when power save is enabled is the large and
unpredictable latency. I understand how enabling power save can
increase latency but my ping times go from 3-4 ms without power save
to a wide range of 3 ms - 3 s after I enable power save. I am trying
smaller beacon intervals to reduce this latency but even at a beacon
interval of 25ms, I get ping times of up to ~400 ms. How do I reduce
this wide variation in latency.

Thanks for your help.

Regards,
- Harshal


2011-09-14 17:32:15

by Christian Lamparter

[permalink] [raw]
Subject: Re: Latency and connection problems with a carl9170-based AP

On Wednesday, September 14, 2011 01:19:59 PM Harshal Chhaya wrote:
> Most of the disconnects seem to be caused by beacons that update the
> TIM IE but not the overall length. The result is a corrupted RSN IE
> (e.g. the IE length says 20 bytes but the IE is only 19 bytes in size)
> which causes the clients to disconnect. This problem lasts for only
> one beacon (i.e. the next beacon has the right size) but it is enough
> to cause the clients to disconnect. Is there a way to fix this?
Now that is really interesting. Do you know if the TIM IE is generated
properly by ieee80211_beacon_add_tim in net/mac80211/tx.c?

> Another problem when power save is enabled is the large and
> unpredictable latency. I understand how enabling power save can
> increase latency but my ping times go from 3-4 ms without power save
> to a wide range of 3 ms - 3 s after I enable power save. I am trying
> smaller beacon intervals to reduce this latency but even at a beacon
> interval of 25ms, I get ping times of up to ~400 ms. How do I reduce
> this wide variation in latency.
What's the listen interval of your stations?
Maybe max_listen_interval=1 in hostapd.conf helps.

Regards,
Chr

2011-09-14 17:38:42

by Johannes Berg

[permalink] [raw]
Subject: Re: Latency and connection problems with a carl9170-based AP

On Wed, 2011-09-14 at 19:32 +0200, Christian Lamparter wrote:
> On Wednesday, September 14, 2011 01:19:59 PM Harshal Chhaya wrote:
> > Most of the disconnects seem to be caused by beacons that update the
> > TIM IE but not the overall length. The result is a corrupted RSN IE
> > (e.g. the IE length says 20 bytes but the IE is only 19 bytes in size)
> > which causes the clients to disconnect. This problem lasts for only
> > one beacon (i.e. the next beacon has the right size) but it is enough
> > to cause the clients to disconnect. Is there a way to fix this?
> Now that is really interesting. Do you know if the TIM IE is generated
> properly by ieee80211_beacon_add_tim in net/mac80211/tx.c?

Hm, looking at that code, is it really correct?

tim = pos = (u8 *) skb_put(skb, 6);
*pos++ = WLAN_EID_TIM;
*pos++ = 4;
...
tim[1] = n2 - n1 + 4;
skb_put(skb, n2 - n1);


shouldn't the latter be skb_put(skb, n2 - n1 - 2)?

But that'd be the other way around I guess...

johannes


2011-09-14 17:59:27

by Johannes Berg

[permalink] [raw]
Subject: Re: Latency and connection problems with a carl9170-based AP

On Wed, 2011-09-14 at 19:38 +0200, Johannes Berg wrote:
> On Wed, 2011-09-14 at 19:32 +0200, Christian Lamparter wrote:
> > On Wednesday, September 14, 2011 01:19:59 PM Harshal Chhaya wrote:
> > > Most of the disconnects seem to be caused by beacons that update the
> > > TIM IE but not the overall length. The result is a corrupted RSN IE
> > > (e.g. the IE length says 20 bytes but the IE is only 19 bytes in size)
> > > which causes the clients to disconnect. This problem lasts for only
> > > one beacon (i.e. the next beacon has the right size) but it is enough
> > > to cause the clients to disconnect. Is there a way to fix this?
> > Now that is really interesting. Do you know if the TIM IE is generated
> > properly by ieee80211_beacon_add_tim in net/mac80211/tx.c?
>
> Hm, looking at that code, is it really correct?
>
> tim = pos = (u8 *) skb_put(skb, 6);
> *pos++ = WLAN_EID_TIM;
> *pos++ = 4;
> ...
> tim[1] = n2 - n1 + 4;
> skb_put(skb, n2 - n1);
>
>
> shouldn't the latter be skb_put(skb, n2 - n1 - 2)?

Nah, I'm just confused.

johannes