1 real networkers don’t use decimal! part 2 planning subnets october 18, 2004
TRANSCRIPT
1
Real Networkers don’t use Decimal! Part 2
Planning Subnets
October 18, 2004
2
Steps to planning a subnet
Obtain starting block of addresses Determine how many subnets and how many
hosts on each subnet you will need Determine how many host bits to “borrow” Create a subnet mask Create a subnet table listing, for each subnet:
Subnet Address and Mask Host Address Range Broadcast address
3
Starting Block of addresses
Determined by a network address and a mask
At first, every starting blocks will be a simple Class A, B or C network.
Variable Length Subnetting allows a subnet to be further subnetted
4
Determining # of Subnets & Hosts
Some information will be provided Assume if only one number is provided (e.g.
# of subnets), the goal is to maximize the other (e.g. # of hosts)
In the real world be sure to discuss growth plans with the client!
5
How many bits to borrow
Remember the formula’s!
# of Possible Subnets = 2Number of subnet bits
# of Possible Hosts = 2Number of host bits
# of Usable Hosts = (2Number of host bits) – 2
Note: Networks running RIP protocol version 1 can’t use the first (Subnet 0) and the last (all 1’s) subnet . Older texts will show the formula
# of Usable Subnets = # of Possible Subnets - 2
6
Number of host bits
The number of host bits will be determined by your subnet mask.
It is a good idea to confirm that there will be enough host bits to meet the specifications.
7
Class C Sample Problem
Subnet the 222.33.4.0 network to create at least 10 networks while maximizing the number of hosts.
Step 1. Determine # of bits to borrow The formula 2 N ≥ 10 Look at your Powers of 2 table to find a value ≥ 10
power 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
value
4194304
2097152
1048576
524288
262144
131072
65536
32768
16384
8192
4096
2048
1024
512
256
128
64
32
16
8 4 2 1
You will need to borrow 4 bits.
8
Class C Problem Step 2
Step 2: Determine your mask. Start with the Class C default mask: 11111111.11111111.11111111.00000000
Change the 4 (from previous step) leftmost host bits into subnet bits11111111.11111111.11111111.11110000
Write the mask:255.255.255.240 or /28
9
Class C Problem Step 3.
Identify your subnets The formula determines that there are 16 possible subnets.
Subnet # Bits Subnet # Bits
0 0000 8 1000
1 0001 9 1001
2 0010 10 1010
3 0011 11 1011
4 0100 12 1100
5 0101 13 1101
6 0110 14 1110
7 0111 15 1111
10
Class C Problem Binary subnets
For example subnet 11 is 11011110 00100001 00000100 10110000
11011110 00100001 00000100 00000000
11011110 00100001 00000100 00000000
00000100 00010000 00000100 10010000
00000100 00100000 00000100 10100000
00000100 00110000 00000100 10110000
00000100 01000000 00000100 11000000
00000100 01010000 00000100 11010000
00000100 01100000 00000100 11100000
00000100 01110000 00000100 11110000
11
Class C Subnets Dotted Decimal notation
Dotted Decimal notation ignores subnetting and converts the 32 bit address into 8 bit chunks.
The 11th subnet: 11011110.00100001.00000100.10110000becomes 222.33.4.176 position 1 0 1 1 0 0 0 0
value 128
64
32
16
8 4 2 1
What will be the 12th subnet in dotted decimal?
12
Class C Subnets Dotted Decimal notation
# Bits Dotted
Decimal
# Bits Dotted
Decimal
011011110.00100001
00000100.00000000
222.33.4.0 811011110.00100001
00000100.10000000
222.33.4.128
1 .00010000 222.33.4.16 9 .10010000 222.33.4.144
2 .00100000 222.33.4.32 10 .10100000 222.33.4.160
3 .00110000 222.33.4.48 11 .10110000 222.33.4.176
4 .01000000 222.33.4.64 12 .11000000 222.33.4.192
5 .01010000 222.33.4.80 13 .11010000 222.33.4.208
6 .01100000 222.33.4.96 14 .11100000 222.33.4.224
7 .01110000 222.33.4.112 15 .11110000 222.33.4.240
13
Host addresses
Since number of possible host addresses depends on the number of host bits, use the same formula used to determine the number of subnets.
# of Host Addresses = 2Number of host bits
host bits 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
number of hosts
4194304
2097152
1048576
524288
262144
131072
65536
32768
16384
8192
4096
2048
1024
512
256
128
64
32
16
8 4 2 1
4 host bits means 16 possible host addresses
14
Possible Hosts on Subnet 11
# Bits Dotted
Deceimal
# Bits Dotted
Deceimal
0
11011110.00100001
00000100.11010000
222.33.4.176 8
11011110.00100001
00000100.11011000
222.33.4.184
1 .11010001 222.33.4.177 9 .11011001 222.33.4.185
2 .11010010 222.33.4.178 10 .11011010 222.33.4.186
3 .11010011 222.33.4.179 11 .11011011 222.33.4.187
4 .11010100 222.33.4.180 12 .11011100 222.33.4.188
5 .11010101 222.33.4.181 13 .11011101 222.33.4.189
6 .11010110 222.33.4.182 14 .11011110 222.33.4.190
7 .11010111 222.33.4.183 15 .11011111 222.33.4.191
Subnet and host bits are combined to create the dotted decimal
15
Special host addresses A host address of all 0 bits is the network identifier
or network address. 11011110.00100001.00000100.00000000 222.33.4.0/24 11011110.00100001.00000100.10110000 222.33.4.176/28
Subnet 11 from our sample A host address of all 1 bits is the layer 3 broadcast
address for that network. 11011110.00100001.00000100.11111111 222.33.4.255/24 11011110.00100001.00000100.10111111 222.33.4.191/28
The broadcast address for subnet 11 from our sample These two addresses can not be assigned to a host. # of Usable Host Addresses = (2Number of host bits) - 2
16
Unusable Subnets
The all 0’s and all 1’s subnets should also not be used when using classful (RIP version 1) routing.
The all 0’s subnet could be confused with the original network. 11011110.00100001.00000100.00000000 222.33.4.0/24 11011110.00100001.00000100.00000000 222.33.4.0/28
A broadcast to the all 1’s subnet could not be distinguished from a broadcast to all hosts of the original network 11011110.00100001.00000100.11111111 222.33.4.255/24 11011110.00100001.00000100.11111111 222.33.4.255/28
Broadcast to subnet 15
17
Formulas
# of Possible Subnets = 2Number of subnet bits
# of Possible Hosts = 2Number of host bits
# of Usable Hosts = (2Number of host bits) - 2
# of Usable Subnets with RIP version 1 = (2Number of subnet bits) – 2
18
Class B Sample Problem
Subnet the 172.123.0.0 network to create at least 5 networks while maximizing the number of hosts.
Step 1. Determine # of bits to borrow The formula 2 N ≥ 5 Look at the Powers of 2 table to find a value ≥ 5
power 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
value
4194304
2097152
1048576
524288
262144
131072
65536
32768
16384
8192
4096
2048
1024
512
256
128
64
32
16
8 4 2 1
You will need to borrow 3 bits.
19
Class B Problem Step 2
Step 2: Determine your mask. Start with the Class B default mask: 11111111.11111111.00000000.00000000
Change the 3 leftmost host bits (from previous step) into subnet bits11111111.11111111.11100000.00000000
Write the mask:255.255.224.0 or /19
20
Class B Problem Step 3.
Identify your subnets: The formula determines that there are 8 possible Subnets.
# Bits Dotted
Decimal
# Bits Dotted
Decimal
010101100.01111011
00000000.00000000
172.123.0.0 410101100.01111011
10000000.00000000
172.123.128.0
1 00100000.00000000
172.123.32.0 5 10100000.00000000
172.123.160.0
2 01000000.00000000
172.123.64.0 6 11000000.00000000
172.123.196.0
3 01100000.00000000
172.123.96.0 7 11100000.00000000
172.123.224.0Which subnets can not be used?
21
Host addresses
# of Host Addresses = 2Number of host bits
11111111.11111111.11100000.00000000 Number of host bits = 32 – mask bits(19) = 13. 8192 Possible host addresses
Host bits 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
number of hosts
4194304
2097152
1048576
524288
262144
131072
65536
32768
16384
8192
4096
2048
1024
512
256
128
64
32
16
8 4 2 1
The Powers of 2 table again!
22
Host Addresses
The 8,192 host addresses would range from10101100 01111011 00100000 00000000
10101100 01111011 00100000 00000001
10101100 01111011 00100000 00000010to
10101100 01111011 00100000 1111111110101100 01111011 00100001 00000000 10101100 01111011 00100001 00000001
to
10101100 01111011 00111111 1111111010101100 01111011 00111111 11111111
23
Host Addresses Dotted Decimal
Using Dotted Decimal notation with Subnet 1, they would range from
10101100.01111011.00100000.00000000172.123.32.0
10101100.01111011.00100000.00000001172.123.32.1
10101100.01111011.00100000.00000010172.123.32.2
to10101100.01111011.00111111.11111110
172.123.63.25410101100.01111011.00111111.11111111
172.123.63.255
Subnet and host bits are combined to create the dotted decimal
Network address
Broadcast address
24
Address Patterns In this example each subnet address is 32 more
than the previous subnet address. The host addresses on subnet 1 range from the
subnet address (172.123.32.0) to one less than the next network address (172.123.63.255).
The last subnet address is the same as the mask# Subnets #
010101100.01111011
00000000.00000000
172.123.0.0 410101100.01111011
10000000.00000000
172.123.128.0
1 00100000.00000000
172.123.32.0 5 10100000.00000000
172.123.160.0
2 01000000.00000000
172.123.64.0 6 11000000.00000000
172.123.192.0
3 01100000.00000000
172.123.96.0 7 11100000.00000000
172.123.224.0
25
Subnet Table
# Subnet Mask 1st Host Last Host Broadcast
0 172.123.0.0 225.255.224.0 172.123.0.1 172.123.31.254 172.123.31.255
1 172.123.32.0 225.255.224.0 172.123.32.1 172.123.63.254 172.123.63.255
2 172.123.64.0 225.255.224.0 172.123.64.1 172.123.95.254 172.123.95.255
3 172.123.96.0 225.255.224.0 172.123.96.1 172.123.127.254 172.123.127.255
4 172.123.128.0 225.255.224.0 172.123.128.1 172.123.159.254 172.123.159.255
5 172.123.160.0 225.255.224.0 172.123.160.1 172.123.191.254 172.123.191.255
6 172.123.192.0 225.255.224.0 172.123.192.1 172.123.223.254 172.123.223.255
7 172.123.224.0 225.255.224.0 172.123.224.1 172.123.255.254 172.123.255.255
Shortcut! Notice that every item (except the mask) is 32 more than the previous value in the octet containing both subnet and host bits. Only true for 3 bit subnets!
26
“Magic Number” shortcuts
The number 32 in the previous example is sometimes called the “magic number.”
It is a result of using dotted decimal notation. It only applies in the octet that contains both
subnet & host bits. There are two ways to determine this number
It is the value of the right most network bit position It also equals 256 – subnet mask
27
Last Example! Class A
Subnet 121.0.0.0 /8 to create 1000 subnets. Step 1. Determine # of bits to borrow
The formula 2 N ≥ 1000 Look at your Powers of 2 table to find a value ≥ 1000
power 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
value
4194304
2097152
1048576
524288
262144
131072
65536
32768
16384
8192
4096
2048
1024
512
256
128
64
32
16
8 4 2 1
You will need to borrow 10 bits.
28
Class A Problem Step 2
Step 2: Determine your mask. Start with the Class A default mask: 11111111.00000000.00000000.00000000
Change the 10 leftmost host bits into subnet bits11111111.11111111.11000000.00000000
Write the mask:255.255.192.0 or /18
29
Determine Magic Number
Network: 121.0.0.0 Mask:255.255.192.0 Subnet 0: 01111001.00000000.00000000.00000000 Subnet 1: 01111001.00000000.01000000.00000000 Subnet 1: 121.0.64.0
or 256 – 192 = 64 Magic Number!
Only use in the octet with both subnet and host bits.
30
Subnet Table, first subnets
# Subnet Mask 1st Host Last Host Broadcast
0 121.0.0.0 225.255.192.0 121.0.0.1 121.0.63.254 121.0.63.255
1 121.0.64.0 225.255.192.0 121.0.64.1 121.0.127.254 121.0.127.255
2 121.0.128.0 225.255.192.0 121.0.128.1 121.0.191.254 121.0.191.255
3 121.0.192.0 225.255.192.0 121.0.192.1 121.0.255.254 121.0.255.255
4 121.1.0.0 225.255.192.0 121.1.0.1 121.1.63.254 121.1.63.255
5 121.1.64.0 225.255.192.0 121.1.64.1 121.1.127.254 121.1.127.255
6 121.1.128.0 225.255.192.0 121.1.128.1 121.1.191.254 121.1.191.255
7 121.1.192.0 225.255.192.0 121.1.192.1 121.1.255.254 121.1.255.255
8 121.2.0.0 225.255.192.0 121.2.0.1 121.2.63.254 121.2.63.255
+64
+64
31
Subnet Table, last subnets
# Subnet Mask 1st Host Last Host Broadcast
1017 121.254.0.0 225.255.192.0 121.254.0.1 121.254.63.254 121.254.63.255
1017 121.254.64.0 225.255.192.0 121.254.64.1 121.254.127.254 121.254.127.255
1018 121.254.128.0 225.255.192.0 121.254.128.1 121.254.191.254 121.254.191.255
1019 121.254.192.0 225.255.192.0 121.254.192.1 121.254.255.254 121.254.255.255
1020 121.255.0.0 225.255.192.0 121.255.0.1 121.255.63.254 121.255.63.255
1021 121.255.64.0 225.255.192.0 121.255.64.1 121.255.127.254 121.255.127.255
1022 121.255.128.0 225.255.192.0 121.255.128.1 121.255.191.254 121.255.191.255
1023 121.255.192.0 225.255.192.0 121.255.192.1 121.255.255.254 121.255.255.255
- 64
Last subnet has the same value in the mixed octet as does the mask
32
Subnetting across octet boundaries
A closer look at the transition from subnet 3 to subnet 4 Subnet 3: 01111001.00000000.11000000.00000000 Subnet 4: 01111001.00000001.00000000.00000000
A closer look at the transition from subnet 1019 to subnet 1020 Subnet 1019:
01111001.11111110.11000000.00000000 Subnet 1020:
01111001.11111111.00000000.00000000
33
Summary
# of Possible Subnets = 2Number of subnet bits
# of Possible Hosts = 2Number of host bits
# of Usable Hosts = (2Number of host bits) – 2 # of RIP v1 Usable Subnets = (2Number of subnet bits) – 2 Magic Number – used in octet with both
subnet and host bits. Right most subnet bit value 256 – subnet mask
Last possible subnet = mask of mixed octet
34
HAPPY SUBNETTING!HAPPY SUBNETTING!