gtpc1m2p | Transmission Control Protocol/Internet Protocol |
A TPF complex can have many different host names. For example, you can assign a different host name to each TPF application. Each of these TPF host names can be associated with one or more local IP addresses. DNS support enables the TPF system to be a DNS server for the host names that reside in your TPF complex.
When a remote client wants to start a connection with a TPF server application across a TCP/IP network, the client needs to get the IP address of the server. Typically, this is done by the client application issuing the gethostbyname function call, passing the host name of the server application as input. The request will be sent to the local DNS server of the client, which in turn will communicate with remote DNS servers to obtain the requested information. The request will eventually flow into the TPF system and be processed by the TPF DNS server code. This code will look up the requested host name in the TPF host name file, select one of the available IP addresses assigned to that host name (which also determines which TPF host will get this connection), and send the response to the DNS query back to the client.
In the DNS hierarchy, you must define the TPF system as the authoritative DNS server for all the host names in your TPF complex. This way, requests for information about TPF host names will be sent to the TPF system. Responses sent by the TPF system always indicate that the information should not be cached. This forces subsequent requests for the same host name to flow into TPF as well. This enables load balancing of TCP/IP connections to be done by the TPF system because every request for a connection to TPF flows into TPF. If information is cached by remote DNS servers or clients, the information can become out of date (for example, if an IP address fails). Another problem with allowing remote nodes to cache information is that load balancing would be very difficult to control because the decision for which TPF host a socket is assigned to is not centralized in one place.
The TPF DNS server will only respond to queries for host names that reside in the TPF system. The TPF DNS server is designed to load balance TCP/IP connections in your TPF complex. It cannot be used to manage host names external to the TPF system.
The TPF host name table is created from information you define in the /etc/host.txt file that must be created in the basic subsystem (BSS). Each line in the file contains a TPF host name followed by zero or more local IP addresses that can be used for connections with this host name. If you do not specify any local IP addresses, all local IP addresses are candidates for use for connections with that host name. The same local IP address can be assigned to multiple host name entries. Blank characters are the only delimiter characters allowed in the file between a host name and an IP address, or between IP addresses. Host names in the file can contain a wildcard character, which you can use only at the beginning of the host name. For example, *.tpf.com is a valid host name but tpf.*.com is not. You can also specify a host name that contains only a wildcard character. This entry will meet the criteria for any host name that is received, so you must place the entry last in the file; otherwise, all host name entries after the entry with the wildcard character will never be selected. Host names in the file can be lowercase or uppercase characters, but when the file is copied into the TPF host name table (THNT), they are converted to all uppercase characters.
The following shows an example of a TPF host name file:
Buytickets.com 1.1.1.2 1.1.2.6 1.1.4.9 Overcharge.org US.SPEEDTRAPS.COM 111.111.111.111 NYR1940.org 1.1.2.6 2.2.2.222 res0.tpf.com 1.1.1.1 *.tpf.com 3.3.3.3 4.4.4.4
The following shows an example of a TPF host name file that is coded incorrectly. In this example, host name res0.tpf.com will never be selected because host name *.tpf.com will be found first. The first matching host name in the TPF host name table will be the one selected even if there is a more exact match later in the table.
Buytickets.com 1.1.1.2 1.1.2.6 1.1.4.9 Overcharge.org *.tpf.com 3.3.3.3 4.4.4.4 US.SPEEDTRAPS.COM 111.111.111.111 NYR1940.org 1.1.2.6 2.2.2.222 res0.tpf.com 1.1.1.1
The TPF host name table is created from the /etc/host.txt file. If you update the /etc/host.txt file, the TPF host name table is automatically refreshed in 1 minute after the update is made. You do not need to stop and restart the TPF DNS server to use information in the updated file.
When a DNS request is received, the TPF host name table is examined to find the host name entry that matches the DNS request. If no match is found, the TPF system will reject the DNS request.
Once the TPF host name table entry is located, the DNS server code will construct a list of local IP addresses that are candidates for the answer to this DNS request. Initially, the list contains all the IP addresses listed in the TPF host name table entry. Next, the list is compacted so that only active IP addresses remain. For example, the TPF host name table entry could indicate that IP addresses X, Y, and Z are candidates; however IP address Y resides on a TPF processor that is not active. Only IP addresses X and Z then remain in the list.
After the final list has been constructed, the action to take is based on how many IP addresses are in the list:
If the UDNS user exit is called, the input includes the TPF host name and the list of local IP addresses that can be used. Each IP address in the list also includes the CPU on which that IP address is active. The UDNS user exit does one of the following:
If the TPF system selects the IP address, a round-robin algorithm is used.