Will max ever support ipv6?

BlitzMax Forums/BlitzMax Programming/Will max ever support ipv6?

EdzUp MkII(Posted 2016) [#1]
At the moment it looks like it only has the outdated ipv4 protocol (int) and no v6.

On the whole it would be a much better idea to try to implement it ASAP if it's possible.

Does ng support it?


Derron(Posted 2016) [#2]
Does ng support it?


I doubt it:
bmx-ng/brl.mod or pub.mod contain fixes to add compatiblity with NG or use new features but the network features are untouched concerning ipv6

maxmods/brl.mod or pub.mod could contain enhancements to vanilla bmx, but do not contain changes to IPv4 / IPv6.


Dunno if there are modules taking care of it.

"Enet" could be enhanced to support IPv6 via some not-yet-merged-pull-requests:
https://github.com/lsalzman/enet/pull/21
https://github.com/csm/enet
https://github.com/freeminer/enet/tree/ipv6

This would allow "gnet" to utilize IPv6.
All other modules would need adjustments too (things being able to handle protocols and IP-addresses)


bye
Ron


Brucey(Posted 2016) [#3]
It might... I started work on adding support to it in NG's modules...


Brucey(Posted 2016) [#4]
Half the problem is that the built-in APIs, look like this :
Function HostIps:Int[]( HostName$ )
Function HostIp( HostName$,index=0 )
Function HostName$( HostIp )
Function DottedIP$( ip )

which appear to make one or two assumptions about what an IP address is.


EdzUp MkII(Posted 2016) [#5]
Yeah I think the int part is the problem as a four byte value only gives the standard ipv4 stuff.


Derron(Posted 2016) [#6]
There are two options (imho):

- rename all of these base functions so "using code" needs to get adopted properly
- keep these functions returning ipv4 addresses (even if invalid for WAN-IPv6-only) and add ipv6-variants + convenience accessors which return objects (TIPAdress with fields ipv4 and ipv6)


Dunno with which ideas others come up with.


bye
Ron


skidracer(Posted 2016) [#7]
Stupid question, how do you ping an IPv6 address such as ::1 , it doesn't seem to work on OSX or Linux with and without square brackets (which Chrome requires).



mac mini

lo 00:00:00:00:00:00 127.0.0.1
lo 00:00:00:00:00:00 ::1
eth0 06:7e:97:62:92:4e 172.31.23.240
eth0 06:7e:97:62:92:4e fe80::47e:97ff:fe62:924e

aws server (linux)

lo0 00:00:00:00:00:00 ::1
lo0 00:00:00:00:00:00 127.0.0.1
lo0 00:00:00:00:00:00 fe80::1
en0 c8:2a:14:33:8b:df fe80::ca2a:14ff:fe33:8bdf
en0 c8:2a:14:33:8b:df 192.168.1.106




Ignore MAC address, but still scratching my head with how to read IPv6 addresses.


skidracer(Posted 2016) [#8]
ping6 ::1 seems to work so all good. Maybe adding a 6 to all the BlitzMax commands is the way to go for the IPv6 versions?


Derron(Posted 2016) [#9]
appending "4" or "6" is okay as long as the expected return value of the default function is a ipv4-thing.

For _me_ this would be ok (what skid suggested), as you will have to code some portions of your apps nonetheless (eg. a manual IP input with limited length)



bye
Ron


col(Posted 2016) [#10]
but still scratching my head with how to read IPv6 addresses.


ipv6 addresses are 128bit and use 8 x 16bit values represented as hex value and are separated by a single colon ':' between each value. There are some shortcuts that are allowed, they are

1. if a value begins with 0's they can be removed - so 0020 can become just 20, and 0000 with become 0
2. if you have an address that has 0 values you allowed to use a double colon '::' to omit that entry. If you have consecutive values of 0 you also use the same '::' to omit all of those 0 values. But you can only have one '::' in an address.

Using the shortcuts above you can get the following

an address of 0000:0000:0000:1234:abcd:fedc:98ce:03a1 can be shortcut to ::1234:abcd:fedc:98ce:3a1,
and an address of 1234:0578:0000:0000:0000:0000:00bd:0123 can be shortcut down 1234:578::bd:123.

To expand back out to get the full 8 x 16bit hex values ( full address representation ) is simple enough. Start on the left until you get to the double colon, then work your back from the right until you get to the double colon. The values that will be left in the middle will all be 0000...

Using one of the addresses that you listed above

fe80::ca2a:14ff:fe33:8bdf in full is fe80:0000:0000:0000:ca2a:14ff:fe33:8bdf


Hope it helps :p


col(Posted 2016) [#11]
oh yeah and ::1 ( 0000:0000:0000:0000:0000:0000:0000:0001) is the loopback address same as the ipv4 127.0.0.1

There are other ranges that are used for certain things - again similar in nature to the ipv4 numbering system. For eg the first value of fe80 is local network linking, which you can see in your post too as the local ipv6 addresses.