Chapter 2 IPv4 Subnetting & VLSM
Chapter 2 IPv4 Subnetting & VLSM
Chapter 2 IPv4 Subnetting & VLSM
2
IPv4 Address Overview
3
Internet Assigned Numbers Authority (IANA)
• IANA (http://www.iana.net) is the master holder of the IP addresses
• The IP multicast addresses and the IPv6 addresses are obtained
directly from IANA
• The IANA allocated remaining IPv4 address space to various other
registries to manage for particular purposes or for regional areas
• AfriNIC (African Network Information Centre)
• APNIC (Asia Pacific Network Information Centre)
• ARIN (American Registry for Internet Numbers)
• LACNIC (Regional Latin-American and Caribbean IP Address Registry)
• RIPE NCC (Reseaux IP Europeans)
4
Binary to Decimal Conversion Overview
5
Class A, B, and C IP Networks Review
• Size of Network and Host Parts of Class A, B, and C Addresses
6
The Actual Class A, B, and C IP Networks
7
Number of Networks
• Size of Network and Host Parts of Class A, B, and C Addresses
8
AND Operation
• Subnet Masks: used to distinguish the network ID portion of the IP
address from the host ID portion of the IP address
• To determine the network and subnet portion of an IP address it must
“AND” the IP address with the subnet mask
Default Subnet Masks Default Subnet Masks
Class A 255.0.0.0 0 AND 0 0
Class B 255.255.0.0 0 AND 1 0
Class C 255.255.255.0 1 AND 0 0
1 AND 1 1
9
AND Operation
• ANDING With Custom subnet masks
10
Class A IP Address Range Example
Network Address 10.0.0.0
Subnet Mask Default 255.0.0.0
First Valid Host 10.0.0.1
Last Valid Host 10.255.255.254
Broadcast Address 10.255.255.255
11
Class B IP Address Range Example
Network Address 172.16.0.0
Subnet Mask Default 255.255.0.0
First Valid Host 172.16.0.1
Last Valid Host 172.16.255.254
Broadcast Address 172.16.255.255
12
Class C IP Address Range Example
Network Address 192.168.0.0
Subnet Mask Default 255.255.255.0
First Valid Host 192.168.0.1
Last Valid Host 192.168.0.254
Broadcast Address 192.168.0.255
13
Classless Inter-Domain Routing (CIDR)
• Use to allocate a number of addresses to a company, a home or a
customer
• Example: Class B default mask would be 255.255.0.0, which is a /16
because 16 bits are ones (1s):
11111111.11111111.00000000.00000000
• The slash notation (/) means how many bits are turned on (1s)
14
CIDR Value
Subnet Mask CIDR Value Subnet Mask CIDR Value
255.0.0.0 /8 255.255.240.0 /20
255.128.0.0 /9
255.255.248.0 /21
255.192.0.0 /10
255.255.252.0 /22
255.224.0.0 /11
255.255.254.0 /23
255.240.0.0 /12
255.248.0.0 /13 255.255.255.0 /24
255.252.0.0 /14 255.255.255.128 /25
255.254.0.0 /15 255.255.255.192 /26
255.255.0.0 /16 255.255.255.224 /27
255.255.128.0 /17 255.255.255.240 /28
255.255.192.0 /18 255.255.255.248 /29
255.255.224.0 /19 255.255.255.252 /30
15
IPv4 Subnetting Basic
16
How to Create Subnets
• Determine the number of required network IDs:
• One for each subnet (LAN)
• One for each wide area network connection
• Determine the number of required host IDs per subnet:
• One for each TCP/IP host
• One for each router interface
• Based on the above requirements, create the following:
• One subnet mask for your entire network
• A unique subnet ID for each physical segment
• A range of host IDs for each subnet
17
Rules for Grouping IP Addresses
• All IP addresses in the same group must not be separated from each
other by a router
• IP addresses separated from each other by a router must be in different
groups
18
IPv4 Subnet Implementation
19
Subnetting Class C Addresses
• In a Class C address, only 8 bits are available for defining the hosts
• Remember that subnet bits start at the left and go to the right, without skipping bits
• We can’t use a /31 or /32 because we have to have at least 2 host bits for assigning
IP addresses to hosts
Binary Decimal CIDR
11111111.11111111.11111111.00000000 255.255.255.0 /24
11111111.11111111.11111111.10000000 255.255.255.128 /25
11111111.11111111.11111111.11000000 255.255.255.192 /26
11111111.11111111.11111111.11100000 255.255.255.224 /27
11111111.11111111.11111111.11110000 255.255.255.240 /28
11111111.11111111.11111111.11111000 255.255.255.248 /29
11111111.11111111.11111111.11111100 255.255.255.252 /30
20
Subnetting Class C Example 1#
21
Subnetting Class C Example 1#
• 2n, where n = the number of bits borrowed
• 21 = 2 subnets
• For each subnet, examine the last octet of the subnet address in binary
• Subnet 1: 00000000 = 0
• Subnet 2: 10000000 = 128
• To calculate the number of hosts per network, you use the formula of 2n – 2, where n =
the number of bits left for hosts
• 27 – 2 = 126
22
Subnetting Class C Example 1#
• Implementing a Class C /25 logical network
23
Subnetting Class C Example 2#
24
Subnetting Class C Example 2#
• Calculate the number of subnets with this formula:
• 22 = 4 subnets
• To calculate the number of hosts, begin by examining the last octet. Notice these subnets:
• Subnet 1: 0 = 00000000
• Subnet 2: 64 = 01000000
• Subnet 3: 128 = 10000000
• Subnet 4: 192 = 11000000
• Apply the host calculation formula:
• 26 – 2 = 62 hosts per subnet
25
Subnetting Class C Example 2#
• Implementing a Class C /26 logical network
26
Subnetting Class C Example 3#
27
Subnetting Class C Example 3#
• To accommodate six networks, subnet 192.168.1.0 /24 into address blocks using this formula:
• 23 = 8
• To get at least six subnets, borrow 3 host bits. A subnet mask of 255.255.255.224 provides the 3 additional
network bits.
• To calculate the number of hosts, begin by examining the last octet. Notice these subnets:
• 0 = 00000000
• 32 = 00100000
• 64 = 01000000
• 96 = 01100000
• 128 = 10000000
• 160 = 10100000
• 192 = 11000000
• 224 = 11100000
• Apply the host calculation formula:
• 25 – 2 = 30 hosts per subnet
28
Fast Way Subnetting
31
Subnetting Class B Example
• Example Network address: 172.16.0.0
• Example Subnet mask: 255.255.128.0 (/17)
• How many subnets?
• 21 = 2
• How many hosts per subnet?
• 215 – 2 = 32,766
• Valid subnets?
• 256 – 128 = 128. 0, 128
• Remember that subnetting is performed in the third octet, so the subnet numbers are really
Subnet 172.16.0.0 172.16.128.0
0.0 and 128.0
First host 172.16.0.1 172.16.128.1
Last host 172.16.127.254 172.255.254
Broadcast 172.16.127.255 172.16.255.255
32
Subnetting Class A Addresses
• We can use up to 22 bits for subnetting
Decimal CIDR Decimal CIDR Decimal CIDR
255.128.0.0 /9 255.255.128.0 /17 255.255.255.0 /24
255.192.0.0 /10 255.255.192.0 /18 255.255.255.128 /25
255.224.0.0 /11 255.255.224.0 /19 255.255.255.192 /26
255.240.0.0 /12 255.255.240.0 /20 255.255.255.224 /27
255.248.0.0 /13 255.255.248.0 /21 255.255.255.240 /28
255.252.0.0 /14 255.255.252.0 /22 255.255.255.248 /29
255.254.0.0 /15 255.255.254.0 /23 255.255.255.252 /30
33
Subnetting Class A Example
34
Variable-Length Subnet Masks (VLSM)
35
Variable Length Subnet Masks (VLSMs)
• VLSM occurs when an internetwork uses more than one mask for
different subnets of a single Class A, B, or C network
• VLSM provides many benefits for real networks, mainly related to
how you allocate and use your IP address space
• To support VLSM, the routing protocol must advertise the mask along
with each subnet
• classless routing protocols advertise the mask with each advertised route, and
classful routing protocols do not
36
Variable Length Subnet Masks (VLSMs)
• Classless and Classful Interior IP Routing Protocols
37
Typical Classful Network
38
Classless Network Design
39
VLSM Network Example 1
• Example Default Network: 192.168.10.0/24
40
Quiz 1#
41
Quiz 2#
42
Quiz 3#
• Find the valid IP Address hostA?
43
Quiz 4#
• Find the valid IP Address hostA and hostB?
44
Route Summarization
45
Route Summarization
46
Route Summarization Example 1#
47
Route Summarization Example 2#
48