IPv4 addresses are 32 bits long, normally written as 4 octets in dotted decimal: a.b.c.d (each octet 0–255).
Example: 192.168.1.10 = four 8-bit numbers.
2. IPv4 Address Classes
To organize networks efficiently, IPv4 addresses were historically divided into classes. These classes help define thenetwork portion and host portion of the address. Here’s a breakdown:
Class
First Octet Range
Default Mask
Host Bits
Hosts per Network
Special Use
A
0 – 127
255.0.0.0
N=8, H=24
~16.7 million
Very large networks
B
128 – 191
255.255.0.0
N=16, H=16
65,534
Medium networks
C
192 – 223
255.255.255.0
N=24, H=8
254
Small networks
D
224 – 239
N/A
Reserved
-
Multicast traffic
E
240 – 255
N/A
Reserved
-
Experimental / research
3. Binary Refresher (Bit Weights)
Each octet has 8 bit positions with weights:
128 64 32 16 8 4 2 1 (left to right).
To convert a decimal octet to binary: subtract the largest weight that fits, mark a 1, continue.
Remaining weights (32,16,8,4,2,1) are all > 0 remainder → bits = 0.
So binary = 11000000.
4. The Network vs Host Concept
IPv4 addresses are divided into:
Network portion – identifies the network.
Host portion – identifies the device (host) on that network.
Which bits are network and which are host depends on the subnet mask. Subnet masks look like this:
Or in binary:
The 1s cover the network bits.
The 0s cover the host bits.
💖 Support Our Work
If you find this post helpful and would like to support my work, you can send a donation via TRC-20 (USDT). Your contributions help us keep creating and sharing more valuable content.