set channel from radiotap headers during injection

2015-08-13 Thread Allan Matthew
I'd like to be able to set the channel information on a per-packet
basis during monitor-mode injection.  Specifically, I would like to be
able to change the channel bandwidth down to half and quarter rates
(my PHY supports this) based on the radiotap header information.
Additionally, if its possible to change the channel itself that would
be desirable.

I've been able to add rate and FEC control to
ieee80211_parse_tx_radiotap, but I'm not sure where to start with
setting channel information. Has anyone been able to do this?  If not,
what do I need to set in order to get per-packet channel control?
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: set channel from radiotap headers during injection

2015-08-14 Thread Allan Matthew
Anyone have any thoughts on this?

Is it possible with channel context enabled somehow?

On Thu, Aug 13, 2015 at 11:22 AM, Allan Matthew  wrote:
> I'd like to be able to set the channel information on a per-packet
> basis during monitor-mode injection.  Specifically, I would like to be
> able to change the channel bandwidth down to half and quarter rates
> (my PHY supports this) based on the radiotap header information.
> Additionally, if its possible to change the channel itself that would
> be desirable.
>
> I've been able to add rate and FEC control to
> ieee80211_parse_tx_radiotap, but I'm not sure where to start with
> setting channel information. Has anyone been able to do this?  If not,
> what do I need to set in order to get per-packet channel control?
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: set channel from radiotap headers during injection

2015-08-19 Thread Johannes Berg
On Fri, 2015-08-14 at 14:39 -0700, Allan Matthew wrote:
> Anyone have any thoughts on this?
> 
> Is it possible with channel context enabled somehow?
> 

I don't think it's possible - per-packet configuration would have to be
basically instantaneous (cannot sleep etc.) and setting the channel is
necessarily a much longer operation.

If your device supports channel contexts, you might be able to *pick*
the channel you want to inject on, but you could probably achieve that
through the existing MAC address selection that picks an interface.
It's also not clear how monitor + chanctx would work at all, since
monitor expects to be on the channel all the time.

You could possibly select other parameters like the bitrate, but the
channel width - especially 5/10 MHz - doesn't seem feasible.

johannes
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: set channel from radiotap headers during injection

2015-08-19 Thread Allan Matthew
Thank you Johannes,

It seems like the functionality for this (maybe not the monitor mode)
must be available in order to support the multiple 802.11p channels in
the 5.8ghz band.

It sounds like what you are proposing is to create a non-monitor vif,
select its channel, bitrate, bandwidth and then use the MAC address to
select it as the transmitting interface.  Is that correct?  I'm
guessing I could do this with raw sockets and prepend the ieee80211
header (but not the radiotap header)?

Thanks for the help!

On Wed, Aug 19, 2015 at 4:24 AM, Johannes Berg
 wrote:
> On Fri, 2015-08-14 at 14:39 -0700, Allan Matthew wrote:
>> Anyone have any thoughts on this?
>>
>> Is it possible with channel context enabled somehow?
>>
>
> I don't think it's possible - per-packet configuration would have to be
> basically instantaneous (cannot sleep etc.) and setting the channel is
> necessarily a much longer operation.
>
> If your device supports channel contexts, you might be able to *pick*
> the channel you want to inject on, but you could probably achieve that
> through the existing MAC address selection that picks an interface.
> It's also not clear how monitor + chanctx would work at all, since
> monitor expects to be on the channel all the time.
>
> You could possibly select other parameters like the bitrate, but the
> channel width - especially 5/10 MHz - doesn't seem feasible.
>
> johannes
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: set channel from radiotap headers during injection

2015-08-19 Thread Ben Greear

On 08/19/2015 04:24 AM, Johannes Berg wrote:

On Fri, 2015-08-14 at 14:39 -0700, Allan Matthew wrote:

Anyone have any thoughts on this?

Is it possible with channel context enabled somehow?



I don't think it's possible - per-packet configuration would have to be
basically instantaneous (cannot sleep etc.) and setting the channel is
necessarily a much longer operation.

If your device supports channel contexts, you might be able to *pick*
the channel you want to inject on, but you could probably achieve that
through the existing MAC address selection that picks an interface.
It's also not clear how monitor + chanctx would work at all, since
monitor expects to be on the channel all the time.

You could possibly select other parameters like the bitrate, but the
channel width - especially 5/10 MHz - doesn't seem feasible.


At least with ath9k, it is possible to send HT20 frames
when the radio has other vifs on the same radio sending HT40 frames, for 
instance.
(And rate-ctrl will do the same thing even for an 'ht40' vif).

ath10k hardware has same general ability, but you have no good way to
get radiotap info to the firmware at this time.

As long as the center freq is the same, it might also be possible to do smaller
bandwith encodings as well.

I would agree that if you are changing the center freq you have little to no 
chance
of this working as expected.

Thanks,
Ben


--
Ben Greear 
Candela Technologies Inc  http://www.candelatech.com

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: set channel from radiotap headers during injection

2015-08-19 Thread Johannes Berg
On Wed, 2015-08-19 at 10:44 -0700, Ben Greear wrote:
> 
> At least with ath9k, it is possible to send HT20 frames
> when the radio has other vifs on the same radio sending HT40 frames, 
> for instance.
> (And rate-ctrl will do the same thing even for an 'ht40' vif).

Yes, but that's pure rate control.

> ath10k hardware has same general ability, but you have no good way to
> get radiotap info to the firmware at this time.
> 
> As long as the center freq is the same, it might also be possible to 
> do smaller bandwith encodings as well.

I don't think this is true - I believe the clock settings are different
for 5 and 10 MHz (vs. each other and higher bandwidths)


johannes
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: set channel from radiotap headers during injection

2015-08-19 Thread Johannes Berg
On Wed, 2015-08-19 at 09:37 -0700, Allan Matthew wrote:

> It seems like the functionality for this (maybe not the monitor mode)
> must be available in order to support the multiple 802.11p channels 
> in the 5.8ghz band.

Not sure - I haven't looked at WAVE/11p in a long time, but the code we
have certainly assumes that the channel configuration is fixed, i.e.
only done once when "joining" the network.

> It sounds like what you are proposing is to create a non-monitor vif,
> select its channel, bitrate, bandwidth and then use the MAC address 
> to
> select it as the transmitting interface.  Is that correct?  I'm
> guessing I could do this with raw sockets and prepend the ieee80211
> header (but not the radiotap header)?
> 

No - radiotap injection has code to select the interfaces. So if you
have hardware that's capable of, say, having two AP interfaces on
different channels, then injection would select the channel by
selecting the interface. However, this isn't really a good way of
handling this either.

If you can be more specific what this would be used for, perhaps kernel
modifications would be appropriate to support it more correctly (rather
than relying on injection.)

johannes
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: set channel from radiotap headers during injection

2015-08-19 Thread Allan Matthew
The idea is this:

I operate an AP on one channel that talks to some set of devices.

On another "channel" (maybe just different BW) I use packet injection
to send data to and from a separate device.

The bitrate to the 2nd device (on the 2nd channel) is much lower than
that of the AP, and I'd like to get longer range out of it.  The idea
is that I use narrower bandwidth and fixed, low bitrates with control
over the retries to get really tight control over that link.

Thats the idea, anyway...

On Wed, Aug 19, 2015 at 11:09 AM, Johannes Berg
 wrote:
> On Wed, 2015-08-19 at 09:37 -0700, Allan Matthew wrote:
>
>> It seems like the functionality for this (maybe not the monitor mode)
>> must be available in order to support the multiple 802.11p channels
>> in the 5.8ghz band.
>
> Not sure - I haven't looked at WAVE/11p in a long time, but the code we
> have certainly assumes that the channel configuration is fixed, i.e.
> only done once when "joining" the network.
>
>> It sounds like what you are proposing is to create a non-monitor vif,
>> select its channel, bitrate, bandwidth and then use the MAC address
>> to
>> select it as the transmitting interface.  Is that correct?  I'm
>> guessing I could do this with raw sockets and prepend the ieee80211
>> header (but not the radiotap header)?
>>
>
> No - radiotap injection has code to select the interfaces. So if you
> have hardware that's capable of, say, having two AP interfaces on
> different channels, then injection would select the channel by
> selecting the interface. However, this isn't really a good way of
> handling this either.
>
> If you can be more specific what this would be used for, perhaps kernel
> modifications would be appropriate to support it more correctly (rather
> than relying on injection.)
>
> johannes
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: set channel from radiotap headers during injection

2015-08-19 Thread Johannes Berg
On Wed, 2015-08-19 at 12:00 -0700, Allan Matthew wrote:
> 
> I operate an AP on one channel that talks to some set of devices.
> 
> On another "channel" (maybe just different BW) I use packet injection
> to send data to and from a separate device.
> 
> The bitrate to the 2nd device (on the 2nd channel) is much lower than
> that of the AP, and I'd like to get longer range out of it.  The idea
> is that I use narrower bandwidth and fixed, low bitrates with control
> over the retries to get really tight control over that link.
> 

It might be somewhat feasible to set up the second one as a regular
client/AP link as well, with a different channel context...

However, the clients on the original AP might not be amused - their AP
would mysteriously disappear every once a while, something they're not
expecting (unless you restrict it to P2P GO/client operation)

johannes
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: set channel from radiotap headers during injection

2015-08-19 Thread Allan Matthew
Regarding the AP clients, could the AP send a power save or sleep
notification telling clients its going away for awhile, then come back
after the specified time?

On Wed, Aug 19, 2015 at 12:41 PM, Johannes Berg
 wrote:
> On Wed, 2015-08-19 at 12:00 -0700, Allan Matthew wrote:
>>
>> I operate an AP on one channel that talks to some set of devices.
>>
>> On another "channel" (maybe just different BW) I use packet injection
>> to send data to and from a separate device.
>>
>> The bitrate to the 2nd device (on the 2nd channel) is much lower than
>> that of the AP, and I'd like to get longer range out of it.  The idea
>> is that I use narrower bandwidth and fixed, low bitrates with control
>> over the retries to get really tight control over that link.
>>
>
> It might be somewhat feasible to set up the second one as a regular
> client/AP link as well, with a different channel context...
>
> However, the clients on the original AP might not be amused - their AP
> would mysteriously disappear every once a while, something they're not
> expecting (unless you restrict it to P2P GO/client operation)
>
> johannes
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: set channel from radiotap headers during injection

2015-08-19 Thread Johannes Berg
On Wed, 2015-08-19 at 12:50 -0700, Allan Matthew wrote:
> Regarding the AP clients, could the AP send a power save or sleep
> notification telling clients its going away for awhile, then come 
> back after the specified time?
> 

No, the protocol has no such provision for the AP.

[also, please try to format your emails more readable, instead of just
tacking on something on the top]

johannes
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: set channel from radiotap headers during injection

2015-08-19 Thread Allan Matthew
On Wed, Aug 19, 2015 at 12:53 PM, Johannes Berg
 wrote:
> No, the protocol has no such provision for the AP.
>
> [also, please try to format your emails more readable, instead of just
> tacking on something on the top]
>
> johannes

Understood, thanks for the help.  Apologies for the poor formatting!
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: set channel from radiotap headers during injection

2015-08-24 Thread Allan Matthew
On Wed, Aug 19, 2015 at 1:43 PM, Allan Matthew  wrote:
>
> Understood, thanks for the help.  Apologies for the poor formatting!

Johannes- What about txpower?  Should this be configurable through the
radiotap headers?
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: set channel from radiotap headers during injection

2015-08-25 Thread Johannes Berg
On Mon, 2015-08-24 at 17:46 -0700, Allan Matthew wrote:
> 
> Johannes- What about txpower?  Should this be configurable through 
> the radiotap headers?

It's ... complicated. First of all, it's currently not supported I
believe, in general, since there's no parsing code. Obviously, parsing
code can be changed, and I think there might even be patches floating
around for that.

However, not all hardware supports per-frame TX power control. Some
might, most will not. Until fairly recently, there was also no API with
drivers to allow setting TX power per frame. This changed with the
addition of TX power control to rate control, of course.

So I think similar to rate control the situation is that it could be
done, but there are many corner cases where it won't work reliably. I'd
apply clean patches that add the functionality while documenting the
issues.

johannes
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: set channel from radiotap headers during injection

2015-08-25 Thread Allan Matthew
On Tue, Aug 25, 2015 at 2:36 AM, Johannes Berg
 wrote:
> It's ... complicated. First of all, it's currently not supported I
> believe, in general, since there's no parsing code. Obviously, parsing
> code can be changed, and I think there might even be patches floating
> around for that.

Adding this into the parse_tx_radiotap() is pretty trivial, I've added
MCS and legacy bitrate, FEC, SGI and STBC controls already.  I just
don't quite know where to put transmit power.

> However, not all hardware supports per-frame TX power control. Some
> might, most will not. Until fairly recently, there was also no API with
> drivers to allow setting TX power per frame. This changed with the
> addition of TX power control to rate control, of course.

I'm currently working with ath9k.  It appears that it supports
per-frame power control, although I'm still familiarizing myself.

Where would I stick the transmit power control?  In the
ieee80211_tx_info->control somewhere, or maybe in the
ieee80211_tx_info->rate_driver_data?
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: set channel from radiotap headers during injection

2015-08-25 Thread Johannes Berg
On Tue, 2015-08-25 at 10:47 -0700, Allan Matthew wrote:
> 
> Where would I stick the transmit power control?  In the
> ieee80211_tx_info->control somewhere, or maybe in the
> ieee80211_tx_info->rate_driver_data?

It's got to be in control, but not sure where - perhaps look at
minstrel blues stuff?

johannes
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html