IP Address Structure

Class A: 0nnnnnnn hhhhhhhh hhhhhhhh hhhhhhhh netid (7bits), hostid (24 bits).
Class B: 10nnnnnn nnnnnnnn hhhhhhhh hhhhhhhh netid (14 bits), hostid (16 bits).
Class C: 110nnnnn nnnnnnnn nnnnnnnn hhhhhhhh netid (21-bits), hostid (8 bits).
Class D: 1110mmmm mmmmmmmm mmmmmmmm mmmmmmmm Multicast group 28 bits.

Class E addresses are reserved for future use.

Subnet Masks

Subnet masks are used to separate an IP address into netid, subnetid and hostid by masking out the hostid. For example:

IP Address: 192.168.216.244 (0xC0A8D8F4)
Net Id: 192 (0xC0)
Subnet Mask: 255.255.255.0 (0xFFFFFF00)
Host Id: 244 (0x000000F4)
Subnet Id: 168.216 (0x00A8D800)

Another example:

IP Address: 192.168.216.244 (0xC0A8D8F4)
Net Id: 192 (0xC0)
Subnet Mask: 255.255.255.192 (0xFFFFFFC0)
Host Id: 52 (0x00000034)
Subnet Id: 168.216.192 (0x00A8D8C0)

Special Addresses

Address elements that resolve to all 1 bits are broadcast addresses.

Net Id 0 is reserved for BOOTP.

References


Author: Stewart Smith
Last update: 27th October 2009
©Copyright: Pentagon Computer Consultants Ltd 2003-9.