Now let us discuss L2 routing at a very high level.
That is exactly how L2 routing happens.
So L2 routing happens whenever one machine wants to send or communicate with another machine which belongs
to the same subnet.
That is, whenever the communicating machines are present in the same subnet, then the data transmission
from one machine to another machine happens using L2 routing only.
So in this diagram you can see that we have an L3 router here and on the right hand side of an L3 router,
we have a subnet A and the network ID of this subnet is 12 .1.1.0 slash 24.
So in this subnet, A, there are four devices which are connected to the subnet.
A, the devices are machine D, machine, F machine E, as well as the L3 router itself.
Now, let us take an example.
Suppose the machine e wants to send a data to machine D so the source machine is machine E and the destination
machine is machine D, So the very first thing that machine E will do is that machine E prepares the
packet.
The Ethernet header contents of this packet should be like this.
The source Mac address should be M that is mac address of E interface of machine e.
And the destination Mac address should be the Mac address of.
If the interface of machine D.
And the type field in the Ethernet header should be 0800.
It means that the network layer protocol will be IPv4 protocol.
So once the machine prepares the Ethernet header and also attaches the rest of the header like IP header
or transport header, then machine E will be in a position to to place the packet on the wire.
So let us suppose that the machine e has placed the packet on the wire and the packet transmission on
the wire takes place.
The packet which is placed on the wire by the machine e is received by all other remaining machines
which are connected to the wire.
So the packet will be received by machine D, the packet will be received by machine F and the packet
will be received by l3 router as well.
Now in the step three when other machine receives the packet.
That is machine.
D machine F, as well as the L3 router.
So what happens when the machine actually receives the packet?
The very first thing that each machine does is to check whether the destination Mac address present
in the ethernet header of the packet is equal to Mac address of the receiving interface.
If this condition is satisfied, then the machine receiving the packet actually accepts the packet.
Accepting the packet means it chop off the ethernet header of the packet and handover the remaining
packet to the.
Network layer.
Why it is hand over the packet to the network layer.
Because the type field in the ethernet header is 0800.
The second case is that if destination Mac address is specified in the packet is not equal to the Mac
address of the receiving interface.
If this condition is true, then machines silently discards the packet.
So now applying this rule machine D will accept the packet because the destination Mac address is specified
in the packet is D, whereas machine f rejects the packet.
Right.
Similarly, L three router also rejects the packet.
So you can see that the packet which was placed by machine E on the wire and the packet was destined
to machine D, the packet eventually is received and processed by the machine D So this is how L2 routing
is done and you can observe that the packet is delivered to the correct intended destination based on
Mac addresses only.
So of course, you must have several questions.
Let us pick up some doubts and questions that may be crossing your mind.
So when the machine wants to communicate with machine D, all that machine E knows that it wants to
communicate with 12 .1.1.2.
We always identify the destination machine using destination machine's IP address and not Mac address.
So using this destination IP address machine e needs to know the corresponding Mac address of machine
D that is machine E should know MD in order to deliver the packet to the destination machine D So how
e would know these Mac address?
The second question is, don't you think that other machines which are connected to the wire in this
example, say Machine F is unnecessarily disturbed for the packet not assigned to it?
So you can see that machine E plays the packet on the wire and the machine D accepted the packet, whereas
the machine F rejected the packet.
So in this case, although Machine F has rejected the packet, but Machine F was unnecessarily disturbed
with the packet which was not destined to machine f, so datalink layer on the machine f actually processed
the packet only to reject it.
We say that the machine f is subjected to thrashing.
So there should be a mechanism that communicating machines, that is machine E and D can exchange packets
with each other without letting any other machines, which is directly connected to the wire.
Even know about the existence of this communication taking place.
So the answer to the question one is given by address, resolution, protocol.
And the answer to the question two is given by layer two switch.
The address resolution protocol solves the problem.
That how we would know these Mac address and the layer two switch solves the problem of thrashing.
So we will discuss each of these concepts in the upcoming lectures.