One rule about Layer 2 Broadcast is that the broadcast needs
to be forwarded to all other devices in that same Layer 2
domain--
that same Broadcast domain.
Well, what if we have two different switches that
are connected together, and we have a Broadcast in VLAN 100,
for example, on one switch?
How does that switch, when it forwards that broadcast over
to the second device, how does it
let the second switch know that this is a Broadcast
4 just VLAN 100 and not, for example, VLAN 200?
Well, the answer to that question is solved with
a technique called trunking and adding a little tag called
an 802.1Q tag to the frames over trunks.
And one of the analogies that I learned decades
ago and is still pretty effective
is the one about airlines.
And I've got seven kids, and I care a great deal
about every one of them.
And when they were young, if I would ever
have to send one of those kids on an airplane,
we'd want to make sure that they get on the plane
and were delivered correctly to the correct party
on the other side.
So what the airlines do is they create a tag
with all the information for the child who's traveling alone,
and they put it on that child for the duration of their trip.
And then, when they land on the other side,
they use that tag that the child has on them
to correctly deliver that frame to the right VLAN--
or, in the example of the plane, to deliver that child
to the correct person who's going
to take care of that child on the receiving side.
So in our topology, we've got three computers connected
to the first switch, we have a connection between the two
switches, and then three more computers
connected to the second switch.
Also, the individual ports on their respective switches
are carved out into various VLANs.
The first two ports are in VLAN 100 on switch-1,
and the third port has been configured
to be part of VLAN 200 here on switch-1.
And we have similar configurations
over here on switch-2, with port 1/1 being in VLAN 100
and ports gig 1/2 and 1/3 being in VLAN 200.
Also, to make things functional and work,
we've also configured in this topology--
all the computers there in VLAN 100,
their IP address starts with 10.100.0.
And all the devices in VLAN 200 have an IP address that begins
with 10.200.0.
And the actual VLAN assignment is
done based on the ports that these devices are connected to,
and the IP addressing can either be
done manually or through some dynamic process like DHCP,
which we'll cover in a different Nugget.
But for now, this is how this network is set up.
So if PC-1 was going to do a ping request--
so PC 1 is right here at 10.100.0.1--
if it did a ping request over to PC-4 over here at 10.100.0.4,
when that frame goes in on gig 0/1, the switch--
because gig 0/1 is configured to be a port in VLAN 100--
the switch knows that that frame that's coming in
is associated with VLAN 100.
But here's the problem.
When switch-1 forwards that frame over to switch-2 so it
can get to PC-4, it needs to add some information-- a tag,
if you will--
along with that frame to indicate, hey, buddy,
it says to switch number 2, this frame
is associated with VLAN 100.
And that additional little information that it's adding is
referred to as an 802.1Q.
That's the name of the protocol that does this,
and it's referred to as a tag.
We're adding that information before we send that frame over
to the other switch.
And that way, when switch-2 receives it,
whether it's a unicast frame, or whether it's a broadcast frame,
switch-2 will know right when it receives it, based on the tag,
that this is a frame associated just with that specific VLAN--
VLAN 100.
And then as switch-2 forwards that frame up to PC-4,
it's going to remove the tag because it's no longer needed
as it forwards the frame up to PC-4,
where that frame needs to go.
So the play by play would be, no tag here on the access port
between PC-1 and the switch.
We'd have the tag added on this interconnection between the two
switches, which is also called a trunk, by the way.
And then when switch-2 forwards that frame out the port where
PC-4 is connected-- that access port--
there would be no benefit or need to include that 802.1Q
tag, because all PC-4 cares about is the actual frame
itself.
And one of the big questions is, to tag or not to tag?
That is the question.
And the primary method that switches
know whether to include a tag or not include a tag
is the type of port that that frame is going across.
If it's an access port, which implies that we're
connected to end user devices--
devices that are not other switches
or don't need to have that tagging information-- those are
referred to as access ports.
And that's why, when we configure VLANs,
we configure both the type of port--
whether it's an access port or a trunk port.
And then if it's an access port, we also
assign what VLAN that access port is a member of.
So that way, when the switch is forwarding
a frame over a trunk, it's going to add the tag.
And when it's forwarding that frame over an access port,
it won't bother including the tag.
And to reinforce this and have some fun with this,
here's a quick little snippet from Wireshark packet capture
of the frame as it went over the trunk when PC-1 at 10.100.0.1
was doing a ping request over to PC-4 at 10.100.0.4.
And once again, the capture was taken over the trunk link.
And as a result, here we have the Layer 2 information
with the source and destination Layer 2 addresses.
And then it wedged in here this next little piece--
this additional little piece--
which is the 802.1Q tag.
And then that tag, it includes the ID, which is the VLAN ID.
Effectively, that says, this frame
is associated with VLAN 100.
So if switches had a voice, maybe they'd sound like that.
So any frames associate with VLAN 100 that are going across
this trunk link between switch-1 and switch-2,
whether they're unicast frames for a specific host,
or whether they're a broadcast for all devices in that same
VLAN, as those frames cross the trunk,
they're going to get this additional little 802.1Q tag
so that the receiving switch knows exactly which VLAN that
frame belongs to.
I hope this has been informative for you,
and I'd like to thank you for viewing.