IP addresses are broken into 4 octets (IPv4) separated by dots called
dotted decimal notation. An octet is a byte consisting of 8 bits. The IPv4
addresses are in the following form:
192.168.10.1
There are two parts of an IP address:
The various classes of networks specify
additional or fewer octets to designate the network ID versus the host ID.
|
||||||||||||||||||||||||||||||||||||
Class A-E networks
The addressing scheme for class A through E networks is shown below. Note: We use the 'x' character here to denote don't care situations which includes all possible numbers at the location. It is many times used to denote networks.
Network Type
|
Normal Netmask
|
Comments
|
|
Class A
|
001.x.x.x to 126.x.x.x
|
255.0.0.0
|
For very large networks
|
Class B
|
128.1.x.x to 191.254.x.x
|
255.255.0.0
|
For medium size networks
|
Class C
|
192.0.1.x to 223.255.254.x
|
255.255.255.0
|
For small networks
|
Class D
|
224.x.x.x to 239.255.255.255
|
Used to support multicasting
|
|
Class E
|
240.x.x.x to 247.255.255.255
|
RFCs 1518 and 1519 define a system called Classless Inter-Domain Routing (CIDR) which is used to allocate IP addresses more efficiently. This may be used with subnet masks to establish networks rather than the class system shown above. A class C subnet may be 8 bits but using CIDR, it may be 12 bits.
There are some network addresses reserved for private use by the Internet Assigned Numbers Authority (IANA) which can be hidden behind a computer which uses IP masquerading to connect the private network to the internet. There are three sets of addresses reserved. These address are shown below:
- 10.x.x.x
- 172.16.x.x - 172.31.x.x
- 192.168.x.x
Other reserved or commonly used addresses:
- 127.0.0.1 - The loopback
interface address. All 127.x.x.x addresses are used by the loopback
interface which copies data from the transmit buffer to the receive buffer
of the NIC when used.
- 0.0.0.0 - This is
reserved for hosts that don't know their address and use BOOTP or DHCP
protocols to determine their addresses.
- 255 - The value of 255
is never used as an address for any part of the IP address. It is reserved
for broadcast addressing. Please remember, this is exclusive of CIDR. When
using CIDR, all bits of the address can never be all ones.
To further illustrate, a few examples of valid and invalid addresses are listed below:
- Valid addresses:
- 10.1.0.1 through
10.1.0.254
- 10.0.0.1 through
10.0.0.254
- 10.0.1.1 through
10.0.1.254
- Invalid addresses:
- 10.1.0.0 - Host IP
can't be 0.
- 10.1.0.255 - Host IP
can't be 255.
- 10.123.255.4 - No
network or subnet can have a value of 255.
- 0.12.16.89 - No Class
A network can have an address of 0.
- 255.9.56.45 - No
network address can be 255.
- 10.34.255.1 - No
network address can be 255.
Sometimes you may see a network interface card (NIC) IP address specified in the following manner:
192.168.1.1/24
The first part indicates the IP address of the
NIC which is "192.168.1.1" in this case. The second part
"/24" indicates the netmask value meaning in this case that the first
24 bits of the netmask are set. This makes the netmask value 255.255.255.0. If
the last part of the line above were "/16", the netmask would be
255.255.0.0.