0

What're the relations between 127.0.0.0/8 and 127.0.0.1?

As per this post, it seems that they are the same thing. I am a newbie at the network, could somebody shed some light on this question?

ADDED: Does it mean the data send to 127.0.0.1:502 could be received with the program which listens on 127.255.255.254:502?

John
  • 101
  • 1
  • @Zac67 Does it mean the data send to `127.0.0.1:502` could be received with the program which listens on `127.255.255.254:502`? – John Jun 08 '21 at 09:06
  • No - 127.0.01 and 127.255.255.254 share the same loopback interface but they're not a single IP address. But you could send a udp datagram from 127.0.0.1:502 to 127.255.255.254:502 without a problem. – Zac67 Jun 08 '21 at 09:16
  • @Zac67 What about TCP? – John Jun 08 '21 at 11:34
  • Absolutely the same - replace "send UDP datagram" with "connect TCP socket". – Zac67 Jun 08 '21 at 15:38
  • @Zac67 It seems that you are wrong after I did a test on Ubuntu. "sudo nc -l 127.0.0.1 502" starts a TCP server. And "sudo nc 127.0.0.1 502" could successfully establish the connection whereas "sudo nc 127.255.255.254 502" couldn't. – John Jun 09 '21 at 01:24
  • That is exactly what I meant. – Zac67 Jun 09 '21 at 05:10
  • @Zac67 But you said :"But you could send a udp datagram from 127.0.0.1:502 to 127.255.255.254:502 without a problem." I am confused now. – John Jun 09 '21 at 06:16
  • "Send from IP:port" = send with IP:port as source; "send to IP:port" = with IP:port as destination. I was trying to point out that all those loopback addresses share a (virtual) network, so they can communicate with each other. They're different addresses still - which you verified in Ubuntu. – Zac67 Jun 09 '21 at 06:24

0 Answers0