So welcome back, guys.
In this module we will going to learn about layer three routing, which is also called as L3 routing.
So we will discuss layer three routing, that is routing done by the network layer of the TCP IP stack,
Right?
And always remember that layer three routing is all about routing being done by IP addresses.
So remember, L3 routing are done on the basis of IP addresses only the Mac addresses are completely
out of caution.
They simply do not play any role in L3 routing.
Mac addresses are restricted only to layer two routing, right?
So layer three routing means that routing done from one layer three router, which is connected to source
subnet two, layer three router connected to destination subnet.
So always remember that layer three routing is all about routing a packet from one subnet to another
subnet, right?
So here source subnet is a subnet in which source machine is present and destination subnet is a subnet
in which destination machine is present.
Right?
So here layer three routing means that routing a packet from a router which is connected to a source
subnet to a router which is connected to destination subnet, right?
And in between these two routers, there could be any number of layer three routers or there could be
an internet between these two routers.
So in this module we will going to learn that what are exactly layer three roots?
How do we install and configure the layer three roots in Linux virtual machines and how layer three
roots help us in achieving layer three routing.
So going forward you can see this is a simple topology.
Right.
So in this topology I have shown two subnets.
On the left hand side we have a source subnet X, right?
And the network ID of this subnet is 11 .1.1.0 slash 24.
On the right hand side, we have a destination subnet Y, and the network ID of this subnet is 12 .1.1.0
slash 24.
Right now we know that every subnet is gated by an L3 router.
So for a source subnet x Layer3 router r1 is a gateway router for subnet x.
Similarly for subnet y, the layer three router R2 is a gateway router for subnet y.
And let us say that in our example Machine B is a source machine and machine F is a destination machine.
Meaning that source machine wants to send a data to the machine F which is present in subnet y.
Meaning that source machine B, which is present in subnet X wants to send data to machine F, which
is present in subnet Y.
And remember, in between these two subnets there is an internet.
So internet means any number of L3 routers can be there in between these two subnets, including L3,
router, R1 and R2.
So always assume internet as a network in which infinite number of layer three routers are present.
Now going forward Machine B, which is a source machine, wants to send a data to a destination machine.
F Right now clearly the destination machine F is present in a remote subnet with respect to machine
B.
So whenever a machine wants to send a data to a remote machine which is present outside its local subnet,
the source machine has to send a data to the gateway router first.
To sending a data by a source machine to a layer three Gateway router is done by L2 routing only.
So Machine B is sending a data to a gateway router R1 using L2 routing.
So remember, the packet has to go to Gateway L3 router first if if the packet has to leave its local
subnet.
So in this case, the source machine B has to send a data packet to its gateway layer three router R1
because the packet is destined to a machine which belongs to a remote subnet.
Now once the packet reaches L3 router R1, the L3 router R1 has the responsibility to send the data
to the next layer three router in the network based on its layer three routing information.
Now, once the packet reaches the layer three router R1, henceforth the journey of the packet is now
done using layer three routing, so it is the router r1's responsibility to send or forward the data
packet further to the next router in the network based on the layer three routing information it has.
So simply layer three router r1 forwards the packet to the next router present in the internet.
And as we already know, that internet is actually a network of large number of layer three routers.
So every router in the internet will going to forward the packet to the next router in the network based
on its layer three routing information.
And by repeating this process, the packet eventually reaches the layer three router R2, which is the
gateway router of the destination subnet.
So we can see that journey of the packet between the router R1 and the router.
R2 is done based on layer three routing.
Right.
So using layer three routing only the packet travels from router R1 and eventually reaches the router
R2, which is the gateway router of the destination machine.
Now once the packet reaches the layer three router R2, the router R2 has the intelligence to find that
the packet actually belongs to one of the local machine present in its directly connected subnet.
Now the destination subnet VI is actually a directly connected subnet of router R2.
So now Router R2 knows that the packet has to be delivered to some destination machine present on the
subnet VI.
So henceforth, the journey of the packet from the router r two to the destination machine F is again
accomplished by layer two routing.
So you can see that when the packet travels from the source machine to the destination machine, there
is an L2 routing followed by layer three routing followed by L2 routing again.
The first instance of Layer two routing is responsible to take the packet from the source machine to
the Gateway router R1.
Then layer three routing is responsible to take the packet from layer three router R1 that is the source
gateway router to the destination gateway router.
Right.
And once the packet reaches the destination Gateway router, the layer two routing again comes into
the picture and layer two routing again is responsible to take the packet from the destination Gateway
router R2 to the actual destination machine.
So we were going to discuss all this process more elaborately and in detail that exactly how Layer three
routing happens in the network.
So with this illustration, I think I'm able to explain the role of layer two routing and layer three
routing in taking a packet from the source machine to destination machine.
Given that source and destination machines are present in different subnets.