So why should we use WiFi as oppose to cellular, well a typical rule thumb is that we use is that we ask ourselves the following question is there WiFi around and if the answer is yes then we are going to use WiFi and if no We're going to use cellular. I'm sure you can relate to that. And there's actually for good reasons. I mean, if on cellular you're going to use up your data for the month, and you have to pay every time that you try to access data depending upon what your plan is. Whereas on WiFi it's unlimited if you're actually on the access point unless it's locked. If you can get onto it for free, then use it. because it's not going to waste your data. Even beyond that, typically, again if we're stationary, and we're on one axis point, lots of times we'll see faster speed on WiFi than we will on our 3G. And large reason for that is due to channel conditions. But as we will see right now, the channel conditions can vary a lot. Depending upon how many people are on the access points. So they vary quite a bit, they can either be very good or they can be very poor. First thing that determines the channel conditions is signal strength, which is what we talked about with cellular. So signal strength is so important, our signals attenuate as we get farther and farther from the access point. And you can tell your relative signal strength by how many bars you have on your phone. That's an indication of how strong your signal is. So if you look in this example right here, we would expect that Anna is going to have a much larger signal strength 'cause she's very close to the access point. Whereas someone like Dana whose farther away or even up to 70 meters away from the access point, would have a much, much weaker signal. The other thing is interference, so the more devices we have in the network the, or the same access point. The more devices we have on the same access point, the more interference we're going to have. So every other device that we add in, talking on this access point, basically means that everyone in, on the access point is going to have a smaller and smaller data rate. And WiFi is particularly succeptible to that, based upon the access method it uses for controlling how people can share the network medium. So the data rate varies a lot. We said that IEEE802.11N, or the N standard that came out in 2009 had a data rate of up to 100 megabits per second. Let's peak data rate, what it can supply at peak if you were Anna here and you were the only person on the access point. But that can go down as low as one megabits per second, it can be barely faster than what you have on 3G and maybe even slower. And especially if you have LTE which has much higher data rate, so you can, lots of times actually see faster speed depending upon how many people you currently have on the access point. A really good example of this is when the, the late Steve Jobs who's the former CEO of Apple introduced the iPhone 4 in 2010. In the auditorium he was in he had to ask everybody to get off of the WiFi because he couldn't get onto the WiFi and do his demonstration. And once everyone else got off he was able to demonstrate that his phone could get on WiFi. But until everyone got off, he couldn't get on. And, that just goes to say that interference varies a lot, depending upon the number of people that are currently in the access point. So, how do we access WiFi, what, what's the process that goes on to do that. Well the first thing you have to do is your device has to select which access point it's going to use. And by selection we, the technical term we use is associate, and associate really just means choose. So how does your device choose it's access point? Well it uses something very intuitive Something that we talked about with cellular. The signal to interference ratio. The one that has the highest SIR would be the one that your device would choose, given that it could access all of the AP's that were in its SSID list. Obviously, it can't, because, so we choose out of all the ones that aren't locked because you can't get on the ones that are locked. And so it's going to want the one that's going to give us the highest signal to interference. If you remember the way we defined SIR was the signal [NOISE] over the interference plus the noise and we looked at a lot of calculations with that when we looked at distributed power control. Same exact metric and it's useful in very, very wide variety of different networks when we're talking about transmission. We're always looking to signal to interference ratio rather than just signal strength. And so, in this example over here where you'll see that typically throughout this lecture we draw circles around the access points. So these two, A and B, are access points. And we, we draw circles around them to denote their transmission ranges. This and how far they can see. And if a device is within the transmission range, it means it can associate with it. So this device here is only in the transmission range of A, so it can associate with A. Whereas these three devices are within the transmission ranges of A and B, so they can choose either one. So this device only has one choice and it's going to choose to associate with access point A. But these two devices here have a choice. So, this device will choose to associate with B because the signal to interference ratio is higher. Whereas this device will choose to associate with A, because the SIR is higher here, because 10 is greater than 9. But down here, 8 is greater than 6. And this device again only has once choice. The second thing once it chooses the access point that it's going to associate with that's to choose what channel to go on. So then your device, now your device has chosen its access point. This is its access point over here. Your device has chosen which one it wants to assolciate with. Now it has to choose the channel. And it's pretty simple, you just choose the channel that the access point is on. Let's look a little more about how the channels are laid out, and we're going to see right now that they overlap, so this is the channel allocation for 802.11b, so for that b standard, and this is right around 2.4 gigahertz, as we said before there was one around 2.4 gigahertz. One around five gigahertz or so, little within five gigahertz. And so, we didn't really go into this too much in the last chapter on cellular when we talked about frequency division [INAUDIBLE] access. But each channel as we said last time, we did say that they do have a range of frequency. So, a channel isn't [UNKNOWN] operating at just a single frequency. They have some range associated with them. And so, we would specify that range. And we can either specify a channel by giving where it starts and where it ends which isn't totally standard. But if we're looking at channel six over here for instance we could say well, channel six starts at whatever 2.437 minus 11 or 2.426 and it ends at 2.4 448, and we could say that if we want, but whats more standard actually is to specify the center frequency. Here we have 2.437 gigahertz with a span of 22 megahertz around that center frequency, and that's how we can specify the channel. So what you'll notice here, and what you'll see is We have 11 channels now on this 802.11b standard. But, you see that they overlap. Right, so there's a lot of overlap. Two part of it is overlapping with one. Three would overlap with 1 and 2 and so on. And the reason we have them overlap is well there's only a certain number of channels that we can fit in here. This is only a finite amount of spectrum. We have 72 megahertz. So to figure out the number of channels that we can fit within 72 megahertz, we can just do a simple caluculation. We take 72 megahertz and for reasons associated with how the device is operating, they need a certain spectrum in order to fit whatever bandwidth it is or whatever data it is that they're operating on. So each of them needs to have 22 megahertz. It's just a given for this attribute here 211B. They need 22 megahertz. So we divide that by 22 megahertz. We get a number that is between 3 and 4. [SOUND] So we know that if we round that down we can only have a maximum of 3 non-overlapping channels because we have 72 megahertz total and then we have to fit 22 megahertz in there. So if we wanted them to not overlap, we can only have 3 maximum. So at least we have 3 non-overlapping channels here. We see channel 1, channel 6 and channel 11 are non-overlapping. But we have to separate them By only five megahertz which means that one, two, three, four, five will overlap somewhat, and and so one as we go down. And so this actually creates some unnecessary interference in the sense that when you take your axis point out, or when you take your router out of the box. We're typically always on some default frequency. So, it might be defaulted on channel six. And if your access point is one channel six and your neighbor's access point is on channel six or you're somewhere, and you have two access point that are close to each other that are both on channel six then the devices that are associating with each of those access points are going to interfere with each other unnecessarily. So if they change the frequency. So, if one of them was then on six and one of them was on 11, instead. You would cut out half the people you'd have to be interfering with. Because, then, if your devices were all in the six range, and then someone else's devices were all in the 11 range, you'd be okay. But by keeping them all on the default frequency, not only do we have interference amongst The ones in our current access point were also interring with devices that maybe associating with a different access point. So for instance in this diagram up here, if both A and B were using channel six, just say they were both on channel six. Then all of these devices would be interfering with one another instead of just having this device and this device interfering with one another being that they're on A and having this device and this device. So if we change 6, for instance from 6 to 11 we wouldn't have that problem. And the third thing that used to happen, so you have to select your axis point, then you have to choose your channel. And that's easy, you just choose the channel that your axis This point is on. Then you have to select a rate. And the rate varies a lot. And the rate is going to vary as interferent conditions change. Because the courtesy procedure, quote on quote, courtesy procedure that WiFi makes our devices handle, requires us to back off for the standard one that we use. When there's more interference conditions and more congestion, we have to wait longer before we can retransmit. So, if you're at a stop sign and you see many people coming down the road you may have to wait a long time before you can actually access it unless you want to have an unnecessary collision. And we'll look at backoff more a little later.