start	end	text
2820	8860	Hello all and welcome to the last and most exciting day at the Wireless Village. My name
8860	13600	is Zero and on behalf of the Wireless Village team I'm very happy to introduce Adrian Chad.
13600	19980	Adrian came up to us during our training class at B-Sides in Las Vegas and said, oh, hi guys,
19980	26640	I worked on the Atheros HAL code and it's my fault that it's all open source now. He's
26760	31100	a B-S-D developer. We're not going to hold that against him for right now. So without
31100	35020	further ado, I'm going to introduce the man who said, if I wanted to, I could win your
35020	37000	CTF, but I don't want to.
38280	47660	It's true. Hi, I'm Adrian. I, as a brief introduction, I worked at Atheros about the time they got
47660	51780	bought by Qualcomm so I got to experience both the happy side of it and the not so happy
51780	58640	side of it. So before we begin, I'm one of the dirty bastards who signed the NDA to get
58640	62640	access to all the shiny toys. So everything that I'm about to tell you, you can actually
62640	65520	figure out for yourself. I'm not going to tell you anything that you shouldn't be able
65520	70220	to figure out by reading the available source code and all of their patent filings. And
70220	75340	if you really want to dig into it, there's a bunch of IEEE presentations from the silicon
75340	80580	people talking about the interesting crap they do in silicon. And I really hate writing
80580	87040	slides and I really hate drawing diagrams. And all the diagrams I have are under NDA.
87040	92060	So I suggest if you're actually interested in a picture representation of how the chip
92060	96980	looks, do some Google searches of your own. I went and did some Google searches and there's
96980	100520	some stuff out there, but they're in leaked data sheets. And for obvious reasons, I'm
100520	106220	not going to post linked data sheets on a recorded talk. But it's all out there.
106220	115020	So the Atheros hardware, the first thing that people think is going on inside it is
115020	119140	that there's a CPU doing all the cool shit. And back in the day of the Prism and Prism
119140	123680	2 chips, there actually is a DSP in them that's actually doing a large part of the Mac and
123680	130560	Fire related activity for the DSSS and the CCK encoding and decoding. However, there
130560	135840	is no CPU in the core of the Atheros chips. By design, they put everything into silicon
135840	142000	and anything that would run in a CPU, they punt to the host operating system driver,
142000	146600	which gives us all the shiny toys that we have. So the bits that are interesting is
146600	152580	the Mac, which implements all the 802.11 data level bits, like generating frames, doing
153200	159320	RTS, CTS, contention, back off, all the timer related stuff. And you can see this is a great
159320	164600	big DMA engine with thousands of little timers implementing 802.11. There's the fire that
164600	170040	does all of the actual physical layer encoding. So that's doing CCK, OFDM, encoding and decoding.
170040	176880	It has multiple radio, sorry, multiple spatial streams for 11N stuff. And there's the radio
176880	182900	that does all the actual RF bits. And so the fire takes in and out like a 20, 40 or 80
182900	189580	megahertz wide baseband signal. And the radio is the thing that steps it up and down to
189580	194580	2 and 5 gig. The real time clock is clocking and also power control. So that's the bit
194580	200020	of the chip that's bringing everything, bringing power on and off and handling clock generation.
200840	207640	And then there's the host interface, which is the PCI, PCIe, the SDIO, inside the little
207640	212560	tiny SOCs that you can get all those TP link and D link access points. They'll have a single
212560	219980	chip with a Wi‑Fi chip on board. And the chip internal to the SOC is actually connected
219980	225540	via a standardized industry protocol called AHB, which means something that I don't remember.
226720	234140	So the MAC consists of some bits that do DMA. So in ETHEROS terms, the PCU handles the received
234140	242300	DMA and the DCU handles TXDMA. The Q control unit handles implementing all the 802.11 crap.
242300	246080	So if you want to fiddle with timing, I'll explain that in a minute. The QCU is the thing
246080	251300	that you program to modify how 802.11 behavior works. And the DCU is the bit that just takes
251300	257640	packets in and DMAs them into the TX50 and sends them out. All of the stuff that's time
257640	264600	sensitive gets handled by the MAC. So AC generation, for example, can be done in hardware. There
264600	268640	are timers to program how long it will wait for an AC on the received side. And you can
268640	273560	disable sending AC if you really want to. And you can disable expecting an AC as well.
273560	279440	RTS and CTS, AMPDU for 802.11 block AC, all of that crap is time sensitive. There's no
279440	285580	point doing it in CPU. If you're a CPU's interrupt handler, it takes too long, then you'd miss
285580	291160	your AC window and crap would be silly. So all of the time sensitive bits are done in
291160	296420	hardware and nothing more. The PHY handles all of the bits that actually do 802.11 data.
297060	300840	So it handles stuff that goes over the air. So it does the clear channel detection to
300840	305800	figure out when it can transmit. It does signal detection and signal sizing, antenna
305800	312880	selection, all the encoding and decoding. It handles all the MIMO stuff. The important
312880	318460	thing here is there's one massive PHY in the 11N chips. And for each physical radio, there's
318460	323780	one set of FFTs and IFFTs going on. And then it funnels all of that crap into one ginormous
323780	330540	PHY that's doing all of the signal correlation and processing in silicon inside the PHY.
330840	335920	And it's kind of scary to look at. The radio handles all the RF synthesis and there's some
335920	340260	back chat between the PHY and the radio that I can't talk about. But most of that's to
340260	344440	do with automatic gain control and signal sizing. So every time that you receive a packet,
344440	349660	the first thing the receiver needs to do is figure out how to size the packet to size
349660	356100	the signal so that it fills the dynamic range of the ADC but it doesn't saturate it to the
356100	360620	point of distorting and screw up receiving it. So there's a lot of fine and coarse grain
361280	366820	automatic gain control going on per packet and per antenna as well on the earlier chips.
367320	371400	There's some filtering going on, and I'll talk about that later. In the earlier chips,
371400	376340	if you've ever popped off the metal shield, there will be two chips. And the first one
376340	381740	is like the AR5212, which implements everything except the radio. And then they put the radio
381740	388220	in an external part. So you have a 2 gig part and a 5 gig part and then a 2 and a 5 gig part.
388620	393360	And the really early stuff actually generated 2 gig first and then upscaled 2 gig to 5 gig
393360	398800	in a separate part. And all of that's gone away now. So with improvements with figuring
398800	404820	out how to do analog crap inside the same chip, they have one die that has either one
404820	411000	or more bits of silicon inside the packaging that does all of the stuff, including base
411000	420800	band resistance and RF. So anything that's 11N after the AR9160 is all one chip. And
420800	425940	that leads to quite a lot better sensitivity. So just as a side note, the chips get more
425940	430080	sensitive on the receive side the further up the chain you go. So I do my wireless sniffing
430080	436700	with AR9280 and AR9380. They have ridiculously sensitive receive sides. And the only thing
436700	442180	that the radio communicator updates, you can program the radio directly, but you only
442180	447320	do that to configure the synth. You don't actually touch it after that. And the RTC
447320	456600	handles all the crap dealing with clock generation. What the hell just happened there? Tech support.
457660	470180	Swipe. So the RTC handles only clock generation. So that handles if it's in 5 meg, 10 meg,
471600	477100	keep going, yeah. You know, the chips can do 5 meg, 10 meg, 20 meg, 40 meg channels.
477100	480800	And so one of the parts of figuring out how to do that is they actually clock the chip
480800	486140	at a different rate. And that can happen dynamically as well when you're doing 20 meg to 40
486140	492040	meg dynamic packet stuff in 11n. So the only thing that you can program when you put the
492040	495820	chip to sleep is the RTC. And the only thing you can tell the RTC to do is wake up the
495820	501240	chip. And so when you're actually a laptop doing power save and you want to put the chip
501240	505340	to sleep and have the chip wake up when the access point says there's something for it,
505340	509760	this is the thing you're fiddling with. And the host interface glues all that crap together.
509760	513520	So it's probably not interesting for most of the stuff that people are doing with these
513520	518560	things. But a lot of the bugs that pop up is because there's issues with the PCIe power
518560	523720	save on the chip and the laptop getting out of whack and causing the device to go away.
524580	533740	So the Mac in detail. No one uses anything before the AR5212 these days. And so I'm not
533740	537320	going to worry about the early stuff. But the new stuff has 10 transmit queues and one
537320	543240	receive queue. And the new and newer stuff has two receive queues. They're implemented
543240	548960	in a priority scheme. So the lowest transmit queue has the lowest priority and gets preempted
548960	557060	by successively higher queues. Q9 is always for multicast traffic that happens after beaconing
557060	561860	and Q10 is always the beacon queue and you can't change that. And as I said before, they're
561860	565460	split into two halves. There's the control unit and the queue control unit and the data
565460	570240	control unit. The QCU handles all the stuff that has to do with timing and 802.11. So
570240	575900	if you're doing things like wanting to have long transmit bursts, you program the QCU
575900	581680	and that handles starting, like, gating the DMA to start, doing the 802.11 stuff to say
581680	587420	I want to start transmitting, programming the nav in the air to reserve the air time
587420	592750	so you can actually do an 802.11 QOS transmit burst. That's all done by the QCU. And the
592750	599190	QCU is just gated and doing the DMA. And the receive side is pretty simple. You program
599190	605110	in where you want the DMA descriptors to and it just happily DMAs received packets in ‑‑
605110	608050	the thing I haven't mentioned here that I should is that there's a filter for filtering
608050	611550	out packets. This is one of the first things that gets interesting for what you guys are
611550	615850	doing with this stuff. Because the filter bits let you do interesting things like give
615850	620990	me only stuff for my associated station, but you can also just say give me everything.
620990	625270	Which is actually kind of useful, especially with what you guys are doing. You can also
625270	630770	say give me everything including management traffic, which means you see RTS and CTS and
630770	635850	ACK frames, which you wouldn't normally see because that sort of stuff is not data related.
635850	641510	But if you're doing, like, driver development like me or spoofing crap like you guys, you
641510	646550	may want to actually see RTS, CTS, you may want to generate ACK frames, see ACK frames
646550	651650	come in. On the later chips, they have a high priority queue and a low priority queue. Not
651650	655410	very interesting for most people. The reason the high priority queue exists is so that
655410	661070	low latency frames like power save data frames can preempt, like, having a large backlog
661070	664830	of, you know, bulk received data frames coming in another queue. So unless you're writing
665030	669150	a station driver, it's probably not that important. So the fire is where things get a little bit
669150	674250	more interesting. Because it's all done in hardware, and once the chip ships, they can't
674250	681370	change it. There's, like, a thousand registers in the damn thing, and some of them per radio.
681370	687310	So you end up being able to tune pretty much every piece of behavior of the fire. And as
687310	690770	they figure out that there's more weird shit going on in the real world, they'll add more
690770	695850	registers to give you the ability to twiddle things so that when they deliver the chip
695850	700670	and they find that stuff in the real world starts acting nasty, they can actually modify
700670	705790	the fire behavior by shipping a driver update. So the interesting things for people wanting
705790	711830	to screw with Wi‑Fi is being able to do things like override signal levels. So when
711830	716310	people are doing long distance links, they're always going to hear weak signals. They may
716310	722230	want to have fine grained control over making the AGC sensitive to far away low level packets.
722230	727550	But if you're in an environment like this, you may only want to receive packets that
727550	731610	are close by and not spend time trying to figure out if the packet is far away. So you
732010	739070	can program that and the chip will actually implement gain control based on stepping sizes
739070	743890	and timing. CCA is something I keep being asked how you disable. So you can just transmit
743890	747690	whenever the hell you want. There's a register. If you read the driver, you'll figure out
747690	751170	which register you programmed to have it disable clear channel. But I'm not going to tell you
751170	758830	how to do it. But you can actually set the CCA threshold for exactly what level it should
758830	763690	be considering the air that's busy. And that has actually changed over time. So it is configurable.
764650	770070	You can do per packet transmit power. So you can actually set the card to transmit at a
770070	774290	high power. But for things that are close by, you can actually lower the transmit power
774290	777990	per packet. So you can do things like confuse people doing Wi‑Fi positioning. Because
777990	782170	they're typically doing, if you're doing it using open source tools, they'll be doing
782170	786330	it using signal strength. And if someone's screwing with their transmit power, all of
786330	790570	that stuff breaks down. The interesting things if you're looking to
790570	794470	twiddle with a lot of this stuff is looking at the calibration and the noise immunity
794470	799170	code. If you read the patents on those and the code, you'll actually get a pretty good
799170	807090	description of how the Atheros FI works. Because all the pre‑core patents cover the FI design
807090	811150	in quite good detail. So I recommend anyone that's interested to read that.
811310	818170	And the RF synth is the final bit here. It does, well, the RF bits. The stuff pre‑Merlin
818170	823270	or pre‑AR9280, you don't get to pick which frequencies you tune to. You only get to tune
823270	829390	to what are pretty much the 802.11 channel offsets. The latest stuff, so AR9280 and later,
829390	835910	let you tune to very, very small fractional increments. The thing to keep in mind is,
835910	839750	and I'll cover this soon, is just because you can tune to those frequencies doesn't
839750	846390	mean that you can actually use them. It also has a configurable width filter for both receive
846390	850630	and transmit. So on the receive side, so it filters out crap from adjacent channels. And
850630	855650	on the transmit side, it actually prevents the transmitter from spewing crap outside
855650	860050	the configured channel width. And when you're trying to do half and quarter rate stuff for
860050	862830	really long distance links, this stuff is actually pretty important.
863650	869350	So now we get to the why. Why do people like these things? And in short, everything inside
869350	874790	is exposed. And because they needed to make it so that they could ship software driver
874790	880030	updates to modify behavior, the chip pretty much lets you get away with bloody murder.
880410	886050	So the only thing that happens is the stuff that offloading would be a pain in the ass.
886050	893310	So you pretty much get the raw 802.11 frames going in and out of the device. There's no
893310	901690	DSP, there's no CPU in the non-mobile products. So everything has to be done locally. So on
901690	908130	the transmit side, you do give it a raw 802.11 frame. Everything from the source MAC address
908130	913970	onwards gets dumped into memory and that will just appear on the air. The chip doesn't care
913970	919310	what you put into it. The only thing you have to worry about is the magic alignment constraints.
919310	924430	But you could pick a random MAC address to transmit from and it will dutifully send that.
924590	929390	So this is why these things are good for injection because they're not enforcing any kind of
929390	934730	source address verification inside the chip. So if you screw up, then you're screwed. But
934730	938870	if you want to specifically spoof other things, you can. And people have used this for all
938870	944830	kinds of interesting things. One common thing that people don't do when they want to be
945210	949050	a naughty device is they won't disable ACK generation. So if I want to go out and see
949050	955330	if there are anything nasty out there, I can actually send probe requests to station MAC
955330	960790	addresses and the hardware will ACK it for you. And you won't know because you're just
960790	966010	simply a driver and the driver doesn't handle ACKs. You can turn off ACKing in the chip.
966010	970230	So if someone tries sending you a packet, even if the driver tosses it later, you still
970230	976550	don't want to necessarily ACK the packet and tell someone you're there. You can also disable
976550	981490	FCS checks so you don't have to opt to the receive side thing. It's no big deal. And
981490	987830	you get to do things like per packet transmit control. Interesting. Okay. On the receive
987830	993350	side, you get everything. So it's all based on what you get with what you configure in
993350	997230	the filter. But if you turn on the promiscuous and the mismanagement bits in the driver,
997230	1001990	you get every frame. And if you disable FCS checks, it will give you every frame including
1001990	1006150	all the errors in the frame. And there have been research papers that actually look at
1006150	1011830	what kinds of bit errors occur in packets and they all use a Theros stuff because it's
1011830	1016670	the only chips you get that let you do this kind of tricky shit. So what other things
1016670	1022130	can the chips do that are interesting? So I'm going to gloss over them because I only
1022130	1027570	have like 30 minutes to talk about this stuff. And there are a lot of other stuff that I
1028590	1033030	if you want to find out, come and see me. But the chips have to be both a station chip
1033030	1037570	and an access point chip. And later chips want to be a station chip and an access point
1037570	1043790	chip and do ad hoc for P2P Wi-Fi stuff. So in order for all of that crap to exist, there
1043790	1049150	has to be support in the chip for things like tracking multiple TSF counters. So if you're
1049150	1055110	trying to do ad hoc and station, you need to have one TSF counter synced to the access
1055110	1059910	point and a second one running your ad hoc network. The more interesting stuff for people
1059910	1064930	doing naughty things is things like the AN9280 spectrum analysis mode where you can
1064930	1070770	actually get the chip to give you per OFDM bin power readings. So a lot of the enterprise
1070770	1077290	products will actually have a nick in there specifically to pull out the spectrum data
1077290	1082230	from the current channel so they can make decisions about how dirty the channel is. If
1082230	1087910	you're doing it based on RSSI only, you're only getting an idea of how much Wi-Fi traffic
1087910	1091190	there is on a particular channel. But if you use the spectrum node, you can see things
1091190	1098190	like microwaves and cordless phones and other kinds of noise generation devices that the
1098190	1104690	chip will treat as noise but won't give you a receive packet for anything. So I use this
1104690	1108770	for a lot of debugging and it's good to see things like microwaves in action. And the
1108770	1113130	later chips actually have Wi-Fi positioning hacks so you can do fine grain packet time
1113130	1117130	stamping and actually do time delay between transmitting a packet and getting the act
1117130	1121790	back so you can actually estimate distance down to a few feet. And that's the kind of
1121790	1126410	crap that powers your enterprise APs tracking you walking around. It's all in these things.
1127550	1131790	Now the things that you're not supposed to do, and I'm not going to tell you how, they're
1131790	1136590	required for regulatory compliance. So you're all pretty spoiled. You buy a laptop and it
1136590	1140330	works and you don't necessarily see the crap that goes on behind the scenes. And what goes
1140330	1144690	on behind the scenes is submitting it to the FCC and getting the thing verified that it's
1144690	1149310	actually behaving correctly or correctly. So one of the things that happens is you need
1149310	1153910	to be able to verify that your chip is transmitting on a particular center frequency and not drifting
1153910	1159150	over time. Otherwise it's not going to interoperate well with other devices. So you can actually
1159150	1164890	put the chip into a just blurs crap out mode and just blurs out a tone. Now if you did
1164890	1167990	this in the real world, the Wi-Fi in your area shuts down. It's actually kind of pretty
1167990	1171730	to watch. The minute you transmit a carrier tone at maximum frequency, you don't care
1171730	1178010	about distortion, no one else's Wi-Fi works. Don't do it. I'm just telling you don't do
1178010	1181730	it. What you do is your own problem, but don't do it. You need to know how to do these if
1181730	1185810	you're submitting your equipment for FCC testing. And I'm pretty sure most of the crap that
1185810	1190410	we buy where they just take a Theros nick and shove it into an existing design like
1190550	1194970	a board and make it work, that's not actually being FCC tested. Getting something FCC tested
1194970	1199710	isn't getting an FCC tested nick, it's actually getting the enclosure and the antenna tested
1199710	1203850	as part of a product. So they end up having to implement this stuff and then prove it.
1203930	1208570	The other interesting thing is you actually get to put the nick into debug modes where
1208570	1213790	you get to inject and receive raw ADC data. It's useful for doing calibration, but it's
1213790	1218130	not useful for doing any other kind of spoofing, at least not from what I've been doing. And
1218130	1223150	so most of the time you're feeding the chip a sine wave and you're trying to calibrate
1223150	1227810	the chip to make sure that what the DAC gets back is an accurate sine wave. And so we put
1227810	1232090	the chip in the debug mode, feed it a constant sine wave, pull out 4K of sample data at a
1232090	1238590	time and make sure the chip is doing its thing. Now I'm going to cover a couple of things
1238590	1241630	that people keep asking me about doing and why it's a good idea and why it's not a good
1241630	1245370	idea. And the most common question I get asked is how the fuck do I break regulatory
1245370	1249650	requirements? You know, I have this chip, it can do a lot more power, it's the regulatory
1249650	1254550	requirements and the chip calibration limits me to transmitting to quite a few dB less
1254550	1260530	than what the chip is apparently capable of doing. Why is this a problem? The main reason
1260530	1266930	is you don't have the equipment. Who here has an actual 6 gig spectrum analyzer and
1266930	1275530	power meter? Anyone? Right. That's a minimum 30 grand entry fee to actually screwing with
1275530	1279850	transmit power. Because if you don't have that, you don't know if your device is actually
1279850	1284390	distorting when it transmits. So the first thing is that you got to have the right equipment
1284390	1288930	to actually measure this. The main reason is that people think about is the regulatory
1288930	1292830	requirements. The two parts are there's a maximum amount of power you can inject into
1292910	1299410	a channel and because Wi-Fi looks like that funny, like, spectrum, that has like a defined
1299410	1303570	mask when you look at it on a spectrum analyzer, you need to make sure you don't transmit power
1303570	1309270	into an adjacent channel that's higher than a certain level. And the specs, the 802.11
1309270	1313470	and the regulatory specs typically say what the maximum amount of power you can inject
1313470	1318630	in adjacent channels before your device is out of compliance. The other thing is that
1319150	1325190	RF is really weird. And at 5 gig, RF is extremely weird. And one of the weird things is that
1325190	1330910	trying to find components that will stay linear over 1 gigahertz worth of 5 gig bandwidth
1331350	1336470	is exceedingly hard to do. And trying to design an RF circuit that's linear over that requirement
1336470	1343470	is exceedingly hard to do. So trying to make sure that your design has both 2 gig and 5
1343470	1349810	gig amplifiers that remain linear over the course of that entire bandwidth is actually
1349810	1356010	hard. And what tends to happen when you look at the output distortion is it's not straight.
1356010	1361070	It does this or it does this or it's wavy. And so as part of the card calibration, they'll
1361070	1367570	actually pick the maximum transmit power that you can do per channel based on what the actual
1367570	1371590	card when you test it gives you distortion wise. They'll say anything more than this
1371590	1376010	much power at this frequency drives the transmitters into nonlinear, some kind of nonlinear behavior
1376010	1384170	that have to drop the transmit power. The third thing is that transmitting on 3 antennas
1384170	1389730	like half a watt is actually pretty power hungry. And most of the stuff that you're
1389730	1395870	plugging into isn't designed for lots of periodic bursts of a couple of amps worth of power.
1395870	1402230	And so the power that your slot can provide you is typically less than what you're using
1402230	1409530	to transmit. And the power requirements change based on the channel and what kind of thing
1409530	1415850	you're transmitting. And this is all the crap that gets looked at in the lab. So the power
1415850	1423170	consumption varies quite a lot and decoupling caps only work so well. And so when figuring
1423170	1429190	out can I overclock, the answer is maybe. Even inside regulatory, even if your card
1429190	1433150	is doing 2 or 3 dB less than the regulatory requirements say, sure. That doesn't mean
1433150	1438570	that the card can actually do it. So I highly recommend that you get some, loan some equipment.
1438750	1443590	And the other thing is all of the high powered NICs I've seen, they'll actually have a 5
1443590	1447970	volt input on them specifically coming from some external source that's not the USB or
1447970	1454250	the PCIe slot. And so you know you have a real high powered NIC if it actually has some
1454250	1458490	external source. You plug it into a mini PCIe slot, the card says it can do half a watt,
1458490	1464910	it's probably distorting. The next thing people ask me to do is can I make it tune to like
1464910	1472130	6 gig or 4.8 gig or like can I pick a tuning that isn't the channels to tune on. And the
1472130	1477490	short answer is sure. The long answer is we only calibrated the NICs for specific channels.
1477490	1482870	For all the reasons I just talked about. And yeah, you can pick arbitrary frequencies to
1482870	1487690	tune the chips to, but not only has it not been tested and you may damage things, the
1487690	1493490	RF synth, RF is weird and as you change the RF synth, it's doing digital, like there's
1493570	1497870	a PLL and it's doing digital upscaling and it may generate noise spurs all over the place
1497870	1502030	based on the current setting of the RF synth and what the devices are and which bits you've
1502030	1506770	turned on or off. So they actually test this stuff in the lab to say okay, this particular
1508190	1513270	synthesis setting for this particular Wi-Fi channel meets the requirements of low spurs
1513270	1517970	and low distortion and it's actually accurate. And you could tune it to arbitrary frequencies,
1517970	1522130	but unless you test it, what you may actually be doing is damaging things, you may be actually
1522130	1526750	generating more noise and the thing may actually be drifting more than you'd like. So if you
1526750	1531610	get a fiddle with this for fun, get a spectrum analyzer and actually test this stuff.
1533230	1537550	The next thing that people ask me is how do I make my NIC work with the microwaves on
1537550	1541930	or how do I have it do a long distance link? And all I'm going to tell you here is read
1541930	1547370	the noise immunity code because it actually twiddles all of the hardware inside the thing
1547370	1554510	for tuning signal sensitivity. And so the NIC gets a handful of microseconds during
1554510	1560770	the preamble to lock on to the Wi-Fi signal and figure out the right signal size. If you're
1560770	1566050	trying to do things like receive long distance traffic and local traffic which is quite high,
1566050	1569870	the NIC doesn't have a lot of time to figure out what the right gain settings are. So when
1569870	1575310	I'm doing this stuff, and I know that I have a mix of long and far traffic, I'll have a
1575310	1579950	NIC doing long only traffic and I'll have a NIC doing local only traffic so that I have
1579950	1587070	a higher percentage of being able to see far away packets before the preamble stops and
1587070	1592690	the packet starts and reception sucks. So if you're experimenting with noisy environments
1592690	1598130	and long distance weak signals, look at the ANI code and read the patent. And I think
1598130	1602310	this is the last thing on the playing around bits. So a couple of years ago when I was
1602310	1606550	working there, we actually got the spectrum analysis stuff open source. So it's in BSD
1606550	1610110	and it's in Linux. There are open source tools for pulling the stuff out. So all those pretty
1610110	1615010	waterfall things you get from like the ubiquity access points, we put them into waterfall
1615010	1619610	mode and you get a channel thing. All it's doing is it's putting the NIC into spectrum
1619610	1626230	mode and scanning over all the channels. And so if you want to actually do it on a Theros
1626230	1630510	NIC without needing to have any other equipment, you can get a pretty good coarse grain idea
1630510	1634670	of what channels are busy, what channels are worth looking at, what's Wi-Fi and what's
1634670	1641410	not Wi-Fi. And as I said, it's all open source. The thing to keep in mind is the same block
1641410	1646150	doing FFT is used for RX and spectral mode. So you can't receive packets at the same time
1646150	1650310	you're actually doing FFT investigations. When you trigger an FFT, sorry, when you trigger
1650470	1655030	a spectrum sample, it doesn't do receive for that period. So I'll use two NICs. And a lot
1655030	1659750	of the enterprise hardware will actually put a second NIC in there, cheaper NIC, specifically
1659750	1665190	to do spectrum analysis in order to pick the right channel to work on. And I don't think
1665190	1668710	any of the open source access point products currently do this, but all the source code
1668710	1673430	is there. If you want to play, then have a play. Now, I see a lot of people walking
1673430	1678630	around with a Theros NICs hanging out of their laptops. And so I figured I'd talk a bit briefly
1678630	1683550	about what's actually going on under the hood in these things. So all the HTC parts have
1683730	1689930	a little 10 silica CPU that's sort of MIPSy and a normal bonafide, honest to God, a Theros
1689930	1695970	Wi-Fi chip in it. So all the crap I just talked about, you can do with the USB NICs. So yes,
1695970	1700610	you can do spectrum analysis with the HTC NICs. Yes, you can vary transmit power. Yes,
1700610	1707810	you can do all the fiddling with it. The early, the first USB stuff had an actual separate
1707810	1714290	CPU and PCIe NIC, the AR9280. And the one that I think everyone has is the single band,
1714290	1719330	single antenna AR9271, which is slightly cut down, but it still does all the same stuff.
1719330	1726330	You can still do spectrum analysis, radar, not radar detection without 5 gig, all the
1726330	1737270	same debug modes, all the same signal level stuff. So the driver in Linux mostly treats
1737270	1741670	the USB widget as a dumb DMA pipe and it knows a little bit about station stuff so it can
1741670	1748290	do frame retransmission in the NIC for doing TX aggregation and rate control, but we're
1748290	1753030	trying to strip that out because the number one reason why you can't run more than 8 stations
1753030	1755950	on one of those NICs in access point mode is because there's a limited amount of RAM
1755950	1762290	on the NIC. But again, the CPU can act as a dumb DMA pipe and the plan is to do that
1762290	1767630	and then we can have as many stations as the driver allows you. And that's actually open
1767630	1771450	source now. The firmware is open source. So if people are interested in doing things like
1771450	1776770	running custom code inside the firmware on the USB NIC, you can actually do that. It
1776770	1782630	uses the open source, tens of GCC tools. I'll put the GitHub repo up here soon. You can
1782630	1787190	build it, you can install it, you can fiddle with it. If people have questions about what
1787190	1792690	kind of weird crap they want to do with their NICs, please let me know. I was going to do
1793050	1796510	like a walk through the hell and show you guys how the thing holds together and what
1796510	1800150	to look at, but unfortunately there have been some significant technical issues in getting
1800150	1806170	things to work. So I'll finish by putting up where the source
1806170	1812410	code is. And everyone takes photos. So Qualcomm and Theros actually put up a GitHub repo a
1812410	1817370	couple of years ago that they're putting all of their projects inside. And everything except
1817370	1823490	the cell phone software firmware and the 11AC firmware is currently up there. Including
1823490	1830350	firmware for their pre-11N USB NICs. I think it was a 5523, yeah. None of us have actually
1830350	1834370	used it. Like, the hardware's out there and there's a driver for it. The firmware's out
1834370	1839450	there. It's a normal Theros device with a little MIPS CPU in there. So it's all documented.
1839690	1844590	The only thing that they haven't opened up is Bluetooth, mobile, and 11AC. And the common
1844590	1848730	question I then get at this point is, what the hell are we going to do about 11AC? Well,
1848730	1853810	I don't work there. So I decided to sign the NDA to get source code access. So I have source
1853810	1859350	code access, but it's not public. The source code isn't public, but if you sign the NDA,
1859350	1864270	you can get access to the firmware source and it looks like a Theros chip with a little
1864270	1871390	CPU inside, as everything else does. The aim behind a bunch of us that are looking at this
1871390	1875550	and admittedly I haven't done very much, but I plan on stepping this up around September
1875550	1879190	is instead of there being, what we don't want to see is a lot of little individual companies
1879190	1883270	publishing their own firmware blobs and suddenly it's like, I have to use company A for station
1883270	1888170	mode and company B for access point mode and company C for mesh mode and there's a dozen
1888170	1892070	different firmware blobs and a dozen different versions of the Linux driver to support things.
1892070	1897210	Our plan is to have one tree that we all share internally inside the little NDA enabled group
1897210	1904270	and ship one binary firmware image so that we're not duplicating effort. The 11AC hardware
1904270	1910870	is actually pretty cool. So if people here are interested in doing 11AC product developments,
1910870	1913830	the hardware will do meshing if you want to spend some time doing it, the hardware will
1913830	1918410	do all the other stuff that you guys are used to, please contact me and I'll bump you
1918410	1924870	over to the open source group and you can sign in and have a chat with them. So the
1924870	1930670	NDA program, I get a lot of cool hardware. Mostly because I import free BSD for fun.
1931770	1935550	There's an open source NDA program where you get access to their internal reference drivers
1935550	1940030	and if you're really nice and not jerk faces, they'll give you data sheet access and you
1940030	1945750	can talk to the developers. But they're all pretty busy people, so I don't recommend shouting
1945750	1951470	them too many questions. If you can talk to the other people like me who have NDA access,
1951470	1957170	we're quite happy to solve problems that would normally take time away from the hardware
1957170	1961530	developers. If you're really, really nice, then they'll actually give you reference design
1961530	1968930	boards. So they actually want to see, there's a group inside of QCA that actually wants
1968930	1974250	to see more open source stuff. They have a pretty heavy OpenWRT group inside of there,
1974710	1980470	bringing their stuff up with OpenWRT and pushing things upstream. So if anyone here is actually
1980470	1984030	looking at doing new product development and thinking of a thorough stuff, the place to
1984030	1988330	start is by talking to these peeps, getting them to, getting a good relation with them.
1988330	1992230	They're down in San Jose, near the San Jose airport, so it's worthwhile having lunch with
1992230	1995630	them and actually talking about the sort of stuff that you're doing and they're doing.
1995630	1999950	And then lawyers are actually kind of cool. All the lawyers inside of Atheros that I worked
1999950	2004230	with and still do here and there, they're the ones that got us access to all of this.
2004390	2008550	They're the ones that approved all of this firmware access and source code access. So
2008550	2013590	they're pretty clued in about open source and working with the community. So if you'd
2013590	2018070	like to join, let me know. You can find me on the internet, it's not that hard. And we'll
2018070	2025390	set stuff up inside of QCA for you to talk to them about stuff. I am trying to get together
2025490	2029310	a group of people to actually do open source Wi-Fi development stuff in the Bay Area because
2029310	2034450	there seems to be a lot of interest, but lots of little disparate groups, you know, groping
2034450	2038210	around in the dark and not necessarily knowing what's going on. So if anyone is interested
2038210	2042470	in coming to the Bay Area sometime later on this year and actually meeting some of the
2042470	2046350	people involved in this and collaborating on learning how the hardware works and what
2046350	2050310	you can do with it and the open source drivers and Linux and other operating systems, let
2050310	2056730	me know. And if there's enough interest, I'll finish putting it together. Any questions?
2059870	2072140	It's either a good sign or a bad sign. We ran out of time. Cool. Well, you know, the
2072140	2076920	hardware is open and it's a long cry from how it looked 15 years ago. Yes?
2080680	2092190	Okay. So the reason why, if you're doing 802.11 stuff, this is good for doing data stuff
2092190	2098370	because it's this big. And anyone who's tried doing actual 802.11 MIMO 11N decoding in SDR,
2098830	2104150	your entry level is an actual FPGA board. And like the FPGA boards that we use, there
2104770	2111050	are like two of these sized FPGA boards running the Wi-Fi bit set quite a lot slower because
2111050	2119190	they're FPGAs. So if you're trying to do like 20, 40, 80MHz 11AC stuff using an SDR, you're
2119190	2124190	probably not going to be doing it at full speed, not with current hardware. The thing
2124190	2128370	to keep in mind is, you know, if you want to be doing a 20MHz channel, your SDR has
2128370	2134410	to be sampling at at least 40 and maybe more. And so, you know, 11AC starts at 40 and goes
2134410	2140150	up to 80. And when you're doing 160MHz, suddenly you're going to have to have like 320MHz wide
2141930	2146950	stuff. And that's a lot of data. And then you have I and Q and you split that off and
2146950	2152110	you get two streams of data and then you have IQ per radio chain and that spirals off into
2152110	2158430	hell, right? So for doing 802.11 sniffing, these chips are pretty good. If you're doing
2158430	2163770	general signal analysis, these chips are not designed for doing general signal analysis.
2164550	2171570	But they're like $2 on eBay. So, yeah. Any other questions?
2172710	2174590	Cool. Well, thanks.
