From Subnetting
to VLSM
by
B Pavan Kumar
Agenda
Classful vs. Classless Routing
VLSM Explained
Why VLSM
Classful vs Classless Routing
Classful routing assigns address space based on the
value in the first octet of the 32-bit IP address
RFC Number 791 (760)
Class based on value in first octet value
Receiving router ands subnet mask to determine
subnet
Class A 0-126
Class B 128-191
Class C 192-223
Classless routing ignores classes and uses a CIDR value
(number of 1s in network mask) to identify the network
CIDR transmitted as part of IP address – RFC 1517-
1520
Network portion not restricted to entire octet
Classless Routing
Address Space Issues
Class A and Class B = 75% address space
< 17000 organizations can be assigned
address
Class C = 12.5% available address space
Each network limited to 254 maximum hosts
Potential routing problems
Too many network addresses in routing
table
Extra work for CPU; more memory
required
Private Addressing
RFC 1918
Class A [Link] to [Link]
Class B [Link] to [Link]
Class C [Link] to [Link]
Used to extend life of IPv4 addressing
Note: Do not mix private and public IP
address in same network – it will create
discontiguous subnets which causes
problems
Classless Routing
Another method used to extend the life of IPv4
Temporary solution to deal with lack of network
numbers
Uses bit mask (NOT 1st octet value) to determine
network portion of address
Uses CIDR to summarize routing information; CIDR
transmitted with IP address
Enables the use of supernets and/or route
aggregation and summarization
Smaller routing tables
Reduced router memory requirements
Reduced number of CPU cycles for routing
processes
Routing Protocols
Classful – can’t send subnet information in
updates
RipV1, IGRP, EGP, BGP3 – also can’t support
discontiguous subnets
Classless
Sends CIDR in updates sent via multicasting
Can authenticate
RipV2 (RFC 1058), EIGRP, OSPF, IS-IS, BGP4
RIPV2 and EIGRP automatically summarize at
classful boundary unless you configure differently
RouterA (config-router) no auto-summary
VLSM
Variable Length Subnet Masking
Subnets a subnet
Can support multiple contiguous
routes
Can use more than one subnet mask
for address space allocated to a firm
Makes more efficient use of available
address space
Creates two-host subnets for serial links
Why Not IPv6?
128-bit address space
Slow to arrive
IPv4 revitalized with new features
VLSM, NAT/PAT, IP unnumbered, private
addresses
Not supported by legacy systems
Requires new software (and
hardware)
Requires retraining
Zero Subnet (Ones too?)
Zero subnet
IOS 12.X and higher supports by default
Configure pre-12.x IOS routers
RouterA(config) IP subnet-zero
DO Use it to increase address space available
Ones subnet
Defined in RFC 1878
Can use it; however can cause problems
Avoid using unless you absolutely need it
Route Aggregation Example 1
Assume you are using three Class B private
addresses
[Link] 10101100.000100 00.0.0
[Link] 10101100.000100 01.0.0
[Link] 10101100.000100 10.0.0
Common bits are 10111000.0001
8 bits in first octet + 6 bits in second octet = 14
CIDR is 14
Insulates upstream routers from route
flapping problems (serial link problem)
Route Aggregation Example 2
Assume you are using three Class A
private addresses
[Link] 00001010.000101 00.0.0
[Link] 00001010.000101 01.0.0
[Link] 00001010.000101 10.0.0
Common bits are 00001010.000101
8 bits in first octet + 6 bits in second
octet = 14
CIDR is 14
Supernet Example 1
Company assigned 4 contiguous Class C networks
[Link]
11001000.00001010.00001010.0
[Link]
11001000.00001010.00001011.0
[Link]
11001000.00001010.00001100.0
[Link]
11001000.00001010.00001101.0
Summarize on common bits = 21
Appears in routing table as [Link]/21
Supernet Example 2
Company assigned 4 contiguous Class C networks
[Link]
11001000.00001010.11001001.0
[Link]
11001000.00001010.11001010.0
[Link]
11001000.00001010.11001011.0
[Link]
11001000.00001010.11001100.0
Summarize on common bits = 21
Appears in routing table as [Link]/21
Network Subnet Example
[Link]/16 is assigned IP address
130 subnets needed
Requires use of third octet for subnet
values
1,2,3,4, …., 254
Each subnet can support 254 hosts
Each serial connection will use a subnet
and waste 252 address spaces
Network Subnet Example
Assigned IP address is [Link]
Scenario - 130 subnets needed and 20
serial connections used now
Requires use of third octet for subnets
[Link] to [Link], subnet mask
[Link] or CIDR 24
Each subnet can support 254 hosts
To use an entire subnet for a serial
connection would waste 252 address
spaces and we have 20 now – SO…..
Network Subnet Example
Subnet the Subnet
Use subnets [Link] to [Link]
for needed subnets with a CIDR of 24
Subnet subnet [Link] using CIDR
30
[Link]/30
[Link]/30
[Link]/30
………………..
[Link]/30
Network 2 Subnet Example
A Network address of [Link] is assigned
Subnet with a CIDR of 26
[Link], [Link] (62 hosts)
Subnet subnet 128 with a CIDR of 28
[Link], [Link],
[Link] (14 hosts)
Subnet subnet [Link] with a CIDR of 30
[Link], [Link],
[Link] (2 hosts)
Can summarize (aggregate) on
[Link]/26
Using VLSM
Variable Length Subnet Masking – allows division
of address space based on the size of networks
Start with network requiring the most
addresses
Create a subnet mask (use CIDR – Classless
InterDomain Routing – number)
Subnet the subnet as needed to provide
address space required for other subnets
Be logical – start at beginning or end or
address space
Addresses must be contiguous to enable
route summarization