IP Classes

From Teknologisk videncenter
Jump to: navigation, search


To remain compatible with the existing IP address space and the IP packet structure, the definition of IP addresses was changed in 1981 in RFC 791 to allow unicast addresses with three different sizes of the network number field (and the associated rest field), as specified in the table below:

Class Leading
Size of Network
Bit field
Size of Rest
Bit field
of Networks
per Network
From IP - to IP
Class A     0     8     24     128     16,777,214 -
Class B     10     16     16     16,384     65,534 -
Class C     110     24     8     2,097,152     254 -
Class D (IP Multicast)     1110     not defined     not defined     not defined     not defined -
Class E (reserved)     1111     not defined     not defined     not defined     not defined -

The number of valid host addresses available is always 2N - 2 (where N is the number of bits used, and the subtraction of 2 adjusts for the invalidity of the first and last addresses). Thus, for a class C address with 8 bits available for hosts, the number of hosts is 254.

The larger network number field allowed a larger number of networks, thereby accommodating the continued growth of the Internet.

The IP address netmask, which is commonly associated with an IP address today, was not required because the mask was implicitly derived from the IP address itself. Any network device would inspect the first few bits of the IP address to determine the class of the address.

The method of comparing two IP addresses' physical networks did not change, however (see subnet). For each address, the network number field size and its subsequent value were determined (the rest field was ignored). The network numbers were then compared. If they matched, then the two addresses were on the same network.


Originally, an IP address was divided into two parts:

  • Network ID: first octet
  • Host ID: last three octets

This created an upper limit of 256 networks. As the networks began to be allocated, this was soon seen to be inadequate.

To overcome this limit, different classes of network were defined, in a system which later became known as classful networking. Five classes were created (A, B, C, D, and E), three of which (A, B, and C) had different lengths for the network field. The rest of an address was used to identify a host within a network, which meant that each network class had a different maximum number of hosts. Thus there were a few networks with each having many host addresses and numerous networks with each only having a few host addresses. Class D was for IP Multicast addresses and Class E was reserved.

Around 1993, these classes were replaced with a Classless Inter-Domain Routing (CIDR) scheme, and the previous scheme was dubbed "classful", by contrast. CIDR's primary advantage is to allow re-division of Class-A, -B and -C networks so that smaller (or larger) blocks of addresses may be allocated to various entities (such as Internet service providers, or their customers) or local area networks.

The actual assignment of an address is not arbitrary. The fundamental principle of routing is that the address of a device encodes information about the device's location within a network. This implies that an address assigned to one part of a network will not function in another part of the network. A hierarchical structure, created by CIDR and overseen by the Internet Assigned Numbers Authority (IANA) and its Regional Internet Registries (RIRs), manages the assignment of Internet addresses worldwide. Each RIR maintains a publicly-searchable WHOIS database that provides information about IP address assignments; information from these databases plays a central role in numerous tools that attempt to locate IP addresses geographically.

Reservered address blocks

Reserved address blocks
CIDR address block Description Reference Current network (only valid as source address) RFC 1700 Private network RFC 1918 Loopback RFC 3330 Reserved (IANA) RFC 3330 Link-Local RFC 3927 Private network RFC 1918 Reserved (IANA) RFC 3330 Reserved (IANA) RFC 3330 Documentation and example code RFC 3330 IPv6 to IPv4 relay RFC 3068 Private network RFC 1918 Network benchmark tests RFC 2544 Reserved (IANA) RFC 3330 IP Multicasts (former Class D network) RFC 3171 Reserved (former Class E network) RFC 1700 Broadcast