The International Simutrans Forum

 

Author Topic: Simutrans-Server relisting by IP change  (Read 1075 times)

0 Members and 1 Guest are viewing this topic.

Offline Andarix

  • *
  • Posts: 94
Simutrans-Server relisting by IP change
« on: September 18, 2019, 02:52:35 PM »
If the port IP address of a home-based Simutrans server changes, it will not be transferred to the list server.

The IP is only determined when starting the Simutrans server. Thereafter, this is always transmitted the same even if the connection IP changes.

This means that when the IP of the Simutrans server is changed daily, it will be displayed online for a maximum of 24 hours.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5593
  • Languages: EN, NO
Re: Simutrans-Server relisting by IP change
« Reply #1 on: September 19, 2019, 06:02:11 AM »
A server that changes IP when it is running is asking for trouble. Especially when clients and servers stay connected for a long time. The connection will be broken. (Even clients will have trouble if they change IP in that case.)

Offline Andarix

  • *
  • Posts: 94
Re: Simutrans-Server relisting by IP change
« Reply #2 on: September 19, 2019, 09:21:39 AM »
The local running Simutrans server has no problems. He has a local private IP that does not change. But the external IP of the connection changes. And this external IP is never checked after the start, whether this has changed.

Thus, the running Simutrans server reports the old meanwhile invalid external IP to the list server.

The Simutrans server should additionally check the external IP every 3 or 6 hours. If that changes, then this is to be communicated to the Listserver.

Even when reloading the game as a server game (via GUI - loading dialog), the IP is not redetermined. It is a complete restart of Simutrans needed.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5593
  • Languages: EN, NO
Re: Simutrans-Server relisting by IP change
« Reply #3 on: September 19, 2019, 02:55:04 PM »
He has a local private IP that does not change. But the external IP of the connection changes.
It is the external IP address people will use to connect and communicate, so that is what matters.

The Simutrans server should additionally check the external IP every 3 or 6 hours. If that changes, then this is to be communicated to the Listserver.
I'm not sure how reasonable it is to support a Simutrans server that can't keep connections. A Simutrans server should keep its address for as long at it is running. If it is not stable enough, then it should be started up only for shorter periods during which the IP is stable. Getting kicked out randomly because the IP address changes is not good player experience.

What could make sense is for the listing server to check that servers are alive every few minutes, and de-list those that no longer respond.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9712
  • Languages: De,EN,JP
Re: Simutrans-Server relisting by IP change
« Reply #4 on: September 22, 2019, 01:35:59 PM »
Any private server in Germany (and britain and some other countries) only gets a dynamic IP that changes every 24h hours. They want you to order a fixed one at extra charge. For hosting, this is not really needed though.

Actually, simutrans does this already. Start it with -easyserver on the command line to enable it.

And in r8823 it will also delist the old entry and start a new one.
« Last Edit: September 22, 2019, 01:49:19 PM by prissi »

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5593
  • Languages: EN, NO
Re: Simutrans-Server relisting by IP change
« Reply #5 on: September 22, 2019, 09:02:07 PM »
Any private server in Germany (and britain and some other countries) only gets a dynamic IP that changes every 24h hours. They want you to order a fixed one at extra charge.
Over here, I think they'd lose money if they tried that. DHCP servers seem to default to reusing the IP address you got last time, so they would have to do something extra for those that don't pay. Once in a while, the DHCP server is replaced or something prevents you from renewing the lease before your IP has been repurposed, which means you get a new IP address. It happens so rarely that I think only ISPs targetting businesses offer a guaranteed stable IP address.

With an IP address change every 24 hours, I imagine one would have to keep track of when your IP address is expected to time out, so that you aren't playing multiplayer games when it happens. Or even just downloading or streaming something, unless the client is smart enough to resume properly, which is quite difficult if it is a live stream. Almost like back when I had to remember not to use the Internet at those times of the day when it cost more. (Of course, back then, one would not be using the Internet for more than around 30 minutes per day anyway.)

Offline Andarix

  • *
  • Posts: 94
Re: Simutrans-Server relisting by IP change
« Reply #6 on: September 24, 2019, 06:13:10 AM »
r8826 the annonce is broken for easyserver

I think that's already been the case since r8638/r8639

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9712
  • Languages: De,EN,JP
Re: Simutrans-Server relisting by IP change
« Reply #7 on: September 24, 2019, 12:30:54 PM »
Simutrans has trouble connecting to the listserver on IPv6 enabled networks, since the hoster changed the IPv6 without telling me. Since Simutrans does not try IP4 if IPv6 timeouts, no communication at all and thus no announce.

If this is not the case, the I cannot test it the moment, until Isaac (or whoever is in power) changes the AAAA record of the server.

Offline Andarix

  • *
  • Posts: 94
Re: Simutrans-Server relisting by IP change
« Reply #8 on: September 24, 2019, 05:53:20 PM »
120.4.1 r8600

- start Simutrans and load game as servergame -> listing on listserver

r8826

- start Simutrans and load game as servergame -> not listening on listserver

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9712
  • Languages: De,EN,JP
Re: Simutrans-Server relisting by IP change
« Reply #9 on: October 02, 2019, 02:54:47 AM »
That you, the query for the IP4 did not work if there was a sucessful query for the IPv6 address. Should be fixed in r8830

Offline Andarix

  • *
  • Posts: 94
Re: Simutrans-Server relisting by IP change
« Reply #10 on: October 02, 2019, 07:53:42 AM »
listing works with r8834 again

thanks

Offline Andarix

  • *
  • Posts: 94
Re: Simutrans-Server relisting by IP change
« Reply #11 on: October 03, 2019, 09:24:56 AM »
relisting by ip change works in r8834

thanks

Offline Andarix

  • *
  • Posts: 94
Re: Simutrans-Server relisting by IP change
« Reply #12 on: November 09, 2019, 01:30:31 PM »
r8866

relisting ( listserver ) and reconnect ( Simutrans server ) works