IPv4 Addressing
and Subnetting
G. Gianini
Summary
• Addressing basics in IPv4
• Limits and problems
• Fixed Mask Subnetting
• Variable Lenght Subnet Masking
• A look at CIDR and IPv6
IPv4 Addressing basics
IPv4 Header
The IPv4 address space consists of a 32 bit field,
or the equivalent of some 4.5 billion values
Dotted-decimal notation
IP address classes
The three classes we focus on
Some special addresses
Zero and All One Host Numbers
• The values 0 and -1 (all ones) have always special
meanings when used in Host Numbers :
– The value zero means “this” host
– The value -1 is used as a broadcast address to mean all
hosts of the indicated network
• As a consequence if n bits are reserved for the host
addressing only 2^n -2 different hosts can be
given an address.
Zero Network Numbers
• In Network numbers of class A,B or C, the zero network number has a special meaning in the three following cases:
– 0.x.x.x means this network within a class A network
– 0.0.x.x means this network within a class B network
– 0.0.0.x means this network within a class C network
The all zero address
• As a consequence of the zero rules
for nets and host
– 0.0.0.0 means this host
The all Ones Network Number
• By convention
– 255.255.255.255 indicates
a broadcast on the
local network
Class A Networks (/8 Prefixes)
Class B Networks (/16 Prefixes)
Class D Networks (/24 Prefixes)
How many nets? How many hosts?
A
B
C
_
2^31 IP addresses (=2,147,483,648) distributed over
2^7 possible network addresses
each with
2^24 hosts (16,777,216)
From those figures one must subtract special addresses as mentioned above
2^30 IP addresses (=1,073,741,824) distributed over
2^14 possible network addresses
each with
2^16 hosts (=65,536)
From those figures one must subtract special addresses as mentioned above
2^29 IP addresses (=536,870,912) distributed over
2^21 network addresses (=2,097,152)
each with
2^8 hosts (=256)
From those figures one must subtract special addresses as mentioned above
0
5
10
15
20
25
30
0 5 10 15 20 25
Network size (log2 n.hosts)
Number of networks (log2 n)
Network
sizeNumber of
Networks
7 14 21
A
C
B
Problems
What if reality does not fit the theory?
• Think of systems of objects of different sizes
(such as vehicles) and of their distribution (if a
parking lot doesn’t fit the actual
vehicles’distribution we are unhappy)
• Think of different case studies of object naming
grouped objects:
– people addresses in cities (mail addressing)
– telephone numbers
– car plates in provinces and states
– computer addresses and organizations
Unforeseen Limitations to
Classful Addressing
The original designers never envisioned that the Internet
would grow into what it has become today.
(Unforseen developements which clash against
the insufficient allocation of a resource
are quite common in many areas: think of Y2K)
Many of the problems that the Internet is facing today
can be traced back to the early decisions that were made
during its formative years.
Depletion of address spaceDuring the early days of the Internet, the seemingly unlimited address space
allowed IP addresses to be allocated to an organization
based on its request rather than its actual need.
As a result, addresses were freely assigned to those who asked for them
without concerns about the eventual depletion of the IP address space.
The decision to standardize on a 32-bit address space
meant that there were only 2^32 = (4,294,967,296) IPv4 addresses available.
A decision to support a slightly larger address space
would have exponentially increased the number of addresses,
and eliminated (or postponed) the current address shortage problem.
No support for medium-sized
organizations
The classful A, B, and C octet boundaries were easy to understand and implement,
but they did not foster the efficient allocation of a finite address space.
Problems resulted from the lack of a network class that was designed
to support medium-sized organizations.
A /24, which supports 254 hosts, is too small
while a /16, which supports 65,534 hosts, is too large.
In the past, the Internet has assigned sites with several hundred hosts a single /16 address
instead of a couple of /24s addresses.
Unfortunately, this has resulted in a premature depletion of the /16 network address space.
The only readily available addresses for medium-size organizations are /24s which have
the potentially negative impact of increasing the size of the global Internet's routing table.
IETF
Short for Internet Engineering Task Force,
the main standards organization for the Internet.
The IETF is a large open international community
of network designers, operators, vendors, and researchers
concerned with the evolution of the Internet architecture
and the smooth operation of the Internet.
It is open to any interested individual.
From Webopedia
IANA
Short for Internet Assigned Numbers Authority,
an organization working under the auspices
of the Internet Architecture Board (IAB) that is
responsible for assigning new Internet-wide IP addresses.
From Webopedia
INTERNET PROTOCOL V4 ADDRESS SPACE (last updated 03 August 2004)
Originally, all the IPv4 address spaces was managed directly by the IANA. Later parts of
the address space were allocated to various other registries to manage for particular purposes
or regional areas of the world. RFC 1466 [RFC1466] documents most of these allocations.
Block Date Registry - Purpose Notes or Reference
----- ------ --------------------------- ------------------
000/8 Sep 81 IANA - Reserved
001/8 Sep 81 IANA - Reserved
002/8 Sep 81 IANA - Reserved
003/8 May 94 General Electric Company
004/8 Dec 92 Bolt Beranek and Newman Inc.
005/8 Jul 95 IANA - Reserved
006/8 Feb 94 Army Information Systems Center
007/8 Apr 95 IANA - Reserved
008/8 Dec 92 Bolt Beranek and Newman Inc.
009/8 Aug 92 IBM
010/8 Jun 95 IANA - Private Use See [RFC1918]
011/8 May 93 DoD Intel Information Systems
012/8 Jun 95 AT&T Bell Laboratories
013/8 Sep 91 Xerox Corporation
014/8 Jun 91 IANA - Public Data Network
015/8 Jul 94 Hewlett-Packard Company
016/8 Nov 94 Digital Equipment Corporation
017/8 Jul 92 Apple Computer Inc.
018/8 Jan 94 MIT
019/8 May 95 Ford Motor Company
020/8 Oct 94 Computer Sciences Corporation
021/8 Jul 91 DDN-RVN
022/8 May 93 Defense Information Systems Agency
023/8 Jul 95 IANA - Reserved
024/8 May 01 ARIN - Cable Block (Formerly IANA - Jul 95)
025/8 Jan 95 Royal Signals and Radar Establishment
026/8 May 95 Defense Information Systems Agency
027/8 Apr 95 IANA - Reserved
028/8 Jul 92 DSI-North
029/8 Jul 91 Defense Information Systems Agency
030/8 Jul 91 Defense Information Systems Agency
031/8 Apr 99 IANA - Reserved
032/8 Jun 94 Norsk Informasjonsteknology
033/8 Jan 91 DLA Systems Automation Center
034/8 Mar 93 Halliburton Company
035/8 Apr 94 MERIT Computer Network
036/8 Jul 00 IANA - Reserved (Formerly Stanford University - Apr 93)
037/8 Apr 95 IANA - Reserved
038/8 Sep 94 Performance Systems International
039/8 Apr 95 IANA - Reserved
040/8 Jun 94 Eli Lily and Company
041/8 May 95 IANA - Reserved
042/8 Jul 95 IANA - Reserved
043/8 Jan 91 Japan Inet
044/8 Jul 92 Amateur Radio Digital Communications
045/8 Jan 95 Interop Show Network
046/8 Dec 92 Bolt Beranek and Newman Inc.
047/8 Jan 91 Bell-Northern Research
048/8 May 95 Prudential Securities Inc.
049/8 May 94 Joint Technical Command (Returned to IANA Mar 98)
050/8 May 94 Joint Technical Command (Returned to IANA Mar 98)
051/8 Aug 94 Deparment of Social Security of UK
052/8 Dec 91 E.I. duPont de Nemours and Co., Inc.
053/8 Oct 93 Cap Debis CCS
054/8 Mar 92 Merck and Co., Inc.
055/8 Apr 95 Boeing Computer Services
056/8 Jun 94 U.S. Postal Service
057/8 May 95 SITA
058/8 Apr 04 APNIC (whois.apnic.net)
059/8 Apr 04 APNIC (whois.apnic.net)
060/8 Apr 03 APNIC (whois.apnic.net)
061/8 Apr 97 APNIC (whois.apnic.net)
062/8 Apr 97 RIPE NCC (whois.ripe.net)
063/8 Apr 97 ARIN (whois.arin.net)
064/8 Jul 99 ARIN (whois.arin.net)
065/8 Jul 00 ARIN
066/8 Jul 00 ARIN
067/8 May 01 ARIN
068/8 Jun 01 ARIN
069/8 Aug 02 ARIN
070/8 Jan 04 ARIN
071/8 Aug 04 ARIN
072/8 Aug 04 ARIN
073/8 Sep 81 IANA - Reserved
074/8 Sep 81 IANA - Reserved
075/8 Sep 81 IANA - Reserved
076/8 Sep 81 IANA - Reserved
077/8 Sep 81 IANA - Reserved
078/8 Sep 81 IANA - Reserved
079/8 Sep 81 IANA - Reserved
080/8 Apr 01 RIPE NCC
081/8 Apr 01 RIPE NCC
082/8 Nov 02 RIPE NCC
083/8 Nov 03 RIPE NCC
084/8 Nov 03 RIPE NCC
085/8 Apr 04 RIPE NCC
086/8 Apr 04 RIPE NCC
087/8 Apr 04 RIPE NCC
088/8 Apr 04 RIPE NCC
089/8 Sep 81 IANA - Reserved
090/8 Sep 81 IANA - Reserved
091/8 Sep 81 IANA - Reserved
092/8 Sep 81 IANA - Reserved
093/8 Sep 81 IANA - Reserved
094/8 Sep 81 IANA - Reserved
095/8 Sep 81 IANA - Reserved
096/8 Sep 81 IANA - Reserved
097/8 Sep 81 IANA - Reserved
098/8 Sep 81 IANA - Reserved
099/8 Sep 81 IANA - Reserved
100/8 Sep 81 IANA - Reserved
101/8 Sep 81 IANA - Reserved
102/8 Sep 81 IANA - Reserved
103/8 Sep 81 IANA - Reserved
104/8 Sep 81 IANA - Reserved
105/8 Sep 81 IANA - Reserved
106/8 Sep 81 IANA - Reserved
107/8 Sep 81 IANA - Reserved
108/8 Sep 81 IANA - Reserved
109/8 Sep 81 IANA - Reserved
110/8 Sep 81 IANA - Reserved
111/8 Sep 81 IANA - Reserved
112/8 Sep 81 IANA - Reserved
113/8 Sep 81 IANA - Reserved
114/8 Sep 81 IANA - Reserved
115/8 Sep 81 IANA - Reserved
116/8 Sep 81 IANA - Reserved
117/8 Sep 81 IANA - Reserved
118/8 Sep 81 IANA - Reserved
119/8 Sep 81 IANA - Reserved
120/8 Sep 81 IANA - Reserved
121/8 Sep 81 IANA - Reserved
122/8 Sep 81 IANA - Reserved
123/8 Sep 81 IANA - Reserved
124/8 Sep 81 IANA - Reserved
125/8 Sep 81 IANA - Reserved
126/8 Sep 81 IANA - Reserved
127/8 Sep 81 IANA - Reserved
128/8 May 93 Various Registries
129/8 May 93 Various Registries
130/8 May 93 Various Registries
131/8 May 93 Various Registries
132/8 May 93 Various Registries
133/8 May 93 Various Registries
134/8 May 93 Various Registries
135/8 May 93 Various Registries
136/8 May 93 Various Registries
137/8 May 93 Various Registries
138/8 May 93 Various Registries
139/8 May 93 Various Registries
140/8 May 93 Various Registries
141/8 May 93 Various Registries
142/8 May 93 Various Registries
143/8 May 93 Various Registries
144/8 May 93 Various Registries
145/8 May 93 Various Registries
146/8 May 93 Various Registries
147/8 May 93 Various Registries
148/8 May 93 Various Registries
149/8 May 93 Various Registries
150/8 May 93 Various Registries
151/8 May 93 Various Registries
152/8 May 93 Various Registries
153/8 May 93 Various Registries
154/8 May 93 Various Registries
155/8 May 93 Various Registries
156/8 May 93 Various Registries
157/8 May 93 Various Registries
158/8 May 93 Various Registries
159/8 May 93 Various Registries
160/8 May 93 Various Registries
161/8 May 93 Various Registries
162/8 May 93 Various Registries
163/8 May 93 Various Registries
164/8 May 93 Various Registries
165/8 May 93 Various Registries
166/8 May 93 Various Registries
167/8 May 93 Various Registries
168/8 May 93 Various Registries
169/8 May 93 Various Registries
170/8 May 93 Various Registries
171/8 May 93 Various Registries
172/8 May 93 Various Registries
173/8 Apr 03 IANA - Reserved
174/8 Apr 03 IANA - Reserved
175/8 Apr 03 IANA - Reserved
176/8 Apr 03 IANA - Reserved
177/8 Apr 03 IANA - Reserved
178/8 Apr 03 IANA - Reserved
179/8 Apr 03 IANA - Reserved
180/8 Apr 03 IANA - Reserved
181/8 Apr 03 IANA - Reserved
182/8 Apr 03 IANA - Reserved
183/8 Apr 03 IANA - Reserved
184/8 Apr 03 IANA - Reserved
185/8 Apr 03 IANA - Reserved
186/8 Apr 03 IANA - Reserved
187/8 Apr 03 IANA - Reserved
188/8 May 93 Various Registries
189/8 Apr 03 IANA - Reserved
190/8 Apr 03 IANA - Reserved
191/8 May 93 Various Registries
192/8 May 93 Various Registries
193/8 May 93 RIPE NCC (whois.ripe
194/8 May 93 RIPE NCC (whois.ripe
195/8 May 93 RIPE NCC (whois.ripe
196/8 May 93 Various Registries
197/8 May 93 IANA - Reserved
198/8 May 93 Various Registries
199/8 May 93 ARIN (whois.arin
200/8 Nov 02 LACNIC (whois.lacn
201/8 Apr 03 LACNIC (whois.lacn
202/8 May 93 APNIC (whois.apni
203/8 May 93 APNIC (whois.apni
204/8 Mar 94 ARIN (whois.arin
205/8 Mar 94 ARIN (whois.arin
206/8 Apr 95 ARIN (whois.arin
207/8 Nov 95 ARIN (whois.arin
208/8 Apr 96 ARIN (whois.arin
209/8 Jun 96 ARIN (whois.arin
210/8 Jun 96 APNIC (whois.apni
211/8 Jun 96 APNIC
212/8 Oct 97 RIPE NCC
213/8 Mar 99 RIPE NCC
214/8 Mar 98 US-DOD
215/8 Mar 98 US-DOD
216/8 Apr 98 ARIN
217/8 Jun 00 RIPE NCC
218/8 Dec 00 APNIC
219/8 Sep 01 APNIC
220/8 Dec 01 APNIC
221/8 Jul 02 APNIC
222/8 Feb 03 APNIC
223/8 Apr 03 IANA - Reserved
224/8 Sep 81 IANA - Multicast
225/8 Sep 81 IANA - Multicast
226/8 Sep 81 IANA - Multicast
227/8 Sep 81 IANA - Multicast
228/8 Sep 81 IANA - Multicast
229/8 Sep 81 IANA - Multicast
230/8 Sep 81 IANA - Multicast
231/8 Sep 81 IANA - Multicast
232/8 Sep 81 IANA - Multicast
233/8 Sep 81 IANA - Multicast
234/8 Sep 81 IANA - Multicast
235/8 Sep 81 IANA - Multicast
236/8 Sep 81 IANA - Multicast
237/8 Sep 81 IANA - Multicast
238/8 Sep 81 IANA - Multicast
239/8 Sep 81 IANA - Multicast
240/8 Sep 81 IANA - Reserved
241/8 Sep 81 IANA - Reserved
242/8 Sep 81 IANA - Reserved
243/8 Sep 81 IANA - Reserved
244/8 Sep 81 IANA - Reserved
245/8 Sep 81 IANA - Reserved
246/8 Sep 81 IANA - Reserved
247/8 Sep 81 IANA - Reserved
248/8 Sep 81 IANA - Reserved
249/8 Sep 81 IANA - Reserved
250/8 Sep 81 IANA - Reserved
251/8 Sep 81 IANA - Reserved
252/8 Sep 81 IANA - Reserved
253/8 Sep 81 IANA - Reserved
254/8 Sep 81 IANA - Reserved
255/8 Sep 81 IANA - Reserved
Summary Table for Specialized Address Blocks
Address Block Present Use Reference
---------------------------------------------------------------------
000.000.000.000/8 "This" Network [RFC1700, page 4]
010.000.000.000/8 Private-Use Networks [RFC1918]
014.000.000.000/8 Public-Data Networks [RFC1700, page 181]
024.000.000.000/8 Cable Television Networks --
039.000.000.000/8 Reserved but subject to allocation [RFC1797]
127.000.000.000/8 Loopback [RFC1700, page 5]
128.000.000.000/16 Reserved but subject to allocation --
169.254.0.0/16 Link Local --
172.16.0.0/12 Private-Use Networks [RFC1918]
191.255.0.0/16 Reserved but subject
to allocation --
192.0.0.0/24 Reserved but subject to allocation --
192.0.2.0/24 Test-Net
192.88.99.0/24 6to4 Relay Anycast [RFC3068]
192.168.0.0/16 Private-Use Networks [RFC1918]
198.18.0.0/15 Network Interconnect
Device Benchmark Testing [RFC2544]
223.255.255.0/24 Reserved but subject to allocation --
224.0.0.0/4 Multicast [RFC3171]
240.0.0.0/4 Reserved for Future Use [RFC1700, page 4]
The Internet Assigned Numbers Authority (IANA) has reserved the
following three blocks of the IP address space for private
internets:
10.0.0.0 - 10.255.255.255 (10/8 prefix)
172.16.0.0 - 172.31.255.255 (172.16/12 prefix)
192.168.0.0 - 192.168.255.255 (192.168/16 prefix)
We will refer to
the first block as "24-bit block",
the second as "20-bit block", and to
the third as "16-bit" block.
Note that (in pre-CIDR notation)
the first block is nothing but a single class A network number,
the second is a set of 16 contiguous class B network numbers,
and the third is a set of 256 contiguous class C network numbers.
IPv4 Address Space
Unicast 219.92 /8s 85.91%
Multicast 16.00 /8s 6.25%
IETF Res. 20.08 /8s 7.84%
Total address space:
- 256 chunks or "/8's",
each of which spans
16,777,216
address values.
The blocks of addresses
- from 224.000.000.000
to 239.255.255.255
reserved for Multicast use.
- from 240.000.000.000
to 255.255.255.255
reserved for future definition.
The address blocks
0.0.0.0/8, 14.0.0.0/8, 127.0.0.0/8
are reserved, as are the address
ranges used for private networks
and other reserved uses.
See RFC 3330.
The remaining addresses, the
equivalent of 219.92 /8 address
blocks form the pool of unicast
addresses which are used for
the Internet.
IANA allocations nowdays
Allocated 142.92 /8s 55.83%
IANA Pool 77.00 /8s 30.08%
Multicast 16.00 /8s 6.25%
IETF Res. 20.08 /8s 7.84%
IPv4 IANA ProjectionsThe post-1995 data has been fitted to an exponential growth model
(a model that assumes growth is proportional to the total size of the network)
The extrapolation of this model to the point of address pool exhaustion is shown here.
The END of IPv4IPv4 Address Space Exhaustion Predictors:
Application of best fit models to historical data relating to the growth in the address space
advertised in the BGP routing table. The underlying assumptions made in this predictive
model is that the previous drivers in address consumption will continue to determine future
consumption rates, and that growth in consumption rates will continue to operate
in a fashion where the growth rate is constant rather than increasing or decreasing.
Source: http://bgp.potaroo.net/ipv4/
Prediction updated: 23 October 2005 (now)
Exhaustion of the IPv4 Unallocated Address Pool
March 2013
Complete Exhaustion of all available IPv4 Address Space:
August 2022 !!!
Summary of problems
- Address space depletion
- Bloating of Internet routing tables.
- Bourocratic loads: local administrators had to request
another network number from the Internet
before a new network could be installed at their site.
The subsequent history of Internet addressing is focused
on a series of steps that overcome these addressing issues
and have supported the growth of the global Internet.
Subnetting
Subnetting
• One solution is to allow a network to be
split in several parts for internal use, but
still act as a single network to the outside
world.
Example A campus network
Here each of the ethernets has his own router
connected to the main router
How does it work
• When a packet comes into the main router, how
does this know which subnet (Ethernet) to give it
to?
• Having a host table with 65K entries each with the
responsable router is impractical
• A better way is that of devoting a part of the host
address to the specification of the router address
Fixed Length Mask Subnetting
In practice some bits are taken away from the host number to
create a subnet number
This adds another level of hierarchy to the IP addressing structure.
Instead of the classful two-level hierarchy, subnetting supports a three-
level hierarchy.
Subnet Mask
To implement subnetting the main router needs a subnet mask that indicates
the split between the network+subnetwork number and host: the subnet mask
tells the net router where the host addresses starts. The bits of the subnet
mask are set to 1 if the system examining the address should treat the
corresponding bit in the IP address as part of the extended-network- prefix.
The bits in the mask are set to 0 if the system should treat the bit as part of
the host-number.
Extended-Network-Prefix LengthThe standards describing modern routing protocols often refer to
the extended-network-prefix- length rather than the subnet mask.
The prefix length is equal to the number of contiguous
one-bits in the traditional subnet mask.
However, it is important to note that modern routing protocols
still carry the subnet mask. There are no Internet standard routing
protocols that have a one-byte field in their header that contains
the number of bits in the extended-network prefix. Rather,
each routing protocol is still required to carry the complete four-octet subnet mask.
How does it work?
In order to route an incoming packet
the main router uses the mask by performing
a logical AND operation, so as to extract the
network address from the overall address, and hands
the packet to the corresponding router.
Address: 11000000 10101000 00010010 10110111
Subnet Mask: 11111111 11111111 11111111 11000000
AND -------- -------- -------- --------
Network ID: 11000000 10101000 00010010 10000000
In the last column of the above example
we have a class C address with a mask of length 26
which tells us that the host portion of the address
10110111 must be split into
the subnet prefix 10
and the host address 110111
How it works without subnetting
• Each router has a table listing
some number of (network, 0) IP addresses and
some number of (this-network, host) IP addresses:
associated with each table is the network interface
to use to reach the destination.The first table is for distant
networks, the second for local hosts.
• When an IP packet arrives its destination address is looked up
in the routing table: if it is for a distant network it is
forwarded to the router indicated in the table; if it is for a
local host (e.g. on the touter LAN) it is sent directly to dht
destination.
How it works with subnetting• When subnetting is introduced the routing tables are
changed, adding entries of the form
(this-network, subnet, 0) and
(this-network, this-subnet, host)
• The first is used to reach other subnets,
the second to reach the hosts of the local subnet.
• Notice that in this way the router does not have to know
the details about the hosts on other subnets: the router will
- take the IP address
- perform an AND with the subnet mask
getting rid of the host number
- look up the resulting subnet number in the routing table.
BenefitsThe size of the global Internet routing table does not grow
because the site administrator does not need to obtain additional
address space and the routing advertisements for
all of the subnets are combined into a single routing table entry.
The local administrator has the flexibility to deploy
additional subnets without obtaining a new network
number from the Internet.
Route flapping (i.e., the rapid changing of routes)
within the private network does not affect the
Internet routing table since Internet routers
do not know about the reachability of the individual
subnets - they just know about the reachability
of the parent network number.
Subnet Design Considerations
The deployment of an addressing plan requires careful thought on the part of the network
administrator. There are four key questions that must be answered before any design
should be undertaken:
1) How many total subnets does the organization need today?
2) How many total subnets will the organization need in the future?
3) How many hosts are there on the organization's largest subnet today?
4) How many hosts will there be on the organization's largest subnet in the future?
All Zero and all one hosts
Recall that according to Internet practices,
the host-number field of an IP address
cannot contain all 0-bits or all 1-bits:
- the all-0s host-number identifies the base network
(or subnetwork) number,
-the all-1s host-number represents the broadcast address
for the network (or subnetwork).
In practice with n bits one will be able to address 2^n-2 hosts
To subnet a network, extend the natural mask using some of the bits
from the host ID portion of the address to create a subnetwork ID.
For example, given a Class C network of 204.15.5.0 which has a
natural mask of 255.255.255.0, you can create subnets in this manner:
204.15.5.0 - 11001100.00001111.00000101.00000000
255.255.255.224 - 11111111.11111111.11111111.11100000
--------------------------|sub|----
By extending the mask to be 255.255.255.224, you have taken
three bits (indicated by "sub") from the original host portion
of the address and used them to make subnets. With these three bits,
it is possible to create eight subnets.
With the remaining five host ID bits, each subnet can have
up to 32 host addresses, 30 of which can actually
be assigned to a device since host ids of all zeros or all ones
are not allowed. So, with this in mind, these subnets have been created.
204.15.5.0 255.255.255.224 host address range 1 to 30
204.15.5.32 255.255.255.224 host address range 33 to 62
204.15.5.64 255.255.255.224 host address range 65 to 94
204.15.5.96 255.255.255.224 host address range 97 to 126
204.15.5.128 255.255.255.224 host address range 129 to 158
204.15.5.160 255.255.255.224 host address range 161 to 190
204.15.5.192 255.255.255.224 host address range 193 to 222
204.15.5.224 255.255.255.224 host address range 225 to 254
How to subnet a network
Three bits are reserved for the subnet addresses
Five bits are reserved for the host addresses
This means that there is going to be room
for 2^3 = 8 subnets each with at most
2^5-2 = 30 hosts
Example
Subnetting a class C network
More subnets => less hosts
This brings up an interesting point.
The more host bits you use for a subnet mask,
the more subnets you have available.
However, the more subnets available,
the less host addresses available per subnet.
For example, a Class C network of 204.17.5.0
and a mask of 255.255.255.224 (/27) allows you
to have eight subnets, each with 32 host addresses
(30 of which could be assigned to devices).
If you use a mask of 255.255.255.240 (/28),
the break down is:
204.15.5.0 - 11001100.00001111.00000101.00000000
255.255.255.240 - 11111111.11111111.11111111.11110000
--------------------------|sub |---
Since you now have four bits to make subnets with,
you only have four bits left for host addresses.
So in this case you can have up to 16 subnets,
each of which can have up to 16 host addresses
(14 of which can be assigned to devices).
Class C Host/Subnet Table
Class C Subnet Effective Effective Number of Subnet
Bits Mask Subnets Hosts Mask Bits
------- --------------- --------- --------- --------------
1 255.255.255.128 2 126 /25
2 255.255.255.192 4 62 /26
3 255.255.255.224 8 30 /27
4 255.255.255.240 16 14 /28
5 255.255.255.248 32 6 /29
6 255.255.255.252 64 2 /30
7 255.255.255.254 128 2* /31
Notice that an exception to the 2^n-2 rule is 31-bit prefixes,
marked with an asterisk ( * ).
Subnetting a Class B network
Take a look at how a Class B network might be subnetted.
If you have network 172.16.0.0 ,then you know that its natural
mask is 255.255.0.0 or 172.16.0.0/16. Extending the mask
to anything beyond 255.255.0.0 means you are subnetting.
You can quickly see that you have the ability to create
a lot more subnets than with the Class C network.
If you use a mask of 255.255.248.0 (/21), how many subnets
and hosts per subnet does this allow for?
172.16.0.0 - 10101100.00010000.00000000.00000000
255.255.248.0 - 11111111.11111111.11111000.00000000
-----------------| sub |-----------
You are using five bits from the original host bits for subnets.
This will allow you to have 32 subnets (25). After using
the five bits for subnetting, you are left with 11 bits
for host addresses. This will allow each subnet
so have 2048 host addresses (211), 2046 of which
could be assigned to devices.
Example
Subnetting a class B network
Nine bits are reserved for the subnet addresses
Seven bits are reserved for the host addresses
This means that there is going to be room
for 2^9 = 512 subnets each with at most
2^7-2 = 126 hosts
Class B Host/Subnet Table
Class B Subnet Effective Effective Number of Subnet
Bits Mask Subnets Hosts Mask Bits
------- --------------- --------- --------- -------------
1 255.255.128.0 2 32766 /17
2 255.255.192.0 4 16382 /18
3 255.255.224.0 8 8190 /19
4 255.255.240.0 16 4094 /20
5 255.255.248.0 32 2046 /21
6 255.255.252.0 64 1022 /22
7 255.255.254.0 128 510 /23
8 255.255.255.0 256 254 /24
9 255.255.255.128 512 126 /25
10 255.255.255.192 1024 62 /26
11 255.255.255.224 2048 30 /27
12 255.255.255.240 4096 14 /28
13 255.255.255.248 8192 6 /29
14 255.255.255.252 16384 2 /30
15 255.255.255.254 32768 2* /31
Class A Host/Subnet TableClass A
Number of
Bits Borrowed Subnet Effective Number of Number of Subnet
from Host Portion Mask Subnets Hosts/Subnet Mask Bits
------- --------------- --------- ------------- -------------
1 255.128.0.0 2 8388606 /9
2 255.192.0.0 4 4194302 /10
3 255.224.0.0 8 2097150 /11
4 255.240.0.0 16 1048574 /12
5 255.248.0.0 32 524286 /13
6 255.252.0.0 64 262142 /14
7 255.254.0.0 128 131070 /15
8 255.255.0.0 256 65534 /16
9 255.255.128.0 512 32766 /17
10 255.255.192.0 1024 16382 /18
11 255.255.224.0 2048 8190 /19
12 255.255.240.0 4096 4094 /20
13 255.255.248.0 8192 2046 /21
14 255.255.252.0 16384 1022 /22
15 255.255.254.0 32768 510 /23
16 255.255.255.0 65536 254 /24
17 255.255.255.128 131072 126 /25
18 255.255.255.192 262144 62 /26
19 255.255.255.224 524288 30 /27
20 255.255.255.240 1048576 14 /28
21 255.255.255.248 2097152 6 /29
22 255.255.255.252 4194304 2 /30
23 255.255.255.254 8388608 2* /31
Subnetting Example
The first entry in the Class A table (/10 subnet mask) borrows two bits (the leftmost bits)
from the host portion of the network for subnetting, then with two bits you have
four (22) combinations, 00, 01, 10, and 11. Each of these will represent a subnet.
Binary Notation Decimal Notation
-------------------------------------------------- -----------------
xxxx xxxx. 0000 0000.0000 0000.0000 0000/10 ------> X.0.0.0/10
xxxx xxxx. 0100 0000.0000 0000.0000 0000/10 ------> X.64.0.0/10
xxxx xxxx. 1000 0000.0000 0000.0000 0000/10 ------> X.128.0.0/10
xxxx xxxx. 1100 0000.0000 0000.0000 0000/10 ------> X.192.0.0/10
Note: The subnet zero and all-ones subnet are included in the effective number of subnets
as shown in the third column.
Time to work up
• Refer to the file Sample exercises.pdf to see
a few worked out examples of fixed mask
subnetting.
Variable Length Subnet Masks
(VLSM)
• In 1987, RFC 1009 specified that a subnetted network could use more than one subnet mask.
• When an IP network is assigned more than one subnet mask, it is considered a network with variable length subnet masks..
VLSM
• Benefits
– Efficient use of the organization’ s assigned
IP address space.
– Route aggregation.
Efficient Use of the Organization's
Assigned IP Address Space
VLSM supports more efficient use of an organization's assigned IP address space.
One of the major problems with the earlier limitation of supporting only a single
subnet mask across a given network-prefix was that once the mask was selected,
it locked the organization into a fixed-number of fixed-sized subnets.
For example, assume that
a network administrator decided
to configure the 130.5.0.0/16 network
with a /22 extended-network-prefix.
...the waste...A /22 extended-network prefix
permits 64 subnets (2^6 ),
each of which supports
a maximum of 1,022 hosts (2^10 -2).
This is fine if the organization wants to deploy a number of large subnets,
but what about the occasional small subnet containing only 20 or 30 hosts?
Since a subnetted network could have only a single mask, the network administrator
was still required to assign the 20 or 30 hosts to a subnet with a 22-bit prefix.
This assignment would waste approximately 1,000 IP host addresses
for each small subnet deployed!
…avoided.One solution to this problem was to allow
a subnetted network to be assigned more
than one subnet mask.
Assume that the network
administrator is also allowed to configure the 130.5.0.0/16 network
with a /26 extended-network-prefix.
A /16 network address with a /26 extended-network prefix permits 1024 subnets (2^10 ),
each of which supports a maximum of 62 hosts (2^6 -2).
The /26 prefix would be ideal for small subnets with less than 60 hosts, while
the /22 prefix is well suited for larger subnets containing up to 1000 hosts.
VLSM. Route aggregation
• VLSM allows the recursive division of
an organization´s address space.
• It can be aggregated to reduce the
amount of routing information at the top
level.
Route AggregationVLSM also allows the recursive division of an organization's address space so that
it can be reassembled and aggregated to reduce the amount of routing information
at the top level. This allows the detailed structure of routing information
for one subnet group to be hidden from routers in another subnet group.
The 11.0.0.0/8 network is first configured with a /16 extended-network-prefix.
The 11.1.0.0/16 subnet is then configured with a /24 extended-network-prefix and
the 11.253.0.0/16 subnet is configured with a /19 extended-network-prefix.
Conceptually, a network
is first divided into subnets,
some of the subnets
are further divided
into sub-subnets,
and so on.
Reducing Routing Table Size
Notice how Router D
is able to summarize the six subnets behind it into a single advertisement (11.1.253.0/24)
and how Router B
is able to aggregate all of subnets behind it into a single advertisement.
Likewise, Router C
is able to summarize the six subnets behind it into a single advertisement (11.253.0.0/16).
Finally, since the subnet structure is not visible outside of the organization,
Router A injects a single route into the global Internet's routing table -11.0.0.0/ 8 (or 11/8).
A planned and thoughtful
allocation of VLSM
can reduce the size
of an organization's
routing tables.
VLSM operation
• Conceptually, a network is divided into
subnets, some of the subnets are further
divided into sub-subnets, and some of the
sub-subnets are divided into sub2-subnets.
11.0.0.0/8
11.1.0.0/16
11.252.0.0/16
11.3.0.0/16
11.2.0.0/16
11.253.0.0/16
11.254.0.0/16
11.253.32.0/19
11.253.64.0/19
11.253.160.0/19
11.253.192.0/19
11.1.1.0/24
11.1.2.0/24
11.1.253.0/24
11.1.254.0/24
11.1.253.32/27
11.1.253.64/27
11.1.253.160/27
11.1.253.192/27
VLSM permits the
recursive division of a
netrwork prefix
VLSM operation
• The recursive process does not require
the same extended-network-prefix be
assigned at each level of recursion.
• The recursive subdivision can be carried
out as far as the network administrator
needs to take it.
VLSM Design Considerations
At each level of the hierarchy:
• 1) How many total subnets does this level need today?
• 2) How many total subnets does this level need in the future?
• 3) How many hosts are there on this level´s largest subnet today?
• 4) How many hosts will there be on this level´s largest subnet in the future?
VLSM Design Considerations (example)
• Assume a network is spread out over a number
of sites.
• An organization has 3 campuses today.
• It will need 3 bits of subnetting to allow
growth (8 subnets).
• Within each campus a second level of
subnetting will identify a building.
• Within each building a third level of
subnetting will identify an individual
workgroup.
VLSM Design Considerations (example)
• From this hierarchical model, the top level
is determined by the number of campuses.
• The mid-level by the number of buildings
at each site.
• The lowest level by the number of
workgroups.
VLSM Design Considerations (example)
• The deployment of a hierarchical subnetting
scheme requires careful planning.
• At the bottom level, the designer must be sure
that the leaf subnets are large enough to support
the required number of hosts.
• The addresses from each site will be aggregable
into a single address block that keeps the
backbone routing tables from becoming too
large.
Requierments for VLSM Deployment
• Three prerequisites:
– The routing protocols must carry extended-network-prefix information with each routing update.
– All routers must implement a consistent forwarding algorithm based on the longest match.
– For route aggregation to occur, addresses must be assigned so that they have topological significance.
Requierments for VLSM Deployment
Routing protocols
• OSPF, IS-IS, RIP-2, EIGRP allow the
deployment of VLSM by providing the
extended-network-prefix length or mask
value along with each route
advertisement.
• This permits each subnetwork to be
advertised with its corresponding prefix
length or mask.
Requirements for VLSM Deployment
Forwarding algorithm based on longest match
• A route with a longer e-n-p describes a smaller set
of destinations than the same route with a shorter
e-n-p.
• Then, a route with a longer e-n-p is said to be
“more specific”.
• A route with a shorter e-n-p is said to be “less
specific”.
• Routers must use the route with the longest
matching e-n-p (most specific matching route)
when forwarding traffic.
Requierments for VLSM Deployment
Example
• If a packet destination IP address is 11.1.2.5
and there are 3 network prefixes in the
routing table (11.1.2.0/24, 11.1.0.0/16, and
11.0.0.0/8), the router would select the route
to 11.1.2.0/24 because it has the longest
match with the destination IP address.
Requirements for the Deployment of VLSM
The successful deployment of VLSM has three prerequisites:
•The routing protocols must carry extended-network-prefix
information with each route advertisement.
•All routers must implement a consistent forwarding algorithm
based on the "longest match."
•For route aggregation to occur, addresses must be assigned
so that they have topological significance.
Requierments for VLSM Deployment
Topological significant address assignment
• Hierarchical routing requires that addresses be assigned to reflect the actual network topology.
• Routing information is reduced by taking the set of addresses assigned to a particular region of the topology, and aggregating them into a single routing update for the entire set.
• This can be done recursively at various points within the hierarchy of the routing topology.
Requierments for VLSM Deployment
Topological significant address assignment
• If addresses do not have a topological
significance, aggregation cannot be
performed and the size of routing tables
would not be reduced.
Time to work up
• Refer to the files
Sample exercises.pdf
VLSM_01.pdf
VLSM_02.pdf
• to se a few worked out examples of
Variable Lenght Subnet Masking.
Supernetting: Classless
Inter-Domain Routing (CIDR)CIDR was officially documented in September 1993
in RFC 1517, 1518, 1519, and 1520.
CIDR supports two important features that benefit the global Internet routing system:
- CIDR eliminates the traditional concept of Class A, Class B, and Class C
network addresses. This enables the efficient allocation of the IPv4 address space
which will allow the continued growth of the Internet until IPv6 is deployed.
- CIDR supports route aggregation where a single routing table entry
can represent the address space of perhaps thousands of traditional classful routes.
This allows a single routing table entry to specify how to route traffic to many
individual network addresses. Route aggregation helps control the amount
of routing information in the Internet's backbone routers, reduces route flapping
(rapid changes in route availability),
and eases the local administrative burden of updating external routing information.
CIDR and VLSM
CIDR and VLSM are essentially the same thing since they both allow a portion
of the IP address space to be recursively divided into subsequently smaller pieces.
The difference is that with VLSM, the recursion is performed on the address space
previously assigned to an organization and is invisible to the global Internet.
CIDR, on the other hand, permits the recursive allocation of an address block
by an Internet Registry to a high-level ISP, to a mid-level ISP, to a low-level ISP,
and finally to a private organization's network.
/20 Bitwise Contiguous Address Blocks
In a classless environment, prefixes are viewed as bitwise contiguous blocks of the
IP address space. For example, all prefixes with a /20 prefix represent the same
amount of address space (2 12 or 4,096 host addresses): a /20 prefix can be
assigned to a traditional Class A, Class B, or Class C network number.
See the following /20 blocks represent 4,096 host
addresses - 10.23.64.0/20, 130.5.0.0/20, and 200.7.128.0/20.
CIDR Address Blocks
This Table provides
information about
the most commonly
deployed CIDR
address blocks.
CIDR Reduces the Size of Internet
Routing Tables
Organization A Changes Network Providers
IP Version 6 (IPv6):
Expanded Addressing
IPv4 uses 32-bit addresses, which potentially can address up to 232 nodes.
However, the combination of network and local address hierarchy and
reserved address space for special handling such as loopback and broadcast
reduces the number of addressable nodes. At the same time, the exponential
growth of computer networks in recent years indicates the outgrowth of
addressable node using 32-bit addresses.
The IPv6 address size has been increased to 128 bits.
In addition to increased address size, IPv6 eliminated broadcast address
and added the notion of anycast address, which can be used to send
a packet to any one of a group of nodes.
References
• A good reference is the following (it
contains pointers to subnet calculators):– www.njedge.net/activities/nes/kvandev-ipnat-111401.ppt
•