IP Addressing Schemes

One of the biggest problems is to choose the correct IP address range to use. So before we can continue with the task of allocating an address for each machine we need to be aware of some of the addressing schemes that are used.

We'll briefly describe three main schemes below. Class-based and subnetting, although still widely used, have largely been overtaken by the classless scheme known as Classless Inter-Domain Routing (CIDR), pronounced “cider.”

Class-Based

IP addresses have historically been based on the “class” system. For this, various classes were created: “A,” “B,” “C,” and “extended addressing mode.” “A,” “B,” and “C” were assigned a network portion and a host portion, which was a fixed value for each. An escape code was provided to access “extended addressing mode,” which would later be split further into classes “D” and “E” (multicast and experimental, respectively).

There was no concept of subnetting within the classes; routers would simply examine the address and deduce its class based on the value of its high-order bits. The network information would be obtained based on the global rules for that class (i.e., what portion of the address relates to the network and which portion relates to the host). This information is summarized in Table 11.1.

Table 11.1. Bit Information for Class-Based Schemes
ClassHigh-Order BitsNetwork BitsHost BitsAddress Bits (b=high order n=network h=host)
A0724bnnnnnnn.hhhhhhhh.hhhhhhhh.hhhhhhhh
B101416bbnnnnnn.nnnnnnnn.hhhhhhhh.hhhhhhhh
C110218bbbnnnnn.nnnnnnnn.nnnnnnnn.hhhhhhhh
Extended Addressing Mode111 

Using the information shown here, we can calculate the number of hosts that are available in each network and also the number of networks that are available in each class. For example, class “A” has 7 bits available for network addresses and 24 bits for host addresses. Converting this to decimal provides us with 126 subnets and 16,777,216 hosts in each network. Table 11.2 shows these details for each class.

Table 11.2. Host Information for Class-Based Schemes
ClassAddress RangeFirst Byte Binary/ DecimalNumber of Available ClassesMax Number of Addresses per Network
A1.0.0.0–126.255.255.25500000000/012616,777,216
B128.0.0.0–191.255.255.25510000000/12816,38465,536
C192.0.0.0–223.255.255.25511000000/1922,097,152256
D (Multicast)224.0.0.0–239.255.255.25511100000/224
E (Reserved)240.0.0.0–255.255.255.25411110000/240

This method of addressing became regarded as inflexible for a number of reasons, the main one being that the number of addresses available for each class is fixed. This often led to address wastage, because, for example, if a company required 2,000 addresses, a class “C” address was too small, while a class “B” was too large. The result was usually to assign a class “B,” which can contain over 65,000 addresses. The company would use just 2,000 of them, resulting in over 60,000 being wasted. It soon became obvious that some other method of address allocation was required.

Subnetting

The problems with address wastage led to subnetting being introduced. This allows the IP address to be split into subnets by applying a netmask to it. To accommodate this within the standard 32-bit address, the subnet details are contained in the host portion. The subnet mask is used to determine which portions of the host component are actually subnet information. The network portion of the address is never affected and so routing still works in a similar way as classful addressing.

Every “1” bit in the subnet mask is used to indicate the network portion of the address, while every “0” bit indicates the host portion. Because the original network portion of the class itself remains the same, each class will have a minimum subnet mask “value.” Table 11.3 shows examples of various subnet masks across different classes.

Table 11.3. Bit Information for Subnetting
ClassSubnet MaskAddress Bits (b=high order n=network s=subnet h=host)
A255.255.0.0bnnnnnnn.ssssssss.hhhhhhhh.hhhhhhhh
A255.255.255.240bbnnnnnn.ssssssss.ssssssss.sssshhhh
B255.255.252.0bbbnnnnn.nnnnnnnn.ssssssnn.hhhhhhhh
C255.255.255.248bbbnnnnn.nnnnnnnn.nnnnnnnn.ssssshhh

We can also see from this that—because the subnet information “eats” into the host details—as the number of subnets increases, the number of hosts available will decrease, and vice versa. Using this information, let's look at an example of how to calculate the available hosts and subnets for an IP address:

  • Class “C” IP address: 192.168.22.1

  • Network address: 192.168.22.0

  • Subnet mask: 255.255.255.192

  • The subnet mask in binary will be: 11111.11111.11111.11000000

  • The netmask will be applied as: bbbnnnnn.nnnnnnnn.nnnnnnnn.sshhhhhh

From this, we see that the last six zeros will form the host component and the preceding two bits will be the subnet. Converting the binary values to decimal leaves us with four subnets each comprising 64 host addresses. Table 11.4 shows the subnets and address ranges that would be generated using this netmask.

Table 11.4. Address Ranges for a Subnetted Address
Subnet AddressAddress RangeBroadcast Address
192.168.22.0192.168.22.1–192.168.22.62192.168.22.63
192.168.22.64192.168.22.65–192.168.22.126192.168.22.127
192.168.22.128192.168.22.129–192.168.22.190192.168.22.191
192.168.22.192192.168.22.193–192.168.22.254192.168.22.255

Alternatively, we could have applied a netmask of 255.255.255.128 to get two subnets, each comprising 126 hosts, or a mask of 255.255.255.248 to get 32 subnets of six hosts each, and so forth.

CIDR

CIDR takes the concept of subnetting a step further. It was introduced to allow a more flexible approach to assigning addresses and is supported in Solaris 2.6 and above. Whereas subnetting can never alter the network portion of the address, CIDR removes these rules and allows users to assign a mask consisting of an arbitrary number of bits. This mask is known as either a “bit mask” or “supernet mask.” CIDR addresses are displayed as “network address/bit mask,” although the dotted notation is still used by many people.

For example, if we were using a class “C” address of 192.168.22.0 and we wanted to use a bit mask of 25 bits, we would indicate this by writing 192.168.22.0/25. This means that the network portion of the address comprises the first 25 bits, and the host component the last seven bits. Table 11.5 shows an example of calculating the network and host details for the previous syntax.

Table 11.5. CIDR Address Range Calculation
Description of CalculationValue
Network number192.168.22.0/25
Supernet mask (binary)11111111.11111111.11111111.10000000
Supernet mask converted to “dot” notation255.255.255.128
Network number converted to binary11000000.10101000.00010110.00000000
First 25 bits of the network number11000000.10101000.00010110.0
Last seven bits—the host component range (binary)0000000 to 1111111
Last seven bits—the host component range (decimal)0 to 127

This shows this subnet has an addresses range from 0 to 127—a total of 128. However, 0 refers to the network itself and 127 will be the broadcast address, so we have 126 addresses available for use: 1 through 126.

Table 11.6 shows the CIDR bitmask value for every possible address and the classful equivalent it would have.

Table 11.6. CIDR Bitmask Values
CIDR Bitmask ValueDotted NotationMax Number of AddressesEquivalent Classful Value
/1128.0.0.02,147,483,648128 As
/2192.0.0.01,073,741,82464 As
/3224.0.0.0536,870,91232 As
/4240.0.0.0268,435,45616 As
/5248.0.0.0134,217,7288 As
/6252.0.0.067,108,8644 As
/7254.0.0.033,554,4322 As
/8255.0.0.016,777,216Class A network
/9255.128.0.08,388,608128 Bs
/10255.192.0.04,194,30464 Bs
/11255.224.0.02,097,15232 Bs
/12255.240.0.01,048,57616 Bs
/13255.248.0.0525,2888 Bs
/14255.252.0.0262,1444 Bs
/15255.254.0.0131,0722 Bs
/16255.255.0.065,536Class B network
/17255.255.128.032,768128 Cs
/18255.255.192.016,38464 Cs
/19255.255.224.08,19232 Cs
/20255.255.240.04,09616 Cs
/21255.255.248.02,0488 Cs
/22255.255.252.01,0244 Cs
/23255.255.254.05122 Cs
/24255.255.255.0256Class C network
/25255.255.255.128128½ C
/26255.255.255.19264¼ C
/27255.255.255.22432⅛ C
/28255.255.255.240161/16 C
/29255.255.255.24881/32 C
/30255.255.255.25241/64 C
/31255.255.255.25421/128 C
/32255.255.255.2551

Unicast, Multicast, and Broadcast Addresses

Normal TCP/IP communication is based on unicast addresses. This means data is sent from one host and directed to another host (i.e., single host-to-host traffic). For this type of communication, the assigned host address of the system would be used; for example, 192.168.22.10.

The broadcast address is derived from the host's network address, but with the host component set to all one's (for example, 192.168.22.255). Whenever data is sent to the broadcast address, all hosts on that network will receive the data.

Multicast addresses are designed to allow a group of hosts to register an interest in receiving a set of data. This means the hosts have a choice of whether to receive the data or not. It is normally controlled at the program level. For example, Network Time Protocol (NTP) has been allocated a multicast address of 224.0.1.1. This will be used by the client programs to perform time queries.

Illegal Addresses

A number of addresses cannot be assigned to a host, for various reasons. Table 11.7 shows these, along with an example of each.

Table 11.7. Illegal Addresses
Address TypeExamplesReason
0.0.0.00.0.0.0Used to indicate the default route
x.x.x.0192.168.22.0Used to signify the network address
x.x.x.255192.168.22.255Used for the broadcast address
255.255.255.255255.255.255.255Used to refer to all hosts on the local network
127.x.x.x127.0.0.10The loopback interface (described later)
128.0.x.x128.0.1.1Reserved by the Network Information Center
129.0.0.x129.0.0.1Reserved by the Network Information Center
191.255.x.x191.255.1.1Reserved by the Network Information Center
223.255.255.x223.255.255.1Reserved by the Network Information Center
Multicast Address224.0.0.1Reserved for multicast addresses
Experimental Address240.0.0.1Reserved for experimental use

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset