An IP address is composed of 32-bit string of 0’s and 1’s. Thus, 192.168.0.1 is a valid 32-bit IP address. These strings of 0 and 1 are called bits, and there are eight (8) strings of bit in 1 byte, and an octet has the equivalent of 8 bits or 1 byte.
How an IP address became a 32-bit?
A 32-bit IP address has four (4) set of combined octets that has a total of, or equivalent to 32-bits. In a given example, 192 represent as the first octet, and 168 is the second octet, and 0 is the third octet, and 1 represent as the last and fourth octet in a 32-bit IP address. Therefore, the combination of four octets would give us a value of 32 bits because each octet has a value of 8 bits.
Thus,
octet 1 + octet 2 + octet 3 + octet 4 = 32 bits
How does an octet have decimal value?
Each octet contains 8 digits of either 0 or 1 that represent each bit as switches that can produce an absolute value of 255 in decimal form.
Example 1:
Binary Decimal
11111111 = 255
Example 2:
Binary Decimal
00000000 = 0
In Example 1, we can see eight digits of one’s (1) that represent all bits (switches) are “ON.” On the other hand, in Example 2, we can see that the result given in decimal is equivalent to 0, which means that all the values that represents to a corresponding bit is “OFF.”
What are the values for each corresponding bits in an octet or byte?
Now, we understand that there are 8 bits in an octet or byte. Each of these bits has corresponding value that is constant for each bit as illustrated in Example 3.
Example 3:
Digits in 1 octet = 1 1 1 1 1 1 1 1
Values for each bit = 128 , 64, 32, 16, 8, 4, 2, 1
Therefore, if we apply this illustration to validate the values in 192.168.0.1 IP address, and we will be able to see how these switches is related with the decimal values for each octet in our example 192.168.0.1 IP address.
Illustration for the 1st octet
11000000 = 192
or
128 + 64 + 0 + 0 + 0 + 0 + 0
= 128 + 64
= 192
Illustration for the 2nd octet
10101000 = 168
or
128 + 0 + 32 + 0 + 8 + 0 + 0 + 0
= 128 + 32 + 8
= 168
Illustration for the 3rd octet
00000000 = 0
or
0 + 0 + 0 + 0 + 0 + 0 + 0 + 0
= 0
Illustration for the 4th octet
00000001 = 1
or
0 + 0 + 0 + 0 + 0 + 0 + 0 + 1
= 1