Ping and FTP Resolve IP Address with Leading Zero as Octal

This article was previously published under Q115388
This article has been archived. It is offered "as is" and will no longer be updated.
SUMMARY
Windows for Workgroups with TCP/IP-32 and Windows NT utilities can acceptInternet Protocol (IP) addresses comprised of decimal, octal, orhexadecimal numbers. This can cause confusion if you unintentionally use aleading zero in a decimal octet. With a leading zero, the number isresolved by these utilities as an octal number, thus specifying the wrongIP address.
MORE INFORMATION
Many TCP/IP programs such as Ping and FTP use the inet_addr() socketsfunction to translate IP address strings into 4-byte addresses. Thisfunction accepts an IP address in standard decimal, octal, and hexadecimalnotation, such that the following IP address examples are acceptable toPing and FTP and resolve to the same IP address:

   22.101.31.153 (decimal)   026.0145.037.0231 (octal)   0x16.0x65.0xF1.0x99 (hexadecimal)   0x16.101.037.153 (a combination of all three number systems)				


If you unintentionally enter a leading zero in an octet, the IP addressthat Ping and FTP resolve is not the same as you intended, as in thefollowing example (using Ping):

   In Windows NT 3.1:      c:\>ping 022.101.31.153      Pinging host 022.101.31.153 (unnamed) : 18.101.31.153      ICMP Echo Reply:TTL 32      ICMP Echo Reply:TTL 32      ICMP Echo Reply:TTL 32      ICMP Echo Reply:TTL 32      Host 022.101.31.153 replied to all 4 of the 4 pings   In Windows NT 3.5:      c:\>ping 022.101.31.153      Pinging 18.101.31.153 with 32 bytes of data:      Ping succeeded: 32 bytes time=10ms TTL=32      Ping succeeded: 32 bytes time=10ms TTL=32      Ping succeeded: 32 bytes time=10ms TTL=32      Ping succeeded: 32 bytes time=10ms TTL=32				


NOTE: In this example, 022.101.31.153 is resolved by Ping to be18.101.31.153 decimal, not 22.101.31.153 decimal.

This results in either a successful (shown above) or unsuccessfulverification of the wrong IP address, depending on whether the resolved IPaddress is a valid IP address in your network environment.

Windows NT 4.0 Enterprise Cluster Administrator will give the followingerror if you specify an ip address to connect to the cluster with leadingzeroes on the decimal octet, you may get the following error:

"A connection to the cluster at "022.101.31.153" could not be opened. Thismay be caused by the customer on node "022.101.31.153" not being started.Would you like Cluster Administrator to attempt to start the ClusterService on node "022.101.31.153"."



To avoid an address being incorrectly resolved, it is recommended that youcheck for and remove leading zeros, unless an octal number is intended.

The following utilities also exhibit this behavior:

PING
FTP
TELNET
Internet Explorer (IE)
Microsoft Cluster Adminitrator
Microsoft Cluster Setup Wizard

prodnt mscs server cluster
Properties

Article ID: 115388 - Last Review: 12/04/2015 10:13:25 - Revision: 2.4

Microsoft Windows 2000 Server, Microsoft Windows 2000 Advanced Server, Microsoft Windows 2000 Professional Edition, Microsoft Windows NT Advanced Server 3.1, Microsoft Windows NT Workstation 3.1, Microsoft Windows NT Advanced Server 3.1, Microsoft Windows NT Workstation 3.5, Microsoft Windows NT Workstation 4.0 Developer Edition, Microsoft Windows NT Server 3.5, Microsoft Windows NT Server 4.0 Standard Edition, Microsoft TCP/IP-32 for Windows for Workgroups 1.0, Microsoft Windows for Workgroups 3.2, Microsoft Windows NT Server 4.0 Enterprise Edition, Microsoft Cluster Server 1.1

  • kbnosurvey kbarchive kbproductlink kbclustering kbnetwork KB115388
Feedback