Académique Documents
Professionnel Documents
Culture Documents
IP Subnetting
How to Subnet
5/24/2011
5/24/2011
OR 192.168.20.0/24
192 .
168 . 20
.
0
1100000.10101000.00010100.00000000
1111111.11111111.11111111.00000000
Host part of address
Network part of address
Default Class C
subnet mask
Count
256
00000000 = 0
.
.
111111111 = 255
5/24/2011
Bit Weight
128
64
32
16
Decimal Value
128
192
224
240
248
252
254
255
Benefits of Subnetworks
Smaller networks are
easier to manage.
5/24/2011
What is subnetting?
Network
Network
172
16
Network
Network
Host
Host
Subnet
Host
Network
172
16
Network
Network
Host
Host
Subnet
Host
5/24/2011
64
64
64
64
256 fruit
00000000 = 0
.
.
111111111 = 255
64 x 4 = 256
256
64 - 2 = 62
64 - 2 = 62
64 - 2 = 62
256 - 2 = 254
00000000 = 0
.
.
111111111 = 255
248
5/24/2011
172.16.3.5
IP: 172.16.2.1
E0
172.16.2.2
E1
IP: 172.16.3.1
172.16.2.160
172.16.3.100
172.16.3.150
172.16. 2 . 160
172.16. 3 . 100
Network Subnet
Host
172.16.2.0
172.16.1.0
172.16.0.0
172.16. 2 . 160
The Internet
5/24/2011
# of Subnets in
powers of 2
Subnets
0, 1
21
00, 01,10, 11
22
23
24
16
Values
Hosts
Dec.
128
64
32
16
127
5/24/2011
Hosts
Dec.
128
64
32
16
127
128
255
When we count up one more the host bits reset to zero and the subnet
bit changes to one.
That is the start of the second subnet
Continue counting until the host bits are all ones.
That is the end of the second subnet
128
64
32
16
63
64
127
128
191
192
255
5/24/2011
My Company
Management
Sales
Accounts
Manufacturing
11111111.11111111.11111111.00000000
New SN Mask:
11111111.11111111.11111111.11000000
1. 192.168.10.00000000 = 192.168.10.0
2. 192.168.10.01000000 = 192.168.10.64
Bit
borrowed
3. 192.168.10.10000000 = 192.168.10.128
4. 192.168.10.11000000 = 192.168.10.192
10
5/24/2011
1
2
8
6
4
3
2
1
6
1
0
1
0
11
5/24/2011
Power
27
26
25
24
23
22
21
20
Decimal
Value
128
64
32
16
12
5/24/2011
Subnetting Class C
Class C Network 192.168.10.0
11000000.10101000.00001010.00000000
N .
N
.
N
.
H
11111111.11111111.11111111.00000000
255
255
255
. 224
Subnet Field
Subnetting Class B
Class B Network 147.10.0.0
10010011.00001010.00000000.00000000
N .
N
.
H
.
H
11111111.11111111.00000000.00000000
255
255
248
Host Field
Five bits borrowed from the Host field and used to designate the
Subnet
We will get 32 (25 subnets)
13
5/24/2011
Subnetting Class A
Class A Network 28.0.0.0
00011100. 00000000.00000000.00000000
N .
H
.
H
.
H
11111111.00000000.00000000.00000000
255
255
240
Host Field
Twelve bits borrowed from the Host field and used to designate
the Subnet
We will get 4096 (212 subnets)
Host Range
Broadcast ID
192.168.10.0
.0 - .30
192.168.10.31
192.168.10.32
.33 - .62
192.168.10.63
192.168.10.64
.35 - .64
192.168.10.95
192.168.10.96
.97 - .126
192.168.10.127
192.168.10.128
.129 - .158
192.168.10.159
192.168.10.160
.161 - .190
192.168.10.191
192.168.10.192
.193 - .222
192.168.10.223
192.168.10.224
.225 - .254
192.168.10.255
14
5/24/2011
Subnetwork # Subnetwork ID
Host Range
Broadcast ID
192.168.10.0
.1 - .30
192.168.10.31
192.168.10.32
.33 - .62
192.168.10.63
192.168.10.64
.65 - .94
192.168.10.95
192.168.10.96
.97 - .126
192.168.10.127
192.168.10.128
.129 - .158
192.168.10.159
192.168.10.160
.161 - .190
192.168.10.191
192.168.10.192
.193 - .222
192.168.10.223
192.168.10.224
.225 - .254
192.168.10.255
15
5/24/2011
2 -2
Where h is the number of Zeros (0s) in the
subnet mask.
201.10.11.85
11001001.00001010.00001011.010 10101
Logical AND
Subnet Mask
255.255.255.224
11111111.11111111.11111111.111 00000
Subnetwork ID
201.10.11.64
11001001.00001010.00001011.010 00000
ANDing
0
AND
AND
AND
AND
16
5/24/2011
2.
3.
17
5/24/2011
18
5/24/2011
2 -2
Where h is the number of Zeros
(0s) in the subnet mask.
19
5/24/2011
Real easy
Based on the valid subnets obtained -- the
broadcast address is always the number right
before the next subnet.
20
5/24/2011
192
00001010
168
00010100
173
10101101
237
11101101
255
11111111
248
11111000
173
10101101
232
11101000
LOGICAL AND
Subnet
Mask
255
11111111
255
11111111
RESULT
Subnet
Address
192
00001010
168
00010100
21
5/24/2011
9. 192.168.173.237
2. Class? C
22
5/24/2011
192
168
10
255
255
255
224
11111111
11111111
11111111
11100000
Octet
1
Octet
2
Octet
3
Octet
4
First
Host
Last
Host
Directed
Broadcast
192
168
10
30
31
11000000
10101000
00001010
00000000
00000001
00011110
00011111
192
168
10
32
33
62
63
11000000
10101000
00001010
00100000
00100001
00111110
00111111
192
168
10
64
65
94
95
11000000
10101000
00001010
01000000
01000001
01011110
01011111
192
168
10
96
97
126
127
11000000
10101000
00001010
01100000
01100001
01111110
01111111
Subnet
Octet
1
Octet
2
Octet
3
Network
Address
First
Host
Last
Host
Directed
Broadcast
192
168
10
128
129
158
159
11000000
10101000
00001010
10000000
10000001
10011110
10011111
192
168
10
160
161
190
191
11000000
10101000
00001010
10100000
10100001
10111110
10111111
192
168
10
192
193
222
223
11000000
10101000
00001010
11000000
11000001
11011110
11011111
192
168
10
224
225
254
255
11000000
10101000
00001010
11100000
11100001
11111110
11111111
23
5/24/2011
Question
What is the subnet for the host IP address
201.100.5.68/28?
Question
How many subnetworks and hosts are
available per subnet if you apply a /28 mask to
the 210.10.2.0 class C network?
24
5/24/2011
CIDR
RFC 4632 (2006) Obsoletes RFC 1519 (1993)
Slow the growth of global routing tables
Reduce the rate of consumption of IPv4
address space.
Replace the Class A/B/C Classfull) network
address assignment system
With Classless", hierarchical blocks of IP
addresses (referred to as prefixes)
25
5/24/2011
Addrs/
Block
1
2
2
16
256
2048
65536
1048576
16777216
268435456
4294967296
# Blocks
4294967296
2147483648
2147483648
268435456
16777216
2097152
65536
4096
256
16
1
Host route
P2P link
Legacy P2P link
Legacy Class C
Legacy Class B
Legacy Class A
Default route
CIDR
0.0.0.0
/0
128.0.0.0
/1
192.0.0.0
/2
224.0.0.0
/3
240.0.0.0
/4
248.0.0.0
/5
252.0.0.0
/6
254.0.0.0
/7
255.0.0.0
/8
26
5/24/2011
CIDR
255.128.0.0
/9
255.192.0.0
/10
255.224.0.0
/11
255.240.0.0
/12
255.248.0.0
/13
255.252.0.0
/14
255.254.0.0
/15
255.255.0.0
/16
CIDR
255.255.128.0
/17
255.255.192.0
/18
255.255.224.0
/19
255.255.240.0
/20
255.255.248.0
/21
255.255.252.0
/22
255.255.254.0
/23
255.255.255.0
/24
27
5/24/2011
CIDR
255.255.255.128
/25
255.255.255.192
/26
255.255.255.224
/27
255.255.255.240
/28
255.255.255.248
/29
255.255.255.252
/30
255.255.255.254
/31
255.255.255.255
/32
VARIABLE-LENGTH
SUBNET MASKS
28
5/24/2011
Variable-Length
Subnet Masks (VLSM) vs. Classless
Inter-domain Routing (CIDR)
VLSM focus on
within an
Organization
CIDR focus is
the Internet
What Is a Variable-Length
Subnet Mask?
Subnet 172.16.14.0/24 is divided into smaller
subnets:
Subnet with one mask (/27)
Then further subnet one of the unused /27 subnets
into multiple /30 subnets
29
5/24/2011
Calculating VLSMs
30
5/24/2011
What Is Route
Summarization?
Routing protocols can summarize addresses of
several networks into one address
31
5/24/2011
Non-Common Bits = 10
192.168.16.0 /22
Non-Common Bits = 11
192.168.16.0 /21
32
5/24/2011
172.16.64.0 - 172.16.79.255
Implementation Considerations
Multiple IP addresses must have the same
highest-order bits.
Routing decisions are made based on the entire
address.
Routing protocols must carry the prefix (subnet
mask) length.
33
5/24/2011
/32
/27
/24
/16
/0
Host
Subnet
Network
Block of Networks
Default
Summarizing Routes in a
Discontiguous Network
34
5/24/2011
VLSM EXAMPLE
VLSM Example
Your company has been assigned IP network 195.39.71.0 /24. Given that
headquarters (60 hosts) is connected to five branch offices (12 hosts each)
by a WAN link, and to an ISP (the ISP owns the addresses on that link),
determine an appropriate IP addressing scheme.
Headquarters
ISP
60 users
Branch 1
12 users
Branch 2
12 users
Branch 3
12 users
Branch 4
12 users
Branch 5
12 users
35
5/24/2011
128
63
191
192
64
255
127
128
Headquarters
60 hosts
64
192
36
5/24/2011
128
Headquarters
60 hosts
160
Branch 1
12 hosts
/28
Branch 3
12 hosts
/28
(255.255.255.240) (255.255.255.240)
144
176
Branch 2
12 hosts
/28
Branch 4
12 hosts
/28
(255.255.255.240) (255.255.255.240)
192
64
128
Headquarters
60 hosts
Branch 1
12 hosts
/28
160
Branch 3
12 hosts
/28
(255.255.255.240) (255.255.255.240)
144
Branch 2
12 hosts
/28
176
Branch 4
12 hosts
/28
(255.255.255.240) (255.255.255.240)
64
192
224
Branch 5
12 hosts
/28
(255.255.255.240)
208
37
5/24/2011
Now we need to
address the 5 WAN
links that connect to
the Branch offices.
These are point-topoint connections and
only require 2
addresses.
128
Headquarters
60 hosts
26 bit mask or /26
(255.255.255.192)
144
176
Branch 4
12 hosts
/28
Branch 2
12 hosts
/28
(255.255.255.240) (255.255.255.240)
192
64
Branch 5
12 hosts
/28
208
Branch 3
12 hosts
/28
(255.255.255.240) (255.255.255.240)
(255.255.255.240)
The remaining
networks could be
used for future
growth of either
LANs or WANs.
160
Branch 1
12 hosts
/28
232
224
WAN
WAN
1
228
WAN
2
236
WAN
4
240
248
WAN
5
244
128
Headquarters
60 hosts
26 bit mask or /26
(255.255.255.192)
Branch 1
12 hosts
/28
160
Branch 3
12 hosts
/28
(255.255.255.240) (255.255.255.240)
144
Branch 2
12 hosts
/28
176
Branch 4
12 hosts
/28
(255.255.255.240) (255.255.255.240)
64
192
Branch 5
12 hosts
/28
(255.255.255.240)
208
224
WAN
1
228
WAN
2
232
WAN
3
236
WAN
4
240
248
WAN
5
244
38
5/24/2011
195.39.71.0 /26
195.39.71.128 /28
195.39.71.144 /28
195.39.71.160 /28
195.39.71.176 /28
195.39.71.192 /28
39