WEBVTT

00:02.820 --> 00:07.940
Hello all and welcome to the last and most exciting day at the Wireless Village.

00:08.160 --> 00:13.600
My name is Zero and on behalf of the Wireless Village team I'm very happy to introduce Adrian Chad.

00:13.600 --> 00:25.640
Adrian came up to us during our training class at B-Sides in Las Vegas and said, oh, hi guys, I worked on the Atheros HAL code and it's my fault that it's all open source now.

00:26.260 --> 00:28.060
He's a B-S-D developer.

00:28.060 --> 00:30.120
We're not going to hold that against him for right now.

00:30.240 --> 00:37.000
So without further ado, I'm going to introduce the man who said, if I wanted to, I could win your CTF, but I don't want to.

00:38.280 --> 00:39.360
It's true.

00:40.440 --> 00:41.600
Hi, I'm Adrian.

00:43.180 --> 00:52.680
I, as a brief introduction, I worked at Atheros about the time they got bought by Qualcomm so I got to experience both the happy side of it and the not so happy side of it.

00:53.900 --> 01:00.340
So before we begin, I'm one of the dirty bastards who signed the NDA to get access to all the shiny toys.

01:00.600 --> 01:03.800
So everything that I'm about to tell you, you can actually figure out for yourself.

01:03.800 --> 01:09.720
I'm not going to tell you anything that you shouldn't be able to figure out by reading the available source code and all of their patent filings.

01:10.120 --> 01:18.120
And if you really want to dig into it, there's a bunch of IEEE presentations from the silicon people talking about the interesting crap they do in silicon.

01:19.280 --> 01:24.460
And I really hate writing slides and I really hate drawing diagrams.

01:24.960 --> 01:27.040
And all the diagrams I have are under NDA.

01:27.040 --> 01:34.340
So I suggest if you're actually interested in a picture representation of how the chip looks, do some Google searches of your own.

01:34.340 --> 01:39.220
I went and did some Google searches and there's some stuff out there, but they're in leaked data sheets.

01:39.220 --> 01:43.020
And for obvious reasons, I'm not going to post linked data sheets on a recorded talk.

01:44.800 --> 01:46.220
But it's all out there.

01:46.220 --> 01:57.440
So the Atheros hardware, the first thing that people think is going on inside it is that there's a CPU doing all the cool shit.

01:57.480 --> 02:09.040
And back in the day of the Prism and Prism 2 chips, there actually is a DSP in them that's actually doing a large part of the Mac and Fire related activity for the DSSS and the CCK encoding and decoding.

02:09.040 --> 02:13.160
However, there is no CPU in the core of the Atheros chips.

02:13.240 --> 02:24.520
By design, they put everything into silicon and anything that would run in a CPU, they punt to the host operating system driver, which gives us all the shiny toys that we have.

02:24.640 --> 02:37.720
So the bits that are interesting is the Mac, which implements all the 802.11 data level bits, like generating frames, doing RTS, CTS, contention, back off, all the timer related stuff.

02:37.720 --> 02:43.560
And you can see this is a great big DMA engine with thousands of little timers implementing 802.11.

02:43.720 --> 02:47.000
There's the fire that does all of the actual physical layer encoding.

02:47.000 --> 02:50.040
So that's doing CCK, OFDM, encoding and decoding.

02:50.040 --> 02:55.060
It has multiple radio, sorry, multiple spatial streams for 11N stuff.

02:56.140 --> 02:59.060
And there's the radio that does all the actual RF bits.

02:59.080 --> 03:05.740
And so the fire takes in and out like a 20, 40 or 80 megahertz wide baseband signal.

03:06.040 --> 03:10.760
And the radio is the thing that steps it up and down to 2 and 5 gig.

03:10.780 --> 03:14.020
The real time clock is clocking and also power control.

03:14.020 --> 03:20.020
So that's the bit of the chip that's bringing everything, bringing power on and off and handling clock generation.

03:20.840 --> 03:31.900
And then there's the host interface, which is the PCI, PCIe, the SDIO, inside the little tiny SOCs that you can get all those TP link and D link access points.

03:31.900 --> 03:35.940
They'll have a single chip with a Wi‑Fi chip on board.

03:36.160 --> 03:45.540
And the chip internal to the SOC is actually connected via a standardized industry protocol called AHB, which means something that I don't remember.

03:46.720 --> 03:50.080
So the MAC consists of some bits that do DMA.

03:50.700 --> 03:58.120
So in ETHEROS terms, the PCU handles the received DMA and the DCU handles TXDMA.

03:58.480 --> 04:02.300
The Q control unit handles implementing all the 802.11 crap.

04:02.300 --> 04:05.140
So if you want to fiddle with timing, I'll explain that in a minute.

04:05.140 --> 04:09.560
The QCU is the thing that you program to modify how 802.11 behavior works.

04:09.560 --> 04:14.480
And the DCU is the bit that just takes packets in and DMAs them into the TX50 and sends them out.

04:15.960 --> 04:19.900
All of the stuff that's time sensitive gets handled by the MAC.

04:19.900 --> 04:23.480
So AC generation, for example, can be done in hardware.

04:24.500 --> 04:28.320
There are timers to program how long it will wait for an AC on the received side.

04:28.320 --> 04:31.240
And you can disable sending AC if you really want to.

04:31.400 --> 04:33.560
And you can disable expecting an AC as well.

04:33.560 --> 04:39.180
RTS and CTS, AMPDU for 802.11 block AC, all of that crap is time sensitive.

04:39.180 --> 04:41.160
There's no point doing it in CPU.

04:41.400 --> 04:49.040
If you're a CPU's interrupt handler, it takes too long, then you'd miss your AC window and crap would be silly.

04:49.040 --> 04:52.620
So all of the time sensitive bits are done in hardware and nothing more.

04:53.060 --> 04:56.420
The PHY handles all of the bits that actually do 802.11 data.

04:57.060 --> 04:59.060
So it handles stuff that goes over the air.

04:59.060 --> 05:03.320
So it does the clear channel detection to figure out when it can transmit.

05:03.320 --> 05:08.560
It does signal detection and signal sizing, antenna selection, all the encoding and decoding.

05:09.000 --> 05:11.020
It handles all the MIMO stuff.

05:12.060 --> 05:16.500
The important thing here is there's one massive PHY in the 11N chips.

05:16.500 --> 05:21.120
And for each physical radio, there's one set of FFTs and IFFTs going on.

05:21.120 --> 05:30.540
And then it funnels all of that crap into one ginormous PHY that's doing all of the signal correlation and processing in silicon inside the PHY.

05:30.840 --> 05:32.480
And it's kind of scary to look at.

05:32.800 --> 05:39.480
The radio handles all the RF synthesis and there's some back chat between the PHY and the radio that I can't talk about.

05:39.480 --> 05:42.220
But most of that's to do with automatic gain control and signal sizing.

05:42.220 --> 05:58.560
So every time that you receive a packet, the first thing the receiver needs to do is figure out how to size the packet to size the signal so that it fills the dynamic range of the ADC but it doesn't saturate it to the point of distorting and screw up receiving it.

05:58.560 --> 06:06.820
So there's a lot of fine and coarse grain automatic gain control going on per packet and per antenna as well on the earlier chips.

06:07.320 --> 06:10.080
There's some filtering going on, and I'll talk about that later.

06:10.420 --> 06:15.760
In the earlier chips, if you've ever popped off the metal shield, there will be two chips.

06:15.760 --> 06:20.780
And the first one is like the AR5212, which implements everything except the radio.

06:20.780 --> 06:23.680
And then they put the radio in an external part.

06:23.680 --> 06:28.220
So you have a 2 gig part and a 5 gig part and then a 2 and a 5 gig part.

06:28.620 --> 06:34.640
And the really early stuff actually generated 2 gig first and then upscaled 2 gig to 5 gig in a separate part.

06:34.640 --> 06:36.300
And all of that's gone away now.

06:36.300 --> 06:52.660
So with improvements with figuring out how to do analog crap inside the same chip, they have one die that has either one or more bits of silicon inside the packaging that does all of the stuff, including base band resistance and RF.

06:53.980 --> 06:59.500
So anything that's 11N after the AR9160 is all one chip.

07:00.560 --> 07:02.880
And that leads to quite a lot better sensitivity.

07:02.880 --> 07:08.520
So just as a side note, the chips get more sensitive on the receive side the further up the chain you go.

07:08.520 --> 07:12.820
So I do my wireless sniffing with AR9280 and AR9380.

07:12.820 --> 07:15.440
They have ridiculously sensitive receive sides.

07:16.220 --> 07:24.120
And the only thing that the radio communicator updates, you can program the radio directly, but you only do that to configure the synth.

07:24.120 --> 07:25.960
You don't actually touch it after that.

07:26.720 --> 07:30.080
And the RTC handles all the crap dealing with clock generation.

07:30.080 --> 07:33.360
What the hell just happened there?

07:35.220 --> 07:36.600
Tech support.

07:37.660 --> 07:38.460
Swipe.

07:40.500 --> 07:46.700
So the RTC handles only clock generation.

07:46.700 --> 07:52.620
So that handles if it's in 5 meg, 10 meg, keep going, yeah.

07:52.620 --> 07:57.100
You know, the chips can do 5 meg, 10 meg, 20 meg, 40 meg channels.

07:57.100 --> 08:02.040
And so one of the parts of figuring out how to do that is they actually clock the chip at a different rate.

08:03.120 --> 08:09.540
And that can happen dynamically as well when you're doing 20 meg to 40 meg dynamic packet stuff in 11n.

08:10.280 --> 08:13.600
So the only thing that you can program when you put the chip to sleep is the RTC.

08:13.600 --> 08:16.400
And the only thing you can tell the RTC to do is wake up the chip.

08:16.920 --> 08:27.000
And so when you're actually a laptop doing power save and you want to put the chip to sleep and have the chip wake up when the access point says there's something for it, this is the thing you're fiddling with.

08:27.440 --> 08:29.760
And the host interface glues all that crap together.

08:29.760 --> 08:34.080
So it's probably not interesting for most of the stuff that people are doing with these things.

08:34.080 --> 08:43.720
But a lot of the bugs that pop up is because there's issues with the PCIe power save on the chip and the laptop getting out of whack and causing the device to go away.

08:44.580 --> 08:46.120
So the Mac in detail.

08:46.960 --> 08:52.920
No one uses anything before the AR5212 these days.

08:52.920 --> 08:54.940
And so I'm not going to worry about the early stuff.

08:54.940 --> 08:58.500
But the new stuff has 10 transmit queues and one receive queue.

08:58.500 --> 09:01.100
And the new and newer stuff has two receive queues.

09:02.320 --> 09:04.880
They're implemented in a priority scheme.

09:04.880 --> 09:13.480
So the lowest transmit queue has the lowest priority and gets preempted by successively higher queues.

09:13.480 --> 09:20.280
Q9 is always for multicast traffic that happens after beaconing and Q10 is always the beacon queue and you can't change that.

09:20.920 --> 09:22.780
And as I said before, they're split into two halves.

09:22.780 --> 09:26.540
There's the control unit and the queue control unit and the data control unit.

09:26.620 --> 09:30.160
The QCU handles all the stuff that has to do with timing and 802.11.

09:30.160 --> 09:50.860
So if you're doing things like wanting to have long transmit bursts, you program the QCU and that handles starting, like, gating the DMA to start, doing the 802.11 stuff to say I want to start transmitting, programming the nav in the air to reserve the air time so you can actually do an 802.11 QOS transmit burst.

09:50.860 --> 09:52.380
That's all done by the QCU.

09:52.380 --> 09:55.290
And the QCU is just gated and doing the DMA.

09:56.170 --> 09:58.390
And the receive side is pretty simple.

09:58.750 --> 10:09.090
You program in where you want the DMA descriptors to and it just happily DMAs received packets in ‑‑ the thing I haven't mentioned here that I should is that there's a filter for filtering out packets.

10:09.090 --> 10:12.830
This is one of the first things that gets interesting for what you guys are doing with this stuff.

10:12.830 --> 10:20.990
Because the filter bits let you do interesting things like give me only stuff for my associated station, but you can also just say give me everything.

10:20.990 --> 10:24.750
Which is actually kind of useful, especially with what you guys are doing.

10:24.750 --> 10:35.850
You can also say give me everything including management traffic, which means you see RTS and CTS and ACK frames, which you wouldn't normally see because that sort of stuff is not data related.

10:35.850 --> 10:47.410
But if you're doing, like, driver development like me or spoofing crap like you guys, you may want to actually see RTS, CTS, you may want to generate ACK frames, see ACK frames come in.

10:47.910 --> 10:51.510
On the later chips, they have a high priority queue and a low priority queue.

10:51.510 --> 10:53.450
Not very interesting for most people.

10:53.450 --> 11:04.230
The reason the high priority queue exists is so that low latency frames like power save data frames can preempt, like, having a large backlog of, you know, bulk received data frames coming in another queue.

11:04.230 --> 11:06.990
So unless you're writing a station driver, it's probably not that important.

11:07.610 --> 11:10.270
So the fire is where things get a little bit more interesting.

11:10.770 --> 11:15.350
Because it's all done in hardware, and once the chip ships, they can't change it.

11:15.470 --> 11:21.370
There's, like, a thousand registers in the damn thing, and some of them per radio.

11:21.370 --> 11:26.730
So you end up being able to tune pretty much every piece of behavior of the fire.

11:26.730 --> 11:43.210
And as they figure out that there's more weird shit going on in the real world, they'll add more registers to give you the ability to twiddle things so that when they deliver the chip and they find that stuff in the real world starts acting nasty, they can actually modify the fire behavior by shipping a driver update.

11:43.990 --> 11:51.630
So the interesting things for people wanting to screw with Wi‑Fi is being able to do things like override signal levels.

11:51.630 --> 11:56.030
So when people are doing long distance links, they're always going to hear weak signals.

11:56.030 --> 12:02.230
They may want to have fine grained control over making the AGC sensitive to far away low level packets.

12:02.230 --> 12:11.110
But if you're in an environment like this, you may only want to receive packets that are close by and not spend time trying to figure out if the packet is far away.

12:11.210 --> 12:20.030
So you can program that and the chip will actually implement gain control based on stepping sizes and timing.

12:21.070 --> 12:23.170
CCA is something I keep being asked how you disable.

12:23.170 --> 12:25.150
So you can just transmit whenever the hell you want.

12:25.270 --> 12:26.150
There's a register.

12:26.370 --> 12:30.470
If you read the driver, you'll figure out which register you programmed to have it disable clear channel.

12:30.470 --> 12:32.210
But I'm not going to tell you how to do it.

12:32.790 --> 12:40.390
But you can actually set the CCA threshold for exactly what level it should be considering the air that's busy.

12:40.390 --> 12:42.010
And that has actually changed over time.

12:42.010 --> 12:43.690
So it is configurable.

12:44.650 --> 12:47.710
You can do per packet transmit power.

12:47.710 --> 12:50.850
So you can actually set the card to transmit at a high power.

12:50.850 --> 12:54.610
But for things that are close by, you can actually lower the transmit power per packet.

12:54.610 --> 12:57.730
So you can do things like confuse people doing Wi‑Fi positioning.

12:57.730 --> 13:03.610
Because they're typically doing, if you're doing it using open source tools, they'll be doing it using signal strength.

13:03.610 --> 13:07.870
And if someone's screwing with their transmit power, all of that stuff breaks down.

13:08.610 --> 13:15.190
The interesting things if you're looking to twiddle with a lot of this stuff is looking at the calibration and the noise immunity code.

13:15.190 --> 13:21.890
If you read the patents on those and the code, you'll actually get a pretty good description of how the Atheros FI works.

13:21.890 --> 13:28.550
Because all the pre‑core patents cover the FI design in quite good detail.

13:28.550 --> 13:31.150
So I recommend anyone that's interested to read that.

13:31.310 --> 13:33.830
And the RF synth is the final bit here.

13:33.830 --> 13:36.090
It does, well, the RF bits.

13:36.430 --> 13:42.490
The stuff pre‑Merlin or pre‑AR9280, you don't get to pick which frequencies you tune to.

13:42.490 --> 13:46.650
You only get to tune to what are pretty much the 802.11 channel offsets.

13:46.650 --> 13:53.590
The latest stuff, so AR9280 and later, let you tune to very, very small fractional increments.

13:53.770 --> 14:01.850
The thing to keep in mind is, and I'll cover this soon, is just because you can tune to those frequencies doesn't mean that you can actually use them.

14:02.410 --> 14:07.170
It also has a configurable width filter for both receive and transmit.

14:07.170 --> 14:10.550
So on the receive side, so it filters out crap from adjacent channels.

14:10.550 --> 14:17.530
And on the transmit side, it actually prevents the transmitter from spewing crap outside the configured channel width.

14:18.010 --> 14:22.830
And when you're trying to do half and quarter rate stuff for really long distance links, this stuff is actually pretty important.

14:23.650 --> 14:25.390
So now we get to the why.

14:25.470 --> 14:27.550
Why do people like these things?

14:27.550 --> 14:30.650
And in short, everything inside is exposed.

14:30.730 --> 14:40.030
And because they needed to make it so that they could ship software driver updates to modify behavior, the chip pretty much lets you get away with bloody murder.

14:40.410 --> 14:46.050
So the only thing that happens is the stuff that offloading would be a pain in the ass.

14:46.050 --> 14:52.790
So you pretty much get the raw 802.11 frames going in and out of the device.

14:52.790 --> 14:57.190
There's no DSP, there's no CPU in the non-mobile products.

14:57.310 --> 15:00.190
So everything has to be done locally.

15:01.250 --> 15:05.130
So on the transmit side, you do give it a raw 802.11 frame.

15:05.130 --> 15:12.790
Everything from the source MAC address onwards gets dumped into memory and that will just appear on the air.

15:12.790 --> 15:15.530
The chip doesn't care what you put into it.

15:15.970 --> 15:19.310
The only thing you have to worry about is the magic alignment constraints.

15:19.310 --> 15:24.430
But you could pick a random MAC address to transmit from and it will dutifully send that.

15:24.590 --> 15:31.990
So this is why these things are good for injection because they're not enforcing any kind of source address verification inside the chip.

15:32.070 --> 15:34.610
So if you screw up, then you're screwed.

15:34.610 --> 15:37.730
But if you want to specifically spoof other things, you can.

15:37.730 --> 15:40.630
And people have used this for all kinds of interesting things.

15:41.570 --> 15:47.990
One common thing that people don't do when they want to be a naughty device is they won't disable ACK generation.

15:47.990 --> 15:58.610
So if I want to go out and see if there are anything nasty out there, I can actually send probe requests to station MAC addresses and the hardware will ACK it for you.

15:58.610 --> 16:03.970
And you won't know because you're just simply a driver and the driver doesn't handle ACKs.

16:03.970 --> 16:06.010
You can turn off ACKing in the chip.

16:06.010 --> 16:13.390
So if someone tries sending you a packet, even if the driver tosses it later, you still don't want to necessarily ACK the packet and tell someone you're there.

16:14.890 --> 16:19.430
You can also disable FCS checks so you don't have to opt to the receive side thing.

16:19.430 --> 16:20.370
It's no big deal.

16:21.270 --> 16:24.370
And you get to do things like per packet transmit control.

16:25.650 --> 16:26.470
Interesting.

16:26.470 --> 16:27.050
Okay.

16:27.070 --> 16:29.530
On the receive side, you get everything.

16:29.670 --> 16:33.950
So it's all based on what you get with what you configure in the filter.

16:33.950 --> 16:38.430
But if you turn on the promiscuous and the mismanagement bits in the driver, you get every frame.

16:38.430 --> 16:43.510
And if you disable FCS checks, it will give you every frame including all the errors in the frame.

16:43.510 --> 16:54.670
And there have been research papers that actually look at what kinds of bit errors occur in packets and they all use a Theros stuff because it's the only chips you get that let you do this kind of tricky shit.

16:55.670 --> 16:58.590
So what other things can the chips do that are interesting?

16:59.030 --> 17:04.430
So I'm going to gloss over them because I only have like 30 minutes to talk about this stuff.

17:05.350 --> 17:10.790
And there are a lot of other stuff that I if you want to find out, come and see me.

17:10.790 --> 17:14.590
But the chips have to be both a station chip and an access point chip.

17:14.830 --> 17:20.910
And later chips want to be a station chip and an access point chip and do ad hoc for P2P Wi-Fi stuff.

17:21.130 --> 17:28.690
So in order for all of that crap to exist, there has to be support in the chip for things like tracking multiple TSF counters.

17:28.690 --> 17:37.970
So if you're trying to do ad hoc and station, you need to have one TSF counter synced to the access point and a second one running your ad hoc network.

17:38.050 --> 17:49.970
The more interesting stuff for people doing naughty things is things like the AN9280 spectrum analysis mode where you can actually get the chip to give you per OFDM bin power readings.

17:50.030 --> 18:02.130
So a lot of the enterprise products will actually have a nick in there specifically to pull out the spectrum data from the current channel so they can make decisions about how dirty the channel is.

18:02.130 --> 18:09.210
If you're doing it based on RSSI only, you're only getting an idea of how much Wi-Fi traffic there is on a particular channel.

18:09.210 --> 18:22.950
But if you use the spectrum node, you can see things like microwaves and cordless phones and other kinds of noise generation devices that the chip will treat as noise but won't give you a receive packet for anything.

18:22.950 --> 18:27.990
So I use this for a lot of debugging and it's good to see things like microwaves in action.

18:28.570 --> 18:40.310
And the later chips actually have Wi-Fi positioning hacks so you can do fine grain packet time stamping and actually do time delay between transmitting a packet and getting the act back so you can actually estimate distance down to a few feet.

18:41.090 --> 18:44.970
And that's the kind of crap that powers your enterprise APs tracking you walking around.

18:45.130 --> 18:46.410
It's all in these things.

18:47.550 --> 18:54.170
Now the things that you're not supposed to do, and I'm not going to tell you how, they're required for regulatory compliance.

18:54.310 --> 18:55.350
So you're all pretty spoiled.

18:55.350 --> 18:59.990
You buy a laptop and it works and you don't necessarily see the crap that goes on behind the scenes.

18:59.990 --> 19:07.130
And what goes on behind the scenes is submitting it to the FCC and getting the thing verified that it's actually behaving correctly or correctly.

19:07.530 --> 19:15.050
So one of the things that happens is you need to be able to verify that your chip is transmitting on a particular center frequency and not drifting over time.

19:15.410 --> 19:18.150
Otherwise it's not going to interoperate well with other devices.

19:18.390 --> 19:23.970
So you can actually put the chip into a just blurs crap out mode and just blurs out a tone.

19:24.530 --> 19:27.190
Now if you did this in the real world, the Wi-Fi in your area shuts down.

19:27.190 --> 19:28.650
It's actually kind of pretty to watch.

19:28.650 --> 19:34.670
The minute you transmit a carrier tone at maximum frequency, you don't care about distortion, no one else's Wi-Fi works.

19:35.230 --> 19:36.390
Don't do it.

19:37.070 --> 19:38.110
I'm just telling you don't do it.

19:38.110 --> 19:40.010
What you do is your own problem, but don't do it.

19:40.010 --> 19:43.970
You need to know how to do these if you're submitting your equipment for FCC testing.

19:44.170 --> 19:53.810
And I'm pretty sure most of the crap that we buy where they just take a Theros nick and shove it into an existing design like a board and make it work, that's not actually being FCC tested.

19:53.810 --> 20:00.990
Getting something FCC tested isn't getting an FCC tested nick, it's actually getting the enclosure and the antenna tested as part of a product.

20:00.990 --> 20:03.850
So they end up having to implement this stuff and then prove it.

20:03.930 --> 20:11.530
The other interesting thing is you actually get to put the nick into debug modes where you get to inject and receive raw ADC data.

20:11.530 --> 20:17.990
It's useful for doing calibration, but it's not useful for doing any other kind of spoofing, at least not from what I've been doing.

20:18.090 --> 20:27.070
And so most of the time you're feeding the chip a sine wave and you're trying to calibrate the chip to make sure that what the DAC gets back is an accurate sine wave.

20:27.210 --> 20:34.830
And so we put the chip in the debug mode, feed it a constant sine wave, pull out 4K of sample data at a time and make sure the chip is doing its thing.

20:37.130 --> 20:42.010
Now I'm going to cover a couple of things that people keep asking me about doing and why it's a good idea and why it's not a good idea.

20:42.010 --> 20:46.330
And the most common question I get asked is how the fuck do I break regulatory requirements?

20:46.750 --> 20:57.370
You know, I have this chip, it can do a lot more power, it's the regulatory requirements and the chip calibration limits me to transmitting to quite a few dB less than what the chip is apparently capable of doing.

20:57.650 --> 20:59.070
Why is this a problem?

20:59.270 --> 21:03.450
The main reason is you don't have the equipment.

21:04.070 --> 21:07.910
Who here has an actual 6 gig spectrum analyzer and power meter?

21:08.430 --> 21:09.170
Anyone?

21:10.890 --> 21:11.830
Right.

21:11.830 --> 21:16.770
That's a minimum 30 grand entry fee to actually screwing with transmit power.

21:16.830 --> 21:21.630
Because if you don't have that, you don't know if your device is actually distorting when it transmits.

21:21.710 --> 21:25.950
So the first thing is that you got to have the right equipment to actually measure this.

21:25.970 --> 21:30.230
The main reason is that people think about is the regulatory requirements.

21:30.290 --> 21:46.950
The two parts are there's a maximum amount of power you can inject into a channel and because Wi-Fi looks like that funny, like, spectrum, that has like a defined mask when you look at it on a spectrum analyzer, you need to make sure you don't transmit power into an adjacent channel that's higher than a certain level.

21:46.970 --> 21:56.330
And the specs, the 802.11 and the regulatory specs typically say what the maximum amount of power you can inject in adjacent channels before your device is out of compliance.

21:57.150 --> 22:00.930
The other thing is that RF is really weird.

22:01.270 --> 22:03.930
And at 5 gig, RF is extremely weird.

22:03.930 --> 22:13.490
And one of the weird things is that trying to find components that will stay linear over 1 gigahertz worth of 5 gig bandwidth is exceedingly hard to do.

22:13.490 --> 22:18.050
And trying to design an RF circuit that's linear over that requirement is exceedingly hard to do.

22:18.050 --> 22:30.750
So trying to make sure that your design has both 2 gig and 5 gig amplifiers that remain linear over the course of that entire bandwidth is actually hard.

22:30.750 --> 22:36.010
And what tends to happen when you look at the output distortion is it's not straight.

22:36.010 --> 22:38.590
It does this or it does this or it's wavy.

22:38.590 --> 22:50.150
And so as part of the card calibration, they'll actually pick the maximum transmit power that you can do per channel based on what the actual card when you test it gives you distortion wise.

22:50.150 --> 22:58.290
They'll say anything more than this much power at this frequency drives the transmitters into nonlinear, some kind of nonlinear behavior that have to drop the transmit power.

22:59.030 --> 23:07.870
The third thing is that transmitting on 3 antennas like half a watt is actually pretty power hungry.

23:07.930 --> 23:15.870
And most of the stuff that you're plugging into isn't designed for lots of periodic bursts of a couple of amps worth of power.

23:15.870 --> 23:23.270
And so the power that your slot can provide you is typically less than what you're using to transmit.

23:23.330 --> 23:30.290
And the power requirements change based on the channel and what kind of thing you're transmitting.

23:30.290 --> 23:33.730
And this is all the crap that gets looked at in the lab.

23:34.290 --> 23:40.870
So the power consumption varies quite a lot and decoupling caps only work so well.

23:41.790 --> 23:46.570
And so when figuring out can I overclock, the answer is maybe.

23:47.030 --> 23:52.650
Even inside regulatory, even if your card is doing 2 or 3 dB less than the regulatory requirements say, sure.

23:52.650 --> 23:54.910
That doesn't mean that the card can actually do it.

23:54.910 --> 23:58.570
So I highly recommend that you get some, loan some equipment.

23:58.750 --> 24:10.850
And the other thing is all of the high powered NICs I've seen, they'll actually have a 5 volt input on them specifically coming from some external source that's not the USB or the PCIe slot.

24:10.930 --> 24:15.010
And so you know you have a real high powered NIC if it actually has some external source.

24:15.010 --> 24:20.290
You plug it into a mini PCIe slot, the card says it can do half a watt, it's probably distorting.

24:21.790 --> 24:31.790
The next thing people ask me to do is can I make it tune to like 6 gig or 4.8 gig or like can I pick a tuning that isn't the channels to tune on.

24:31.790 --> 24:33.450
And the short answer is sure.

24:33.730 --> 24:37.490
The long answer is we only calibrated the NICs for specific channels.

24:37.490 --> 24:39.510
For all the reasons I just talked about.

24:39.870 --> 25:02.990
And yeah, you can pick arbitrary frequencies to tune the chips to, but not only has it not been tested and you may damage things, the RF synth, RF is weird and as you change the RF synth, it's doing digital, like there's a PLL and it's doing digital upscaling and it may generate noise spurs all over the place based on the current setting of the RF synth and what the devices are and which bits you've turned on or off.

25:02.990 --> 25:15.650
So they actually test this stuff in the lab to say okay, this particular synthesis setting for this particular Wi-Fi channel meets the requirements of low spurs and low distortion and it's actually accurate.

25:15.690 --> 25:25.870
And you could tune it to arbitrary frequencies, but unless you test it, what you may actually be doing is damaging things, you may be actually generating more noise and the thing may actually be drifting more than you'd like.

25:25.870 --> 25:31.610
So if you get a fiddle with this for fun, get a spectrum analyzer and actually test this stuff.

25:33.230 --> 25:39.590
The next thing that people ask me is how do I make my NIC work with the microwaves on or how do I have it do a long distance link?

25:39.730 --> 25:49.010
And all I'm going to tell you here is read the noise immunity code because it actually twiddles all of the hardware inside the thing for tuning signal sensitivity.

25:49.330 --> 25:59.530
And so the NIC gets a handful of microseconds during the preamble to lock on to the Wi-Fi signal and figure out the right signal size.

25:59.930 --> 26:09.670
If you're trying to do things like receive long distance traffic and local traffic which is quite high, the NIC doesn't have a lot of time to figure out what the right gain settings are.

26:09.670 --> 26:29.730
So when I'm doing this stuff, and I know that I have a mix of long and far traffic, I'll have a NIC doing long only traffic and I'll have a NIC doing local only traffic so that I have a higher percentage of being able to see far away packets before the preamble stops and the packet starts and reception sucks.

26:30.590 --> 26:36.310
So if you're experimenting with noisy environments and long distance weak signals, look at the ANI code and read the patent.

26:37.190 --> 26:40.990
And I think this is the last thing on the playing around bits.

26:40.990 --> 26:45.330
So a couple of years ago when I was working there, we actually got the spectrum analysis stuff open source.

26:45.330 --> 26:47.630
So it's in BSD and it's in Linux.

26:47.630 --> 26:49.570
There are open source tools for pulling the stuff out.

26:49.570 --> 26:57.110
So all those pretty waterfall things you get from like the ubiquity access points, we put them into waterfall mode and you get a channel thing.

26:57.110 --> 27:01.730
All it's doing is it's putting the NIC into spectrum mode and scanning over all the channels.

27:02.250 --> 27:15.750
And so if you want to actually do it on a Theros NIC without needing to have any other equipment, you can get a pretty good coarse grain idea of what channels are busy, what channels are worth looking at, what's Wi-Fi and what's not Wi-Fi.

27:17.390 --> 27:19.630
And as I said, it's all open source.

27:19.630 --> 27:23.870
The thing to keep in mind is the same block doing FFT is used for RX and spectral mode.

27:23.870 --> 27:27.850
So you can't receive packets at the same time you're actually doing FFT investigations.

27:27.850 --> 27:33.570
When you trigger an FFT, sorry, when you trigger a spectrum sample, it doesn't do receive for that period.

27:33.570 --> 27:34.790
So I'll use two NICs.

27:34.790 --> 27:43.610
And a lot of the enterprise hardware will actually put a second NIC in there, cheaper NIC, specifically to do spectrum analysis in order to pick the right channel to work on.

27:43.810 --> 27:49.010
And I don't think any of the open source access point products currently do this, but all the source code is there.

27:49.010 --> 27:50.930
If you want to play, then have a play.

27:52.210 --> 27:56.170
Now, I see a lot of people walking around with a Theros NICs hanging out of their laptops.

27:57.110 --> 28:01.310
And so I figured I'd talk a bit briefly about what's actually going on under the hood in these things.

28:01.550 --> 28:11.090
So all the HTC parts have a little 10 silica CPU that's sort of MIPSy and a normal bonafide, honest to God, a Theros Wi-Fi chip in it.

28:11.090 --> 28:15.430
So all the crap I just talked about, you can do with the USB NICs.

28:15.430 --> 28:18.730
So yes, you can do spectrum analysis with the HTC NICs.

28:18.730 --> 28:20.390
Yes, you can vary transmit power.

28:20.390 --> 28:23.690
Yes, you can do all the fiddling with it.

28:24.850 --> 28:31.350
The early, the first USB stuff had an actual separate CPU and PCIe NIC, the AR9280.

28:31.510 --> 28:39.330
And the one that I think everyone has is the single band, single antenna AR9271, which is slightly cut down, but it still does all the same stuff.

28:39.330 --> 28:50.210
You can still do spectrum analysis, radar, not radar detection without 5 gig, all the same debug modes, all the same signal level stuff.

28:50.210 --> 29:16.810
So the driver in Linux mostly treats the USB widget as a dumb DMA pipe and it knows a little bit about station stuff so it can do frame retransmission in the NIC for doing TX aggregation and rate control, but we're trying to strip that out because the number one reason why you can't run more than 8 stations on one of those NICs in access point mode is because there's a limited amount of RAM on the NIC.

29:16.930 --> 29:26.150
But again, the CPU can act as a dumb DMA pipe and the plan is to do that and then we can have as many stations as the driver allows you.

29:26.370 --> 29:28.270
And that's actually open source now.

29:28.270 --> 29:29.450
The firmware is open source.

29:29.450 --> 29:36.570
So if people are interested in doing things like running custom code inside the firmware on the USB NIC, you can actually do that.

29:36.570 --> 29:39.670
It uses the open source, tens of GCC tools.

29:40.550 --> 29:42.470
I'll put the GitHub repo up here soon.

29:42.470 --> 29:44.970
You can build it, you can install it, you can fiddle with it.

29:45.930 --> 29:51.390
If people have questions about what kind of weird crap they want to do with their NICs, please let me know.

29:51.790 --> 30:01.210
I was going to do like a walk through the hell and show you guys how the thing holds together and what to look at, but unfortunately there have been some significant technical issues in getting things to work.

30:01.850 --> 30:07.230
So I'll finish by putting up where the source code is.

30:08.110 --> 30:09.490
And everyone takes photos.

30:09.630 --> 30:15.210
So Qualcomm and Theros actually put up a GitHub repo a couple of years ago that they're putting all of their projects inside.

30:15.210 --> 30:22.150
And everything except the cell phone software firmware and the 11AC firmware is currently up there.

30:22.350 --> 30:26.570
Including firmware for their pre-11N USB NICs.

30:26.570 --> 30:28.830
I think it was a 5523, yeah.

30:29.050 --> 30:30.790
None of us have actually used it.

30:30.790 --> 30:33.590
Like, the hardware's out there and there's a driver for it.

30:33.690 --> 30:34.650
The firmware's out there.

30:34.650 --> 30:38.190
It's a normal Theros device with a little MIPS CPU in there.

30:38.190 --> 30:39.450
So it's all documented.

30:39.690 --> 30:43.210
The only thing that they haven't opened up is Bluetooth, mobile, and 11AC.

30:43.990 --> 30:48.550
And the common question I then get at this point is, what the hell are we going to do about 11AC?

30:48.610 --> 30:49.870
Well, I don't work there.

30:49.890 --> 30:53.070
So I decided to sign the NDA to get source code access.

30:53.070 --> 30:56.210
So I have source code access, but it's not public.

30:56.210 --> 31:06.890
The source code isn't public, but if you sign the NDA, you can get access to the firmware source and it looks like a Theros chip with a little CPU inside, as everything else does.

31:08.190 --> 31:22.010
The aim behind a bunch of us that are looking at this and admittedly I haven't done very much, but I plan on stepping this up around September is instead of there being, what we don't want to see is a lot of little individual companies publishing their own firmware blobs and suddenly it's like,

31:22.010 --> 31:32.070
I have to use company A for station mode and company B for access point mode and company C for mesh mode and there's a dozen different firmware blobs and a dozen different versions of the Linux driver to support things.

31:32.070 --> 31:41.790
Our plan is to have one tree that we all share internally inside the little NDA enabled group and ship one binary firmware image so that we're not duplicating effort.

31:42.950 --> 31:45.690
The 11AC hardware is actually pretty cool.

31:45.690 --> 32:03.870
So if people here are interested in doing 11AC product developments, the hardware will do meshing if you want to spend some time doing it, the hardware will do all the other stuff that you guys are used to, please contact me and I'll bump you over to the open source group and you can sign in and have a chat with them.

32:04.550 --> 32:07.690
So the NDA program, I get a lot of cool hardware.

32:07.910 --> 32:10.670
Mostly because I import free BSD for fun.

32:11.770 --> 32:22.490
There's an open source NDA program where you get access to their internal reference drivers and if you're really nice and not jerk faces, they'll give you data sheet access and you can talk to the developers.

32:22.490 --> 32:27.230
But they're all pretty busy people, so I don't recommend shouting them too many questions.

32:27.410 --> 32:38.070
If you can talk to the other people like me who have NDA access, we're quite happy to solve problems that would normally take time away from the hardware developers.

32:38.710 --> 32:42.270
If you're really, really nice, then they'll actually give you reference design boards.

32:44.210 --> 32:50.430
So they actually want to see, there's a group inside of QCA that actually wants to see more open source stuff.

32:50.430 --> 32:57.430
They have a pretty heavy OpenWRT group inside of there, bringing their stuff up with OpenWRT and pushing things upstream.

32:57.990 --> 33:08.330
So if anyone here is actually looking at doing new product development and thinking of a thorough stuff, the place to start is by talking to these peeps, getting them to, getting a good relation with them.

33:08.330 --> 33:15.630
They're down in San Jose, near the San Jose airport, so it's worthwhile having lunch with them and actually talking about the sort of stuff that you're doing and they're doing.

33:15.630 --> 33:17.870
And then lawyers are actually kind of cool.

33:18.250 --> 33:24.230
All the lawyers inside of Atheros that I worked with and still do here and there, they're the ones that got us access to all of this.

33:24.390 --> 33:28.450
They're the ones that approved all of this firmware access and source code access.

33:28.450 --> 33:31.830
So they're pretty clued in about open source and working with the community.

33:32.950 --> 33:35.210
So if you'd like to join, let me know.

33:35.210 --> 33:37.070
You can find me on the internet, it's not that hard.

33:37.070 --> 33:42.910
And we'll set stuff up inside of QCA for you to talk to them about stuff.

33:43.710 --> 33:56.530
I am trying to get together a group of people to actually do open source Wi-Fi development stuff in the Bay Area because there seems to be a lot of interest, but lots of little disparate groups, you know, groping around in the dark and not necessarily knowing what's going on.

33:56.530 --> 34:10.010
So if anyone is interested in coming to the Bay Area sometime later on this year and actually meeting some of the people involved in this and collaborating on learning how the hardware works and what you can do with it and the open source drivers and Linux and other operating systems,

34:10.010 --> 34:10.970
let me know.

34:10.970 --> 34:14.050
And if there's enough interest, I'll finish putting it together.

34:15.710 --> 34:16.730
Any questions?

34:19.870 --> 34:22.090
It's either a good sign or a bad sign.

34:26.200 --> 34:27.820
We ran out of time.

34:30.460 --> 34:31.060
Cool.

34:31.060 --> 34:36.240
Well, you know, the hardware is open and it's a long cry from how it looked 15 years ago.

34:36.240 --> 34:36.920
Yes?

34:40.680 --> 34:41.240
Okay

34:45.390 --> 34:45.950
.

34:47.490 --> 34:53.690
So the reason why, if you're doing 802.11 stuff, this is good for doing data stuff because it's this big.

34:53.710 --> 35:01.630
And anyone who's tried doing actual 802.11 MIMO 11N decoding in SDR, your entry level is an actual FPGA board.

35:01.630 --> 35:12.390
And like the FPGA boards that we use, there are like two of these sized FPGA boards running the Wi-Fi bit set quite a lot slower because they're FPGAs.

35:12.390 --> 35:22.290
So if you're trying to do like 20, 40, 80MHz 11AC stuff using an SDR, you're probably not going to be doing it at full speed, not with current hardware.

35:22.990 --> 35:31.410
The thing to keep in mind is, you know, if you want to be doing a 20MHz channel, your SDR has to be sampling at at least 40 and maybe more.

35:31.490 --> 35:35.410
And so, you know, 11AC starts at 40 and goes up to 80.

35:35.570 --> 35:42.730
And when you're doing 160MHz, suddenly you're going to have to have like 320MHz wide stuff.

35:43.530 --> 35:44.690
And that's a lot of data.

35:44.690 --> 35:53.030
And then you have I and Q and you split that off and you get two streams of data and then you have IQ per radio chain and that spirals off into hell, right?

35:53.030 --> 35:57.610
So for doing 802.11 sniffing, these chips are pretty good.

35:57.610 --> 36:03.770
If you're doing general signal analysis, these chips are not designed for doing general signal analysis.

36:04.550 --> 36:06.930
But they're like $2 on eBay.

36:06.930 --> 36:09.350
So, yeah.

36:09.610 --> 36:11.570
Any other questions?

36:12.710 --> 36:13.550
Cool.

36:13.550 --> 36:14.590
Well, thanks.

