You are on page 1of 14

IP Subnetting

Shahzad Rashid
NOC Executive Engineer (TXN)
Telenor Pakistan
Contents

 IP Classes

 Why Subnetting

 Subnetting for Networks

 Subnetting for Hosts


 IP Classes:

 Class A: 1-126 (16 Million Hosts on 127


Networks)
 Class B: 128-191 (65000 Hosts on 16000 Networks)
 Class C: 192-223 (254 Hosts on 2 Million Networks)
 Class D: 224-239 (Reserved for Multicast Groups)
 Class E: 240-254 (For Future use and R & D)
 Loop Back Address: 127.x.x.x (Reserved for Loopback Tests)
 .1/.2 are usually used as Gateway Addresses
 The last address e.g. .255 is used as Broadcast Address

 Why Subnetting:

 To preserve Public IPv4 Addresses


Subnetting for Networks
• .

 Step 1: Convert the Number of Networks to Binary

 Step 2: Reserve bits in Subnet Mask according to the Number of


Networks Converted to Binary (From Left to Right)

 Step 3: Use the Last Reserved bit to find your Network Ranges
Practice Scenario
• .

 Subnetting for 5 Networks using Class C IP Address: 192.168.1.0

 Default Class C Mask: 255.255.255.0

Step 1: Convert required Networks to Binary

128 64 32 16 8 4 2 1

0 0 0 0 0 1 0 1

 Bit 1 and 3 are Turned ON. That makes a total of 5


 Now Count from Right to Left and see how far is the last bit Turned ON
 3 is the count from Right to Left
Practice Scenario (Contd…)
• .

Step 2:

 Subnet mask: 255.255.255.0


 Reserve 3 bits in the Fourth Octet of Subnet Mask from Left to Right (Turn
them ON and turn OFF the remaining bits)

255 255 255 0


11111111 11111111 11111111 000000000
11111111 11111111 11111111 111000000

 First 3 Bits of the Last (Fourth) Octet Reserved


 Subnet Mask comes out to be : 255.255.255.224
 This is the Subnet Mask for 5 Networks
Practice Scenario (Contd…)
• .

Step 3:

255 255 255 0


11111111 1111111111111111000000000
11111111 1111111111111111111000000

 Refer to the Last Octet

128 64 32 16 8 4 2 1

1 1 1 0 0 0 0 0

 Starting from Left to Right notice the last bit Turned ON


 Last bit Turned ON is 32
 Network Ranges will be determined using 32
Practice Scenario (Contd…)
• .

Step 3 (Contd…):

 Network Ranges (The best possible utilization of IP for 5 Networks)

1. 192.168.1.1 ----- 192.168.1.31


2. 192.168.1.32 ----- 192.168.1.63
3. 192.168.1.64 ----- 192.168.1.95
4. 192.168.1.96 ----- 192.168.1.127
5. 192.168.1.128 ----- 192.168.1.159
6. 192.168.1.160 ----- 192.168.1.191
7. 192.168.1.192 ----- 192.168.1.223

 These are the 7 Seven Network Ranges which is the most appropriate
Subnetting for 5 Networks without misusing the IP’s
Subnetting for Hosts
• .

 Step 1: Convert the Number of Hosts to Binary

 Step 2: Reserve bits in Subnet Mask according to the Number of Hosts


Converted to Binary (From Right to Left)

 Step 3: Use Last Reserved bit to find your Network Ranges


Practice Scenario
• .

 Subnetting for 50 Hosts using Class C IP Address: 192.168.1.0

 Default Class C Mask: 255.255.255.0

Step 1: Convert required Networks to Binary

128 64 32 16 8 4 2 1

0 0 1 1 0 0 1 0

 Bit 2, 5 and 6 are Turned ON. That makes a total of 50


 Now Count from Left to Right and see how far is the last bit Turned ON
 6 is the count from Right to Left
Practice Scenario (Contd…)
• .

Step 2:

 Subnet mask: 255.255.255.0


 Reserve 6 bits in the Fourth Octet of Subnet Mask from Right to Left (Turn
them OFF and turn ON the remaining bits)

255 255 255 0


11111111 11111111 11111111 000000000
11111111 11111111 11111111 110000000

 Last 6 Bits of the Last (Fourth) Octet Reserved


 Subnet Mask comes out to be : 255.255.255.192
 This is the Subnet Mask for 50 Hosts
Practice Scenario (Contd…)
• .

Step 3:

255 255 255 0


11111111 11111111 11111111000000000
11111111 11111111 11111111110000000

 Refer to the Last Octet

128 64 32 16 8 4 2 1

1 1 0 0 0 0 0 0

 Starting from Left to Right notice the last bit Turned ON


 Last bit Turned ON is 64
 Network Ranges for 50 Hosts will be determined using 64
Practice Scenario (Contd…)
• .

Step 3 (Contd…):

 Network Ranges (The best possible utilization of IP for 50 Hosts)

1. 192.168.1.1 ----- 192.168.1.63


2. 192.168.1.64 ----- 192.168.1.127
3. 192.168.1.128 ----- 192.168.1.191
4. 192.168.1.192 ----- 192.168.1.255

 Each Network Range can have around 60-61 Hosts each, which is the
best possible Subnetting for 50 Hosts
Thanks for Viewing

• .

You might also like