Lecture-9 Subnetting Calculation
Lecture-9 Subnetting Calculation
Logical Operator
A logical operator is a symbol or word used to connect two or more
expressions to produce another compound value.
The value of the compound value depends only on that of the original
expressions and on the meaning of the operator.
To get the output result as TRUE through AND operation, both the input values
must be TRUE
To get the output result as ‘1’, all input values must be ‘1’. If any of the input
value is a zero, the result output will be zero.
Input-1 0 1 1 0
Input-2 1 1 0 0
Output after AND Operation 0 1 0 0
Calculation of Network ID
(From AND Operation)
194.105.89.90 1 1 0 0 0 0 1 0 0 1 1 0 1 0 0 1 0 1 0 1 1 0 0 1 0 1 0 1 1 0 1 0
255.255.255.248 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0
After AND Operation: 1 1 0 0 0 0 1 0 0 1 1 0 1 0 0 1 0 1 0 1 1 0 0 1 0 1 0 1 1 0 0 0
Decimal Value after AND 194. 105. 89. 88
(we get the Net ID)
192.168.20.100 255.255.255.128
192.168.20.100 1 1 0 0 0 0 0 0 1 0 1 0 1 0 0 0 0 0 0 1 0 1 0 0 0 1 1 0 0 1 0 0
255.255.255.128 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0
AND Operation 1 1 0 0 0 0 0 0 1 0 1 0 1 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0
Network ID : 192.168.20.0
Calculation of Network ID
(From AND Operation)
200.100.50.100 / 28
200.100.50.100 255.255.255.240
128 64 32 16 8 4 2 1
1 1 1 1 1 1 1 1
200.100.50.100 1 1 0 0 1 0 0 0 0 1 1 0 0 1 0 0 0 0 1 1 0 0 1 0 0 1 1 0 0 1 0 0
255.255.255.240 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0
AND Operation 1 1 0 0 1 0 0 0 0 1 1 0 0 1 0 0 0 0 1 1 0 0 1 0 0 1 1 0 0 0 0 0
Net ID: 200. 100. 50. 96
Calculation of Network ID
(From AND Operation)
Instead of ANDING everything, we are ANDING only the last OCTET of IP and Subnet
128 64 32 16 8 4 2 1
212.50.35.50/28 1 1 1 1 1 1 1 1
212.50.35.50 255.255.255.240
50= 0 0 1 1 0 0 1 0
240= 1 1 1 1 0 0 0 0
0 0 1 1 0 0 0 0 = 48 (after AND)
48
120= 0 1 1 1 1 0 0 0
224= 1 1 1 0 0 0 0 0
0 1 1 0 0 0 0 0 =96
= 96
212.50.35.150/25 1 1 1 1 1 1 1 1
1 0 0 0 0 0 0 0
212.50.35.150 255.255.255.128
1 0 0 1 0 1 1 0
1 0 0 0 0 0 0 0
1 0 0 0 0 0 0 0
0
Calculation of Network ID
(From AND Operation)
128 64 32 16 8 4 2 1
1 1 1 1 1 1 1 1
200.100.50.50/27 = 200.100.50.32
200.50.60.70/28 = 200.50.60.64
200.50.70.150/29 = 200.50.70.144
Values We Need To Work With Network Design
1. We need the Network ID
5. We need the first available IP address & last IP address of every network.
2. Then we deduct the value of the last octet of the Subnet Mask from the
Magic Number.
3. For example, if the Subnet Mask is with CIDR value/26, that means
255.255.255.192, then the Subnet Size is = 256-192 = 64 (number of
possible IP addresses)
Calculation of Subnet Size
Calculation of Subnet Size (number of possible IP addresses):
Deduct the last value of subnet mask from the Magic Number. In that way we
get the Subnet Size. (Here it is: 256-240=16)
Number of subnet is obtained by dividing the magic number by the subnet size.
Here it is: 256/16 = 16
AlterNet Way of Calculating Network ID
Let the IP is: 192.168.200.150/28
That is: 192.168.200.150 255.255.255.240
The last OCTET of the subnet, which indicates the Subnet ID, will be the closest
multiplied value of the subnet size.
192.168.200.100 255.255.255.248
Subnet Size: 256-248=8
8x12=96
8x13=104
Multiply the subnet size and in that way go to the closest value of the last octet of
IP address. That closest value is the Network ID.