switch-iot / hin2n

n2n support for mobiles
GNU General Public License v3.0
580 stars 125 forks source link

Can UDP multicast packets be forwarded? #78

Closed Raven81163700 closed 1 year ago

Raven81163700 commented 1 year ago

I am not fluent in English, so I use translation software, please forgive me if it causes you trouble.

I'm using your project for Minecraft BE multiplayer, but I can't search for LAN multiplayer games in the game, in fact I have to manually use the IP assigned by Supernode to the host and add a server with the default game port 19132 to be able to search, which is very unfriendly to the room list mode I am going to develop, if the user joins a new room then he has to change the server configuration to the IP of the new host.

I queried n2n for issue and added the -E parameter, which I guess is to enable accept multicast MAC addresses in the configuration file.In addition, I noticed that in linux it is by default to send multicast to all network interfaces, and it is possible that setting the -x parameter of the vNIC hop does not work. I found the tun0 network card created by your app on my phone's terminal, but it does not support MULTICAST.

We're sorry that since this is not a fatal error, I can't provide you with information such as error logs, so I can only describe the problem I encountered in as much detail as possible.

Thank you very much


Another question (I'm not sure if I need to open another issue, please notify me to edit if requested) I want to support a low Android version, I noticed that the minimum supported SDK for your project is 17 (Android 4.2?), but it stop working when I launch the app. This issue was mentioned in other issues, and it seems that the introduction of 'EVP_CIPHER_CTX_reset' after openssl 1.1.1 does not work properly in versions prior to Android 6 (I also noticed that one issue used Android 5.1 and had the same trouble). Then I tried replacing openssl inside jnilib with 1.0.2 and replacing all 'EVP_CIPHER_CTX_reset' with 'EVP_CIPHER_CTX_cleanup' (I'm not sure if that would work) and then reported that 'EVP_chacha20' was missing I noticed an issue in 2018 mentioning that Android 4.4 works, does this mean that I can bring in an older version of your project to be compatible with devices below Android 6

Raven81163700 commented 1 year ago

The starting point of this question is completely wrong, Minecraft bedrock sends broadcast packets rather than multicast packets to connect to the local area network. However, hin2n does not correctly process broadcast packets. Instead, it is interpreted as sending packets to the host identified as 255 under the subnet. I use wireshark to capture a broadcast packet whose source address is a MAC address and ask "who has 172.211.124.258? tell 172.221.124.114"