3. Standard IP to X.121 Address Mapping
This section describes the algorithm that should be used to convert IP addresses to X.121 addresses [1]. You will note that "h" is always listed as greater than or less than the number 64. This number is used to differentiate between PSN physical and logical host port addresses. Note that at the time of this writing, the DDN does not make use of the PSN's logical addressing feature, which allows hosts to be addressed independently of their physical point of attachment to the network.
3.1. Derivation of DDN X.25 Addresses
To convert a Class A IP address to a DDN X.25 address:
3.1.1. If the host field (h) is less than 64 (h < 64)
The address corresponds to the following DDN X.25 physical address:
ZZZZ F III HH ZZ (SS)
where:
ZZZZ = 0000
F = 0 because the address is a physical address;
III is a three decimal digit representation of "i", right-adjusted and padded with leading zeros if required;
HH is a two decimal digit representation of h", right-adjusted and padded with leading zeros if required;
ZZ = 00 is optional.
(SS) is an optional Sub-Address field which is ignored in the DDN. This field is either left out or filled with zeros.
The address 26.9.0.122 corresponds to the DDN X.25 physical address 000001220900.
3.1.2. If the host field (h) is greater than or equal to 64 (h >= 64)
The address corresponds to the following DDN X.25 physical address:
ZZZZ F RRRRR ZZ (SS)
where:
ZZZZ = 0000
F = 1 because the address is a logical address;
RRRRR is a five decimal digit representation of the result "r" of the calculation
r = h * 256 + i
(note that the decimal representation of "r" will always require five digits)
ZZ = 00
and
(SS) is optional.
The address 26.83.0.207 corresponds to the DDN X.25 logical address 000012145500.
3.2. For Class B IP addresses
The "h" and "i" fields will ALWAYS consist of 8 bits each taken from the REST field of the Internet address. The mapping follows the same rules as in 3.1.
3.3. For Class C IP addresses
The "h" and "i" fields will ALWAYS consist of 4 bits each taken from the REST field of the Internet address. The mapping follows the same rules as in 3.1.