Transcript for:
Introduction to Computer Networking Basics

hello everyone and welcome to the first class of cs340 introduction to computer networking in fall of 2020. um so why would you take this class well i don't know you must all have your reasons because you signed up for it but let me try to tell you why i think you should take this class um because it it teaches you how the internet works and the internet it's really cool you know it's one of the greatest technical achievements in human history you'll see throughout the class that's very complex and it um involves the the kind of coordination that happens to make it work is is really interesting and impressive and different than i think any other system you will have encountered or you'll see right so it's a big global system that involves uh billions of different machines um those are not they're not really coordinated like they don't they're not running the same software they're not managed by the same company but somehow those machines all can work together reliably and can and the system can grow uh can scale uh very well okay so that the internet doesn't have centralized control and has unreliable components yet it still somehow works and um you've seen obviously in your lifetimes and i have in mind the changes we've seen in our society that have been brought about by the internet and kind of mobile computing technologies so um i think any software engineer needs to understand networking at least at the level that we're going to be talking about in this class in this class i think we're going to be going like one level deeper than what a typical software engineer needs to know but that's a good thing okay as a software engineer usually you need to understand an application layer how to use networking like how to make a connection from a client to a server let's say to transfer data and you might need to know what kind of connection to make but you know typical software engineer doesn't need to know for example how routing happens in the internet okay we're gonna be studying that in this class because um first of all number one it's interesting it's it's it's like i said a very cool set of solutions to an interesting problem i think you can learn general lessons from that but also gives you a little bit of an appreciation for when things go wrong you know in your job as a software engineer let's say you can kind of have a mental model of like why things like why performance might vary in the way that it does um it helps you diagnose performance problems to anticipate uh performance issues and then of course you know obviously this is preparation for those of you i assume it's going to it's just a fraction of you but for those of you who are going to go on to study networking in great depth for example if you're going to go to grad school and study networking or you're going to go on to work at a company that really focuses on networking then of course you need to know this and a lot more about networking okay personally most of what i know about networking i learned on the job as a software engineer and as a kind of like network engineer before that in sort of it jobs and then i learned more by teaching the class of course but yeah so the course is really aimed at just giving an introductory level uh understanding of networking that is suitable for software engineers um those who want to work anywhere either whether it's front end or back end or full stack okay so we'll be talking about you know i described so far the internet as one thing but it's really pretty complicated involves several different layers so we'll be talking about the application layer different applications that run on the internet we'll be talking about encryption which enables those app applications to work securely we'll talk about making reliable connections on the internet routing which is getting data from one point to another on this big network and we'll talk a little bit about physical connections like just getting data from two neighboring machines and so these are a variety of different topics that cover different aspects of getting the whole system to work and we'll go through it kind of one step at a time for this class there's a textbook that's required this picture shows the seventh edition of computer networking top-down approach by um carosi and ross this is a very good textbook it's kind of the standard for uh university level networking classes uh which is why it's in seventh edition actually is also there's now an eighth edition available although i don't think there's a physical printed version of the eighth edition there's just an online version so far they're still working on printing it and then the next second half of this uh lecture i'm going to give you a sort of history of the internet and brief overview of the internet we're going to go into more details really in the second lecture but i want to talk to you a little bit about kind of like the philosophy and operation of the internet to give you a taste of what's what we're going to be learning and i'm going to be kind of jumping around here uh like throughout the class we're gonna be starting from the top application level level and moving down to until eventually we get to physical media in this class though this first lecture i'm gonna be talking a little bit about the whole stack including some details about some of the level like link layer stuff as well but you know we'll get to details of that stuff later okay so as an exercise before this introduction to the internet i want you guys now you all to think about what happens when you use internet okay so what steps are involved when you visit a website on your laptop how's that different on your phone versus your computer and finally the last question i have is what's the difference between the world wide web and the internet so i want you to actually stop and think so this is the first time i'm using the stop and think logo so this means pause the video answer these questions briefly i mean you don't need to spend you don't need to spend more than like one minute uh it could take less if you if you like know the answers very easily um but yeah just think about those those questions see what answers you come up with please pause the video now and answer those questions okay i'm assuming you've you've paused and now started the video again you have your answers now now i'm going to talk a little bit about the answers okay so um i'm actually not going to go we're going to spend the whole quarter talking about what steps are involved when you visit a website on your laptop actually so really this is meant uh just to get you thinking and if this is a real lecture to get you talking to your neighbor um so i'm not even gonna try to answer these these questions really we'll talk a little about world war i but the first the internet um in this in this lecture but um all the steps involved i mean so there's a dns query the translate i'm just say briefly that if you go to let's say google.com you have to figure out what the ip address is that you need to visit your browser sends an http get request to that ip address to fetch the like whatever url it is that you're visiting like that's sent in the request in order to make that request you have to set up a tcp connection which involves like a three-way handshake of packets between you and that google server in order for your packets to even get to that google server the routers along the way need to accept your packets look at the ip address and figure out where to forward them along the next hop in the in the network to reach the destination that happens for every single packet you send the server will have to will examine your request and figure out what data should be sent back in response in other words what's the website that i'm asking for the server will send back that data the browser gets it and gets it in chunks which are called packets reassembles it into one big document and then the browser kind of like interprets that html document to render something on your screen okay that's kind of a high level um there are many other steps there that i didn't really mention okay all right so we've been talking a little bit about the about the internet but what is the internet really um to fully answer that question again it'll take the whole quarter i think but we can start by saying that it's a network of billions of computing devices called hosts or end systems by network what i mean is a graph in the kind of discrete math sense so there are a bunch of nodes and edges so the nodes are devices and we have interior nodes which are these routers these kind of circle with x things on them we'll talk more about those later then we have we have these end hosts which are the laptops smartphones and servers that are connected to the routers that are connected to the other routers that are connected to all the other machines right so it's a network there are a bunch of computers which we call call these hosts or end systems every one of these hosts has an ip address ip stands for internet protocol so this is the subject look we'll come into look at in detail somewhere in the middle of the class how those ip addresses are used which and it may seem surprising to you that we're not going to cover ip addresses until the middle of the class but once you see once we get going you'll see that there are a lot of details we need to figure out even before we get to um ip addresses um although i should say it's more like a third into the class than halfway into the class um yeah and we also have a bunch of links that connect to the different nodes so the edges in this graph are our links so there's some i'm drawing these as lines but you can imagine these are either you know copper wire so let's so wires for electrical signals or they could be fiber optic wires um fiber optic links which are like uh will allow light to be sent back and forth to transmit information they could also be radio links like these mobile devices connected to a base station those are all links and these hosts send packets of data to other hosts the whole purpose of the network really is to allow the network the any pair of these machines to talk to each other okay so the internet is a way is a is a a structure that combines links and and routers to allow lots of devices and hosts to talk to each other in a pairwise manner so um this laptop can send a message to any one of the other end hosts in the system technically it also can send one to send a message to one of these routers but usually the purpose of these routers in the middle and switches is just to direct the only reason why they're here is to pass traffic to the um destinations of that traffic okay uh when what what when did the internet come about and who invented it um the internet actually grew out of the arpanet which was a u.s military-funded academic research project in the 70s it sort of became mainstream or public in the 1980s and uh but these days it's not it's much more than what it started off as i mean so the arpanet this u.s military academic project this is just what kind of created it was the first kind of global scale i mean really national scale network that that was the basis of the internet it started to get adopted by by universities and then that grew into a network that connected eventually now everyone on the on the can connect to any anyone in the world what's interesting about the internet is that it's not controlled by any one entity although there are certain organizations that have control over certain aspects of it so the internet itself like the operation of the internet is really a bunch of what are called autonomous systems which are networks that are operated independently like northwestern university is a campus and the i.t staff for northwestern controls the network on campus right that's an autonomous system so they kind of choose where to build the wires and they and where the routers and switches are going to be to create a network of that connects all the different users on campus that is an autonomous system we'll talk more about this in the second half of the class i think or the middle of the class somewhere around there but somehow that northwestern campus network is connected to other universities and um commercial internet service providers that connect northwestern to the rest of the world so yeah so it's a bunch of networks that are connected to other networks and that in turn creates the internet that there are two bodies uh that are responsible for um some tasks that are that are needed to make it all work so the icann is the internet corporation for assigned names and numbers basically what they do is allocate ip addresses and dns top-level domains to different organizations so um i said before that every host every machine on the internet has an ip address well those have to be unique like if i have one ip address i should be the only person who has that ip address apart from nat which is really just sharing an ip ip address but that's um that's a detail that we'll talk about later but um so if i if i address a packet to say that this packet is going to ip address number seven let's say just to simplify it that that number seven should uniquely identify one destination so that what that when a packet is sent i should be confident that it goes to the place that i intended it to go to so the icann is responsible for assigning ip addresses uniquely to the different autonomous systems which are networks internet service providers basically and then they give those ip addresses to their customers okay there's also this dns which is domain name service which is responsible for like the domains like you know northwestern.edu or google.com or facebook.com those kind of user-friendly names those are actually kind of like aliases for ip addresses so that the users don't have to type in ip addresses to web browsers or when you're emailing someone you don't have to you don't have to say like you know bob at some number you can just say bob gmail.com so gmail.com is a domain which is translated to an ip address so that the message is actually translated into like a machine that is that receives that that message um that's dns we'll talk in detail about that later the icann is responsible for kind of the the root dns servers which which control um who is allowed to decide um who has what domains okay so the icann manages just those two things the dns top level domain servers and the ip addresses are the the only things that need to be centrally managed the only resources that need to be centrally managed the other thing that's centrally managed is the protocol definitions and that's managed by the ietf the internet engineering task force so this this is the group that decides what the protocols are that devices on internet use to interact so in other words what are the rules for communication we'll talk more about protocols later in this lecture but they have a they have a process called rfcs which is like a public uh process rfc stands for request for comments that the etf uses to develop new protocols because the internet the internet was developed began development in the 1970s i guess what we what we call the internet really didn't come about until about 1983 with tcp ip that specific protocol suite which i'll talk about later but it's evolving so it's become more more protocols you know more features i guess you could say have been added to the internet over time they continue to be added um by and mostly that happens by the ietf approving new uh protocols through rfcs okay well again we'll talk about those later those are internet standards just as a joke this picture on the upper left left side is is really just a joke um but um vice president gore who i'm sure you you may know was in office from 96 to 99 he was uh he was a senator before he's vice president and and one of the things he did actually was support the funding of the arpanet and the internet the early internet and in those days they called it the internet super sorry the information super highway uh which is an outdated term but anyway so he was a very big proponent for the us government investing in the internet and at one point he kind of said that he he invented people some of his political opponents um sort of like made fun of him for claiming that he invented the internet um when really what he was doing was uh kind of promoting the funding for it but anyway um uh that's a little joke uh he got kind of um teased for for for claiming that he invented the internet um but this is a picture of him actually with with president uh clinton installing ethernet cabling in like a school or something but yeah al gore didn't create the internet um it was a a group of uh researchers in networking okay so looking back in that history so in the early days i mentioned arpanet was a us military slash research project for connecting uh machines around the us and in 1977 this arpanet which was a precursor to the internet could be mapped out on a single sheet of paper so this picture shows all the different machines that were connected to the arpanet and uh how they were connected right you can see that the the names you see on here like pdp 10 pdp 11 those are different models of computers like 360 is an ibm mainframe pdp is a what's called a micro computer just like a closet size computer in those days anyway and you can see also the names of the facilities like a l is argon national labs so that's the location closest to us illinois here is the university of illinois which is actually south of a l so this map is not geographically to scale cmu's carnegie mellon and you can see how these these different facilities were connected so lincoln labs is in like massachusetts right and mit and so on so across the country there were these links from you know the the midwest to the east coast and the extent you see stanford over here and there's even a link to hawaii and this kind of squiggly line here shows that it was a um satellite circuit so that there was a radio connection between uh california and a satellite and from a satellite to another satellite and from that satellite down to hawaii and yeah so there were just like a few dozen links and a few dozen computers they could all be shown on a map and if you wanted to send data from one place to one point to another you could kind of like figure out you could look at this piece of paper basically and like if you wanted to you could figure out what machines it should that the data should travel through to reach the final destination now notice that it's a network and not a like fully connected graph if for example you are the university of illinois you want to connect to all these other machines throughout the country to exchange research data it would be nice if you could just make let's say two connections one to utah and one to this wpafb i don't know offhand what that is looks like a router if you can just make those two connections or one connection even and then send your data just either left or right to reach its destination instead of having to connect like if illinois wants to talk to cmu sure you could build a wire from illinois to cmu and that would make that would be an efficient way to for that data to go there i mean the cost of spilling the wire would be expensive because it's really long but you'd have a really good connection but then that would not also allow you to reach all these other places so if you want to talk to everyone you have to have a wire to connect to everyone that's a bad design so a network allows you to have just like a small number of connections or even just one connection and to have those neighbors relay your data to the final destination so from an efficiency perspective in terms of the number of connections you have to build a network is it's like superior to the simpler design of making direct connections to everywhere you need to talk but it adds this complexity that you need to figure out like rules or protocols for getting uh machines to to to forward data for that is um just kind of passing through right so coming back to that question i asked you earlier on the internet and the web are not the same thing although in common parliaments and people these days when i talk about the internet often in popular kind of discourse what they really mean is the web the internet is the network like the the wires and routers the data connection is the internet the internet is a worldwide network of interconnected computers um so it's based on tcp the tcp ip protocol that was developed in 1983 and can we kind of say 1983 is the birth date of the modern internet oh um the web really refers to web pages and so you have all these pages um and it's called a web and it's a similar kind of term term as as network like a web is like a thing that has a lot of connections like a network but the connections that the web refers to are the links between pages so every page links to other pages those pages link to other pages so it's really when you talk about the web the web is a network of documents a network of information as opposed to a network of computers you could have it theoretically you could have a web you could take the world wide web and kind of download it on onto let's say one really big computer in one place and it would still kind of be a web of information because those pages would be connected to each other in interesting ways we can think of the web as one one application uh one of many applications i should say many um that were the run on top of the internet and dns we'll talk about dns later that's the way of mapping from host names to ip addresses the web uses the http protocol which was released in 1991 so so we can date the web back to 1991 which is you can see is newer than the internet this is invented at cern by physicists for exchanging information about um like physics stuff but apart from the web there are many other applications that use the internet and some of those don't use the web some of them do but you know things like email email actually predates the web ssh bittorrent voiceover ip for for telephone calls ftp remote desktop blah blah blah you know any smartphone app you use probably interacts with a backend service using the internet right but doesn't necessarily use the web okay i'll say this over and over again between the throughout the class but one of the cool things about the internet is that it's distributed and loosely coupled there's no one entity that manages all the hosts routers and links on the internet so that the hosts are managed by different owners like the machine the computers are owned by different people the routers are owned by different telecommunications companies and i.t organizations and links same thing but somehow they work together and no one organization decides where links should be built where routers should be placed who should be allowed to join the internet the only central um organization i mentioned the icann uh the the manages resources is just ip addresses basically deciding how different or different users are identified under your internet the hardware and software can be made by many different vendors there's no like standard machine you have to buy to join the internet as long as the manufacturer follows the standards internet standards those protocols and you know anyone can build a machine that can work on the internet whether we're talking about the hardware or the software um so this this all happens this is enabled this interoperability and um loose coupling and distributed nature of the internet is possible because of their there's uh their standards that allow interoperability so a network protocol is a set of rules basically for defining how computers communicate and this defines the types of messages that can be sent and a very precise definition of how to structure those messages at the bit level so that you know as a sender exactly how to how to write your message like what the zeros and the ones should be and for the receiver when the message comes in message comes in as like zeros and ones you know exactly if you're by understanding the protocol you know exactly how to interpret those zeros and ones to figure out what the message is um saying like what the what the request is uh the protocol also defines um you know what the different responses are that you should or could give to requests that come in and what what actions you should take to make the communication happen correctly okay so these protocols are very clearly defined at a you know bit level those allow new devices to join the internet and be compatible with it even though they're you know manufactured by different uh companies or users now to give you a little bit more of a sense of what a protocol is um the word protocol actually comes predates computers and uh it really comes from uh etiquette and human interaction so protocol like i said is a set of rules for interaction or communication but more broadly interaction if you remember in the um the first old star wars movie uh c-3po introduces himself as a protocol droid uh because if you i mean if you remember the movie his his role is to communicate right he's a translator he knows all these different languages and and he communicates between machines and people and people different species of uh you know aliens and whatnot because he understands the rules of communication okay so for people in in human society we also have protocols and etiquette to allow strangers to interact this is just like remember i was talking with the internet i said that new machines can join and interact with all the other machines on the internet if they follow the same rules follow the same the right protocol same thing is true of people right if you walk into a grocery store that you've never been to before but you understand the rules of grocery stores then you kind of know how to to shop and get your work done right you know that you can that what you're supposed to do is actually just go up and pick up the food that you want and put it in a cart and um you don't have to pay until the end like that's a that's a rule that we have that's a convention or it's part of the protocol but when you do finish collecting all your things you're supposed to go and wait in line okay the fact that you wait in line is part of a set of rules that we that we have learned right that's part of the protocol uh and then when you get to the when you get to the front of the line you're supposed to put your groceries on the car on the the belt you know the no one else can do it for you so that you have to do that that's part of the protocol um and so on right um the same thing is true of just like interactions with people if you aren't meet a stranger on the street um you know that um you know you should say hello to the person before you you say you ask them to do something else for you or whatever um we have we have all these little rules of etiquette which we can think of as protocols to allow us to interact with people we've never met before and to to to behave successfully in new situations as long as the rules for those interactions are ones that we understand ahead of time okay now with computers we need much more strict protocols that are very precisely defined because computers are not nearly as intelligent or flexible as a person right and so that's what protocols do and we'll talk throughout this class about protocols many different protocols that work at many different levels of the internet but every every everything we talk about in this class basically um is related to is a different protocol i mean there are many different protocols we're going to talk about that control different aspects of the network of networking okay so i'm showing this picture again same picture of the internet and all these machines you see here at the edge can send and receive messages but they're two different classes of machines here i mentioned this before we have we have the network edge which are the machines that have just one link they're at the edge because they have one link we also have the uh devices in the core of the network and i'm just defining those as the machines that have more than one connection so like in this case the picture just shows routers are the ones that have multiple links and they have a i'm showing this little icon that's like a flat cylinder with a little x switch picture on it and the purpose of these core devices is to provide connectivity for the rest of the network so um if like let's say this smartphone in the upper left wants to send the message so it has a link to the space station over the radio medium where i can send the message and then that message ends up here this router um if the destination for that message is actually somewhere down here like the server let's say it's trying to make a request to get an email message uh this the this router and all the other routers along the path will act as relays to just kind of forward the data in the right direction the purpose of these routers is to know what direction to send the data so that eventually it reaches the intended destination okay so these routers provide connectivity between the different parts of the network and then the edge and the devices at the edge are the users of the network whether they're clients or servers we'll talk more about that later okay so we have we have two different classes of devices at the edge and the core we also have the connections which i'm showing is lines and those are physical media we'll talk more about those at the very end of the class not too much actually just a little bit and those things together make the internet make the physical manifestation of the internet but really when we talk about the internet um the internet is really the rules of the internet are are the internet the protocols of the internet are the internet more than the physical manifestation of it is okay we have many different access technologies that are used for clients to connect for for users to connect um like for example wi-fi and in cellular and ethernet different kinds of links basically so the different connections that are used between the device to connect to the rest of the internet and you know depending on what they are as you probably observe they have different properties like different speeds and sometimes they're dedicated to you like if you plug an ethernet cable into your computer that is like you're the only one using that wire but if you're connected on wi-fi then you're kind of using the radio waves that might be simultaneously used by someone else you're kind of sharing that medium that airspace ip addresses sometimes are shared or given individually to people we'll talk about that later uh but let's talk now about a little bit of history just because it's interesting and it kind of motivates uh one of the main we can talk a little bit once we understand the history we can talk a little bit more about the in what some of the innovations of the internet are what makes the internet really um powerful and different from this old technology but in the early days of communication um i guess the earliest uh modern communication mechanisms were i'm actually if you think about it the uh postal mail was a technology and a very important technology that revolutionized people's lives we're not going to go that far back and that and that actually involved a lot of technological breakthroughs to make that work but if we go as far back as like the telegram and telephone what we had were electrical signals that people wanted to send between different locations so i talk into a phone the microphone converts my voice into a waveform and i want that waveform to be presented somewhere else so that someone so that it can go to a speaker and be translated back into audio and someone can hear what i said right um the same thing is true telegraph is just a simpler version where instead of encoding my voice i could just have like kind of like beeps i just want to send a series of beeps to encode like morse code messages but in the early days so people figured out you know in the you know more than 100 years ago how to send electrical signals on wires to communicate right so if you had a wire that connected if i had a wire between me and the person i wanted to talk to we could talk we could talk over that wire the challenge came about when you wanted to create when you wanted to connect lots of people to talk to each other right you could build a wire it's very easy to develop to see how you would build a system where if i want to talk to three people i would have three wires to went to those three people and i would just like pick up like connect my phone to one of to the one of the wires that correspond to the person i want to talk to right that's like the simplest possible system that's the earliest kind of system that was developed the way that even up until the 1950s the way that the telephone network worked was worked was based on on that very simple kind of manual connection between the callers so when i picked up the phone i would talk to an operator so my phone the wire that my phone was connected to would run to a call center like um like a telephone office like this where um one of these holes on the switchboard would be the end point of my wire and when i picked it up like a little light would would shine on my my wire that would tell the operator someone wants to make a phone call there and so they would plug their headset into that hole and then they would be talking to me and i would say oh hello i want to talk to so and so um and maybe you tell them what their number was like you would you would you would say i want to talk to um you know pers i want to talk to hollywood 403 and the operator would would would say would would make a connection between would now connect your wire could connect a wire from your hole to the hole that person you wanted to talk to basically connect a wire between his two holes so that your wire connected through this intermediate wire to the other person's wire and then the connection was established so that's a very early form of switching uh eventually this was automated so that you didn't have to talk to someone and tell them who to plug into what you would do is is press numbers on your phone that would create a set of signals that would tell an a mechanical system how to connect your how to how to connect your uh line to another line and there's a a kind of hierarchy to it where the first few numbers would relate to like the the exchange which the the kind of rough geographic destination and the final numbers would correspond to the particular person um yeah so that basic idea of so this was a network but it was the connections were controlled manually and later on electromechanically and that system kind of is still in in use today but only for the last mile of the network so that the internal part of the network has been upgraded or was upgraded probably decades ago to use newer technologies as they came out for making connections internally in a network but very often actually like you know in my building probably there's a telephone jack in the wall and that wire runs down to the basement and that runs out to the telephone pole and then that that part of those wires probably have been around since the building was built in like 1975. those are the same wires that were used in the early days for that old style of switching although the backend part of that has been upgraded so for internet access at home it's kind of interesting there are a couple of different technologies that are used that are based on old networks that were built for different purposes so the public switched telephone network that i was talking about before um dsl still uses that network for internet but it uses different frequencies so you can actually talk at this you can use that wire both for talking on telephone and also for um sending data and they don't interfere uh cable connections cable networks that we use for both television and internet were originally deployed just for cable television later on the cable companies realized that they could use those networks they'd already built to sell internet service to customers if they just reserved certain channels for data and they gave their customers a cable modem that would like send data back on those channels i'll talk more about that at the very end of the class so but but the point is that that network was not designed at all for data use for it was designed for analog video where you know maybe 30 or 40 different video channels were sent out broadcast at the same time to all the different customers um but these days both of these networks have been the core of them uses has kind of been replaced by a fiber optic network that is capable of handling any kind of data whether it's telephone video for for television or just generic internet data and we know that the internet itself is a provides by providing you know arbitrary data connections it can support any kind of communication including telephone and video we use it for but in the early days when we had you know we had the the internet which came out of the arpanet was a set of you know wires that were built specifically to connect universities and other kind of like important you know military research facilities that was kind of separate from this other network that was developed for telephone communications so we had the pstn for telephone and the internet kind of operated at the same time and in the 90s you know personal computers became popular and there was a demand you know companies that decided they could sell access to the internet so that people could go online and like send emails and find information all that kind of stuff the very early days of the internet but um again the only communication connection people had was a telephone so what people did was they used a dial-up internet connection and what this did was basically the idea was you would connect your computer to your telephone line and your computer would use a modem to place a telephone call to a local telephone number that was operated by an internet service provider and that isp would it would accept your connection and there will be a voice connection an audio connection basically a telephone connection between isp and your computer and your computer would send data over this audio channel so uh just as an example i don't know if you can hear this but when your computer [Applause] okay so that sound that you heard was the sound of in you know 1990s cable modem or not cable a 1990s modem fax modem that was establishing a data connection between a computer and a that's a server that uh would connect you to the internet and all those different chirps and and like weird noises you heard what that's the way that the computer that the computer is using a modem would communicate data so that the zeros and ones using audio you know so the channel was designed for voice communication you know telephone communication you had to somehow transmit data over that that audio channel and it did that with those weird noises um and yeah so while you're connected to the internet if someone else picked up the telephone it would actually and said something then the computer listening on the other end would interpret that as data and it would actually interrupt your session and corrupt your data and screw things up so your internet you could either use a telephone or use the internet which is kind of funny these days of course it's totally different and instead the most [Music] the next step after those dial up internet connections was dsl where you instead of having your computer sharing the same uh range of frequencies like that kind of audio signal that we can hear instead of the tel the computer using those others audio signals it does low frequency audio signals that we can hear um you'd have a dsl modem that used higher frequencies that would not really that they were much higher than what the telephone communication was using so you'd use the same wire like same connection between your house and the telephone company equipment but the low frequencies that you can hear would be used for voice calls and higher frequencies would be used at this very same time by your dsl modem to communicate data back and forth okay and of course this only works if this wire between your house and a telephone central office is capable of of of transmitting those high frequency signals in some places it's not this is why some people when they use dsl have better performance than other cust dsl customers it really depends on the quality of the liars between your house and the central office okay and this this also allowed a lot more a lot much faster data because the the range of frequencies that were used here went up really quite high and whereas the if you're relying on it on the voice channel you know that voice channel is really designed just for very simple audio communication not for really dense high frequency uh communication okay um cable networks i'll talk more about these at the end of the in the end of the class so kind of last second and last chapter um in the early days what what cable companies did was basically they had a bunch of channels that different subscribers wanted to see on their televisions and you'd have all those channels uh would be sent simultaneously on a single wire so that's the cable that goes out to the customer's houses and the same basically what would happen is if you subscribe to cable like someone would come out and they would find the cable wire in the alley and they would kind of splice into it and connect a wire to your house and so everyone was getting the same signal which carried all the channels at the same time um you can see basically so those cables look like this and you have different channels there are different frequencies that have different video channels so later on when the cable companies wanted to uh support internet service they reserved some channels for data and then the cable modems would um send their data in those channels while at the same time the video would come in on the different channels okay but um the details of this are not super important yet we'll come back to this later i just wanted to give a little taste of that now um as we're getting a general introduction to like all the topics of the class when it comes to making links links between different um computers and routers on the internet uh you've probably seen ethernet cables look like this and inside those cables are twisted pairs of copper cables the reason why they're twisted is to help reduce noise and these work well for short distances and for speeds up to i think these days is about 10 gigabits per second so pretty fast uh for personal use certainly and these are electrical signals so we're sending electrical charges on copper wires it's cheap and easy but if you want to go over really long distances or go really fast it's better to use fiber optic cabling instead and these this is one type of fiber optic cables that you might see in a data center that i've worked with and these cables are actually flexible and it kind of feels like it might be a regular wire but inside of it is like this kind of plasticky fiber which is clear and it allows light to travel down it really efficiently so what's being sent along these wires is not electrical signals but light and on the end of it what comes out of these these holes is light and this allows it to travel over very long distances without losing quality in the same way that uh if you wanted to have an electrical cable that went let's say 100 miles you would need to charge it up with a lot of electricity and it wouldn't it wouldn't really work it would be slow because there'd be a lot of capacitance so it'd be slow it would be noisy and it would consume a lot of electricity but with fiber optics this is really efficient the light doesn't really lose any strength or it doesn't really get any noise when it travels over long distances and these fibers so we can go over long distances and we can actually get even significantly faster speeds on fiber optic but this is not used as much in like simple home connections because it's more expensive um especially the like the transceivers this like the transmitter and receiver that that thing that converts from electrical signal to light basically the the light beam and receiver is is kind of expensive not super expensive like maybe fifty dollars for each connection instead of like you know two dollars for each connection another kind of connection of course is radio and you might not always think about radio as a connection but it it is and the way that works is you send these kind of waves out into space and you know the big difference between uh wired and wireless communication is that um with wireless communication you have an emitter like this you kind of see this picture that the signal goes out and as it spreads like it doesn't go just in one little narrow path like along a wire it gets spread out so it gets weaker and weaker as it travels very quickly so the amount of distance you can cover with a wireless connection is pretty limited because it keeps kind of spreading out and getting weaker and you also are sharing the that space with any other wireless senders and receivers that might be out there so there's a lot of interference where other people are trying to send uh data let's say on wi-fi at the same time as you so you have competition for the spectrum that leads to loss noise and slowness we'll see how that happens at the end of the class um in the u.s the federal communications commission is responsible for licensing different frequency spans for different uses so it's not just a free-for-all where different devices just send whatever they want you only are allowed to send in certain frequencies by the fcc unless so for example wi-fi is restricted to like the 2 gigahertz and 5 gigahertz frequencies 2.4 gigahertz and 5 gigahertz and the 2.4 gigahertz frequency band is really crowded and slow because there's a lot of competition [Music] but we also have like you know smartphones now that use cellular radios to access the internet of course now one interesting question i want you to consider is why wi-fi and cellular radio ranges are so different so you probably know that this range of wi-fi is only maybe up to 100 feet at most if you get more than 100 feet away from your base station then um wi-fi doesn't really work um so like on campus you have a ton of wi-fi base stations like thousands of them throughout northwestern's campus to get to have access everywhere cellular is different there might only be one cellular tower on northwestern's campus that covers all the users in that area or even fewer like there could be let's just say 20 base stations in all of evanston or fewer than that like maybe even 10. it depends on the the specific technology so why is it the wi-fi has much less range than cellular i want you to stop and think about that now so again pause the video think about it see we can come up with okay so i hope you've if you've paused and thought about the difference between wi-fi and cellular it's complicated but i would say just add a to address it really quickly that a few things are that there are different frequencies being used so wi-fi generally uses 2x4 gigahertz and 5 gigahertz it's higher frequencies generally than the cellular uses like frequencies in the hundreds and that means that it travels for further before losing energy you also wi-fi is limited by the fcc to using much less power and transmissions so like that router that you have at home for wi-fi only transmits like a quarter of a watt of energy whereas a cellular tower is allowed by the fcc to transmit like i don't know exactly like maybe let's say 10 watts or 100 watts but much more power so it can the radio signals can go farther can reach phones that are pretty far much further away than wi-fi um those wifi devices also are operating in an unlicensed band and a less controlled band so your cellular operator for example the fcc uh controls might give an exclusive license to a certain company like verizon for example might be the only company that is operating in a certain frequency for their cell phones right so if they're the only company using that frequency there's no noise and that means that the customers when they listen to that frequency even if the sender is very far away they still can can can can hear with a signal clearly because there's no there's no competing noise whereas with wi-fi you have like all your neighbors are using why like here in my apartment there are like 25 or 30 different wi-fi access points that i can see uh if i run it like a a sniffer and that means that if i want my signal to be heard by my device it has to be stronger than all those neighbors like it's it doesn't matter if um yeah even if i had the when you have other transmitters that are also sending in the same frequency that kind of over can overwhelm the data that you're trying to send um yeah so those are these are some of the reasons um and some the other reasons also relate to the protocols and we're not necessarily going to get into all of that in this class i think the final topic here is i'm going to talk briefly about uh this is maybe the most substantive uh technical part of the this first lecture about circuit switching and packet switching okay so i'm coming back to the idea of the public switch telephone network this old network that predated the internet this is a way to motivate uh how the internet works we have telephones okay they're not directly connected to each other with with a single wire they go through a network okay that's to allow lots of phones to connect to lots of other phones with few wires okay with the the pstn the public switch telephone network if two people want to talk there has to be a dedicated electrical path established from point to point the way i'm showing this is i have these switches these round blue things are switches and these are things that make connections between change connections between wires basically and i'm showing four different wires connecting the neighboring switches so there are four communication channels between this upper left router and the upper right router or switch i should say and when this phone wants to talk to this phone down here it has to use one of these four channels or wires for its call and has to use one of these before down here to place the call right so this call can be happening then someone else might be maybe could could also be using one of these other four wires to make a different call along a different path right now the the interesting part about this or what i want to point out what i want to point out here is that these this circuit is dedicated to the connection for the duration of the call so this can this second um channel here in this first channel here the one i'm showing in green those are dedicated to that call for the duration of the call and that connection has to be established before the call can happen this actually is not the only option we'll see why now this is the obvious choice this is the simplest way to design a network but it's not the only one it's not the way the internet works this is the way the telephone network the old telephone network works okay the advantage of this is that performance is guaranteed because we we have a dedicated connection end to end if someone else wants to make a call they might be able to use one of these unused links but they cannot use the one that i've already reserved the downside of this is that if i want to place a call i might not be able to place that call i may have to wait until there's a free link that can be dedicated to my call okay and another downside here is that it's a little bit wasteful because during a call there's actually a significant amount of silence especially in a conversation because a telephone call actually involves two signals right two directions like me to you and you to me right so there's a bi-directional communication and when i'm talking you probably are not going to be talking because you're listening i mean technically you can talk and i would be able to hear you but it's unlikely so really we're using the channel kind of on average about half the channel and sometimes even less when i pause between words okay so the utilization of this channel is less than 50 it's a little bit wasteful um we call this an all or nothing approach because we either create we either create the connection and allow that connection to happen at its full capacity or we don't allow the connection at all like in other words we wait until there's a free connection um service does not degrade gracefully when there's a lot of demand it just kind of stops suddenly if more than four people want to use this link here it can't happen there's no way to to support five or six simultaneous calls across this channel except by routing around this other way okay i'm going to skip that now the way this works i showed four connections between the different switches um you know i'll come back to this we'll come back to this later on in the class in the link layer chapter but just as a quick preview you know there aren't actually three wires between those switches i'm showing three connections but actually that those are done with multiplexing so there are two different ways to do it we'll talk about these more later on in the class but for example you could split the frequencies that are supported by that channel into into four different chunks so one call is using the low frequencies and other calls using the medium frequencies the other one's using higher and then the last ones using higher frequencies and they're in their the calls are kind of limited to operating within those specific frequency bands another option is to use time division multiplexing where we kind of at any given time one call is using the link but they alternate so you could take the audio for my my communication and kind of like fast forward it like shrink it down to play to be played four times as fast and then you play my audio then you switch to playing someone else's four times as fast someone else is four times as fast someone else is four times as fast and then back to me and kind of repeats over and over again that's time division multiplexing so we have we actually have one connection one wire whether it's electrical or obstacle or whatever or radio but we're just we're just dividing that channel into four channels using some media access control we'll talk about this later on in the class but computer networks do not use circuit switching they use packet switching which is different okay and this is one of the key concepts of internet networking and it'll take a little bit of of of reading and thinking before this makes total sense as to why we do this but that the idea should be relatively simple the motivation is a little bit more complex but with packet switching what we do is um we don't really we don't create these connections end to end what we do is we take we take data we want to send and we we um we take a small chunk of data we call it a packet we limit the size of those chunks to to be within a certain small size on the internet usually it's below 1.5 kilobytes so 1500 bytes and then we address that data with a destination and the sender's address and we send it and it's forwarded hop by hop until eventually reaches its destination and i like you can and a good analogy for this is postcards although i guess these days like i have i don't know when the last time any of you have used postal mail was but you probably have a mental model for how how the postal system works but anyway so with a postcard you write an address for the destination on there you have a return address you put some data on there and you put it in a box to to mail it and then eventually it reaches the destination but it goes kind of like one step at a time the same thing is true of packets on the internet in order to send data you don't have to really have to really know the whole path to reach the destination you just have to know what the address is the final destination you have to write that on your packet you have to include the destination in the packet and you have to send it to a router that's connected to the internet and then it'll kind of eventually get there and we'll see throughout the class how that works um the uh notice that there this is different than creating a dedicated connection between because um we have to split our data into small chunks the these packets can arrive in any order actually they're not necessarily going to arrive in the order that we sent them in we'll deal with this within the tcp section of the class uh the reason they may arrive in any order is because they might take different paths we're not telling um the data what path to take we're not reserving a path like we did with circuit switching we're just sending data to the next hop and and and telling it where to go like telling it what the destination is and also importantly since we're not reserving capacity uh we're not we're not really sure there's going to be enough capacity to deliver the packet it's the best effort approach so actually the packet could get dropped if there if this network is just totally overwhelmed the packet could be dropped and again in the tcp section of this class we'll learn how we cope with that packet loss so i have a little comparison here of packet switching and circuit switching by switching here here i mean the way that a link is shared by competing users two different approaches so with uh packet switching it's actually kind of simpler than circuit switching because we don't we don't have to set up a connection from sender to receiver we just need to know what the destination is and and record that on the packet this the senders and the routers along the way don't need to know the full destination full path to the destination they just need to know what the next hop is like in order to get it closer to the destination this also more efficiently makes use of the resources in the network because you're not reserving capacity that might not be used but what circuit switching gives you is guaranteed performance because a connection is reserved end-to-end um this makes it better for like video and audio audio and video streaming where you're gonna have a constant flow of data a constant rate of data that that's predictable although i guess streaming audio i mean like streaming music where there's a constant flow of data not like not the telephone case where there are pauses in the conversation okay um one other very general but i should say we're going to talk a little bit more about packet and circuit switching in the next lecture so don't worry too much about about that yet uh i think this is the final topic in the in this lecture uh a little bit about measuring performance of networks um so i just want to introduce two basic ways of looking at network performance one is throughput and the other is latency so throughput is what you're probably most familiar with sometimes it's called bandwidth although i think that's a confusing term because there's a more specific technical definition of bandwidth that refers to frequencies but throughput is the rate of data transfer like the number of bits per second bps or bytes per second now on the internet we actually send packets in discrete so we send data in packets which are discrete chunks so you might have in one moment a bunch of data that arrives so to calculate throughput what we really do is measure the flow of data over time some time window and we calculate an average amount of data that came through latency is the other important aspect of network performance and this is the delay of data being sent so in general latencies delay of any action we could use the term latency also to refer to software and uh like disks and you know storage stuff like that databases uh network latency is the time it takes for a bit of data to arrive at a destination usually we measure this with the round trip time which is the time it takes to observe the response to the request so we send data and eventually something comes back that's the the difference between the send and receives the round trip time um that also includes some time it took to process the data on the receiver side which makes it like not a totally pure measurement of the network but because it's easy to observe in one location it's the most common type of measurement and these two are actually totally independent throughput and latency but they're both important and they affect applications in different ways some applications care more about throughput others more about latency we'll see that later on so the internet is uh it's big it's complex we'll see later on that it's dynamic that the way the paths that are taken change over time we know that links fail and somehow the internet heals itself and keeps working uh users come and go so network performance is constantly changing those throughputs and latencies will change over time and over space of course depending on where i am where i'm connected who i'm talking to all those change okay so when we're looking at network performance we need to look at like a range of values and we can summarize those with summary statistics like the mean and median but those alone don't really capture everything we don't we want to see how all users are experiencing the network not just the average user so we can look at minimum and maximum we also can look at the fifth percentile 95th percentile which are kind of like minimum and maximum but ignore outliers and more generally we can look at the full distribution of performance values with a cumulative distribution function which is called a cdf and this is basically a line plot which at first is a little bit hard to read but this shows basically takes every single value you observed it sorts them and then plots them in a scatter plot and on the y-axis you have um like the position in the ordering and on the on the on the x-axis you have the value so basically what what you can do is you can as you go up from on the y-axis from 0 to 1 you're going from the smallest to the largest value that was observed and on the x-axis you see what that value was so the smallest value in this case was 15 the largest value was um you know 87 and you know the the the value right in the middle between large small smallest and largest in terms of if you were to order them the median value uh was 22. you you get that by looking at the middle of the y-axis the the 95th percentile value so in other words the value that is greater than 95 percent of the other values that were observed but less than 5 percent was 43 milliseconds and you can with this kind of plot you can answer the question like how many a lot of questions that you can't answer with other kinds of plots this is why um networking researchers prefer this kind of view of network performance data if you want to know for example how observations were between two values like between 20 and 30. you could take this plot you see 20 and 30 on the x-axis and you can just trace it up and say okay 20 is around 0.2 and 30 is around 0.9 you subtract the 2 and you get 0.7 so 70 percent of the values are between 20 and 30. you can get that very easily by looking at the plot so if you were to like differentiate this you would get the pdf the probability distribution function which is kind of like a histogram but this integral form the cdf is much easier to to uh to use although at first it might be a little confusing and one of the homework questions asks you to create one of these okay so i've said that network performance varies what i want you to do now is um try measuring your own network performance and you can use either one of these websites fast.com or speedtest.net to measure network performance and of course what i would do in class is ask everyone in the room to measure it and what's interesting is is everyone will get a different you get a wide range of values for different people sitting in the same lecture hall and i would ask students why is it why is it different for you what i want you to do is try running this test twice in a row from the same place you could also try different times of day but even if you just do it back to back you'll get different values and the question is why do you get different results or why would your friend or why if you have two devices and you measure why would you get two different results on those two different devices so i want you to stop and think about that pause the video okay i hope you thought about uh why you got different performance um it's a bit of a trick question because i'm not going to give all the answers there are dozens of reasons just like the earlier question about what happens when you visit a website um we'll learn about them in the class you know it could be the devices are like one one's a fast device once a slow device but that's not really the the satisfying answer that's not the full answer because even on the same device you get different observations so if you're using radio there could be more or less interference in the air there could be more or less congestion in the path that your packets are taking to research destinations there's more queuing um we'll learn about what that is later it could be that the server that got your request was busier at the time so it was slower to respond there are all kinds of answers it could be a different path was used um so yeah so internet connection speed varies and actually one interesting thing recently there was an internet service provider a cable company that uh was sued by its customers because the speed the customer its customers were getting run average 80 slower than what was advertised they had to pay a big settlement um so so the moral of the story is that you know one number is not going to really tell you much about the performance of your of your network connection like if you say i have a 10 gigabit 10 megabit per second internet connection at home all that really says is at most that's what i'm going to get you know in practice the actual performance can vary quite a bit so we need to like do a lot of experiments and make a lot of observations to really have a sense of what that network connection is like and the performance of your connection depends not just on your own connection to the internet but what's happening inside the internet and that's one of the things you're going to learn in this class it's not just a connection to the internet is not just you can't just say like you can't just buy a connection of a certain speed and expect every one of your connections to have that speed because what you're buying is a connection from yourself to an internet service provider but that's just the first hop or the first couple of hops in a very long series of steps that lead to your destination so anywhere along that way could be a slowdown okay okay finally that's the end that was a little bit longer than i expected i gave an overview of the internet talked about different media access methods i talked about a little history of the internet mentioned that the internet is loosely coupled and decentralized um and you have to follow certain protocols the standard protocols in order to work on the internet the telephone network is different than the internet because it uses circuit switching that reserves end-to-end path for communication and um the internet does not do that it's it uses stored and forwarding we'll see how that works later on in the class