Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

[BUG] Dedicated server connection issues with IPv6 networks

Hi again, as you can already see (link text) we're working in an Android / IOS multiplayer project, and due the new apple policies (link text) we forced to make our app to be IPv6 capable, and here is when a new issue appears. Following the instructions provided by apple (link text) we setup a IPv6 network to perform our own tests.

If we connect any device using the IPv6 network we're unable to connect to the dedicated server using the open command pointing to the IPv4 address (the server host is an AWS EC2 with IPv4 and IPv6 support). But, if we use a ipv4 client network it works perfect.

Additional notes:

  • It is not a IOS dependence issue because it happens testing in android devices too.

  • We already tested other apps using the IPV6 network and everything works fine, so we can discard a network issue.

Additional Information

  • UE4 - 4.14.3 (Source Version)

We're made some changes to the engine code regarding your answer to enable ARM64 support to the dedicated server: (link text)

After read the links listed next we assume that Unreal 4.14 is already ipv6 capable.

  • New: Enabled IPv6 support on iOS and Mac (link text).

  • Fixed! UE-35738 IPv6 implementation is not working on IOS (link text)

Product Version: UE 4.14
more ▼

asked Mar 31 '17 at 08:17 PM in Bug Reports

avatar image

8 1 2 5

avatar image Matthew J Apr 06 '17 at 08:16 PM

Hello DarielNS,

Thank you for reporting this issue. I'm currently looking into getting a test set up for this but due to the network modifications required, it's taking some time. I'll try to get back to you as soon as possible.

avatar image ChonusaN Apr 29 '17 at 07:04 PM

Hi Matthew, Is there any news about this?

avatar image Matthew J May 09 '17 at 04:59 PM

Hello GameOlic,

I apologize for the delay but we're currently in the process of having a testing environment setup to simulate the environment a consumer would be using to connect with IPv6 to accurately test this problem.

avatar image ChonusaN May 15 '17 at 11:59 PM

Ok Matthew, please let me know. We are really stucked at this issue and our deadline is aproaching. Thanks

avatar image DarielNS Jun 03 '17 at 07:53 PM

Hi Matthew,

In case it can help, we debug the thing a little more and finally get a good log about the issue:

[2017.06.03-18.58.22:096][544]LogNet: Browse:

[2017.06.03-18.58.22:105][544]LogInit: BSD IPv6: Socket queue 32768 / 32768

[2017.06.03-18.58.22:107][544]LogIOS: Host addr is WIFI: [::ffff:]

[2017.06.03-18.58.22:113][544]PacketHandlerLog: Loaded PacketHandler component: Engine.EngineHandlerComponentFactory (StatelessConnectHandlerComponent)

[2017.06.03-18.58.22:116][544]LogNet: Game client on port 8001, rate 10000

[2017.06.03-18.58.22:119][544]LogSockets: sendto error: (ESocketErrors:23)

[2017.06.03-18.58.22:120][544]LogNetVersion: GetLocalNetworkVersion: CL: 0, ProjectName: test, ProjectVersion:, EngineNetworkVersion: 2, GameNetworkVersion: 0, NetworkChecksum: 1076119533

[2017.06.03-18.58.22:121][544]LogNet: UPendingNetGame::InitNetDriver: Sending hello. [UNetConnection] RemoteAddr: [::ffff:]:8001, Name: IpConnection_0, Driver: PendingNetDriver IpNetDriver_0, IsServer: NO, PC: NULL, Owner: NULL

[2017.06.03-18.58.23:123][604]LogSockets: sendto error: (ESocketErrors:23)

[2017.06.03-18.58.24:137][666]LogSockets: sendto error: (ESocketErrors:23)

[2017.06.03-18.58.25:152][727]LogSockets: sendto error: (ESocketErrors:23)

We got the log by making the 'open map' to an IPv4 network from an IPv6 net. Remember that our AWS is currently supporting IPv6 network.

Note: we edit the log to hidden our real IPv4 address (marked in bold), if you need the real IP please let me know.

avatar image zompi2 Jun 04 '17 at 10:35 AM

From what I can see - You are trying to connect to AWS via IPv4 address. AWS has dual-stack support so You can use either IPv4 and IPv6 address.

But when you are in IPv6 network, using BSDIPv6 sockets and trying to connect to IPv4 server - then you must use the help of DNS64. To do this, simply set up a domain address and try to connect to it. The domain will be something like "mygame.test.amazon.com". You can set up it in AWS dashboard. The DNS64 should get you RemoteAddr like: [64:ff9b::3492:4696]

Another, very importan thing - you are trying to connect via port 8001. The default port for UE4 is 7777. You can change it by launching a dedicated server with a parameter: -port=8001 If I remember correctly - UE4 will try next 100 ports if the first one won't succeed.

avatar image DarielNS Jun 04 '17 at 07:09 PM

Hi again zompi2 I checked what you told me, the problem persist, and i got this log:

[2017.06.04-17.50.33:061][387]LogNet: Browse: ec2-52-146-70-150.us-west-2.compute.amazonaws.com:8001//Game/Maps/Login

[2017.06.04-17.50.33:083][387]LogInit: BSD IPv6: Socket queue 32768 / 32768

[2017.06.04-17.50.33:085][387]LogIOS: Host addr is WIFI: [::ffff:]

[2017.06.04-17.50.33:094][387]PacketHandlerLog: Loaded PacketHandler component: Engine.EngineHandlerComponentFactory (StatelessConnectHandlerComponent)

[2017.06.04-17.50.33:101][387]LogNet: Game client on port 8001, rate 10000

[2017.06.04-17.50.33:103][387]LogNetVersion: GetLocalNetworkVersion: CL: 0, ProjectName: hunterswar, ProjectVersion:, EngineNetworkVersion: 2, GameNetworkVersion: 0, NetworkChecksum: 1076119533

[2017.06.04-17.50.33:107][387]LogNet: UPendingNetGame::InitNetDriver: Sending hello. [UNetConnection] RemoteAddr: [::]:8001, Name: IpConnection_0, Driver: PendingNetDriver IpNetDriver_0, IsServer: NO, PC: NULL, Owner: NULL

[2017.06.04-17.50.33:279][396]LogNet: Host name resolution completed

[2017.06.04-17.50.34:120][438]LogSockets: sendto error: (ESocketErrors:23)

[2017.06.04-17.50.35:126][496]LogSockets: sendto error: (ESocketErrors:23)

[2017.06.04-17.50.36:130][557]LogSockets: sendto error: (ESocketErrors:23)

As you can see the RemoteAddr is empty, we dont sure but it may be caused due the weird host name that amazon provide, anyways your opinion will be very helpful.

We already request a hostname change (or redirect by DNS to another domain) to perform more tests.

avatar image zompi2 Jun 04 '17 at 08:44 PM

You've said you have 4.14 right? There was a bug with IP name resolving, fixed here: https://github.com/EpicGames/UnrealEngine/pull/3172 This should make ip resolving for ipv4 proper and you should get the Remote Addr after "Host name resolution completed".

This will work for IPv4 network. For IPv6... it seems I can't give codes at this moment, but I can tell where is the problem. But at fist - check if the host name resolving is ok.

avatar image zompi2 May 31 '17 at 07:58 PM

Hi there.

I can confirm that on iOS and Android connecting to the dedicated server via IPv6 is not possible.

The code has many bugs in terms of containing the ipv6 address. For some reasons engine tries to cast ipv6 address which has 128bits to ipv4 addres where we hve 32 bits and we've got huge data lost.

I've fixed it, but the only I can do is to inform about what accualy went wrong.

avatar image DarielNS May 31 '17 at 08:14 PM

Thank you so much!, i'll be waiting for your reply.

avatar image Matthew J Aug 30 '17 at 01:53 PM

Hello DarielNS, I apologize for the delay on this response; Are you still experiencing this issue? If so, I would like to continue investigating.

avatar image DarielNS Aug 31 '17 at 04:38 PM

Hi Matthew, we deal with Apple to bypass the requisite for now, but the problem still there. We will aboard the issue again after finish our milestones. I appreciate your interest so much.

avatar image zompi2 Aug 31 '17 at 07:23 PM

Hi. If you could inform the programmers - the issue is that there is no structure to hold 128bit ip address anywhere. Adding specialized methods for setting and getting ipv6 should fix all problems.

I'm currently consulting this with my team... We have a fix for that, but making pull requests to master takes a lot of time which we don't have :(

avatar image feiwu Jan 03 '18 at 04:30 AM

hi, @zompi2, did you means this code? if I change this code to fix ipv6 length, will pass appstore? alt text

if change this code works, you don't need pull the source from github, just public IpConnection,and configure it in engine configure file.

ios.png (24.0 kB)
(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

I've finally could sit down and write everything...

So - here's a pull request. https://github.com/EpicGames/UnrealEngine/pull/4397/files

Main issue is in the IpConnection.cpp LowLevelSend method. There is an ResolveInfo copying the address to the RemoteAddr. But it is doing it by copying only 4 bytes, not 16 (which is the size of IPv6).

The host name resolver is bad too in my opinion. There will be problems if you try to connect using IPv4 network and IPv4 server.

There are 4 new methods: SetIPv6 and GetIPv6 for explicitly getting and setting IP Address using IPv6 byte code and IsBSDIPv6 which checks is the Address is binded to the BSDIPv6 socket and CreateInternetAddr6 for proper creating and then cacheing the resolved address.

There is a lot of going on with interfaces and there might be bugs. I will look at this in the future, but I think this is a good solution.

We are using it in our project and we have dedicated server on Linux and game on iOS and Android working pretty nice on any combination of IPv4 and IPv6 networks.

more ▼

answered Jan 05 '18 at 08:11 PM

avatar image

755 24 48 145

avatar image ARCoded Feb 20 '18 at 11:42 PM

Hi zompi!. we re trying to implement your suggestion right now, but the SocketSubsystemBSDIPv6.cpp is shiggly different. We are now working in UE 4.18.1. What version you used?

avatar image zompi2 Feb 21 '18 at 01:56 PM

I've been doing it on 4.18.something, hmm... Check the @feiwu solution it should work really nice without engine modification.

avatar image ARCoded Feb 26 '18 at 09:12 PM

Hi Zompi, our programmer decied to try your solution first (he have his own reassons i think). We performed the engine changes in UE 4.18.1, everything still working as expected in a IPV4 client network, but when we trying to connect to the server from a IPV6 client network it returns Host name resolution failed with 51 error. We're testing the connection using windows client and server.

What we do:

  1. We compiled the moded engine (4.18.1)

  2. We Compiled our project using the moded engine

  3. We packaged a windows version of our client and dedicated server (debug)

  4. We opened our dedicated server in the desired remote pc (default port: 7777)

  5. We executed our client (in a pc with ipv6 network only, not the apple simulation, is a real one)

  6. We openend the console

  7. We executed OPEN hostname.com

  8. It returned the mentioned error

Our hostname is a DNS with our ipv4 and ipv6 addresses.

Have you a idea about what is happening?, thanks in advance.

LOGS: https://pastebin.com/74B1L3hM

avatar image zompi2 Feb 26 '18 at 10:51 PM


First of all, I have to admit... I've never tried to make it work on Windows... Because we're working on mobiles here, we've been testing it on IOS, Android and building dedicated server application for Linux.

But as far as I understand - you've enabled IPv6 for Windows (SocketSubsystemWindows should inherit from FSocketSubsystemBSDIPv6).

Quick look to the google and the error code 51 is:

"An MX record is returned but no A record—indicating the host itself exists, but is not directly reachable."

Soo... it seems the DNS does not return the valid IP address (or it didn't return it at all). Have you tried to ping it? Are you sure it works? Does it point directly to the host machine address?

We've been testing this on Amazon EC2 machines, so it was easy for us to configure the environment there.

The other hint I have is to set such hints:

hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_DGRAM;

Sadly this is the only feedback I'm able to provide... Please inform if anything helped!

avatar image ARCoded Feb 28 '18 at 06:02 PM

Hi again Zompi, you was right, the client resolves the IPv6 like a charm in android devices. But it does not reach our dedicated server after executing the open hostname.com command. We think that the issue may be related with the platform where our dedicated server is running right now, that is Windows. As we can see the server is listening IPV4 only, but we dont sure.

  • [2018.02.28-17.48.57:193][ 0]LogInit: WinSock: I am database1 (IPV4_WAN_ADDRESS:0)

  • [2018.02.28-17.48.57:193][ 0]PacketHandlerLog: Loaded PacketHandler component: Engine.EngineHandlerComponentFactory (StatelessConnectHandlerComponent)

  • [2018.02.28-17.48.57:194][ 0]LogNet: GameNetDriver IpNetDriver_0 IpNetDriver listening on port 7777

avatar image zompi2 Feb 28 '18 at 07:21 PM

Windows uses Socket Subsystem that inherits from regular FSocketSubsystemBSD, so if you haven't change that - dedicated server will try to use IPv4 connection.

Fun fact - you can run a dedicated server in IPv4 network and connect to it from the IPv6 network. But then - the server must be inside IPv4 network. Otherwise it will receive IPv6 packets and will have no proper implementation to handle it.

The easiest solution would be to inherit the Windows Socket Subsystem from FSocketSubsystemBSDIPv6.

You can check this article to clarify a lttle: http://zompi.pl/migrating-to-ipv6/

avatar image feiwu Feb 21 '18 at 01:13 AM

I don't think change engine code is a good solution, create a class public from the IpConnection and then configure the engine.ini to use it should be a better solution. And the user should not need to check if the address is ipv6, the design of the InetAddress class is to avoid low level operation on a specific protocol.

avatar image zompi2 Feb 21 '18 at 01:55 PM

Hi. I've seen Your solution and it is really nice. Also - your solution should be inside the engine's IpConnection.cpp, because the original one is bugged.

The main issue in the original code is that in LowLevelSend it copies resolved address into 4 bytes uint32, which will completely break everything if the address is ipv6. So, the original code breaks the convention of protocol transparency.

Also, I suggest to check if Your solution works in real live IPv6 environment. When I was working on the solution to this I've been testing it in this nat64 enviro provided by MacOSX and everything worked fine, but in real IPv6 network on mobile device there were still issues.

Also check if this code will still work with connections IPv6->IPv6, IPv4->IPv4 and IPv6->IPv4. Not sure if host resolving is currently right for all situations.

Anyway, realy neat solution :)

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

After read the code and do some test, I finaly make it works. It's the engine bug,
bug you don't need compile from source, I post my solution on github: https://github.com/feixuwu/UE4-IOS-IPV6

more ▼

answered Jan 04 '18 at 01:07 PM

avatar image

301 2 6 21

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question