How WiFi Works - Computerphile

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
steve what what are we looking at today though well i'm slightly concerned by what i'm looking at because you seem to be in a different location have you expanded is there something odd going on and you're stroking something like a bond villain there yeah i'm puppy sitting so this is marley hello hello marley say hello to everyone there we go that's marley marley is a ship and unfortunately i can't leave him alone for very long because he's quite young so he's probably going to eat the microphone and everything but it means that i'm having to do this on wi-fi well that's great because i wanted to talk about wi-fi we briefly touched on this when we talked about the wi-fi hidden no problem where you've got the access point and then you've got the two computers that are sufficiently far away from it that they can't talk to each other they can't see each other's transmissions but they can both talk to the access point and we talked about how the access point could configure things by sending the sort of clear to send packets out to enable them to communicate without colliding with each other when both machines tried to transmit at the same time and i thought we could talk about a few more issues that sort of come up from using wireless networks that you perhaps don't get in the same way if you've got a cable between all the machines in particular this is the fascinating sort of relationship between your sort of wi-fi speed distance and time when we have a wi-fi network we we know the basics we have an access point which is connected to our internet connection via ethernet usually technically doesn't have to be but that's what we tend to use these days and then it transmits via radio waves either 2.4 gigahertz or 5 gigahertz or a few variations but we won't get into that we'll keep things generic in this video it transmits the data to your machine and we sort of know intuitively from basically having used it that if we are sitting close to the wi-fi access point then generally we'll get a good connection the speeds are high but and i think you've experienced this short if you get far enough away from the access point well the speed tends to drop off until you get further enough away you don't get any speed at all and you just lose connection so i thought we could talk about why wi-fi networks have to do that and some of the implications that become because of the way they're managing it now why does the speed have to drop off well i think an easy way to look at it and to make things slightly tricky for sure when he's editing this video seeing as he's remote and i'm remote is i've got um my ipad here and we can see the problem visually i put some text on the screen of the ipad and hopefully you can see this if not sean's got some superimposition to do um but it's uh can you see what it says here sean it's just bleached out on the skype i'm afraid it's all completely white as far as i can sort of bring the brightness down oh yeah just sort of yeah i can see this text but it's a bit blurry so you can see this text is a bit blue now one way i could get that better for you is to bring it closer and if i bring it closer to the camera eventually it's still gonna be blurry because i'm not refocusing the camera i can see words bit more clearly but i can't see what they say let me just make the text um bigger okay um so we're going to do the same thing i'm going to make the text right yeah we got it now hello world hello world yeah and things and in fact if i was to come back to my um thing here if i made the text sufficiently big back from where i originally started i increased the size eventually standing over here you'd be able to see yeah i mean notwithstanding the odd reflection i can see hello world now we can work that out yeah yeah exactly and in many ways that's what's going on with a wi-fi network when i was far away and the text was small that's equivalent to us transmitting the data very very fast if you were standing where i was you could read that text fine but you couldn't because i was far away from the camera and the camera and the skype connection was sort of reducing the quality of the image and it's the same sort of thing that's happening with wi-fi we know that the wi-fi is transmitted over radio signals and to do that it needs to encode the zeros and ones that make up the data packets the ethernet frames that are being transmitted into the radio waves we'll gloss over how that's done we'll just keep it general for this video i'm sure we can do another video or someone can do a video on all the encoding that's done for that that's not my area of expertise uh and things um but we take the data and we encode it into a radio signal that's transmitted and if we're transmitting the data very very fast and we do that by making each symbol of that message well that's a zero and one and again i'm glossing over how that's encoded each symbol relatively short amount of time it's a bit like when we had the small text visually so the the bits of the stems of the characters were small so we made them take up a small amount of time as we transmit it now that's fine if you're sitting underneath your wi-fi access point you'll receive the signal and your laptop or whatever it is we'll be able to decode it and get the original zeros and ones that make up the frame and process the data there's probably some error correction going on in there as well just to be able to sort of correct things or at least error checking to and so you know if the packets got corrupted and you can ask for it to be reset so that's fine if you're there but as you move away from your access point then you're still going to get the signal but as you move further away from it the signal level is going to drop just because of the way that radio waves work further away you are from the source the less powering kit but also it's not a perfect environment you've got noise in the radio spectrum anyway from various sources other wi-fi networks nearby or far away just general background radio noise if you've got an old fm radio and you tune it to an area where there's no station you can hear the static that's just the noise of the signal that's there so you've got the signal which you're transmitting which is getting less and less in power as you move further away but you've also got noise then that becomes a point where you can detect there is a signal just like you could see that was something on the ipad screen but you can't determine what it is because it's sort of mixed in with the noise so how do we get around that well we do the same thing as i did with the text we make the symbols that make up the message bigger now we can't make them bigger physically like we did the text but we can make them longer in time and if we make them longer in time that means it's going to take longer for us to transmit each symbol which means it's going to take longer for the whole packet to transmit which means that the data that you're receiving will come in slower so a lot of the things that your wi-fi access point in your laptop tablet phone whatever it is you're using need to do is negotiate a speed so that when they transmit the data it's transmitted at a speed that the other end can receive it with enough clarity there's still noise there just as you saw that the text was still wasn't perfectly crisp but it was sufficiently clear enough amongst the noise which we simulated with the camera and things that you could actually get the message and it's the same thing that you need to do with wi-fi so if your access points here and your three floors up in your studio then you're going through all different floors which are going to attenuate the signal there's noise from other things in there and eventually you find that you get a really slow signal it's actually quicker to pick up the usb stick and walk around and deliver it by hand than it is to transmit it over the network connection on the other hand if you're downstairs looking after your dog in the lounge and the wi-fi access point is probably somewhere in the same vicinity you get a rather decent signal and you can do things you can watch netflix whatever it is you want to do without any problems other streaming providers are available like the bbc iplayer amazon prime tc plus discovery the speed in which we can transfer data over wi-fi is inherently related to how far we are from the access point because as we get further away we need to transmit things either in a longer amount of time so that they're clearer to the receiver because it says oh this is slightly higher up now for two seconds strength time massively but you get the idea so this is probably a one or a zero for two seconds whereas if it was just sort of half a second again shrink time to some speeds that these things work at it would be much harder to see what was actually was that just a bit of noise that i got there or was actually the one that was being transmitted you can't tell on the other hand if it's a longer higher level for longer you can receive what the signal is the other thing you could do of course is boost the power up but you don't really have that option if using something like a laptop because you've got a finite amount of power from the battery and the access point if it boosts the power too much is going to flood the whole neighborhood with your wi-fi signal or you could use a better aerial but again the aerials are built into [Music] the machine and so on you need to do something which means you can receive the signal clearer than you could before and the easiest way for the access point in the laptop to do that is to just reduce the transmission speed make the symbols longer in time and then you can detect what they are and receive the ethernet frame the data packet with the data that you're interested in now there's an interesting implication of this because we also need to think about how our computers know whether there's a wi-fi network there so when you open up your laptop sean and you want to connect to a new wi-fi how do you do it um you don't make the dog bark [Laughter] well if you go for a new one you basically scan the area don't you you do you click on whatever icon it is on whatever operating system you're using that you know see what networks are out there so presumably they're announcing themselves somehow are they yeah exactly so generally unless it's a hidden wi-fi network what we do is we see a list of all the wi-fi networks that we're interested in and we just pick the one that we want to connect to it'll then ask us for some encryption details sort of the pre-shared key or maybe some authentication details so that we can set up an encrypted session so the data is not transmitted in the clear at least hopefully and things and then they can talk to each other but the wi-fi access point it does that by sending out what's called a beacon package and this basically just announces that the wi-fi network is there and is one of these sent out for every different wi-fi network that exists so if your wi-fi access point is broadcasting several different wi-fi networks for different reasons like the ones at the university are you've got eduroam for general use you've got specific ones for our robots and things to connect to which have slightly different setups on them then it needs to send out a beacon packet for each of what we call the ssids that describe each of those networks and so it'll send one out for rome it'll send one out for the robot related one and so on but now think about it it cannot send them out at the fastest speed because if it did and you're sitting three flights of stairs up in your studio you wouldn't detect it and so you wouldn't know the wi-fi network was there so how do you think the wi-fi access point gets around there well assuming he's got a variant speed yeah and so actually what the wi-fi networks do is when they send out that beaconing packet they send it at the slowest possible speed that they're set up to do and that could potentially go as low as one megabit per second if you're really far away from a wi-fi network then you send that at one megabit per second does that mean that you're actually seeing um networks from far far away ones that you probably wouldn't even really realistically be able to use potentially yeah i mean i remember when i moved into my house for the first time opening up my uh this is before i put the wi-fi network in which i did relatively quickly uh before things like the bathroom but that's another story uh i opened up the wi-fi tab on my mac and it was basically the whole screen full of wi-fi networks every sort of house in the area you could see a different wi-fi network you could tell which providers are using based on the ssid still saying bt virgin whatever what network provider they were with and so on but you could see all these different wi-fi's chances are most of them you'd be so far away from that even if you knew the credentials you wouldn't get a good signal but you could just about to take the beacon packets and say ah this network is out there now the other thing is you can't just send these packets um once you can't just have your access point say hey here i am because if it did that well it might get corrupted on transmission in which case you wouldn't get it and so you want to know it was there or you might turn your laptop on after the access point is sent it's actually that access point sends that beacon packet out several times a second in fact it sends it every 102.4 milliseconds and things now put this together we're sending out a packet every 102.4 milliseconds it has to be transmitted at the lowest speed possible and it will take up a certain amount of time because it's got data that needs to be in there sort of what network channel which part of the 2.4 gigahertz spectrum is it using what the ssid is various other options and the machines need to communicate and things so it's about things about 300 bytes or so that these packets are plus you've got preambles and post ambles and frame check sequences so you can make sure that it says so it takes up a certain amount of time and as that's being transmitted of course you can only transmit one packet at any one time so as that's being transmitted you can't actually transmit anything else on your wi-fi network and this is why network operators who provide wi-fi in public spaces don't like people coming along and using their phone on hotspot tethering when you turn on hotspot tethering whether it's an android phone or an iphone whatever it is when we turn on the hotspot mode on our phone this effectively becomes a wi-fi network it becomes a wi-fi access point it's transmitting out beacon packets and it's either going to be on the same channel as one of your access points and if you've got a commercial set up so in a sports stadium or train station or something you're probably going to be using all the channels anyway so the chances that you're transmitting on the same channel as one of their access points is very very high it sends out its beaconing packet and again it will probably do it at the slowest speed possible because unless you've tuned it it'll do it about one megabit a second and so suddenly you have the access point peaking packet then you have your personal hotspot beacon packet and then they're going to be transmitted again in 102.4 milliseconds and so actually it doesn't take many personal hotspots or at rogue access points around to actually drag the speed of the wi-fi network down to sort of being unusable i think it's something like 15 extra hotspots it's that sort of order um if you not set them all up properly you can sort of drag the wi-fi speed down to absolutely terrible positions so actually when you sort of see people saying don't use personal hotspots here they're not doing it because they want you to use their wi-fi network well they might because they get money from that possibly but it actually really does degrade the performance for everyone so if you if you're trying to use a free wi-fi and you realize it's really slow so you pull your phone out to make a hotspot instead you're actually becoming part of the problem yeah effectively yeah and it's not just that even in your home network if you're sitting uh with your puppy um having a squat a skype conversation here then you've probably got pretty good signal there but if you've got someone upstairs working in the studio also on the wi-fi network who's on a slower network they're actually going to slow down your connection because their packets are going to take longer in time and while they're transmitting you can't transmit at the same time on the same frequency ignoring sort of memo type stuff which use different frequencies and so on but the simple thing you can't transmit at the same time until they're done so if you were to sort of sort of do a sort of round robin type transmission you transmit a packet yours is very very fast then you have to wait for their packet then you transmit a very small one then you have to wait for there it's more and you transmit another one wait for their small one you end up that most of the time you're sitting there waiting to transmit while the other person is transmitting slowly they probably don't notice much of a difference because your packets are very very fast and very very small but you suddenly find that your network speed is tanked purely because someone else elsewhere in the building is on the same network transmitting at a much slower speed yeah it's called psycaboo it's out it's after doctor who isn't it right so it's been a while since i've watched doctor who but the idea is that doctor who keeps showing people this blank piece of paper and it's psychic paper which means that they see some identification that means something and when that space what it's doing is it's looking for extra areas where it can add the nodes to build that graph up
Info
Channel: Computerphile
Views: 182,356
Rating: undefined out of 5
Keywords: computers, computerphile, computer, science, University of Nottingham, Dr Steve Bagley, Marley, 4k, UHD
Id: vvKbMueRzrI
Channel Id: undefined
Length: 17min 19sec (1039 seconds)
Published: Mon May 02 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.