Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot communicate between win and linux (V2.9.0 r875) #642

Closed
llfj opened this issue Feb 22, 2021 · 17 comments · Fixed by #830
Closed

Cannot communicate between win and linux (V2.9.0 r875) #642

llfj opened this issue Feb 22, 2021 · 17 comments · Fixed by #830
Labels

Comments

@llfj
Copy link

llfj commented Feb 22, 2021

edge v.2.9.0.r875.8589471
supernode v.2.9.0.r875.8589471

Cannot communicate between win and linux.
Win and win or linux an linux can communicate.
It seems that win cannot get the mac address of linux edge

@Logan007
Copy link
Collaborator

I have just tried Linux supernode and Windows edge (compiled using our Building instructions) of that same commit as yours real quick. And I do not see any issue. What is your exact configuration / command lines? What output do you get running with supernode and edge -vvvv?

@llfj
Copy link
Author

llfj commented Feb 22, 2021

You try to use linux edge and windows edge, they can connect to the supernode, but linux and windows cannot communicate with each other.

@Logan007
Copy link
Collaborator

Logan007 commented Feb 22, 2021

I can't confirm. I am getting a clean ping between Windows and Linux edges (supernode on Linux).

@llfj
Copy link
Author

llfj commented Feb 22, 2021

command lines : edge -d ddd -a 10.1.1.1 -c n2n -k test -l xxxxxxx:xxxx -A3 -f

@Logan007
Copy link
Collaborator

Logan007 commented Feb 22, 2021

I did a fresh re-build on Windows as well as on Linux and used your command line on Linux (Windows does not not understand -f and we can omit -d if not other TAP device around). And of course, I use different IP addresses 10.1.1.2 and 10.1.1.2 as well as my own supernode.

Also, on Linux, I have put ./edge ... instead of only edge ... so it uses the freshly build executable from the current directory and not the one from the system's /bin directory.

I am sorry not being able to confirm any issue. The ping works like a charm.

Do you see any special output if you use -vvvvv at the edge?

@llfj
Copy link
Author

llfj commented Feb 23, 2021

@Logan007
Copy link
Collaborator

Thank you for providing the log files. I stumbled across the "unknown ether type" message in the linux log which immediately reminded me of #617 – we have rephrased the message to "unknown ether type" afterwards.

I assume you do not deal with VLAN as the unknown ether types do not look like VLAN markings.

How did you build your Windows version?

Could you please try to rebuild your Windows build using exactly the way depicted in our building documentation? And if you have already done so, could you please remove the n2n\build directory before rebuilding again?

@llfj
Copy link
Author

llfj commented Feb 23, 2021

After testing the windows version of Edge, if you use the VS compiler to compile windows, it can communicate with Linux normally. If you use mingw compiler to compile, windows can communicate with windows, but windows cannot communicate with linux. The V2.7 version does not have this problem.

@Logan007
Copy link
Collaborator

That sounds like a hard to debug issue. Different behavior depending on different build tool chains...

I would like to take a closer look into it as soon as I get to build using mingw myself, I haven't had the opportunity yet.

But to narrow it down a bit upfront: Does your mingw version 2.9 communicate with Linux if you disable encryption (-A1)? Or if you use a different encryption scheme, e.g. -A2 or -A4?

@llfj
Copy link
Author

llfj commented Feb 23, 2021

like #617
Linux and windows can communicate without the password "-k", and use the password "-k" can not communicate regardless of the encryption (-A2-A3-A4...).

@Logan007
Copy link
Collaborator

Thank you very much! 💪

That will give me good a starting point for debugging a mingw-build – whenever I get to it...

Meanwhile, I have emphasized the need to stick to the described tool chain in the building documentation.

@Logan007 Logan007 mentioned this issue Feb 25, 2021
21 tasks
@llfj
Copy link
Author

llfj commented Apr 2, 2021

n2n v.2.9.0.r902.35dc670

The windows version compiled by mingw still cannot communicate with linux.
I found a phenomenon that the linux side of encrypted communication will receive a prompt like "02/Apr/2021 17:21:58 [network_traffic_filter.c:159] collect_packet_info stumbled across the unknown ether type 0xEF7B”.
But without -k windows can communicate with linux , there will be no such prompt。

02/Apr/2021 17:32:45 [edge_utils.c:1421] handle_PACKET size 108 transform 3
02/Apr/2021 17:32:45 [transform_aes.c:138] transop_decode_aes 108 bytes ciphertext
02/Apr/2021 17:32:45 [network_traffic_filter.c:159] collect_packet_info stumbled across the unknown ether type 0x362A
02/Apr/2021 17:32:45 [edge_utils.c:1537] sending to TAP 92
02/Apr/2021 17:32:45 [edge_utils.c:2187] ### Rx N2N UDP (154) from 117.82.66.175:10090
02/Apr/2021 17:32:45 [edge_utils.c:2266] [PsP] Rx data from 121.224.228.207:10240 (Via=117.82.66.175:10090) [154 B]
02/Apr/2021 17:32:45 [edge_utils.c:1421] handle_PACKET size 108 transform 3
02/Apr/2021 17:32:45 [transform_aes.c:138] transop_decode_aes 108 bytes ciphertext
02/Apr/2021 17:32:45 [network_traffic_filter.c:159] collect_packet_info stumbled across the unknown ether type 0x49BB
02/Apr/2021 17:32:45 [edge_utils.c:1537] sending to TAP 92
02/Apr/2021 17:32:46 [edge_utils.c:2187] ### Rx N2N UDP (154) from 117.82.66.175:10090
02/Apr/2021 17:32:46 [edge_utils.c:2266] [PsP] Rx data from 121.224.228.207:10240 (Via=117.82.66.175:10090) [154 B]
02/Apr/2021 17:32:46 [edge_utils.c:1421] handle_PACKET size 108 transform 3
02/Apr/2021 17:32:46 [transform_aes.c:138] transop_decode_aes 108 bytes ciphertext
02/Apr/2021 17:32:46 [network_traffic_filter.c:159] collect_packet_info stumbled across the unknown ether type 0x918B
02/Apr/2021 17:32:46 [edge_utils.c:1537] sending to TAP 92
02/Apr/2021 17:32:56 [n2n.c:454] Purging old registrations
02/Apr/2021 17:32:56 [n2n.c:459] Remove 0 registrations
02/Apr/2021 17:32:56 [n2n.c:454] Purging old registrations
02/Apr/2021 17:32:56 [n2n.c:459] Remove 0 registrations
02/Apr/2021 17:33:00 [edge_utils.c:2187] ### Rx N2N UDP (104) from 117.82.66.175:10090
02/Apr/2021 17:33:00 [edge_utils.c:2266] [PsP] Rx data from 121.224.228.207:10240 (Via=117.82.66.175:10090) [104 B]
02/Apr/2021 17:33:00 [edge_utils.c:1421] handle_PACKET size 58 transform 3
02/Apr/2021 17:33:00 [transform_aes.c:138] transop_decode_aes 58 bytes ciphertext
02/Apr/2021 17:33:00 [network_traffic_filter.c:159] collect_packet_info stumbled across the unknown ether type 0x90C8
02/Apr/2021 17:33:00 [edge_utils.c:1537] sending to TAP 42

02/Apr/2021 17:33:00 [edge_utils.c:1074] send REGISTER_SUPER to 117.82.66.175:10090
02/Apr/2021 17:33:00 [edge_utils.c:857] sendto_fd sent=91 to
02/Apr/2021 17:33:00 [edge_utils.c:495] Registering with multicast group 224.0.0.68:1968
02/Apr/2021 17:33:00 [edge_utils.c:1210] Send REGISTER to 224.0.0.68:1968
02/Apr/2021 17:33:00 [edge_utils.c:857] sendto_fd sent=61 to
02/Apr/2021 17:33:00 [edge_utils.c:1000] send PING to supernodes
02/Apr/2021 17:33:00 [edge_utils.c:857] sendto_fd sent=36 to
02/Apr/2021 17:33:00 [edge_utils.c:2187] ### Rx N2N UDP (50) from 117.82.66.175:10090
02/Apr/2021 17:33:00 [edge_utils.c:2380] Rx REGISTER_SUPER_ACK from MAC 9A:D1:0D:4F:AA:E7 [117.82.66.175:10090] (external 114.218.194.239:60655). Attempts 2
02/Apr/2021 17:33:00 [edge_utils.c:2187] ### Rx N2N UDP (50) from 117.82.66.175:10090
02/Apr/2021 17:33:00 [edge_utils.c:2524] Rx PONG from supernode '9A:D1:0D:4F:AA:E7'

@Logan007
Copy link
Collaborator

Logan007 commented Apr 2, 2021

@llfj: Thank you for sharing your finding. That is well in line with the so far seen symptoms.

02/Apr/2021 17:21:58 [network_traffic_filter.c:159] collect_packet_info stumbled across the unknown ether type 0xEF7B basically is an indicator that decryption failed (in case of encrypted communication), not leading to a valid ethernet frame type to be filtered and delivered to the TAP.

@llfj
Copy link
Author

llfj commented Apr 3, 2021

This is a very troublesome thing, especially for our cross-compiling N2N for windows under linux. Can you compare the code of V2.8 to solve this problem? V2.8 has no similar problems.

@Logan007
Copy link
Collaborator

Logan007 commented Apr 3, 2021

Can you compare the code of V2.8 to solve this problem?

I will debug. This has not been not forgotten.

especially for our cross-compiling N2N for windows under linux.

I just prioritize it a bit lower while working towards the 3.0 features first because there currently still is way to get working Windows binaries (MSVC, /doc/Building.md).

This is a very troublesome thing,

I am sorry for inconvenience. It just will take some time to dig down to that.

@llfj
Copy link
Author

llfj commented Aug 29, 2021

After testing, the version before v2.9.0_r814 --hard 8089200 uses mingw to compile the edge of the windows platform and the ping succeeds after encrypted communication with the edge of the Linux platform.
Versions after v2.9.0_r814 --hard 8089200 use mingw to compile the edge of the windows platform to encrypt the communication with the edge of the linux platform and then the ping fails, but the ping succeeds when using "-A1" without encrypting the communication.

@Logan007 Logan007 linked a pull request Sep 29, 2021 that will close this issue
@chinayangh
Copy link

VS compiler

Where can get VS compiler edition ? Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants