3 ms·
How would the receiving host know which 127 address you imagined belongs to it?
by trumpdong 5mo ago
How would the receiving host know which 127 address you imagined belongs to it?
- dcrazy 5mo agoWhat do you mean “receiving host?” 127/8 is reserved for loopback. If you bind a socket to an interface with an address in that range, you can only use it to communicate with yourself. The sending and receiving hosts are the same.
- trumpdong 5mo agoI mean the host that receives the packet. Weren't you suggesting to use 127/8 as an alternative to link-local addresses?
- dcrazy 5mo agoNo, I was saying that you can assign different loopback addresses to different interfaces even if the interfaces have been assigned the same routable IP address. This lets you distinguish them. On my Mac, however, loopback addresses are only assigned to the `lo0` interface, not to physical interfaces. I don’t know anything about how other platforms handle it, so I caveated my explanation with “maybe nobody does this in practice.”
- trumpdong 5mo agoHow does a loopback address for each interface help you do link-local stuff?