So first of all in
Networking, It is the interface of a network equipment
That has IP addresses. Machines by themselves do not have any IP addresses, right!!
So it is always the interfaces that have IP addresses
So IP address or MAC address are actually the property of interface of a machine
right
But there should be some way to identify the Machine uniquely and of course
deterministically through IP addresses in the network
So for this purpose
We create a special software interface called loopback interface on the machine and we assign an IP address to it
So remember loopback interfaces are software interfaces. now, what does that mean?
It means that loopback interface is actually not a hardware
but loopback interfaces are software based interfaces and
Therefore you can create as many as you want. So on a given machine you can create as many loopback interfaces as you want
Right because loopback interface are actually the conceptual concept
They are actually not a physical interface or they are not a hardware
so on a
Router you have slots. in these slots, Actually you insert the interfaces and
These are physical interfaces that you need to buy from the market
We call these interfaces as Nics. Nic means network interface cards
So these are actually a physical piece of hardware that you need to buy
From the market and insert it into the slots of the router
So loopback interfaces are not a hardware
It means that there is some piece of software
Running on the router or a network device and that piece of software
Simulate as an interface to the operating system
So because loopback interface is simulated by a software
therefore you can create as many loopback interfaces as you want on a
Network device and you can assign IP address to those loopback interfaces
So since loopback interfaces are software interfaces and they are not Hardware interfaces
Therefore they are not prone to hardware failures. So anything that is not Hardware is
Obvious that it will also not fail
They will not wear and tear out over a period of time
so because they are not hardwares therefore loopback interface possess the
property of high availability
That is suppose on this router this slot or this interface fails
Right, so this interface will go down
but loopback interface is a
software based interface and the probability of failing of a software is way less than the probability of
failing of a hardware
Right so loopback interfaces that is created on this router will always be up and running most of the time and
therefore loopback interfaces possess the property of high availability
So high availability here means that because loopback
Interfaces will be up most of the time, the remote machines in the network can always send a packet to this machine
using a loopback IP address as destination IP address in the packet
Therefore if A that is machine A creates a loopback interface
lo1 and assign an IP address to it as
12.1.1.
1/32 and there is another machine B in the network which creates a loopback interface
Lo1 and assign an IP address to it as 13.1.1.
1/32
then A can always send a packet to B with source IP address as
12.1.1.1 and destination IP address as 13.1.1.1 and
Our IP rule is still valid, so what was our IP rule that machine A
Can send a packet to the Machine B
only if machine A specify the destination IP address in the packet as
IP address of one of the local interface of machine B
so in this case
The IP rule is still valid because at the end of the day the loopback interfaces also are local
Interfaces of the machine on which they are created
So it is a good practice to assign the source IP address as IP address of loopback interface of source machine and
the destination IP address as IP address of loopback interface of destination machine
Loopback interfaces are not used for any traffic exchange
It serves the purpose of device reach ability in the network
So this is the important property of loopback interfaces. So remember loopback interfaces are not a hardware
Therefore loopback interfaces cannot transmit or receive
The traffic or the data from other nodes in the topology
But the remote machine can send a packet to
another machine in the topology by specifying the loopback interface of the destination machine as
Destination IP address in the packet. So that means the loopback interface can be used for device reach ability
So you can see for example
machine A can send a data to the machine B using B's loopback address as destination address in the packet and
Once this packet reaches to machine B machine B will consume the packet
So there is no such thing like B will forward the packet out of loopback interface
Because loopback interface are conceptual concept, so B do not forward the packet out of loopback interface
because there is no such thing and
Loopback interface is a conceptual concept and it is not a physical interface
Right. So the packet that arrives on B with the destination IP address is equal to the IP address of the loopback interface
Such a packet will be locally processed by the machine B
So guys going forward
We can view the loopback interface as just another
interfaces
Right and loopback addresses itself is one subnet with mask value always 32
So let's try to understand these two points
So you can see that in the below topology there is a router R
Right, and it has two physical interfaces
so the subnet ID of physical interface Ethernet 3 is
192.168.1.0/
24 so let's call it as subnet A
right and the subnet ID of physical interface Ethernet 2 is
192.168.5.0/
24 and let's call it s subnet B
So you can see in this diagram. How many local subnet does this router have?
the answer is 2
that is subnet A and subnet B both are the local subnets to this router and
Because these links are actually physical links therefore there could be other machines present on the other side of these links
right
Now let us try to visualize how loopback interface logically looks like to the topology
So I have added one interface to this router and
This is loopback interface with name Lo1 so loopback interfaces also have the MAC addresses and
They are configured with the IP addresses. So
You can see that any IP address that is assigned to the loopback interface always has a mask value of 32
Loopback interfaces do not have a mask value other than 32 for ipv4 addresses
Now let us try to apply some
IP address mathematics on the loopback IP address
So we have a loopback interface one, which is configured with the IP address 122.1.1.
1/32 now we have already learned how to calculate the network ID
so apply the network ID mathematics
You will find that the network ID of this interface is 122.1.1.
1/32 and we already know how to calculate the broadcast address
So the broadcast address of this interface is 122.1.1.
1/32
So you can see that for loopback interfaces
The network ID is same as broadcast address is same as the IP address that is configured on the loopback interface
Now I will ask you one question how many local subnets does this router R has
The answer is three
One local subnet is A another local subnet is B and the third local subnet is 122.1.1.
1/32
because router R has
Three local interfaces, the interface Ethernet 3, the interface Ethernet 2 and the interface loopback 1
So the number of local subnets for this router is three
If you create another loopback interface on this router
then the number of local subnet for this router will be four and
Loopback subnets. So what is the network ID of the loopback interface this one, right?
So I want you to apply the definition of local subnets and remote subnets in this case
you will find that the loopback subnets are always the local subnets for the local router and
Loopback subnets are always the remote subnets for any other network device in the topology