So guys, now we will take an example in which how an L3 router forwards the packet which is destined
to a host machine present in one of the VLANs.
So you can see in this topology we have an L3 router here, right?
And on this L3 router we have created three interfaces that is Svi, ten, Svi 11 and 12.
Right?
And we have done the binding of Svi interfaces with the corresponding VLANs.
Right.
And let us assume that this L3 router has an ARP table and in that ARP table it already has an entry
which maps the IP address.
14 .1.1.3 with the Mac address.
Now this IP address is an actress of host machine E, right?
And M is the Mac address that is configured on an interface of machine E Right.
So we have assumed that this L3 router has already done the ARP resolution for host machine E.
Right now in this example, you also see there are two L2 switches.
Right.
And these two L2 switches is connected by a trunk line.
Of course.
Right.
So this is the Mac address table for L2.
Switch one and this is the Mac address table for L2 switch two.
So here you can see that we have already populated the Mac address table for L2 switch one and we also
see that we have already populated the entry in the Mac address table for l2 switch two.
Because these entries in the Mac address table of L2 switch one and L2 switch two is required in order
to forward the traffic that is destined for the host machine.
E.
So in our example, the host machine E is the machine to which this L3 router has to deliver the packet.
So to simplify the example and only focus on the concept that how LTE router forwards the packet so
that packet eventually reaches the host machine present in a Vlan, we have assumed that the Mac address
table of L2 switch one and l2 switch two is populated with the required entries.
So now going forward.
So let us suppose that this L3 router receives the traffic from the Internet.
And let us say that the destination IP address that is specified in the IP header of the packet is 14
.1.1.3.
And you can see that this IP address is the IP address of the host machine.
E Right.
So this is the destination IP address and this is the destination Mac address present in the Ethernet
header of the packet.
Now the value of destination Mac address is x x because it really don't matter that what is the destination
Mac address in the packet?
But whatever it is, it will be same as the Mac address configured on the recipient interface of an
L3 router.
And remember that this packet is untagged of course, so it will not have any 802.1 q vlan header because
this packet is actually coming from l3 routing domain.
Now you can see that in this topology there are three distinct VLANs that is Vlan ten, Vlan 11 and
Vlan 12.
The host machines are present in one of these VLANs.
So therefore this L3 router has to provide service to these three VLANs.
Providing service means this L3 router has to forward the traffic to the host machine present in three
different VLANs.
And it is for this reason that this interface of L3 router is configured as a trunk line and this interface
is operating in three VLANs that is Vlan ten, Vlan 11 and Vlan 12.
Also you can see that host machine is present in Vlan 11, host machine is present in Vlan ten and remember
the port P4 or port P3 is operating in access mode.
Right.
So host machine F is operating in Vlan 12 and host machine B is operating in Vlan 11.
And similarly host machine A is operating in Vlan 12 and you can see that the physical interface of
L2 switch, which is connected to host machines, are operating in access mode.
So Port P7 is in access mode, Port P5 is in access mode, Port, P2, P3 and P4 are operating in access
mode, whereas Port P6 and P1 are operating in trunk mode.
So this was the description of this topology.
Now let us come back to our packet.
Now this packet is received by this L3 router.
So now let us apply the four steps that we have learned in the previous slide and try to see that how
this L3 router forwards this packet using those four steps.
So apply the step number one.
The L3 router inspects the destination IP address of the packet and try to find the matching interface.
Now, in this case, the matching interface is C11, right?
Now, in the second step, the router finds the Vlan, which is having a binding with C11.
Now, as per our configuration it will be Vlan 11.
Right?
So Router now knows that the host machine to which this packet should be delivered is present in Vlan
11.
Now using the destination IP address that is specified in the packet router tries to find out the Mac
address of the host machine.
Now we have assumed that router already has an entry in the ARP table.
Therefore Router knows that the destination Mac address is M, which is the Mac address of the host
machine.
E.
Now if router did not have this entry in the ARP table, then the router would have launched the ARP
broadcast request in Vlan 11 to find the ARP resolution for IP address.
14 .1.1.3.
Right, but we have assumed that router has already done the ARP resolution for this IP address.
Therefore, L3 router has an entry in its ARP table.
So now L3 Router has all the information it needs in order to decide what it has to do with the packet.
So router prepares the packet and it fills the destination mac address in the packet with the Mac address
of the host machine.
It inserts the 802.1 q vlan header so it is 802.1 q vlan header in the packet and it tags the packet
with Vlan 11.
Why?
Because Vlan 11 had a binding with c 11.
Right.
And destination ip address in the packet is remain unchanged.
Now apply the final step that is router will forward this packet out of all the physical interfaces
which is operating in Vlan 11.
Now in this case, router has a port P0 which is operating in Vlan 11.
Therefore router forwards the packet on the trunk line out of interface p0.
Right now.
Now the job of L3 router is done.
Now you know the rest of the steps that how this packet will be delivered to the host machine.
E Right.
So when this packet is received by L2 switch one, the L2 switch one will use its Mac address table
to decide how to forward the packet.
So you can see that the packet is tagged with Vlan 11 and the destination mac address in the packet
is M, so l2 switch one forwards the packet out of interface P6.
Right.
So this denotes that this is a Vlan tagged packet and is being forwarded out of interface P6 of l2 switch
one and since the packet is already tagged with Vlan 11 so there will be no change in h 02.1 q vlan
header of the packet.
Similarly, l2 switch two receives this packet and l2 switch two will then look up its Mac address table
and you can see that it finds a matching entry in the Mac address table and decides to forward the packet
out of interface P4.
So since the interface P4 is operating in access mode, therefore the 802.1 q vlan header gets removed
from the packet.
So what remains in the packet is the destination Mac address and the destination IP address fields in
the packet.
So eventually this packet reaches the host machine in the untagged form.
So we have learned the complete steps regarding how L3 router can forwards the packet such that the
packet eventually reaches its intended destination, which is our host machine.
In our example present in Vlan 11.
Similarly, this L3 router can forwards a packet which is destined for host machine present in Vlan
12 and Vlan ten.
So in other words, our L3 router can actually service multiple vlans that is Vlan ten, Vlan 11 and
Vlan 12.
So the final conclusion that you can draw from this example is that that using just one physical interface
of L3 router router can service multiple subnets using vlans.
Right.
So this is all about how router forwards the traffic on VLANs.