Tuesday, July 26

Counting Binary Bits


Before we proceed on any class address we must first know how to count binary, the 8 bits for each group. IP address composed of four groups which are separated by a dotted decimal. For example, we will use the private address “192.168.1.1” then convert to binary number...

The result will be “11000000.10101000.00000001.00000001”. This is what our NIC (network interface card) does their job by reading the binary and handle important data-conversion to the network.

NIC – a PC device installed to each computer including the servers which provides connectivity between the PC and the network’s physical medium.

By reading the binary number it is hard to understand without calculation and knowing how to count the bits. In each bit represents a multiple of two (1, 2, 4, 8, 16, 32, 64, 128). However, we count the bits in opposite direction 128 to 1 because the first bit is 128.

See example below. 11000000 is equal to 192:



Binary Numbering System

In the binary numbering system, the radix is 2. Therefore, each position represents increasing powers of 2. In 8-bit binary numbers, the positions represent these quantities:

2^7 2^6 2^5 2^4 2^32^2 2^1 2^0

128 64 32 16 8 4 2 1

The base 2 numbering system only has two digits: 0 and 1.

When we interpret a byte as a decimal number, we have the quantity that position represents if the digit is a 1 and we do not have that quantity if the digit is a 0, as shown in the figure.

1 1 1 1 1 1 1 1

128 64 32 16 8 4 2 1

A 1 in each position means that we add the value for that position to the total. This is the addition when there is a 1 in each position of an octet. The total is 255.

128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255

A 0 in each position indicates that the value for that position is not added to the total. A 0 in every position yields a total of 0.

0 0 0 0 0 0 0 0

128 64 32 16 8 4 2 1
0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 = 0



Notice in the figure that a different combination of ones and zeros will yield a different decimal value.

Sunday, July 24

First Octet Bit for Address Class


When configuring TCP/IP, we generally work with network addresses in dotted decimal and not in binary, but it's pretty easy to see the ranges that correspond to the class address or class addresses. For example, using class B. The first two bits of the first octet are “10”. The remaining bits can be change to one, for us to determine the its range. This is represented as “10xx xxxx”. Thus, the binary range for the first octet can be from “1000 0000” to “1011 1111”. This is 128 to 191 in decimal. So, in the “classful” scheme, any IP address whose first octet is from 128 to 191 is a class B address.


Below example, I have shown the bit patterns of each of the five classes, and the way that the first octet ranges can be calculated.


IP Address Class

Class A
0xxx xxxx - total 1
0111 1111 - total 127

range: 1 to 127

Class B
10xx xxxx
1000 0000 - total 128
1011 1111 - total 191

range: 128 to 191

Class C
110x xxxx
1100 0000 - total 192
1101 1111 - total 223

range: 192 to 223

Class D
1110 xxxx
1110 0000 - total 224
1110 1111 - total 239

range: 224 to 239

Class E
1111 0000 - total 240
range: 240 to 254


note: Class D and Class E are reserved and not usable. It was meant for multicasting and research.

Also take notes that most of the ip address above are public ip addresses. To determine the private ip address are the following:

Class A

range: 10.0.0.0 to 10.255.255.255

Class B

range: 172.16.0.0 to 172.31.255.255

Class C

range: 192.168.0.0 to 192.168.255.255

These private ip address is what we used on our LAN network.