IPv6 support

Place all meeting requests / announcements here...
Post Reply
User avatar
Tim Riker
Maintainer
Maintainer
Posts: 21
Joined: Thu Dec 02, 2004 5:33 pm
Location: USA, Utah, Salt Lake City
Contact:

IPv6 support

Post by Tim Riker »

My fork is currently working for base functionality with BZFlag over IPv6 and IPv4.

https://github.com/BZFlag-Dev/bzflag/pull/323

bzfs can start with -i 0.0.0.0 to run in IPv4 mode, or with -i :: to run in IPv6 mode. IPv6 is the default on my fork.

bzadmin connects to IPv4 or IPv6 instances. bzadmin now has udp+ handshaking. This is mainly for connectivity testing as bzadmin does not do much with anything sent over udp.

bzflag client connects to IPv4 or IPv6 instances.

banlists are now loading/saving correctly, but not applying in all cases. (fixed)

server cache save/load needs work. we should not save/load the ip, just the name:port (fixed)

bzfls should have the server IP removed. Not done yet. (fixed)

There is a pull request to better handle different ips here:

https://github.com/BZFlag-Dev/bzflag-bzfls/pulls

It bases REMOVE on a matching key, and not on the request coming from the correct ip. It add nameport so that tokens are server specific.

This should be ready to apply to prod. It's running on my test instance:

https://my-dev.bzflag.org/db/

Dev sites:

https://www-dev.bzflag.org/
https://forums-dev.bzflag.org/
https://images-dev.bzflag.org/
https://my-dev.bzflag.org/

I can provide server access if anyone is interested in helping with the IPv6 support.
Tim Riker - http://rikers.org/ - Tim@Rikers.org
BZFlag maintainer - http://BZFlag.org/ - for fun!
User avatar
Tim Riker
Maintainer
Maintainer
Posts: 21
Joined: Thu Dec 02, 2004 5:33 pm
Location: USA, Utah, Salt Lake City
Contact:

Re: IPv6 support

Post by Tim Riker »

Marked pull request as ready to merge. v4->v4, v6->v6 and v4->v6 are all working on Linux including banlist support for v4 and v6.

https://github.com/BZFlag-Dev/bzflag/pull/323
Tim Riker - http://rikers.org/ - Tim@Rikers.org
BZFlag maintainer - http://BZFlag.org/ - for fun!
trpted
Private First Class
Private First Class
Posts: 242
Joined: Mon Feb 21, 2005 8:29 pm

Re: IPv6 support

Post by trpted »

Great to hear/read. :)

While I get to get listed in the list server it has to be public IP Address, does the IPv6 Address have to be a public one or can it be any (ex Link-local IPv6 Address? This means for LAN or testing reasons..

Please and thank you
User avatar
Tim Riker
Maintainer
Maintainer
Posts: 21
Joined: Thu Dec 02, 2004 5:33 pm
Location: USA, Utah, Salt Lake City
Contact:

Re: IPv6 support

Post by Tim Riker »

The list server only lists servers that it can reach. It will not list private v4 or private v6 space as it can't reach that, and neither would clients.

I've not tested IPv6 broadcast discovery yet. It might work. IPv4 broadcast discovery does still work.

My bzfls list server changes will allow listing a public ipv6 address by ip. The list server will have to get updated so that it can reach ipv6 only servers. The dev instance will allow registration of v4 or v6 servers by ip, or v4+v6 servers by dns name. List server entry for ipv6 will look like:

Code: Select all

2603:1030:c04:3::2c for default port
[2603:1030:c04:3::2c]:5155 for non-default port
The same format works on the command line for bzadmin and bzflag clients. Special addresses like

Code: Select all

fe80::
will not work as the list server won't be able to reach them. Similarly, firewall rules need to be in place to allow access. The list server will not list a server it can't reach. Debug output should show the host and port that it tried to reach.

With my latest changes, 4v in v6 addresses are shown as if they were v4 native. If the server is listening on

Code: Select all

::
which is the ipv6 any address, then it will accept connections from v6 AND v4 clients. A connection from v4 would look like

Code: Select all

::ffff:a.b.c.d
but it will be shown to admins as

Code: Select all

a.b.c.d
.

If the server is listening on

Code: Select all

0.0.0.0
then it is running ipv4 only.
Tim Riker - http://rikers.org/ - Tim@Rikers.org
BZFlag maintainer - http://BZFlag.org/ - for fun!
trpted
Private First Class
Private First Class
Posts: 242
Joined: Mon Feb 21, 2005 8:29 pm

Re: IPv6 support

Post by trpted »

Let me try that again, if I was not clear.

Assume that someone has IPv6 but not a public one.

Is it possible for someone else who is a client in the same subnet (ex Link-local IPv6 Address) reach the server?

Please and thank you
User avatar
Tim Riker
Maintainer
Maintainer
Posts: 21
Joined: Thu Dec 02, 2004 5:33 pm
Location: USA, Utah, Salt Lake City
Contact:

Re: IPv6 support

Post by Tim Riker »

I have not yet tested this. Broadcast discovery should work for IPv6 like it does for IPv4. The client sends a broadcast packet to the network, and any servers that are running reply.

So, yes. IPv4 clients and servers can find each other on the local network.

IPv6 clients and server should be able to do the same.

This does not use the list server, it uses broadcast packets.
Tim Riker - http://rikers.org/ - Tim@Rikers.org
BZFlag maintainer - http://BZFlag.org/ - for fun!
User avatar
Tim Riker
Maintainer
Maintainer
Posts: 21
Joined: Thu Dec 02, 2004 5:33 pm
Location: USA, Utah, Salt Lake City
Contact:

Re: IPv6 support

Post by Tim Riker »

IPv4 broadcast discovery does still work. If a server has both v4 and v6 connectivity, clients doing broadcast discovery will connect over v4.

IPv6 lan/broadcast/multicast discovery is not working. One would have to put the IPv6 server IP on the command line and then connections would work.

We probably need to msg ff02::1 if we detect IPv6 support.

The list server does handle public v4 and/or v6 servers.
Tim Riker - http://rikers.org/ - Tim@Rikers.org
BZFlag maintainer - http://BZFlag.org/ - for fun!
trpted
Private First Class
Private First Class
Posts: 242
Joined: Mon Feb 21, 2005 8:29 pm

Re: IPv6 support

Post by trpted »

Ok, thank you.

I have more questions.

#1 About https://my-dev.bzflag.org/db, there are two entries.

a) Why is 127.0.0.1 listed / what is that about?

b) After the version ID (ex BZFS0225) but before 127.x.x.x is that long series of letters and numbers. Is that the IPv6 Address?

c) Why no sepration? Ex 2001:0db8:85a3:0000:0000:8a2e:0370:7334

d) If mistaken that long series of numbers after the version ID but before the 127.x.x.x is not IPv6, are you going to make a publicly listed server use IPv6?

#2 Where is the code to download:

https://github.com/BZFlag-Dev/bzflag/tree/master

OR

is it https://github.com/timriker/bzflag/tree/timriker

??

Please and thank you
User avatar
blast
General
General
Posts: 4930
Joined: Fri Mar 21, 2003 3:49 pm
Location: playing.cxx
Contact:

Re: IPv6 support

Post by blast »

If you're talking about in the LIST action having the 127.0.0.1, that's just for compatibility. The list server has historically included the game server's IP address in the LIST response, but now that we're going to be having multiple IP addresses per server (such as one IPv4 and one IPv6) it didn't make sense to have that. To avoid breaking older clients, that 127.0.0.1 placeholder is included unless the protocol is specified as one that knows it is excluded.

The long hex string is not the IPv6 address. That's the game info string, which has information such as player counts/limits, game mode, and game settings. Game servers should publish under hostnames, not IP addresses. My plan is to require a host name to get a server key in the future.

The code to test right now would be in the https://github.com/timriker/bzflag repo under the timriker branch.

Code: Select all

git clone --branch=timriker https://github.com/timriker/bzflag bzflag-ipv6
"In addition to knowing the secrets of the Universe, I can assure you that I am also quite potty trained." -Koenma (Yu Yu Hakusho)

Image
User avatar
Tim Riker
Maintainer
Maintainer
Posts: 21
Joined: Thu Dec 02, 2004 5:33 pm
Location: USA, Utah, Salt Lake City
Contact:

Re: IPv6 support

Post by Tim Riker »

I changed one of the servers to be listed by IP. This is what it would look like if a server has an IPv6 address but no DNS name. As @blast mentions, this is NOT what we want. We'd expect a server operator to get a DNS name that would point to both the IPv4 and IPv6 addresses for the server. My patches to the list server support server by ip both for IPv4 and IPv6, but I strongly prefer that people get a DNS name.

Someday the BZFlag servers might support encryption. Certificates would need to match a DNS name. Certificate authorities will not grant certificates to IPs.

If you don't supply a version string, you get this:

https://my-dev.bzflag.org/db/?action=LIST

will show:

Code: Select all

2603:1030:c04:3::2c BZFS0225 000100da000500010032006400fa00000c000c000c000c000c000c00c8 127.0.0.1 HiX dev testing
one.bzflag.org:5155 BZFS0225 000100da000500010032006400fa00000c000c000c000c000c000c00c8 127.0.0.1 HiX dev testing
however, for newer clients, they would include a newer version number as something like:

https://my-dev.bzflag.org/db/?action=LI ... n=BZFS0225

and get back:

Code: Select all

2603:1030:c04:3::2c BZFS0225 000100da000500010032006400fa00000c000c000c000c000c000c00c8 HiX dev testing
one.bzflag.org:5155 BZFS0225 000100da000500010032006400fa00000c000c000c000c000c000c00c8 HiX dev testing
Notice that they no longer get the unused IP address after the hexencoded server details.

This same format is what can be passed on the bzflag or bzadmin command lines.

Code: Select all

2603:1030:c04:3::2c
is a server at that ip on the default port, and

Code: Select all

[2603:1030:c04:3::2c]:5155
is on a custom port. A list server reply with a custom port would look like:

Code: Select all

[2603:1030:c04:3::2c]:5155 BZFS0225 000100da000500010032006400fa00000c000c000c000c000c000c00c8 HiX dev testing
@blast pointed to my repo. I think it's ready to merge in to upstream, however, I have NOT yet compiled it for anything other than Linux.

My changes will need my list server pull request applied first. That pull request should work with all existing clients and servers already, but obviously we've not tried it yet.
Tim Riker - http://rikers.org/ - Tim@Rikers.org
BZFlag maintainer - http://BZFlag.org/ - for fun!
User avatar
blast
General
General
Posts: 4930
Joined: Fri Mar 21, 2003 3:49 pm
Location: playing.cxx
Contact:

Re: IPv6 support

Post by blast »

I still think that IPv6 addresses should always be contained within square brackets in situations where a port might be included, so if we allow bare IPv6 addresses to publish, I'd rather see:

Code: Select all

[2603:1030:c04:3::2c] BZFS0225 000100da000500010032006400fa00000c000c000c000c000c000c00c8 127.0.0.1 HiX dev testing
As an example in other software, web browsers require square brackets around an IPv6 address even if you're not providing a port number.
"In addition to knowing the secrets of the Universe, I can assure you that I am also quite potty trained." -Koenma (Yu Yu Hakusho)

Image
trpted
Private First Class
Private First Class
Posts: 242
Joined: Mon Feb 21, 2005 8:29 pm

Re: IPv6 support

Post by trpted »

I think I found it.

REF https://github.com/timriker/bzflag/tree/feature_ipv6

About REF https://github.com/timriker/bzflag/blob ... /ChangeLog

Says nothing, unless I am missing it, about IPv6 in the release notes. That would help...
User avatar
blast
General
General
Posts: 4930
Joined: Fri Mar 21, 2003 3:49 pm
Location: playing.cxx
Contact:

Re: IPv6 support

Post by blast »

No, that's not the correct branch. That's the "feature_ipv6" branch. I said it's the "timriker" branch. And are you really going to complain about a ChangeLog not being updated on an experimental branch? Look at the code changes itself or test the code. We can worry about the ChangeLog when it's ready to merge/release.
"In addition to knowing the secrets of the Universe, I can assure you that I am also quite potty trained." -Koenma (Yu Yu Hakusho)

Image
trpted
Private First Class
Private First Class
Posts: 242
Joined: Mon Feb 21, 2005 8:29 pm

Re: IPv6 support

Post by trpted »

blast wrote: Fri Apr 21, 2023 9:07 pm We can worry about the ChangeLog when it's ready to merge/release.
While that will be fine, I am just wondering why that is.

Please and thank you
Post Reply