Internet Addressing

Each host on a TCP/IP network is assigned a unique 32-bit IP address consisting of a network number and a host number. The network number identifies a specific network, and must be assigned by the Internet Network Information Center (InterNIC) or an accredited registrar. An Internet Service Provider (ISP) can obtain blocks of network addresses from InterNIC and can assign addresses as necessary. The host number identifies a host on a network and is assigned by the network administrator. The IP address is grouped into four binary octets (an octet is a group of eight bits) and is represented using dotted decimal notation. The minimum value for an octet is 0, and the maximum value is 255. The basic format is illustrated below.

The basic format of an IP address

The basic format of an IP address

IP addressing supports five address classes - A, B, C, D, and E, of which only classes A, B, and C are available for commercial use. The following table illustrates the IP address classes.

IP Address Classes
ClassFormatPurposeAddress rangeMax hosts
AN.H.H.HA few large organisations1.0.0.0 -,777,214
BN.N.H.HMedium-size organisations128.1.0.0 -,534
CN.N.N.HRelatively small organisations192.0.1.0 -
DN/AMulticast groups (RFC 1112) -
EN/AExperimental240.0.0.0 -

(N = Network number, H = Host number)

The diagram below illustrates the format of the commercial IP address classes.

The format of the commercial IP address classes

The format of the commercial IP address classes

The address class can be determined using the following table. For example, IP address has a first octet of 172, which falls between 128 and 191, so is a Class B address.

Determining the Address Class
ClassFirst octetHigh-order bits
A1 - 1260
B128 - 19110
C192 - 223110
D224 - 2391110
E240 - 2541111

Note that addresses beginning with 127 are used by some systems for special purposes. Note also that addresses with all zeros in the host part of the address refer to the network itself, and addresses ending in 255 are not used to refer to individual hosts on the network, since they are considered to be broadcast addresses.

IPv6 addresses are typically composed of a 64-bit network prefix, and a 64-bit host part. The host part may be automatically generated from the interface's MAC address, or assigned sequentially. IPv6 addresses are normally written as eight groups of four hexadecimal numbers. A group consisting solely of zeros can be omitted. For example, 2001:0db8:85a3:0000:1319:8a2e:0370:1337 can be shortened to 2001:0db8:85a3::1319:8a2e:0370:1337. Note, however, that there must be only one double colon in an address. Leading zeros in a group can also be omitted, so the addresses below are all valid and equivalent to each other: