Internet Protocol Version 4 (IPv4)

A link on a host on an intranet is identified by its IP address. Internet Protocol (IP) is the protocol that is used to deliver datagrams between such hosts. It is assumed the reader is familiar with the TCP/IP protocols. Details of some of the protocols can be found in the TCP/IP Tutorial and Technical Overview. Specific information relating to the Internet Protocol can be found in RFC 791.

An IPv4 address is a 32-bit address that is usually represented in dotted decimal notation, with a decimal value representing each of the four octets (bytes) that make up the address. For example:
    00001001010000110110000100000010        32-bit address
    00001001 01000011 01100001 00000010     4 octets
       9        67       97       2         dotted decimal notation (9.67.97.2)

The IPv4 address consists of a network address and a host address. Within the Internet, the network addresses are assigned by a central authority, the Network Information Center (NIC). The portion of the IPv4 address that is used for each of these addresses is determined by the class of address. There are three commonly used classes of IPv4 addresses (see Figure 1).

Figure 1. Classes of IPv4 addresses
Diagram of three commonly used classes of IPv4 addresses: class A, class B, and class C.

The class of the address is determined by the first octet of the IPv4 address. Figure 2 shows how the class of address is determined. The figure also shows Class D addresses. Class D addresses represent multicast groups, not network IP addresses. Multicast group addresses consist of the high-order, four bits of 1110 and the remaining 28 bits, which form a multicast group ID.

Figure 2. Determining the class of an IPv4 address
    32-bit address           xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx
 
    Class A                  0xxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx
                   min       00000000
                   max       01111111
                   range     1 - 126    (decimal notation; 0 and 127 are reserved)
 
    Class B                  10xxxxxx xxxxxxxx xxxxxxxx xxxxxxxx
                   min       10000000
                   max       10111111
                   range     128 - 191  (decimal notation)
 
    Class C                  110xxxxx xxxxxxxx xxxxxxxx xxxxxxxx
                   min       11000000
                   max       11011111
                   range     192 - 223  (decimal notation)
 
    Class D                  1110xxxx xxxxxxxx xxxxxxxx xxxxxxxx
                   min       11100000
                   max       11101111
                   range     224-239 (decimal notation)
 

As shown in Figure 2, the value of the bits in the first octet determine the class of address, and the class of address determines the range of values for the network and host segment of the IPv4 address. For example, the IPv4 address 9.67.97.2 would be a class A address, since the first two bits in the first octet contain B'00'. The network part of the IPv4 address is 9 and the host part of the IPv4 address is 67.97.2.

See RFC 1166–Internet Numbers for more information about IPv4 addresses. See RFC 1060–Assigned Numbers for more information about reserved network and host IPv4 addresses, such as a network broadcast address.