Dot-decimal notation
Dot-decimal notation is a presentation format for numerical data. It consists of a string of decimal numbers, using the full stop as a separation character.
A common use of dot-decimal notation is in information technology, where it is a method of writing numbers in octet-grouped base-ten numbers. In computer networking, Internet Protocol Version 4 addresses are commonly written using the dotted-quad notation of four decimal integers, ranging from 0 to 255 each.
IPv4 address
Dot-decimal notation is common in the form of dotted-quad notation to represent IPv4 addresses. Dot-decimal notation is a presentation format for numerical data expressed as a string of decimal numbers, each separated by a full stop and represented without any extra leading zeros. For example, the hexadecimal number 0xFF000001 may be expressed in dot-decimal notation as 255.0.0.1.An IPv4 address has 32 bits. For purposes of representation, the bits may be divided into four octets written in decimal numbers, ranging from 0 to 255, concatenated as a character string with full stop delimiters between each pair of numbers. This octet-grouped dotted-decimal format may more specifically be called dotted octet format, and an address so noted a dotted-quad address.
For example, the address of the loopback interface, usually assigned the host name localhost, is 127.0.0.1. It consists of the four octets 01111111, 00000000, 00000000, and 00000001. The 32-bit number is represented in hexadecimal notation as 0x7F000001.
No formal specification of this textual IP address representation exists. The first mention of this format in RFC documents was in RFC 780 for the Mail Transfer Protocol published May 1981, in which the IP address was supposed to be enclosed in brackets or represented as a 32-bit decimal integer prefixed by a pound sign. A table in RFC 790 used the dotted decimal format, zero-padding each number to three digits. RFC 1123 of October 1989 mentions a requirement for host software to accept "IP address in dotted-decimal form", although it notes "his last requirement is not intended to specify the complete syntactic form for entering a dotted-decimal host number". An IETF draft intended to define textual representation of IP addresses expired without further activity.
A popular implementation of IP networking, originating in 4.2BSD, contains a function inet_aton for converting IP addresses in character string representation to internal binary storage. In addition to the basic four-decimals format and 32-bit numbers, it also supported intermediate syntax forms of octet.24bits and octet.octet.16bits. It also allowed the numbers to be written in hexadecimal and octal representations, by prefixing them with 0x and 0, respectively. These features continue to be supported in some software, even though they are considered as non-standard. This means addresses with a component written with a leading zero digit may be interpreted differently in programs that do or do not recognize such formats.
A POSIX-conforming variant of inet_aton, the inet_pton function, supports only the four-decimal variant of IP addresses.
IP addresses in dot-decimal notation are also presented in CIDR notation, in which the IP address is suffixed with a slash and a number, used to specify the length of the associated routing prefix. For example, 127.0.0.1/8 specifies that the IP address has an eight-bit routing prefix, and therefore the subnet mask 255.0.0.0.