Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 49

Chapter 2:

IPv4 Subnetting & VLSM


CISCO CERTIFIED NETWORK ASSOCIATE (CCNA)
Agenda
• IPv4 Address Overview
• IPv4 Subnetting Basic
• IPv4 Subnet Implementation
• Variable-Length Subnet Masks (VLSM)
• Route Summarization

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

Bits Binary Decimal


0 00000000 0
1 10000000 128
2 11000000 192
3 11100000 224
4 11110000 240
5 11111000 248
6 11111100 252
7 11111110 254
8 11111111 255

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

Network Address 00001010.00000000.00000000.00000000


Subnet Mask Default 11111111.00000000.00000000.00000000
First Valid Host 00001010.00000000.00000000.00000001
Last Valid Host 00001010.11111111.11111111.11111110
Broadcast Address 00001010.11111111.11111111.11111111

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

Network Address 10101100. 00010000.00000000.00000000


Subnet Mask Default 11111111.11111111.00000000.00000000
First Valid Host 00001010.00000000.00000000.00000001
Last Valid Host 10101100. 00010000.11111111.11111110
Broadcast Address 10101100. 00010000.11111111.11111111

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

Network Address 11000000. 10101000.00000000.00000000


Subnet Mask Default 11111111.11111111.11111111.00000000
First Valid Host 11000000. 10101000.00000000.00000001
Last Valid Host 11000000. 10101000.00000000.11111110
Broadcast Address 11000000. 10101000.00000000.11111111

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

• How many subnets?


• 2x = number of subnets. x is the number of masked bits, or the 1s.
• For example, in 11000000, the number of 1s gives us 22 subnets. In this example,
there are 4 subnets
• How many hosts per subnet?
• 2y – 2 = number of hosts per subnet. y is the number of unmasked bits, or the 0s.
• For example, in 11000000 the number of 0s gives us 26 – 2 hosts or 62 hosts per
subnet
• What are the valid subnets?
• 256 – subnet mask = block size
• example would be 256 – 192 = 64 or increment number
29
Fast Way Subnetting
• Case Study
• What is the subnet mask for this
networks? x
2 = number of subnets
2x = 8
2x = 2 3
x=3
y = 32 – 24 – 3 = 5
 255.255.255.224 or /27
• What are the valid subnets?
256 – 224 = 32 or increment number
 0, 32, 64, 96, 128, 160, 192, 224
First Net-ID: 192.168.10.0/27
Valid-Host: 192.168.1 – 30 /27
Broadcast-ID: 192.168.10.31/27
30
Subnetting Class B Addresses
• We can use up to 14 bits for subnetting

Decimal CIDR Decimal CIDR


255.255.128.0 /17 255.255.255.0 /24
255.255.192.0 /18 255.255.255.128 /25
255.255.224.0 /19 255.255.255.192 /26
255.255.240.0 /20 255.255.255.224 /27
255.255.248.0 /21 255.255.255.240 /28
255.255.252.0 /22 255.255.255.248 /29
255.255.254.0 /23 255.255.255.252 /30

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

• Example Network address: 10.0.0.0


• Example Subnet mask: 255.255.0.0 (/16)
• How many subnets?
• 28 = 256
• How many hosts per subnet?
• 216 – 2 = 65,534
• Valid subnets?
• 256 – 255 = 1.  0,
Subnet 1, 2, 3, 4, etc (all in the
10.0.0.0 second octet)
10.1.0.0 .…………………..
First host 10.0.0.1 10.1.0.1 ……………………
Last host 10.0.255.254 10.1.255.254 ……………………
Broadcast 10.0.255.255 10.1.255.255 ……………………

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

• Summarization, also called route aggregation, allows routing protocols to


advertise many networks as one address
• The purpose of this is to reduce the size of routing tables on routers to
save memory, which also shortens the amount of time for IP to parse the
routing table and find the path to a remote network.

46
Route Summarization Example 1#

• Sample “Best” Summary on Router R3


• Relist the subnet IDs (and prefix lengths) and calculate the subnet broadcast addresses
• Identify 10.3.4.0 as the lowest subnet ID and 10.3.7.255 as the highest subnet broadcast
address, defining the low and high end of the range that the summary must include
• With all four masks as /24, subtract 1 from 24, so the initial value of /P to try is /23

47
Route Summarization Example 2#

• Sample “Best” Summary on Router R2


• Relist the subnet IDs (and prefix lengths) and calculate the subnet broadcast addresses
• Identify 10.2.1.0 as the lowest subnet ID and 10.2.4.255 as the highest subnet broadcast
address, defining the low and high end of the range that the summary must include
• As with the previous example, with all four masks as /24, you choose an initial /P to use of
1 less, or /23

48

You might also like