Why is IPv4 called classic addressing

IPv4 addressing on the Internet

The content of this chapter includes general information on the network classes and describes the IP subnetwork method according to the IPv4 method. Every network node, in most cases a computer, can be identified in the network where it is located by its unchangeable, unique MAC address. Data exchange within this one network would thus be possible. If the communication partner is in a different network, knowledge of the MAC address is not sufficient to establish the connection. Addressing on the Internet takes place via the IP address, which is made up of the network address and the system or host address. The addressing is explained for the still existing and used IPv4 Internet protocol.

Each network interface, which also includes network cards, network printers or routers, is assigned a unique IP address. The IPv4 address consists of a 32-bit binary number that is combined into four 8-bit groups, the octets. They are converted into easier-to-read decimal numbers and separated by dots in dotted-decimal notation.

The binary IP address 10100011 11000010 10011000 00101111
corresponds to decimal with a point

Network classes

In the first model of the Department of Defense (DoD), the first 8 bits of the IP address indicated the network number and the following 24 bits indicated the host or subscriber numbers. It was assumed that only a few networks would be required. With this procedure one could only address 256 networks. With newer RFCs, the address space was first divided into three and later into five network classes. They are identified by the letters A, B, C, D, E. This network class system existed from 1981 to 1993 and was expanded from 1985 to include the subnetting process. From 1993 it has been replaced by the classless CIDR procedure.

Following the development, there is an overview of the network classes here. All class A networks have a 0 in the highest bit. It is the class bit or prefix of the network class. This is followed by the network ID with 7 bits. The prefix and network ID form the first octet in the class A network. The remaining three octets with 24 bits belong to the host ID. Class-A networks are assigned to very large organizations.

Class B networks have the bit sequence 10 as the class bit, followed by the network ID with 14 bits. The first two octets or 2 bytes form the network address. The remaining two octets with 16-bit host IDs are available. Class-B networks can be found in medium-sized networks.

Class C networks begin with 110. The network ID is 21 bits long and includes three octets with the class bit. The last octet with 8 bits remains for the host IDs. Class-C networks are used in smaller networks.

The table shows the purely theoretical figures for the first three classes. The valid network numbers are each 2 lower and are calculated as follows:

The number of networks in a class: Network bits  −  2
The number of hosts per network class: Host bits −  2

The valid network numbers and host numbers for classes A, B and C are listed in the following table. Over 4 billion IP addresses are available for Internet connections based on the IPv4 protocols.

The decimal digit of the first octet determines the network class. Network components only interpret binary values ​​and require a mask to recognize the network and evaluate the IP address. It consists of a 32-bit long binary digit, which is easy to read for us as groups of four dotted decimally, separated by dots. The last 24 bits remain set to logic 0 in the network mask for Class-A. With Class-B the last 16 bits are binary 0 and for Class-C the last 8 bits remain binary 0. The corresponding decimal notation of the standard mask is entered in the top table.

Reserved address areas

  • The IP address is reserved for the host itself until a valid IP address has been obtained.
  • 127.x.x.x are referred to as localhost and as network-internal loop addresses,
    the so-called loop back is used.
  • The addresses,, and are reserved
  • to with the mask is a private Class-A network.
    A total of 16777214 hosts can be addressed.
  • to with the mask is a class B network.
    It is used for link local with APIPA.
  • to with the mask contains 16 private Class-B networks.
    65534 hosts can be addressed each.
  • to with the mask has 256 private Class-C networks.
    Each network includes up to 254 hosts.

By reserving the private address areas, every organization can structure its internal networks very flexibly. Conflicts with the public IP addresses for Internet connections are avoided. The routers of the Internet service providers discard the data with these addresses and do not pass them on.

Class D and E networks are intended for special tasks. Class D begins with 1110 as the highest bit sequence. This is followed by a 28-bit long identifier, the multicast group ID. The address range is calculated from to

Network class E has the class bit sequence 1111. With the subsequent 28 bits, an address range of to is calculated. This network class is reserved for future applications and experiments.

IP subnet procedure

The network classes shown above can be divided into many smaller areas using the subnetwork method. The class rules according to Class-A, Class-B and Class-C are basically retained. Each physical network that belongs to one of these classes can thus be divided into further logical networks, the subnets. Mutual overlapping of the subnets must not take place.

Within a subnet, only the network nodes can exchange data directly with one another. The data traffic between the logical networks and the subnets is carried out using a routing process. The data exchange between the physical networks is also based on a routing method, which is completely independent of the routing between the logical networks. To the outside world, the router only needs the address of the next subnet and has no knowledge of the hosts active there. Subnets are only known locally, as the link with the subnet mask is only made in the router.

In the case of the subnet procedure, the 32-bit long IP address is assumed and is no longer bound to the rigid byte boundaries of the network classes. Each subnet mask begins with a closed block of binary 1 states, which is followed by a block of binary 0 states until all 32 bits are set. The IP address is logically ANDed bit by bit with the subnet mask. The result is a network number and a host part. The following example shows the relationships:

  • If the bit is set in the subnet mask, the corresponding bit of the IP address is part of the network address.
  • If the bit in the subnet mask is not set, the corresponding bit of the IP address belongs to the host part.

As before, the IP address can be entered using the mask notation or the shorter prefix or length notation is used. For prefix notation, the successive binary 1 states are added up in the subnet mask and appended to the IP address with a slash. The prefix notation of the example address is then: / 24

The following table shows all useful subnet masks, the appropriate prefix and the maximum usable number of hosts that are possible with the respective mask. The number of hosts that can theoretically be calculated from the bit pattern is 2 greater. As will be explained below, two of the host numbers are reserved and cannot be assigned.

Number of hosts and subnets

The subnet procedure reduces the host part in favor of the network part. The network part in the address is still determined by the class rule. The host part results from the binary 0 sequence of the mask used. The subnet part is the rest that remains with the 32 bits. The following applies to the mathematical calculation:

Subnet bits = 32 - (network bits + host bits).

The IP address stands for a class A network, as the first octet ranges from 1 ... 126. So 8 bits belong to the network. The mask has a 16-bit long 0-sequence and thus 16 host bits. 8 subnet bits remain.

The IP address is synonymous with and the mask belongs to the Class-C network. The first octet comprises decimal 192 ... 223 and according to the class rule there are 24 network bits. With the prefix notation 27, 5 host bits remain, which can be read from the binary 0 sequence of the mask. From 32 - (24 + 5) 3 subnet bits are calculated.

In the dotted decimal notation of the subnet mask there are only nine valid decimal values, which can be followed by further .0 digits. This fact follows from the uninterrupted binary 1 sequence in the mask read from the left. The conversion of the last octet with binary 1 and 0 values ​​leads to the valid decimal values:

There is a restriction on the total number of subnets and hosts that can actually be used. According to the conventions for assigning IP addresses, two subnets per network and two hosts per subnet cannot be used. This includes the zero subnet, where all subnet bits are set to binary 0, and the broadcast subnet, where all bits are set to binary 1. Many routers can use these addresses, but both cases are considered "discouraged" and we do not recommend using them. The two addresses where only binary 0-sequences or binary 1-sequences occur in the host part are reserved and cannot be freely assigned under any circumstances. The number of subnets and hosts are calculated as follows:

Subnets = 2Number of subnet bits − 2 With Hosts per subnet = 2Number of host bits − 2

If you want to work with IP addresses, the following points can be helpful. The following table then shows some examples:

  • Recognize the structure of the IP address; Mask notation or prefix notation.
  • Detection of the network part according to the rules of the network class.
  • Determine the host size from the number of binary 0s in the mask.
  • Calculate the subnetwork bits from the mathematical remainder of 32 - (network bits + host bits).
  • Calculate the number of subnets.
  • Calculate the number of hosts on each subnet.

The subnet number and the IP address in the subnet

To determine it, the IP address is logically ANDed bit by bit in its binary representation with the binary mask. The result of the link is converted back to the dotted decimal representation. The whole octet is always converted into a decimal number, even if binary 1 and 0 states occur.

The subnet broadcast address

The subnet broadcast address is required to send data packets to all network nodes in the subnet at the same time. Knowing this address makes it very easy to specify the highest valid IP address in the subnet. All host bits in the subnet number are converted to a binary 1. The determination can be seen from the example of the IP address

The subnet broadcast address in binary representation is identical to the subnet number, only that all host bits are set to binary 1. The binary representation can be derived bit by bit from the subnet number and the inverted mask, which are then logically ORed. The following example shows the process for IP

The range of valid IP addresses in the subnet

The first valid IP address is the subnet number for which the last bit is set to 1 in the 32-bit representation. The last valid IP address is the broadcast address, where the last bit is 0 in 32-bit notation. In the dotted decimal representation, the last decimal number is decreased by 1.