- Address Conversion Functions
- Allocating IP Addresses
- Manipulating IP Numbers
- What's Next
Allocating IP Addresses
You learned how Internet addresses are classified in the previous section. IP addresses are allocated to various individuals and groups by an organization known as the InterNIC. However, some ranges of IP addresses have been set aside for private use, and still others are reserved for special uses.
Private IP Numbers
Normally, IP numbers must be registered by the InterNIC at rs.internic.net. (Prior to April 1, 1993, this was handled by the NIC at nic.ddn.mil.) However, if your system is not directly connected to the Internet, you do not need to have a globally unique address. You can use "private" IP numbers instead.
The first question that immediately follows, then, is "What IP numbers should I use?" This section is provided to help you make that decision, and to act as a future reference guide.
RFC 1597 is an Internet standards document that describes how private IP numbers are allocated. Table 3.3 provides a quick summary for you, complete with netmask values.
Table 3.3: Private IP Number Allocations
Class |
Lowest |
Highest |
Netmask |
A |
10.0.0.0 |
10.255.255.255 |
255.0.0.0 |
B |
172.16.0.0 |
172.31.255.255 |
255.255.0.0 |
C |
192.168.0.0 |
192.168.255.255 |
255.255.255.0 |
Your choice of a class A, B, or C IP number series will depend largely upon the number of separate networks and hosts that you plan to establish. If the total number of networks and hosts is small, then a class C address might be sufficient. Alternatively, a class A address allows for one network (without subnetting), but a very large total number of hosts. Class B provides a large number of both networks and hosts.
Reserved IP Numbers
There are a large number of reserved IP numbers and these blocks are listed in RFC 1166. As one example of a reserved series of numbers, the Amateur Radio IP number series are shown in Table 3.4 as an example. These are used by amateur radio operators using the Internet protocol on packet radio equipment. Now that the AX.25 protocol is built into the Linux kernel (as of 2.2.0), it is certain that more radio amateurs will be exercising these IP numbers!
Table 3.4: Amateur Radio Reserved IP Numbers
Class |
Lowest |
Highest |
Netmask |
A |
44.0.0.0 |
44.255.255.255 |
255.0.0.0 |
This brings you to the end of the IP number tour. Now, it's time to apply your knowledge of socket addresses and IP numbers to functions that Linux provides to make IP address conversion easier.