I’ve been reading about the loopback (lo) interface out of curiosity (triggered by finding that cupsd is connected to one), and tried to understand how it works and where it fits in the network visible to each party. For some reason, it eludes me. All the text I can find, repeats the same basic words and expressions and that’s not helpful here. Also, images about this thing are sorely lacking. Hopefully some one here can check how I’ve understood this, and correct what I’ve missed.
1. About the general idea
As I’ve understood it, lo is a virtual interface. Not the actual physical network adapter, or network card or whatever you want to call it; thinking ways of virtual memory being not on the actual RAM stick on your MB but still functioning similarly from the POV of the process. Lo looks like a real physical thing to the process as well. This enables an interface that’s always up and reachable.
Questions:
- What manages the lo? An application or some other manager on the system, the OS, or the NIC?
- Is the interface ‘up’ towards the inside of the system, or the external network? Shouldn’t the the actual NIC be the one visible towards the outside of the system?
2. The need for it
Apparently it works somehow as a mechanism, through which you can bypass a router that is down or otherwise unreachable in a network with multiple routers. Another router somehow nabs the message heading to an unreachable router that would’ve been normally used on the route to the destination. Some text spoke of every router thinking it has the same IP(?) so hearing about the message, and knows to take up the job through that. This avoids having to try the routing several times if several routers are down along the most direct route. How does the message bounce around the network when rerouting?
Three cases using the image:
Case 1: The short route is Source-R1-R2-End, so that’s the default route. If the connection between R2 and End is cut, does the message then go via R4 or R7 and how it’s chosen?
Case 2: If the router R2 is down, does the message go via R3 and R4? How do the know that they need to do it instead of the R5-R6-R7 branch and how does the latter know not to do it if the virtual interface is advertised around the network? Or do they both do it wasting resources?
Case 3: If R2-End and R1-R2 are cut, and R3 is down, does the message still try to return to the “default route” and go to R2 via R5-6 and then pick either R7 or R4 route to end, or does it just go the whole R5-R7 route?
How does the lo fit into all of this?
Questions:
- AFAIK several devices on a network can’t have the same address. I miss something. What?
- How does another router know that it’s responsible for the routing now without every other router on the network doing the same thing?
3. The need for direct link for a process
This segment is just one question: Just looking at the output of SS -tulpn
, it becomes apparent that many processes use a direct connection through the physical interface. Why? Wouldn’t it be better by default to use the lo for everything, or is this the case just inside the local network?
I would appreciate the help.