n42n / n3n

Peer to Peer VPN
51 stars 6 forks source link

dropped incoming data from unknown supernode #31

Closed H-Maktub closed 1 month ago

H-Maktub commented 1 month ago

Hello, I use Supernode Federation, but only one edge is in a normal state. On other edges, only one supernode is online, prompting "15/May/2024 16:38:44 [src/edge_utils.c:2372] dropped incoming data from unknown supernode"

config

superNode1

[connection]
bind=42014
[supernode]
community_file=/etc/n3n/community.list
federation=***
[logging]
verbose=5

superNode2

[connection]
bind=13914
[supernode]
federation=***
peer=seek.mhwl.cc:42014
[logging]
verbose=5

edgeNode1

[community]
name=***
cipher=ChaCha20
key=***
supernode=seek.mhwl.cc:42014
[tuntap]
macaddr=DE:AD:BE:EF:12:01
address = 10.200.10.3
address_mode = static
[auth]
pubkey=***

edgeNode2

[community]
name=***
cipher=ChaCha20
key=***
supernode=seek.mhwl.cc:42014 
[tuntap]
macaddr=DE:AD:BE:EF:00:00
address = 10.200.10.1
address_mode = static
[auth]
pubkey=***

log

edgeNode1

versi c macaddr           sockaddr             upt last_see 
3.3.4 1 F6:0F:F1:91:EA:F8 163.179.36.110:42014 271 7s       
0 56:48:07:EE:1F:8F 8.134.178.182:13914    0 19858d8h 

edgeNode2

versi c macaddr           sockaddr             upt la 
3.3.4 1 F6:0F:F1:91:EA:F8 163.179.36.110:42014 342 1s 
3.3.4 0 56:48:07:EE:1F:8F 8.134.178.182:13914  318 1s 

edgeNode1 Startup log

15/May/2024 16:38:32 [n3n-edge.c:810] starting n3n edge 3.3.4 Thu May 9 18:04:06 2024 +1000
15/May/2024 16:38:32 [n3n-edge.c:816] using compression: none.
15/May/2024 16:38:32 [n3n-edge.c:817] using ChaCha20 cipher.
15/May/2024 16:38:32 [src/edge_utils.c:489] number of supernodes in the list: 1
15/May/2024 16:38:32 [src/edge_utils.c:491] supernode 0 => seek.mhwl.cc:42014
15/May/2024 16:38:32 [src/transform_cc20.c:143] setup_cc20_key completed
15/May/2024 16:38:32 [src/conffile.c:1418] sessiondir: /run/n3n/my
15/May/2024 16:38:32 [n3n-edge.c:839] use manually set IP address
15/May/2024 16:38:32 [n3n-edge.c:857] skip PING to supernode
15/May/2024 16:38:32 [src/edge_utils.c:383] Setting pmtu_discovery false
15/May/2024 16:38:32 [n3n-edge.c:928] skip auto IP address asignment
15/May/2024 16:38:32 [src/tuntap_linux.c:221] Waiting for TAP interface to be up and running...
15/May/2024 16:38:32 [src/tuntap_linux.c:242] Interface is up and running
15/May/2024 16:38:32 [n3n-edge.c:962] created local tap device IPv4: 10.200.10.3/24, MAC: DE:AD:BE:EF:12:01
15/May/2024 16:38:32 [n3n-edge.c:1024] WARNING: n3n has not been compiled with libcap-dev; some commands may fail
15/May/2024 16:38:32 [n3n-edge.c:1029] dropping privileges to uid=997, gid=996
15/May/2024 16:38:32 [n3n-edge.c:1058] edge started
15/May/2024 16:38:32 [src/edge_utils.c:1596] update_supernode_reg: doing fast retry.
15/May/2024 16:38:32 [src/edge_utils.c:1208] successfully joined multicast group 224.0.0.68:1968
15/May/2024 16:38:32 [src/resolve.c:172] supernode2sock successfully resolves supernode IPv4 address for seek.mhwl.cc
15/May/2024 16:38:32 [src/edge_utils.c:1664] registering with supernode [seek.mhwl.cc:42014][number of supernodes 1][attempts left 2]
15/May/2024 16:38:32 [src/edge_utils.c:1334] send REGISTER_SUPER to [163.179.36.110:42014]
15/May/2024 16:38:32 [src/edge_utils.c:1070] sent=79
15/May/2024 16:38:32 [src/edge_utils.c:640] registering with multicast group 224.0.0.68:1968
15/May/2024 16:38:32 [src/edge_utils.c:1480] send REGISTER to [224.0.0.68:1968]
15/May/2024 16:38:32 [src/edge_utils.c:1070] sent=61
15/May/2024 16:38:32 [src/edge_utils.c:2309] Rx N2N_UDP of size 61 from [172.16.0.156:42067]
15/May/2024 16:38:32 [src/edge_utils.c:2460] skipping REGISTER from self
15/May/2024 16:38:32 [src/edge_utils.c:2223] Rx TAP packet (  90) for 33:33:00:00:00:16
15/May/2024 16:38:32 [src/edge_utils.c:2229] dropping Tx multicast
15/May/2024 16:38:32 [src/peer_info.c:176] Purging old registrations
15/May/2024 16:38:32 [src/peer_info.c:181] Remove 0 registrations
15/May/2024 16:38:32 [src/edge_utils.c:2223] Rx TAP packet (  86) for 33:33:FF:EF:12:01
15/May/2024 16:38:32 [src/edge_utils.c:2229] dropping Tx multicast
15/May/2024 16:38:32 [src/edge_utils.c:2309] Rx N2N_UDP of size 84 from [163.179.36.110:42014]
15/May/2024 16:38:32 [src/edge_utils.c:2581] Rx REGISTER_SUPER_ACK from F6:0F:F1:91:EA:F8 [163.179.36.110:42014] (external 218.204.178.2:42067) with 2 attempts left
15/May/2024 16:38:32 [src/edge_utils.c:2624] supernode '8.134.178.182:13914' added to the list of supernodes.
15/May/2024 16:38:32 [src/edge_utils.c:2649] [OK] edge <<< ================ >>> supernode
15/May/2024 16:38:32 [src/edge_utils.c:1574] sending gratuitous ARP...
15/May/2024 16:38:32 [src/transform_cc20.c:77] encode_cc20 42 bytes
15/May/2024 16:38:32 [src/edge_utils.c:2161] encode PACKET of 96 bytes, 42 bytes data, 54 bytes overhead, transform 4
15/May/2024 16:38:32 [src/edge_utils.c:1955] multicast or broadcast destination peer, using supernode
15/May/2024 16:38:32 [src/edge_utils.c:2014] Tx PACKET of 96 bytes to FF:FF:FF:FF:FF:FF [163.179.36.110:42014]
15/May/2024 16:38:32 [src/edge_utils.c:1070] sent=96
15/May/2024 16:38:32 [src/transform_cc20.c:77] encode_cc20 42 bytes
15/May/2024 16:38:32 [src/edge_utils.c:2161] encode PACKET of 96 bytes, 42 bytes data, 54 bytes overhead, transform 4
15/May/2024 16:38:32 [src/edge_utils.c:1955] multicast or broadcast destination peer, using supernode
15/May/2024 16:38:32 [src/edge_utils.c:2014] Tx PACKET of 96 bytes to FF:FF:FF:FF:FF:FF [163.179.36.110:42014]
15/May/2024 16:38:32 [src/edge_utils.c:1070] sent=96
15/May/2024 16:38:32 [src/peer_info.c:176] Purging old registrations
15/May/2024 16:38:32 [src/peer_info.c:181] Remove 0 registrations
15/May/2024 16:38:32 [src/edge_utils.c:2223] Rx TAP packet (  90) for 33:33:00:00:00:16
15/May/2024 16:38:32 [src/edge_utils.c:2229] dropping Tx multicast
15/May/2024 16:38:33 [src/edge_utils.c:2223] Rx TAP packet (  90) for 33:33:00:00:00:16
15/May/2024 16:38:33 [src/edge_utils.c:2229] dropping Tx multicast
15/May/2024 16:38:33 [src/edge_utils.c:2223] Rx TAP packet (  70) for 33:33:00:00:00:02
15/May/2024 16:38:33 [src/edge_utils.c:2229] dropping Tx multicast
15/May/2024 16:38:33 [src/edge_utils.c:2223] Rx TAP packet (  90) for 33:33:00:00:00:16
15/May/2024 16:38:33 [src/edge_utils.c:2229] dropping Tx multicast
15/May/2024 16:38:37 [src/edge_utils.c:2223] Rx TAP packet (  70) for 33:33:00:00:00:02
15/May/2024 16:38:37 [src/edge_utils.c:2229] dropping Tx multicast
15/May/2024 16:38:44 [src/edge_utils.c:2223] Rx TAP packet (  70) for 33:33:00:00:00:02
15/May/2024 16:38:44 [src/edge_utils.c:2229] dropping Tx multicast
15/May/2024 16:38:44 [src/edge_utils.c:1257] send PING to supernodes
15/May/2024 16:38:44 [src/edge_utils.c:1070] sent=38
15/May/2024 16:38:44 [src/edge_utils.c:1070] sent=38
15/May/2024 16:38:44 [src/edge_utils.c:2309] Rx N2N_UDP of size 74 from [8.134.178.182:13914]
15/May/2024 16:38:44 [src/edge_utils.c:2372] dropped incoming data from unknown supernode
15/May/2024 16:38:44 [src/edge_utils.c:2309] Rx N2N_UDP of size 74 from [163.179.36.110:42014]
15/May/2024 16:38:44 [src/edge_utils.c:2764] Rx PONG from supernode F6:0F:F1:91:EA:F8 version '3.3.4'
hamishcoleman commented 1 month ago

Whilst is it definitely unexpected to get an error for this config, you do have one strange setting: usually, all the supernodes are told about all their peers, so can you quickly try adding an appropriate supernode.peer= line to your supernode1 to point it at supernode2?

I'll probably need to dig deeper into the code to understand better what is happening, but will not get a chance for a couple of days. So, if that quick config suggestion gets things working better, great.

H-Maktub commented 1 month ago

Whilst is it definitely unexpected to get an error for this config, you do have one strange setting: usually, all the supernodes are told about all their peers, so can you quickly try adding an appropriate supernode.peer= line to your supernode1 to point it at supernode2?

I'll probably need to dig deeper into the code to understand better what is happening, but will not get a chance for a couple of days. So, if that quick config suggestion gets things working better, great.

I have tried the method you mentioned, and there are still problems; but edgenode2 is normal. Is it possible to add an example of Federation configuration file?