ntop / n2n

Peer-to-peer VPN
GNU General Public License v3.0
6.28k stars 943 forks source link

Bug: when running in SELECT_RTT mode, the edge running on supernode will be always in PSP mode #863

Closed galaxyskyknight closed 3 years ago

galaxyskyknight commented 3 years ago

I run an edge on the same machine of where supernode stands, each supernode got one edge which running in DSN_SELECT_RTT mode, upon observation, it will encounter the diagram below showed problem (all other edge will be only connected in PSP mode but none of them in P2P), however it is not working in this way if changed it to load balance mode, and as well I am wondering why it shows the binded IP address is 127.0.0.1 but not public IP address, is it prior select the loopback interface than the eth0 which cause the PSP-ONLY issue?.

### First supernode's edge output: image

### Second supernode's edge output: image

Logan007 commented 3 years ago

If no active data flow, edges will be shown as supernode forward or not at all. Did you try to ping the edges before the screenshots?

How is output different in load balance mode?

galaxyskyknight commented 3 years ago
  1. ping doesn't help, whatever I ping from local edge or remote edge. not trigger the status from PSP to P2P.
  2. in load balance mode, some of remote edges (as you mentioned those who has active data flow) could be shown in Peer to peer but not like this - all edges fall in supernode forward lists, and in load balance mode, that matches what expected result.
Logan007 commented 3 years ago

why it shows the binded IP address is 127.0.0.1

This might be the key to solve it.

It should be showing the public IP address. Do you provide public address to -l at edge? You also might want to try -e auto or -e <network adapter address> at the affected edges.

GreatMichaelLee commented 3 years ago

why it shows the binded IP address is 127.0.0.1

This might be the key to solve it.

It should be showing the public IP address. Do you provide public address to -l at edge? You also might want to try -e auto or -e <network adapter address> at the affected edges.

I found the problem, the reason is becoz I configure the -l with domain name, howeve I also configure this domain name point to 127.0.0.1 in /etc/hosts. after I remove it it resolved.

btw: why in the port 5644 output, the supernode mac address changed time by time? is it using a encrypted hash value instead of real MAC?

Logan007 commented 3 years ago

after I remove it it resolved.

Glad to hear!!

why in the port 5644 output, the supernode mac address changed time by time?

It is not a hash value, the supernode's MAC address is random by default – if not provided through -m. It should only change at supernode startup. So, maybe it restarted?

Logan007 commented 3 years ago

Considered answered, please re-open if required.