So welcome back, guys.
In this module, we will going to learn the concept of L2 routing.
That is routing that is done at the layer two of TCP IP stack.
So layer two is the data link layer of TCP IP stack.
So therefore, L2 routing also means the routing that is done by Datalink layer of TCP IP stack.
So we will discuss L2 routing.
That is the routing that is done by data link layer of the TCP IP stack.
Please note that only Mac addresses is used to deliver the packet to destination machine.
So whenever we talk about L2 routing it means.
We are talking about routing that is based on Mac addresses.
IP addresses do not play any role in layer two routing.
Please remember that.
It is for this reason that Mac addresses are also called layer two addresses, whereas IP addresses
are used at layer three of TCP IP stack and therefore IP addresses are called layer three addresses.
Once the packet is received from the outside world to L3 router, thereafter packet is delivered to
the destination machine in a subnet using Mac addresses only.
So you can see in this diagram we have an L3 router and this L3 router has two interfaces, right?
The two interfaces host a subnet.
Let's say the subnet on the right hand side is A and the network ID of this subnet is 11 .1.1.0 slash
24.
Whereas the subnet on the other interface of L3 router is ten .1.1.0 slash 24.
So here you can see that it is an L3 router which has two interfaces.
And each interface of an L3 router actually hosts a subnet.
Now in subnet A, there are four machines which are directly connected in subnet A.
The machines are Machine A.
Machine B.
Machine C and machine D.
Please note that each IP addresses through which these machines are connected to the subnet falls in
the subnet A So this point means that as soon as from the outside world some packet arrives on layer
three router.
And let's say that the destination IP address in this packet is the IP address of the machine.
B that is the destination.
IP address is 11 .1.1.3.
So once the packet is received by the router, thereafter the packet is delivered to a machine which
is directly connected to one of the local subnet of this L3 router using L2 routing.
So L2 routing means routing within a subnet.
Now, routing within a subnet has two meanings here.
That is routing from one machine to another machine, and both the machines are present in the same
subnet.
So in this example, if A wants to send a packet to machine C.
Then the packet is delivered from machine A to machine C using L2 routing only.
The other meaning of layer two routing is to route a packet from directly connected l3 router to a machine
present in a directly connected subnet.
It means routing a packet from layer three router to any machine which is directly connected to a local
subnet of this L3 router.
So in this example, if the router wants to send a data packet to any machine which is connected to
subnet A, then that is also achieved by layer two routing.