|Powered by QM on a Rpi server|
KnowledgeBase 00098: IPV6 Support
This article was originally published as a Tip of the Week.
What is IPV6?
Every device connected to the Internet must have a unique IP address that provides a way to identify the device in much the same way as telephones are assigned numbers. For many years, the Internet has used a protocol known as IPV4 to represent these addresses, usually written as four numbers in the range 0 to 255 separated by periods, e.g. 126.96.36.199.
There are 232 (4,294,967,296) unique values that can be represented in the IPV4 protocol and, despite this being a very large number, the addresses have now all been allocated. Many have been assigned in large blocks for further allocation to individual devices so, although it may appear that new addresses are still being assigned, the pool from which they come is exhausted.
The IPV6 protocol uses a much larger address range that has 2128 possibilities, far more than could ever be required. An IPV6 address is conventionally written as eight groups of four hexadecimal digits though there are address formation rules that often allow the address to be compressed by omitting some elements. See Wikipedia for a full discussion of IPV6.
Using IPV6 in QM
All parts of QM that support Internet style connections can use either IPV4 or IPV6 style addresses. The only change that should be needed within an application is to ensure that anywhere that inputs, displays or stores a network address can handle the longer IPV6 format.
Direct telnet style network entry to QM can be from clients that use either address protocol. Use of QMNet to access files on remote QM servers can use either address style in the SET.SERVER command that defines the server.
The QMBasic socket functions handle all aspects of the IPV4 and IPV6 protocols internally. For example, the OPEN.SOCKET() function can take an address in either form or as a network name to be looked up via a Domain Name Server (DNS).
Because not all operating systems on which QM runs support IPV6 and there is no reliably consistent way to detect support automatically, the default behaviour of QM is to use the older IPV4 style interfaces. If IPV6 is to be used, it must be enabled in the QM configuration parameters by setting the IPV6 parameter value to 1. Doing this on an operating system that does not support IPV6 is likely to cause errors.
For the same reason, the QMClient API adopts IPV4 by default. The QMConnectionType() function provides the ability to enable IPV6 in the client software.