Hey I'm Clint Garrett, Ace Networker, and in this second video in our network switches and
switching series we're going to discover the 3 switch functions at Layer 2. Now these are the 3
primary things that most Layer 2 switches do in any networking environment. Now this video is
going to be one of the most important if not THE most important that you will ever watch
out of all the videos that I make because when you learn these 3 switch functions at Layer 2,
you learn the foundational understanding of computer networks in general. And if if you learn
about network switches especially Layer 2 devices Layer 2 switches you're going
to have a foundation that you can build on with the rest of your computer networking knowledge.
All of the other technologies all of the other protocols will become that much easier for you to
learn grasp and understand. So make switches your foundation because switches are really
what run most networks, local area networks. So without wasting any more time let's get to it!
And when I say perform I mean when traffic (1's and 0's) when traffic first arrives on a port
on a switch, a physical port on the outside of the switch, and it arrives from some other computer or
switch or router on the network that's connected on that port, the switch has to do one or more of
these 3 things with that traffic and information: It's going to do address learning or it's going
to do forward filtering or forwarding filtering decisions it's going to make those decisions and
the third thing is it's going to be avoiding loops in what they call "loop avoidance" So address
learning, forwarding and filtering decisions, and loop avoidance. What are these exactly, you
may be asking? Well let's get into the basics and like all my other content you can delve deeper,
as I may in the near future with my content here, you can delve deeper into each of these topics to
learn more about how they each work exactly. But i'm just going to touch on the basics here and we
can go from there. So the first thing a Layer 2 switch does is it learns the addresses of
all the devices connected to it. If you want more detail on how it does this, make sure to check out
this video where I run down how it learns those addresses or how a switch learns those addresses.
Now it's not following people home and getting home addresses. We're talking about the hardware
address from each of those connected devices or the better known as the MAC addresses of the NIC
cards from each of those devices connected to the switch. It learns those by looking at incoming
frames that were sent by those devices reading the Source MAC address (the address of the device
that sent the frame out is in its Source address when it creates the frame and ships it out to the
switch or out onto the network) and recording that MAC address into what we call the Filter Table
on the switches memory, more often than not it's called the Filter Table but it's
sometimes referred to as the MAC Table or the MAC Address Table or simply the Address Table
(those are all pretty much synonymous). It's the same filtering table that the switch
learns and memorizes the memory of all those recorded MAC addresses retrieved from the source
address in the incoming frames. A switch performs this function of learning MAC
addresses from incoming frames to allow it to be extremely efficient in handling future
traffic. And we're not talking about an all-day process here. On most switches the MAC address
of those connected devices are recorded into the Filter Table within just a few seconds to minutes
after all those connected devices are powered on and they start talking to the switch.
And that leads us to the next function a Layer 2 switch performs...forwarding and filtering
decisions. So once a switch learns that, the MAC addresses from each incoming frame on a port,
it associates that learned MAC address with that physical port and this helps it forward and filter
future incoming frames or traffic by examining the Destination MAC address on the frame and
comparing that Destination MAC address to the MAC addresses it's already learned in its Filter
Table from all of the Source addresses and all the frames it's received. So if the Destination
MAC address on an incoming frame matches the MAC address in the switches Filter Table, it
will forward that frame out the physical port or interface it knows that device with that address
is connected to. And it will not send that frame out any other interfaces. Now really quickly,
if the switch reads the Destination MAC address on an incoming frame and that MAC address does
not match anything in its own Filter Table then what the switch does is it will forward
that frame out all the other interfaces except the interface that the frame arrived to on the switch.
Again, if you'd like a more in-depth explanation feel free to watch this video where I go into more
detail about that process. Last but not least the third function a Layer 2 switch performs is
called "loop avoidance" When we say "loop" we're actually talking about a physical loop that's been
created either intentionally or unintentionally on the local area network. Now this could be
caused by 2 or more cables between this switch and an adjacent switch or it could be a bigger
loop that exists across the entire LAN. I've even I've seen scenarios more often than not in real
life where loops are created by a technician or an administrator saying,"Hey we need a connection
between this switch and this switch" so they'll connect a cable between them. What they don't
realize is they're actually making a physical loop around their entire network. So that traffic
is able to reach that same (those same) switches and devices through multiple paths. Regardless of
how or why those loops exist, one of the primary functions of a switch is to detect these loops and
to avoid or prevent them from continuing to exist, because loops allow repeated replication and
multiplication of broadcast frames and or packets to a point where a network is unable to function
or pass traffic. And this can happen within a very short few seconds to a few minutes in most cases.
But a network can get to where it's unable to function or pass traffic because it's overloaded
by broadcast after broadcast after broadcast. The protocol that runs on a switch to detect
and avoid these network loops is called STP and that's an acronym for Spanning Tree Protocol. To
understand this more fully, check out this video I made previously on Spanning Tree Protocol and
how it works. Essentially Spanning Tree Protocol works by detecting existing loops in the network
and determining to block 1 or more interfaces that help to create that loop, and that's to
prevent traffic from repeating over and over again like we were talking about within that loop. So it
shuts that loop down before that broadcast storm or what they refer to as "broadcast radiation"
can occur. And those are the 3 switch functions at Layer 2. Again if you learn the concept about
these 3 primary switch functions, you will have a foundation that you can build upon
with all the other technologies all of the other protocols everything else that's involved. Now
you may be saying,"Clint, what about VLANs? What about all the other protocols that run on
switches? What about the different access levels when we're running a command line or
when we're programming a switch or when we're looking at log files?" We're going to get into
all of that later on but you need to understand these 3 primary functions
on a Layer 2 switch. Now if you have not yet subscribed to my Youtube channel,
click below to subscribe! Make sure you also click the bell if you want to be notified when my next
videos come out, and believe me I've got a series of them coming out here with a lot more protocols,
a lot more technologies to show you all the basics of computer networking so you can pass
the Network+ Exam (and even really go beyond that if you really want to). We're going to possibly
be getting into some technologies that will be more along the lines of Cisco Certified Network
Associate, Cisco Certified Network Professional and that type of thing. So be watching for those
as we go along. Also if you haven't checked out the free Cheat Code Workshop I'm going to
be showing you how to score 30 or higher on the Network+ Exam without really knowing much about
all any of the other technologies at all. But the workshop is going to give you some basic
need-to-know things as well as a Cheat Code that's going to help you advance that much faster,
score that much higher. So make sure to get in on that and I will see you in the next video!