Cannot build NATCompleteServer using CMake

Supporttopics regarding SLikeNet
mantracker
Junior-Member
Posts: 10
Joined: Sat Jan 20, 2018 1:23 am

Re: Cannot build NATCompleteServer using CMake

Post by mantracker »

Luke1410 wrote:This is weird. I don't have an immediate other idea at hand. Looks like I'll have to test this on the cloud instance myself. I try to get this squeezed in at some point (atm we are busy putting together the 0.1.1 release). I'll get back to you once I have further information.
I tested this on both the cloud and local instances though. There is no case where I could get it working. Have you guys ever been able to get NATCompletServer and NATCompleteClient working before?

Also, when is the 0.1.1 set for release? The reason I am asking is because I am contemplating integrating SLikeNet into our team's project. However, we are on a tight timeline and if SLikeNet is not a possible solution, we need to look elsewhere instead.
Luke1410
Site Admin
Posts: 44
Joined: Wed Jul 12, 2017 12:42 am

Re: Cannot build NATCompleteServer using CMake

Post by Luke1410 »

We did a quick test run on Windows and the sample basically worked there.

If you have the same issue running it on a normal Linux instance, I'll dig into this some time tonight quickly to see if I can reproduce the issue locally.
Luke1410
Site Admin
Posts: 44
Joined: Wed Jul 12, 2017 12:42 am

Re: Cannot build NATCompleteServer using CMake

Post by Luke1410 »

I did several detailed test runs over the day. As far as my tests go everything seems to work with the NATCompleteServer sample in all of my test environments which is:
- Windows 10 1709 (64-bit)
- Windows 10 1703 (64-bit)
- Ubuntu 16.04 (32-bit)
- Ubuntu 14.04 (64-bit)

Let's tackle your issue from two sides:
1. In your Linux instance can you run sudo ifconfig from the terminal and send me the output you see?
Then run the NATCompleteServer sample and in a second terminal window run sudo netstat -l and send me that output too.
If it contains confidential data feel free to obscure it or send it to me via a PGP encrypted mail (contact information and PGP key: http://www.luke1410.de/typo3/index.php?id=8).
2. I'm currently putting together a package which should allow you to build the NATCompleteServer sample on Linux without the need to use Wine. I'll get back to you with instructions on how to use that ASAP.
mantracker
Junior-Member
Posts: 10
Joined: Sat Jan 20, 2018 1:23 am

Re: Cannot build NATCompleteServer using CMake

Post by mantracker »

Luke1410 wrote:I did several detailed test runs over the day. As far as my tests go everything seems to work with the NATCompleteServer sample in all of my test environments which is:
- Windows 10 1709 (64-bit)
- Windows 10 1703 (64-bit)
- Ubuntu 16.04 (32-bit)
- Ubuntu 14.04 (64-bit)

Let's tackle your issue from two sides:
1. In your Linux instance can you run sudo ifconfig from the terminal and send me the output you see?
Then run the NATCompleteServer sample and in a second terminal window run sudo netstat -l and send me that output too.
If it contains confidential data feel free to obscure it or send it to me via a PGP encrypted mail (contact information and PGP key: http://www.luke1410.de/typo3/index.php?id=8).
2. I'm currently putting together a package which should allow you to build the NATCompleteServer sample on Linux without the need to use Wine. I'll get back to you with instructions on how to use that ASAP.
Hi Luke, thanks for getting back to me. I sent you an email containing 2 screenshots of the output. Please take a look
Luke1410
Site Admin
Posts: 44
Joined: Wed Jul 12, 2017 12:42 am

Re: Cannot build NATCompleteServer using CMake

Post by Luke1410 »

From the netstat output you sent me I would conclude that everything seems to work fine. The port is open (see line 6 in the output you sent me). Did you actually try to connect a NATCompleteClient to the server?

In case you wanna give a native Linux binary a try, I just fixed the build issues of that sample on Linux. The changes are expected to go into the upcoming 0.1.1 build. If you want to test this already now, follow these steps to build the current 0.1.x-development branch version:

Code: Select all

// install a subversion client and cmake (if not installed already)
sudo apt-get install subversion cmake

// download the current development branch from the SVN repository
mkdir SLikeNet_0_1_x
cd SLikeNet_0_1_x
mkdir Source
cd Source
svn co https://www.slikesoft.com/svn/slikenet/branches/0.1.x/src . --depth immediates
svn up Samples --set-depth infinity
svn up CmakeIncludes --set-depth infinity
svn up CmakeIncludes --set-depth infinity
svn up DependentExtensions --set-depth infinity
svn up Source --set-depth infinity
svn up Lib --set-depth immediates
svn up Lib/DLL --set-depth infinity
svn up Lib/JanssonStatic --set-depth infinity
svn up Lib/LibStatic --set-depth infinity
svn up Lib/MiniupnpcStatic --set-depth infinity
svn up Lib/raknet_dll --set-depth infinity
svn up Lib/raknet_janssonstatic --set-depth infinity
svn up Lib/raknet_libstatic --set-depth infinity
svn up Lib/raknet_miniupnpcstatic --set-depth infinity

// create the CMake make files
cd ..
mkdir cmake
cd cmake
cmake ../Source -DRAKNET_ENABLE_SAMPLES=1

// build the NATCompleteServer sample
make NATCompleteServer

// run the NATCompleteServer
cd Samples/NATCompleteServer
./NATCompleteServer
For testing purposes I'd suggest you select 'n' for the first option and 'y' for all following options when running the NATCompleteServer.
After the server started you can hit space to get the stats (and see if any client connected to the server).
mantracker
Junior-Member
Posts: 10
Joined: Sat Jan 20, 2018 1:23 am

Re: Cannot build NATCompleteServer using CMake

Post by mantracker »

Luke1410 wrote:From the netstat output you sent me I would conclude that everything seems to work fine. The port is open (see line 6 in the output you sent me). Did you actually try to connect a NATCompleteClient to the server?

In case you wanna give a native Linux binary a try, I just fixed the build issues of that sample on Linux. The changes are expected to go into the upcoming 0.1.1 build. If you want to test this already now, follow these steps to build the current 0.1.x-development branch version:

Code: Select all

// install a subversion client and cmake (if not installed already)
sudo apt-get install subversion cmake

// download the current development branch from the SVN repository
mkdir SLikeNet_0_1_x
cd SLikeNet_0_1_x
mkdir Source
cd Source
svn co https://www.slikesoft.com/svn/slikenet/branches/0.1.x/src . --depth immediates
svn up Samples --set-depth infinity
svn up CmakeIncludes --set-depth infinity
svn up CmakeIncludes --set-depth infinity
svn up DependentExtensions --set-depth infinity
svn up Source --set-depth infinity
svn up Lib --set-depth immediates
svn up Lib/DLL --set-depth infinity
svn up Lib/JanssonStatic --set-depth infinity
svn up Lib/LibStatic --set-depth infinity
svn up Lib/MiniupnpcStatic --set-depth infinity
svn up Lib/raknet_dll --set-depth infinity
svn up Lib/raknet_janssonstatic --set-depth infinity
svn up Lib/raknet_libstatic --set-depth infinity
svn up Lib/raknet_miniupnpcstatic --set-depth infinity

// create the CMake make files
cd ..
mkdir cmake
cd cmake
cmake ../Source -DRAKNET_ENABLE_SAMPLES=1

// build the NATCompleteServer sample
make NATCompleteServer

// run the NATCompleteServer
cd Samples/NATCompleteServer
./NATCompleteServer
For testing purposes I'd suggest you select 'n' for the first option and 'y' for all following options when running the NATCompleteServer.
After the server started you can hit space to get the stats (and see if any client connected to the server).
I've tried to connect to the NATCompleteServer from my NATCompleteClient on Windows. However, I keep getting ID_NAT_TARGET_NOT_CONNECTED on the NATCompleteClient.

Code: Select all

Enter IP of system NatPunchthroughServer, or press enter for default: 138.68.233.235
Enter port of system NatPunchthroughServer, or press enter for default: 61111
Connecting...
Enter RakNetGuid of the remote system, which should have already connected
to the server.
Or press enter to just listen.
1085367777379512699
Calculating port stride from 138.68.233.235|61111
CALCULATING_PORT_STRIDE timeout
Starting ID_NAT_PUNCHTHROUGH_REQUEST to guid 1085367777379512699.
Punchthrough attempt to guid 1085367777379512699 failed due to ID_NAT_TARGET_NOT_CONNECTED.
Failed: ID_NAT_TARGET_NOT_CONNECTED

Failed NatPunchthoughClientFramework
Proceeding to next stage.
Executing Router2Framework

Failed Router2Framework
Proceeding to next stage.
Executing UDPProxyClientFramework

Failed UDPProxyClientFramework
Connectivity not possible. Exiting
Luke1410
Site Admin
Posts: 44
Joined: Wed Jul 12, 2017 12:42 am

Re: Cannot build NATCompleteServer using CMake

Post by Luke1410 »

So it seems as if you successfully run the NATPunchthrough server and the client can also successfully establish a connection to the server.

The error you are getting (ID_NET_TARGET_NOT_CONNECTED) suggests that the target you are setting in the client to pass the data through by the server didn't connect to the server yet (and hence it's GUID cannot be resolved to that of a connected client). To reiterate how the NAT punchthrough principles work also see the old RakNet documentation contained in the SLikeNet distribution under Help/RakNet/documentation/natpunchthrough.html . It's still mostly valid (just a few things are outdated which are not important for the case however).

I take it you connected two NAT clients to the server (the first one set up as listening only, with the second one trying to listen and send data (to the other client)). I'm tempted to set up a test server on my side allowing you to test your clients. That'd allow me to verify that the client part is set up correctly. Would that be of any help to you?
mantracker
Junior-Member
Posts: 10
Joined: Sat Jan 20, 2018 1:23 am

Re: Cannot build NATCompleteServer using CMake

Post by mantracker »

Luke1410 wrote:So it seems as if you successfully run the NATPunchthrough server and the client can also successfully establish a connection to the server.

The error you are getting (ID_NET_TARGET_NOT_CONNECTED) suggests that the target you are setting in the client to pass the data through by the server didn't connect to the server yet (and hence it's GUID cannot be resolved to that of a connected client). To reiterate how the NAT punchthrough principles work also see the old RakNet documentation contained in the SLikeNet distribution under Help/RakNet/documentation/natpunchthrough.html . It's still mostly valid (just a few things are outdated which are not important for the case however).

I take it you connected two NAT clients to the server (the first one set up as listening only, with the second one trying to listen and send data (to the other client)). I'm tempted to set up a test server on my side allowing you to test your clients. That'd allow me to verify that the client part is set up correctly. Would that be of any help to you?
That would definitely be helpful to me. I'd also like to point out that I was only trying to connect a single client to the server. I didn't think of a listening client or anything like that, and had no idea I was supposed to setup 2 clients. I will definitely try that on my side as well, and report back my results
mantracker
Junior-Member
Posts: 10
Joined: Sat Jan 20, 2018 1:23 am

Re: Cannot build NATCompleteServer using CMake

Post by mantracker »

So I've tried to add both the listening client, and the connecting client as well. The listening client is fine, but the connecting client is not. I've attached all the logs below:

Also, note that I barely made any modifications to the samples. I assume it's just supposed to work out of the box right? The only changes I made was to print out the GUID on the server, so that on the clients I know what GUID to connect to:

Server Log:

Code: Select all

root@martin:~/Downloads# wine NATCompleteServer.exe 
Server GUID is: 1085367777379512699
IPs:
HostName: martin
1. 127.0.0.1
2. 127.0.0.1
3. 127.0.0.1
Using port 61111
002c:fixme:kernelbase:AppPolicyGetThreadInitializationType 0xfffffffa, 0x7bfe74
Started on 138.68.233.235|61111

NAT traversal server.
See http://www.dx.net/raknet_dx.php for discounted server hosting
Select which features to support.

NatTypeDetectionServer
Requirements: Requires 4 IP addresses
Description: Determines router type to filter by connectable systems.
One instance needed, multiple instances may exist to spread workload.
Support NatTypeDetectionServer? (y/n): N

NatPunchthroughServerFramework
Requirements: None
Description: Coordinates NATPunchthroughClient.
Support NatPunchthroughServerFramework? (y/n): Y

RelayPlugin
Requirements: None.
Description: Relays messages between named connections.
Support RelayPlugin? (y/n): Y

CloudServer
Requirements: None.
Description: Single instance cloud server that maintains connection counts
Useful as a directory server to find other client instances.
Support CloudServer? (y/n): Y

Starting NatPunchthroughServerFramework...
Success.

Starting RelayPlugin...
Success.

Starting CloudServer...
Success.

Supported features: NatPunchthroughServerFramework, RelayPlugin, CloudServer
Entering update loop. Press 'q' to quit.
Listening Client:

Code: Select all

Enter local port, or press enter for default:
NAT traversal client
Supported operations:

UPNPFramework
Requires server: No
Description: Use UPNP to open the router

NatTypeDetectionFramework
Requires server: Yes
Description: Determines router type to avoid NAT punch attempts that cannot
succeed.

NatPunchthoughClientFramework
Requires server: Yes
Description: Causes two systems to try to connect to each other at the same
time, to get through routers.

Router2Framework
Requires server: No
Description: Connect to a peer we cannot directly connect to using the
bandwidth of a shared peer.

UDPProxyClientFramework
Requires server: Yes
Description: Connect to a peer using a shared server connection.

Do you have a server running the NATCompleteServer project? (y/n): Y
Executing UPNPFramework

Failed UPNPFramework
Proceeding to next stage.
Executing NatTypeDetectionFramework

Failed NatTypeDetectionFramework
Proceeding to next stage.
Executing NatPunchthoughClientFramework
Enter IP of system NatPunchthroughServer, or press enter for default: 138.68.233.235
Enter port of system NatPunchthroughServer, or press enter for default: 61111
Connecting...
Enter RakNetGuid of the remote system, which should have already connected
to the server.
Or press enter to just listen.

Listening
My GUID is 67555774598987172
Calculating port stride from 138.68.233.235|61111
CALCULATING_PORT_STRIDE timeout
Other Client:

Code: Select all

Enter local port, or press enter for default:
NAT traversal client
Supported operations:

UPNPFramework
Requires server: No
Description: Use UPNP to open the router

NatTypeDetectionFramework
Requires server: Yes
Description: Determines router type to avoid NAT punch attempts that cannot
succeed.

NatPunchthoughClientFramework
Requires server: Yes
Description: Causes two systems to try to connect to each other at the same
time, to get through routers.

Router2Framework
Requires server: No
Description: Connect to a peer we cannot directly connect to using the
bandwidth of a shared peer.

UDPProxyClientFramework
Requires server: Yes
Description: Connect to a peer using a shared server connection.

Do you have a server running the NATCompleteServer project? (y/n): y
Executing UPNPFramework

Failed UPNPFramework
Proceeding to next stage.
Executing NatTypeDetectionFramework

Failed NatTypeDetectionFramework
Proceeding to next stage.
Executing NatPunchthoughClientFramework
Enter IP of system NatPunchthroughServer, or press enter for default: 138.68.233.235
Enter port of system NatPunchthroughServer, or press enter for default: 61111
Connecting...
Enter RakNetGuid of the remote system, which should have already connected
to the server.
Or press enter to just listen.
1076360901365999200
Calculating port stride from 138.68.233.235|61111
CALCULATING_PORT_STRIDE timeout
Starting ID_NAT_PUNCHTHROUGH_REQUEST to guid 1076360901365999200.
Punchthrough attempt to guid 1076360901365999200 failed due to ID_NAT_TARGET_NOT_CONNECTED.
Failed: ID_NAT_TARGET_NOT_CONNECTED

Failed NatPunchthoughClientFramework
Proceeding to next stage.
Executing Router2Framework

Failed Router2Framework
Proceeding to next stage.
Executing UDPProxyClientFramework

Failed UDPProxyClientFramework
Connectivity not possible. Exiting
I'd also like to note that the clients always say that they failed to load UPNPFramework, and NatTypeDetectionFramework. I assume those are irrelevant and should work regardless?
Luke1410
Site Admin
Posts: 44
Joined: Wed Jul 12, 2017 12:42 am

Re: Cannot build NATCompleteServer using CMake

Post by Luke1410 »

If the logs you provided there are accurate then it seems as if you entered the wrong GUID of the listening client when setting up the "other client". The Listening client reported its GUID to be: 67555774598987172

According to the log in the "other client" you entered: 1076360901365999200

Regarding your questions:
Yes the samples should in principle all run out of the box. Any issue using them as they are should be considered a bug.
Note however that by default the NATCompleteClient only has the NATPunchthrough case enabled. That's why it reports the UPNPFramework and NATTypeDetectionFramework failed. But these should not be necessary for the testing purpose in your case anyway, so it's all fine from that side.
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest