Placeholder Image

字幕列表 影片播放

  • [MUSIC PLAYING]

  • SPEAKER: You type an address into a browser, you send an email,

  • you perhaps have a video conference or a chat online.

  • Have you ever stopped to consider what exactly

  • is going on underneath the hood, so to speak, of those pieces of software?

  • And really the entire infrastructure that somehow

  • connects you to the person or persons with whom you're communicating.

  • Well it turns out that there's a whole stack, so to speak,

  • of internet technologies that underline the software that you and I use

  • these days, every day.

  • And indeed, the software that we use, browsers

  • and email clients and the like, are really abstractions,

  • very user friendly abstractions, on top of some lower level implementation

  • details.

  • And these days, too, have we built abstractions even above those so known

  • as the cloud, an abstraction on top of this underlying infrastructure

  • that enables us to do most anything we want computationally without even

  • having that hardware locally.

  • So let's see if we can't distill what goes on when you do type an address

  • or a URL into the address bar of a browser and then hit Enter.

  • Or you type out an email--

  • specify someone's email address and then hit Enter.

  • What exactly is going on underneath the hood?

  • Well, at the end of the day, I dare say that what your laptop, and my laptop,

  • and our desktops, and even our servers are capable of really

  • is just sending messages in envelopes back and forth across the internet.

  • Virtual envelopes, if you will.

  • Now in our human world, an envelope needs a few things on the outside.

  • If you want to send a letter or a card or something old school to someone,

  • you need to address it, of course.

  • And you need to put, perhaps in the middle, the recipient's name,

  • and address, and other details.

  • You might put in the top left hand corner, by convention, your own name

  • and or address.

  • You might even put a little memo in the bottom

  • that specifies what's inside or fragile or some other annotation.

  • So this metaphor of the physical world is actually

  • pretty apt for what's going on underneath the hood in computers.

  • When you have a computer plugged into a network

  • or connected wirelessly to a network, it really

  • is just sending and receiving envelopes, virtual envelopes,

  • that at the end of the day are just patterns of zeros and ones,

  • but collectively, those zeros and ones represent your email or the request

  • that you've made of a web server, the response you're getting back

  • from that web server.

  • So let's see if we can't formalize exactly what these lower level

  • primitives are, consider exactly how they're layered on top of one another,

  • because thereafter we can build almost anything we want

  • on top of this infrastructure once we understand what those underlying

  • building blocks actually are.

  • So let's consider how we actually address

  • this envelope in the first place.

  • After all, when I turn on my laptop or turn on my phone

  • or open up my desktop in the morning, how does that computer or that phone

  • even know what its own address is on the internet?

  • Because just as in our human world, wherein

  • you need to be uniquely addressable in the physical world

  • in order to even receive an envelope or a card or a package,

  • so do computers need to be uniquely identifiable on the internet.

  • Now for our purposes, now we can consider the internet just

  • to be an internetworked collection of computers connected

  • via wires, connected wirelessly.

  • There's some kind of interconnectivity among all of these devices

  • and these days our phones and internet of things devices and other things

  • still.

  • So let's just stipulate that somehow or other there's

  • a physical connection, or even a wireless connection,

  • between all of these various devices.

  • So those devices all need unique addresses,

  • just like a building in the human world needs an address.

  • For instance, the computer science building here on campus is at 33 Oxford

  • Street, Cambridge, Massachusetts, 02138, USA.

  • With that precise information, can you send us a real mail or a package

  • or anything else through the physical world in order for it

  • to arrive on our doorstep?

  • But what if you, instead, wanted to send us an email

  • and get it to that building, or really me,

  • wherever I am physically in the world on my internet works device?

  • You need to know my computer's address, you

  • need to know my phone's address, or at least the mail server

  • that's responsible for receiving that message from you.

  • Well, it turns out that most any network on a campus, in a corporation,

  • even at home these days has a DHCP server.

  • Stands for a Dynamic Host Configuration Protocol,

  • and that's just a fancy way of describing a server that is constantly

  • listening for new laptops, new desktops, new phones, new other devices, to wake

  • up or be turned on and to shout out the digital equivalent of hello, world,

  • what is my address?

  • Because the purpose in life of these DHCP

  • servers is to answer that question.

  • To say, David you're going to go ahead and be address 1.2.3.4 today.

  • Or David, you're going to be 4.5.6.7 or 5.6.7.8.

  • Any number of possibilities can be used to represent

  • uniquely my particular device.

  • So DHCP servers are run by the system administrators on a campus,

  • in a company, in an internet service provider.

  • More generally, they're run by whoever provides us

  • with our internet connectivity.

  • They just exist on our network.

  • But these DHCP servers also give us other information.

  • After all, it's not really sufficient just to know what my own address is.

  • How do I know where anyone else in the world is?

  • Well, it turns out that the internet is filled

  • with devices called routers whose purpose in life,

  • as their name suggests, is to route information from point A

  • to point B to point C and so on.

  • And those routers, similarly, need to know these addresses

  • so that they know upon receiving some packet of information,

  • some virtual envelope, in which direction to send it off.

  • So these DHCP servers also tell me not just my address, but also the address

  • of the next hop, so to speak.

  • I, as a little old laptop or phone or a desktop,

  • I have no idea where 99.999 percent of the computers in the world

  • are, even higher than that perhaps.

  • But I do need to know where the next computer is on the internet,

  • so that if I want to send information that leaves this room,

  • it needs to go to a router whose purpose in life

  • is to, again, route it further along.

  • And generally there might be one, two, maybe even 30 steps

  • or hops in between me and my destination for that email or virtual envelope,

  • and those routers are all configured by people who aren't me,

  • system administrators beyond this, beyond these walls

  • to know how to route that data.

  • So we can actually see evidence of this that you yourself

  • have had underneath your fingertips all this time

  • and you might not have ever poked around.

  • For instance, if you want to see your own address,

  • keep an eye out for a number of this form.

  • It's a number dot number dot number dot number, and each of those place holders

  • represents a specific value, either starting at zero or ending at 255.

  • In other words, each of these hashes can be any value between 0 and 255,

  • and that range 0 to 255 well that's 256 total possible values.

  • That's eight bits.

  • Ergo, each of these place holders represents 8 bits, 8 more bits, 8 more,

  • 8 more.

  • So an IP address, by definition, is 32 bits.

  • And there it is.

  • IP, an acronym you've probably seen somewhere,

  • even if you've not thought hard about what it is,

  • stands for Internet Protocol.

  • Internet Protocol mandates that every computer on the internet,

  • at the risk of oversimplification, has a unique address called an IP address.

  • And those IP addresses look like this.

  • If these IP addresses are composed of 32 bits, how many possible IPs are there

  • and therefore how many possible machines can we have on our internet?

  • Well, 2 times 2 times 2, 2 to the 32, so that's four billion, give or take.

  • By design of IP addresses, you can have four billion,

  • give or take, possible permutations of zeros and ones if you have 32 in total,

  • and that gives you four billion, maximally,

  • computers and phones and internet of things devices, and the like.

  • Now that sounds big, but not when each of us

  • personally probably carries one IP address in our pocket in our phone,

  • maybe another on our wrist these days, one or more computers

  • in our life, not to mention all of the other devices and servers in the world

  • that need these addresses, too.

  • So long story short, this is version 4 of IP.

  • It's decades old, but there's also a newcomer on the field

  • called IPv6, version 6.

  • There isn't really to be a version 5.

  • And IPv6 is only finally gaining traction

  • because we're running so short on IPs that it's

  • becoming a problem for campuses, for companies, and beyond.

  • But IPv6 will use 128 bits instead of 32,

  • which gives us many, many, many, many, more possibilities, bigger

  • numbers than I can even pronounce.

  • So that should cut it for quite some time.

  • But not every computer on the internet needs a public IP address, only

  • those envelopes, so to speak, that need to leave my pocket, or my home,

  • or my campus, or my company.

  • It turns out, as a short term mechanism to squeeze a bit more utility out

  • of our 32-bit addresses, which are still omnipresent

  • and the most popular among the versions, well

  • we can actually distinguish between public IP

  • addresses that do actually go out on the internet and private addresses.

  • And indeed, if your own IP address happens

  • to start with the number 10 and then a dot or the number

  • 172.16 and then a dot, or the number 162.168 and then a dot,

  • and then something else, well, odds are, your computer has a private IP address.

  • And this is just a feature of the little router that's probably in your home,

  • or the bigger router on your campus or corporate network,

  • that enables you to have an IP address that's only used within the company,

  • only used within your home, and cannot, by definition,

  • be routed publicly beyond your company, beyond your home,

  • because the router will stop it.

  • And so here we actually have the beginnings of a firewalling mechanism,

  • if you will.

  • In the real world, a firewall is a device

  • that prevents fire from going from one store to another, for instance.

  • In the virtual world, a firewall is a piece of software

  • that prevents zeros and ones from going from one place to another.

  • And in this case do we already have a mechanism

  • via public and private addresses of keeping some data securely,

  • or with high probability securely, within our company

  • versus allowing it to go out on the internet.

  • So we'll see now some screenshots of some actual computers from Mac OS

  • and Windows alike that reveal their IP addresses,

  • and you yourself can see this on your own machines.

  • For instance, here on Windows 10 is a screenshot

  • of what your Network Preferences, so to speak, might look like.

  • And if you focus down here, it's a bit arcane at first glance,

  • but IPv4 address is 192168.1.139 when we took that screenshot.

  • And indeed, it starts with 192168 which means it's private,

  • and indeed, I took this screenshot while we were within a home network,

  • and so that suggests it can be used to route among computers in that home

  • but not beyond.

  • You'll see, too, if we move on to the next screen

  • where you see more advanced network properties,

  • you can also see the dimension of this default gateway, which is

  • synonymous with router, default router.

  • 192168.1.1.

  • So a default router or default gateway is that first hop,

  • so that if I want to send an email outside of my home,

  • I want to visit a web page outside of my company,

  • all I need do is hand that virtual envelope containing that email

  • or that web request off to the machine on the local network that

  • has that IP address.

  • I have no idea where it's going to go thereafter, to hops two and three

  • and beyond, but that's why we have this whole internet

  • and even more routers out there.

  • They, the routers, intercommunicate and relay that data,

  • hop to hop to hop, until it finally reaches its destination.

  • Now where did I get my IPv4 address from,

  • where did I get my default gateway from?

  • From the DHCP server in my home, in my company, or whatever network

  • I happen to be on.

  • And Mac OS is the same.

  • If these screens are unfamiliar, you might recognize this,

  • under System Preferences in Mac OS.

  • Here, while connected to Harvard University's network,

  • you can actually see that my IP address was 10.254.16.242.

  • That number, too, starting with one of those internal or private prefixes,

  • indicative of the fact that even within Harvard,

  • where we keeping all of our Harvard traffic internal to Harvard,

  • and then not exposing that externally.

  • And indeed, if we look in the more advanced preferences here,

  • we can see that the router for my Mac was 10.254.16.1.

  • Which is to say this Mac, when it's ready to send something off campus,

  • simply hands that envelope off to this particular router here.

  • And the router's job, ultimately, that first hop, a border gateway or border

  • router, literally referring to a computer

  • that physically or metaphorically is on the edge of a campus

  • or company, its purpose in life is to simply change

  • what's on that envelope initially from the private IP