Sunteți pe pagina 1din 91

The Ultimate

Guide to
Subnetting!

Master the Art of Subnetting a Network


Complete coverage of Subnetting, Supernetting, CIDR and VLSM
V 3.0

The Ultimate Guide to Subnetting! is part of the


e-Guide training series published by

5142 Hollister Ave. #3


Santa Barbara, CA 93111
E-Mail: inquiry@HotTrainingMaterials.com
Website: HotTrainingMaterials.com

Other e-Guides in this series:

NAT Primer
Unique CCNA Study Guide

Copyright 2001-06 by New Frontier Training


All rights reserved
No portion of this document may be extracted, resold, copied, distributed or otherwise
disseminated without prior written permission from the author

Table of Contents
Introduction ........................................................................................................................................4
Chapter 1 A Review Of IP Addressing ..........................................................................................6
Overview......................................................................................................................................7
IP Addressing Basics ...................................................................................................................7
Working With Binary Numbers ..................................................................................................8
Classful Addressing ....................................................................................................................9
Public Vs. Private IP Addressing ................................................................................................12
Classless Addressing ...................................................................................................................13
The Manifestations of Classless Addressing: Subnetting, Supernetting, CIDR, VLSM .............16
Chapter 2 Why Classless Addressing Works .................................................................................19
Overview......................................................................................................................................20
Its All About Determining Where To Forward Packets ............................................................20
Determining The Network Number of A Destination IP Address ..............................................21
Chapter Summary ........................................................................................................................26
Chapter 3 Subnetting Explained .....................................................................................................27
Overview......................................................................................................................................28
How To Subnet ............................................................................................................................28
Subnetting a Class C Network Address .......................................................................................28
The Proof Is In The Anding .....................................................................................................33
Subnetting Summed Up ...............................................................................................................33
Chapter Summary ........................................................................................................................35
Chapter 4 Supernetting Explained ..................................................................................................36
Overview......................................................................................................................................37
Why Supernetting Is Dead ........................................................................................................37
How To Supernet ........................................................................................................................37
Chapter Summary .......................................................................................................................40
Chapter 5 CIDR And VLSMs Explained .......................................................................................41
Overview......................................................................................................................................42
CIDR............................................................................................................................................42
Problems Solved By CIDR .........................................................................................................43
VLSMs ........................................................................................................................................46
VLSMs Applied Before Allocating A CIDR Address ................................................................46
VLSMs Applied After Allocating A CIDR Address ..................................................................48
Summing up CIDR and VLSMs .................................................................................................51
Riding The Hierarchical Highway ..............................................................................................51
Ipv6 To The Rescue? ..................................................................................................................52
Chapter Summary ........................................................................................................................53
Appendixes ........................................................................................................................................54
Appendix A Subnetting Exercises ..................................................................................................55
Appendix B Quick And Dirty Subnetting .......................................................................................76
Appendix C Real Life Classlful Subnetting Examples ...................................................................79
Appendix D Real Life Classless Subnetting Examples...................................................................84
Appendix E Subnetting Tables........................................................................................................88
Appendix F A Note About Cisco Routers .......................................................................................90

Introduction

Introduction
It is generally agreed that one the most difficult aspect of TCP/IP to master is subnetting and its
closely related cousins, supernetting, Variable Length Subnets Masks (VLSMs) and Classless
Inter-Domain Routing (CIDR). As a group, all these technologies can generally be referred to as
classless addressing. When teaching TCP/IP classes I have watched students fly through core
TCP/IP concepts, only to stumble when classless addressing was introduced. After reflecting on
this dilemma for a while, I worked with a few advanced students to fashion a way to make the
topic of classless addressing easily understandable. We apparently were successful, because
students time after time tell me they really truly get classless addressing when this approach is
used! That is gratifying.
This book was written so that you too, once-and-for-all, can understand all aspects of classless
addressing. You will be able to address your own network with a logical, organized, hierarchical
numbering scheme, and understand the existing IP numbering scheme on any network you come
into contact with. Whether you are in a position where you need to understand classless
addressing to pass a certification test, design an addressing scheme at your place of work, or
simply need to understand the IP address space assigned by your ISP, this book will help with
clear explanations, and lots of examples.
So, on with the show . . .

Copyright 2001-06 by New Frontier Training

Chapter 1 A Review of IP
Addressing

Chapter 1 A Review of IP Addressing

Overview
In this chapter the basics of IP addressing are explored. In the first part of the chapter traditional
classful addressing is explained, followed by a brief, but important introduction to classless
addressing and its various manifestations; subnetting, variable subnetting, supernetting, and
Classless Inter-Domain Routing. Subsequent chapters will examine classless addressing in depth.
Here, the following topics will be covered:

IP addressing basics
Classful IP addressing
Public and private addresses
Introduction to classless IP addressing

IP Addressing Basics
An IP address is the number assigned to a host that uniquely identifies the host on both the local
network and all IP networks. IP addresses relate to the networking layer of the OSI model (layer
3). The networking layer handles network (logical) addressing and routing of packets.
IP addresses must be globally unique. No two hosts on any public IP network can have the same
address. The only exception to this rule is when one network is isolated from other networks
either because it is a stand-alone network, or because the network is hidden from other connected
networks via a NAT box, gateway, or proxy server. In the latter case, a globally unique IP address
is substituted for the host addresses sourcing packets bound for another network (see the
subsequent section on public and private addressing).

DEFINING A HOST
A host is any device with a network interface assigned an IP address. We often think of a
device with an IP address as a workstation or a server but a number of devices firewalls,
printers, NAT devices, and especially routers have interfaces with an IP address assigned to
each interface. Even layer 2 switches, which mostly deal with physical (MAC) addresses, may
have an IP address assigned to an interface for management purposes.
A term sometimes used interchangeably with host is node. The two terms are very similar in
that they both point to addressable devices connected to a network. However, a host is
specifically related to a device with an IP address, whereas a node may or may not be configured
with an IP address (it might be accessed only by its MAC address or it may also have a differing
type of network address such as an IPX address). The term node therefore is a more generic than
the term host.

In the current widely deployed version of IP, IPv4, an IP address is a 32 bit binary number. For
ease of readability it is often expressed in decimal format. To make it even easier to discern an IP
address, it is usually represented in dotted decimal format, meaning a period is inserted every 8
bits (1 byte). This results in a 4-part number expressed in decimal form as shown in the table
below.

Copyright 2001-06 by New Frontier Training

Chapter 1 A Review of IP Addressing


Binary
Decimal
Dotted Decimal

11001000 11001000 11001000 00000001


336,860,601
200.200.200.1

A 32 bit IP address expressed in 3 different formats

Each of the four portions of the decimal number is known as an octet. This term is derived from
the fact that each octet is 8 bits in size. This means that each octet can vary in value from 0-255,
for a total of 256 possibilities (28 = 256). Which brings us to the next logical question: How many
unique addresses can an IP address represent? Calculating the answer in decimal, we get the
following:

256*256*256*256 = 4,294,967,296
Yep, thats over 4 billion possibilities. However, the next thing to understand about an IP address
is that it represents not one, but two elements. An IP address represents not only a particular host,
but also the network the host is a part of. The host portion of the address must be unique within a
given network, whereas the network portion of the address must be globally unique among all
possible connected networks.

Working with Binary Numbers


Not all of us are necessarily comfortable with binary numbers. Paradoxically, many nuances
of IP addressing, such as subnetting, are more easily understood if the address is expressed in
binary form. That is why many of the examples in this section will have the address
expressed in both decimal and binary forms.
Binary numbers are actually quite easy to understand because each bit represents only 2
possibilities; 0 or 1. Therefore each additional bit doubles the number of possibilities:
1
2
3
4
5
6
7
8

bit
bits
bits
bits
bits
bits
bits
bits

=
=
=
=
=
=
=
=

2 possibilities
4 possibilities
8 possibilities
16 possibilities
32 possibilities
64 possibilities
128 possibilities
256 possibilities

0, 1
00, 01, 10, 11
000, 001, 010, 011, 100, 101, 110, 111
0000, 0001, 0010, 0011, . . . 1111
00000, 00001, 00010, 00011, . . . 11111
000000, 000001, 000010, 000011, . . . 111111
0000000, 0000001, 00000010, . . . 1111111
00000000, 00000001, 00000010, . . . 11111111

That is why an octet (8 bits) represents 256 possible numbers (0-255). 2*2*2*2*2*2*2*2 = 256.
A way to express the same thing in less space is 28, or 2 raised to the 8th power.
It is not necessary to perform any math by hand when working with IP addresses expressed in
binary format. Any calculator that can convert between decimal and binary numbers, like the
Windows calculator, will handle it for you. All that is necessary is to switch the calculator to
scientific mode. Simply start the calculator program (Start / Programs / Accessories / Calculator),
then click on View / Scientific.
To convert a decimal number to binary, click the Dec button, type in the number, and then click
the Bin button. To convert a binary number to decimal, click the Bin button, type in the number,
and then click the Dec button. For example, to convert the address 200.200.200.1 to binary, enter
each octet one at a time with the calculator set for Dec and convert to binary. The result should be

Copyright 2001-06 by New Frontier Training

Chapter 1 A Review of IP Addressing


11001000. 11001000. 11001000. 00000001. Keep in mind that most calculators wont display the
leading zeros though.
Converting from binary to decimal is the same process in reverse. Just be sure to enter the binary
numbers 8 bits (1 byte) at a time with the calculator set for Bin, and convert to Dec.
You can also easily calculate powers of 2. For example to prove that 28 indeed equates to 256, do
the following:
1. Be sure calculator is in Dec mode. Type 2
2. Click the x^y button once
3. Type 8 and press Enter
The result should be 256.

Classful Addressing
The original, and now mostly obsolete system for denoting the network/host represented by an IP
address was the classful system. You will see shortly why the system is no longer used for
allocating addresses. The classful system mandates three different types (classes) of IP addresses,
whereby entire octets are tasked with representing either the network portion or the host portion
of the address. This is illustrated in the below table.

ADDRESS
CLASS

DIVISION BETWEEN
NETWORK AND HOST
PORTION OF ADDRESS

EXAMPLES

Network.host.host.host

10.10.10.0

Network.Network.host.host

128.50.0.0

Network.Network.Network.host
Classful addressing chart

190.0.0.0

Network Numbering
In a classful addressing system, a class A network reserves the first octet for network numbering,
while leaving the remaining three octets for host numbering. A class B address reserves the first
two octets for network numbering and the remaining two octets for host numbering. A class C
address reserves the first three octets for network numbers and only one octet for host numbering.
How does this all work out? Have a look at the following table.

Copyright 2001-06 by New Frontier Training

Chapter 1 A Review of IP Addressing

CLASS

FIRST OCTET
IN BINARY

DECIMAL
EQUIVALENT

RANGE OF
ADDRESSEES

# OF
POTENTIAL
NETWORKS

00000000 to 01111111

0 to 127

0.0.0.0 to
127.0.0.0

27 or 128

10000000 to 10111111

128 to 191

128.0.0.0 to
191.255.0.0

214 or 16,384

11000000 to 11011111

192 to 223

192.0.0.0 to
223.255.255.0

221 or
2,097,152

11100000 to 11101111

224 to 239

Multicast addresses

11110000 to 11111111
240 to 255
Experimental
Number of networks for each class

In the classful system, certain bits in the first octet are frozen they form a set pattern and are
never altered. A class A address is defined by the first bit being frozen at 0. Since the network
portion of a class A network ID is confined to the first octet, that leaves 7 bits that can be
manipulated to create network IDs. 27 equates to 128 potential class A networks. Thats not very
many networks, but with three remaining octets tasked to host numbers, each network had a huge
number of potential host addresses.
Class B networks have the first two bits of the first octet frozen at 10. Since the first two octets of
a class B address form the range of network IDs, 14 bits are therefore available. 214 equates to
16,384 potential class B networks.
Class C networks have the first three bits of the first octet frozen at 110. Since the first three
octets of a class C address form the range of network IDs, 21 bits are available. 221 equates to
2,097,152 potential class C networks.
In point of fact, not every potential network address translates into a valid, usable network
address. Certain addresses are considered reserved for other uses, as shown in the table below.

NETWORK ID

COMMENT

0.0.0.0

First potential class A network address

127.0.0.0

Last potential class A network address


Used for testing. Host 127.0.0.1 is for loopback testing

128.0.0.0

First potential class B network address

191.255.0.0

Last potential class B network address

192.0.0.0

First potential class C network address

223.255.255.0

Last potential class C network address

224.0.0.0 and above

10

Multicast and experimental. Not used for host addressing


Reserved / invalid network addresses

Copyright 2001-06 by New Frontier Training

Chapter 1 A Review of IP Addressing


As a general rule, all network bits set to either 0 or 1 (not including frozen bits) create invalid
network addresses and explain why most of the above addresses are reserved. The following table
shows the actual number of usable networks.

CLASS

FIRST OCTET
IN DECIMAL

RANGE OF
ADDRESSEES

# OF USABLE
NETWORKS

1 to 126

1.0.0.0 to 126.0.0.0

27 - 2 or 126

128 to 191

128.1.0.0 to 191.254.0.0

214 - 2 or 16,382

192 to 223

192.0.1.0 to 223.255.254.0
Number of useable network IDs

221 -2 or 2,097,150

Host Numbering
The number of hosts per network varies according to the network class. Class A networks leave a
whopping three full octets for the range of host IDs for each network. Thats well over 16 million
hosts per network! Class B and C networks leave two octets and one octet, respectively, for host
addresses. The following table illustrates the number of hosts per network for each network class.

CLASS

HOST
ADDRESS
RANGE
IN DECIMAL

BINARY EQUIVALENT

# OF HOSTS
PER
NETWORK

x.0.0.1 to
x.255.255.254

x.00000000.00000000.00000001 to
x.11111111.11111111.11111110

224 -2 or
16,777,214

x.x.0.1 to
x.x.255.254

x.x.00000000.00000001 to
x.x.11111111.11111110

216 -2 or 65,534

x.x.x.1 to x.x.x.254

x.x.x.00000001 to x.x.x.11111110
Hosts per network

28 -2 or 254

As with network addresses, not all potential host addresses are valid. The rule is that a host
address of all binary zeros or binary ones cannot be assigned. A host address of all binary zeros
represents the network number itself (i.e. 1.0.0.0), and a host address of all binary ones represents
the broadcast address for the network. The above table accounts for that rule with the formula 2n
2, where n = number of host bits.
Enumerating an IP Address
The following table illustrates the range of host addresses and the broadcast address for each of
the three network classes.

Copyright 2001-06 by New Frontier Training

11

Chapter 1 A Review of IP Addressing

CLASS

EXAMPLE
NETWORK

BEGINNING
HOST
ADDRESS

ENDING HOST
ADDRESS

BROADCAST
ADDRESS

1.0.0.0

1.0.0.1

1.255.255.254

1.255.255.255

128.0.0.0

128.0.0.1

128.0.255.254

128.0.255.255

192.0.0.0
192.0.0.1
192.0.0.254
Enumerating the host IDs for an example network

192.0.0.255

Comments on the Classful Addressing Scheme


Obviously the choice of which class IP address to choose is paramount when designing a network
under this system. If a class A network is assigned to an organization with only 500 hosts, over 16
million addresses are wasted. The classful system does not allow organizations to easily share
unused host addresses with other organizations. As a matter of fact the industry got itself in a jam
a few years ago over this exact issue. So many addresses had been wasted that a crisis was
inevitable as the Internet took off in the early 90s. This has given rise to a new system for
allocating IP addresses on the Internet. This newer classless system has become the ubiquitous
way of assigning addresses, and is discussed in detail in this book. The classful system is still
used in certain circumstances however, particularly in private networks.

Public vs. Private IP Addressing


As previously discussed, IP addresses used on the Internet must be unique. Such addresses are
considered public. This is simply a range of the IP address space reserved for public use.
Isolated networks can make use of an area of the IP address range reserved as private. If a
privately addressed network ever needs to connect to another network across the Internet, the host
initiating the communication must have its private address translated to a public address (usually
through NAT).
Public Addressing
A central assigning authority allocates all addresses that will be used on the Internet. See the table
below. Synonymous terms for public addresses are registered, routable, external, legal, nonreusable, global, and globally unique addresses.
Private Addressing
RFC 1918 allocates a range of the IP address space for use by private networks. These IP
addresses can never be used on the Internet. This action was taken in the mid 1990s to conserve
the rapidly depleting number of globally unique IP addresses. Synonymous terms for private
addresses are non-routable, reserved, internal, local, reusable, illegal, and unregistered.
Since network packets with private addresses will never be routed from one domain to another,
any number of companies can use the same private addresses. Private IP addresses are free of
charge and they can be reused over and over on any number of private networks. Not so with the
venerable public range of addresses, which have become rare and expensive.

WHATS AN RFC?
An RFC, or Request For Comment, is the method used to define standards for the Internet. An
RFC starts life as a public document in draft form that is circulated in the Internet community.

12

Copyright 2001-06 by New Frontier Training

Chapter 1 A Review of IP Addressing


Each RFC has an assigned number. Once accepted as a standard, the RFC retains the same
number and is still called a Request For Comment; just one of those little oddities, like doctors
practicing medicine.

The implementation of privately addressed networks is what caused the proliferation of proxy
servers, NAT boxes, and gateways. These devices substitute a public address for a private address
when access to the Internet is required. A small pool of public addresses can serve the needs of
dozens or even hundreds of privately addressed hosts.

PUBLIC IP ADDRESS RANGE


Class A

1.0.0.0 9.0.0.0 and 11.0.0.0 126.0.0.0

Class B

128.0.0.0 172.15.0.0 and 172.32.0.0 191.255.0.0

Class C

192.0.0.0 192.167.255.0 and 192.169.0.0 223.255.255.0


PRIVATE IP ADDRESS RANGE

Class A

10.0.0.0 (1 network, 16 million+ host addresses)

Class B

172.16.0.0 172.31.0.0 (16 networks, 65K+ hosts per network )

Class C

192.168.0.0 192.168.255.0 (256 networks, 254 hosts per network )


Public / private address ranges
(Network portion of address is in BOLD)

Classless Addressing
With classless addressing the traditional dividing line between the network and host portion of the
address is blurred. While classful addressing draws the dividing line only at octet borders,
classless addressing draws the network/host line at any bit boundary. This allows for a highly
flexible addressing scheme that does not unnecessarily waste IP addresses.
Distinguishing the Network ID
The first step in understanding classless addressing is to understand how the IP stack running on a
host determines the network portion of an IP address. This is a critical step in determining which
network a destination address belongs to.
How does a host determine which network it is a part of? How does a source host determine the
network number of a destination IP address? The traditional method for making that
determination has been via a technique known as the First Octet Rule. However, as you will see,
the First Octet Rule only works in a classful environment, not in this modern world of classless
addressing. That is why the industry has shifted to using something known as a subnet mask or
prefix number to identify the network portion of an IP address. Both methods are explained
below.
The First Octet Rule
The first octet rule was the original mechanism a host employed to determine the address class of
an IP address. It was noted earlier that the value of the first few high order bits (starting left to

Copyright 2001-06 by New Frontier Training

13

Chapter 1 A Review of IP Addressing


right) define the address class. It is exactly those bits that the First Octet Rule uses to discern the
address class of the source and destination addresses of a packet.

ADDRESS
CLASS

BIT PATTERN OF
FIRST OCTET

00000000 = 0

10000000 = 128

11000000 = 192

D (multi-casting)

11100000 = 224

E (Experimental)
11110000 = 240
High order bits determine the class

Human beings usually recognize address class by memorizing the decimal number 128, which
demarcate the beginning of the class B address range (anything under 128 is therefore class A),
and the decimal numbers 192 and 223, which demarcate the class C range.
The problem with either system however, is a built-in assumption that the value of the first octet
will always dictate the network number. Unfortunately, with classless addressing re-drawing the
network/host dividing line within an octet, as opposed to between octets, that assumption is no
longer true. The address 10.4.1.1 typically represented host address 4.1.1. on network 10.0.0.0.
But with classless addressing, the address 10.4.1.1 could represent host 1.1 on network 10.4.0.0 ,
or host .1 on network 10.4.1.0 (you will see why later). The First Octet Rule fails in a classless
environment because IP will fail to understand that a packet with a destination address of say,
10.4.1.1 may need to be routed to a different network. This is why no modern networking devices
use the First Octet Rule for determining the network portion of an address.
The Subnet Mask
The contemporary method for determining the network address is the subnet mask. A subnet
mask does just what it implies; it masks (blocks out) out the host portion of the address, thereby
revealing just the network number. Why is it called a subnet mask and not a network mask?
Actually, sometimes it is. Its also referred to as the net mask, the subnet address, or simply the
mask.
The subnet mask, like an IP address, is a 32 bit number expressed in dotted decimal format. For
classful networks, it takes the form shown below.

ADDRESS
CLASS

DEFAULT
SUBNET MASK

255.0.0.0

255.255.0.0

C
255.255.255.0
Subnet mask used for each network class

14

Copyright 2001-06 by New Frontier Training

Chapter 1 A Review of IP Addressing

Typical IP configuration on a Windows workstation

IP uses a simple mathematical process called ANDing in conjunction with the subnet mask to
actually derive the network number from an IP address. ANDing is a Boolean logic process that
says that at least two things must be true before an action is taken. People actually use this type of
logic in everyday life; If you take the car to work and you have time, stop by the store for
groceries on your way home. The recipient of the message will only bring home groceries if
he/she has both time and a vehicle (or get groceries regardless, to avoid getting into trouble with
their mate, but thats a different branch of logic). Its called Boolean logic because a
mathematician named George Boole popularized it in the 19th century. The ANDing process is
performed on the IP address and the subnet mask to extract the network. It is explained in detail
in the chapter 2.
Prefix Notation
Prefix notation is simply an alternate method of expressing a networks mask. Prefixes are cool
because they express the address mask in less space. In prefix notation, a single number preceded
by a / is used instead in the usual dotted decimal format. As you may deduce from Table 1.13,
prefix notation simply reflects the number of bits turned on in the mask. Notice the default mask
in the table expressed in binary form. The first three octets of 255 each represent all binary bits
turned on; 24 bits turned on. Thus the prefix of /24.

EXPRESSED IN DECIMAL

255.255.255.0

EXPRESSED IN BINARY

11111111.11111111.11111111.00000000

/24
EXPRESSED IN PREFIX
NOTATION
Three ways to express the same a network mask

Copyright 2001-06 by New Frontier Training

15

Chapter 1 A Review of IP Addressing


By the same token, a class A mask would be represented as /8 in prefix notation (255.0.0.0) and
a class B mask would be /16 (255.255.0.0). A very simple system. More and more networking
equipment and operating systems allows you to enter the network mask as a prefix number in lieu
of a subnet mask, like Windows XP for example. Prefix notation is also commonly used by public
WAN carriers. If you are assigned a network number by your ISP, the mask will usually be
notated in prefix format.
Prefix notation is also known as slash notation, prefix masking, prefix address and prefix routing,
just to name a few synonyms.

The Manifestations of Classless Addressing: Subnetting, Supernetting, CIDR,


VLSM
If the concepts of subnetting, VLSMs, supernetting or CIDR have daunted you in the past, rest
easy. All this stuff is basically the same thing! They are each just slightly different manifestations
of the basic concept of classless IP addressing; which is simply the process of drawing the
network/host dividing line at bit boundaries as opposed to octet boundaries. Drawing the
network/host line between any two bits breaks all the old rules something that is always fun to
do. In this final section of the chapter we wish to briefly define the difference between the various
classless addressing techniques in order to give you a point of reference as you learn all about
classless routing throughout the balance of the book.
Subnetting in brief
Subnetting is the act of taking a single IP network ID and sub-dividing it to create two or more
network IDs. Subnetting is performed whenever there is a need to split an existing network
number into multiple subnets. Subnetting has often been used to extend the life of a public IP
address, since such addresses are rare and expensive. However, subnetting can also be performed
on private addresses, particularly when it is desired to maintain the hierarchical addressing
scheme of a network.
Subnetting is accomplished by relocating the net-work/host dividing line to the right from its
originally assigned position into the portion of the address representing the host IDs. As the line
moves to the right, bit by bit, additional network IDs are created, as host IDs are sacrificed.
Thats the trade off. The further the line is moved to the right, the more networks (subnets) are
created, with a fewer number of hosts per network. This borrowing of host bits is accomplished
by altering the original subnet mask of the network ID. A custom mask (prefix) is how IP
discerns the subnets that were created by the bit borrowing process.
RFCs related to subnetting: 950

16

Copyright 2001-06 by New Frontier Training

Chapter 1 A Review of IP Addressing


VLSMs in Brief
In standard subnetting, the alteration made to the subnet mask to create additional subnets is
applied to all hosts residing on all subnets. This results in each subnet containing the same
number of potential host addresses. But with Variable Length Subnet Masks (VLSMs), the subnet
mask can be altered (varied) again for one or more of the subnets. In effect this is sub-subnetting.
The reason for this apparent insanity is the same as it always is when submerged in the world of
classless addressing that is to provide the utmost in addressing utilization. A standard subnetted
class C address may yield say, two subnets with 62 hosts per subnet. But what if one subnet
requires 62 hosts and another requires say, only 2 host IDs? In that case one of the subnets could
itself be subnetted further, creating additional subnets with the specified number of hosts per
subnet. You could make a whole bunch of 2-host subnets, or reserve some of the address space
for other sized subnets as the need arose. There is no limit to the amount of times a network can
be summarization up until the entire address space is exhausted.
RFCs related to VLSMS: No specific RFC, but VLSMs are referred to in the RFC for CIDR. See
the subsequent section on CIDR.
Supernetting in Brief
Supernetting is simply the reverse of standard subnetting. Instead of moving the network/host
dividing line to the right creating additional networks with fewer hosts per network, the line is
moved to the left creating fewer networks with a greater number of hosts per network. This
technique is applied to contiguous blocks of network IDs to create a single network number with
the combined total of all host IDs that were originally spread out among several addresses.
Supernetting allows an organization that was assigned say, four public class C networks, to
combine them into a single network ID and thus avoid the need to route traffic between networks.
At the assignment level where public addresses are allocated, supernetting at one time was used
to allocate addresses more efficiently. Take an organization requiring 1,000 addresses. It was
smarter to supernet the four addresses into a single ID before making the assignment, because
then a single entry in the ISPs route tables was sufficient to route packets properly for the
organization. Could the organization receiving the block of supernetted addresses then subnet the
network ID back into multiple subnets? Sure. Could it even variably subnet the ID, creating any
combination of subnets and hosts per subnet that it wished (within the confines of the total
addressable space of the ID)? Absolutely. Bear in mind however that supernetting at the
assignment level has been replaced by the more efficient CIDR system.
RFCs related to supernetting: 1338
CIDR in Brief
Classless Inter-Domain Routing is the contemporary method address allocation occurs on the
Internet today. The assigning authority no longer wastes entire classful addresses by handing out
say, a class B address with 65,000+ host IDs. Instead, what were class A, B or C addresses are
now simply treated as 32 bit numbers whose network/host dividing line can be drawn at any
point. Every public network ID is treated the same, regardless of its previous class distinction. A
CIDR address block is assigned with the network/host dividing line set to match the
requirements of the organization receiving the address. Organizations receive very close to the
exact number of addresses they need; no more, no less.
A pleasant side effect of allocating addresses in this manner allows the minimization of the
number of route table entries on Internet routers. Blocks of CIDR assigned addresses can be
summarized into a single route table entry, regardless of the number of networks actually
Copyright 2001-06 by New Frontier Training

17

Chapter 1 A Review of IP Addressing


represented. The concept of route summarization goes hand-in-hand with classless addressing
techniques.
RFCs relating to CIDR: 1517, 1518, 1519, 1520

18

Copyright 2001-06 by New Frontier Training

Chapter 2 Why Classless


Addressing Works

Chapter 2 Why Classless Addressing Works

Overview
This short but important chapter helps you understanding just why classless addressing works.
You dont need to remember what you read here in order to subnet a network. Its just that
classless addressing is . . . well . . . weird. It doesnt look like it should work yet it does.
Understanding the mechanism that allows the IP stack running on a host to forward packets
correctly is the key to feeling comfortable with all aspects of classless addressing. It will also help
you understand why certain legacy networking equipment and routing protocols dont support
classless addressing.

Its All About Determining Where To Forward Packets


Whenever you are dealing with hosts communicating across networks, the first question that must
be asked about an outbound packet is: What network are you bound for? TCP/IP handles packets
very differently depending upon whether the destination host is on the same network or another
one.

WHAT IS A HOST?
A host is any device with an interface that requires a TCP/IP address. Such devices include
workstations, servers, routers, firewalls, printers, NAT devices and more. Every device on an IP
network must have at least one interface connecting it to the network, and each interface must
be assigned an IP address. The generic term host is used to refer to any such device.
The use of the term host in this book is mostly in the context of workstations and servers.
So in this case, host is just a short hand way of saying workstations or servers.

Take a look at the following two simplified scenarios. In the first scenario, communications are
taking place between two hosts on the same network. In the second scenario, the hosts are on two
different networks.
Scenario 1
Both hosts on the same network
Source host (A)
190.1.1.1

1.
2.
3.
4.
5.

20

Destination Host (B)


190.1.1.2

Host A wants to send a packet to host B.


Host A checks to see if host B is on the same network and determines that it is.
Host A sends a BROADCAST packet asking for the MAC address of Host B.
Host B receives the BROADCAST packet and responds to Host A with its MAC address.
Using the MAC address, host A sends the packet to host B.

Copyright 2001-06 by New Frontier Training

Chapter 2 Why Classless Addressing Works


Scenario 2
Each host on a different network
Source host (A)
190.1.1.1

Destination Host (B)


200.1.1.1

1. Host A wants to send a packet to host B.


2. Host A checks to see if host B is on the same network and determines that it is not.
3. Host A examines its local route table to see if the target network is listed. If so, the router
specified in the route table is queried for its MAC address. If not, the host checks for a
configured default gateway, and queries the address specified for a MAC address (if there
is neither a route table entry or a configured default gateway, the packet is dropped and
an error message is generated).
4. The router responds to Host A with its MAC address.
5. Using the MAC address, host A sends the packet to the router.

WHAT IS A BROADCAST PACKET?


Broadcast packets are a way of shouting to everyone on the network. A sending host needs
the MAC address of the destination host in order to deliver its payload. A broadcast packet
satisfies this need by sending an announcement to ALL hosts on the network asking for their
MAC addresses. The packet includes the destination hosts IP address. Only the host with an IP
address matching the one in the broadcast packet responds with its MAC address.

WHAT IS A MAC ADDRESS?


MAC (Media Access Control) addresses are the unique identifying numbers burned into every
network interface card (NIC). MAC addresses are known as physical addresses because they are
permanently associated with the NIC, whereas IP addresses are known as logical addresses
because they can be reassigned from one host to another. Communications can only take place
between two hosts via their MAC addresses.

Notice the difference in the two scenarios. If the destination host is on the same network, it is
only necessary to learn its MAC address and then communications can commence. If however the
destination host is not on the same network, things are different. In that case the packet must be
forwarded to a router. The router then handles the job of getting the packet to its destination.
Depending on the location of the target network, this may involve other routers as well. All of
this, though, depends on accurate determination of the destination packets network ID.

Determining the Network Number of a Destination IP Address.


In was previously noted that in the legacy days of a classfully addressed world, the First Octet
Rule was used by the IP stack to determine how destination packets should be forwarded. The
First Octet Rule fails in a classlessly addressed environment however because the rule assumes
that the network/host dividing line occurs at only three points in the 32 bit address. Packets cant
be forwarded unless the network ID can be properly derived. Contemporary IP stacks therefore
use a subnet mask, which fix the network/host dividing at any bit boundary. But how exactly does
Copyright 2001-06 by New Frontier Training

21

Chapter 2 Why Classless Addressing Works


this mask work? Thats where the ANDing process comes in. Understanding ANDing translates
to understanding classless addressing.
The ANDing process
The IP stack uses the ANDing process to perform a simple bit by bit comparison of an address
and its mask to derive the network ID of the address. This process occurs for both the source and
destination addresses. The derived network IDs of the two addresses are then compared. If they
dont match, the packet is routed to another network.
Example 1 - Source/destination on Same Network
Lets convert the source and destination class C addresses from Scenario 1 into binary and
examine the ANDing process IP goes through to determine if the two IP addresses are on the
same network.

Source Address: 190.1.1.1 /24


Address
Binary equivalent

Subnet mask
Binary equivalent

ANDing

190

.1

.1

.1

10111110

00000001

00000001

00000001

255

.255

.255

.0

11111111
11111111
11111111
00000000
==============================================
10111110
00000001
00000001
00000000

Network address 190

.1

.1

.0

_________________________________________________________________

Destination Address: 190.1.1.2


Address
Binary equivalent

Subnet mask
Binary equivalent

ANDing

190

.1

.1

.2

10111110

00000001

00000001

00000010

255

.255

.255

.0

11111111
11111111
11111111
00000000
==============================================
10111110
00000001
00000001
00000000

Network address 190

22

.1

.1

.0

Copyright 2001-06 by New Frontier Training

Chapter 2 Why Classless Addressing Works


What ANDing basically does is pass through network bits where that mask is set to 1 and block
network bits where the mask is set to 0.
More specifically, for each of the two addresses, IP compares each bit in each network octet with
the corresponding bit in the subnet mask. To illustrate, the very first bit in the source address 190
octet is 1. This will be matched with the very first bit in the first 255 octet, which also happens
to be 1. For each bit compared, IP says: If the source address bit is set to 1 AND the
corresponding subnet bit is set 1, then pass a 1 through. If not, pass a 0.
If either bit had been set 0 the test would have failed and IP would then pass a 0. An example
of this is the second bit over. The second bit for the source address is set to 0. The
corresponding bit in the subnet mask is set to 1. The test fails and IP passes through a 0. In
other words both bits must be set to 1 in order to pass a 1. Any other combination renders
a 0. Its actually a very simple rule.
After both addresses have been ANDed, the results are compared to see if the source network
and the destination network are the same. In this case they are. Note that the different host
address (.2 compared to .1) had no impact on the result because host addresses are always filtered
out since the host portion of the mask is set to 0. Since the network numbers match, the
destination address is known to be on the same network as the source address, and IP goes about
the business of determining the targets MAC address so that the two hosts can communicate.
Example 2 Source/destination on Different Networks
To complete our treatment of the ANDing process lets perform it on the addresses from scenario
2. In this case the target host is on a different network.

Source Address: 190.1.1.1 /24


Source address
Binary equivalent

Subnet mask
Binary equivalent

ANDing

190

.1

.1

.1

10111110

00000001

00000001

00000001

255

.255

.255

.0

11111111
11111111
11111111
00000000
==============================================
10111110
00000001
00000001
00000000

Network address 190

.1

.1

.0

_________________________________________________________________

Copyright 2001-06 by New Frontier Training

23

Chapter 2 Why Classless Addressing Works

Destination Address: 200.1.1.1


Target address
Binary equivalent

Subnet mask
Binary equivalent

ANDing

200
11001000

.1

.1

.1

00000001

00000001

00000001

255

.255

.255

.0

11111111
11111111
11111111
00000000
==============================================
11001000
00000001
00000001
00000000

Network address 200

.1

.1

.0

IP performs a comparison of the ANDing results and determines that address 200.1.1.1 is on a
different network than 190.1.1.1. The packet is therefore forwarded to another network.
Note: TCP/IP in fact does not know the subnet mask value of the destination address. It only knows the mask of the
source address. IP applies the sources subnet mask to the target IP address when ANDing. Even though IP does not
know if the target address uses a differing mask, the process can be trusted, because ANDing tells enough to know
whether the target address belongs to the current network or not. Exactly which network the address in fact belongs to
will be left to the routing process.

Example 3 Classless Addressing in Use


Now lets try a classless example. We expect ANDing will work exactly the same because it
takes no measure of traditional classful boundaries. Lets see.

Source Address: 42.2.0.1 /17


Source address
Binary equivalent

Subnet mask
Binary equivalent

ANDing

42

.2

.0

.1

00101010

00000010

00000000

00000001

255

.255

.0

.0

11111111
11111111
10000000
00000000
==============================================
00101010
00000010
00000000
00000000

Network address 42

.2

.0

.0

_________________________________________________________________

24

Copyright 2001-06 by New Frontier Training

Chapter 2 Why Classless Addressing Works

Destination Address: 42.2.128.1


Source address
Binary equivalent

Subnet mask
Binary equivalent

ANDing

42

.3

.0

.1

00101010

00000010

10000000

00000001

255

.255

.0

.0

11111111
11111111
10000000
00000000
==============================================
00101010
00000010
10000000
00000000

Network address 42

.3

.128

.0

Indeed, it is determined that the addresses belong to differing networks. ANDing gave no regard
to classful boundaries. If the 42.0.0.0 had been assigned a traditional class A prefix of /8, the
source and destination addresses would have considered part of the same network. Regardless of
where the network/host dividing line is set for an address, ANDing will always extract the correct
network ID.
With an understanding of the contemporary process for determining the network portion of an
address, you are now prepared to step into the world of subnetting, variable subnetting,
supernetting, and CIDR in the following chapters.

Copyright 2001-06 by New Frontier Training

25

Chapter 2 Why Classless Addressing Works

Chapter 2 Summary

26

When a host starts a communication session with another host, the first thing it must
check is whether the target host is on the same network as the source.
Although humans tend to use the value of the first octet to determine the network portion
of an IP address, TCP/IP uses the subnet mask (i.e. prefix). The subnet mask marks the
dividing line between the network and host portion of an IP address.
The ANDing process uses the subnet mask of the source and destination addresses of a
packet to extract the network number. IP then knows whether to deliver the packet locally
or route it.

Copyright 2001-06 by New Frontier Training

Chapter 3 Subnetting
Explained

Chapter 3 Subnetting Explained

Overview
This chapter explains subnetting A-Z. Recall that the basic purpose of subnetting is to derive
additional networks from a single network address. Classful examples are used for clarity, but the
drill is the same for classless network IDs that will be subnetted. Furthermore, subnetting
techniques are the same for private or public addresses.

How to Subnet
Subnetting is accomplished by altering the originally assigned subnet mask for the network ID. A
custom subnet mask creates additional networks (subnets) within an organization by borrowing
bits from the host portion of the address to create additional network IDs. The result is that you
end up with fewer host addresses.
The following items must be taken into consideration when subnetting:

Determine the total number of subnets needed. This includes planning for future networks
Determine the total number of hosts that each subnet must support now and in the future
Define a custom subnet mask that will support the required number of hosts for that subnet
Derive the subnet IDs
Derive the host IDs for each subnet

Derive the broadcast address for each subnet


This process is accomplished in the three steps noted below. The concept of subnetting is far
more easily illustrated by looking at the subnet mask in its binary form. Therefore, the examples
will show the mask in both decimal and binary formats.

Subnetting a Class C Network Address


Step 1 - Create additional network numbers by using a custom subnet mask.
This example assumes an organization has configured the private address 192.168.50.0 /24 on its
network. The organization now wishes to create two smaller networks connected by a router to
reduce broadcast traffic.
1st octet
IP address
Default Subnet
mask
Binary equivalent
of subnet mask

2nd octet

3rd octet

4th octet

192

.168

.50

.0

255.

.255

.255

.0

11111111

11111111

11111111

00000000

NETWORK
Default network/host dividing line for a class C address

HOST

Note the dividing line separating the network portion of the address from the host portion of the
address. This is the default dividing point for a class C address.

28

Copyright 2001-06 by New Frontier Training

Chapter 3 Subnetting Explained


Borrowing Bits
Creating additional network IDs involves moving the dividing line to the right into the host
portion of the address. In effect you are removing bits from the host portion of the address and
supplying them to the network ID side. The more bits you borrow, the more network IDs you
create, because the new subnet IDs are formed strictly from the various combinations of the
borrowed bits. Keep in mind however that the more bits you borrow, the fewer bits there are for
host IDs.
The following example borrows 2 bits. Subnetting bits are always borrowed starting from the left
end (high order) of the host portion of the address. Lets see how many networks we can create
from two bits.

Default mask
Borrowing
Turn bits on

1st octet
11111111
11111111

2nd octet
11111111
11111111

3rd octet
11111111
11111111

4th octet
00

00000000
000000

11111111

11111111

11111111

11

000000

NETWORK ID
Subnet ID
Borrowing bits causes the network/host dividing line to be redrawn

HOST ID

The first row shows the original dividing line of the address. In the second row, the bits have been
borrowed from the 4th octet, moving them into a new field called the Subnet ID. In the third row
the borrowed bits have been turned on (set to 1). This last step is critical. This is how IP knows
the dividing line has been moved to the right. IP always identifies ON bits in the mask (1) as
network bits and OFF bits (0) as host bits. Note that the new subnet ID field is made up solely
of borrowed bits. Well figure out how many networks the subnet ID represents in a moment, but
first lets derive the new mask.
Determining the custom subnet mask
The custom subnet mask is determined by simply converting the modified fourth octet back to
decimal, which is always comprised of 8 bits, regardless of their purpose.
Altered
Subnet mask

1st octet

Decimal
From 3rd row of
previous table

255
11111111

2nd octet

3rd octet

.255
11111111

.255
11111111

4th octet
.192
11

NETWORK ID
Subnet ID
Altered subnet mask converted back to a decimal number

000000
HOST ID

Note the above table. Nothing has changed in the first three octets. In the fourth octet, the binary
number 11000000 converts to 192. Thus 255.255.255.192 is the new subnet mask for this
network, replacing the default mask. The new mask will be used by ALL hosts on ALL newly
formed subnets. Now you know why its easier to understand this in binary. Its hard to draw a
dividing line on the decimal number 192! But in fact .192 now partially represents the network ID
and partially represents the host IDs. Its weird, but it works.

Copyright 2001-06 by New Frontier Training

29

Chapter 3 Subnetting Explained


Note: We strongly suggest that you perform the binary to decimal conversion yourself. Its very easy. Just use the
Windows Calculator program, in scientific mode (click on View / Scientific).

As you can see, the mechanics of creating a custom subnet mask are relatively easy. Just
remember that you always borrow from the host portion of the address.
Step 2 - Determine the subnet IDs
Now that the new subnet mask has been determined its time to derive the subnet IDs. We are
interested in how many subnets have been created, as well as each subnets ID.
The total number of subnets created is based on the possible combinations of the borrowed bits.
Binary numbering only allows for two possible values for each digit; 0 or 1. In our example with
2 borrowed bits, there are four possible combinations. Both bits can be turned OFF (00), both bits
can be turned ON (11), or one bit can be OFF and one ON (01), and vice-versa (10).
Note: You can also do the math with the calculator by setting it to binary mode, start with 00, add 1, and continuously
add 1 to the result (just remember that the calculator wont display leading zeros).

WHAT HAPPENS TO THE 192.100.50.0/24?


The first thing to remember when determining subnet IDs is that the original network number
in this case 192.100.50.0/24 is rendered invalid when subnetting. Instead, all network IDs (we
can start calling them subnet IDs) are based on the borrowed bits. The only place the
192.100.50.0/24 ever be seen again is possibly in the routing tables of a router. 192.100.50.0/24 in
fact refers to the entire group of subnets as a whole and could be entered on certain routers to
point the way to all those subnets, if the subnets all happen to be downstream of the router. This
is known as network summarization or route aggregation, and is a powerful way to reduce the
number of routing entries in a bloated route table.

00

01

10

11

As shown above, two binary bits can form a maximum of four combinations. That is the
maximum number of subnets in this example. However, there is a catch. Its the first gotcha.
Any combination of all binary 0s or all binary 1s is an illegal network number1. The number 0 is
an invalid network ID, and all binary 1s represent a broadcast address, which allows a host to
send a message to everyone on the network. Therefore, you always lose two potential network
IDs when you subnet (and all the host addresses associated with them!). Therefore in this
example we are left with two valid network numbers to work with (now you know why we
started by borrowing two bits).
00

01

10

11

Enumerating the subnet IDs


To enumerate or list the dubnet IDs, simply combine each valid bit combination back with the
remainder of the host ID the bits were borrowed from and convert the number back to decimal.
Append the result to the original network address.

See appendix F for an exception to this rule for Cisco routers

30

Copyright 2001-06 by New Frontier Training

Chapter 3 Subnetting Explained

4th octet
Borrowed bits

Remainder of host ID

Combine and
Convert to Decimal

00
01
10
11

000000
000000
000000
000000

Invalid
01000000 = 64
10000000 = 128
Invalid

Subnets
Resulting network numbers

192.100.50.0
192.100.50.64 /26
192.100.50.128 /26
192.100.50.192

Determining the new subnet IDs

The first column of this table reflects the possible combinations of the 2 bits borrowed from the
host portion of the address. The second column simply lists the remaining bits of the Host ID.
The third column of the table combines the borrowed bits back with the remaining host bits, and
converts the resulting number to decimal. The fourth column reflects the newly created subnet
IDs. It takes longer to explain than to do it.
If you were not familiar with subnetting you could easily mistake those subnet numbers for host
addresses. To the naked eye those addresses looks like a reference to host 64 and host 128 on
the 192.100.50.0 network. However, they are NOT host addresses anymore. They are subnet
addresses. The .64 marks the beginning of the 192.100.50.64 network. The .128 marks the
beginning of the 192.100.50.128 network. The .64 and .128 will never again be host addresses on
this subnetted network.
Note: Remember the cardinal rule of subnetting when converting binary numbers to decimal: Always convert the entire
octet. Even if bits have been borrowed from an octet to create subnet IDs, you ALWAYS treat the octet as a whole when
converting to decimal!

Step 3 - Determine the Host IDs


The last step of the process is to determine the host IDs belonging to each subnet. Originally this
class C network number was capable of supporting 254 hosts (190.100.50.1 190.100.50.254).
However many host addresses are rendered invalid once subnetting occurs, so its important to
understand which host addresses remain and which subnet they belong to.
The range of host addresses available is derived from the remaining bits in the host portion of the
address. In this example 6 bits remain. You can quickly calculate the total number of hosts per
subnet with the formula

2n 2

(where n = the number of remaining bits)

Note: This is the same formula used to determine the number of valid network numbers for a given subnet mask.

In this case the formula plays out like this: 2*2*2*2*2*2 - 2 = 62. The reason that two is
subtracted from the total is because, like a network address, a host address of all binary 0s or all
binary 1s is invalid. All host bits set to 0 always represent the Subnet itself. For instance, all
bits set to 0 equate to .64, the ID of this subnet. All host bits set to 1 represent the broadcast
address for the subnet.

Copyright 2001-06 by New Frontier Training

31

Chapter 3 Subnetting Explained


Its quite easy to calculate the host addresses for each subnet. Begin by calculating the first valid
host ID for the first network ID. The first host ID is just one number higher than the network
number.
192.100.50.64 /26 subnet
Host ID
1st host ID
2nd host ID
3rd host ID
4th host ID

Binary format

Covert to decimal

Complete host address

.65
.66
.67
.68

192.100.50.65
192.100.50.66
192.100.50.67
192.100.50.68

Subnet ID Host ID

01
01
01
01

000001
000010
000011
000100

And so on . . .
61st host ID
62nd host ID

01
111101
.125
192.100.50.125
01
111110
.126
192.100.50.126
Note: 192.100.50.127 is the broadcast address for the subnet (all host bits turned on)
Enumerating the host IDs for the .64 subnet

The first host ID is just the subnet number plus one, and the last host ID is just two shy of the
next subnet, the .128. More specifically, all host bit OFF except the low order bit equates to
the first host ID. All host bit ON except the low order bit equates to the first host ID. Now
lets calculate the host IDs for the .128 subnet:
192.100.50.128 /26 subnet
Host ID
1st host ID
2nd host ID
3rd host ID
4th host ID

Binary format

Covert to decimal

Complete host address

10 000001
10 000010
10 000011
10 000100

.129
.130
.131
.132

192.100.50.129
192.100.50.130
192.100.50.131
192.100.50.132

And so on . . .
61st host ID
62nd host ID

10 111101
.189
192.100.50.189
10 111110
.190
192.100.50.190
Note: 192.100.50.191 is the broadcast address for the subnet (all host bits turned on)
Enumerating the host IDs for the .128 subnet

The table below summarizes the newly subnetted network.


SUBNET 1
Original Network Address
Custom subnet mask
Derived Network Address 1
Begin host address
Ending Host address
Total valid hosts
Broadcast address

192.100.50.0
255.255.255.192
192.100.50.64
192.100.100.65
192.100.100.126
62
192.100.100.127

SUBNET 2
Original Network Address
Custom subnet mask
Derived Network Address 2
Begin host address
Ending Host address
Total valid hosts
Broadcast address

192.100.50.0
255.255.255.192
192.100.50.128
192.100.100.129
192.100.100.190
62
192.100.100.191

The host IDs .1-.63 and .193-.254 are gone. They are rendered useless because they are
now owned by invalid network IDs 192.100.50.0 (invalid because the subnet ID is all binary 0s), and
192.100.50.192 (invalid because the subnet ID is all binary 1s).
The new 192.168.50.0

32

Copyright 2001-06 by New Frontier Training

Chapter 3 Subnetting Explained

The Proof is in the Anding


If you have any doubts about how the convoluted process of subnetting works (were worried if
you dont) you can prove to yourself that it works beyond the shadow of a doubt by performing
the ANDing process.
Example: Host 190.100.50.65 sends a packet to host 190.100.50.129. Which subnet will IP
determine the destination host is a part of?
Source address
Binary equivalent

Subnet mask
Binary equivalent

ANDing

190

.100

.50

.65

11000000

01100100

00110010

01000001

255

.255

.255

.192

11111111
11111111
11111111
11000000
==============================================
11000000
01100100
00110010
01000000

Network address 190

.100

.50

.64

_________________________________________________________________
Target address
Binary equivalent

Subnet mask
Binary equivalent

ANDing

190

.100

.50

.129

11000000

01100100

00110010

10000001

255

.255

.255

.192

11111111
11111111
11111111
11000000
==============================================
11000000
01100100
00110010
10000000

Network address 190

.100

.50

.128

Remember that the ANDing process masks out the host portion of the address, leaving just the
network portion. Before subnetting, ANDing would have determined that the target host was on
the same network. After subnetting, the ANDing process shows the target address as being part of
a different network and forwards the packet to a router.

Subnetting Summed Up

Determine the total number of subnets needed. This includes planning for future networks.
Determine the total number of hosts that each subnet must support now and in the future.
Define a custom subnet mask that will support the required number of hosts for that subnet.
Derive the subnet IDs.
Derive the host IDs for each subnet.

Derive the broadcast address for each subnet.

Copyright 2001-06 by New Frontier Training

33

Chapter 3 Subnetting Explained

DETERMINING HOW MANY HOST BITS TO BORROW


In the current example we arbitrarily borrowed 2 bits and happened to end up with two
networks. In reality you will be trying to create a specific number of subnets. Although you can
learn a Quick and Dirty way to do this in the appendix, the formula normally used is:
2n 2, (where n= the number of bits borrowed)
For example if you borrowed 3 bits, the formula would be (2*2*2) 2, which is 6. That means
borrowing three bits would yield six subnets.

Unless you are a hotshot brainy type it might take a couple of passes for all this subnetting stuff
to sink in. Dont hesitate to go through this chapter more than once, and when you feel ready you
can move on to the subnetting exercise in the next chapter.

34

Copyright 2001-06 by New Frontier Training

Chapter 3 Subnetting Explained

Chapter 3 Summary

A single network is subdivided into multiple networks by relocating the network/host


dividing line.
Subnets are created by borrowing bits from the first host portion of an IP address.
When subnetting a network, the original network number becomes invalid.
When subnetting a network, many host addresses become invalid.
New subnet IDs are derived solely from the borrowed bits.
A subnet ID can never be all binary 0s. All 0s is an invalid network ID. A subnet ID
can never be all binary 1s. All 1s represents the broadcast address for all hosts on all
subnets.
A host ID can never be all binary 0s. All 0s represents the subnet ID. A host ID can
never be all binary 1s. All 1s represents the broadcast ID for all hosts on that subnet.
To calculate the subnet IDs, one at a time combine each valid combination of the
borrowed bits with the remainder of the octet they were borrowed from and convert to
decimal.
To calculate the first host ID for a subnet, turn all host bits OFF except the low order bit,
combine with the subnet ID bits and convert to decimal. Calculate the last host ID by
turning all host bits ON except the low order bit, combine with the subnet ID bits and
convert to decimal.
It is much easier to understand subnetting if the subnet mask is temporarily converted to
binary.

Copyright 2001-06 by New Frontier Training

35

Chapter 4 Supernetting
Explained

Chapter 4 Supernetting Explained

Overview
Supernetting is the reverse of subnetting. With supernetting, rather than dividing one network
number into multiple routed subnets, you instead combine several network numbers into one
larger network hence negating the need for a router between subnets.

Why Supernetting is Dead


Supernetting, at the assignment level, is dead as a doornail. Why? Its been replaced by a superior
solution CIDR. Bear in mind however that many texts, websites, and some folks in the industry
still refer to classless addressing and CIDR notation as supernetting, using the terms almost
interchangeably. Thats fine. . . supernetting and CIDR both use the same core process that
makes all classless addressing work the placing of the network/host dividing line at bit
boundaries as opposed to octet boundaries. And, supernetting and CIDR both refer to the concept
of aggregating a number of subnets into a single network ID.
So whats the difference between supernetting and CIDR? The distinction will be made clear in
this chapter and the next, but in brief, a traditional definition of supernetting refers to taking a
number of class C addresses and manipulating the prefix such that a single network ID is created.
How that is done will be demonstrated shortly, but the result is that by aggregating several
networks into one, an organization with modest host requirements could be assigned an allocation
of addresses closer to its actual needs, rather than burning an entire class B address and waste
thousands of IP addresses. Supernetting was a sort of bottom-up approach. CIDR on the other
hand takes a more top-down approach, because CIDR works with raw 32 bit addresses having
no class distinction of any sort. CIDR therefore has no need to aggregate pre-existing, class based
addresses. This results in a more flexible was of assigning address space.
We include this chapter of the book for two reasons. For one thing, its interesting and
educational to see how traditional supernetting is applied. For another, supernetting is sometimes
still used at the organizational level. For example, say an organization has several legacy public
class C network IDs. Such addresses are valuable, and the organization may not wish to
relinquish them. However, the organization wants to aggregate two or more of the class C
networks in order to eliminate a router. You cant just renumber the network, since public
addresses are in use. In this case supernetting would solve the problem nicely.

How to Supernet
Supernetting is far easier than subnetting. Its only a one step process. In supernetting, instead of
borrowing bits from the host portion of the address to create additional network IDs, you instead
borrow bits from the network portion of the address to reduce the number of networks. To
illustrate, look at the following table showing four contiguous network IDs and their binary
equivalent:
Network ID 198.53.212.0
Network ID 198.53.213.0
Network ID 198.53.214.0
Network ID 198.53.215.0

11000110.00110101.11010100.00000000
11000110.00110101.11010101.00000000
11000110.00110101.11010110.00000000
11000110.00110101.11010111.00000000

Note that when the addresses are converted to binary, the only difference is in the last two digits
of the 3rd octet in other words at the end of the network portion of the address. What would be
the effect of creating a custom subnet mask mask by donating those last two bits to the host ID
portion of the address?

Copyright 2001-06 by New Frontier Training

37

Chapter 4 Supernetting Explained

Original mask

11111111
255.

11111111
255.

11111111|
255.

00000000
0

Custom mask

11111111
255.

11111111
255.

111111 | 00
252.

00000000
0

Following standard conventions for creating custom subnet masks, the two bits in question are
turned off to represent that they are now part of the host ID. The bits left on are considered part of
the network ID.
The result of this is that the entire range of the four class C addresses can now be addressed as a
single network address! The resulting range of host IDs from the original four addresses are
grouped together in one big pool and can be allocated as needed. No subnetting of the network is
required!
The table below enumerates how altering the subnet mask in this manner pans out.
Network addresses to supernet:
Default subnet mask:
# of networks required:
# of hosts per network:
# of bits lent to network octet:
Custom subnet mask:

190.53.212.0, 190.53.213.0, 190.53.214.0, 190.53.215.0


255.255.255.0
1
Maximum
2
255.255.252.0

Network portion of address is shown in bold


Supernet ID
11000000.00110101.110101 00.00000000
198
.53
.212
.0

1st Host ID:

11000000.00110101.110101 00.00000001
198
.53
.212
.1

Last Host ID:


11000000.00110101.110101 11.11111110
198
.53
.215
.254

Broadcast Address
11000000.00110101.110101 11.11111110
198
.53
.215
.255
Note that the new network ID is simply the first class C address in the range.
Why were two bits donated? That is how many digits were unique in the network portion of the address. You always
donate whatever number of bits create unique addresses.

Supernetting four class C addresses

38

Copyright 2001-06 by New Frontier Training

Chapter 4 Supernetting Explained


As always, ANDing shows the story. Lets say a computer on the 198.53.212.0 network wants to
send a message to the 198.53.213.0 network. Lets assume the sending computer has the IP
address 198.53.212.25 and the receiving computer has the IP address 198.53.213.98. What
happens when TCP/IP performs the ANDing process?
Sending computer
190.
IP address
binary equiv. 11000000
Subnet mask
binary equiv.
ANDing
Subnet ID

53.

212.

25

00110101

11010100

00011001

255.

255.

252.

11111111

11111111

11111100

00000000

11000000
190.

00110101
53.

11010100
212.

00000000
0

53.

213.

98

00110101

11010101

1100010

255.

255.

252.

11111111

11111111

11111100

00000000

11000000
190.

00110101
53.

11010100
212.

00000000
0

Receiving computer
IP address
190.
binary equiv. 11000000
Subnet mask
binary equiv.
ANDing
Subnet ID

Viola! The ANDing process always has the last word. Both IP addresses appear to TCP/IP that
they are on the same network.

Copyright 2001-06 by New Frontier Training

39

Chapter 4 Supernetting Explained

Chapter 4 Summary

40

Supernetting is the opposite of subnetting. When supernetting, smaller networks are


combined into larger ones.
At the address assignment level, supernetting has been replaced by CIDR.
When supernetting you borrow bits from the network portion of the address.
Caveats for subnetting:
Supernetting must be performed on contiguous network numbers. The right most
network octet of the beginning address must be equally divisible by the number of
networks numbers you are combining. For example if you wish to combine 4 class C
networks, the first networks third octet must be divisible by 4.
Any routers used to forward traffic to connected networks must run a routing protocol
that supports supernetted addresses (i.e. a classless routing protocol)
Unlike in subnetting, all 0s and all 1s are valid network IDs (see appendix F for
exceptions)

Copyright 2001-06 by New Frontier Training

Chapter 5 CIDR and VLSMs


Explained

Chapter 5 CIDR and VLSMs Explained

Overview
Classless Inter-Domain Routing (CIDR) and Variable Length Subnet Masks (VLSMs) are closely
related manifestations of classless addressing, so they are dealt with together in a single chapter.
CIDR is a standard defined in RFCs 1517-1520 that allow an assigning authority to allocate an
address space closely matching the number of addresses required by a customer. This is made
possible by setting the prefix of a 32 bit IP address at a specific bit boundary, ignoring any sense
of class A, B and C distinctions. By carefully setting both the prefix (subnet mask), and the
starting point of the address range being assigned, various portions of the entire 32 bit address
space can be allocated to different customers.
Since different customers require differing amounts of address space, CIDR allows for setting
different prefixes for different portions of the same address. In other words, the mask is varied,
thus you have varying masks applied to the same 32 bit address at the assignment level.
Moreover, since initial allocation of address space is usually to very large ISPs, it is expected that
such ISPs will break up the address space into various sized chunks according to the needs of
its customers. The ISP will therefore apply varying prefixes to the allocated address as well, in
order to squeeze out the largest number of useable addresses.
This chapter shows exactly how all this wonderfulness happens. To begin, lets walk through
some details about how CIDR and VLSMs work, then go through an example of a sample IP
address being initially allocated then track how the address is continually broken up all the way
down the ladder until it an address is allocated to an end user. This is where the rubber meets the
road in real world classless addressing, and its where all the concepts of variable masks, address
aggregation, hierarchical addressing, and route summarization come to life.

CIDR
CIDR is the contemporary standard for assigning network numbers on the Internet. The
Classless in Classless Inter-Domain Routing means that the traditional class A B or C
distinctions of the network/host boundaries of a network address are cast aside in favor of a
system with far more granular control over address assignment.
The Internet agency responsible for assigning network addresses is called the NIC (Network
Information Center) or InterNIC. Traditionally the NIC worked through it subsidy, IANA
(Internet Assigned Numbers Authority) to administer the addresses. As the Internet has
grown larger and larger, private regional entities have taken on the responsibility of assigning
addresses. In America the local agency allocating network addresses is ARIN (American
Registry for Internet Numbers). Ok, is that confusing enough? We will mostly use the
generic term assigning authority when referring to the agency that assigns network addresses.
CIDR supports the concept of classless networking between networks, or more accurately,
between routing domains thus the moniker Inter-Domain Routing. A domain is defined as a
network or networks under a single administrative control. For example, CIDR allows
organization A and organization B to be assigned classless IP addresses and successfully
route packets between the two organizations (domains). The Border Gateway Protocol
(BGP), which was enhanced to support classless addressing in version 4, handles the routing
of such traffic.

42

Copyright 2001-06 by New Frontier Training

Chapter 5 CIDR and VLSMs Explained

Problems Solved by CIDR


CIDR was created to solve two problems; (1) IP addresses were being handed out in an
inefficient, wasteful manner, and (2) the routing tables on the Internets backbone routers
were growing frightfully large as entries for every allocated network were continually being
added.
CIDR solves the first problem, wasted address allocation, by employing the same classful rulebreaking method that has been used to subnet networks for years namely the manipulation of the
traditional network/host dividing line of an address. In fact, the RFC specifying CIDR notation
throws out the entire classful addressing architecture. Rather than continue to hand out
inefficiently sized class A, B or C network addresses, CIDR allocates an address or group of
addresses sized to fit the actual needs of the requesting organization. This is known as a CIDR
block. No more class A, B or C public addresses!
Note: In fact there are many organizations still in possession of classful (wasteful) address assignments. However,
many of these addresses have been reclaimed and then reallocated as efficient CIDR addresses.

CIDR addresses the problem of bloated route tables as well. Traditionally, the powerful routers
that form the core of the Internet needed to know the route to every possible network. As the
Internet has grown, so has the size of the routing tables. This inhibits performance. CIDR deals
with this issue by aggregating multiple network addresses into a single entry in the routing table.
The process, known as route aggregation or route summarization, reduces the size and
complexity of the routing tables.

AN ANALOGY FOR AGGREGATED ROUTES


To understand the concept of aggregation, think of an analogy to a housing sub-division that
is accessed from only one main road. There are dozens of streets (routes) within the subdivision, but only one way (route) to get to the sub-division itself. Therefore, to get to the subdivision one needs only to know the location of the access road. Only upon arriving at the
entrance to the sub-division is a more specific map required. Its the same with route tables. Only
routers connected to the actual subnets of the assigned address need list the more specific
routes. Routers upstream of those subnets only require a single, less specific, summary route
to properly forward any traffic bound for those subnets.

To illustrate an example of a CIDR assigned address, lets assume a large ISP has a requirement
for 4,000 addresses. The assigning authority chooses to allocate the 155.0.0.0 address space. The
challenge is to allocate as close as possible to 4,000 addresses, which the ISP will rework into
various sized subnets based on its needs.
Since it takes 12 bits to allocate 4,000 addresses (212-2 = 4,094), the prefix of the address is set to
/20. This means that the assigning authority owns the first 20 bits of the address, but the
remaining 12 bits are completely controlled by the ISP.
The initial allocation of the 155.0.0.0 with a /20 means the ISP will start off with a single network
ID of 155.0.0.0/20, supporting 4,094 hosts. See the following table.

Copyright 2001-06 by New Frontier Training

43

Chapter 5 CIDR and VLSMs Explained

ASSIGNMENT

CUSTOMER

ADDRESS RANGE
155

.0

TOTAL
ADDRESSES
.16

.1

10011011.00000000.00010000.00000001
155.0.16.0 /20

Large ISP

through . . .

155

.0

4,094

.31

.254

10011011.00000000.00011111.11111110
ARIN Allocation of the 155.0.0.0 network bits are in bold

The above table enumerates the range of host addresses for this assignment as 155.0.0.1 through
155.0.15.254. Its easy to figure the first possible host ID is for the assignment, but its a little
tricky to calculate the last address. That is why its expressed in binary. Recall from the chapter
on subnetting that the first host ID of any address is always all host bits OFF except the low order
bit, and the last host ID is all host bits ON except the low order bit. Now its not so hard to see, is
it?
Note: If there is one single thing we want you remember after reading this book, it is that converting an address to
binary will always help understand whats going on! The above example should clearly illustrate this point.

With CIDR notation, any allocated address would have worked out the same way. For example
12.0.0.0 or 196.0.0.0, although formerly class A and Class C network IDs respectfully, are treated
exactly the same as the 155.0.0.0 under CIDR. There is no difference, because the default
network / host dividing line is no longer used.
We will get back to what the ISP will ultimately do with this assignment, but in the meantime
what about the remaining address space in the 155.0.0.0? Only 4,000 addresses have been
allocated, leaving millions of unused addresses. For CIDR notation to live up to its reputation for
efficiency, those addresses must be allocated. They will, starting at 155.0.32.0, and continuing
until all the space of the 155.0.0.0 has been exhausted. The following table illustrates one way
allocation of the 155.0.0.0 might be completed.

44

Copyright 2001-06 by New Frontier Training

Chapter 5 CIDR and VLSMs Explained

ASSIGNMENT

CUSTOMER

HOST ADDRESS RANGE

TOTAL
ADDRESSES

10011011.00000000.00000000.00000000
2

Invalid. All zeros in subnet field

155.0.0.0 /20

10011011.00000000.00010000.00000000

Large ISP

155.0.16.0 /20

10011011.00000000.00010000.00000001

155.0.16.1 start
4,094
10011011.00000000.00011111.11111110

155.0.31.254 end

10011011.00000000.00100000.00000000

Customer 2

155.0.32.0 /20

10011011.00000000.00100000.00000001

155.0.32.1 start
4,094
10011011.00000000.00101111.11111110

155.0.63.254 end
Etc. . . .

10011011.00000000.11100000.00000000

155.255.224.0 /20

Customer
4094

10011011.11111111.11100000.00000001

155.255.224.1 start
4,094
10011011.11111111.11101111.11111110

155.255.239.254 end

10011011.00000000.11110000.00000000

Broadcast address for the

155.255.240.0 /20

155.0.0.0 /20

One possible way to allocate the 155.0.0.0 /20

Ho hum. As always, rendering the addresses in binary makes visualizing the allocation a snap.
Subnet bits are incremented one at a time until all bits are on, and the entire address space has
been allocated.

See appendix F
Copyright 2001-06 by New Frontier Training

45

Chapter 5 CIDR and VLSMs Explained

VLSMs
Like we said, the above example shows one way to allocate the 155.0.0.0. The assigning authority
however is not limited to allocating the address space proportionally. To maximize efficiency,
Variable Length Subnet Masks are used frequently when allocating the space.
VLSMs are an extension to standard subnetting. Rather than apply the same mask to all subnets,
differing masks can be applied to differing portion of the assigned address space. VLSMs can be
applied to CIDR addresses before they are ever allocated, allowing granular control over the
assignment of public addresses. VLSMs can also be applied by an organization when first
allocating an assigned CIDR address. And the mask can be varied again when the organization
wishes to reallocate already assigned address space. As long as the networking equipment
supports variable masks (mainly the routing protocol in use), there is no end to how many times
the mask of a given scope of address space can be varied that is until the space is exhausted.

VLSMs Applied Before Allocating a CIDR Address


Lets reallocate the 155.0.0.0 /20 by varying the original mask to create two 2,000 host networks
out of one of the 4K networks.

46

Copyright 2001-06 by New Frontier Training

Chapter 5 CIDR and VLSMs Explained

ASSIGNMENT

CUSTOMER

HOST ADDRESS RANGE

10011011.00000000.00010000.00000000

Large ISP

10011011.00000000.00010000.00000001

155.0.16.0 /20

155.0.16.1 start

TOTAL
ADDRESSES

4,094

10011011.00000000.00011111.11111110

155.0.31.254 end
Customer 2

New subnets

10011011.00000000.00100000.00000001

155.0.32.1

10011011.00000000.00100000.00000000

155.0.32.0 /21

2,046

10011011.00000000.00101111.11111110

155.0.47.254

10011011.00000000.00111000.00000001
10011011.00000000.00110000.00000000

Customer 3

155.0.48.1

2,046

155.0.48.0 /21
10011011.00000000.00111111.11111110

155.0.63.254

10011011.00000000.01000000.00000000

Customer 4

155.0.64.0 /20

10011011.00000000.01000000.00000001

155.0.64.1 start

4,094

10011011.00000000.01111111.11111110

155.0.127.254 end
Etc. . . .

10011011.00000000.11100000.00000000

155.255.224.0 /20

Customer x

10011011.11111111.11100000.00000001

4,094

155.255.224.1 start
10011011.11111111.11101111.11111110

155.255.239.254 end

Applying a VLSM to a portion of the 155.0.0.0 /20

By varying the mask to include one more bit, a single subnet ID has been created allowing only
two subnets. Notice that this procedure mimics the one used in standard subnetting in that a new
subnet field is created. Also notice that both created subnets are valid. The rule of not allowing all
0s or all 1s in the subnet field must only be obeyed once.

Copyright 2001-06 by New Frontier Training

47

Chapter 5 CIDR and VLSMs Explained

New mask (/21)

1st octet
11111111

2nd octet
11111111

3rd octet
11111
1

000

4th octet
00000000

NETWORK ID
| Subnet ID | HOST IDs
Altering the mask from /20 to /21 creates one subnet bit

VLSMs Applied After Allocating a CIDR Address


Lets continue the example to see how VLSMs are used once the CIDR block has been assigned.
Recall that the large ISP has been assigned what at this point is a single network ID with over
4,000 addresses. The ISP almost certainly does not have one customer with a need for 4K
addresses. Rather, it is going to apply a new prefix to its CIDR block that breaks up the address.
Moreover, the ISP is going to vary the mask applied to various blocks of the address to hand out
just the right number of addresses to each of its customers.
The assigning authority owns the first 20 bits of the 155.0.16.0 /20. Those bits are frozen as far as
the ISP is concerned. However, the ISP is free to have its way with the remaining bits, and create
any number of subnets it pleases within the confines of the allocated space. Lets say the ISP has
several customers requiring an address space of 500 hosts, and two customers each requiring an
address space of 200 hosts. Furthermore the ISP needs a whole bunch of 2-host subnets for pointto-point connections to provide Internet access for other customers. The table below illustrates
one way this allocation could be accomplished.
Network ID

Subnet IDs

Host ID range

155.0.16.0 /23

155.0.16.0 /23
155.0.18.0 /23
155.0.20.0 /23
155.0.22.0 /23
155.0.24.0 /23
155.0.26.0 /23
155.0.28.0 /24
155.0.29.0 /24

155.0.16.1 155.0.17.254
155.0.18.1 155.0.19.254
155.0.20.1 155.0.21.254
155.0.22.1 155.0.23.254
155.0.24.1 155.0.25.254
155.0.26.1 155.0.27.254
155.0.28.1 155.0.28.254
155.0.29.1 155.0.29.254

155.0.30.0 /30
155.0.30.4 /30
155.0.30.8 /30
155.0.30.12 /30
155.0.30.16 /30
...
155.0.31.252 /30

155.0.30.1 155.0.30.2
155.0.30.5 155.0.30.6
155.0.30.9 155.0.30.10
155.0.30.13 155.0.30.14
155.0.30.17 155.0.30.18
...
155.0.31.253 155.0.31.254

155.0.28.0 /24
155.0.30.0 /30

Total # of
subnets
6

128

Hosts per
subnet
510
510
510
510
510
510
254
254
2
2
2
2
2
...
2

Varying the applied mask to create the right balance of networks and hosts

By varying the mask applied to different portions of the address space, the ISP has efficiently
administered its CIDR block. This is the essence of VLSMs. Lets walk through the table and
clarify how everything works out.

48

Copyright 2001-06 by New Frontier Training

Chapter 5 CIDR and VLSMs Explained


Row 1
In row 1, the /20 prefix was changed to /23. This leaves 9 bits for hosts, which is the required
amount for the customers needing 500 host networks, thus retaining 3 bits for subnet IDs.
To enumerate each created /23 subnet, its easiest to calculate in binary as illustrated below.

New mask (/23)

1st octet
11111111

2nd octet
11111111

3rd octet
1111 111

4th octet
00000000

NETWORK ID
| Subnet ID | HOST IDs
Altering the mask from /20 to /23 creates three subnet bits

Three subnet bits allows for 8 subnets (23 = 8). Note that the value 2 was not subtracted from the
number of subnets. The no all 0s or all 1s rule has already been obeyed. The table below
enumerates each /23 subnet.
3rd octet
Frozen bits

Borrowed bits
for subnet IDs

Remainder
of host bits

Combine bits and


convert octet back
to decimal

0001
0001
0001
0001
0001
0001
0001
0001

000
001
010
011
100
101
110
111

0
0
0
0
0
0
0
0

00010000 = .16
00010010 = .18
00010100 = .20
00010110 = .22
00011000 = .24
00011010 = .26
00011100 = .28
00011110 = .30

Subnets
Resulting network IDs

155.0.16.0 /23
155.0.18.0 /23
155.0.20.0 /23
155.0.22.0 /23
155.0.24.0 /23
155.0.26.0 /23
155.0.28.0 /23
155.0.30.0 /23

Enumerating the subnet IDs for the 155.0.16.0 /23

For completeness, the host IDs of one subnet will be enumerated.


155.0.18.0 /23 network
Host ID
1st host ID
2nd host ID
3rd host ID
4th host ID

Binary format

00010010.00000001
00010010.00000010
00010010.00000011
00010010.00000100
And so on . . .
Last host
00010011.11111110
ID

Covert to decimal

Complete host address

.18.1
.18.2
.18.3
.18.4

155.0.18.1
155.0.18.2
155.0.18.3
155.0.18.4

.19.254

155.0.19.254

Subnet ID Host ID

Enumerating the host IDs for the .64 subnet

Row 2
To satisfy the requirements of the two customers needing an address space of 200 hosts, the ISP
simply takes the next unassigned range of addresses starting at 150.0.28.0, and applies a mask of

Copyright 2001-06 by New Frontier Training

49

Chapter 5 CIDR and VLSMs Explained


/24. This is the closest choice to create the required number of addresses because the remaining 8
host bits allow for 254 addresses per subnet.

New mask (/24)

1st octet
11111111

2nd octet
11111111

3rd octet
1111
1111

4th octet
00000000

NETWORK ID
| Subnet IDs | HOST IDs
Applying a /24 prefix to the next range of the address to create 254 host subnets

Just as applying the /23 prefix would have created eight 500-host subnets if the mask was not
varied again, here the /24 applied to the starting range 155.0.28.0 would create sixteen 254-host
subnets. However, only two of those 254 host subnets are needed, and so in a moment the mask
will again be varied at the address following the first two of the sixteen subnets. First lets
enumerate those two subnets before moving on to the 2-host subnets.
3rd octet
Frozen bits

Borrowed bit
for subnet IDs

Remainder
of host bits

Combine bits and


convert octet back
to decimal

0001
0001

1100

n/a
n/a

00011100 = .28
00011101 = .29

111

Subnets
Subnet ID

155.0.28.0 /24
155.0.29.0 /24

Enumerating the subnet IDs for the 155.0.28.0 /24

As always, the customer receiving the assignment of either subnet would be free to vary the mask
again and create additional subnets as long as the customer does not touch the frozen bits, which
for it are the first 24 bits.
Row 3
The ISP wants to allocate the balance of the address space as a bunch of 2-host subnets. The next
unallocated portion of the address space is 155.0.30.0. Two bits must be left for host IDs, so a /30
mask is applied to the address.

New mask (/30)

1st octet
11111111

2nd octet
11111111

3rd octet
4th octet
1111 1111 111111

00

NETWORK ID
| Subnet IDs
| HOST IDs
Applying a /30 prefix to the next range of the address to create 2 host subnets

50

Copyright 2001-06 by New Frontier Training

Chapter 5 CIDR and VLSMs Explained


3rd and 4th octet
Frozen
bits
0001
0001
0001
0001
etc. . . .

Borrowed bits
for subnet IDs
1110.000000
1110.000001
1110.000010
1110.000011

0001

1111.111110

Remainder
host bits
00
00
00
00

Combine bits and convert octets


back to decimal
00011110.00000000 = .30.0
00011110.00000100 = .30.4
00011110.00001000 = .30.8
00011110.00001100 = .30.12

00
00011111.11111100 = .31.252
Enumerating the subnet IDs for the 155.0.30.0 /30

Subnets
Subnet ID
155.0.30.0 /30
155.0.30.4 /30
155.0.30.8 /30
155.0.30.12 /30

155.0.31.252 /30

Summing up CIDR and VLSMs


The examples in the last few pages should clearly illustrate what a powerful combination CIDR
and VLSMs are. An assigning authority can allocate address space efficiently, and the space can
be utilized efficiently as it is reallocated to other providers.
The key to using CIDR assigned addresses is to always remember the following rules:
All bits dictated by the mask as network bits are frozen and cant be altered.
All bits designated as host bits may be used as is, or further subnetted as needed.
When subnetting, always start borrowing from the high order hosts bits of the current mask.
When subnetting, borrow as many bits as possible, leaving only enough host bits to meet the
requirements of the number of hosts required for the subnet. This will yield the maximum
number of subnets that can later be subdivided further as needed.

Riding the Hierarchical Highway


An important side effect shown by the examples is that classless addressing with CIDR and
VLSMs make possible a hierarchical structure of network addressing. Hierarchical numbering
schemes allow for efficient, organized addressing of networks. At the assignment level,
representing many networks as a single network ID (less specific) makes for smaller route tables
and more efficient routing of packets. Only at the point in the route where more specific
addressing information is required must the subnets of the network ID be enumerated in the route
tables.
Hierarchical addressing makes sense at the organizational level as well even with private IP
addresses. Rather than deploying several private class B or class C network for each routed
network, you could start with a base 32 bit address, say the 10.0.0.0, or the 172.16.0.0 and use
VLSMs to allocate the appropriate number of addresses to each subnet. With a little planning you
can develop a hierarchical structure that maps to the structure of the organization. Then a glance
at any IP address reveals say, the country, state and city, building, department, floor, and even
device type, greatly simplifying route tables at the same time.

OTHER HIERARCHICAL ANALOGIES


If all this hierarchical stuff makes you a little dizzy. it may help to realize that we live with many
different hierarchical schemes in daily life. The phone organization is a great example. Telephone
switches make a long distance connection first by area code. The balance of the number is
ignored for most of the calls journey. When the call has been routed to the correct area code the

Copyright 2001-06 by New Frontier Training

51

Chapter 5 CIDR and VLSMs Explained


telephone numbers prefix is checked to route the call to the appropriate regional switch. Finally
the suffix is checked to make the actual connection. The backbone switches only need listings of
area codes, and the regional switches only need listings of local prefixes. The local switches
only need to know which suffix matches a customer. None of the switches can route the call on
their own, but working together they can get the call to its destination.

IPv6 to the Rescue?


CIDR, VLSMs, and NAT were created as a solution to the problem of 32 bit network
addresses being exhausted. Another solution would be to increase the size of the existing
address space beyond 32 bits. Thats where the next version of IP, IPv6, comes in. IPv6
purports to ultimately replace the current version of IP, version 4, with a quadrupled address
length of 128 bits.
IPv6 deployment is proceeding slowly however. CIDR and NAT have been so successful, that the
pressure to move to a new addressing scheme has been lessened. Network security also plays a
role in lessening the demand for public addresses. Were trying to hide our networks from the
Internet now. It used to be you had bragging rights if you had enough public addresses to
assign one to every workstation in you organization. Not anymore. Now the trend is to
address hosts with private addresses that hide behind NAT appliances and stateful firewalls.
Although IPv6 is slowly permeating into our networks, it is likely to be some time before we
all jump the IPv4 ship. During this transition many IP hosts will run dual IP stacks.

52

Copyright 2001-06 by New Frontier Training

Chapter 5 CIDR and VLSMs Explained


Chapter 5 Summary

Classless Inter-Domain Routing was developed to more efficiently allocate network


addresses by allocating the exact amount of address space an organization requires. CIDR
obsoletes the class system at the assignment level.
CIDR provides an efficient, flexible system of network and host address allocation, and
lessens the load on backbone routers by aggregating multiple routes into a single routing
entry.
CIDR was developed as a work-around technology until IPv6 can be fully deployed, but
its great success has lessened the need to deploy IPv6 right away.
Varying masks can be applied to the same 32 bit address space when initially allocating
an address, greatly leveraging the efficiency of CIDR notation. VLSMs can also be
applied to CIDR addresses at the organizational level, thus maintaining efficiency of
allocation.
Variable masks can be applied to privately addressed networks to allow an organization
to benefit form the organizational, hierarchical, and routing table efficiencies brought by
VLSMs.
Networking equipment must support classless addressing. This mainly has to do with the
IP stack running on the hosts, and the use of classless routing protocols on the routers.
Remember the following rules when working with classless addressing:
o All bits dictated by the mask as network bits are frozen and cant be altered.
o All bits designated as host bits may be used as is, or further subnetted as needed.
o When subnetting, always start borrowing from the high order hosts bits of the current
mask.
o When subnetting, borrow as many bits as possible, leaving only enough host bits to
meet the requirements of the number of hosts required for the subnet. This will yield
the maximum number of subnets that can later be subdivided further as needed.

Copyright 2001-06 by New Frontier Training

53

Appendixes

Appendix A Subnetting
Exercises

Appendix A Subnetting Exercises

Overview
This appendix gives you an opportunity to hone your subnetting skills. Examples using private, classful
IP addresses will be presented for simplicity. The same procedures shown here are applied to classless
addresses however. You can work through each exercise on your own and check the answers on the page
following the exercise. Or if you get stuck you can jump forward and get a hint.
As you go through the exercises keep an eye out for patterns and shortcuts. After you subnet a few times
you will start to see patterns for how subnet and host IDs are created. Through experience you will also
start to see obvious shortcuts that can be taken when subnetting. When that happens you are well on your
way to becoming a subnetting master!

Appendix A Subnetting Exercises

Exercise #1
Scenario:
An organization has chosen to deploy a private Class C address 192.168.45.0.
The organizations network is in one building on two separate floors. There are 50 computers on one
floor, and 40 computers on the other floor. A router connects the two segments of the network.
Configure a subnetting scheme for this network that assumes that there will never be more than 2 subnets
and allows for the maximum number of hosts. List just the first and last host ID for each subnet.

Subnetting Helper Sheet


Network address to subnet:
Default subnet mask:
# of networks required:
# of hosts per network:
# of bits borrowed:
Custom subnet mask:
Subnet IDs:

1st Host ID:

Last Host ID:

Broadcast Address:

1
2
3
4
5
6
7
8
9
10
Workspace:
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________

Appendix A Subnetting Exercises

Solution to exercise #1
Original IP address: 192.168.45.0
1) Determine the number of subnets needed
a) Two subnets are specifically asked for. Borrowing two bits results in two subnets; (22) 2 = 2.
2) Determine the number of host IDs needed per network
a) The largest number of hosts either subnet must support is 50. 2 bits have been borrowed from the
host ID, leaving 6 bits, which is 62 hosts per network; (26) 2 = 62. Therefore, the two bits
borrowed for the subnet ID will still allow for a sufficient number of hosts.
3) Define a custom subnet mask
a) Convert the default subnet mask to binary (255.255.255.0).
11111111.11111111.11111111.000000000
b) Turn on the first two bits in the host octet of the mask to indicate these are now subnet bits:
11111111.11111111.11111111.110000000
c) Convert the subnet mask back to decimal
255.255.255.192
4) Define the subnet IDs to be used
a) List all the possible combinations of the borrowed bits
00
01
10
11
b) Combine each valid combination with the remainder of the octet and convert to decimal
01 000000 = 64
10 000000 = 128

Note: Remember the cardinal rule of subnetting when converting binary numbers to decimal: Always convert the entire octet.
Even if bits have been borrowed from an octet to create subnet IDs, you ALWAYS treat the octet as a whole when converting to
decimal.

c) Reunite the octet with rest of the IP address and you have your subnet IDs.
192.168.45.64
192.168.45.128

Appendix A Subnetting Exercises


5) Determine the beginning and ending host ID for each subnet
a) The 1st host ID is all host bits turned OFF except one (all 0s would be the network number)
000001
b) The last host ID is all host bits turned ON except one (all 1s would be the broadcast address)
111110
c) Combine each subnet ID with the beginning and ending host IDs in turn and convert to decimal
Subnet #1
01 000001 = 65
01 111110 = 126
Subnet #2

10 000001 = 129
10 111110 = 190

d) Combine with remainder of address and you have your beginning/ending host IDs.
Subnet #1 192.168.45.65 to 201.67.45.126
Subnet #2

192.168.45.129 to 201.67.45.190

Subnetting Helper Sheet completed

1
2
3
4
5
6
7
8
9
10

Network address to subnet:


Default subnet mask:
# of networks required:
# of hosts per network:
# of bits borrowed:
Custom subnet mask:
Subnet IDs:

255.255.255.0
2
62
2
255.255.255.192 or /26
1st Host ID:

Last Host ID:

Broadcast Address:

192.168.45.64
192.168.45.128

192.168.45.65
192.168.45.129

192.168.45.126
192.168.45.190

192.168.45.127
192.168.45.191

192.168.45.0

Appendix A Subnetting Exercises

Exercise #2
Scenario:
An organization has chosen to deploy the private Class C address 192.168.11.0.
The organizations network has four buildings located 250 apart. There are 12 computers in each
building. A router connects the segments of each network.
Configure a subnetting scheme for this network that allows for the growth of two additional subnets and
accommodates up to 25 hosts per network.

Subnetting Helper Sheet


Network address to subnet:
Default subnet mask:
# of networks required:
# of hosts per network:
# of bits borrowed:
Custom subnet mask:
Subnet IDs:

1st Host ID:

Last Host ID:

Broadcast Address:

1
2
3
4
5
6
7
8
9
10
Workspace:
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________

Appendix A Subnetting Exercises

Solution to exercise #2
Original IP address: 192.168.11.0
1) Determine the number of subnets needed
a) Four subnets are needed plus planning for two additional subnets makes six. Borrowing three bits
will be just enough; (23) 2 = 6.
2) Determine the number of host IDs needed per network
a) The largest number of hosts any subnet must support is 25. 3 bits were borrowed from the host ID
leaving 5 bits, which is 30 hosts per network; (25) 2 = 30. Plenty for this job.
3) Define a custom subnet mask mask
a) Convert the default subnet mask to binary (255.255.255.0).
11111111.11111111.11111111.000000000
b) Turn on the first three bits in the host octet of the subnet mask to indicate these are now network
bits:
11111111.11111111.11111111.1110000
c) Convert the subnet mask back to decimal
255.255.255.224
4) Define the network subnet IDs to be used
a) List all the possible combinations of the borrowed bits
000
100
001
101
010
110
011
111
b) Combine each valid combination with the remainder of the octet and convert to decimal
100 00000 = 128
001 00000 = 32 101 00000 = 160
010 00000 = 64 110 00000 = 192
011 00000 = 96
c) Reunite the octet with rest of the IP address and you have your subnet IDs.
193.1.11.128
193.1.11.32
193.1.11.160
193.1.11.64
193.1.11.192
193.1.11.96
5) Determine the beginning and ending host ID for each subnet
a) The 1st host ID is all bits turned OFF except one (all 0s would be the network number)
00001
b) The last host ID is all bits turned ON except one (all 1s would be the broadcast address)
11110
c) Combine each subnet ID with the beginning and ending host IDs and convert to decimal
Subnet #1
001 00001 = 33
001 11110 = 62
Subnet #2

010 00001 = 65

Appendix A Subnetting Exercises


010 11110 = 94
Subnet #3

011 00001 = 97
011 11110 = 126

Subnet #4

100 00001 = 129


100 11110 = 158

Subnet #5

101 00001 = 160


101 11110 = 190

Subnet #6

110 000001 = 193


110 111110 = 222

d) Combine with remainder of address and you have your beginning/ending host IDs
Subnet #1 192.168.11.33 to 192.168.11.62
Subnet #2 192.168.11.65 to 192.168.11.94
Subnet #3 192.168.11.97 to 192.168.11.126
Subnet #4 192.168.11.129 to 192.168.11.158
Subnet #5 192.168.11.160 to 192.168.11.190
Subnet #6 192.168.11.193 to 192.168.11.222

Subnetting Helper Sheet completed


Network address to subnet:
Default subnet mask:
# of networks required:
# of hosts per network:
# of bits borrowed:
Custom subnet mask:

Subnet IDs:
1
2
3
4
5
6
7
8
9
10

192.168.11.32
192.168.11.64
192.168.11.96
192.168.11.128
192.168.11.160
192.168.11.192

192.168.11.0
255.255.255.0
6
25
3 (renders 6 networks with 30 hosts per network)

255.255.255.224 or /27
Last Host ID:
1st Host ID:

192.168.11.33
192.168.11.62
192.168.11.65
192.168.11.94
192.168.11.97
192.168.11.126
192.168.11.129
192.168.11.158
192.168.11.161
192.168.11.190
192.168.11.193
192.168.11.222

Broadcast Address:

192.168.11.63
192.168.11.95
192.168.11.127
192.168.11.159
192.168.11.191
192.168.11.223

Appendix A Subnetting Exercises

Exercise #3
Scenario:
An organization is deploying private Class C address 192.168.254.0.
The organizations network has eight departments and wants to put all departments on separate networks
to avoid broadcast storms (routers dont usually pass broadcast packets). There are no more than 10
people per department.
Configure a subnetting scheme that allows for eight networks now, and leaves room for additional
subnets only as long as the subnetting scheme accommodates at least 12 hosts per network.

Subnetting Helper Sheet


Network address to subnet:
Default subnet mask:
# of networks required:
# of hosts per network:
# of bits borrowed:
Custom subnet mask:
Subnet IDs:

1st Host ID:

Last Host ID:

Broadcast Address:

1
2
3
4
5
6
7
8
9
10
Workspace:
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________

Appendix A Subnetting Exercises

Solution to exercise #3
Original IP address: 192.168.254.0
1) Determine the number of subnets needed
a) A minimum of eight subnets are needed and only more can be created if there are at least 12 host
addresses to go around. Borrowing 3 bits yields 8 potential networks, but when the 2 invalid
networks are removed you come up short. Therefore 4 bits must be borrowed; (24) 2 = 14. That
allows for 6 spare networks. You could not borrow anymore than 4 bits because at least 12 hosts
are required per subnet. If 5 bits were borrowed for network IDs, the remaining 3 bits of the octet
would only allow 6 hosts per subnet; (23) 2 = 6.
2) Determine the number of host IDs needed per network
a) Borrowing 4 bits from the host ID leaves 4 bits remaining, which is 14 hosts per network. (24)
2.
3) Define a custom subnet mask mask
a) Convert the default subnet mask to binary (255.255.255.0).
11111111.11111111.11111111.000000000
b) Turn on the first 4 bits in the host octet of the subnet mask to indicate these are now network bits:
11111111.11111111.11111111.111100000
c) Convert the subnet mask back to decimal
255.255.255.240
4) Define the network (subnet) IDs to be used
a) List all the possible combinations of the borrowed bits
0000
0100
1000
1100
0001
0101
1001
1101
0010
0110
1010
1110
0011
0111
1011
1111
Combine each valid combination with the remainder of the octet and convert to decimal
0100 0000 = 64 1000 0000 = 128 1100 0000 = 192
0001 0000 = 16 0101 0000 = 80 1001 0000 = 144 1101 0000 = 208
0010 0000 = 32 0110 0000 = 96 1010 0000 = 160 1110 0000 = 224
0011 0000 = 48 0111 0000 = 112 1011 0000 = 176
b) Reunite the octet with rest of the IP address and you have your subnet IDs.
201.255.254.64
201.255.254.128 201.255.254.192
201.255.254.16 201.255.254.80
201.255.254.144 201.255.254.208
201.255.254.32 201.255.254.96
201.255.254.160 201.255.254.224
201.255.254.48 201.255.254.112 201.255.254.176
5) Determine the beginning and ending host ID for each subnet
a) The 1st host ID is all bits turned OFF except one (all 0s would be the network number)
00001
b) The last host ID is all bits turned ON except one (all 1s would be the broadcast address)
11110

Appendix A Subnetting Exercises


c) Combine each subnet ID with each host ID in turn and convert to decimal
Subnet #1
0001 0001 = 17
0001 1110 = 30
Subnet #2

0010 0001 = 33
0010 1110 = 46

Subnet #3

0011 0001 = 65
0011 1110 = 78

etc. . .
Subnet #14

1110 0001 = 225


1110 1110 = 238

d) Combine with remainder of address and you have your beginning/ending host IDs
Subnet #1 192.168.254.17 to 192.168.254.30
Subnet #2 192.168.254.33 to 192.168.254.46
Subnet #3 192.168.254.65 to 192.168.254.78
etc. . . .
Subnet #14 192.168.254.225 to 192.168.254.238

Subnetting Helper Sheet completed


Network address to
subnet:
Default subnet mask:
# of networks required:
# of hosts per network:
# of bits borrowed:
Custom subnet mask:
Subnet IDs:

1
2
3
4
5
6
7
8
9
10
11
12
13
14

192.168.254.16
192.168.254.32
192.168.254.48
192.168.254.64
192.168.254.80
192.168.254.96
192.168.254.112
192.168.254.128
192.168.254.144
192.168.254.160
192.168.254.176
192.168.254.192
192.168.254.208
192.168.254.224

192.168.254.0
255.255.255.0
8
12
4 (renders 14 networks with 14 hosts per network)

255.255.255.240 or /28
1st Host ID:

192.168.254.17
192.168.254.33
192.168.254.49
192.168.254.65
192.168.254.81
192.168.254.97
192.168.254.113
192.168.254.129
192.168.254.145
192.168.254.161
192.168.254.177
192.168.254.193
192.168.254.209
192.168.254.225

Last Host ID:

Broadcast Address:

192.168.254.30
192.168.254.46
192.168.254.62
192.168.254.78
192.168.254.94
192.168.254.110
192.168.254.126
192.168.254.142
192.168.254.158
192.168.254.174
192.168.254.190
192.168.254.206
192.168.254.242
192.168.254.238

192.168.254.31
192.168.254.47
192.168.254.63
192.168.254.79
192.168.254.95
192.168.254.111
192.168.254.127
192.168.254.143
192.168.254.159
192.168.254.175
192.168.254.191
192.168.254.207
192.168.254.243
192.168.254.239

You could allocate any 10 of these 14 subnets to satisfy the organizations initial need.

Appendix A Subnetting Exercises

Exercise #4
Scenario:
An organization is deploying private Class C address 92.168.222.0.
The organizations only needs two hosts attached to each network but it needs the maximum number of
subnets possible while still allowing for the two hosts.
Configure a subnetting scheme that accommodates the objective.

Subnetting Helper Sheet


Network address to subnet:
Default subnet mask:
# of networks required:
# of hosts per network:
# of bits borrowed:
Custom subnet mask:
Subnet IDs:

1st Host ID:

Last Host ID:

Broadcast Address:

1
2
3
4
5
6
7
8
9
10
Workspace:
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________

Appendix A Subnetting Exercises

Solution to class C exercise #4


Original IP address: 192.168.222.0
1) Determine the number of subnets needed
a) To gain the maximum number of subnets, you need to borrow the maximum number of bits. Try
borrowing 7 bits and see how that works out. Borrowing 7 bits works out like this; (27) 2 = 126.
Thats 126 subnets, but before proceeding further check to see if this scheme allows for enough
host addresses. With 1 bit remaining the calculation is; (21) 2 = 0. Whoops. Zero host addresses
is unacceptable.
Lets try borrowing just 6 bits. (26) 2 = 62.
With two bits left for host addresses it works out like this: (22) 2 = 2. Just right.
2) Determine the number of host IDs needed per network
a) As calculated in the previous step; (2*2) 2 = 2.
3) Define a custom subnet mask mask
a) Convert the default subnet mask to binary (255.255.255.0).
11111111.11111111.11111111.000000000
b) Turn on the first three bits in the host octet of the subnet mask to indicate these are now network
bits:
11111111.11111111.11111111.11111100
c) Convert the subnet mask back to decimal
255.255.255.252
4) Define the network (subnet) IDs to be used
a) List all the possible combinations of the borrowed bits
000000
000100
001000
000001
000101

000010
000110
111110
000011
000111
111111
b) Combine each valid combination with the remainder of the octet and convert to decimal
000100 00 = 16
001000 00 = 32
000001 00 = 4
000101 00 = 20
...
000010 00 = 8
000110 00 = 24
111110 00 = 248
000011 00 = 12
000111 00 = 28
c) Reunite the octet with rest of the IP address and you have your subnet IDs.
192.168.222.16
192.168.222.32
192.168.222.4
192.168.222.20
...
192.168.222.8
192.168.222.24
192.168.222.248
192.168.222.12
192.168.222.28
5) Determine the beginning and ending host ID for each subnet
a) The 1st host ID is all bits turned OFF except one (all 0s would be the network number)
01
b) The last host ID is all bits turned ON except one (all 1s would be the broadcast address)
10

Appendix A Subnetting Exercises


c) Combine each subnet ID with each host ID in turn and convert to decimal
Subnet #1
000001 01 = 5
000001 10 = 6
Subnet #2

000010 01 = 9
000010 10 = 10

Subnet #3

000011 01 = 13
000011 10 = 14

...
Subnet #62

111110 01 = 249
111110 10 = 250

d) Combine with remainder of address and you have your beginning/ending host IDs
Subnet #1 192.168.222.5 to 192.168.222.6
Subnet #2 192.168.222.9 to 192.168.222.10
Subnet #3 192.168.222.13 to 192.168.222.14
...
Subnet #62 192.168.222.249 to 192.168.222.250

Subnetting Helper Sheet completed


Network address to
subnet:
Default subnet mask:
# of networks required:
# of hosts per network:
# of bits borrowed:
Custom subnet mask:
Subnet IDs:

1
2
3
4
5
6
7
8
..
62

192.168.222.4
192.168.222.8
192.168.222.12
192.168.222.16
192.168.222.20
192.168.222.24
192.168.222.28
192.168.222.32
...
192.168.222.248

192.168.222.0
255.255.255.0
Maximum
2
6 (renders 62 networks with 2 hosts per network)

255.255.255.252 or /30
1st Host ID:

Last Host ID:

Broadcast Address:

192.168.222.5
192.168.222.9
192.168.222.13
192.168.222.17
192.168.222.21
192.168.222.25
192.168.222.29
192.168.222.33

192.168.222.6
192.168.222.10
192.168.222.14
192.168.222.18
192.168.222.22
192.168.222.26
192.168.222.30
192.168.222.34

192.168.222.7
192.168.222.11
192.168.222.15
192.168.222.19
192.168.222.23
192.168.222.27
192.168.222.31
192.168.222.35

192.168.222.249

192.168.222.250 192.168.222.251

Appendix A Subnetting Exercises

Exercise #5
Scenario:
An organization is deploying private Class B address 172.16.0.0.
The organizations network is in one building on two separate floors. There are 250 computers on one
floor, and 200 computers on the other floor. A router connects the two segments of the network.
Configure a subnetting scheme for this network that assumes that there will never be more than 2 subnets
and allows for the maximum number of hosts. Just list the first and last host ID for each subnet.
Configure a subnetting scheme that accommodates the objective.

Subnetting Helper Sheet


Network address to subnet:
Default subnet mask:
# of networks required:
# of hosts per network:
# of bits borrowed:
Custom subnet mask:
Subnet IDs:

1st Host ID:

Last Host ID:

Broadcast Address:

1
2
3
4
5
6
7
8
9
10
Workspace:
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________

Appendix A Subnetting Exercises

Solution to exercise #5
Original IP address: 172.16.0.0
1) Determine the number of subnets needed
a) Remember that class B host addresses occupy two octets, for a total of 65,534 possible hosts.
(216)-2. When borrowing bits to create additional networks you always start from the left most
octet, which for a class B addresses is the 3rd octet.
Two networks are whats required, so borrowing two bits should be adequate (22)-2 = 2.
2) Determine the number of host IDs needed per network
a) The scenario specifies a maximum of 250 hosts per subnet. Borrowing 2 bits for the subnet IDs
leaves 14 bits remaining for host IDs; (214) 2 = 16,382.
3) Define a custom subnet mask mask
a) Convert the default subnet mask to binary (255.255.0.0).
11111111.11111111.00000000.000000000
b) Turn on the first three bits in the host octet of the subnet mask to indicate these are now network
bits:
11111111.11111111.11000000.00000000
c) Convert the subnet mask back to decimal
255.255.192.0
4) Define the network (subnet) IDs to be used
a) List all the possible combinations of the borrowed bits
00
01
10
11
b) Combine each valid combination with the remainder of the octets and convert to decimal
01 000000.00000000 = 64.0
10 000000.00000000 = 128.0
Reunite the octets with rest of the IP address and you have your subnet IDs.
172.16.64.0
172.16.128.0
Note: As with class C addresses, the original network number (172.16.0.0) is rendered invalid.
5) Determine the beginning and ending host IDs for each subnet
a) The 1st host ID is all bits turned OFF except one (all 0s would be the network number)
000000.00000001
(when calculating host IDs always add from the far right)
b) The last host ID is all bits turned ON except one (all 1s would be the broadcast address)
111111.11111110

Appendix A Subnetting Exercises


c) Combine each subnet ID with each host ID in turn and convert to decimal
Subnet #1
01 000000.00000001 = 64.1
01 111111.11111110 = 127.254
Subnet #2

10 000000.00000001 = 172.16
10 111111.11111110 = 191.254

d) Combine with remainder of address and you have your beginning/ending host IDs
Subnet #1
172.16.64.1 to 172.16.127.254
Subnet #2
172.16.172.16 to 172.16.191.254

Subnetting Helper Sheet completed


Network address to subnet:
Default subnet mask:
# of networks required:
# of hosts per network:
# of bits borrowed:
Custom subnet mask:
Subnet IDs:

1
2

172.16.64.0
172.16.128.0

172.16.0.0
255.255.0.0
2

Max
2 (renders 2 networks with 16,382 hosts per network)

255.255.192.0 /18
1st Host ID:

172.16.64.1
172.16.172.16

Last Host ID:

Broadcast Address:

172.16.127.254
172.16.191.254

172.16.127.255
172.16.191.255

Perplexed?
Keep in mind that class B host addresses increment like this:
172.16.64.1, 172.16.64.2, . . . 172.16.64.254, 172.16.64.255, 172.16.65.1, 172.16.65.2, . . .
172.16.65.254, 172.16.65.255, 172.16.66.1 . . . . . . . 172.16.191.252, 172.16.191.253,
172.16.191.254
Why is 172.16.191.254 the last host address? That is the decimal equivalent of all bits but one
being turned on (10 111111.11111110 = 191.254). The 10 of course is the network ID, not a host
ID. Even though it is part of the octet it is not part of the host ID.

Appendix A Subnetting Exercises

Exercise #6
Scenario:
An organization is deploying private Class B address 172.23.0.0.
The organizations network has ten buildings located 250 apart. There are 500 computers in each
building. A router connects the segments of each network.
Configure a subnetting scheme for this network that allows for the growth of five additional subnets and
accommodates up to 1000 hosts per network.

Subnetting Helper Sheet


Network address to subnet:
Default subnet mask:
# of networks required:
# of hosts per network:
# of bits borrowed:
Custom subnet mask:
Subnet IDs:

1st Host ID:

Last Host ID:

Broadcast Address:

1
2
3
4
5
6
7
8
9
10
Workspace:
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________

Appendix A Subnetting Exercises

Solution to exercise #6
Original IP address: 172.23.0.0
1) Determine the number of subnets needed
a) 10 networks are in place now but there may be up to 15. Borrowing 4 bits is not quite enough (24)
2 = 14 subnets. Therefore 5 bits must be borrowed to accommodate the planned growth.
Borrowing 5 bits allows for up to 30 subnets (25) 2 = 30.
2) Determine the number of host IDs needed per network
a) The scenario specifies at least 1000 hosts per subnet. Borrowing 5 bits for the subnet IDs leaves
11 bits remaining. (211) 2 = 2,046.
3) Define a custom subnet mask mask
a) Convert the default subnet mask to binary (255.255.0.0).
11111111.11111111.00000000.000000000
b) Turn on the first three bits in the host octet of the subnet mask to indicate these are now network
bits:
11111111.11111111.11111000.00000000
c) Convert the default subnet mask back to decimal
255.255.248.0
4) Define the network (subnet) IDs to be used
a) List all the possible combinations of the borrowed bits
00000
00100
00001
00101
00010
00110
00011
00111

01000
...
11110
11111

b) Combine each valid combination with the remainder of the octets and convert to decimal
00100 000.00000000 = 32.0
01000 000.00000000 = 64.0
00001 000.00000000 = 8.0
00101 000.00000000 = 40.0
...
00010 000.00000000 = 16.0 00110 000.00000000 = 48.0
11110 000.00000000 = 240.0
00011 000.00000000 = 24.0 00111 000.00000000 = 56.0
c) Reunite the octets with rest of the IP address and you have your subnet IDs.
172.23.32.0
172.23.64.0
172.23.8.0
172.23.40.0
...
172.23.16.0
172.23.48.0
172.23.240.0
172.23.24.0
172.23.56.0

Appendix A Subnetting Exercises


5) Determine the beginning and ending host IDs for each subnet
a) The 1st host ID for each subnet is all bits turned OFF except one (all 0s would be the network
number)
000.00000001 (when calculating host IDs always add from the far right)
b) The last host ID for each subnet is all bits turned ON except one (all 1s would be the broadcast
address)
111.11111110
c) Combine each subnet ID with each host ID in turn and convert to decimal
Subnet 1
00001 000.00000001 = 8.1
00001 111.11111110 = 15.254
Subnet 2

00010 000.00000001 = 16.1


00010 111.11111110 = 23.254

Subnet 3

00011 000.00000001 = 24.1


00011 111.11111110 = 27.254

...
Subnet 14

11110 000.00000001 = 240.1


11110 111.11111110 = 247.254

d) Combine with remainder of address and you have your beginning/ending host IDs for each
subnet.
Subnet 1
172.23.8.1 to 172.23.15.254
Subnet 2
172.23.16.1 to 172.23.23.254
Subnet 3
172.23.24.1 to 172.23.31.254
...
Subnet 14 172.23.240.1 to 172.23.247.254

Appendix A Subnetting Exercises

Subnetting Helper Sheet completed


Network address to
subnet:
Default subnet mask:
# of networks required:
# of hosts per network:
# of bits borrowed:
Custom subnet mask:
Subnet IDs:

1
2
3
4
5
6
7
8
..
30

170.239.8.0
170.239.16.0
170.239.24.0
170.239.32.0
170.239.40.0
170.239.48.0
170.239.56.0
170.239.64.0
...
170.239.240.0

170.239.0.0
255.255.0.0
15
1,000
5 (renders 30 networks with 2,046 hosts per network)
255.255.248.0 or /21
1st Host ID:
Last Host ID:
Broadcast Address:

170.239.8.1
170.239.16.1
170.239.24.1
170.239.32.1
170.239.40.1
170.239.48.1
170.239.56.1
170.239.64.1

170.239.15.254
170.239.23.254
170.239.31.254
170.239.39.254
170.239.47.254
170.239.55.254
170.239.63.254
170.239.71.254

170.239.15.255
170.239.23.255
170.239.31.255
170.239.39.255
170.239.47.255
170.239.55.255
170.239.63.255
170.239.71.255

170.239.240.1

170.239.247.254 170.239.247.255

How do you easily know what the last network number is without incrementing through every
single network number? Simply turn on all the network address bits except one and convert to
binary!
In this example since we borrowed 5 bits the network portion of the IP address is:
00000 000.00000000

network host
Turning on all network bits except one is: 11110 000.00000000
Convert to decimal and the answer is 240.0
The weird thing about subnetting is that the octet value of 240 represents both the network number
and the host IDs. But the ANDing process always reveals the truth of the matter.

Appendix B Quick & Dirty


Subnetting

Appendix B Quick & Dirty Subnetting

Overview
Youve sweated and toiled, and you finally have a good grasp of subnetting. Now you will learn
how to subnet the Quick and Dirty style. Quick and dirty means NO BINARY and NO
CALCULATOR.
The key to subnetting Quick and Dirty style is via something known as the magic number. You
have worked with the magic number already though you may not have realized it. Once you
determine the magic number in a subnetting problem, everything else is childs play. You can use
this method for any classful or classless address, as long as you are only borrowing from one
octet.
Note: This method works only if you are borrowing from a single octet. If borrowing beyond one octet, do not use this
method.

Copyright 2001-06 by New Frontier Training

77

Appendix B Quick & Dirty Subnetting

How to subnet with no binary numbers and no calculator


This example uses the address 192.168.1.0 /24.
1. Determine the number of bits to borrow
a. Determine the number of hosts per subnet
Count on your fingers, starting at two, doubling the number for each finger until
you get the number of hosts you need (i.e., 1 finger = two subnets, two fingers =
4 subnets etc). Subtract two from the result. If you still have enough hosts, that
is the number of bits that must remain after borrowing. If not, youre one
finger short, so just borrow one additional bit.
b. Determine the number of subnets
Like before, count on your fingers starting at two, doubling the number for each
finger until you get the number of subnets you need. If you are subnetting an
address not previously subnetted, subtract two from the result (must obey the
rule of no all 0s or all 1s the first time an address is subnetted). If you still have
enough subnets while retaining the desired number of host bits, then borrow
that number of bits.
Example for 6 subnets with 30 hosts: 5 bits must remain for hosts, leaving 3 bits to
borrow. 3 bits is enough for 6 subnets, so 3 bits will be borrowed.
2. Determine the Magic Number
a. Start at the number 256, and cut it in half for each bit you borrowed. This gives
you the MAGIC NUMBER. The subnet mask, and all subnet addresses come
from this number.
Example with 3 borrowed bits: 128, 64, 32. (32 is the magic number)
3. Determine the custom subnet mask
a. Subtract the magic number from 256.
Example: 256-32=224. 224 is the custom subnet mask mask for the 4th
octet (255.255.255.224 or /27).
4. Determine the first subnet number
a. The magic number is the 1st subnet number (192.168.1.32)
5. Determine successive subnet numbers
a. Just add the magic number to the previous subnet number.
Example: Previous subnet number was 192.168.1.32. Add the magic
number to 32 = 192.168.1.64. The next subnet number is 192.168.1.96,
then 192.168.1.128, etc.
6. Determine the last subnet number
a. Subtract the magic number from the custom subnet mask.
Example: 224-32 = 192 (192.168.1.192)
7. Determine the Host IDs and broadcast address for any subnet.
a. The number of Host IDs per subnet is always the magic number 2.
b. The first Host ID is always one greater than the subnet number.
c. The last Host ID is always two less than the next subnet number.
d. The broadcast address is always one less than the next subnet number.
Example:
Subnet 192.168.1.32 (255.255.255.224)
There are 30 host addresses (32-2=30)
The first host number is 192.168.1.33 (32+1)
The last host number is 192.168.1.62 (64-2)
Broadcast address is 192.168.1.63 (64-1)

Appendix C Real Life Classful


Subnetting Examples

Appendix C Real Life Subnetting Examples Classful Addresses


Working With Existing Subnetted Networks
Whether you walk into an environment with an existing network, or preparing to take a
certification test, you often need to reverse-engineer the addressing scheme of a network. In
either case, you need to be able to look at an IP address along with its mask and determine what
network ID it is a part of. Here are some examples of classful networks to get you in practice.
Appendix D has some classless examples.

Appendix C Real Life Subnetting Examples Classful Addresses


Example #1
Given the following IP address, answer the questions below:
192.168.1.69
255.255.255.192
1. What subnet number is the IP address part of?
2. How many host IDs for this subnet?
3. How many subnets are there?
To answer these questions, the first order of business is to determine how many bits were
borrowed to create the subnet field. The number of bits in the subnet field determines how many
subnets exist, the subnet IDs, and the number of hosts per subnet.
Since this is a classful address, its a pretty straight forward process. This is a private, class C
address. A value of .192 in the 4th octet where the bits were borrowed converts to 11000000. That
means two bits were borrowed. From here just act like you are subnetting the address for the first
time:

Two borrowed bits means 2 possible subnets; 22-2 = 2.


The first subnet is all subnet bits turned OFF except the low order bit, then recombine the
result with the rest of the bits in the octet; 01 000000 = .64.
The last subnet is all subnet bits turned ON except the low order bit, then recombine the
result with the rest of the bits in the octet; 10 000000 = .128.
There are 6 bits for host IDs; 26 -2 = 62.

Now the questions about this network can be answered. The host is part of subnet 192.168.1.64.
There are 62 hosts per subnet. There are two subnets.

Appendix C Real Life Subnetting Examples Classful Addresses

Example #2
Given the following IP address, answer the questions below:
172.16.2.232
255.255.255.0
1. What subnet number is the IP address part of?
2. How many host IDs for this subnet?
3. How many subnets are there?
Here we have a private class B address with the mask of a class C address. Quite common.
1. Eight borrowed bits in the 3rd octet means 254 possible subnets; 28-2 = 254.
2. The first subnet is all subnet bits turned OFF except the low order bit, then recombine the
result with the rest of the bits in the octet; 00000001 = .1.
3. The last subnet is all subnet bits turned ON except the low order bit, then recombine the
result with the rest of the bits in the octet; 11111110 = .255.
4. There are 8 bits for host IDs; 28 -2 = 254.
The host is part of subnet 172.16.2.0. There are 254 hosts per subnet. There are 254 subnets.

Appendix C Real Life Subnetting Examples Classful Addresses

Example #3
Given the following IP address, answer the questions below:
172.16.2.233
255.255.255.192
1. What subnet number is the IP address part of?
2. How many host IDs for this subnet?
3. How many subnets are there?
Here we have a private class B address with bits borrowed from two octets to create the subnet
field. No need to panic however. The same procedure as the two previous examples applies. Eight
bits have been borrowed from the 3rd octet , and two bits more from the 4th octet (192 =
11000000), for a total of 10 bits in the subnet field.
4. 10 borrowed bits means 254 possible subnets; 210-2 = 1022.
5. The first subnet is all subnet bits turned OFF except the low order bit, then recombine the
result with the rest of the bits in the octet; 00000000.000001 00 = .0.4.
6. The last subnet is all subnet bits turned ON except the low order bit, then recombine the
result with the rest of the bits in the octet; 11111111.111110 00 = 255.248.
7. There are 6 bits for host IDs; 26 -2 = 62.
By enumerating the subnets (0.4, 0.8, 0.12, etc.), you will eventually reach the 2.232, (note that
232 is a multiple of 4). The host is part of subnet 172.16.2.232. There are 62 hosts per subnet.
There are 1,022 subnets. See example 2 in appendix D for a shortcut to quickly determine the
subnet a host belongs to.

Appendix D Real Life Classless


Subnetting Examples

Appendix D Real Life Subnetting Examples Classless Addresses


Real life classless addressing examples
The following subnetting examples are taken from real life applications of classless addressing. All three
are actual examples of ISPs using classless addressing to provide the appropriate amount of host
addresses for its subscribers.

Appendix D Real Life Subnetting Examples Classless Addresses


Example #1
Cable provider allocating a single IP address to a subscriber
Customers IP configuration:
IP Address
24.11.203.84
Subnet Mask
255.255.255.0
Default Gateway 24.11.203.1
1. What subnet number is the IP address part of?
2. How many host IDs for this subnet?
3. How many subnets are there?
Now we are in a world that is quite apart from the classful examples in appendix C. These are classless
CIDR addresses, so no assumptions can be made about the starting point for borrowing bits. If this was a
classful address it would be known that 16 bits had been borrowed for the subnet field. The class A
24.0.0.0 and a prefix of /24 would tell us that. But its a public address, a CIDR address, so you have to
proceed more carefully. Even though it is clear that 24 bits form the network portion of the address, and 8
bits form the host portion, what is not known is what the mask was of the address just before the subnet
was created. Was it an /8? Doubtful. A /16? Maybe. Variable subnetting used? Who knows. Its just not
easy to determine how the base address was allocated Therefore it is not known what the range of subnets
is using this mask. However, the subnet ID and host scope for this address can be ascertained.

LOOKING UP AN ADDRESS WITH WHOIS


In America, ARIN allocates public addresses to large ISPs and some large organizations. An ARIN
allocated address can be looked up at http://www.arin.net/whois. Type in the address and click the search
button. The results will show ARINs record of who has received the initial allocation. It does not show
any entities that ranges of the address have been leased to.

1. The subnet ID is 24.11.203.0 /24, and provides host addresses in the range 24.11.203.1 to
24.11.203.254. This is a simple calculation based on the /24 prefix, which allows 8 bits to form 254
host addresses.
2. IP address 24.11.203.84 is assigned to the cable modem at the customers premises, probably
automatically through DHCP. The default gateway of 24.11.203.1 is the ISPs router for this subnet.
The gateway address must be on the same subnet. The cable provider is usually running Ethernet as
the layer 2 protocol even over what must be a significant distance. In other words, this is a LAN not
a WAN (a WAN would require a WAN layer 2 protocol such as SLIP or PPP, and likely use a twohost subnet address).
3. The customer is not necessarily entitled to use any other addresses on the subnet. The customer is in
fact sharing the address range (as well as the bandwidth!) of this network with the neighbors. They
are all on one LAN that extends throughout the neighborhood. With likely only one IP address, the
customer is relegated to using Network Address Translation or a proxy server in order to share the
connection. Of course, virtually all home Internet routers have NAT capability, and the Windows
based Internet Connection Sharing facility provides software based NAT.

Appendix D Real Life Subnetting Examples Classless Addresses


Example #2
DSL provider allocating a network to a subscriber
Customers IP configuration:
Computer #1
IP Address
4.3.211.112
Subnet Mask
255.255.248.0
Default Gateway 4.3.208.1
Computer #2
IP Address
4.3.213.25
Subnet Mask
255.255.248.0
Default Gateway 4.3.208.1
This is the same basic drill as example #1, except its a DSL connection provided by the phone company,
and the customer has two systems both getting their IP address from the cable provider. The assigned
public address is either a CIDR address or a legacy class A address that has not yet been reallocated. As
with any CIDR address, there is no way to look at just the IP configuration of a host and determine how
the address space has been allocated. Lets see what we can learn though.
The mask of .248 in the 3rd octet (/21) tells us that 11 bits remain for host IDs, thus 2046 host addresses
for this subnet. A 2000+ address space for this subnet makes for a much larger network than the previous
cable example, but in this case the subscriber is only sharing the same network with its neighbors, not the
same bandwidth. Unlike cable, DSL provides a private pipe to the customer premises.
Lets determine which subnet these two hosts are a part of. Unlike the last example, where the custom
mask fell on an octet boundary, you cant just eyeball the address and determine the subnet number. You
could enumerate each subnet like this . . .
00001 000.00000000 = 8.0
00010 000.00000000 = 16.0
00011 000.00000000 = 24.0
...
11110000.00000000 = 240.0
. . . but is there a better way? Yes. Heres how:
First, convert the octet of the portion of the address where the dividing line is drawn between the network
bits and the host bits the 3rd octet in this case. The first computer will be used as an example.
211 = 11010 011
Remember that the first 21 bits of this address are used for the subnet ID. Now simply turn OFF the bits
in the octet that are NOT part of the subnet ID. That would be the 3 low order bits. Now convert back to
decimal.
11010 000 = 208
The subnet ID is 4.3.208.0.

Appendix E Subnetting Tables

Appendix E Subnetting Tables

Subnetting Tables (classful)

Class A network subnetting possibilities (default subnet mask = 255.0.0.0.)


Number of bits borrowed
for subnet mask
2
3
4
5
6
7
8

Number of Subnets created


from borrowed bits
2 (22-2)
6 (23-2)
14 (24-2)
30 (25-2)
62 (26-2)
126 (27-2)
254 (28-2)

Number of hosts per subnet

Custom Subnet Mask

4,194,302 (222-2)
2,097,150 (221-2)
1,048,574 (220-2)
524,286 (219-2)
262,142 (218-2)
131,070 (217-2)
65,534 (216-2)

255.192.0.0
255.224.0.0
255.240.0.0
255.248.0.0
255.252.0.0
255.254.0.0
255.255.0.0

Class A subnetting could continue past this table by borrowing bits from the 3rd and 4th octet.
Class B network subnetting possibilities (default subnet mask = 255.255.0.0.)
Number of bits borrowed
for subnet mask
2
3
4
5
6
7
8

Number of Subnets created


from borrowed bits
2 (22-2)
6 (23-2)
14 (24-2)
30 (25-2)
62 (26-2)
126 (27-2)
254 (28-2)

Number of hosts per subnet

Custom Subnet Mask

16,382 (214-2)
8,190 (213-2)
4,094 (212-2)
2,046 (211-2)
1,022 (210-2)
510 (29-2)
254 (28-2)

255.255.192.0
255.255.224.0
255.255.240.0
255.255.248.0
255.255.252.0
255.255.254.0
255.255.255.0

Class B subnetting could continue past this table by borrowing bits from the 4th octet.
Class C network subnetting possibilities (default subnet mask = 255.255.255.0.)

Number of bits borrowed


for subnet mask
2
3
4
5
6
7
8

Number of Subnets created


from borrowed bits
2 (22-2)
6 (23-2)
14 (24-2)
30 (25-2)
62 (26-2)
126 (27-2) Invalid
254 (28-2) Invalid

Number of hosts per subnet

Custom Subnet Mask

62 (26-2)
30 (25-2)
14 (24-2)
6 (23-2)
2 (22-2)
0 (21-2) Invalid
-1 (20-2) Invalid

255.255.255.192
255.255.255.224
255.255.255.240
255.255.255.248
255.255.255.252
255.255.255.254
255.255.255.255

Appendix F A word about Cisco


Routers

90

Copyright 2001-06 by New Frontier Training

Appendix F A Word About Cisco Routers

A word about Cisco routers


Cisco routers, have a few unique features that make life more flexible for network addressing.
These features dont always follow RFC conventions, and they have their caveats, but we are
mentioning them here since Cisco owns such a large portion of the router market.
1. Cisco routers allow subnets to begin at 0 (all subnet bits set to 0). This does not conform
to the RFCs for subnetting, which say zero cannot be a valid network number, but none-theless Cisco routers can do it if you use the global configuration command ip subnet-zero.
2. Cisco routers also have the IP unnumbered command. This command allows a point-topoint link between two networks without the use of an IP address on either router interface.
3. Cisco routers also have the capability of defining two IP addresses to one interface (known as
a secondary addresses). This is a flexible tool that helps out in a variety of circumstances.
When implementing such a configuration, care must be taken to insure that all networking
equipment in the environment supports the 0 subnet.

Copyright 2001-06 by New Frontier Training

91

S-ar putea să vă placă și