TCP/IP Addressing
As we have already noted, a TCP/IP address consists of four decimal numbers, separated by a dot, eg: 192.168.1.20. TCP/IP addresses are written in dotted-decimal format for ease of use, but they are really 32-bit binary numbers, eg: the binary equivalent of 192.168.1.20 is 11000000.10101000.00000001.00010100.
Certain IP addresses are reserved for specific functions:
- 255.255.255.255 is reserved for network broadcasts.
- 127.0.0.1 is reserved as a loopback address for testing the IP address configuration of the local host computer.
- the address ranges 192.168.x.y, 172.16.0.0 to 172.31.255.255 and 10.0.x.y are reserved as nonroutable, meaning that they restricted to internal use on LANs and cannot be used on the Internet.
The addressing scheme traditionally used for IP addressing is known as Classful IP Addressing and uses three address classes, A, B and C, each of which uses a different the number of bits for the class prefix. The following table shows the different classes and the corresponding prefix ranges:
If you want to get a range of IP addresses, you will need to contact an Internet Service Provider (ISP). When you do this, you'll probably find that you can't get your own Class B range. Instead you'll get part of a Class B range.
When a Classful IP address range is broken down into smaller pieces, you need to use a variable-length subnet mask (VLSM). The standard subnet masks used with the Classful IP ranges are as follows:
Class A: 255.0.0.0
Class B: 255.255.0.0
Class C: 255.255.255.0
However, if you want to use only part of the address class range, you need to alter the standard subnet mask. Consider the case where we wish to break up a Class C range into several smaller ranges. A typical Class C range contains 254 host IP addresses. Most small companies don't need 254 addresses, so they will use a VLSM to break up the range and create smaller pools of IP addresses. For example, if a company needed only 50 IP addresses, they could use a subnet mask of 255.255.255.192 with a Class C range of IP addresses. This subnet mask would break up the original Class C range and create four IP address ranges containing 62 IP addresses each.