Lab2 - subnetting

26
© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public ITE PC v4.0 Chapter 1 1 subnetting

Transcript of Lab2 - subnetting

Page 1: Lab2 - subnetting

© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

ITE PC v4.0

Chapter 1 1

subnetting

Page 2: Lab2 - subnetting

ITE PC v4.0

Chapter 1 2 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

IP Address Classes

IP addresses are divided into classes to define the large,

medium, and small networks. Class A addresses are assigned to larger networks.

Class B addresses are used for medium-sized networks,

Class C for small networks,

Class D for Multicasting

Class E for Experimental purposes

Page 3: Lab2 - subnetting

ITE PC v4.0

Chapter 1 3 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

Identifying Address Classes

Page 4: Lab2 - subnetting

ITE PC v4.0

Chapter 1 4 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

IP address types

• IP address could be one of three categories

Network address

Host address

Broadcast address

Page 5: Lab2 - subnetting

ITE PC v4.0

Chapter 1 5 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

Network / Broadcast Addresses

- Network address :

the first IP address in it which all host part bits = 0

- Broadcast address:

the last IP address in the network which all host part bits = 1

no. of host bits

- other addresses are host addresses = 2 - 2

-Here are some examples:

Class Network Address Broadcast Address

A 12.0.0.0 12.255.255.255

B 172.16.0.0 172.16.255.255

C 192.168.1.0 192.168.1.255

Page 6: Lab2 - subnetting

ITE PC v4.0

Chapter 1 6 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

Subnet Mask

- 32 bit mask ( 1’s followed by 0’s )

- Used by routers and hosts to determine the number of

network- significant bits ( identified by 1’s )

and host- significant bits in an IP address (identified by 0’s)

- example : Class Network Address Default subnet mask

A 12.0.0.0 255.0.0.0 or /8

B 172.16.0.0 255.255.0.0 or /16

C 192.168.0.0 255.255.255.0 or /24

Page 7: Lab2 - subnetting

ITE PC v4.0

Chapter 1 7 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

Octet Values of a Subnet Mask

• Subnet masks like IP addresses can be represented in the dotted decimal format like 255.255.255.0.

Page 8: Lab2 - subnetting

ITE PC v4.0

Chapter 1 8 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

Subnetting

- Subnetting a network means to use the subnet mask to divide the

network and break a large network up into smaller, more efficient and

manageable segments, or subnets.

- Subnetting is done by taking part of host bits then add it to

the network part

Network part Host part

Subnet

bits

Network part Host part

IP

address

Page 9: Lab2 - subnetting

ITE PC v4.0

Chapter 1 9 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

Subnetting Example

Divide network 192.168.1.0/24 into 4 subnets

Solution: 4 subnets need 2 bits

192.168.1 . 0

192.168.1 . 0000 0000 to 0011 1111

192.168.1 . 0100 0000 to 0111 1111

192.168.1 . 1000 0000 to 1011 1111

192.168.1 . 1100 0000 to 1111 1111

subnet mask is 255.255.255.192 or /26

The first subnet is 192.168.1.0/26

The second subnet is 192.168.1.64/26

The third subnet is 192.168.1.128/26

The fourth subnet is 192.168.1.192/26

0 - 63

64 - 127

128 - 191

192 - 255

Page 10: Lab2 - subnetting

ITE PC v4.0

Chapter 1 10 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

Divide network 192.168.1.0/24 into 4 subnets -

Solution :

4 subnets need 2 bits

- subnet mask = 255.255.255.192

- interesting octet is 192

- hop count = 256 – 192 = 64

- The first subnet is 192.168.1.0/26

- The second subnet is 192.168.1.64/26

- The third subnet is 192.168.1.128/26

- The fourth subnet is 192.168.1.192/26

Subnetting Example

0 - 63

64 - 127

128 - 191

192 - 255

Page 11: Lab2 - subnetting

ITE PC v4.0

Chapter 1 11 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

Divide network 172.16.0.0/16 into 8subnets

Solution :

- 8 subnets need 3 bits

- subnet mask = 255.255.224.0

- interesting octet is 224

- hop count = 256 – 224 = 32

- The first subnet is 172.16.0.0/19

- The second subnet is 172.16.32.0/19

- The third subnet is 172.16.64.0/19

-The 8th subnet is 172.16.224.0/19

Subnetting Example

172.16.0.1-172.16.31.254

172.16.32.1 -172.16.63.254

172.16.64.1-172.16. 95.254

172.16.224.1-172.16.255.254

Page 12: Lab2 - subnetting

ITE PC v4.0

Chapter 1 12 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

Divide network 10.0.0.0/10 into 4subnets

Solution :

- 4subnets need 2 bits

- subnet mask = 255.240.0. 0

- interesting octet is 240

- hop count = 256 – 240= 16

- The first subnet is 10.0.0.0/12

- The second subnet is 10.16.0.0/12

- The third subnet is 10.32.0.0/12

- The fourth subnet is 10.48.0.0/12

Subnetting Example

10.0.0.1-10.15.255.254

10.16.0.1-10.31.255.254

10.32.0.1-10.47.255.254

10.48.0.1-10.63.255.254

Page 13: Lab2 - subnetting

ITE PC v4.0

Chapter 1 13 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

How Many Networks

Page 14: Lab2 - subnetting

ITE PC v4.0

Chapter 1 14 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

Given the Class C network of 204.15.5.0/24, subnet the network in order to create the network in the figure below, with the host requirements shown

Page 15: Lab2 - subnetting

ITE PC v4.0

Chapter 1 15 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

Calculating Addresses without VLSM

Looking at the network shown, you can see that you are required to create five subnets.

The largest subnet must support 28 host addresses.

You can start by looking at the subnet requirement.

In order to create the 5 needed subnets you would need to use 3 bits from the Class C host bits.

Two bits would only allow you four subnets (22).

How many hosts will this support? 25 = 32 (30 usable).

This meets the requirement

Page 16: Lab2 - subnetting

ITE PC v4.0

Chapter 1 16 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

Calculating Addresses without VLSM

Subnet Mask = 255. 255. 255. 224 /27

Interesting Octet is 224

Hope Count = 256-224 = 32

Subnet A: 204.15.5.0/27 host address range 1 to 30

Subnet B: 204.15.5.32/27 host address range 33 to 62

Subnet C: 204.15.5.64/27 host address range 65 to 94

Subnet D: 204.15.5.96/27 host address range 97 to 126

Subnet E: 204.15.5.128/27 host address range 129 to 158

Page 17: Lab2 - subnetting

ITE PC v4.0

Chapter 1 17 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

Waste of IP Addresses ?

Subnet A: 204.15.5.0/27 host address range 1 to 30

Only 14 Addresses Used

Subnet B: 204.15.5.32/27 host address range 33 to 62

Only 28 Addresses Used.

Subnet C: 204.15.5.64/27 host address range 65 to 94

Only 2 Addresses Used

Subnet D: 204.15.5.96/27 host address range 97 to 126

Only 7 Addresses Used

Subnet E: 204.15.5.128/27 host address range 129 to 158

Only 28 Addresses Used

Page 18: Lab2 - subnetting

ITE PC v4.0

Chapter 1 18 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

In many cases, having the same subnet mask for all subnets ends up wasting address space.

Solution ?

Using Variable Length Subnet Masks (VLSM)

VLSM allows you to use different masks for each subnet, thereby using address space efficiently

How ?

The easiest way to assign the subnets is to assign the largest first and work your way down.

In our case:

Proceed in the following order: Network B, E, A, D, C

Page 19: Lab2 - subnetting

ITE PC v4.0

Chapter 1 19 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

Subnet B: requires a /27 (255.255.255.224) mask to support 28 hosts

We have calculated that before:

Subnet B: 204.15.5.0/27 host address range 1 to 30

Subnet E: requires a /27 (255.255.255.224) mask to support 28 hosts

We have also calculated that before:

Subnet E: 204.15.5.32/27 host address range 33 to 62

Calculating Addresses with VLSM

Page 20: Lab2 - subnetting

ITE PC v4.0

Chapter 1 20 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

Subnet A: Needs 14 Hosts

Take one of the subnets from the last subnetting procedure (other than the ones given to B and E.

Example: 204.15.5.64/27 (Apply Subnetting on this one)

To support 14 hosts (at least 4 bits are needed for the hosts)

Subnet Mask = 255. 255.255.240 /28

Interesting Octet = 240 Hop Count = 256 – 240 = 16

Number of Subnets = 2 ^ 1 = 2

204.15.5.64/28 -> Host address range 65 to 78 (Assign that to Subnet A)

204.15.5.80/28 -> Host Address Range 81 to 95

Calculating Addresses with VLSM

Page 21: Lab2 - subnetting

ITE PC v4.0

Chapter 1 21 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

Subnet D: Needs 7 Hosts

Take one of the subnets from the last subnetting procedure (other than the ones given to A and D

Example: 204.15.5.80/28 (Apply Subnetting on this one)

To support 7 hosts (at least 4 bits are needed for the hosts, 3 bits has only 6 valid hosts)

Hence no need for any more subnetting

204.15.5.80/28 -> Host Address Range 81 to 94

Calculating Addresses with VLSM

Page 22: Lab2 - subnetting

ITE PC v4.0

Chapter 1 22 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

Subnet C: Needs 2 Hosts

Take one of the subnets from the last procedure (other than the ones given to A

Example: 204.15.5.96/28 (Apply Subnetting on this one)

To support 2 hosts (at least 2 bits are needed for the hosts)

Subnet Mask = 255. 255.255.252 /30

Interesting Octet = 252 Hop Count = 256 – 252 = 4

Number of Subnets = 2 ^ 2 = 4

204.15.5.96/30 -> Host address range 97 to 98 (Assign that to Subnet C)

204.15.5.100/30 -> Host Address Range 101 to 102

Calculating Addresses with VLSM

Page 23: Lab2 - subnetting

ITE PC v4.0

Chapter 1 23 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

Finally:

Subnet B: 204.15.5.0/27 host address range 1 to 30

Subnet E: 204.15.5.32/27 host address range 33 to 62

Subnet A 204.15.5.64/28 host address range 65 to 78

Subnet D 204.15.5.80/28 host address range 81 to 94

Subnet C 204.15.5.96/30 host address range 97 to 98

Calculating Addresses with VLSM

Page 24: Lab2 - subnetting

ITE PC v4.0

Chapter 1 24 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

Calculating Addresses: Case 2

Page 25: Lab2 - subnetting

ITE PC v4.0

Chapter 1 25 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

Calculating Addresses: Case 2

Page 26: Lab2 - subnetting

ITE PC v4.0

Chapter 1 26 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public

Calculating Addresses: Case 2

Calculate the address ranges for sub networks