IPv 4 Subnetting
IPv 4 Subnetting
2
Subnetting
Network Network Network Host
8 Bits 8 Bits 8 Bits 8 Bits
27 26 25 24 23 22 21 20 27 26 25 24 23 22 21 20 27 26 25 24 23 22 21 20 27 26 25 24 23 22 21 20
Subnet Host
2. Subnet field and the host field are created from the original host portion
3. Provides addressing flexibility
4. To create a subnet address:
◦ Network administrator borrows bits from the original host portion
◦ Designates them as the subnet field (gives up control)
3
What is a Subnet Mask?
Class B Default Subnet Mask Class B Subnet Mask with
255.255.0.0 4 bits borrowed
255.255.240.0 Allowed
1.Formal name: Extended Network Prefix Numbers
5.Allowed numbers: 255, 254, 248, 240, 224, 192, 128, 0 4- 240
5- 248
6.Step to determine the subnet mask:
◦ Express the subnetwork IP address in binary form 6- 252
◦ Replace the network and subnet portion of the address with all 1s 7- 254
◦ Replace the host portion of the address with all 0s
◦ Convert the binary expression back to dotted-decimal notation 8- 255
4
Subnet Mask
If you have a class C address:
1.How many bits are used without subnetting?
24 or /24
2. What is the subnet mask?
11111111.11111111.11111111.00000000 or 255.255.255.0
N . N . N . H
3. If you borrowed 4 bits, how many are used?
28 or /28
1. 194.78.112.6/28 255.255.255.240
2. 117.23.8.3/10 255.192.0.0
3. 156.132.64.12/20 255.255.240.0
4. 208.150.112.16/30 255.255.255.252
5. 91.118.125.2/16 255.255.0.0
6
Useable Subnets and Host
MEMORIZE
2b = useable subnets
2. Formula for calculation USEABLE Hosts (unused bits):
2u - 2 = useable hosts
7
Calculating Subnets and Hosts
Example: Class C network, borrowing 3 bits:
1.What is the subnet mask?
255.255.255.224
2. How many useable subnets?
2b= ? 23 = 8 useable subnets
3. How many useable hosts per subnet?
2u-2= ? 25 (32) - 2 = 30 useable hosts
Possible number of hosts
8
Boolean Operations
1.The term "operations" in mathematics refers to rules that define
how one number combines with other numbers
2.Boolean operators for binary numbers:
◦ AND is like multiplication NAND is the AND with a reversed outcome
◦ OR is like addition NOR is the OR with a reversed outcome
◦ NOT changes 1 to 0, and 0 to 1
3.In order to route a data packet, the router must first determine the
destination network/subnet address by performing a logical AND
using the destination host's IP address and the subnet mask
4.Result will be the network/subnet/wire address
9
ANDing
Find the network address for this class B IP:
1.180.160.120.8/18
10
Classful Subnetting
THINGS YOU MUST ALWAYS FIND
THINGS YOU KNOW BY DEFAULT: OUT FIRST BEFORE FINDING YOUR
IP’S:
1.Class 1.Bits Borrowed
2.Formulas 2.Number of subnets
3.Default Mask 3.Numbers of hosts
4.Subnet Mask
5.Increment (Possible number of hosts)
11
An IP address of 196.112.48.0 with the most
hosts:
1.Bits Borrowed 1
5.Increment 128
12
An IP address of 196.112.48.0 with 2 bits
borrowed would have:
1.Bits Borrowed 2
5.Increment 64
13
An IP address of 196.112.48.0/27:
1.Bits Borrowed 3
5.Increment 32
14
A class C address 196.112.48.12 with 4 bits
borrowed would have:
1.Bits Borrowed 4
5.Increment 16
15
An IP address of 196.112.48.0/29:
1.Bits Borrowed 5
5.Increment 8
16
An IP address of 196.112.48.0 with the most
subnets:
1.Bits Borrowed 6
5.Increment 4
17
Class C Subnetting Bits
Formula = N.N.N.H Default Slash = /24 Default Mask = 255.255.255.0
Bits Borrowed 1 2 3 4 5 6
18
Class C Subnetting Chart
196.112.48.0/26 Class C N.N.N.H 255.255.255.0
Subnet Network Useable Broadcast
Number Address Range Address
SN0 196.112.48.0 196.112.48.1 – 196.112.48.62 196.112.48.63
256
19
20
Private Addresses
The following rages are available for private addressing:
Class A 10.0.0.0 – 10.255.255.255
Class B 172.16.0.0 – 172.31.255.255
Class C 192.168.0.0 – 192.168.255.255
21
Automatic Private IP Addressing (APIPA)
1.Feature of modern operating systems
2.Automatically self-configures an IP address and subnet mask when
a DHCP server isn't available
3.IP address range: 169.254.0.1 through 169.254.255.254
4.Configures a default class B subnet mask of 255.255.0.0
5.Used until a DHCP becomes available
6.APIPA cannot be routed over the Internet
22