You need to satisfy these requirements, and you want to have addresses in reserve
that you can use if your company expands. Where do you start? There is not just
one correct way of doing this. You have a Class B address space assigned to you,
and you shall see that this will not be that difficult. First, let's subnet the Class B
address space into four equal size pieces. For four subnets, you will need to use 2
bits from the host address or a /18 subnet mask. The third byte of the IP address is
divided as
To satisfy the first requirement of a maximum of 60 Class C size networks, subnet
the 156.26.0.0/18 address into Class C size or /24 subnets. How many Class C
size subnets will this provide? We are using an additional 6 bits to subnet the
156.26.0.0/18 network, and 26 = 64 subnets. This will be sufficient to satisfy the
first requirement. The Class C networks will have the following addresses:
How were these network numbers determined? The 156.26.0.0/18 network was
derived from the 156.26.0.0/16 network. The first 16 bits are fixed and equal to
156.26. The next 2 bits are fixed and equal to 0 because this is the subnet used for
the Class C size networks. Therefore, the possible range of values for the third
byte are
For the first requirement, use networks 156.26.0.0/24 through 156.26.59.0/24.
To satisfy the second requirement, use the last Class C size network, 156.26.63.0,
and subnet it to the proper size. For a maximum of 10 hosts, you will need 4 bits
for the host address. With 4 bits, a network can support 14 hosts (16 – 2). Because
a Class C size network is being subnetted, there are only 8 bits to work with (the
last byte). Four bits are needed for the hosts, which leaves 4 bits for the network.
The requirement is 14 networks, and 4 network bits can support 16 networks. The
last byte is divided, so 4 bits are used for the network and 4 bits for the host:
For the final requirement of four point-to-point networks, the 156.26.63.240 network
will be subnetted using a 30-bit mask. A point-to-point network requires
only two host addresses.
There are 4 bits available on the 156.26.63.240/28 subnet. Two are needed for the
host bits. The two remaining bits are sufficient for the four point-to-point networks
that are required. The last byte of the 156.26.63.240 is used for the final
subnetting operation:
The final plan is shown in Figure 3-21.
If this is your first experience dealing with subnet masks and you find it a bit confusing,
take comfort in the fact that this is normal. Subnets and subnet masks take
time to master. Get some paper and a pencil and practice, practice, practice. To aid
in your understanding, try the following problems:
1. What is the broadcast address for network 156.26.0.0/16?
Answer: Set the 16 host bits to 1 to obtain 156.26.255.255.
2. What is the broadcast address for network 156.26.0.0/24?
Answer: Set the 8 host bits to 1 to obtain 156.26.0.255.
3. What is the broadcast address for network 156.26.0.0/28?
Answer: Set the 4 host bits to 1 to obtain 156.26.0.15.
4. The Class C address 195.14.22.0 is subnetted using a 27-bit subnet mask.
How many subnets are there and what are the network numbers?
Answer: The natural mask for a Class C address is /24. Therefore, 33 additional
bits are used for the subnet, 23 = 8, so there are eight subnets. The 3
additional network bits are taken from the fourth byte so the network numbers
are
0 0 0 0 0 0 0 0 = 0 195.14.22.0/27
0 0 1 0 0 0 0 0 = 32 195.14.22.32/27
0 1 0 0 0 0 0 0 = 64 195.14.22.64/27
0 1 1 0 0 0 0 0 = 96 195.14.22.96/27
1 0 0 0 0 0 0 0 = 128 195.14.22.128/27
1 0 1 0 0 0 0 0 = 160 195.14.22.160/27
1 1 0 0 0 0 0 0 = 192 195.14.22.192/27
1 1 1 0 0 0 0 0 = 224 195.14.22.224/27
5. What is the range of host addresses for the network 195.14.22.64/27?
Answer: 195.14.22.65 – 195.14.22.94
6. What is the broadcast address for network 195.14.22.64/27?
Answer: 64 = 0 1 0 0 0 0 0 0, so the broadcast address is:
0 1 0 1 1 1 1 1 = 95 or 195.14.22.95
IP routing and route summarization
The network in Figure 3-22 is a partial implementation of the addressing plan
developed for the 156.26.0.0 network.
Figure 3-22 - Example Network for Route Summarization
Routers A, B, C, and D are access routers and each one connects to two Class C
size networks. Routers E and F are the distribution routers, and Router G is the
core router. The terminology used in Figure 3-22 is explained in Figure 3-23.
The network in Figure 3-22 has 12 subnets, so each router will have 12 entries in
its IP routing table. The routing table for Router G is listed in Table 3-13. Initially,
the only routes in the IP routing table are the directly connected networks. The
other subnets need to be learned either statically or dynamically. Statically means
that every route has to be manually entered on every router. The network has 7
routers so 7 * 12, or 84, routes would need to be entered for IP routing to work.
Certainly this can be done, but it would take some time and would be prone to
error. Imagine entering all routes statically for a network with hundreds of routers
and thousands of routes. This is not a scalable solution. A better solution is to use
a dynamic IP routing protocol that will dynamically advertise routes throughout
your network. The later chapters will discuss IP routing protocols. For now,
assume that all the routes have been entered statically.
Figure 3-23 - Network Terminology
Table 3-13 - IP Routing Table for Router G

The network in Figure 3-22 is similar to the network that was developed in Chapter
1 for the statewide delivery of mail. Router G is equivalent to the core post
office that routed mail between states, and between cities in a state. Routers E and
F are equivalent to the distribution post offices that routed mail between the access
post offices and the state post office. Routers A, B, C, and D are equivalent to the
access post offices that routed mail between streets (networks) and the distribution
post offices. For the statewide postal network, the core post office did not need to
know about every street. It was sufficient to route mail based on the city name. For
routing between states, the core post office did not need to know the route to every
city and every street in another state. It was sufficient to route interstate mail
based on the state name alone. This process of information hiding, or route reduction,
was called route summarization or aggregation. It would be nice if IP routes
could be aggregated to reduce the size of the routing tables.
Routes are summarized, or aggregated, by reversing the subnetting process. For
example, in Figure 3-21, the 156.26.63.240/28 network was subnetted into 4 /30
networks:
156.26.63.240/30
156.26.63.244/30
156.26.63.248/30
156.26.63.252/30
A router can have these four specific routes in the routing table. Or, a router can
have one route, or IP prefix, that summarizes these four specific networks. The
summary prefix 156.26.63.240/28 contains every possible subnet of
156.26.63.240/28 in the same way that a state contains every possible city and
street name contained within that state. The state name summarizes all the city
and street names into one prefix. A summary address allowed the core post office
to maintain one route to another state and not a route for every possible destination
in the other state.
A summary prefix should only summarize those subnets that are actually being
used. The prefix 156.26.0.0/16 summarizes all the subnets of the Class B address
space 156.26.0.0. So the prefix 156.26.0.0/16 does summarize the four specific
/30 subnets of 156.26.63.240/28, but it also summarizes all other subnets of
156.26.0.0/16. This summary tells a router that all subnets of 156.26.0.0/16 are
reachable even though many of the subnets might not be in use.
For the network in Figure 3-22 and subnets in Table 3-13, the subnets can be summarized
into one route advertisement.
For Router G, 156.26.0.0/24 through 156.26.3.0/24 can be reached through interface
serial 0. If you look at the bit patterns of these four subnets, you can determine
the subnet mask to use to summarize these routes. It is sufficient, in this
case, to examine only the third byte of the subnets:
0 = 0 0 0 0 0 0 0 0
1 = 0 0 0 0 0 0 0 1
2 = 0 0 0 0 0 0 1 0
3 = 0 0 0 0 0 0 1 1
The subnet mask that needs to be used should include only those bits that do not
change. For these four routes, the upper 6 bits do not change. These 6 bits need to
be included in the summary subnet mask. The value of the mask for the third byte
is 1 1 1 1 1 1 0 0 = 252, so the required subnet mask is 255.255.252.0.
Applying the same process to the subnets 156.26.56.0/24 through 156.26.59.0/24,
the values of the third byte are
56 = 0 0 1 1 1 0 0 0
57 = 0 0 1 1 1 0 0 1
58 = 0 0 1 1 1 0 1 0
59 = 0 0 1 1 1 0 1 1
As with the previous example, the upper 6 bits need to be included in the subnet
mask and the required mask is again 255.255.252.0. The new routing table for
Router G is listed in Table 3-14.
Table 3-14 - IP Routing Table for Router G Using Summary Prefixes

The routing table on Router G has been reduced from 12 to 6 routes, a significant
reduction. Notice that the two new summary prefixes have a 22-bit subnet mask
instead of a 24-bit subnet mask. To see how this works, assume Router G receives
a packet for the host at IP address 156.26.2.37. There is no subnet mask information
in a destination IP address. The router will find the best match for this route
from the routing table. An address with /32 is a host address:
156.26.2.37/32 = 10011100 00011010 00000010 00100101
156.26.0.0/22= 10011100 00011010 00000000 00000000
There is a 22-bit match between the host address and the prefix 156.25.0.0/22, so
this packet will be forward using interface serial 0.
What if subnet 156.26.3.0/24 was moved to Router C? (See Figure 3-24.)
Figure 3-24 - Summary and Specific IP Prefixes

Can we still summarize the networks attached to Routers A and B? Yes. The summary
prefix 156.26.0.0/22 contains 156.26.0.0/24 through 156.26.3.0/24, so
Router G thinks it can reach the 156.26.3.0/24 network through Router E. You can
keep this summary prefix as long as a more specific prefix for network 152.26.3.0/24
is added to the routing table on Router G. (See Table 3-15.)
Table 3-15 - IP Routing Table for Router G Using Summary Prefixes and
a More Specific Prefix

Router G now has two routes to subnet 156.26.3.0/24. Which one will it use?
Assume Router G receives a packet for host 156.26.3.12/32. Router G will compare
this route with the entries in the routing table and there are two that match.
This matches 22 bits in the host address:
156.26.0.0/22 = 10011100 00011010 00000000 00000000
156.26.3.12/32 = 10011100 00011010 00000011 00001100
This matches 24 bits and the longest match wins. Router G will forward the
packet to Router F:
156.26.3.0/24 = 10011100 00011010 00000011 00000000
156.26.3.12/32 = 10011100 00011010 00000011 00001100
Try reinforcing the key points with the following questions:
1. How many subnets of the Class C address 197.45.120.0/24 are there that can
support at least 12 hosts?
Answer: Four bits are required for 12 hosts (24 – 2 = 14). This is a Class C
address, so there are 4 bits left for the network. Therefore, there are 16 subnets
that can support at least 12 hosts.
2. What are the network numbers for the subnets in the previous question?
Answer: The first 4 bits of the last byte are included in the network number.
0 0 0 0 0 0 0 0 = 0 197.45.120.0
0 0 0 1 0 0 0 0 = 16 197.45.120.16
0 0 1 0 0 0 0 0 = 32 197.45.120.32
0 0 1 1 0 0 0 0 = 48 197.45.120.48
0 1 0 0 0 0 0 0 = 64 197.45.120.64
0 1 0 1 0 0 0 0 = 80 197.45.120.80
0 1 1 0 0 0 0 0 = 96 197.45.120.96
0 1 1 1 0 0 0 0 = 112 197.45.120.112
1 0 0 0 0 0 0 0 = 128 197.45.120.128
1 0 0 1 0 0 0 0 = 144 197.45.120.144
1 0 1 0 0 0 0 0 = 160 197.45.120.160
1 0 1 1 0 0 0 0 = 176 197.45.120.176
1 1 0 0 0 0 0 0 = 192 197.45.120.192
1 1 0 1 0 0 0 0 = 208 197.45.120.208
1 1 1 0 0 0 0 0 = 224 197.45.120.224
1 1 1 1 0 0 0 0 = 240 197.45.120.240
3. Summarize the 16 networks from the previous example into two equal size
prefixes.
Answer: Examine the bit patterns of the fourth byte of the first 8 subnets.
0 0 0 0 0 0 0 0 = 0 197.45.120.0
0 0 0 1 0 0 0 0 = 16 197.45.120.16
0 0 1 0 0 0 0 0 = 32 197.45.120.32
0 0 1 1 0 0 0 0 = 48 197.45.120.48
0 1 0 0 0 0 0 0 = 64 197.45.120.64
0 1 0 1 0 0 0 0 = 80 197.45.120.80
0 1 1 0 0 0 0 0 = 96 197.45.120.96
0 1 1 1 0 0 0 0 = 112 197.45.120.112
The only bit that is constant is the first bit, so a 25-bit mask is needed. The
summary for the first eight subnets is
197.45.120.0/25
The only bit that is constant for the second set of eight subnets is again the
first bit and it is always 1. The summary for the second set of eight subnets is
197.45.120.128/25.
Supernets
When more bits are used than the natural mask length for the network portion of a
Class A, B, or C address, this process was called subnetting. The natural mask for
a Class A address is 8 bits. If more than 8 bits are used for the network portion of
the IP address, we say that the Class A address has been subnetted.
You can also use fewer bits than the natural mask for the network portion. This
process is called supernetting. For example, assume your company owns the following four Class C addresses:
200.10.4.0/24
200.10.5.0/24
200.10.6.0/24
200.10.7.0/24
You can aggregate the addresses using a 22-bit mask, which is 2 bits less than the
natural 24-bit mask. The process is the same as subnetting, but the term that is
used depends on whether more or fewer bits than the natural mask are being used.
The supernet for these networks is 200.10.4.0/22.
All parts reproduced from the book Routing First-Step, ISBN 1587201224, Copyright 2005, Cisco Systems, Inc. Reproduced by permission of Pearson Education, Inc., 800 East 96th Street, Indianapolis, IN 46240. Written permission from Pearson Education, Inc. is required for all other uses. Visit www.ciscopress.com for a detailed description and to learn how to purchase this title.