[Rseding91] [1.1.30] NatPunchRequest not sent unless a multiplayer game has been hosted first

This subforum contains all the issues which we already resolved.
Post Reply
Hornwitser
Fast Inserter
Fast Inserter
Posts: 116
Joined: Fri Oct 05, 2018 4:34 pm
Contact:

[Rseding91] [1.1.30] NatPunchRequest not sent unless a multiplayer game has been hosted first

Post by Hornwitser »

While looking into NAT punching I noticed the following weird behavior:

If you start the game and go directly to the public server list, click on servers and try to connect one no NatPunchRequest messages are sent by the client.

If you start the game and choose "Host new game" that is publicly visible, let it run for a few seconds before exiting, and after that go browse the public server list then the client sends NatPunchRequest messages for each server you click on and before each connection attempt to a server.

I don't think this is how it's supposed to work.

Rseding91
Factorio Staff
Factorio Staff
Posts: 11809
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [1.1.30] NatPunchRequest not sent unless a multiplayer game has been hosted first

Post by Rseding91 »

Hornwitser wrote:
Tue Apr 06, 2021 9:58 pm
If you start the game and go directly to the public server list, click on servers and try to connect one no NatPunchRequest messages are sent by the client.
That is intended. Nat punching is only relevant for the host and it's design is to keep the port open on the host side so client packets reach the host. The act of sending packets from the client to the server is itself nat-punching on the client side.
Hornwitser wrote:
Tue Apr 06, 2021 9:58 pm
If you start the game and choose "Host new game" that is publicly visible, let it run for a few seconds before exiting, and after that go browse the public server list then the client sends NatPunchRequest messages for each server you click on and before each connection attempt to a server.

I don't think this is how it's supposed to work.
That doesn't sound intended. The nat-punch sending should stop as soon as the server has been quit.
If you want to get ahold of me I'm almost always on Discord.

Hornwitser
Fast Inserter
Fast Inserter
Posts: 116
Joined: Fri Oct 05, 2018 4:34 pm
Contact:

Re: [1.1.30] NatPunchRequest not sent unless a multiplayer game has been hosted first

Post by Hornwitser »

diagram.png
diagram.png (14.86 KiB) Viewed 882 times
This diagram shows for the packet labeled 1. how NatPunchRequest is sent by the client in 0.16.51. When sent in this manner nat punching works.

In 1.1.30 NatPunchRequest is not sent unless you first host a game. If NatPunchRequest packets are not sent then nat punching will not work. Nat punching is therefore highly relevant to the client, if the client doesn't send a NatPunchRequest to your ping pong server that is then forwarded to the target server then no nat punching can take place.

Rseding91
Factorio Staff
Factorio Staff
Posts: 11809
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [1.1.30] NatPunchRequest not sent unless a multiplayer game has been hosted first

Post by Rseding91 »

I think you're misunderstanding part of what nat punching is/does. The ping-pong servers don't relay anything; they simply reply to the packet sent to them with the IP they got the packet on.

So in that regard: the ping-pong server only talks with the computer that sent it the packets. It never sends anything to other computers.
If you want to get ahold of me I'm almost always on Discord.

Hornwitser
Fast Inserter
Fast Inserter
Posts: 116
Joined: Fri Oct 05, 2018 4:34 pm
Contact:

Re: [1.1.30] NatPunchRequest not sent unless a multiplayer game has been hosted first

Post by Hornwitser »

And I think you don't understand how nat punching works. But the good news is that it actually functions in 0.16.51, so I've put together this demonstration video for you that shows the ping pong servers does relay nat punch requests contrary to what you're saying, and that this relaying is integral to making nat punching work.

https://youtu.be/08u9eD7Iieo

Rseding91
Factorio Staff
Factorio Staff
Posts: 11809
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [1.1.30] NatPunchRequest not sent unless a multiplayer game has been hosted first

Post by Rseding91 »

After talking with one of my co-workers I believe it's time for me to eat-crow as the saying goes and admit I was wrong. I'll be looking into this more and seeing if I can figure out what's going on.
If you want to get ahold of me I'm almost always on Discord.

Rseding91
Factorio Staff
Factorio Staff
Posts: 11809
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [Rseding91] [1.1.30] NatPunchRequest not sent unless a multiplayer game has been hosted first

Post by Rseding91 »

Ok, it's now fixed for the next release.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Resolved Problems and Bugs”