ntop / n2n

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

Add more news to edge’s output #873

Open lucktu opened 3 years ago

lucktu commented 3 years ago

This is information without p2p

25/Oct/2021 09:15:33 [edge_utils.c:3774] adding supernode = n2n.lucktu.com:10090
25/Oct/2021 09:15:33 [edge.c:1045] WARNING: switching to AES as key was provided
25/Oct/2021 09:15:33 [edge.c:1085] starting n2n edge 2.9.0.r1032.c5253ec Oct 25 2021 09:02:59
25/Oct/2021 09:15:33 [edge.c:1091] using compression: none.
25/Oct/2021 09:15:33 [edge.c:1092] using AES cipher.
25/Oct/2021 09:15:33 [edge_utils.c:392] number of supernodes in the list: 1
25/Oct/2021 09:15:33 [edge_utils.c:394] supernode 0 => n2n.lucktu.com:10090
25/Oct/2021 09:15:33 [edge_utils.c:483] successfully created resolver thread
25/Oct/2021 09:15:33 [edge.c:1116] use manually set IP address
25/Oct/2021 09:15:33 [edge.c:1231] created local tap device IP: 10.30.10.11, Mask: 255.255.255.0, MAC: CE:B6:1F:8B:5F:48
25/Oct/2021 09:15:33 [edge.c:1298] WARNING: n2n has not been compiled with libcap-dev; some commands may fail
25/Oct/2021 09:15:33 [edge.c:1303] dropping privileges to uid=65534, gid=65534
25/Oct/2021 09:15:33 [edge.c:1329] edge started
25/Oct/2021 09:15:33 [edge_utils.c:1132] successfully joined multicast group 224.0.0.68:1968
25/Oct/2021 09:15:33 [edge_utils.c:2730] [OK] edge <<< ================ >>> supernode

I think there should be a news, ... psp; When the state changes(p2p to psp, or psp to p2p), there should also be a new message.

Logan007 commented 3 years ago

I think there should be a news, ... psp;

psp to p2p

Actually, this message already is in the code (src/edge_utils.c:816). It will only be output at higher verbosity level.

The question is if these messages will clutter the output. If we lift this type of message to TRACE_NORMAL, it will highly depend on edge's communication pattern how often this message will appear. It will be always re-printed when edges re-appear after a while (no communication in between, purged, seeing it again). For scalability, edges do no keep track of peers / other edges forever and they forget about them after a while without communication. So, seeing them again causes another output.

I am open to change it but I would wait for a broader discussion to make sure we will have found a stable majority on this point.

p2p to psp

I am not so sure about this type of message and how to identify this case. Anyone?

lucktu commented 3 years ago

I mean display the current state correctly, no change, no news.

lucktu commented 3 years ago

And the version of supernode.

Logan007 commented 3 years ago

And the version of supernode.

894

lucktu commented 3 years ago

And the version of supernode.

894

Thank you! actually, I was hoping it would be in the message below:

25/Oct/2021 09:15:33 [edge_utils.c:3774] adding supernode = n2n.lucktu.com:10090
... ...
25/Oct/2021 09:15:33 [edge_utils.c:1132] successfully joined multicast group 224.0.0.68:1968
25/Oct/2021 09:15:33 [edge_utils.c:2730] [OK] edge <<< ================ >>> supernode
Logan007 commented 3 years ago

The version number is not transmitted in REGISTER_SUPER_ACK but in PONG message. Hence, it cannot be displayed with this message which occurs on the very first REGISTER_SUPER_ACK.