IPv4 Addressing Subnetting
IPv4 Addressing Subnetting
Subnetting
www.ine.com
Didn’t we already cover this?
Copyright © www.ine.com
Agenda
» A Brief History of IPv4
» Communications within a Broadcast Domain
» Identifying classes and types of IPv4 Addresses
» IPv4 Governing Bodies
» Private vs Public Addresses
» IPv4 Subnet Masks
» Same-Length Subnetting
» VLSM
» IPv4 Address Summarization
» Supernetting
Copyright © www.ine.com
The Early Internet
» L3 Addressing was developed prior to L2 Addressing
» Early Internet History (1972):
• There were no such things as LANs (Ethernet was in development at Xerox)
• All communications were point-to-point using a variety of methods
Circuit Switching
Satellite Uplinks
Direct Cable connections
• There was a need to develop a protocol so that hosts on these disparate
networks (and networks yet to be invented) could communicate with each
other.
• Very few networks existed.
Copyright © www.ine.com
Separate and Unique Networks
NCP Address: XX NCP Address: YY
Telephone Lines
Mainframe IMP IMP Mainframe
Circuit always up, no need to “dial”
NCP Address: ZZ
IMP Mainframe
Telephone Lines
Mainframe Modem Modem Mainframe
Traditional “dial” circuit
Copyright © www.ine.com
The Birth of TCP/ IP
Network# 4
Copyright © www.ine.com
00000100 xxxxxxxx xxxxxxxx xxxxxxxx
Addressing and Broadcast Domains
» With the popularity of Ethernet and Token Ring in late
1970s, the concept of multiple hosts all sharing a common
gateway (a single Broadcast domain) was born.
IP Address: 00000010 xxxxxxxx xxxxxxxx xxxxxxxx
Telephone Lines Hub
Router Router
Circuit always up, no need to “dial”
NCP Address: ZZ
IP Address: 00000001 xxxxxxxx xxxxxxxx xxxxxxxx Mainframe Mainframe
Hub
Router
Mainframe Mainframe Mainframe IP Address: 00000011 xxxxxxxx xxxxxxxx xxxxxxxx
Mainframe
We all need addresses
starting with 00000001
Copyright © www.ine.com
Communications within Broadcast Domains
» Communications within a Broadcast Domain
• Broadcast (needs no address)
• Unicast (requires an address: MAC)
• Multicast (requires an address: MAC with special format)
» Networked Software Applications fall into two categories:
• Those that assume the destination is in same broadcast domain as the
source (example= ARP).
• Those capable of intra, or inter-broadcast domain communications.
Copyright © www.ine.com
So an IP Address = Broadcast Domain Address?
» Not quite…IP is used to address “networks”, be they
broadcast-based or Point-to-Point, or anything else.
» IP address = 2-parts
• Network/ Broadcast Domain Address
• Unique Host address within that broadcast domain.
» In this way, when sending to a remote host, we don’t need to
know their L2 address.
• Packet is addressed to remote host’s IP address
• Frame is addressed to gateway’s L2 address
Copyright © www.ine.com
Host-ID and Broadcast Domains
LAN-1: 00000001 xxxxxxxx xxxxxxxx xxxxxxxx
00000001 00000000 00000000 00000001 00000001 00000000 00000000 00000010 00000001 00000000 00000000 00000011
00000010 00000000 00000000 00000001 00000010 00000000 00000000 00000010 00000010 00000000 00000000 00000011
Copyright © www.ine.com
What do these addresses look like?
MAC Address = 48-bits long
000000101110101001101011000100101010010111111111
Bits 305-336
= Dest IP Address
So where are these addresses in all of this?
101011010101101010110101010101011010101010101011111111111110101010100000000000001010111010101101010101001000000000011
8-bytes (64-bits) of Bits 65-112 Bits 113-160 12-bytes (96-bits) of
“Ethernet stuff” = Destination MAC = Source MAC “IP stuff”
Bits 273-304
= Source IP Address
2-bytes (16-bits) of
Copyright © www.ine.com “Ethernet stuff”
IPv4 Addressing – a review of what we’ve learned
Copyright © www.ine.com
IP Bit Patterns
» Multicast
• One-to-many communication
• 1110xxxx. xxxxxxxx. xxxxxxxx. xxxxxxxx
» Broadcast
• One-to-all communication
• Host portion of address all ones…or entire address all ones.
• Any.11111111.11111111.11111111
• 11111111. 11111111. 11111111. 11111111
» Unicast
• One-to-one communication
• All other patterns that do NOT start with 00000000
Copyright © www.ine.com
Classes of IPv4
» 1981 - Classes of Addresses Introduced:
• Class A: 0.0.0.0 through 127.255.255.255
• Class B: 128.0.0.0 through 191.255.255.255
• Class C: 192.0.0.0 through 223.255.255.255
• Class D: 224.0.0.0 through 239.255.255.255
• Class E: 240.0.0.0 through 255.255.255.255
• Note: 127 ranges are considered as loopbacks
• Note: 169.254 ranges are considered as APIPA
Copyright © www.ine.com
Quiz-1
» Identify which of the IP addresses below
belong to a Class-B network?
A 01010111 00101011 11111111 01010000
B 11010111 00101011 11111111 01010000
C 10010111 00101011 11111111 01010000
D 191.7.145.3
E 126.57.135.2
F 194.7.145.3
Copyright © www.ine.com
Answer-1
» Identify which of the IP addresses below
belong to a Class-B network?
A 01010111 00101011 11111111 01010000
B 11010111 00101011 11111111 01010000
C 10010111 00101011 11111111 01010000
D 191.7.145.3
E 126.57.135.2
F 194.7.145.3
Copyright © www.ine.com
Quiz-2
» Identify which of the IP addresses below
belong to a Class-C network?
A 10010111 00101011 11111111 01010000
B 11010111 00101011 11111111 01010000
C 01010111 00101011 11111111 01010000
D 136.7.145.3
E 223.57.135.2
F 101.7.145.3
Copyright © www.ine.com
Answer-2
» Identify which of the IP addresses below
belong to a Class-C network?
A 10010111 00101011 11111111 01010000
B 11010111 00101011 11111111 01010000
C 01010111 00101011 11111111 01010000
D 136.7.145.3
E 223.57.135.2
F 101.7.145.3
Copyright © www.ine.com
The need for governing bodies
» As new networks were created and connected to
the Internet, there was a need for someone to
govern the allocation of IP addresses.
I own 2.0.0.0 /8
B
Packet destined to 2.2.2.2
A
I own 2.0.0.0 /8
Who should I C
send this to???
Copyright © www.ine.com
IANA and RIRs
» Current IPv4 Addressing Allocation Structure
IANA
ISP
Also called, “RIRs”
End Users End Users
http://www.iana.org/assignments/ipv4-address-space/ipv4-address-space.xhtml
Copyright © www.ine.com
IPv4 Addresses: Public & Private
» IP addresses “leased” to a corporation (by an ISP or
an RIR) are known as public IP addresses.
Copyright © www.ine.com
IPv4 Addresses: Private
» Private IPv4 address:
• Defined in RFC 1918
• For internal use only
» Range of private address
• Class A : 10.0.0.0 through 10.255.255.255
• Class B : 172.16.0.0 through 172.31.255.255
• Class C : 192.168.0.0 through 192.168.255.255
Copyright © www.ine.com
IPv4 Addresses: Public
» Public IPv4 addresses
• Globally unique
• Should be purchased
• Usually used in Internet edge
• Taken from Class-A, Class-B, and Class-C addressing space.
» Range of public addresses
• Beyond the RFC 1918 space, all addresses are public
Copyright © www.ine.com
1985: Introduction of Subnets
» Soon became apparent that assigning multiple Classfull networks to each
company would result in network depletion.
» A single Classfull network was assigned to each company with the
expectation of subnetting.
Copyright © www.ine.com
How do computers use Subnet Masks? (4)
Systems with Classfull Addresses (with subnet masks)
If I need to send a packet to everyone within my
The full 32-bit number of broadcast domain I’ll send it to
my Broadcast Domain is 10000001 00000001 00000001 11111111
129.1.0.0 (129.1.1.255)
Copyright © www.ine.com
Subnet Mask
» Helps identify network and host portion of
network
» Three representations:
• Binary 11111111 11111111 00000000 00000000
• Dotted Decimal: 255.255.0.0
• Backslash (shorthand): / 16
» Systems that utilize a subnet mask RELY on it
to identify their local network.
Copyright © www.ine.com
Quiz-3
» Given the following subnet mask (in binary) what is the
equivalent representation in dotted-decimal and shorthand?
Subnet Mask = 11111111 11111111 11110000 00000000
A 255.255.0.0
B 255.255.255.0
C 255.255.192.0
D 255.255.240.0
E /16
F /18
G /20
Copyright © www.ine.com H /24
Answer-3
» Given the following subnet mask (in binary) what is the
equivalent representation in dotted-decimal and shorthand?
Subnet Mask = 11111111 11111111 11110000 00000000
A 255.255.0.0
B 255.255.255.0
C 255.255.192.0
D 255.255.240.0
E /16
F /18
G /20
Copyright © www.ine.com H /24
Quiz-4
» If the following subnet mask were to be applied to a PC’s
NIC, how many bits of the IP address would be interpretted
as “networking bits”?
Subnet Mask = 255.255.255.248
A 16-bits
B 20-bits
C 24-bits
D 27-bits
D 29-bits
Copyright © www.ine.com
Answer-4
» If the following subnet mask were to be applied to a PC’s
NIC, how many bits of the IP address would be interpretted
as “networking bits”?
Subnet Mask = 255.255.255.248
A 16-bits
B 20-bits
C 24-bits
D 27-bits
D 29-bits
Copyright © www.ine.com
Quiz-5
» What subnet mask would be appropriate (in dotted-
decimal) to indicate to a host that the first 26-bits of its IP
address should be considered as the network?
A 255.254.0.0
B 255.255.255.192
C 255.255.255.0
D 255.255.0.0
D 255.255.255.224
Copyright © www.ine.com
Answer-5
» What subnet mask would be appropriate (in dotted-
decimal) to indicate to a host that the first 26-bits of its IP
address should be considered as the network?
A 255.254.0.0
B 255.255.255.192
C 255.255.255.0
D 255.255.0.0
D 255.255.255.224
Copyright © www.ine.com
Quiz-6
» Given the following IP address and Subnet Mask identify
the subnetwork address of this host.
IP Address = 137.54.101.77
Subnet Mask = 255.255.224.0
A 137.54.96.0
B 137.54.0.0
C 137.54.101.64
D 137.54.224.0
Copyright © www.ine.com
Answer-6
» Given the following IP address and Subnet Mask identify
the subnetwork address of this host.
IP Address = 137.54.101.77
Subnet Mask = 255.255.224.0
A 137.54.96.0
B 137.54.0.0
C 137.54.101.64
D 137.54.224.0
Copyright © www.ine.com
Quiz-7
» Given the following IP address and Subnet Mask (in binary)
identify which of the answers below provide for the
broadcast address of this network.
IP Address = 01000011 00000011 01100000 00001101
Subnet Mask = 11111111 11111111 00000000 00000000
A 67.3.96.255
B 67.3.96.0
C 67.3.255.255
D 67.255.255.255
Copyright © www.ine.com
Answer-7
» Given the following IP address and Subnet Mask (in binary)
identify which of the answers below provide for the
broadcast address of this network.
IP Address = 01000011 00000011 01100000 00001101
Subnet Mask = 11111111 11111111 00000000 00000000
A 67.3.96.255
B 67.3.96.0
C 67.3.255.255
D 67.255.255.255
Copyright © www.ine.com
Quiz-8
» Given the following IP address and Subnet Mask identify
which of the answers below provide for the broadcast
address of this network.
IP Address = 130.54.6.99
Subnet Mask = 255.255.255.0
A 130.255.255.255
B 130.54.255.255
C 130.54.6.255
D 130.0.0.0
Copyright © www.ine.com
Answer-8
» Given the following IP address and Subnet Mask identify
which of the answers below provide for the broadcast
address of this network.
IP Address = 130.54.6.99
Subnet Mask = 255.255.255.0
A 130.255.255.255
B 130.54.255.255
C 130.54.6.255
D 130.0.0.0
Copyright © www.ine.com
Quiz-9
» Given the following IP address and Subnet Mask (in binary)
identify which of the answers below provide for the
broadcast address of this network.
IP Address = 01000011 00000011 01100000 00001101
Subnet Mask = 11111111 11111111 11110000 00000000
A 67.3.96.255
B 67.3.111.255
C 67.3.0.255
D 67.255.255.255
Copyright © www.ine.com
Answer-9
» Given the following IP address and Subnet Mask (in binary)
identify which of the answers below provide for the
broadcast address of this network.
IP Address = 01000011 00000011 01100000 00001101
Subnet Mask = 11111111 11111111 11110000 00000000
A 67.3.96.255
B 67.3.111.255
C 67.3.0.255
D 67.255.255.255
Copyright © www.ine.com
Quiz-10
» Given the following IP address and Subnet Mask identify
which of the answers below provide for the broadcast
address of this network.
IP Address = 77.42.200.101
Subnet Mask = 255.255.224.0
A 77.0.0.0
B 77.255.255.255
C 77.42.255.255
D 77.42.192.255
E 77.42.223.255
Copyright © www.ine.com
Answer-10
» Given the following IP address and Subnet Mask identify
which of the answers below provide for the broadcast
address of this network.
IP Address = 77.42.200.101
Subnet Mask = 255.255.224.0
A 77.0.0.0
B 77.255.255.255
C 77.42.255.255
D 77.42.192.255
E 77.42.223.255
Copyright © www.ine.com
Subnet Masks and Byte Boundaries (1)
» Remember that while we (as humans) represent IP
addresses as dotted decimal, computers see it
simply as a long string of 32-bits.
» A subnet mask is another string of 32-bits that is
used as a comparison tool against the IP address.
» The subnet mask can divide the IP address
anywhere…it doesn’t have to fall on an even byte
boundary.
Copyright © www.ine.com
Subnet Masks and Byte Boundaries (2)
LAN: 00000001 00000011 hhhhhhhh hhhhhhhh /16
Example-1
00000001 00000011 00000000 00000001 00000001 00000011 00000000 00000010 00000001 00000011 00000000 00000011
00000001 00000011 11000000 00000001 00000001 00000011 11000000 00000010 00000001 00000011 11000000 00000011
00000001 00000011 11000000 01110001 00000001 00000011 11000000 01110010 00000001 00000011 11000000 01110011
Copyright © www.ine.com
So why subnet?
» Each IP network that is purchased is only good
for a single broadcast domain (VLAN).
» Often unused/ unallocated host space within a
given network.
» Subnetting = Dividing a single, allocated network
into multiple sub-networks.
» Minor loss of available hosts addresses.
Copyright © www.ine.com
Subnetting Practicality
» Imagine if each network you “lease” from your ISP costs
you $100.00/ month.
» The building below requires four, distinct broadcast
domains (i.e. Networks)
Copyright © www.ine.com
Answer - 11
» You are leased the following network from
your ISP: 45.0.0.0 / 8
» If you convert the first three host bits into
subnetting bits…how many total subnets will
you have available?
2SN = Quantity of available subnets
23 = 8
Copyright © www.ine.com
Quiz - 12
» You are leased the following network from
your ISP: 160.160.0.0 / 16
» If you convert the first six host bits into
subnetting bits…how many total subnets will
you have available?
Copyright © www.ine.com
Answer - 12
» You are leased the following network from
your ISP: 160.160.0.0 / 16
» If you convert the first six host bits into
subnetting bits…how many total subnets will
you have available?
2SN = Quantity of available subnets
26 = 64
Copyright © www.ine.com
Quiz - 13
» You are leased the following network from
your ISP: 45.0.0.0 / 8
» If you convert the first three host bits into
subnetting bits…what will be the subnet
address of the fourth subnet?
Copyright © www.ine.com
Answer - 13
» You are leased the following network from your
ISP: 45.0.0.0 / 8
» If you convert the first three host bits into
subnetting bits…what will be the subnet address of
the fourth subnet? 45.__ __ __ xxxxx.xxxxxxxx.xxxxxxxx /11
45.000xxxxx.xxxxxxxx.xxxxxxxx /11
45.01100000.00000000.00000000 45.001xxxxx.xxxxxxxx.xxxxxxxx /11
45.010xxxxx.xxxxxxxx.xxxxxxxx /11
45.011xxxxx.xxxxxxxx.xxxxxxxx /11
45.96.0.0 /11
Copyright © www.ine.com
Quiz - 14
» You are leased the following network from your ISP:
199.0.0.0 / 24
» From this single network you need to create 7-subnets.
» What will be your new subnet mask?
A 255.255.255.240
B 255.255.255.252
C 255.255.255.224
D 255.255.255.192
Copyright © www.ine.com
Answer - 14
» You are leased the following network from your ISP:
199.0.0.0 / 24
» From this single network you need to create 7-subnets.
» What will be your new subnet mask?
A 255.255.255.240
B 255.255.255.252
C 255.255.255.224
D 255.255.255.192
Copyright © www.ine.com
Quiz - 15
» You are leased the following network from your ISP:
145.10.0.0 / 19
» From this single network you need to create 58-subnets.
» What will be your new subnet mask?
A 255.255.255.128
B 255.255.248.0
C 255.255.252.0
D 255.255.255.192
Copyright © www.ine.com
Answer - 15
» You are leased the following network from your ISP:
145.10.0.0 / 19
» From this single network you need to create 58-subnets.
» What will be your new subnet mask?
A 255.255.255.128
B 255.255.248.0
C 255.255.252.0
D 255.255.255.192
Copyright © www.ine.com
Another Formula to Remember!!
Copyright © www.ine.com
Quiz-16
» Given the following subnet mask, how many
hosts can “fit” in this subnet?
255.255.255.192
A 60-hosts
B 62-hosts
C 64-hosts
D 128-hosts
E 126-hosts
Copyright © www.ine.com
Answer-16
» Given the following subnet mask, how many
hosts can “fit” in this subnet?
255.255.255.192
A 60-hosts
B 62-hosts
C 64-hosts
D 128-hosts
E 126-hosts
Copyright © www.ine.com
Quiz-17
» An ISP leases you the following network:
140.10.0.0 / 23
You need to create 22-subnetworks from this single network.
What will be your new Subnet Mask…and how many hosts will
be supported in each subnet? A 255.255.255.240
B 255.255.255.0
C 255.255.255.192
D 6-hosts
E 14-hosts
Copyright © www.ine.com
F 30-hosts
Answer-17
» An ISP leases you the following network:
140.10.0.0 / 23
You need to create 22-subnetworks from this single network.
What will be your new Subnet Mask…and how many hosts will
be supported in each subnet? A 255.255.255.240
B 255.255.255.0
C 255.255.255.192
D 6-hosts
E 14-hosts
Copyright © www.ine.com
F 30-hosts
Quiz-18
» An ISP leases you the following network:
199.10.1.0 / 24
You need to create 22-subnetworks from this single network.
Copyright © www.ine.com
Answer-18
» An ISP leases you the following network:
199.10.1.0 / 24
You need to create 22-subnetworks from this single network.
Copyright © www.ine.com
Quiz-19
» An ISP leases you the following network:
139.10.8.0 / 21
You need to create 59-subnetworks from this single network.
Copyright © www.ine.com
Answer-19
» An ISP leases you the following network:
139.10.8.0 / 21
You need to create 59-subnetworks from this single network.
Copyright © www.ine.com
Same Length Subnetting – The Problem
Starting network is 199.199.199.0 /24
You need four sub-networks. 2x ≥ 4 therefore “x” = 2 (subnetting bits)
199.199.199.0 /26 (/24 + 2-subnet bits = /26)
Host Bits available: x.x.x.0 through x.x.x.255
.255 .0
Network#1
5-hosts
Network#4 Network#1
Network#2
80-hosts .192 .63
.191 One (1) Network .64
12-hosts Network#4
Copyright © www.ine.com .128 .127
The Solution - VLSM
Starting network is 199.199.199.0 /24
Create each subnet based on quantity of hosts required…NOT quantity of networks required.
Copyright © www.ine.com
VLSM & CIDR
» CIDR
• Classless Interdomain Routing
• Beyond the classful behavior
• Class A address can be treated as Class B & C or vice
versa
• Ex: 199.50.0.0/ 16 [/ 16 is prefix-length from Class B]
Copyright © www.ine.com
Quiz-20
» Starting with the base network of 100.100.100.0/ 24, use VLSM to
divide this single network into multiple subnetworks appropriate to fit
the requirements shown below.
Copyright © www.ine.com
Answer-20
» Starting with the base network of 100.100.100.0/ 24, use VLSM to
divide this single network into multiple subnetworks appropriate to fit
the requirements shown below.
Network-3 (marketing): 100-hosts /25 (supports up to 126-hosts)
100.100.100.0 /25 (next available network = 100.100.100.128)
Copyright © www.ine.com
Answer-21
» Starting with the base network of 140.140.0.0/ 22, use VLSM to divide
this single network into multiple subnetworks appropriate to fit the
requirements shown below.
Network-4 (human resources): 220-hosts /24 (supports up to 254-hosts)
140.140.0.0 /24 (next available network = 140.140.1.0)
Copyright © www.ine.com
IPv4 Summarization
Copyright © www.ine.com
IPv4 Summarization - Example
» Example
• Network : 10.10.32.0 / 20
• Network: 10.10.48.0 / 20
• Subnet mask: 255.255.240.0
» Conversion of network-id into bits
• 10.10.0010hhhh.hhhhhhhh / 20
“h” = Host Bit
• 10.10.0011hhhh.hhhhhhhh / 20
• AND operation result : 10.10.001hhhhh.hhhhhhhh
Copyright © www.ine.com
10.10.32.0 / 19 (summarized network)
Quiz-22
» What single, summarized route can be created
by summarizing the following subnets?
135.75.42.100 /30
135.75.42.108 /29
135.75.42.112 /28
Copyright © www.ine.com
Answer-22
» What single, summarized route can be created
by summarizing the following subnets?
135.75.42.100 /30
135.75.42.0110xxxx
Copyright © www.ine.com
IPv4 Summarization and Supernetting
Copyright © www.ine.com