Creating a Mapping Between a TCP/IP Host and One or More IP Addresses

Use the TCPIP MAPPING command to create a mapping between a TCP/IP host name or domain name and one or more IP addresses. If the mapping is host name to IP address, the host is assumed to be in the local domain.

This command will not create a route on the host. If a specific route is required, the route must be added via the TCPIP ROUTE command.

Enter the following from your system console:

NW TCPIP MAPPING + <tcp/ip hostname> <ip address> [,<ip address>]

If the command is successful, you receive the following response:

<TCPIP hostname> MAPPED TO <ip address> [,<ip address>]

How the System Resolves a TCP Host Name

If no mapping is defined for a TCP host name in the TCP host name table, then SYSTEM/RESOLVER is called to resolve this TCP host name. SYSTEM/RESOLVER calls the TCPIPSUPPORT library to request rankings of all IP addresses configured with that TCP host name.

Each IP address is given a rank value based on the criteria indicated in the following table. The value 0 is the highest rank.

Value

Criteria

0

A local direct route. a. In the Local Subnet 1. Learned by OI 2. Learned by Resolver b. Not in the Local Subnet 1. Learned by OI 2. Learned by Resolver

1

An indirect route added with an OI command.

n

An IP route metric associated with a learned route.

250

No route specified; a default route exists.

256

No route specified; no default route exists.

You should use the RESOLVER configuration file to assign the loopback host name to 127.0.0.1 and ::1 if sockets applications are expected to resolve “local host” to one of these addresses.

Note: For information on how to configure hosts in the Resolver, refer to the TCP/IP Distributed Systems Services Operations Guide.

If a program opens a port file and one or more port subfiles with a certain description, including specific values for the MYNAME, YOURNAME, and YOURDOMAINNAME file attributes, TCPIPSUPPORT tries to find a matching IPAddress for the value assigned to the YOURDOMAINNAME attribute. If a Hostname/IPAddress pairing is not configured via the NW TCPIP MAPPING command, then TCPIPSUPPORT passes the value assigned to the YOURDOMAINNAME attribute to SYSTEM/RESOLVER to obtain the IPAddress associated with the specified YOURDOMAINNAME attribute.

If SYSTEM/RESOLVER does not find a match in its cached data for the YOURDOMAINNAME attribute value and there is a domain name server configured, SYSTEM/RESOLVER requests information from the domain name server. When the Hostname/IPAddress pairing is returned to SYSTEM/RESOLVER and caching is set, SYSTEM/RESOLVER caches the returned information and passes the corresponding IPAddress to TCPIPSUPPORT. If caching is not set, the corresponding IPAddress is passed to TCPIPSUPPORT, but the information is not stored by SYSTEM/RESOLVER.

The Hostname/IPAddress pairing is then stored in the mapping table of the TCPIPSUPPORT library. This information can be displayed via the NW TCPIP MAPPING inquiry command. Since the information is stored in the TCPIPSUPPORT library, the call to SYSTEM/RESOLVER is not necessary for any subsequent programs using this YOURDOMAINNAME value, unless the entry in the mapping table has been aged.

Note: For information on aging, see “Aging of Learned Host Name/IP Address Pairings” found later in this section.

How the System Determines Reachability of Remote Multi-Homed Hosts

In a remote multi-homed environment, an internal PING request is sent to each IP address of the remote host. When a successful PING reply is received, a reachable flag associated with that IP address is set. The IP address that is chosen is the first IP address with the reachable flag set for that remote host name.

Example

Given the following entry in the mapping table:

HOST1.SOME.BIG.COM MAPPED TO 1.2.3.4, 10.12.13.14, 10.12.13.15

An internal PING request is sent to all three IP addresses but only two of the addresses, 10.12.13.14 and 10.12.13.15, return a positive response to the request. The IP address 10.12.13.14 is chosen because it is the first address in the list of IP addresses with the reachable flag set. If all the PING requests fail, the host is marked unreachable.

Dynamic Association of Host Name/IP Address Information

The TCP/IP provider retains the host name/IP address information acquired from a domain name server when a connection is established. The acquired information is then assigned to the appropriate subport attributes associated with the connection. These attribute values can then be used by the application. For example, Telnet can create a specific station name.

The YourHost attribute is set to the leftmost element of the fully specified domain name provided; it is 17 characters or less. The YourDomainName attribute is assigned to the specified domain name.

Once a host name/IP address pairing is established, subsequent connectivity will use this pairing. You can use the following command to remove learned pairings:

NW TCPIP MAP - LEARNED

Example

Assume the following host name/IP address pairing is defined in the domain name server:

HOST1.SOME.BIG.COM 192.10.1.5

The following port file attributes are assigned when you initiate a Telnet session to 192.10.1.5, HOST1, or HOST1.SOME.BIG.COM:

  • YourHost becomes HOST1. Note that YourHost is updated if it is 17 characters or less.

  • YourDomainName becomes HOST1.SOME.BIG.COM. YourDomainName is always updated.

  • YourIPAddress becomes 192.10.1.5

The host name/IP address pairing is stored in the mapping table. Use the NW TCPIP MAP inquiry to view these mappings. For this example, the following response would be returned:

HOST1.SOME.BIG.COM MAPPED TO 192.10.1.5 [LEARNED]
Note: The information provided in this section explains how subport attributes are updated by the TCP/IP product. Note that existing port applications which do not explicitly set these attributes will not have them automatically reset when the subfile closes.For example, an application defines a passive subport without setting the YOURHOST attribute to NULL. Prior to opening the connection, TCP/IP learns the hostname (for example, HOST1) from a Domain Name Server and updates the YOURHOST attribute with HOST1. When the connection closes, and because the attribute is not reset, the YOURHOST attribute is maintained as HOST1. Therefore, subsequent connections will only be successful from HOST1. To ensure that any host will be able to use this port, the applications should explicitly set the YOURHOST attribute to NULL in the port definition.

Using the TCP Host Names Defined in the Mapping Table as Telnet Station Names

The station name for incoming Telnet sessions default to the format IP1_2_3_4/<station #>. However, if the TCP Host is statically configured via the NW TCPIP MAPPING command, the station name will contain the TCP Hostname instead. Alternatively, if the TCP Host is dynamically “learned” from Resolver (or from a DNS), the format of the Telnet station name is controlled by the Telnet STATION_NAME CONVERTIPADDRESS option.

For example, the NW TCPIP MAPPING (TCPIP MAP) inquiry yields the following:

HOST1.SOME.BIG.COM MAPPED TO 192.10.1.5
HOST2.SOME.BIG.COM MAPPED TO 192.10.1.6 [LEARNED]
  • Incoming Telnet sessions from 192.10.1.5 will have the station name of HOST1/<station #>.

  • Incoming Telnet sessions from 192.10.1.6 will have the station name of IP192_10_1_6/<station #> or HOST2/<station #> depending on the setting of CONVERTIPADDRESS.

For more information on Telnet Station Naming or an example of an IPv6 conversion, refer to the Telnet STATION_NAME option in the TCP/IP Distributed Systems Services Operations Guide.

Aging of Learned Host Name/IP Address Pairings

A 60-minute timer is used to delete learned entries in the host name table. When the timer expires, the host name table is searched for learned entries not currently in use or used within the last 60 minutes.

  • Existing dialogs are not interrupted by the aging algorithm.

  • When a new dialog is initiated, reachability information is learned.