sub netting

3
Subnetting If you are solving a subnetting problem involving same size subnets, the problem can be presented in one of two different ways. Either you are creating a minimum number of subnets (thereby maximizing the number of hosts per subnet) or you need a minimum number of hosts per subnet (thereby maximizing the number of subnets). Either way, you are trying to figure out how many bits to borrow from the host portion of the IP address in order to create subnets. Remember, an IP address is divided into a network portion followed by a host portion. The “dividing line” is defined by the subnet mask. The subnet mask begins with 1’s and ends with 0’s. The number of 1’s in the subnet mask defines the number of bits in the network portion of the IP address. The number of bits in the network portion can be indicated with a shorthand notation (slash notation) in the form of /n where n is the number of bits in the network portion. For example, an IP address of 192.168.1.0 where the first three octets (24 bits) is the network portion and the last octet (8 bits) is the host portion can be written as 192.168.1.0/24 or 192.168.1.0 with a subnet mask of 255.255.255.0. You can never change the network portion of an IP address. This is the network number that has been assigned to you and any change might overlap with a network number assigned to someone else. You can do anything you want with the host portion of the address. In order to create subnets, you borrow bits from the host portion and thereby decrease the number of bits available for host addresses. When you do this, you have to increase the number of 1’s in the subnet mask by the number of bits borrowed in order to indicate that the “dividing line” is farther to the right. The number of subnets created is defined by the number of unique combinations (values) of the borrowed bits. This can be computed by the formula 2 n where n is the number of bits borrowed. So if I borrow 3 bits, I can have a total of 8 subnets (2 3 = 2x2x2 = 8. The unique combinations of the borrowed bits are: 000 001 010 011 100 101 110 111 If I started out with 8 host bits and borrowed 3, I have 5 host bits remaining. There is a restriction on the host bit values that can be used for IP addresses in that they cannot be all 0’s (that is the subnet ID) and they cannot be all 1’s (that is the broadcast address for that subnet). So the formula for the number of valid host addresses is 2 n 2. In this case, n is 5 so 2 5 = 2x2x2x2x2 = 32. 2 5 2 = 32 2 = 30. To indicate there are

Upload: lan-wan

Post on 01-Nov-2014

91 views

Category:

Documents


9 download

DESCRIPTION

Sub Netting

TRANSCRIPT

Page 1: Sub Netting

Subnetting

If you are solving a subnetting problem involving same size subnets, the problem

can be presented in one of two different ways. Either you are creating a minimum

number of subnets (thereby maximizing the number of hosts per subnet) or you need a

minimum number of hosts per subnet (thereby maximizing the number of subnets).

Either way, you are trying to figure out how many bits to borrow from the host portion of

the IP address in order to create subnets.

Remember, an IP address is divided into a network portion followed by a host

portion. The “dividing line” is defined by the subnet mask. The subnet mask begins with

1’s and ends with 0’s. The number of 1’s in the subnet mask defines the number of bits

in the network portion of the IP address. The number of bits in the network portion can

be indicated with a shorthand notation (slash notation) in the form of /n where n is the

number of bits in the network portion. For example, an IP address of 192.168.1.0 where

the first three octets (24 bits) is the network portion and the last octet (8 bits) is the host

portion can be written as 192.168.1.0/24 or 192.168.1.0 with a subnet mask of

255.255.255.0.

You can never change the network portion of an IP address. This is the network

number that has been assigned to you and any change might overlap with a network

number assigned to someone else. You can do anything you want with the host portion

of the address. In order to create subnets, you borrow bits from the host portion and

thereby decrease the number of bits available for host addresses. When you do this, you

have to increase the number of 1’s in the subnet mask by the number of bits borrowed in

order to indicate that the “dividing line” is farther to the right.

The number of subnets created is defined by the number of unique combinations

(values) of the borrowed bits. This can be computed by the formula 2n where n is the

number of bits borrowed. So if I borrow 3 bits, I can have a total of 8 subnets (23 =

2x2x2 = 8. The unique combinations of the borrowed bits are:

000

001

010

011

100

101

110

111

If I started out with 8 host bits and borrowed 3, I have 5 host bits remaining.

There is a restriction on the host bit values that can be used for IP addresses in that they

cannot be all 0’s (that is the subnet ID) and they cannot be all 1’s (that is the broadcast

address for that subnet). So the formula for the number of valid host addresses is 2n – 2.

In this case, n is 5 so 25 = 2x2x2x2x2 = 32. 2

5 – 2 = 32 – 2 = 30. To indicate there are

Page 2: Sub Netting

three more bits in the network portion, the subnet mask has to be changed so the last octet

is 11100000, i.e. 255.255.255.224 (or /27).

The subnet ID, host addresses, and subnet broadcast address are derived by

writing the subnet portion and host portion together in binary and then converting to

decimal. If we are given a network address of 192.168.1.0/24 and borrow three bits to

create subnets, the first subnet is defined as (only writing the last octet in binary):

00000000 192.168.1.0/27 subnet ID

00000001 192.168.1.1/27 valid host address

00000010 192.168.1.2/27 valid host address

00000011 192.168.1.3/27 valid host address

00000100 192.168.1.4/27 valid host address

00000101 192.168.1.5/27 valid host address

00000110 192.168.1.6/27 valid host address

00000111 192.168.1.7/27 valid host address

00001000 192.168.1.8/27 valid host address

00001001 192.168.1.9/27 valid host address

00001010 192.168.1.10/27 valid host address

00001011 192.168.1.11/27 valid host address

00001100 192.168.1.12/27 valid host address

00001101 192.168.1.13/27 valid host address

00001110 192.168.1.14/27 valid host address

00001111 192.168.1.15/27 valid host address

00010000 192.168.1.16/27 valid host address

00010001 192.168.1.17/27 valid host address

00010010 192.168.1.18/27 valid host address

00010011 192.168.1.19/27 valid host address

00010100 192.168.1.20/27 valid host address

00010101 192.168.1.21/27 valid host address

00010110 192.168.1.22/27 valid host address

00010111 192.168.1.23/27 valid host address

00011000 192.168.1.24/27 valid host address

00011001 192.168.1.25/27 valid host address

00011010 192.168.1.26/27 valid host address

00011011 192.168.1.27/27 valid host address

00011100 192.168.1.28/27 valid host address

00011101 192.168.1.29/27 valid host address

00011110 192.168.1.30/27 valid host address

00011111 192.168.1.31/27 subnet broadcast address

The second subnet is defined by changing the subnet ID (the first three bits) from 000 to

001 and then converting to decimal (only writing the last octet in binary):

Page 3: Sub Netting

00100000 192.168.1.32/27 subnet ID

00100001 192.168.1.33/27 valid host address

00100010 192.168.1.34/27 valid host address

00100011 192.168.1.35/27 valid host address

00100100 192.168.1.36/27 valid host address

00100101 192.168.1.37/27 valid host address

00100110 192.168.1.38/27 valid host address

00100111 192.168.1.39/27 valid host address

00101000 192.168.1.40/27 valid host address

00101001 192.168.1.41/27 valid host address

00101010 192.168.1.42/27 valid host address

00101011 192.168.1.43/27 valid host address

00101100 192.168.1.44/27 valid host address

00101101 192.168.1.45/27 valid host address

00101110 192.168.1.46/27 valid host address

00101111 192.168.1.47/27 valid host address

00110000 192.168.1.48/27 valid host address

00110001 192.168.1.49/27 valid host address

00110010 192.168.1.50/27 valid host address

00110011 192.168.1.51/27 valid host address

00110100 192.168.1.52/27 valid host address

00110101 192.168.1.53/27 valid host address

00110110 192.168.1.54/27 valid host address

00110111 192.168.1.55/27 valid host address

00111000 192.168.1.56/27 valid host address

00111001 192.168.1.57/27 valid host address

00111010 192.168.1.58/27 valid host address

00111011 192.168.1.59/27 valid host address

00111100 192.168.1.60/27 valid host address

00111101 192.168.1.61/27 valid host address

00111110 192.168.1.62/27 valid host address

00111111 192.168.1.63/27 subnet broadcast address

The remaining 6 subnets are derived in the same way.

So if the problem is to create a minimum number of subnets, you figure out how

many bits you have to borrow using the formula 2n. If the problem is to create subnets

with a minimum number of hosts per subnet, you figure out how many bits you have to

have left in the host portion using the formula 2n – 2. You then subtract this number

from the number of host bits you started with to determine the number of bits you borrow

for subnetting.