.
What is an IP Class ?
.
An IP Class is a range of IP addresses. They have been designed to provide an address sheme which accomodates small and large networks.
.
There are 5 Classes from A to E defined as follows:
Class A - first byte is 1 to 126 decimal (0xxxxxxx in binary)
Class B - first byte is 128 to 191 decimal (10xxxxxx in binary)
Class C - first byte is 192 to 223 decimal (110xxxxx in binary)
Class D - first byte is 224 to 239 decimal (1110xxxx in binary)
Class E - first byte is 240 to 254 decimal (1111xxxx in binary)
.
IANA allocates only Class A to Class C addresses. Class D is reserved for multicast and Class E for future use.
Adresses begining by 127 (01111111) are reserved for loopback or local testing. The IP 127.0.0.1 is usually implemented as local host loopback IP.
.
For each IP Class we also define a Network Mask as follows:
Class A - 255.0.0.0 (11111111.00000000.00000000.00000000 in binary)
Class B - 255.255.0.0 (11111111.11111111.00000000.00000000 in binary)
Class C - 255.255.255.0 (11111111.11111111.11111111.00000000 in binary)
.
The Network part of the IP address is deduced by operating a binary AND between the IP address and the Network Mask of the Class. The binary AND will let "as-is" all binary values combined with "1"s and will zero all others (see "Binary operators").
For example, for Class A:
IP address : aaaaaaaa.bbbbbbbb.cccccccc.dddddddd
Network mask: 11111111.00000000.00000000.00000000
Binary AND --------------------------------------
Network : aaaaaaaa.00000000.00000000.00000000
.
The Host part of the IP address is deduced by operating a binary AND between the IP address and the Network Mask of the Class inversed (binary NOT).
For example, for the same Class A:
IP address : aaaaaaaa.bbbbbbbb.cccccccc.dddddddd
Network mask inversed: 00000000.11111111.11111111.11111111
Binary AND --------------------------------------
Host : 00000000.bbbbbbbb.cccccccc.dddddddd
.
From this comes:
Class A - the first byte codes the Network ("n"s) and the 3 last bytes are the Host ("h"s) : nnnnnnnn.hhhhhhhh.hhhhhhhh.hhhhhhhh
Class B - the fist two bytes codes the Network ("n"s) and the 2 last bytes are the Host ("h"s) : nnnnnnnn.nnnnnnnn.hhhhhhhh.hhhhhhhh
Class C - the fist three bytes codes the Network ("n"s) and the last bytes are the Host ("h"s) : nnnnnnnn.nnnnnnnn.nnnnnnnn.hhhhhhhh
.
Here is a summary of number of networks and number of hosts per Class:
Class A - 2^7-2 = 126 networks - 2^24-2 = 16777214 hosts

Class B - 2^14-2 = 16382 networks - 2^16-2 = 65534 hosts
Class C - 2^21-2 = 2097150 networks - 2^8-2 = 254 hosts
.
.

.

Copyright (c) 2002 - Guillaume Péan
www.shunsoft.net