The IP address is 32 bits in length. The actual format of the address is dependent on what class of address is used. The format of the address is actually in three parts:
Class, NET ID and HOST ID
The class determines how many bits are used for the net id and the host id. The valid classes are A, B, C, D and E. When applying for registered IP addresses you must ask for the class you wish to use.
Choosing a class
When dealing with IP addresses it is important to recognise which class of address you are dealing with. This is because the class of address determines the number of bits used to represent the NET ID and the HOST ID. To determine the class of a particular address you must work at the bit level. The first bits of an address determine the class of address.
Dotted Decimal Notation
Although you need to work at the bit level to find the class of address it is not feasible to deal with bits for addresses. Because bits are not reasonable the dotted decimal notation is used.
The 32 bit address is divided into 4 lots of 8 bits. Each number has a range of 0 to 255. (2 to the power of 8 is 256).
Example numbers are therefore
When dealing with IP addresses it is important to be able to work out the class of an address in order to determine which network id and which host id the address refers to. To find the class of a particular address take the first number and write it in binary. Then compare the binary bit pattern with the patterns overleaf to determine the class of address.
Some addresses are not allowed to be used as IP addresses for hosts. The first is Network ID 127. This Network ID is reserved for internal loopbacks. Other reserved IP addresses concern all ones or all zeros. No constituent part (net id or host id) of the IP address for a host may be all ones or all zeros.
The general rule is
1s mean ALL
0s mean THIS
The following is a table of special addresses and their meanings