IP Subnetting
IP Subnetting
Subnet Mask
Subnet Mask
Subnet Mask
Network Host
Host IP: 172.16.33.10 10101100.00010000.00100001.00001010 Mask: 255.255.0.0 11111111.11111111.00000000.00000000 ----------------------------------Net Add: 172.16.0.0 10101100.00010000.00000000.00000000
Devices such as hosts use the bit-wise AND operation on the: Host IP address Subnet mask AND operation: 1 AND 1 = 1 0 AND anything = 0
4
Subnet Mask
Network Host
Host IP: 172.16.33.10 10101100.00010000.00100001.00001010 Mask: 255.255.255.0 11111111.11111111.11111111.00000000 ----------------------------------Net Add: 172.16.33.0 10101100.00010000.00100001.00000000
Subnet Mask
Network Host
Formalized in 1985, the subnet mask breaks a single network in to smaller pieces.
Allows network administrators to divide their network into small networks or subnets.
What is subnetting?
Network Network 172 16 Host 0 Host 0
Network Network
Subnet
Host
Subnetting is the process of borrowing bits from the HOST bits, in order to divide the larger network into small subnets. Subnetting does NOT give you more hosts, but actually costs you hosts. You lose two host IP Addresses for each subnet, one for the subnet IP address and one for the subnet broadcast IP address. You lose the last subnet and all of its hosts IP addresses as the broadcast for that subnet is the same as the broadcast for the network. In older technology, you would have lost the first subnet, as the subnet IP address is the same as the network IP address. (This subnet can be used in most networks.)
9
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 or subnet. 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
98 Apples (100 2)
10
Analogy
98 Apples (100 2)
10
10
10
10
10
10
10
It is the same as taking a barrel of 100 apples and dividing it into 10 barrels of 10 apples each.
11
8
(less 2)
8
(less 2)
98 Apples (100 2)
8
(less 2)
8
(less 2)
8
(less 2)
8
(less 2)
8
(less 2)
8
(less 2)
However, in subnetting we will see that we lose two apples per subnet: one for the network address one for the broadcast address
8
(less 2)
12
X
(less 2) (less 2)
8
(less 2)
8
(less 2)
98 Apples (100 2)
8
(less 2)
8
(less 2)
8
(less 2)
8
(less 2)
8
(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 The last basket (subnet) The broadcast address for the last subnet is the same as for the entire network.
X
(less 2)
13
14
15
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 0s in host portion
Host 0 0 0 0 0 0 0
16
Subnets Addresses
256 Subnets 28
Subnet Example
Network address 172.16.0.0 with /16 Base Network Mask Using Subnets: Subnet Mask 255.255.255.0 or /24
Broadcast
Host IP Address: 172.16.3.50 A host of the 172.16.3.0 /24 network With NO subnetting:
Network 172.16.0.0 First Host 172.16.0.1 Last Host 172.16.255.254 Broadcast 172.16.255.255
65,534 host addresses, one for network address and one for broadcast address. Host IP Address: 172.16.3.50 A host of the 172.16.0.0 /16 network
18
With subnetting:
Network 172.16.0.0 172.16.1.0 172.16.2.0 172.16.3.0 172.16.4.0 172.16.5.0 172.16.6.0 172.16.7.0 172.16.254.0 172.16.255.0
First Host 172.16.0.1 172.16.1.1 172.16.2.1 172.16.3.1 172.16.4.1 172.16.5.1 172.16.6.1 172.16.7.1 172.16.254.1 172.16.255.1
19
With subnetting:
Network 172.16.0.0 172.16.1.0 172.16.2.0 172.16.3.0 172.16.4.0 172.16.5.0 172.16.6.0 172.16.7.0 172.16.254.0 172.16.255.0 First Host 172.16.0.1 172.16.1.1 172.16.2.1 172.16.3.1 172.16.4.1 172.16.5.1 172.16.6.1 172.16.7.1 172.16.254.1 172.16.255.1 Last Host 172.16.0.254 172.16.1.254 172.16.2.254 172.16.3.254 172.16.4.254 172.16.5.254 172.16.6.254 172.16.7.254 172.16.254.254 172.16.255.254 Broadcast 172.16.0.255 172.16.1.255 172.16.2.255 172.16.3.255 172.16.4.255 172.16.5.255 172.16.6.255 172.16.7.255 172.16.15.255 172.16.255.255 Hosts 254 254 254 254 254 254 254 254 254 254 --65,024
Total address = 256 subnets * (256 hosts 2) = 256 * 254 = 65,024 NOTE: It is common for some network administrator to not use the last subnet.
20
With subnetting:
Network 172.16.0.0 172.16.255.0 First Host 172.16.0.1 172.16.255.1 Last Host Broadcast 172.16.0.254 172.16.0.255 172.16.255.254 172.16.255.255
Major Network Address: 172.16.0.0 Major Network Mask: 255.255.0.0 Major Network Broadcast Address: 172.16.255.255 Subnet Mask: 255.255.255.0 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
21
22
172.16.1.0 255.255.255.0
Network Host
23
172.16.1. 0 0 0 0 0 0 0 0 255.255.255. 0 0 0 0 0 0 0 0
Network Host 6 host bits
24
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
Network Host 255.255.255.192 6 host bits
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
25
172.16.1.0 255.255.255.0
Network Host
26
172.16.1. 0 0 0 0 0 0 0 0 255.255.255. 0 0 0 0 0 0 0 0
Network Host 4 host bits
27
172.16.1. 0 0 0 0 0 0 0 0 255.255.255. 1 1 1 1 0 0 0 0
Network Host 255.255.255.240 4 host bits
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
28
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
29
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
30
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
3 subnet bits Network Host 255.255.255.224
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
31
VLSM allows an organization to use more than one subnet mask within the same network address space. Implementing VLSM is often referred to as "subnetting a subnet", and can be used to maximize addressing efficiency. Classful routing protocols require that a single network use the same subnet mask. Therefore, network 192.168.187.0 must use just one subnet mask such as 255.255.255.0. VLSM is simply a feature that allows a single autonomous system to have networks with different subnet masks. If a routing protocol allows VLSM, use a 30-bit subnet mask on network connections, 255.255.255.252, a 24-bit mask for user networks, 255.255.255.0, or even a 22-bit mask, 255.255.252.0, for networks with up to 1000 users.
33
A waste of Space
The above addressing scheme is fine for a small LAN. However, this addressing scheme is extremely wasteful if using point-to-point connections
34
35
Subnet 6 is further broken into /30 subnets for Point-to-Point WAN Links
36
37
38
Remember the following rules: 1. A router must know in detail the subnet numbers attached to it. 2. A router does not need to tell other routers about each individual subnet if the router can send one aggregate route for a set of routers. 3. A router using aggregate routes would have fewer entries in its routing table.
39
Remember the following rules: 1. A router must know in detail the subnet numbers attached to it. 2. A router does not need to tell other routers about each individual subnet if the router can send one aggregate route for a set of routers. 3. A router using aggregate routes would have fewer entries in its routing table.
40
42
Subnetting Exercise 1
Host IP Address Network Mask Subnet Mask Find: Number of Subnet Bits Number of Subnets Number of Host Bits per Subnet Number of Usable Hosts per Subnet Subnet Address for this IP Address IP Address of First Host on this Subnet IP Address of Last Host on this Subnet Broadcast Address for this Subnet 172.25.114.250 255.255.0.0 (/16) 255.255.255.192 (/26)
43
Subnetting Exercise 2
Host IP Address Subnet Mask Number of Subnet Bits Number of Subnets Number of Host Bits per Subnet Number of Usable Hosts per Subnet Subnet Address for this IP Address IP Address of First Host on this Subnet IP Address of Last Host on this Subnet Broadcast Address for this Subnet
172.30.1.33 255.255.255.0
44