• No results found

Basic Subnetting Algorithm

N/A
N/A
Protected

Academic year: 2021

Share "Basic Subnetting Algorithm"

Copied!
12
0
0

Loading.... (view fulltext now)

Full text

(1)

�������� ����� �����

�������� ����� ����� Page # 1Page # 1 June 21, 2014June 21, 2014

IP Addressing and Subnetting

IP Addressing and Subnetting

How

How to

to identify

identify a

a student

student in

in a

a university?

university?

How

How to

to identify

identify a

a PC

PC in

in a

a network?

network?

���������� ���������� �� �� ������� ������� (�������, (�������, ����)����) ���������� ���������� ������ ������ �������� ����� ����� # # ������� ������� # # ������� ������� �������������� �� ��������� �� ��������� ��� ���� �� �������� �������� ���������� ���/�� �������� ��� �����, ���� �� ��������� ��� ��������, ��� ���� �� �������� �������� ���������� ���/�� �������� ��� �����, ���� �� ��������� ��� ��������, �� ����� �������� �� ����� ��� ������� �� �����������. ������������ ��� ������� �� � ���/�� ������� ��� ������ �� ����� �������� �� ����� ��� ������� �� �����������. ������������ ��� ������� �� � ���/�� ������� ��� ������ ����� ����� ��� ���� ��� ���� ���� ��� � ������ �� ������������� �� �������. ���� ������� �� �������� �� �� ���. ���� ������� �� �������� �� �� ��� ���� ����������� �������. �� ��� ����� ����, ��� ��. �� ��� ����� ����, ��� �� ������� ��� ������� ��� ��� �������� �������   �� ������� ������� ������� �������   �� ���� ����������� ������� ��� �� ������� �� � �����������, �� ���� �� � ��� �� ������� �� � �����������, �� ���� �� � ������� �������������� ������� , �������  , ������� �� ��� �� ��� �� ������� ����� ��. ��� ���. ��� ����� ������ ���� ������ �������������� (���) ������� �� ��� ����������� �� � (���) ������� �� ��� ����������� �� � 48���� �������� �������48���� �������� �������. ���� ������� �� ������ ���� ��� ������� ���������. ���� ������� �� ������ ���� ��� ������� ��������� ���� (���) ��� ������ ������ ������ ��� ��� �� ��������. ��� ����������� �� ��� ������� �� ������� ��� ��� �������� ���� (���) ��� ������ ������ ������ ��� ��� �� ��������. ��� ����������� �� ��� ������� �� ������� ��� ��� �������� ��� ������� ����� ����� ������� �� ����� ������ �����������. ��� ������� ����� ����� ������� �� ����� ������ �����������. ������ �� ������� ������� ��� ����� ������ �� ������� ������� ��� ����� ������������������������������ ������� ������� ������� ������� ����� ��� ����� ��� ���� ����������� ������� �� �� ���������, �� �� ���������, �� ������� ������� ��. ���� ���. ���� ��� ����� ����� ������������ ����� ������� ��� ���� ������������. � ����� � ��� ���� ������������. � ����� � ������� ������� �� ��������� �� ��� ������� ������� �� ��������� �� ��� ����� 1����� 1 �� ��� �������. 12� �� �������� ��� �������� �������. ��� ����� ����� ����� �� ��� �������. 12� �� �������� ��� �������� �������. ��� ����� ����� ����� ������� ��� ������� �� ��� � ����� � ������� �������. ������� ��� ������� �� ��� � ����� � ������� �������. ������� ������ ���� ������� ������ ���� ��� ��� ������� ������ ����������� ������ ���� ���� ��� ������ ����, ������� 255, �� ���� ��� ����� � ���� �� ��� ����� � �������, ����� 1� ���� ���� ��� ������ ����, ������� 255, �� ���� ��� ����� � ���� �� ��� ����� � �������, ����� 1� ���� �� ��� ����� � ���������, ��� ����� 24 ���� �� ��� ����� � ���������. ��� ������� ������ ���� ����� ������� ��� ����� �� ��� ����� � ���������, ��� ����� 24 ���� �� ��� ����� � ���������. ��� ������� ������ ���� ����� ������� ��� ����� ��������� �� ��� ����������� ���� �� �� ���� ������� �� ������� ���. �� �� ������ �� ��������� ��� ������� ���� ��������� �� ��� ����������� ���� �� �� ���� ������� �� ������� ���. �� �� ������ �� ��������� ��� ������� ���� ������� ��������� ������ ������� �� ����� � ������� ��������� ������ ������� �� ����� � ������ ������ ���������� ������ ����.. ������� ��� ���� ������� ������� ��� ���� ������� ��� ������� �� ���� ������� �� ��� ������� ��� ������� �� ���� ������� �� ��� ������� ������ �� ��� ���� �� ��� ����������� �� ��� ���� �� ��� �����. �� �� �������, ��� ����� � ������� ��. �� �� �������, ��� ����� � ������� �� 11�.0.0.5 �� � ����� �� �������. ��� ������� �������, �� ����� � ����, ����� ��� ����� �� 11�, �� ��� ��� ����� ��� ��� ���� 11�.0.0.5 �� � ����� �� �������. ��� ������� �������, �� ����� � ����, ����� ��� ����� �� 11�, �� ��� ��� ����� ��� ��� ���� �������, �� ���� 24 ����, �� ��� ��� ����� �� ��� ����. �� ��� ���� ������� ���� ��� �����, �� ����� �� ��� ������� ������� �������, �� ���� 24 ����, �� ��� ��� ����� �� ��� ����. �� ��� ���� ������� ���� ��� �����, �� ����� �� ��� ������� ������� ������. �� ��� ���� ������� ���� ��� ����, �� ����� �� � ��������� ��� ��� ������� �������. ������. �� ��� ���� ������� ���� ��� ����, �� ����� �� � ��������� ��� ��� ������� �������. ��� ����� �� ��� ����� ������ ����� �� ��� ����� ��� ����� �� ������� ���� ������� 255 �� ������ 11111111 ����� �� ������� ���� ������� 255 �� ������ 11111111.. UIU

UIU UAPUAP

��� ���

��� ��� ��� ��� ��� ��� ��� ��� ������

������

(2)

�������� ����� ����� Page # 2 June 21, 2014

Example – IP Address

(3)

�������� ����� ����� Page # 3 June 21, 2014

Example – Broadcast Address

����� �

Example:

���� ��� ����� �� ��� ��������� �� ���������.

ďż˝.

20�.34.�4.12

 �.

23ďż˝.34.2.1

ďż˝.

114.34.2.ďż˝

ďż˝. 12ďż˝.14.ďż˝.ďż˝

(4)

�������� ����� ����� Page # 4 June 21, 2014

Example:

������� ��� ��������� ������� ���� ������� 201, �11, 1��.

Example:

������� ��� ��������� ������ ������� ���� �������� 11011101, 11110111, 10001100.

Example:

������ ��� ��������� �� ��������� ���� �������������� �������� �� ������ ��������.

ďż˝.

114.34.2.ďż˝

 �.

12ďż˝.14.ďż˝.ďż˝

ďż˝.

20�.34.�4.12

ďż˝. 23ďż˝.34.2.1

Example:

���� ��� ������� �� ��� ��� ���� �� �� ��� ��������� �� ���������

������� ��

���� ��

ďż˝.

114.34.2.ďż˝

 �.

132.��.�.�

ďż˝.

20�.34.�4.12

(5)

�������� ����� ����� Page # 5 June 21, 2014

(6)

�������� ����� ����� Page # 6 June 21, 2014

(7)

�������� ����� ����� Page # 7 June 21, 2014

Subnetting Example

(8)
(9)

�������� ����� ����� Page # 9 June 21, 2014

Example:

����� ��� ��������� ����� �� ����� �������� (/�).

ďż˝.

2��.2��.2��.0

 �.

2��.0.0.0

ďż˝.

2��.2��.224.0

�. 2��.2��.240.0

A Simple Algorithm for Subnetting

��������

������ �� ������� ���� ������ ���������� � �

������ �� ���� �������� ����������� ����� � �� ���

������ �� ���� ���� ��������� ����� ���������� � ��

����� � � � � � ���� �� ����� �� �� �����

��� ��� ������� ��� �� ���� �� ��� ��������� ����

�� ��� ���� �� ����

ďż˝

��

 ����� �� �������

 �� ���

ďż˝

��

 ������

 ����� ����������, ������ ���

����� ������

���� �� ����� ���� ��� ������� ���� �� ���

ďż˝

� �������� �����

ďż˝

 ����.

���� �� �������

���

 ���� ������ ��

������� � ����

 ��� ����� �� ���

�� ������� ������

 ����.

���� �� �������

���

 ���� ������ ��

������� � ����

 ��� ����� �� ���

�� ����� ������

 ����.

���� ��  ����� ��� ���� ���� ����� �� ����

������� �� � �����

  ��� ������� �� ���

�������

��������

 ������.

Example:

��� ���� ��� ��������� �� ���.��.��.�, ���� ������� �� ��������� �� ������. ���� ��� ��

��

��

������� �� ������ # �.

N S H

Example:

��� ���� ��� ��������� �� �.�.�.�, ���� ������� �� ��������� �� �������. ���� ��� ���

��

 �� �������

�� ������ # ��.

N S H

Example:

��� ���� ��� ��������� �� ���.��.�.�, ��������� �� ������. ���� ���

��

 �� ������� �� ������ # ���.

N S H

(10)

�������� ����� ����� Page # 10 June 21, 2014

From the table on the right; to

obtain 500 subnets.

We need to borrow 9 host bits

as subnet bits.

This will give us;

29 = 512

 subnets

(Remember you may end up

with unused subnets)

To determine the number of

usable hosts per subnet we

subtract the borrowed bits (9)

from the total number of host bits

(16) which gives us 7 remaining

host bits. Using the formulae

Hosts = 2

n

 – 2 = 2

7

 – 2 . From

the table 2

7

= 128. Thus usable

hosts = 128 – 2 =126

(Remember the first and last

addresses are for network and

broadcast, hence the minus 2 in

the formula)

A Step by Step Guide to Subnetting

Address

172.16.0.0/16

=

default subnet 255.255.0.0

ie

Class B

 address

 Network

Host

IP Address

10101100.00010000.00000000.00000000

Subnet Mask

11111111.11111111.00000000.00000000

You may be asked to supply

500 subnets

; using the formula Subnets = 2

n

, Where

n

 = no. of bits to borrow

Step 1

Step 2

Step 3

Mark the borrowed bits as subnet bits

 Network

Subnet

Host

IP Address

10101100.00010000.00000000.00000000

Subnet Mask

11111111.11111111.11111111.10000000

Step 4

Define the subnetted network;

Address

172.16.0.0/25

=

subnet mask

255.255.255.128 (custom Subnet Mask)

n 2n 0 1 1 2 2 4 3 8 4 16 5 32 6 64 7 128 8 256 9 512 10 1024 11 2048 12 4096 13 8192 14 16384 15 32768 16 65536

16 network bits

Remember the borrowed bits in the mask change

from 0 (zero) to 1 (one)

There are now 25 network bits.

(16 original + 9 borrowed)

The first 3 octets (24 bits) are network

bits, hence each octet = 255. The final

octet has only the MSB (Most Significant

Bit) as a network bit, hence 128.

(11)

�������� ����� ����� Page # 11 June 21, 2014

Step 5:

Calculate the subnet addresses and usable hosts for each subnet

 Network

Subnet

Host

IP Address

10101100.00010000.00000000.00000000

Mask

11111111.11111111.11111111.10000000

00000000.00000000

(zero subnet, may not be used)

First usable network 

Last usable network 

(one subnet, may not be used)

Thus first usable subnet (Subnet 1) = 10101100.00010000.00000000.10000000

=

172 . 16

.

0

.

128

the first usable host (Subnet 1) = 10101100.00010000.00000000.10000001

172 . 16

.

0

.

129

the last usable host (Subnet 1) = 10101100.00010000.00000000.11111110

172 .

16

.

0

.

254

the broadcast address (Subnet 1) = 10101100.00010000.00000000.11111111

172 .

16

.

0

.

255

Thus host range (Subnet 1) =

10101100.00010000.00000000.10000001

to 10101100.00010000.00000000.11111110

172 . 16

.

0

.

129

172 .

16

.

0

.

254

Thus 2nd usable subnet (Subnet 2) = 10101100.00010000.00000001.00000000

=

172 . 16

.

1

.

0

the first usable host (Subnet 2) = 10101100.00010000.00000001.00000001

172 . 16

.

1

.

1

the last usable host (Subnet 2) = 10101100.00010000.00000001.01111110

172 .

16

.

1

.

126

the broadcast address (Subnet 2) = 10101100.00010000.00000001.01111111

172 .

16

.

1

.

127

Thus host range (Subnet 2) =

10101100.00010000.00000001.00000001

to 10101100.00010000.00000001.01111110

172 . 16

.

1

.

1

172 .

16

.

1

.

126

the host range (Subnet 3) =

10101100.00010000.00000001.10000001

to 10101100.00010000.00000001.11111110

172 . 16

.

1

.

129

172 .

16

.

1

.

254

and the host range (Subnet 4) =

10101100.00010000.00000010.00000001

to 10101100.00010000.00000010.01111110

172 . 16

.

1

.

129

172 .

16

.

1

.

126

and so on………

We are only interested in this

part of the address when

calculating the subnets

For each subnet, the binary value

of the subnet bits will increment

by 1, so the first 5 subnets and

last 2 are; *See

appendix

00000000.0

00000000.1

00000001.0

00000001.1

00000010.0

…etc.

11111111.0

11111111.1

(12)

�������� ����� ����� Page # 12 June 21, 2014

 Appendix

IP Value 128 64 32 16 8 4 2 1 128 64 32 16 8 4 2 1 Subnet Number 256 128 64 32 16 8 4 2 1

Subnet 0( Not Used) 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Subnet 1 Address 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 Subnet 1 Host 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 Subnet 1 Host 126 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 0 Subnet 1 Broadcast 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 Subnet 2 Address 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 Subnet 2 Host 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 Subnet 2 Host 126 0 0 0 0 0 0 0 1 0 1 1 1 1 1 1 0 Subnet 2 Broadcast 0 0 0 0 0 0 0 1 0 1 1 1 1 1 1 1 Subnet 3 Address 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 Subnet 3 Host 1 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 1 Subnet 3 Host 126 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 Subnet 3 Broadcast 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 etc. Subnet 510 Address 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 Subnet 510 Host 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 1 Subnet 510 Host 126 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 0 Subnet 510 Broadcast 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 Subnet 511(Not Used) 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0

Note: Only the final two octets are shown for clarity.

Example:

�� ������������ �� ������� ��� ������� ����� ���.��.�.����. ��� ������������� ����� �� ������ ���

�������.

ďż˝.

���� ��� ������ ����.

 �.

���� ��� ������ �� ��������� �� ���� ������.

ďż˝.

���� ��� ����� ��� ���� ��������� �� ������ 1.

�. ���� ��� ����� ��� ���� ��������� �� ������ �12.

Example:

�� � ����� �� ���������, �� ���� ��� �� ������� �� ��� ���� �� ���.��.��.�����. ���� ��� ���

������� ������� ��� ��� ��������� ������� �� ���� ������

Example:

������� �������� 1�0.�0.0.0, ��� 2��.2��.2��.12�. ����� �� ��� ��������� ����� �� �� ������� ���

����

�� �������� ������ 170.60.25.1 170.60.26.127 170.60.40.13� 170.60.212.212 170.60.255.1�0 170.60.252.16 170.60.100.63

References

Related documents

The ethical issues raised by grateful patient fundraising are complex 1 " and can be subdivided into specific issues relating to conflicted decision making

In terms of associ- ations between adherence (higher scores) to various dietary patterns and having a high EFP (belonging to the top 20% of the population), the results of this

The method computes a WS function for each digit by an LUT cascade and a binary adder, then adds adjacent digits with q -nary adders.. A 16-bit binary to decimal converter is

This paper highlights the scenario of local hunting [as defined by 20] of prey species in Northern parts of Bardia National Park and the implications of this for carnivore

The optimal insulin delivery regimens for low-fat meals comprise a normal bolus or short square wave delivered at least 30 minutes prior to the meal, whereas the optimal regimens

Differential expression of an hsp70 gene during tran- sition from the mycelial to the infective yeast form of the human pathogenic fungus Paracoccidioides brasiliensis. Minchiotti

60 In a recent study of American high school students, Litwiller and Brausch 60 found that adolescents’ substance use and violent behavior partially mediated the

The Village of River Ranch: A Post Occupancy Evaluation of a The Village of River Ranch: A Post Occupancy Evaluation of a Traditional Neighborhood Development in Lafayette, Louisiana