37
Subnetting & Supernetting Marc Khayat, Technical Advocacy Team [email protected] October 2011

Sub Netting and Super Netting

Embed Size (px)

Citation preview

Page 1: Sub Netting and Super Netting

Subnetting & Supernetting

Marc Khayat, Technical Advocacy Team

[email protected]

October 2011

Page 2: Sub Netting and Super Netting

© 2011 Cisco and/or its affiliates. All rights reserved. 2 All webinars are available at http://lms.netacad.net/course/view.php?id=1201

Page 3: Sub Netting and Super Netting

© 2011 Cisco and/or its affiliates. All rights reserved. 3 All webinars are available at http://lms.netacad.net/course/view.php?id=1201

Part I - Subnetting

Page 4: Sub Netting and Super Netting

© 2011 Cisco and/or its affiliates. All rights reserved. 4 All webinars are available at http://lms.netacad.net/course/view.php?id=1201

• Number of required subnets

• Number of required hosts per subnet

Page 5: Sub Netting and Super Netting

© 2011 Cisco and/or its affiliates. All rights reserved. 5 All webinars are available at http://lms.netacad.net/course/view.php?id=1201

Page 6: Sub Netting and Super Netting

© 2011 Cisco and/or its affiliates. All rights reserved. 6 All webinars are available at http://lms.netacad.net/course/view.php?id=1201

• Using the numerical calculations

• Using the graphical representation

Page 7: Sub Netting and Super Netting

© 2011 Cisco and/or its affiliates. All rights reserved. 7 All webinars are available at http://lms.netacad.net/course/view.php?id=1201

• Network size is the number of IP addresses in a subnet, including the network ID and the broadcast address

• Magic nb is the same as the network size if prefix > /24

• Magic nb must always be between 1 and 255. If greater than 255, divide by 256. If smaller than 1, multiply by 256.

• Every time you divide by 256, you move 1 octet to the left

• Every time you multiply by 256, you move 1 octet to the right

• Everything is a multiple of the magic nb (therefore, the name )

• Don’t bother googling the term “magic nb”

Numerical Calculations

Page 8: Sub Netting and Super Netting

© 2011 Cisco and/or its affiliates. All rights reserved. 8 All webinars are available at http://lms.netacad.net/course/view.php?id=1201

• Nb of required subnets should be an exponential multiple of 2 (so, 2, 4, 8, 16, 32, etc.). If not, then round up.

• To get the magic nb, few easy steps:

1. Identify the first non-255 number in the mask

2. Subtract that number from 256

3. Divide the outcome by the number of required subnets

4. That’s your magic nb!

Numerical Calculations

Page 9: Sub Netting and Super Netting

© 2011 Cisco and/or its affiliates. All rights reserved. 9 All webinars are available at http://lms.netacad.net/course/view.php?id=1201

• Required number of subnets 5 (should be really looking at 8)

• Mask: (/24) 255.255.255.0

First non-255 number is 0

256 – 0 = 256

256 / 8 = 32 (that’s the magic number)

• Mask: (/16) 255.255.0.0

First non-255 number is 0

256 – 0 = 256

256 / 8 = 32 (that’s the magic number)

• Mask: (/20) 255.255.240.0

First non-255 number is 240

256 – 240 = 16

16 / 8 = 2 (that’s the magic number)

Numerical Calculations

On the 4th octet

On the 3rd octet

On the 3rd octet

Page 10: Sub Netting and Super Netting

© 2011 Cisco and/or its affiliates. All rights reserved. 10 All webinars are available at http://lms.netacad.net/course/view.php?id=1201

• Required number of subnets 12 (should be really looking at 16)

• Mask: (/25) 255.255.255.128

First non-255 number is 128

256 – 128 = 128

128 / 16 = 8 (that’s the magic number)

• Mask: (/20) 255.255.240.0

First non-255 number is 240

256 – 240 = 16

16 / 16 = 1 (that’s the magic number)

• Mask: (/21) 255.255.248.0

First non-255 number is 248

256 – 248 = 8

8 / 16 = 0.5 * 256 = 128 (that’s the magic number)

Numerical Calculations

On the 4th octet

On the 3rd octet

Started on the 3rd but moved to the 4th octet

Page 11: Sub Netting and Super Netting

© 2011 Cisco and/or its affiliates. All rights reserved. 11 All webinars are available at http://lms.netacad.net/course/view.php?id=1201

• Simply add the magic nb to the initial network. Example: subnetting 192.168.252.0 255.255.252.0 (/22) into 2, 4 or 8 subnets:

Numerical Calculations

2 Subnets 4 Subnets 8 Subnets

Magic Nb =

(256-252)/2 = 2

Magic Nb =

(256-252)/4 = 1

Magic Nb =

(256-252)/8 = 128

(multiplied by 256)

192.168.252.0 192.168.252.0 192.168.252.0

192.168.254.0 192.168.253.0 192.168.252.128

192.168.254.0 192.168.253.0

192.168.255.0 192.168.253.128

192.168.254.0

192.168.254.128

192.168.255.0

192.168.255.128

Page 12: Sub Netting and Super Netting

© 2011 Cisco and/or its affiliates. All rights reserved. 12 All webinars are available at http://lms.netacad.net/course/view.php?id=1201

• Subtract the magic number from 256. So to continue with the previous example of subnetting 192.168.252.0/22:

Numerical Calculations

2 Subnets 4 Subnets 8 Subnets

Magic Nb = 2 (3rd octet) Magic Nb = 1 (3rd octet) Magic Nb = 128 (4th octet)

256 – 2 = 254 256 – 1 = 255 256 – 128 = 128

255.255.254.0 (/23) 255.255.255.0 (/24) 255.255.255.128 (/25)

Page 13: Sub Netting and Super Netting

© 2011 Cisco and/or its affiliates. All rights reserved. 13 All webinars are available at http://lms.netacad.net/course/view.php?id=1201

• With a subnet mask of 255.255.255.224, all network IDs would be a multiple of (256 – 224 = 32), 4th octet, so x.x.x.0, .32, .64, …, .224

• With a subnet mask of 255.255.128.0, all network IDs would be a multiple of (256 – 128 = 128), 3rd octet, so x.x.0.0, .128.0

Numerical Calculations

Page 14: Sub Netting and Super Netting

© 2011 Cisco and/or its affiliates. All rights reserved. 14 All webinars are available at http://lms.netacad.net/course/view.php?id=1201

• Subnet 192.168.16.0/20 into networks of 4 subnets

• /20 => 255.255.240.0 => 256 – 240 = 16

• 16 / 4 = 4 (magic number, on the 3rd octet)

• Networks are: 192.168.16.0, 192.168.20.0, 192.168.24.0,192.168.28.0

• Mask is 256 – 4 = 252 => 255.255.252.0 or /22

Numerical Calculations

Page 15: Sub Netting and Super Netting

© 2011 Cisco and/or its affiliates. All rights reserved. 15 All webinars are available at http://lms.netacad.net/course/view.php?id=1201

• 1st and foremost: add the 2 IPs of network ID and broadcast address

• Look for the closest exponentional multiple of 2

• That’s your network size.

• Continue as previously explained.

Numerical Calculations

Page 16: Sub Netting and Super Netting

© 2011 Cisco and/or its affiliates. All rights reserved. 16 All webinars are available at http://lms.netacad.net/course/view.php?id=1201

• Subnet 192.168.16.0/20 into networks of 700 hosts per subnet

• 700 => 702 => 1024 (network size)

• 1024 / 256 = 4 (magic number, on the 3rd octet)

• Networks are: 192.168.16.0, 192.168.20.0, 192.168.24.0,192.168.28.0

• Mask is 256 – 4 = 252 => 255.255.252.0 or /22

Numerical Calculations

Page 17: Sub Netting and Super Netting

© 2011 Cisco and/or its affiliates. All rights reserved. 17 All webinars are available at http://lms.netacad.net/course/view.php?id=1201

• 123.45.164.255/22: network, broadcast or valid host? If broadcast or valid host address, what is the network address?

Answer: valid host, network address is 123.45.164.0/22

• 100.198.7.64/18: network, broadcast or valid host? If broadcast or valid host address, what is the network address?

Answer: valid host, network address is 100.198.0.0/18

• Hint: from prefix, get mask, then get magic number, then see the closest multiple of that number and match it to the appropriate value in the address provided above.

Numerical Calculations

Page 18: Sub Netting and Super Netting

© 2011 Cisco and/or its affiliates. All rights reserved. 18 All webinars are available at http://lms.netacad.net/course/view.php?id=1201

• It gets a little bit confusing when it is requested to subnet a network into several subnets, each with a different size.

• So, let’s start with an example!

• VLSM = Variable Length Subnet Mask

Numerical Calculations

Page 19: Sub Netting and Super Netting

© 2011 Cisco and/or its affiliates. All rights reserved. 19 All webinars are available at http://lms.netacad.net/course/view.php?id=1201

• 192.168.1.0/24 to be subnetted into A (100 hosts), B (40 hosts), C (10 hosts), D (2 hosts).

• Remember to always start with the largest network first!

Numerical Calculations

Subnet Nb of

Hosts

Net

Size

Magic

Nb

Mask

(4th octet)

Prefix Subnet address

A 100 128 128 256-128=128 /25 192.168.1.0

B 40 64 64 256-64=192 /26 192.168.1.(0+128=128)

C 10 16 16 256-16=240 /28 192.168.1.(128+64=192)

D 2 4 4 256-4=252 /30 192.168.1.(192+16=208)

Page 20: Sub Netting and Super Netting

© 2011 Cisco and/or its affiliates. All rights reserved. 20 All webinars are available at http://lms.netacad.net/course/view.php?id=1201

• For subnet A, start from the initial network address (192.168.1.0). The next network would be a multiple of the magic nb, as explained before. So, 192.168.1.128. Remember that we’re working on the 4th octet;

• For subnet B, the address is 192.168.1.128. The next network would be a multiple of the magic nb, so we add 64 to 128. So, the next network is: 192.168.1.192.

• For subnet C, address is 192.168.1.192. For the next network, we add the magic nb (16) to the current address, so 192.168.1.208.

• For subnet D, address is 192.168.1.208.

• The next network and all remaining addresses are free

(192.168.1.212 192.168.1.255)

Numerical Calculations

Page 21: Sub Netting and Super Netting

© 2011 Cisco and/or its affiliates. All rights reserved. 21 All webinars are available at http://lms.netacad.net/course/view.php?id=1201

• 192.168.160.0/19 to be subnetted into A (2000 hosts), B (500 hosts), C (100 hosts), D (4 hosts).

• Free addresses: 192.168.170.(128+8) 192.168.191.255.

Numerical Calculations

Subnet Nb of

Hosts

Net

Size

Magic Nb Mask Prefix Subnet address

A 2000 2048 2048/256=8 256-8=248

(3rd octet)

/21 192.168.160.0

B 500 512 512/256=2 256-2=254

(3rd octet)

/23 192.168.(160+8=168).0

C 100 128 128 256-128=128

(4th octet)

/25 192.168.(168+2=170).0

D 4 8 8 256-8=248

(4th octet)

/29 192.168.170.(0+128)

Page 22: Sub Netting and Super Netting

© 2011 Cisco and/or its affiliates. All rights reserved. 22 All webinars are available at http://lms.netacad.net/course/view.php?id=1201

Numerical Calculations – section end

Questions?

Page 23: Sub Netting and Super Netting

© 2011 Cisco and/or its affiliates. All rights reserved. 23 All webinars are available at http://lms.netacad.net/course/view.php?id=1201

• Graphically map addresses of an octet

• Very easy to operate within one octet

• Rule of thumb: always divide in half

• Will ensure that you won’t waste/forget networks

Graphical Representation

• Identify your magic numbers (already know how to do it) Step 1 • Segment and reserve networks on the bar graph starting

with the largest network first. Step 2

• You’re done! Step 3

Page 24: Sub Netting and Super Netting

© 2011 Cisco and/or its affiliates. All rights reserved. 24 All webinars are available at http://lms.netacad.net/course/view.php?id=1201

• The bargraph shows a complete octet (from 0 till 255), so 256 values

• You are only allowed to split a segment in half

• Golden rule still applies: always start with the largest network first

• Choose the subnet locations according to the requirements

Graphical Representation

128

64

32

16

8

4

0

256

Page 25: Sub Netting and Super Netting

© 2011 Cisco and/or its affiliates. All rights reserved. 25 All webinars are available at http://lms.netacad.net/course/view.php?id=1201

• Subnet 192.168.10.0/24 into:

A (100 hosts), B (20 hosts), C (10 hosts)

All on the 4th octet.

Graphical Representation

A (128)

B (32)

C (16)

FREE

Addresses

Width of 128

Width of 64

Width of 32

Width of 16

Subnet Magic Nb Subnet ID

A 128 192.168.10.0 /25

B 32 192.168.10.128 /27

C 16 192.168.10.160 /28

FREE 192.168.10.176

192.168.10.255

Subnet Magic Nb

A 128

B 32

C 16

Width of 256

This represents the 4th octet

0

128

160

176

255

Page 26: Sub Netting and Super Netting

© 2011 Cisco and/or its affiliates. All rights reserved. 26 All webinars are available at http://lms.netacad.net/course/view.php?id=1201

Graphical Representation – section end

Questions?

Page 27: Sub Netting and Super Netting

© 2011 Cisco and/or its affiliates. All rights reserved. 27 All webinars are available at http://lms.netacad.net/course/view.php?id=1201

Part II - Supernetting

Page 28: Sub Netting and Super Netting

© 2011 Cisco and/or its affiliates. All rights reserved. 28 All webinars are available at http://lms.netacad.net/course/view.php?id=1201

Page 29: Sub Netting and Super Netting

© 2011 Cisco and/or its affiliates. All rights reserved. 29 All webinars are available at http://lms.netacad.net/course/view.php?id=1201

• Using the numerical calculations

• Using the graphical representation

• Actually, these are the reverse methods of those of subnetting.

Page 30: Sub Netting and Super Netting

© 2011 Cisco and/or its affiliates. All rights reserved. 30 All webinars are available at http://lms.netacad.net/course/view.php?id=1201

• Look for the number that encompasses all subnets

• Must be an exponential multiple of 2 (so, 2, 4, 8, 16, 32, etc.)

• Has to start from a multiple of that number. If not, then round up.

• To get the mask, deduct this number from 256 on the appropriate octet.

Numerical Calculations

Page 31: Sub Netting and Super Netting

© 2011 Cisco and/or its affiliates. All rights reserved. 31 All webinars are available at http://lms.netacad.net/course/view.php?id=1201

• Networks: 192.168.1.0/24, 192.168.2.0/24, 192.168.3.0/24

• Number is 4, starts from 0, at 3rd octet. Supernet address is 192.168.0.0 255.255.252.0

• Networks: 192.168.23.0/24, 192.168.25.0/24, 192.168.27.0/24, 192.168.29.0/24

• Number is 16, starts from 16, at 3rd octet. Supernet address is 192.168.16.0 255.255.240.0

• Networks: 192.168.96.0/20, 192.168.112.0/21, 192.168.120.0/22, 192.168.124.0/23

• Number is 32, starts from 96, at 3rd octet. Supernet address is 192.168.96.0 255.255.224.0

Numerical Calculations

Page 32: Sub Netting and Super Netting

© 2011 Cisco and/or its affiliates. All rights reserved. 32 All webinars are available at http://lms.netacad.net/course/view.php?id=1201

Numerical Calculations – section end

Questions?

Page 33: Sub Netting and Super Netting

© 2011 Cisco and/or its affiliates. All rights reserved. 33 All webinars are available at http://lms.netacad.net/course/view.php?id=1201

• Very easy to operate within one octet

• Map subnets to the famous bar graph

• Stack networks onto each other, in order

• Supernet should be a number that:

• Is an exponential multiple of 2

• Has to start from a multiple of that number. If not, then round up.

Graphical Representation

128

64

32

16

8

4

0

256

Page 34: Sub Netting and Super Netting

© 2011 Cisco and/or its affiliates. All rights reserved. 34 All webinars are available at http://lms.netacad.net/course/view.php?id=1201

Graphical Representation

A (128)

B (32)

C (16)

FREE

Addresses

0

128

160

176

255

Subnet Net Size Subnet ID

A 128 192.168.10.0 /25

B 32 192.168.10.128 /27

C 16 192.168.10.160 /28

Supernet address: 192.168.10.0/24

192

Page 35: Sub Netting and Super Netting

© 2011 Cisco and/or its affiliates. All rights reserved. 35 All webinars are available at http://lms.netacad.net/course/view.php?id=1201

Graphical Representation

0

128

255

Subnet Net Size Subnet ID

A 1 192.168.10.0 /24

B 2 192.168.12.0 /23

C 1 192.168.14.0 /24

Supernet address: 192.168.8.0/21

64

32

0

16

8

10

12

16

11 A (1)

B (2)

C (1) 14

15

FREE

FREE

FREE

Page 36: Sub Netting and Super Netting

© 2011 Cisco and/or its affiliates. All rights reserved. 36 All webinars are available at http://lms.netacad.net/course/view.php?id=1201

Graphical Representation – section end

Questions?

Page 37: Sub Netting and Super Netting

Thank you.