Professional Documents
Culture Documents
Please support my site. Click on the Google-sponsored links found on the web
pages.
IPv4 Addressing Concepts
IPv4 Addresses
10
IPv4 Addresses
IPv4 Addresses are 32 bit addresses:
1010100111000111010001011000100
11
IPv4 Addresses
An IP address has two parts:
network number
host number
12
IPv4 Addresses
Answer:
Newer technology - Classless IP Addressing
The subnet mask determines the network portion and the host
portion.
Value of first octet does NOT matter (older classful IP addressing)
Hosts and Classless Inter-Domain Routing (CIDR).
Classless IP Addressing is what is used within the Internet and in
most internal networks.
13
Types of
Addresses
Network
Addresses have
all 0’s in the host
portion.
Broadcast
Addresses have
all 1’s in the host
portion.
Host Addresses
can not have all
0’s or all 1’s in the
host portion.
11111111111111110000000000000000
Subnet Mask
Used to define the:
Network portion
Host portion
32 bits
Contiguous set of 1’s followed by a contiguous set of 0’s
1’s: Network portion
0’s: Host portion
17
Dividing the Network and Host Portions
11111111.11111111.00000000.00000000
Expressed as:
Dotted decimal
Ex: 255.255.0.0
Slash notation or prefix length
/16 (the number of one bits)
18
Network
Addresses
19
Example 1
Network Address: 192.168.1.0
Subnet Mask: 255.255.255.0
192.168.1.0
Network Host
20
Example 2
Network Address: 172.0.0.0
Subnet Mask: 255.0.0.0
172.0.0.0
Network Host
21
Example 3
Network Address: 172.0.0.0
Subnet Mask: 255.255.0.0
172.0.0.0
Network Host
22
Subnet Masks – Your Turn!
Underline the network portion of each address:
Network Address Subnet Mask
172.0.0.0 255.0.0.0
172.16.0.0 255.255.0.0
192.168.1.0 255.255.255.0
192.168.0.0 255.255.0.0
192.168.0.0 255.255.255.0
10.1.1.0 /24
10.2.0.0 /16
10.0.0.0 /16
23
Subnet Masks – Your Turn!
Underline the network portion of each address:
Network Address Subnet Mask
172.0.0.0 255.0.0.0
172.16.0.0 255.255.0.0
192.168.1.0 255.255.255.0
192.168.0.0 255.255.0.0
192.168.0.0 255.255.255.0
10.1.1.0 /24
10.2.0.0 /16
10.0.0.0 /16
24
Why the mask matters: Number of hosts!
Subnet Mask: 1st octet 2nd octet 3rd octet 4th octet
255.0.0.0 or /8 Network Host Host Host
255.255.0.0 or /16 Network Network Host Host
255.255.255.0 or /24 Network Network Network Host
The more host bits in the subnet mask means the more hosts in the
network.
Subnet masks do not have to end on “natural octet boundaries”
25
IP Addresses
29
Broadcast
Addresses
30
Subnet Masks – Your Turn!
What is the broadcast address of each network:
Network Address Subnet Mask Broadcast Address
172.0.0.0 255.0.0.0
172.16.0.0 255.255.0.0
192.168.1.0 255.255.255.0
192.168.0.0 255.255.0.0
192.168.0.0 255.255.255.0
10.1.1.0 /24
10.2.0.0 /16
10.0.0.0 /16
31
Subnet Masks – Your Turn!
What is the broadcast address of each network:
Network Address Subnet Mask Broadcast Address
172.0.0.0 255.0.0.0 172.255.255.255
172.16.0.0 255.255.0.0 172.16.255.255
192.168.1.0 255.255.255.0 192.168.1.255
192.168.0.0 255.255.0.0 192.168.255.255
192.168.0.0 255.255.255.0 192.168.0.255
10.1.1.0 /24 10.1.1.255
10.2.0.0 /16 10.2.255.255
10.0.0.0 /16 10.0.255.255
32
Bringing it
all together
192.168.10.100/24
71
What is subnetting?
Network Network Host Host
172 16 0 0
72
Analogy
Before subnetting:
In any network (or subnet) we can not use
all the IP addresses for host addresses.
We lose two addresses for every network
98 Apples or subnet.
(100 – 2) 1. Network Address - One address is reserved
to that of the network. For Example:
172.16.0.0 /16
2. Broadcast Address – One address is
reserved to address all hosts in that
network or subnet. For Example:
172.16.255.255
This gives us a total of 65,534 usable hosts
73
Analogy 10 barrels x 10 apples = 100 apples
10 10 10
98 Apples
(100 – 2) 10
10 10
10 10 10
10
8 8 8
(less 2) (less 2) (less 2)
98 Apples 8
8 8
(100 – 2) (less 2) (less 2) (less 2)
8 8 8
(less 2) (less 2) (less 2)
75
2 = 1 network address + 1 broadcast address
8 X 8 8
(less 2) (less 2) (less 2)
98 Apples 8
8 8
(100 – 2) (less 2) (less 2) (less 2)
8 8 8
(less 2) (less 2) (less 2)
In legacy networks, we also lost:
The first basket (subnet)
The network address of the first subnet is the
network address of the entire network
X 8
(less 2)
The last basket (subnet)
The broadcast address for the last subnet is the
same as for the entire network.
76
Subnet Example
Network address 172.16.0.0 with /16 Base Network Mask
Using Subnets: Subnet Mask 255.255.255.0 or /24
Subnet addresses: All 0’s in host portion
172 16 0 0 Subnets
Addresses
172 16 1 0
172 16 2 0 256
172 16 3 0 Subnets
28
172 16 Etc. 0
172 16 254 0
172 16 255 0
77
Subnet Example
Network address 172.16.0.0 with /16 Base Network Mask
Using Subnets: Subnet Mask 255.255.255.0 or /24
65,534 host addresses, one for network address and one for
broadcast address.
79
Host IP Address: 172.16.3.50
With subnetting: A host of the 172.16.3.0 /24 network
80
With subnetting:
Network First Host Last Host Broadcast Hosts
172.16.0.0 172.16.0.1 172.16.0.254 172.16.0.255 254
172.16.1.0 172.16.1.1 172.16.1.254 172.16.1.255 254
172.16.2.0 172.16.2.1 172.16.2.254 172.16.2.255 254
172.16.3.0 172.16.3.1 172.16.3.254 172.16.3.255 254
172.16.4.0 172.16.4.1 172.16.4.254 172.16.4.255 254
172.16.5.0 172.16.5.1 172.16.5.254 172.16.5.255 254
172.16.6.0 172.16.6.1 172.16.6.254 172.16.6.255 254
172.16.7.0 172.16.7.1 172.16.7.254 172.16.7.255 254
…
172.16.254.0 172.16.254.1 172.16.254.254 172.16.15.255 254
172.16.255.0 172.16.255.1 172.16.255.254 172.16.255.255 254
---
65,024
NOTE: It is common for some network administrator to not use the last subnet.
81
With subnetting:
Network First Host Last Host Broadcast
172.16.0.0 172.16.0.1 172.16.0.254 172.16.0.255
172.16.255.0 172.16.255.1 172.16.255.254 172.16.255.255
First Subnet:
Subnet Address: 172.16.0.0
Subnet Broadcast Address: 172.16.0.255
Last Subnet:
Subnet Address: 172.16.255.0
Subnet Broadcast Address: 172.16.255.255
82
Subnetting: Step-by-step
Determining Network and Subnet Information
Use the Classless Subnetting Worksheet (Excel Spreadsheet) to do the
following:
Given any IP address and major network mask we can determine:
Major Network Address
First host address of the network
Last host address of the network
Broadcast address of the network
Number of usable hosts in the network
If the network is subnetted and we know the subnet mask we can
determine:
Subnet (network) Address
First host address of the subnet
Last host address of the subnet
Broadcast address of the subnet
Number of usable hosts in the subnet
Number of usable subnets in this network
84
See a spreadsheets on my website
Nutshell: Classless
Subnetting in a Nutshell
(Excel spreadsheet)
Worksheet: Classless
Subnetting Worksheet (Excel
spreadsheet)
85
Part 1: Determine Major Network Information
86
Convert IP Address/Network Mask to Binary
First, let’s determine the Major Network Information.
This is the information for the entire network, whether or not there are subnets.
Using the Major Network Mask, determine the major network Address, the broadcast
address for the entire network, and the number of hosts for the entire network.
The Major Network Mask (or Base Mask, Subnet Mask) is provided by the ISP.
Convert these addresses to binary.
Host IP Address:138.101.114.250
Major Network Mask: 255.255.0.0 (/16)
87
Determine Network Address
Determine the Network Address by using the AND operation.
Perform a bit-wise AND operation on the IP Address and the Subnet Mask
Note: 1 AND 1 results in a 1, 0 AND anything results in a 0
Express the result in Dotted Decimal Notation
The result is the Major Network Address of this for this host IP Address is
138.101.0.0
88
Determine Network Address
A simple way of doing the AND operation:
1. In the Network mask locate where the 1’s end and the 0’s begin and draw a
line. (I call this the “Major Network Divide” or “MD” on the worksheet.)
2. Now copy all of the bits above the 1 bits in the Network mask, to the
Network address.
3. For the rest of the bits in the Network address (the bits below the 0’s in the
Network mask) write all 0’s.
MD
89
Network: Determine First Host, Last Host, Broadcast Addresses
Remember that the network mask separates the network portion of the address from
the host portion.
Major Network Mask: 255.255.0.0 or /16
The network address has all 0’s in the host portion of the address
The broadcast address has all 1’s in the host portion of the address
The first host is all 0’s and a 1 in the host portion of the address.
The last host is all 1’s and a 0 in the host portion of the address.
90
Network: Determine First Host, Last Host, Broadcast Addresses
The network address has all 0’s in the host portion of the address
The broadcast address has all 1’s in the host portion of the address
The first host is all 0’s and a 1 in the host portion of the address.
The last host is all 1’s and a 0 in the host portion of the address.
91
Network: Determine the number of usable hosts
By counting the number of host bits we can determine the total number of usable hosts for
this network (before subnetting).
Host bits: 16
Total number of hosts:
216 = 65,536
65,536 – 2 = 65,534 (Can’t use the all 0’s address, network address, or the all 1’s
address, broadcast address.)
Network Portion
Host Portion = 16 bits
92
Part 2: Determine Subnet Information
93
Convert IP Address/Subnet Mask to Binary
Now we will determine the Subnet Network Information. (Assuming we are
subnetted.)
This is the information only for that subnet.
Using the Subnet Mask, determine the Subnet Address, the broadcast address for
the entire network, and the number of hosts for the subnet.
The Subnet Mask is determined by the network administrator, depending upon the
number of subnets and the number of hosts per subnet that are needed.
Convert these addresses to binary.
Host IP Address: 138.101.114.250
Subnet Mask: 255.255.255.192 (/26)
94
Determine Subnet Address
Determine the Network Address by using the AND operation.
Perform a bit-wise AND operation on the IP Address and the Subnet Mask
Note: 1 AND 1 results in a 1, 0 AND anything results in a 0
Express the result in Dotted Decimal Notation
The result is the Major Network Address of this for this host IP Address is
138.101.114.192
95
Determine Subnet Address
A simple way of doing the AND operation:
1. In the Subnet mask locate where the 1’s end and the 0’s begin and draw a line. (I call
this the “Subnet Divide” or “SD” on the worksheet.)
2. Now copy all of the bits above the 1 bits in the Subnet mask, to the Network address.
3. For the rest of the bits in the Subnet address (the bits below the 0’s in the Network
mask) write all 0’s.
SD
96
Subnet: Determine First Host, Last Host, Broadcast Addresses
Remember that the network mask separates the network portion of the address from
the host portion.
Subnet Mask: 255.255.255.192 or /26
The network address has all 0’s in the host portion of the address
The broadcast address has all 1’s in the host portion of the address
The first host is all 0’s and a 1 in the host portion of the address.
The last host is all 1’s and a 0 in the host portion of the address.
97
Subnet: Determine First Host, Last Host, Broadcast Addresses
The subnet address has all 0’s in the host portion of the subnet address
The broadcast address has all 1’s in the host portion of the subnet address
The first host is all 0’s and a 1 in the host portion of the subnet address.
The last host is all 1’s and a 0 in the host portion of the subnet address.
98
Subnet: Determine the number of usable hosts
By counting the number of host bits we can determine the total number of usable
hosts for this subnet.
Host bits: 6
Total number of hosts:
26 = 64
64 – 2 = 62 (Can’t use the all 0’s address, network address, or the all 1’s
address, broadcast address.) SD
99
Subnet: Determine the number of usable subnets
By counting the number of subnet bits we can determine the total number of usable hosts
for this subnet.
Subnet bits: 10
Total number of hosts:
210 = 1,024
1,024 – (0, 1, or 2) = ? 1,024 – 1 = 1,023 usable subnets
The number of usable subnets depends upon whether or not we can use the first and/or
last subnets. In today’s networks, both the first and last subnets are generally usable.
In this example, the network administrator has determined the last subnet is not to be used.
MD SD
Network Portion
Subnet Portion Host
Portion
100
Overall Visual
The subnet address has all 0’s in the host portion of the subnet address
The broadcast address has all 1’s in the host portion of the subnet address
The first host is all 0’s and a 1 in the host portion of the subnet address.
The last host is all 1’s and a 0 in the host portion of the subnet address.
101
Overall Visual
The following information must be provided:
IP Address (host or network)
Major Network Mask
If subnetted:
Subnet Mask
Number of usable subnets (less 0, 1, or 2)
102
Notes
Quick check
First host: 1 more than network/subnet address
Last host: 1 less than broadcast
Does the host IP address fall in the range of network host
addresses? Of subnet host addresses?
103
Tips
Use worksheets
Don’t do short-cuts unless you understand the process we just
discussed and you know what you are doing.
Only use a subnet calculator to check your answers.
You must know how to subnet, then you can use the calculator.
Interviews, exams, and certification exams do not allow subnet
calculators.
Practice, practice, practice!
104
Chapter 6
IPv4 Addresses – Part 2
Please support my site. Click on the Google-sponsored links found on the web
pages.
Chapter 6
IPv4 Addresses – Part 3
Please support my site. Click on the Google-sponsored links found on the web
pages.
Calculating the number subnets/hosts
needed
Calculating the number subnets/hosts needed
172.16.1.0
255.255.255.0
Network Host
Network 172.16.1.0/24
Need:
As many subnets as possible, 60 hosts per subnet
108
Calculating the number subnets/hosts needed
172.16.1. 0 0 0 0 0 0 0 0
255.255.255. 0 0 0 0 0 0 0 0
6 host bits
Network Host
Network 172.16.1.0/24
Need:
As many subnets as possible, 60 hosts per subnet
109
Calculating the number subnets/hosts needed
Number of subnets
172.16.1. 0 0 0 0 0 0 0 0
255.255.255. 1 1 0 0 0 0 0 0 255.255.255.192
6 host bits
Network Host
Network 172.16.1.0/24
Need:
As many subnets as possible, 60 hosts per subnet
New Subnet Mask: 255.255.255.192 (/26)
Number of Hosts per subnet: 6 bits, 64-2 hosts, 62 hosts
Number of Subnets: 2 bits or 4 subnets 110
Calculating the number subnets/hosts needed
172.16.1.0
255.255.255.0
Network Host
Network 172.16.1.0/24
Need:
As many subnets as possible, 12 hosts per subnet
111
Calculating the number subnets/hosts needed
172.16.1. 0 0 0 0 0 0 0 0
255.255.255. 0 0 0 0 0 0 0 0
4 host bits
Network Host
Network 172.16.1.0/24
Need:
As many subnets as possible, 12 hosts per subnet
112
Calculating the number subnets/hosts needed
Number of subnets
172.16.1. 0 0 0 0 0 0 0 0
255.255.255. 1 1 1 1 0 0 0 0 255.255.255.240
4 host bits
Network Host
Network 172.16.1.0/24
Need:
As many subnets as possible, 12 hosts per subnet
New Subnet Mask: 255.255.255.240 (/28)
Number of Hosts per subnet: 4 bits, 16-2 hosts, 14 hosts
Number of Subnets: 4 bits or 16 subnets 113
Calculating the number subnets/hosts needed
172.16.1.0
255.255.255.0
Network Host
Network 172.16.1.0/24
Need:
Need 6 subnets, as many hosts per subnet as possible
114
Calculating the number subnets/hosts needed
Number of subnets
172.16.1. 0 0 0 0 0 0 0 0
255.255.255. 0 0 0 0 0 0 0 0
3 subnet bits
Network Host
Network 172.16.1.0/24
Need:
Need 6 subnets, as many hosts per subnet as possible
115
Calculating the number subnets/hosts needed
Number of subnets
172.16.1. 0 0 0 0 0 0 0 0
255.255.255. 1 1 1 0 0 0 0 0 255.255.255.224
3 subnet bits
Network Host
Network 172.16.1.0/24
Need:
Need 6 subnets, as many hosts per subnet as possible
New Subnet Mask: 255.255.255.224 (/27)
Number of Hosts per subnet: 5 bits, 32-2 hosts, 30 hosts
Number of Subnets: 3 bits or 8 subnets 116
VLSM (Variable Length Subnet Masks)
VLSM
Example: 10.0.0.0/8
Subnet in /16 subnets:
10.0.0.0/16
10.1.0.0/16
10.2.0.0/16
10.3.0.0/16
Etc.
Subnet one of the subnets (10.1.0.0/16)
10.1.0.0/24
10.1.1.0/24
10.1.2.0/24
10.1.3.0/24
etc
118
Host can only be a member
VLSM of the subnet. Host can NOT
be a member of the network
that was subnetted.
YES!
10.2.1.55/24
10.2.1.55/16
NO!
All other /16
subnets are still
available for use
as /16 networks or
to be subnetted.
119
VLSM – Using the chart
This chart can be used to help
determine subnet addresses.
This can any octet.
We’ll keep it simple and make it the
fourth octet.
Network: 172.16.1.0/24
What if we needed 4 subnets?
What would the Mask be?
What would the addresses of each
subnet be?
What would the range of hosts be for
each subnet?
120
VLSM – Using the chart
Network: 172.16.1.0/24
What if we needed 4 subnets?
What would the Mask be?
255.255.255.192 (/26)
What would the addresses of each subnet be?
172.16.1.0/26
172.16.1.64/26
172.16.1.128/26
172.16.1.192/26
What would the range of hosts be for each
subnet?
172.16.1.0/26: 172.16.1.1-172.16.1.62
172.16.1.64/26: 172.16.1.65-172.16.1.126
172.16.1.128/26: 172.16.1.129-172.16.1.191
172.16.1.192/26: 172.16.1.193-172.16.1.254
121
16 /30 subnets
Still have
3 /26
subnets
16 /30 subnets
122
Classful Subnetting
Classful IP Addressing
125
Address Classes
126
Default Mask: 255.0.0.0 (/8)
Class A addresses
First octet is between 0 – 127, begins with 0
8 bits 8 bits
With 16 bits available for hosts,
Number
between there a 216 possible addresses.
128 - 191 That’s 65,536 nodes!
There are 16,384 (214) class B networks.
65,534 host addresses, one for network address and one for broadcast
address.
Class B addresses represent 25% of the total IPv4 unicast address space.
Class B addresses are assigned to large organizations including corporations
(such as Cisco, government agencies, and school districts).
128
Default Mask: 255.255.255.0 (/24)
Class C addresses
First octet is between 192 – 223, begins with 110
8 bits
With 8 bits available for hosts,
Number there a 28 possible addresses.
between
192 - 223
That’s 256 nodes!
The network portion of the IP address was dependent upon the first octet.
There was no “Base Network Mask” provided by the ISP.
The network mask was inherent in the address itself.
131
IPv4 Address Classes
Class D Addresses
A Class D address begins with binary 1110 in the first octet.
First octet range 224 to 239.
Class D address can be used to represent a group of hosts called a host
group, or multicast group.
Class E Addresses
First octet of an IP address begins with 1111
Class E addresses are reserved for experimental purposes and should not
be used for addressing hosts or multicast groups.
132
Fill in the information…
1. 192.168.1.3 Class _____ Default Mask:______________
Network: _________________ Broadcast: ________________
Hosts: _________________ through ___________________
133
Fill in the information…
134
Class separates network from host bits
The Class determines the Base Network Mask!
135
Know the classes!
First First Network
Host
Class Bits Octet Bits
Bits
A 0 0 – 127 8 24
B 10 128 - 191 16 16