�������� ����� �����
�������� ����� ����� 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
��� ���
��� ��� ��� ��� ��� ��� ��� ��� ������
������
�������� ����� ����� Page # 2 June 21, 2014
Example – IP Address
�������� ����� ����� Page # 3 June 21, 2014
Example – Broadcast Address
����� �
Example:
���� ��� ����� �� ��� ��������� �� ���������.
ďż˝.
20�.34.�4.12
 �.
23ďż˝.34.2.1
ďż˝.
114.34.2.ďż˝
ďż˝. 12ďż˝.14.ďż˝.ďż˝
�������� ����� ����� 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
�������� ����� ����� Page # 5 June 21, 2014
�������� ����� ����� Page # 6 June 21, 2014
�������� ����� ����� Page # 7 June 21, 2014
Subnetting Example
�������� ����� ����� 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 HExample:
��� ���� ��� ��������� �� �.�.�.�, ���� ������� �� ��������� �� �������. ���� ��� ���
�� �� �������
�� ������ # ��.
N S HExample:
��� ���� ��� ��������� �� ���.��.�.�, ��������� �� ������. ���� ���
�� �� ������� �� ������ # ���.
N S H�������� ����� ����� 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.
�������� ����� ����� 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
appendix00000000.0
00000000.1
00000001.0
00000001.1
00000010.0
…etc.
11111111.0
11111111.1
�������� ����� ����� 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.