If you watched our internet primer video, I left a bit of a cliffhanger,
right by talking about the internet and how it's a system of protocols.
Well,
let's talk about the first of those
protocols that actually comprises the internet.
And interestingly enough, it's called the internet protocol,
which we usually refer to as IP.
So the internet, as I said is an interconnected network and internet,
which is really just several networks woven together
and agreeing somehow to communicate with one another.
What is this somehow I'm talking about? Well, this is the internet protocol.
This dictates
how information
is transmitted from point A to point B and this is sort of a condition of joining
the network of the internet
uh is agreeing to follow this protocol when information needs
to be moved from point A to point B.
So at the very end of that internet primer video,
I showed this image of what the internet was.
And on a small scale, this is actually probably pretty accurate,
this might be how three networks actually talk to each other.
But it's a bit misleading. And the reason it's a bit misleading
is because if I just number,
the networks for the sake of convenience here and we get
rid of everything else and just focus on the networks.
It's a bit misleading because it implies that all
three networks have a connection to one another.
One is connected to 22, is connected to three and three is connected to one.
And when I talk about a connection here,
I'm talking about a physical wired connection.
We do have wireless,
but it's really impractical for data to
be transmitted wirelessly over a large scale.
And so at some point, we really do rely on wired technology,
telephone wires, fiber optic wires,
various technologies that are physically connecting point A to
point B and on a small scale like this,
this might be accurate.
But as this, as the image gets a little bigger,
let's now imagine we have six different networks.
If that's true.
Now we have something like this for every
network to be connected to every other network.
And if you look, every, every network has five arrows connected to it.
So everything is connected to every other network.
But we only have six networks here and already look at how much wiring
we have to employ,
right? And the internet consists of a lot more than six networks.
We can't afford to wire each network to each other network,
especially considering some of these networks span oceans,
right?
If we're trying to connect to a network in Asia or in Europe,
we're gonna have to span an entire ocean
if we need to.
We, we're gonna need to use wires at some point,
but we wanna minimize the number of wires we actually
use.
We don't wanna send a million wires across the ocean
because they cost millions of dollars a piece to lie down
and so
rapidly, we wouldn't be able to afford the internet anymore.
So we have to have another way for every network to talk to every other network.
Or else we have pieces that are of the internet
that are disconnected from other pieces of the internet.
And that's, that's not what we want,
but we don't want to have them all wired together.
And this is where routers come back into play.
We can use routers in the following way.
What if instead of every network being
physically connected to every other network,
we had these intermediary pieces where the
networks were connected to these intermediaries,
which were connected to a few networks.
So instead of having one connect to 2345 and six,
maybe one connects to a router which maybe connects to one or two of those networks,
but also maybe connects to other routers,
which also will connect to those other networks.
And the with the router's job is it contains information called a routing table
that dictates. Where do I go? If I see a particular IP address?
If I see an IP address starting with four, I'm gonna go this way
if I see an IP address starting with a 12, I'm gonna go.
That way,
we don't need to be connected physically to
network number four or network number 12. In this example,
we just know generally where we wanna go. And if you think about it,
this is sort of similar to the concept of recursion that we talked about.
Uh when we were talking about it in C
I'm not gonna connect you
to exactly where you wanna go. I'm just gonna move you one step closer
to where you wanna go.
And I'll let somebody else deal with solving the rest of the problem.
I'll just solve this little piece of the problem
and defer the rest of it to somebody else.
So routing information is actually kind of similar to
recursion if that's a concept that you understand,
well, maybe that analogy would help.
So let's take a look, look at this networking example again and assume that
um again, we're gonna use those same six networks one through six.
So let's just say that every IP address on network one starts with one dot something.
And we'll say that there's, you know, some,
some other thing that deals with how to all
the systems that are connected to network one,
we just care about connecting all of those networks together in an internet.
So every
device that is connected to network one has an IP address
that starts with one dot And then three other numbers.
This is a generalization of the way things actually work. Um It's
quite a bit more precise than this,
but this should give you a general idea
of what the internet protocol is actually doing.
So this was the diagram we had before, this was the system that was not sustainable.
Even six, this might be OK.
But if we get to 10 or 20 or 50 we're gonna be lying a
lot of wires and 50 is still also not even the tip of the iceberg
uh as to the number of networks we have.
So this, this model is unsustainable, we can't stick with this.
So let's instead
adopt this model where we get rid of all the wires between the networks
and we add
routers.
So these yellow boxes represent routers and
their job is to move information generally closer
to where it's supposed to go.
And maybe these are the connections that these networks have and
maybe these are the tables that are built into the router.
So if we just start by looking at
network one, for example,
basically what it says is if I ever see an address that doesn't start with a one,
that's what the exclamation 0.1 or the bang one there, not one,
I'm going to pass it off to a router
and from there, the router can make a decision.
The router says, if I see a one, I'm gonna move to network number one,
that's the green arrow heading to the left out of that top left box.
If I see a two,
that's the arrow sort of heading to the top right towards the purple network.
If I see an IP address starting with a two,
I'm gonna go towards the two network.
If I see a three, a four, a five or six,
that's that red arrow coming out of the top left router.
I'm not connected to 345 or six,
but I know somebody who is or who's a little bit closer to there.
So I'm just gonna say every time I see an IP address starting with 345 or six,
I'm just gonna send it to that router, so I'll move it,
I'll move it a little closer to where it's supposed
to go and let that router deal with the problem.
And as you can see
if you wanted to pause here and trace, you can get to every other point in the network.
Um, from wherever you are,
all six networks can still connect to every other network,
but they're not physically connected anymore.
There are now these intermediate steps.
Now, of course, there's a trade off of speed, right?
If one was directly connected to six,
we wouldn't have to go through two routers along the way.
So we'll be able to get the connection a little bit faster,
but maybe that trade off is worth it, right.
If it's gonna be so expensive in terms of actual cost
dollars and cents to
physically wire all these networks together,
maybe a little bit of slow down and speed is OK, we can tolerate that.
So again, in that example,
we were just talking about on none of the networks
were directly directly connected to each other at all.
There could have been maybe in that example,
we could have made it so that maybe network one
and two were directly connected and that would be OK.
Some networks are physically connected to other networks,
but they're not all connected to each other.
They rely on the routers in this particular example,
to distribute the communication from point A to point B
on a small scale.
Like what we're talking about here,
this configuration actually might be more
inefficient than just having direct connections.
But on a large scale, we can,
we can scale the system a lot better.
Um It's really gonna reduce our cost
of network infrastructure to have intermediary routers.
Uh whose job it is to move traffic from the
center to the receiver from point A to point B
um as opposed to wiring everybody together.
So let's take a look at an example
of information traveling using this internet protocol.
Let's say that I am
um I am physically located at IP 1.208 0.12 0.37.
So I exist somewhere on the one network
and I want to send a message to you and you're on the five network at 5.1 88.109 0.14
your IP address specifically doesn't matter.
But in this particular example, we're talking about this generalization
of what the internet protocol is all about.
You're on the five network and I'm on the one network.
And as you can see, we're not connected to each other at all.
So I start out
and I wanna send you a message.
And so somehow I communicate that message to the router.
The router is the one that actually has the IP address.
And it's looking at where it's supposed to go. We're going to five dot something.
So now I'm gonna start using my or the router rather,
it's gonna start using its router table to pass information along.
It sees that five is not one. So it's because I'm gonna pass it to this guy.
Then this guy has to make a decision. Where am I gonna go? Well, it's not a one.
So I'm not gonna move to the one network and it's not a two.
I'm not gonna move to the two network. It starts with a five.
I'm not connected to five, this router says, and so I'm just gonna pass it off to,
I'm gonna go down this path.
This is where threes and fours and fives and sixes go
and I'll let that guy deal with it.
I'll get it a little closer to where it's supposed to go.
I know, it's supposed to go in that general direction,
but maybe that guy can deal with it.
Ok.
So that guy looks, he says, ok, this IP address starts with a five.
Well, I'm connected to three and to six.
So I can't get the message directly where it needs to go.
But that other router over there, I know if I send it fours and fives,
it can handle those.
So it passes it along down the path.
And then this router says, well, I'm connected to networks four and five.
So yes, I can help you. I'll take the IP address.
Also the five, I'll give it to the five network.
The five network will do some work on its end and give the message to you.
And now we've successfully transmitted a message from me
to you using the internet protocol again, very generalized
for purposes of illustration as to what's happening.
But that's pretty much how the internet protocol works.
The routers know generally where to send it
and will send it one step along the way,
getting it closer and closer to its destination
until one router is physically connected to the network or the address or whatever,
whatever
in question and gives it there.
Now
in general, except for really, really small small messages.
Um
If it's not gonna send it as one big chunk of data, right?
If I'm sending you an email, a very long email,
say it's not gonna take that entire email, bundle it up in,
you know, a ball or a package or whatever
and send that entire thing down the network.
First of all, sending information along the network is expensive. It does add up
and the larger the chunk, the more costly it is to move every step of the way.
Um And if it, if there's somehow a slowdown and there's this giant,
sort of like if you're driving on the
highway and there's this giant truck kind of blocking
the way and you can't get around it on either lane because it's kind of spread out.
It slows everybody else down behind it.
But small cars, if they were all small cars, they might be able to
move around. That analogy sort of helps a little bit.
So one big block in the system can really slow everybody else down.
And so what IP is going to do is split this data into packets. It's gonna take this big
email or FTP transfer or file transfer or maybe I'm making a request
to a web browser because I want a picture of a cat.
Um And it's gonna take that request or that email or that file and
break it up into many pieces and send all of the pieces separately.
So, in fact, I'm filling the highway with a lot of small cars which can all move
instead of a big truck that might, if something goes wrong,
um,
throttle the traffic for everybody else,
another side effect of this is if there's some sort of catastrophic failure
and a piece and, um, and, you know, something goes wrong and the packet gets dropped,
something is failed and the message can't be communicated the net with the router.
Maybe had too much stuff going in. It couldn't juggle everything.
And so it just literally dropped it. That's sort of the analogy. Right.
It has to, it's got a lot of things going on. It's passing information from
point A to point B. We're not the only two people on the internet.
So it's has to process a lot of traffic
and if it doesn't have enough hands and it can't figure out what it's doing,
it might just drop something
so it can do something else. It's got too much going on
if we had our messages one huge block and that was what got dropped.
Now, we have to send the message again
and we are now possibly causing traffic again and we were
on the risk of that huge block being dropped again.
But if the data has been broken up into packets and we drop one of those,
it's a lot less costly to send that packet one more
time as opposed to the entire thing one more time.
So IP is responsible for
getting information from point A to point B
and also breaking the information into small pieces
so that the network isn't overly taxed.
IP is also known as a connection, less protocol,
there is not necessarily a defined path from
the sender to the receiver or vice versa.
Now, in this example,
we've talked about there actually is only one way to get to every network.
Um So in this particular illustration,
there actually is a defined path from point A to point B.
But we can change that by just making one modification to the two
routers on the left by adding this condition to the router tables.
Now notice that from the top left router,
there are actually two ways to deal with a four or a five IP address.
It can go down to the lower left router
or it can go to the right to the right router. It has multiple options
and this is actually kind of a good thing, right?
Because it makes our network more responsive if for example, it's sort of like a gps
if you've ever been driving on the highway
and suddenly your gps warns you that traffic is ahead,
that's you, you want to avoid it if you can. And so you can recalculate your route
and
the, the router tables.
In addition to uh having information or the router network rather,
in addition to having information about
uh where
packets should go or where data should go.
There's also sort of this general pulse on the state of
its local network where what's gonna happen if I send it
uh down this path versus this path.
And so
in,
in light of
heavy traffic situations on the network,
maybe things will get routed a more inefficient
way or a more generally inefficient way.
Because if we go the regular way, there's gonna be a lot of traffic,
the highway is completely jammed.
So maybe what we'll do is instead take side
roads which ordinarily would take a lot more time,
but no one's really using those side roads.
And so we can route our packets that way.
So not every packet of a big chunk of data might
take the same path from the beginning to the end.
And our network becomes a lot more responsive.
If our router tables allow for there to be multiple options
um for where to go.
We don't,
we're not depending on that one truck moving out of the way we can
get off the highway at the next exit and take a different path.
And so
the internet protocol sort of does a little bit of that
too.
So that's the basics of the internet protocol.
Um
But there's one more issue to deal with, which is what happens if we do drop a packet,
how do we know we're gonna send that packet again?
Right.
Well, internet protocol doesn't guarantee delivery.
We're gonna be depending on another protocol to
deal with that called transmission control protocol TCP.
Um And we're gonna talk about transmission control protocol in the next video,
I'm Doug Lloyd. This is CS 50