-
Hello. Welcome to the second part of our
-
lesson on network devices.
-
This is the first lesson from the first
-
module of my new course
on networking fundamentals.
-
The purpose of this module is to teach you
-
how data flows through the internet.
-
In part one of this lesson, we discussed
-
the concepts of a host,
-
an IP address, and a network. If you
-
haven't watched that video, go ahead and
-
pause this video right now
and watch the first video.
-
There'll be a link in the description.
-
In this video, we're simply going to
-
continue right where we left off.
-
Now, the main idea we want to teach in
-
this video are these last two devices:
-
switches and routers.
But we can't really understand those
-
until we understand
where we've come from.
-
So we have to start there.
-
In the last video, we unpacked the idea
-
of a network. We identified that a
-
network is created anytime you connect
-
two computers to each other using a wire.
-
One thing to understand about sending
-
data across a wire is that it decays as
-
it travels greater and greater distances.
-
If the two computers you're connecting
-
are in the same room, then you don't
-
really have to worry about it.
-
The decay will still occur, but the
-
signal will still get through,
and therefore,
-
connectivity between these
hosts is still attained.
-
If, however, these hosts span greater
-
distances, maybe you're
connecting two computers on
-
opposite sides of a building, or even in
-
two different buildings,
then you might have a problem.
-
If the signal decays before
it gets the other side,
-
then these two hosts cannot share data.
-
In those cases, what you need is a
-
repeater. A repeater is a device
whose sole purpose is to
-
regenerate signals.
Anything that comes in on one end
-
simply gets regenerated
out the other side.
-
This allows you to connect devices
together which span greater distances.
-
So far, we've been talking
about networking
-
from the perspective of
connecting one host
-
directly to another host. Well, if you add
-
a third host, you now have
to connect that host
-
to all the other hosts which
you've already established.
-
And if you add a fourth host,
-
you now have to connect this fourth host
-
to all the hosts that already exist.
-
And again, if you add a fifth host,
you now have to connect this fifth host
-
to every host that
has already been connected.
-
As you can see, connecting
hosts directly to each other
-
simply doesn't scale.
-
Instead, we created devices
which we could put
-
at the center of every network and connect
-
all the hosts to those devices.
-
And these devices would then handle
-
funneling communication
between these different hosts.
-
The benefit to these types of devices is
-
that if a sixth host gets spun up,
-
it's very easy to simply connect it once
-
to that device,
and now it has connectivity
-
to every host that has already existed.
-
That's what all of these are. And the
-
first of these types of devices
that we're going to discuss
-
is known as a hub. A hub
-
is nothing more than
a multi-port repeater.
-
Earlier, we discussed repeaters, and we
-
said all they do is regenerate signals.
-
Hubs do the same thing, except they do it
-
across multiple ports.
-
For example, if these two hosts over here
-
need to communicate,
-
one of them sends a packet to the other,
-
it'll hit the hub, and the hub will
-
simply duplicate that packet and send it
-
out all remaining ports.
-
That'll allow what this guy
sends to arrive over here.
-
This fixes the scale problem. A hub is the
-
first device that allows us to connect
-
multiple devices in the center, and now
-
all of them have connectivity to each other.
-
But, as you can probably see, the problem
-
with the hub is that everybody receives
-
everybody else's data.
-
These two hosts over here, which are
-
uninvolved in the communication
between these two hosts,
-
are receiving a copy of
everything they send.
-
Which brings us to bridges.
-
Here, we have two sets of hosts, all
-
interconnected using a hub.
-
And a bridge is meant to sit in between
-
hub-connected hosts.
-
Bridges, by definition, only have two
-
ports: one port facing one set of
-
hub-connected devices and another port
-
facing the other set of
hub-connected devices.
-
Bridges will also then learn
which hosts are on which
-
side of the bridge. This would allow the
-
bridge to contain communication
-
to only the side that is necessary.
For example,
-
if these hosts again need
to speak to each other,
-
when they send data to each other
-
through that hub, the hub is of course
-
going to simply regenerate that signal
-
at all ports
-
and notice that the bridge can be
-
getting a copy of that packet.
-
But the bridge knows that the other
-
green host is on this side of the bridge,
-
and therefore, the bridge isn't going to
-
bring that packet to the other side.
-
The bridge is the first type of device
-
that helps contain packets
only to their relative networks.
-
On the other side, if these hosts
need to speak to each other,
-
they can also send packets to each other
-
through their hub, and once again, the
-
bridge will not let those packets bleed
-
into the other side, because it knows
-
the yellow devices exist on the right hub.
-
And of course, if this device needs to
-
send something to this device, the bridge
-
is going to know that that traffic
-
is going to have to cross the bridge,
-
and the bridge will allow that packet to
-
traverse to the other side.
-
The main takeaway is understanding that
-
bridges can learn
which hosts are connected
-
on either side of the two
ports of the bridge.
-
Now this finally brings
us to switches.
-
Switches are sort of like a combination
-
of hubs and bridges. They are like hubs
-
in the sense that many devices can
-
connect to the switch, and they are like
-
bridges in the sense
that they can learn which hosts
-
are connected to each port.
-
The main difference is that they're
-
doing it on a per-port basis,
-
which means if these two
hosts want to speak to
-
each other, the switch
will know that the only ports
-
that need to receive this traffic
-
are the two that are connected to those
-
green hosts, and will keep that communication
-
contained to just those ports.
Moreover, if these
-
two hosts want to speak to each other,
-
the switch will again make sure that
-
that communication only flows
between the relative ports.
-
So this is how a switch is like a
-
combination of a hub and a bridge.
-
The formal definition of a switch that
-
we want to use is that
a switch is a device
-
which facilitates
communication within a network.
-
Earlier, we defined a network as a
-
logical grouping of hosts which require
-
similar connectivity. Which means
-
all of these devices over here all
-
belong to the same network.
-
Moreover, networks all share the same
-
IP address space,
-
which means this network owns all the IP
-
addresses which start with
-
192.168.1.anything,
-
and this host's identity is the IP
-
address 192.168.1.33
-
And this host would be 192.168.1.66.
-
And this set of devices could
very easily represent
-
all the different hosts on
your home wi-fi network.
-
Maybe this device is your printer, and
-
this device is your laptop,
and this device is your mobile phone,
-
and so on.
-
Or maybe this network and these devices
-
represent all the PCs that might exist
-
within a particular classroom
-
of the school network. Or maybe, even
-
further, all these devices represent
-
hosts that exist in the sales team
-
of the London office of the
ACME corporation.
-
One way or another, since all these
-
devices are connected with a switch,
-
they all belong to the same network.
-
Now, let's go back to that
example of the school network.
-
we said that the school
likely has many different classrooms,
-
and each of those classrooms
belong to their own network,
-
which means this would be a more
-
accurate representation of the school
-
network. We would have Classroom Two
-
owning that IP space, and Classroom Three
-
owning that IP space.
-
Now, the reason you might want to
-
separate these two sets of devices into
-
their own network is
because they might have
-
different connectivity requirements.
-
For example, maybe
these computers over here
-
all belong to the biology classroom and
-
all they need is simple
internet connectivity,
-
but maybe these computers over here
-
belong to the computer science classroom,
-
and they not only need internet connectivity,
-
but also access to various cloud resources
-
to do their studies. Well, since these
-
computers have different
connectivity requirements
-
than these computers, it's a good idea to
-
separate those out into separate networks.
-
Now, in both cases, we can still use
-
switches to facilitate
-
all the communication within the networks,
-
meaning this switch can handle all the
-
communication between these three
-
hosts, and this switch can
handle all the communication
-
between these three hosts.
-
But what happens if this host down here
-
wants to speak to this host
on a different network?
-
Well, if a switch can only facilitate
-
communication within a network,
-
we would need another type of
-
device to handle the communication
-
between networks, and that device would be
-
a router. A router is a device whose
-
primary purpose is to
facilitate communication
-
between networks. At the very least,
-
you're going to need that router to
-
connect you with the
ultimate network of networks
-
known as the internet.
-
So let's unpack this further.
-
Routers provide traffic
control points between
-
networks. Let's say we wanted to limit
-
the traffic that could go
from this PC to this PC.
-
Well, since these two PCs
aren't separate networks,
-
all that traffic has to flow through the
-
router, creating a great place
-
to add security policies or traffic
-
filtering, or even redirecting that
-
traffic elsewhere entirely.
-
Since routers sit on the boundary between
-
networks, they provide a logical
location to apply security policies.
-
This type of security filtering isn't
-
traditionally available on switches.
-
These days, there are modern switches
-
that can do such filtering, but it is
-
generally accepted that
the devices sitting
-
on the same network don't
typically need filtering for
-
traffic traveling within the network.
-
If you had devices that needed different
-
types of connectivity, you'd want to
-
place them in different networks.
-
The network boundary is
what is meant to be
-
the logical separation of devices.
-
The way routers work is that they learn
-
which networks that they are
-
attached to. Meaning, this router is going
-
to learn that on this interface, it's
-
connected to the 172.16.20 network
-
And on this interface, it's
connected to the 172.16.30 network.
-
And out here is the direction
to go to the internet.
-
The knowledge of each of these different
-
networks is known as a route,
-
and all these routes are stored in what
-
the router calls a routing table.
-
A routing table is therefore
-
all the networks that a router knows
-
about, and the router is going to use
-
this routing table in
order to funnel traffic
-
out the appropriate interface.
-
Now, when we say a router learns which
-
networks they are attached to,
-
what we mean is that
a router has an IP address
-
in every network that they're attached to.
-
For example, when this
router is attached to this
-
network, it is given an
IP adress in that network.
-
This interface's identity
is the IP address 172.16.20.1,
-
and this interface's identity
is the IP address
-
172.16.30.254.
-
This IP address is going to serve as
-
what's known as a gateway.
-
A gateway is a host's way
out of their local network.
-
For example, this host over here has the
-
IP address 172.16.20.33
-
But if that host wants to
speak to something on a
-
different network, it knows
it's going to have to go
-
through a router, and the IP address for
-
that router is stored as
that host's default gateway.
-
Notice, this host has a
default gateway of 172.16.20.1.
-
That's this interface
IP address of that router.
-
Now, if we go a step higher than that,
-
routers are actually what create
-
the hierarchy in networks and IP
-
addresses that we discussed in the prior
-
sections of this lesson. For example, the
-
New York office of the ACME corporation
-
that had all the different teams that
-
each had their own IP networks?
-
Well, each of those networks
are connected to different
-
routers, and each of
those routers are then
-
connected to another router.
-
And if a host in the sales team wants to
-
speak to a host on the marketing team,
-
it's going to use its gateway, which is
-
its closest router IP address,
-
which is then going to send the packet
-
to the next router, to the next router,
-
and then finally to the
host on the marketing team.
-
The Tokyo office of the ACME corporation
-
is likely going to have a similar setup,
-
and both of these routers are then
-
likely going to connect to the internet.
-
The internet is nothing more than a
-
bunch of different routers itself.
-
Meaning, if a host on the marketing team
-
wants to speak to a host on the
-
engineering team in Tokyo,
-
that host will send the data to the
-
router, which will send
the data to the next router,
-
which will send it through all
the routers on the internet,
-
which will finally send it
to the Tokyo router, and
-
finally to the engineering team.
-
That is how data is going to
flow across the internet,
-
and that is the role that routers play
-
in making that possible.
-
Now, the last idea I want
to leave you with
-
actually involves pulling back
the definition of switches as well.
-
There's something important
you have to understand
-
about what we've defined
as routers and switches.
-
Routing is the process
of moving data between
-
networks. A router,
as we have described it,
-
is simply a device whose primary purpose
-
is to perform routing. In the same way,
-
switching is the process
of moving data within networks.
-
And a switch, as we have described it, is
-
a device whose primary purpose
-
is switching. The reason I bring that up
-
is there are many other types of network
-
devices that exist out there.
-
Access points, firewalls, load balancers,
-
Layer-3, switches, proxies,
-
and there's even devices that only exist
-
in the cloud, like
virtual switches and virtual routers.
-
One way or another,
all these devices are going to
-
perform routing, or
switching, or both. So later on
-
in this module, when we describe
-
what a router does, or what a switch does,
-
what we are actually describing is what
-
any device does that implements routing,
-
or any device does
that implements switching.
-
And with that, we close our lesson on
-
network devices.
In part one of this lesson,
-
we unpacked hosts,
IP addresses, and networks,
-
and in part two,
-
we continued that discussion
by illustrating repeaters,
-
hubs, bridges, switches, and routers.
-
In the next lesson, we're going to give
-
you a practical perspective
on the OSI model.
-
This will lay the foundation to
-
understand what all of these devices do
-
to enable data flowing
through the internet.
-
But that wraps up this lesson. Your main
-
takeaways are on the slide right now.
-
I hope you enjoyed this lesson.
I want to thank you for watching,
-
and we'll see you in the next one.
-
Hey, YouTube. I hope you enjoyed that free
-
lesson for my new course on
networking fundamentals.
-
I'll be releasing the entire first
-
module for free here on YouTube.
-
I want this course to be the ultimate
-
networking fundamentals course, and since
-
I'm still scoping out the outline, you
-
could have a say in what topics will be covered.
-
Let me know in the comments below what
-
subjects you want included in this course.
-
Otherwise, remember to like and subscribe,
-
and of course, if you learned something
-
from this video, the best way to thank me
-
is to share this video.
-
It's a small act of gratitude, but one I
-
appreciate greatly.
-
I hope you enjoyed this lesson. I want to
-
thank you for watching, and we'll see you
-
in the next one.