12. Communication Layer#
This chapter describes the methods and protocols involved in establishing a connection between a client application and an Altibase database server.
Communication Protocol#
A network protocol is a set of rules that governs the communication between computers on a network. This section describes the communication protocols that can be used by an Altibase database server and client applications.
- TCP/IP
- Unix Domain Socket
- IPC using Shared Memory
- IPCDA
- SSL/TLS
TCP/IP#
Transmission Control Protocol/Internet Protocol (TCP/IP) is an industry-standard networking protocols used to build the global internet. TCP is a protocol for exchanging data reliably and directly between two network hosts. IP is a protocol used for communicating data across packet-switched networks.
Altibase supports both Internet Protocol Version 4 (IPv4) and Internet Protocol Version 6 (IPv6). IPv6 addresses the problem currently afflicting IPv4, which is the exhaustion of addresses for connecting computers or hosts on the Internet. IPv6 has a very large address space, because an IPv6 address consists of 128 bits, as compared to 32 bits in IPv4.
For more information about IPv6, please refer to the Internet Protocol Version 6 (IPv6) Specification, RFC 2460.
IPv6 Address Notation#
IPv6 addresses are denoted by eight groups of 16-bit hexadecimal quartets, separated by colons (:).
The following is an example of a valid IPv6 address:
2001:cdba:0000:0000:0000:0000:3257:9652
Any four-digit group of zeroes within an IPv6 address may be reduced to a single zero, or may even be omitted altogether. Therefore, the following IPv6 addresses are equivalent notations:
2001:cdba:0000:0000:0000:0000:3257:9652
2001:cdba:0:0:0:0:3257:9652
2001:cdba::3257:9652
The URL for the above address will be of the form:
http://[2001:cdba:0000:0000:0000:0000:3257:9652]/
Altibase supports the standard IPv6 address notation specified by RFC2732. When connecting to an Altibase database server, the IPv6 address must be enclosed between a left square bracket([) and a right square bracket(]).
The following are examples of valid IPv6 addresses in Altibase:
[::1]
[2002:c0a8:101:1:216:e6ff:fed2:7aea]
$ isql -s [2002:c0a8:101:1:216:e6ff:fed2:7aea] -u sys
In the case of a link-local address that begins with FE80, a zone index is appended to the address, separated by a percent sign (%). The zone index is the index for the interface to which the link-local address is assigned.
In Linux systems, a link-local address needs to be qualified with a zone index in order to connect to an Altibase server. (The exception is JDBC applications, for which this is not required.) An example of such a zone index is shown below:
[fe80::221:86ff:fe94:f51f%eth0]
$ isql -s [fe80::221:86ff:fe94:f51f%eth0] -u sys
IP Stack#
A host may have one of a variety of different protocol stacks1 installed. There are three types of IP hosts, which differ based on their ability to support the two protocols.
[Table 12-1] Types of IP Hosts
IPv4-only host | A host having only an IPv4 stack installed. An IPv4-only host cannot understand IPv6 addresses. |
IPv6/IPv4 host | A host having a dual stack installed, thus supporting both IPv4 and IPv6. |
IPv6-only host | A host having only an IPv6 stack installed. An IPv6 only host does not support IPv4. |
IPv6 Client/Server Connectivity#
Network connectivity
refers to establishing a connection and communication between two or more computers over a network.
The following table shows the protocol versions that can be used for communication between a server and client for different combinations of hosts having different protocol stacks. Supported (v6) means that the client/server hosts have protocol stacks that support IPv6, and that they can connect to other hosts using the IPv6 interface.
[Table 12-2] IPv6 Client/Server Connection
IPv4-only Server | Dual-Stack Server | IPv6-only Only | |
---|---|---|---|
IPv4-only Client | Supported (v4) | Supported (v4) | Not supported |
Dual-Stack Client | Supported (v4) | Supported (v4, v6) | Supported (v6) |
IPv6-only Client | Not supported | Supported (v6) | Supported (v6) |
IPv6 Support in Altibase#
Support for IPv5 by the components of Altibase has outlined above in the table in the previous IPv6 Client/Server Connectivity section.
Server#
To support IPv6, the NET_CONN_IP_STACK property in the altibase.properties file must be set to 1 or 2. For more detailed information about that property, please refer to the General Reference > Chapter 2. Altibase Properties.
Client#
To connect using IPv6, the DSN attribute must be set to an IPv6 address, or the DSN attribute must be set to a host name and the PREFER_IPV6 attribute must be set to TRUE.
For a given host name, Altibase clients attempt to connect to all IP addresses returned by a call to getaddrinfo() until a successful connection is established, or until all addresses have been attempted. If more than one IP address is returned, Altibase clients attempt to establish a connection to each of those IP addresses in an order determined in consideration of the PREFER_IPV6 attribute. If the PREFER_IPV6 attribute is not set, or if it is set to FALSE, an attempt is first made to connect to any IPv4 addresses that were returned. If this attempt fails, the client then attempts to connect to any IPv6 addresses that were returned. If the PREFER_IPV6 attribute is set to TRUE, an attempt is first made to connect to any IPv6 addresses that were returned. If this attempt fails, the client then attempts to connect to any IPv4 addresses that were returned.
For more detailed information about the PREFER_IPV6 attribute, please refer to CLI User's Manual.
Unix Domain Socket#
On UNIX platforms, when both the client and database server is installed on a single machine, Unix domain sockets can be used for communication. Using UNIX domain sockets realizes better performance than when using TCP/IP. To use UNIX domain sockets, the CONNTYPE for ODBC/CLI and the ISQL_CONNECTION environment for the Altibase utilities must be set.
For more detailed information, please refer to the CLI User's Manual and to the manuals for the respective utilities.
IPC using Shared Memory#
This section describes the inter-process communication (IPC) using shared memory provided by Altibase, that is to, how to exchange data between concurrently running processes is delineated as well in this section. When the client and Altibase database server are installed on the same machine, the client application will implement much-advanced performance when using this communication method. IPC using shared memory provides the best performance, however, it uses additional memory. In order to use the IPC method, the following details should be executed first:
- Configure the server property in the altibase.properties file. Refer to the General Reference > Chapter 2. Altibase Properties > Session Properties.
- Specify CONNTYPE attribute in ODBC/CLI application program, and specify ISQL_CONNECTION environment in Altibase utilities, such as iLoader and iSQL. Refer to the CLI User's Manual for in-depth information.
IPCDA#
IPCDA (Inter Process Communication Direct Attach), similar to IPC, exchanges data between the client and database server by using shared memory. IPCDA simplifies reading and writing data, and it raises the performance quality by reducing idle time between the client and server rather than IPC.
It should be noted that, as constraints, IPCDA can be only used in Linux, and in common with IPC, CLI, and ODBC is supported but JDBC is not supported. In addition, LOB data cannot be used when using IPCDA.
The following configurations should be executed prior to use IPCDA:
- IPCDA related server properties should be specified in altibase.properties file. Please refer to General Reference > Chapter 2. Altibase Properties for in-depth information on each property.
- IPCDA_CHANNEL_COUNT
- IPCDA_FILEPATH
- IPCDA_DATABLOCK_SIZE
- Specify CONNTYPE attribute in ODBC/CLI application program. Please refer to the CLI User's Manual for more detailed information
SSL/TLS#
Altibase implements the SSL/TLS protocol, which uses a systematic key algorithm to encrypt and decrypt data and an asystemtic algorithm to securely exchange a pair of public and private keys for authentication.
The SSL/TLS feature of Altibase has the following characteristics.
- Secure access to the Altibase server is based on the OpenSSL API developed by the OpenSSL project. The OpenSSL project supports the SSL 2.0 / 3.0 and TLS 1.0, 1.2, and 1.3 protocols, including a general cryptographic library.
- Altibase supports server-only authentication and mutual authentication.
- In order to support SSL communication in the Altibase server, a separate service port is required in addition to the existing TCP port.
- In order to use SSL communication with the server, both ALTIBASE_PORT_NO and ALTIBASE_SSL_PORT_NO must be defined as environment variables.
- Altibase provides the JDBC and ODBC interfaces for SSL connection.
For more detailed information about how to configure and implement SSL/TLS in Altibase, please refer to the Altibase SSL/TLS User's Guide.
-
The term
protocol stack
refers to the software implementation of a networking protocol suite. ↩