ntop / n2n

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

how to diag for an Edge if only this one stay in a PSP status #841

Closed galaxyskyknight closed 2 years ago

galaxyskyknight commented 3 years ago

the situtation is I have 9 edges ,one of these nines can only stay in PSP status and cannot transfer to P2P, it is the same network operators with others, and use the same supernodes, so how can I figure out what's the problem here(I run it on openwrt, perhaps the firwmare issue or firewall issue) if I enable the log output to vvvv level, what I could expect to read to find the problem, can you give some key logs information from the purching hole process perspective?

btw: I strongly recommend if you have time please kindly give some illustration for the init/puching hole process diagram for an Edge and Supernode interactive with status machine diagram in the documents and show some key logs for each status transfer so we could easy to figure out why P2P cannot established , that will be great help and highly apperciated. thanks.

galaxyskyknight commented 3 years ago

now the awkward situation is the end user have no any diag way to figure out why PSP but P2P cannot be established, if you can develop a tools to testing the P2P is reachable by simualte the edge interactive but in more transparency way in oneshot and output the analysis report instead to read logs in a developer methodology , that will be more helpful .

galaxyskyknight commented 3 years ago

Here is the log and snapshot, please help to see why p2p is disabled and using supernode, the problematic edge is 10.0.0.6(00:90:10:00:00:06)

05/Oct/2021 11:36:41 [edge_utils.c:664] pending peers list size=3 05/Oct/2021 11:36:41 [edge_utils.c:1379] skipping register as P2P is disabled 05/Oct/2021 11:36:41 [edge_utils.c:1379] skipping register as P2P is disabled

05/Oct/2021 11:37:47 [edge_utils.c:2274] encode PACKET of 188 bytes, 134 bytes data, 54 bytes overhead, transform 4 05/Oct/2021 11:37:47 [edge_utils.c:2079] searching destination socket for 00:90:10:00:00:02 05/Oct/2021 11:37:47 [edge_utils.c:2101] p2p peer 00:90:10:00:00:02 not found, using supernode 05/Oct/2021 11:37:47 [edge_utils.c:2107] found peer's socket 00:90:10:00:00:02 [[SupernNode A IP]:10086] 05/Oct/2021 11:37:47 [edge_utils.c:2134] Tx PACKET of 188 bytes to 00:90:10:00:00:02 [[SupernNode A IP]:10086] 05/Oct/2021 11:37:47 [edge_utils.c:1040] sent=188 to 05/Oct/2021 11:37:47 [edge_utils.c:2324] Rx TAP packet ( 182) for 00:90:10:00:00:02 05/Oct/2021 11:37:47 [transform_cc20.c:68] encode_cc20 182 bytes 05/Oct/2021 11:37:47 [edge_utils.c:2274] encode PACKET of 236 bytes, 182 bytes data, 54 bytes overhead, transform 4 05/Oct/2021 11:37:47 [edge_utils.c:2079] searching destination socket for 00:90:10:00:00:02 05/Oct/2021 11:37:47 [edge_utils.c:2101] p2p peer 00:90:10:00:00:02 not found, using supernode

image

logs attached:

n2n-20211005.log

galaxyskyknight commented 3 years ago

the problem I resolved after I investigate the code, this is becoz I add a '-S1' option on this edge thus it prompts the 'p2p is disabled', after remove the '-S1' option , some edges can be established connection via p2p, however, my suggestion is still validate, if there is a tool that can diag the p2p/psp mode via trasnparency dump the status transfer log/info, that would be great.

skyformat99 commented 3 years ago

the problem I resolved after I investigate the code, this is becoz I add a '-S1' option on this edge thus it prompts the 'p2p is disabled', after remove the '-S1' option , some edges can be established connection via p2p, however, my suggestion is still validate, if there is a tool that can diag the p2p/psp mode via trasnparency dump the status transfer log/info, that would be great.

This is Interesting ideas. But it probably won't happen.