Introduction to Subnetting
1/8
1/5
This material was developed with funding from the
National Science Foundation under Grant # DUE 1601612
Back
Next
Restart
Before subnetting
IP address
After
Subnetting
Network identifier
Host identifier
2/5
Click to view subnet
TCP/IP connects networks of different sizes and systems of different types. These networks loosely fall into one of three main classes (A, B, and C) that have predefined sizes.
To configure TCP/IP correctly, a device requires an IP address, subnet mask, and a default gateway. The subnet mask divides an IP address into two parts: one part identifies the network to which it belongs, and the other part identifies the device (or host).
A subnet is a logical subdivision of the network which divides a network into two or more networks. To overcome the inherent problems with class-based addressing, subnetting allows you to borrow some host bits and use them to create more networks.
Subnet identifier
Because subnetting divides a network’s broadcast domains, there is better control of traffic flow which increases network performance.
Reduces network
congestion
3/5
Controls
network
growth
Create networks that have logical host limits as opposed to IP address class limits. Network administration teams can be assigned to specific subnets based on special skills and ability to manage emerging technologies and services.
Improves
network
security
Individuals can be segregated based on privileges. Assign highly trusted individuals higher access to sensitive resources. Limit access to individuals of lower trust (or guest).
Improves network performance and
speed
Network traffic destined for a device within a subnet stays in that subnet which reduces congestion. If a network has no subnets, every computer sees broadcast packets from all computers and server.
Click to reveal the benefits of subnetting
Eases
network
administration
Plan and design a network using subnets to reflect the organization's size and complexity. Some organizations reserve subnets for future growth.
Interface 3
Interface 2
IP Address = 190.100.1.62
Mask = 255.255.255.240
Destination Network Address
Full Class C = 190.100.32.0
255.255.255.240
Network Address = 190.100.1.32
Address Range 190.100.1.32-46
Broadcast Address = 190.100.1.47
Interface 0
Click each Interface box to reveal the configuration
4/5
Subnet Y
Network traffic flows between subnetworks through routers which serve as the logical or physical boundary between subnets.
A router has at least one inbound connection (Interface0) from outside the network. The router applies addresses and subnet masks to the internal interfaces (Interface1, Interface2, and Interface3) to create each subnet.
Subnet X
Internet
Subnet Z
IP Address = 190.100.1.30
Mask = 255.255.255.240
Network
Destination Network Address
Full Class C = 190.100.1.0 255.255.255.0 Network Address = 190.100.1.0
Address Range 190.100.1.1-254
Broadcast Address = 190.100.1.255
Destination Network Address
Full Class C = 190.100.1.16 255.255.255.240
Network Address = 190.100.1.16
Address Range 190.100.1.17-30
Broadcast Address = 190.100.1.31
IP Address = 190.100.1.253
Mask = 255.255.255.240
IP Address = 190.100.1.46
Mask = 255.255.255.240
Destination Network Address
Full Class C = 190.100.1.48 255.255.255.240
Network Address = 190.100.1.48
Address Range 190.100.1.49-62
Broadcast Address = 190.100.1.63
Interface 1
10100
00101
Click on each method for more information.
Powers of 2
Magic Number
5/5
There are three common methods to determine the subnet size when given an IP address and subnet mask. You may find that one of these methods will work to help you conquer Class A, Class B, and Class C Subnetting.
Binary
(Boolean AND)
/23
32 – 11 = 21
30
/16
32 – 23 = 9
221 = 2,097,152
32 – 16 = 16
216 = 65,536
29 = 512
2,097,150
255.255.240.0
510
65,534
Main Menu
/27
32 – 24 = 8
/20
1/2
To determine how many hosts used based on your subnet mask, you will work in powers of 2. If your subnet mask is 255.255.254.0, you are using 23 bits for the subnet mask. To figure the number of hosts, take 2n where n is the number of bits you have available (32-23=9 represented by the green zeros). The result of 29 is 512, as shown in the table.
Since subnet masks cannot contain all 0s or all 1s in the network or the host portion of the address, you need to subtract 2 from 512 resulting in 510 usable host addresses.
32 – 27 = 5
32 – 20 = 12
25 = 32
255.240.0.0
212 = 4,096
/12
255.255.128.0
4,094
32 – 12 = 20
/17
255.255.255.240
/28
255.255.255.0
220 = 1,048,576
255.255.248.0
32 – 17 = 15
32 – 29 = 3
32 – 28 = 4
/24
1,048,574
255.255.252.0
215 = 32,768
255.128.0.0
23 = 8
24 = 16
28 = 256
1,022
32,766
6
32 – 9 = 23
/9
14
254
223 = 8,388,608
255.248.0.0
255.255.255.128
255.255.192.0
8,388,606
255.255.255.224
/13
/25
255.255.255.252
/18
32 – 13 = 19
32 – 25 = 7
210 = 1,024
/30
32 – 18 = 14
255.255.254.0
11111111.11111111.11111110.00000000
9 bits or 29 equals 512
219 = 524,288
27 = 128
/21
32 – 30 = 2
214 = 16,384
524,286
255.192.0.0
255.254.0.0
255.255.255.248
126
32 – 21 = 11
22 = 4
/22
16,382
/15
/10
/29
2
211 = 2,048
Powers of 2
32 – 15 = 17
32 – 10 = 22
222 = 4,194,304
255.252.0.0
2,046
Host Bits
217 = 131,072
255.255.255.192
4,194,302
Subnet Bits
32 – 22 = 10
/8
255.255.224.0
131,070
/14
Determine Hosts
/26
32 – 14 = 18
32 – 8 = 24
/19
32 – 19 = 13
Usable Hosts
Subnet Mask
32 – 26 = 6
218 = 262,144
26 = 64
255.224.0.0
224 = 16,777,216
213 = 8,192
262,142
62
/11
16,777,214
8,190
255.255.254.0
255.255.0.0
255.0.0.0
Bits Used (n)
32 – n = x
Number of Hosts (2x)
255.240.0.0
Usable Hosts (2x – 2)
Element
with Audio
HTML
View Powers of 2
[x] close
Click View Powers of 2 to help you complete the table based on the given subnet mask.
2/2
Result using the AND function
1
Condition 1
Binary (Boolean AND)
Condition 2
0
Boolean Logic compares an IP address and a subnet mask to determine the network address using the Boolean AND operation. Examine the subnet mask. The portion of the subnet mask with consecutive binary 1s allow pass-through for the IP address. The portion of the subnet mask with binary 0s does not allow pass-through—notice the resulting AND function of the last octet is all 0s.
Boolean AND means that Condition 1 AND Condition 2 must be met. With binary numbers, 1 is considered true and 0 is false.
Network
Address
Result
194.168.1.0
IP address (Condition 1)
Subnet Mask (Condition 2)
. . .
210.169.49.145 /21 or 255.255.248.0
IP address/
Subnet Mask
Test your knowledge. Fill in the Result based on the given IP address and Subnet Mask.
172.16.41.37
Subnet Mask:
What is the Magic Number?
Look at the subnet mask and take the number that is furthest to the left that is NOT “255”.
The magic number can be in the second, third, or fourth octet.
Click the magic wands to calculate the magic numbers.
200.10.10.150
38.24.100.75
Mask = 255.240.0.0
256 – 224 = 32
Mask = 255.255.248.0
256 – 252 = 4
Mask = 255.255.255.252
Click on the wand to reveal the magic number for each subnet mask.
Mask = 255.255.192.0
256 – 248 = 8
Mask = 255.255.255.128
256 – 128 = 128
256 – 192 = 64
256 – 240 = 16
2/8
Mask = 255.224.0.0
Click the magic wand to calculate the network address.
172.16.32.0
{
Since 41 falls in the range 32 – 48, the first number in the range, 32 is the network address that 172.16.41.37 belongs to.
3/8
Network Address:
172.16.41.37
What Network Does the IP Address Belong to?
Take the last non-zero number of the subnet mask to calculate the magic number. In this example the magic number is 16; this means 16 is the network multiplier. Go up increments of 16 until you find the range that 41 belongs within.
172.16.48.0 – 2 = 172.16.47.254
Click the magic wand to continue.
What is the Broadcast Address?
Take the higher number from the range and subtract one:
4/8
Look at the range that you found and take the higher number (48) and subtract two to get the last usable address:
172.16.32.0 + 1 = 172.16.32.1
172.16.48.0 – 1 = 172.16.47.255
What is the First and Last Assignable IP Address?
Take the IP Network address and add one to get the first usable address:
Magic Number =
Mask = 255.248.0.0
256 – Last Mask Value = Magic Number
Magic Number Challenge
Your turn. Enter the magic number for each subnet mask.
Click the submit button to check your answers.
5/8
Mask = 255.255.255.240
Magic Number =
Magic Number =
Magic Number =
Mask = 255.255.252.0
Magic Number =
Magic Number =
IP Address
24.100.34.56
Mask
200.25.125.60
160.60.162.200
Network Address
7/8
98.100.10.220
140.40.218.100
192.168.20.35
255.255.255.240
255.255.252.0
IP Network Address
Calculate the Network IP Address
Use the magic number to determine the network address for each IP Address and mask combination. Enter the network address and click the submit button to check your answers.
38.150.150.125
8/8
28.155.48.58
202.20.20.134
1st and Last Usable Host Address
210.215.25.133
188.20.206.243
1st Usable
Host Address
Last Usable
Host Address
172.57.155.123
Calculate the Network IP Address Ranges
Now the challenge is to find the first and last usable address in each subnet. Enter the addresses in the boxes provided and click the submit button to check your answers.
255.255.240.0
256 – 240 = 16
16 is the magic number
256 – 252 = 4
4 is the magic number
255.252.0.0
32 is the magic number
255.255.255.224
256 – 224 = 32
Magic Number =...
Magic Number Placement
Now enter the magic number for each subnet mask in the proper octet.
Click the submit button to check your answers.
Magic Number =...
Magic Number =...
6/8
Magic Number =...
Magic Number =...
Magic Number =...