Networking

IPv4

An IPv4 address is composed of four sets of 8 binary bits, which are referred to as octets. The result is that IP addresses are 32 bits in length. Each bit in each octet is assigned a decimal value. The leftmost bit has a value of 128, followed by 64, 32, 16, 8, 4, 2, and 1, left to right.

Each bit in the octet can be either a 1 or a 0. If the value is 1, it is counted as its decimal value, and if it is 0, it is ignored. If all the bits are 0, the value of the octet is 0. If all the bits in the octet are 1, the value is 255, which is 128+64+32+16+8+4+2+1.

By using the set of 8 bits and manipulating the 1s and 0s, you can obtain any value between 0 and 255 for each octet.

Table 1 shows some examples of decimal-to-binary value conversions.

Table 1 Decimal-to-Binary Value Conversions

Decimal Value

Binary Value

Decimal Calculation

10

00001010

8+2=10

192

11000000

128+64=192

205

11001101

128+64+8+4+1=205

223

11011111

128+64+16+8+4+2+1=223


IP Address Classes

IP addresses are grouped into logical divisions called classes. In the IPv4 address space, there are five address classes (A through E), although only three (A, B, C) are used for assigning addresses to clients. Class D is reserved for multicast addressing, and Class E is reserved for future development.

Of the three classes available for address assignments, each uses a fixed-length subnet mask to define the separation between the network and the node address. A Class A address uses only the first octet to represent the network portion, a Class B address uses two octets, and a Class C address uses the first three octets. The upshot of this system is that Class A has a small number of network addresses, but each class A address has a very large number of possible host addresses. Class B has a larger number of networks, but each class B address has a smaller number of hosts. Class C has an even larger number of networks, but each Class C address has an even smaller number of hosts. The exact numbers are provided in Table 2.

Table 2 IPv4 Address Classes and the Number of Available Network/Host Addresses

Address Class

Range

Number of Networks

Number of Hosts per Network

Binary Value of First Octet

A

1126

126

16,777,214

0xxxxxxx

B

128191

16384

65,534

10xxxxxx

C

192223

2,097,152

254

110xxxxx

D

224239

NA

NA

1110xxxx

E

240255

NA

NA

1111xxxx