Welcome back guys. Now in this lecture we will going to
Study the loopback
Interfaces. So what are exactly loopback interface?
what is their purpose and
How they are used? we will going to understand all these concepts regarding loopback
interfaces
So one obvious question that naturally
Arises in our mind is that when we send a packet destined to a remote machine,
What is the IP address we should specify as a source and destination IP address in the backend?
Let us say for example
Machine A wants to send a packet which is destined to machine B
then what should be the source IP address and destination IP address
Machine A should specify in the packet
So if A wants to send a data to the machine B
What should be the source IP address to be specified in the IP header of the packet now?
You can see that the machine A has two interfaces
Let's call it as interface 1 and the interface 2. Now interface has an IP address 10.18.
1.2 and
interface 2 has an IP address 11.18.5.1
So when machine A generate any packet
Destined to some remote machine in the network, What should be the source IP address machine A should specify.
Should this be the IP address of interface 1 or should be the IP address of interface 2?
Similarly the next question that arises is
Regarding destination IP address if machine A wants to send a packet to the destination machine B
Then what should be the destination IP address machine A should specify. should it be the IP address 192.168.1.2? that is IP
address of interface 1 for machine B or
should machine A
Specify the IP address of interface 2 of machine B. That is 192.168.5.1
So what should be the destination IP address machine A should specify?
So the question stands tall
Regarding when machine A wants to send a packet to the machine B
What should be the source IP address and what should be the destination IP address to be specified in the packet
So the answer is A
Can specify the source IP address as IP address of any local interface
So
Machine A can specify the source IP address as IP address of any of its local interface
that is machine A can specify the IP address of interface 1 or
IP address of interface 2 both will going to work
Similarly machine A can specify the destination IP address as IP address of any local interface of machine B
Right thus any combination of source IP
that is source IP could be 10.18.1.2 or 11.18.5.1 and
destination IP address could be
192.168.1.2 or
192.168.5.1
So as long as machine A specify any combination of these source IP and destination IP address in the packet, the packet
Will be eventually routed successfully by the network and the packet will reach the destination node B
That is the packet would be delivered to the destination node B by the network layer
So in short any combination of source IP address and destination IP address
Would result in the same fate of the packet
So actually there is a need to come up with one
deterministic way to specify the source IP address and destination IP address in the packet
So there is a need of deterministic way
Right at this point of time
It seems that machine A has too many options to specify a source IP address and destination IP address in the packet
Right. Though this will work, but in networking, there should be a deterministic way or there should be a rule
Using which the machines should specify our particular source IP address and destination IP address in the packet
So we will discuss what is that deterministic way.
So guys let us try to discuss the possible solution of the problem that we have just discussed
So there is a need to come up with special IP
addresses which identify the l3 router as a device in the network and
That address should be unique. So
Loopback addresses help achieve this goal. So
Loopback addresses are used to represent the identity of a networking device
So you can see in the below diagram the machine A has two interfaces
with IP address 10.18.1.2
Let's call this interface as interface 1 and let's call another interface of the Machine A as interface 2
Similarly machine B also has two interfaces
Let's call it as interface 3 and inter phase 4 which have their own IP address configured on them
So you can see that machine A is configured with the loopback address 122.1.1
1/32 and machine B is configured with the loopback address
122.1.1.2/32
So loopback addresses are actually are not tied to any physical interface of a machine
But actually they represent the identity of the machine itself
So if somebody ask you that hey
What is the IP address of the machine A then you should say that IP address of the machine A is
122.1.1.
1/32 and
If somebody asks you that
What is the identity of the Machine B, then you should say that the loopback address of the Machine B is
122.1.1.
2/32
so loopback addresses
Identifies the networking device as a whole in the network
Right. So loopback addresses are used to represent the identity of the networking device
Now if machine A wants to send a data which is destined to the Machine B
Then it is actually a good practice that machine A should
specify the source IP address as its own loopback address and
It should specify the destination IP address as the loopback address of the destination machine
So this is actually a good networking practice
however, as I mentioned that if machine A specify the source IP address as IP address of any of its local interface and
specify destination IP address as IP address of any local interface of
Destination machine the packet would still routed in the same way and will eventually reach the destination machine B
So specifying the source and destination IP address as loopback addresses is actually a good networking
Practice in the scenario when the Machine A wants to send a packet to some
specific machine B in the network
Now let us try to understand some of the properties of loopback addresses