The Class A networking address scheme is designed for the government and large institutions needing a great deal of unique nodes. Although the Class A network has only 254 unique network addresses, it can contain approximately 17 million unique nodes, which can make subnetting such a network a nightmare.
Getting up to speed with subnetting Class A addresses requires a little forethought, some basic information, and a lot of practice. Here, I will explain Class A subnet masks and how to assign valid subnets and host addresses to provide flexibility in configuring your network.
Info on Class B and Class C subnetting
If you need more information on subnetting other types of networks, take a look at Todd Lammle’s other subnetting articles: “Subnetting a Class B network address,” and “Subnetting a Class C network address.”
Class A subnet masks must start with 255.0.0.0 at a minimum, because the whole first octet of an IP address (the IP address describes the specific location on the network) is used to define the network portion (the network portion describes the “street” that IP addresses are located on). Routers use the network portion to send packets through an internetwork. Routers aren’t concerned about host addresses. They need to know only the “street” on which hosts are located and that the MAC address is used to find a host on a LAN. The last three octets of a Class A subnet mask are used to address hosts on a LAN; the 24 bits you can manipulate however you wish.
If you wanted to create smaller networks (subnetworks) out of a Class A network ID, you’d borrow bits from the host portion of the mask. The more bits you borrow, the more subnets you can have, but this means fewer hosts per subnet. However, with a Class A mask, you have 24 bits to manipulate, so this isn’t typically a problem.
Table A lists all the available Class A subnet masks:
|255.0.0.0||(/8)||1 network||with 16,777,214 hosts|
|255.128.0.0||(/9)||2 subnets||with 8,388,606 hosts each|
|255.192.0.0||(/10)||4 subnets||with 4,194,302 hosts each|
|255.224.0.0||(/11)||8 subnets||with 2,097,150 hosts each|
|255.240.0.0||(/12)||16 subnets||with 1,048,574 hosts each|
|255.248.0.0||(/13)||32 subnets||with 524,286 hosts each|
|255.252.0.0||(/14)||64 subnets||with 262,142 hosts each|
|255.254.0.0||(/15)||128 subnets||with 131,070 hosts each|
|255.255.0.0||(/16)||256 subnets||with 65,534 hosts each|
|255.255.128.0||(/17)||512 subnets||with 32,766 hosts each|
|255.255.192.0||(/18)||1,024 subnets||with 16,384 hosts each|
|255.255.224.0||(/19)||2,048 subnets||with 8,190 hosts each|
|255.255.240.0||(/20)||4,096 subnets||with 4,094 hosts each|
|255.255.248.0||(/21)||8,192 subnets||with 2,046 hosts each|
|255.255.252.0||(/22)||16,384 subnets||with 1,022 hosts each|
|255.255.254.0||(/23)||32,768 subnets||with 510 hosts each|
|255.255.255.0||(/24)||65,536 subnets||with 254 hosts each|
|255.255.255.128||(/25)||131,072 subnets||with 126 hosts each|
|255.255.255.192||(/26)||262,144 subnets||with 62 hosts each|
|255.255.255.224||(/27)||524,288 subnets||with 30 hosts each|
|255.255.255.240||(/28)||1,048,576 subnets||with 14 hosts each|
|255.255.255.248||(/29)||2,097,152 subnets||with 6 hosts each|
|255.255.255.252||(/30)||4,194,304 subnets||with 2 hosts each|
This chart assumes you can use subnet zero. If you’re not using subnet zero, subtract two from each number in the Subnets column in Table A above.
Once you have an idea what your network will look like, write down the number of physical subnets you have and the number of hosts needed for each subnet. For example, on a WAN point-to-point link, you need only two IP addresses, so you can use a /30 mask.
The slash (/) indicates the number of mask bits turned on. It saves you from typing, or pronouncing, the whole mask. For example, /8 means 255.0.0.0, /16 is 255.255.0.0, and /24 is 255.255.255.0. You pronounce it as “configure a slash 24 mask on that network.” It’s just an easier way of saying “configure a 255.255.255.0 mask on that network.”
Figure A is an example of assigning masks on a case-by-case basis or, in this instance, LAN by LAN. It shows a network with eight LANs and two WANs connected to the corporate office, along with one additional point-to-point, Fast Ethernet LAN connection to another building located next to the main corporate office. This figure is an example of how I would draw out the network.
|Notice that I indicated the number of host addresses needed for each network connection.|
Using this type of drawing, you can now look at the chart and assign a mask that fits each network. Just remember to keep growth projections in mind.
Classless routing—the practice of assigning different size masks on your network—does not work unless you run a routing protocol that supports prefix routing. RIP version 2, OSPF, and EIGRP are examples of routing protocols that can support classless routing. Classful routing, on the other hand, means that all hosts have the same size mask. RIP version 1 and IGRP are classful routing protocols, and neither will work in a classless environment.
For more information on the protocols supporting classless routing, read these Todd Lammle articles:
Once you have the mask assigned to each network, you must assign the valid subnet addresses and host ranges to each network. To determine the valid subnets and host addresses for each network, you need to answer three easy questions:
- What is the valid subnet address?
- What is the broadcast address?
- What is the valid host range?
- Here are some tips for finding the answers:
- Valid subnet address: To figure out the valid subnet address, simply subtract the subnet mask from 256. For example, if you had a Class A mask of 255.240.0.0, the equation would be 256-240=16. The number 16 is the first subnet and also your block size. Keep adding the block size (in this case 16) to itself until you reach the subnet mask value. The valid subnets in this example are 16, 32, 48, 64, 80, 96, 112, 128, 144, 160, 176, 192, 208, 224. As another example, if you had a Class A subnet mask of 255.255.240.0, you’d use the mask on the second and third octets minus 256. The second octet would be 256-255=1, 2, 3, etc., all the way to 254; the third octet would be 256-240=16, 32, 48, etc.
- Broadcast address: To determine the broadcast address of each subnet, just subtract 1 from the next subnet value. For example, within the 16 subnet, the next subnet is 32, so the broadcast address of the 16 subnet is 31. The broadcast address for the 32 subnet is 47, because the next subnet is 48. The broadcast address for the 48 subnet is 63, because the next subnet is 64.
- Valid host range: The valid hosts are the numbers between the subnet address and the broadcast address. For the 16 subnet, the valid host range you can assign on a network is 17-30 because the subnet number is 16 and the broadcast address is 31. For the 32 subnet, the valid host range is 33 to 46 because the subnet number is 32 and the broadcast address is 47. You can’t use the subnet number and broadcast addresses as valid host addresses.
Assigning valid host addresses
Using Figure A as an example, let’s assign networks and valid host ranges to each network. First, create another table of usable block sizes. Figure B shows how to assign block sizes to your network on a granular basis.
|In this example, the network ID used for the entire internetwork is 10.1.1.0.|
You can build this network in many different ways, but I prefer to start with the WAN links (block size of four) on the bottom and work my way up, while the largest LANs start at the top and work toward the bottom. The network will work any way you construct it, as long as you configure your block sizes correctly on the chart.
Now you have to assign the valid host ID to each LAN and WAN, and your network should be up and running. It would be a good idea for you to use EIGRP as your routing protocol to help you get this up and running quickly.
Assigning other Class A masks
Figure B is an example of variable length subnet masks and is typically the easiest way you’ll assign IP addresses on an internetwork. However, let’s go through a few practice examples of subnetting Class A masks, to make sure you really understand the process.
Practice Class A mask 255.240.0.0 (/12)
This mask provides you with only four subnet bits, or 16 subnets (14 if you’re not using subnet zero) with 1,048,574 hosts each. The valid subnets are 256-240=16, 32, 48, 64, 80, etc., all the way to 224. (Subnets 0 and 240 are available if you’re using subnet zero.)
The first subnet, assuming subnet zero, is:
- Subnet: 10.0.0.0
- Broadcast: 10.15.255.255
- Valid host range: 10.0.0.1 through 10.15.255.254
The last subnet, assuming subnet zero, is:
- Subnet: 10.240.0.0
- Broadcast: 10.255.255.255
- Valid host range: 10.240.0.1 through 10.255.255.254
Practice Class A mask 255.255.128.0
This mask provides you with nine bits of subnetting and 15 host bits (/17). This gives you 512 subnets with 32,766 hosts each. The second octet is 256-255=1, 2, 3, etc., all the way to 255. Zero is available in the second octet if you have either a subnet bit on in the third octet or are, of course, using subnet zero.
The first available subnet is:
- Subnet: 10.0.0.0
- Broadcast: 10.0.127.255
- Valid host range: 10.0.0.1 through 10.0.127.254
You must remember that the third octet is using only one subnet bit. This bit can be either off or on; if it is off, the subnet is 0. If it is on, the subnet is 128.
Here’s an example of the 10.0.128.0 subnet:
- Subnet: 10.0.128.0
- Broadcast: 10.0.255.255
- Valid host range: 10.0.128.1 through 10.0.255.254
The last available subnet is:
- Subnet: 10.255.128.0
- Broadcast: 10.255.255.255
- Valid host range: 10.255.128.1 through 10.255.255.254
Practice Class A mask 255.255.255.252
This mask is the easiest to subnet. Even if it weren’t a Class A mask, and you used this mask with a Class B or Class C mask, you’d always have only two available host IDs. The reason you would use this with a Class A mask is because it can give you up to 4,194,304 subnets with two hosts each. This is a perfect mask for a point-to-point link, so I suggest always saving a few block sizes of four (/30) masks for use on WANs and point-to-point LAN connections.
If you use the 10.2.3.0 network, your subnets are always 2.3 in the second and third octets, respectively. But the fourth octet is where it changes, as in 256-252=4, 8, 12, 16, 20, 24, 28, etc., all the way to 248. If you use subnet zero, your first subnets are 0, and your last subnet is 255.
An example of the 10.2.3.0 subnet is:
- Subnet: 10.2.3.0
- Broadcast: 10.2.3.3
- Valid hosts: 10.2.3.1 and 10.2.3.2
An example of the 10.2.3.252 subnet is:
- Subnet: 10.2.3.252
- Broadcast: 10.2.3.255
- Valid hosts: 10.2.3.253 and 10.2.3.254
Using Class A network IDs
You should probably use Class A network IDs in most networks these days. Why? Because the 10.0.0.0 network ID cannot be routed on the Internet. These private IP address ranges allow you to create a more secure network and use port address translation on your router to the Internet to do the translation for you. I suggest 10.0.0.0 to address your network because it provides the most flexibility for configuring networks.