SlideShare a Scribd company logo
By: Muhammad Hanif
IP V4 Subnetting
Quotes of the day
 Rabi Zidni Elma.
 Aay ALLAH mairy Elam main izafa kr.
 Seek of knowledge from cradle to the grave.
So Far we Study in IPv4
 Header
 Address format
 Classful IPAddress
 Class A
 0 to 127
 Class B
 128 to 191
 Class C
 192 to 223
 Class D
 224 to 239
 Class E
 240 to 255
Routing
 The data communication is done through the Network id (1st
part) of an IP Address.
 The data is reach first to the destination network (using
Network id) and then to that particular host (Destination) in
that network (using Host id).
Network Address and Network Mask
 Network Address:The First address of a Network is the
network address of that network, which specify the network.
 All the data communication inWAN is done through the
Network address, so that the data first reach to network and
then to Host.
 Network Mask: A network mask or a default mask in classful
addressing with n leftmost bits all set to 1s and (32 − n) rightmost
bits all set to 0s.
Default Network Masks
Network Address
 To extract the network address from the destination address
of a packet, a router uses the AND operation.
 When the destination address (or any address in the block) is
ANDed with the default mask, the result is the network
address.
 AND Operation:
 1AND 1 = 1
 1AND 0 = 0
 0AND 1 = 0
 0AND 0 = 0
Example
 Example: A router receives a packet with the destination address
131.24.67.32. Show how the router finds the network address of the
packet.
 Solution: Since the class of the address is B, the router applies the
default mask for class B, 255.255.0.0 to find the network address.
 Dest.Add. : 10000011. 00011000. 01000011. 00100000
AND
 Mask: 11111111.11111111.00000000.00000000
 Net.Add. : 10000011. 00011000. 00000000.00000000
 = 131.24.0.0
Example
 Example: A router receives a packet with the destination address
131.24.67.32. Show how the router finds the network address of
the packet.
 Solution: Since the class of the address is B, the router applies the
default mask for class B, 255.255.0.0 to find the network address.
Three-Level Addressing: Subnetting
 The IP addresses were originally designed with two levels of
addressing.
 To reach a host on the Internet, we must first reach the network and
then the host.
 It soon became clear that we need more than two hierarchical levels,
for two reasons.
 First, an organization that was granted a block in class A or B needed
to divide its large network into several subnetworks for better
security and management.
 Second, the blocks in class A and B are larger and most of the IP
address then lost so class A or B could divide the block into smaller
subblocks.
Subnetting
 In subnetting, a network is divided into several smaller
sub-networks (subnets)
 Each sub network having its own sub network address.
 For a network here we will use /n,
 Where the “n” will show the length of the network id.
Subnet Mask
 The network mask is use when a network is not subnetted.
 When we divide a network to several sub networks, we need
to create a sub network mask (or subnet mask) for each sub
network.
 A sub network has subnet id and host id.
Subnet Mask Cont.
 Subnetting increases the length of the net id and decreases
the length of host id.
 When we divide a network to “s”number of subnetworks,each of
equal numbers of hosts,
 we can calculate the subnetid for each subnetwork.
Subnet Mask cont.
 For Example: Calculate a subnet mask for a network
141.14.0.0/16. we want to make 4 sub networks for this IP
address uing subnet.
 First we have to calculate Subnet Mask.
 We need 4 networks so 22
= 4. so we require 2 more bits to add
them in Network Id bits, so now we have 16 + 2 = 18 network
id bits.
 So Subnet mask for this class B will now =
 11111111.11111111.11000000.00000000
 OR: 255.255.192.0
Subnet Mask cont.
Subnetting Host IDs
 Now we can further subdivide a single IP to Sub networks
through Subnetting.
 In Each Subnet the First and Last IP address will be reserved.
 First IP Address will be the Network Address for that
small network (Sub Network).
 The Last IP address will be the Broadcast Address for that
small network (Sub Network).
 It mean that the a sub network will always support to -2 sub
host ids.
Example (with out subnetting)
 We have an IP address: 141.14.0.0
 It is Class B IP address.
 This network can have 216
= 65536 – 2 = 65534 Hosts.
 It is a single Network.
Example (Using Subnetting)
 We have an IP address: 141.14.0.0
 It is Class B IP address.
 This network can have 216
= 65536 – 2 = 65534 Hosts.
 But we want to have let suppose 4 sub networks of this single
network
 As 2n
= 4 if n = 2, so 22
= 4
 So we require 2 extra bits to add in the network id bits.
Example Cont.
 IP address: 141.14.0.0
 Network ID: 141.14.0.0/16
 4 Networks = 2 bits
 141.14.0.0/18
 Now we have 18 bits for Network id and the remaining bits
for host id = 32-18 = 14
 So now we can make 4 networks and each network will have
214
= 16384 – 2 = 16382 Hosts.
Example Cont.
 IP address: 141.14.0.0
 Binary : 10001101.00001110.00000000.0000000
 Network Mask for Class B: 255.255.0.0
 Or: 11111111.11111111.00000000.00000000
 For Subnetting: for 4 sub networks
 IP address: 141.14.0.0/18
 Subnet Mask: 11111111.11111111.11000000.00000000
 Or: 255.255.192.0
Example cont.
 First Subnet:
 IP address: 141.14.0.0/18
 Hosts in each network 214
= 16384 – 2 = 16382
 Range:
 141.14.0.0 to 141.14.63.255
 1st
Subnet ID: 141.14.0.0/18
Example cont.
 2nd Subnet: Range:
 141.14.64.0 to 141.14.127.255
 2nd
Subnet ID: 141.14.64.0/18
 3rd Subnet: Range:
 141.14.128.0 to 141.14.191.255
 3rd
Subnet ID: 141.14.128.0/18
 4th
Subnet: Range:
 141.14.192.0 to 141.14.255.255
 4th
Subnet ID: 141.14.192.0/18
Example cont.
Example to Find the Subnet Address of a
host IP
 A network is divided into four subnets. Since one of the
addresses in a subnet is 141.14.120.77, Find the subnet
address.
 Sol: As the IP is from Class B i.e. 141.14.120.77
 Divided into 4 sub networks so 2 bits are reserved.
 So the subnet mask is
 11111111.11111111.11000000.00000000
 Or: 255.255.192.0
Example Cont.
 IP address: 141.14.120.77
 Binary : 10001101.00001110.01111000.01001101
 Subnet mask: 255.255.192.0
 Or: 11111111.11111111.11000000.00000000
 SubnetAddress: IP AND subnet mask:
 10001101.00001110.01111000.01001101
AND
 11111111.11111111.11000000.00000000
 Subnet Address:
 10001101.00001110.01000000.00000000
= 141.14.64.0
Example Cont.
Exercise
 What is the subnet address if the IP address is
19.30.84.5 and the mask is 255.255.192.0?
Solution
Exercise
 A company is granted the IP address 201.70.64.0, The
company needs six subnets. Design the subnets.
Solution
 TheAddress is of Class C: 201.70.64.0
 The company needs six subnets.This number 6 is not a power of 2.
The next number that is a power of 2 is 8 (23
).
 We need 3 more 1s in the subnet mask.The total number of 1s in
the subnet mask is 27 (24 + 3).
 The total number of 0s is 5 (32 27).The mask is
‐
11111111 11111111 11111111 11100000
Or 255.255.255.224
 The number of subnets is 8.
 The number of addresses in each subnet is 25
(5 is the number of
0s) = 32-2 = 30
Address Range
Exercise
 A subnet has a subnet address of 141.14.64.0, find the
address range in the subnets if its subnet masks are
1. 255.255.224.0
2. 255.255.240.0
Solution
 Subnet address : 141.14.64.0
 Class B:
1. For 255.255.224.0
As 224 = 128 + 64 + 32
So 3 bits are Reserved for Network and 5 for host in
2nd
Octat
Total Number of Hosts bits = 8 + 5 = 13
Total Number of Host = 213
= 8192 – 2 = 8190
Solution cont.
 Subnet address : 141.14.64.0
 Class B:
2. For 255.255.240.0
As 240 = 128 + 64 + 32 + 16
So 4 bits are Reserved for Network and 4 for host in
2nd
Octat
Total Number of Hosts bits = 8 + 4 = 12
Total Number of Host = 212
= 4096 – 2 = 4092
Solution Cont.
Yet another Exercise
 Mask 255.255.255.192
 How many subnets are possible?
 How many hosts are there in one subnet?
 Is it possible to divide one of the subnet in two? How?
Do it (Your Self as follow)
Home Work
 Do your self of book chapter No. 5
 Do the examples and exercise.
 Book Name:TCP – IP protocol suite
 By: Behrouz A. Forouzan
subnetting ipv4-Ipv4 subneeting methodologies

More Related Content

PPTX
Lecture W5 CN IP Subnetting P2.pptx
PPTX
Lecture 03 networking
PDF
IP Address & Its Classes .pdf
PPTX
Fixed Length Subnetting about ip address.pptx
PPT
Expl net fund_chapter_06_i_pv4_part_2
DOCX
Subnetting class C
PPTX
Ch7 IP addressing.pptx
PPTX
IP subnetting Part II for network desig.pptx
Lecture W5 CN IP Subnetting P2.pptx
Lecture 03 networking
IP Address & Its Classes .pdf
Fixed Length Subnetting about ip address.pptx
Expl net fund_chapter_06_i_pv4_part_2
Subnetting class C
Ch7 IP addressing.pptx
IP subnetting Part II for network desig.pptx

Similar to subnetting ipv4-Ipv4 subneeting methodologies (20)

PPTX
7-Lect_7 .pptxNetwork LayerNetwork Layer
PPTX
7-Lect_7 .pptxNetwork Layer. Addressing Subnetting Mask (default and subnet) ...
PPTX
computer network notes in network layer.
PPTX
1703_anusua_basuclassful addressing_IP_Addressing
PPSX
CyberLab TCP/IP and IP Addressing & Subnetting
PPTX
Lecture_Network_Layer-IP Addressing.pptx
PPTX
IPv4 addressing and subnetting
PDF
Subnetting in network layer in computer networks
PDF
Subnetting
PPT
How IP address works
PPT
IP-address trial.ppt
PDF
Lecture 06
PPTX
IP_ADDRESSING_AND_SUBNETTING.pptx
PDF
Chapter 8 - IP Subnetting, Troubleshooting and Introduction to NAT 9e
PPTX
NP - Unit 2 - Internet Addressing, ARP and RARP
PDF
Network Layer Numericals
PPTX
IPv4 Addressing Architecture
PPTX
CCNA ppt Day 3
PPT
4a logical laddressing
DOC
Subnet questions with ans(networking)
7-Lect_7 .pptxNetwork LayerNetwork Layer
7-Lect_7 .pptxNetwork Layer. Addressing Subnetting Mask (default and subnet) ...
computer network notes in network layer.
1703_anusua_basuclassful addressing_IP_Addressing
CyberLab TCP/IP and IP Addressing & Subnetting
Lecture_Network_Layer-IP Addressing.pptx
IPv4 addressing and subnetting
Subnetting in network layer in computer networks
Subnetting
How IP address works
IP-address trial.ppt
Lecture 06
IP_ADDRESSING_AND_SUBNETTING.pptx
Chapter 8 - IP Subnetting, Troubleshooting and Introduction to NAT 9e
NP - Unit 2 - Internet Addressing, ARP and RARP
Network Layer Numericals
IPv4 Addressing Architecture
CCNA ppt Day 3
4a logical laddressing
Subnet questions with ans(networking)
Ad

Recently uploaded (20)

PPTX
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PPTX
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
PPTX
Geodesy 1.pptx...............................................
PDF
PPT on Performance Review to get promotions
PDF
composite construction of structures.pdf
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PDF
Digital Logic Computer Design lecture notes
PDF
Structs to JSON How Go Powers REST APIs.pdf
PDF
Operating System & Kernel Study Guide-1 - converted.pdf
PPTX
web development for engineering and engineering
PPTX
Sustainable Sites - Green Building Construction
PPT
Mechanical Engineering MATERIALS Selection
PDF
Well-logging-methods_new................
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
PPT
Project quality management in manufacturing
PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
Geodesy 1.pptx...............................................
PPT on Performance Review to get promotions
composite construction of structures.pdf
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
CYBER-CRIMES AND SECURITY A guide to understanding
Digital Logic Computer Design lecture notes
Structs to JSON How Go Powers REST APIs.pdf
Operating System & Kernel Study Guide-1 - converted.pdf
web development for engineering and engineering
Sustainable Sites - Green Building Construction
Mechanical Engineering MATERIALS Selection
Well-logging-methods_new................
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
Project quality management in manufacturing
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
Ad

subnetting ipv4-Ipv4 subneeting methodologies

  • 1. By: Muhammad Hanif IP V4 Subnetting
  • 2. Quotes of the day  Rabi Zidni Elma.  Aay ALLAH mairy Elam main izafa kr.  Seek of knowledge from cradle to the grave.
  • 3. So Far we Study in IPv4  Header  Address format  Classful IPAddress  Class A  0 to 127  Class B  128 to 191  Class C  192 to 223  Class D  224 to 239  Class E  240 to 255
  • 4. Routing  The data communication is done through the Network id (1st part) of an IP Address.  The data is reach first to the destination network (using Network id) and then to that particular host (Destination) in that network (using Host id).
  • 5. Network Address and Network Mask  Network Address:The First address of a Network is the network address of that network, which specify the network.  All the data communication inWAN is done through the Network address, so that the data first reach to network and then to Host.  Network Mask: A network mask or a default mask in classful addressing with n leftmost bits all set to 1s and (32 − n) rightmost bits all set to 0s.
  • 7. Network Address  To extract the network address from the destination address of a packet, a router uses the AND operation.  When the destination address (or any address in the block) is ANDed with the default mask, the result is the network address.  AND Operation:  1AND 1 = 1  1AND 0 = 0  0AND 1 = 0  0AND 0 = 0
  • 8. Example  Example: A router receives a packet with the destination address 131.24.67.32. Show how the router finds the network address of the packet.  Solution: Since the class of the address is B, the router applies the default mask for class B, 255.255.0.0 to find the network address.  Dest.Add. : 10000011. 00011000. 01000011. 00100000 AND  Mask: 11111111.11111111.00000000.00000000  Net.Add. : 10000011. 00011000. 00000000.00000000  = 131.24.0.0
  • 9. Example  Example: A router receives a packet with the destination address 131.24.67.32. Show how the router finds the network address of the packet.  Solution: Since the class of the address is B, the router applies the default mask for class B, 255.255.0.0 to find the network address.
  • 10. Three-Level Addressing: Subnetting  The IP addresses were originally designed with two levels of addressing.  To reach a host on the Internet, we must first reach the network and then the host.  It soon became clear that we need more than two hierarchical levels, for two reasons.  First, an organization that was granted a block in class A or B needed to divide its large network into several subnetworks for better security and management.  Second, the blocks in class A and B are larger and most of the IP address then lost so class A or B could divide the block into smaller subblocks.
  • 11. Subnetting  In subnetting, a network is divided into several smaller sub-networks (subnets)  Each sub network having its own sub network address.  For a network here we will use /n,  Where the “n” will show the length of the network id.
  • 12. Subnet Mask  The network mask is use when a network is not subnetted.  When we divide a network to several sub networks, we need to create a sub network mask (or subnet mask) for each sub network.  A sub network has subnet id and host id.
  • 13. Subnet Mask Cont.  Subnetting increases the length of the net id and decreases the length of host id.  When we divide a network to “s”number of subnetworks,each of equal numbers of hosts,  we can calculate the subnetid for each subnetwork.
  • 14. Subnet Mask cont.  For Example: Calculate a subnet mask for a network 141.14.0.0/16. we want to make 4 sub networks for this IP address uing subnet.  First we have to calculate Subnet Mask.  We need 4 networks so 22 = 4. so we require 2 more bits to add them in Network Id bits, so now we have 16 + 2 = 18 network id bits.  So Subnet mask for this class B will now =  11111111.11111111.11000000.00000000  OR: 255.255.192.0
  • 16. Subnetting Host IDs  Now we can further subdivide a single IP to Sub networks through Subnetting.  In Each Subnet the First and Last IP address will be reserved.  First IP Address will be the Network Address for that small network (Sub Network).  The Last IP address will be the Broadcast Address for that small network (Sub Network).  It mean that the a sub network will always support to -2 sub host ids.
  • 17. Example (with out subnetting)  We have an IP address: 141.14.0.0  It is Class B IP address.  This network can have 216 = 65536 – 2 = 65534 Hosts.  It is a single Network.
  • 18. Example (Using Subnetting)  We have an IP address: 141.14.0.0  It is Class B IP address.  This network can have 216 = 65536 – 2 = 65534 Hosts.  But we want to have let suppose 4 sub networks of this single network  As 2n = 4 if n = 2, so 22 = 4  So we require 2 extra bits to add in the network id bits.
  • 19. Example Cont.  IP address: 141.14.0.0  Network ID: 141.14.0.0/16  4 Networks = 2 bits  141.14.0.0/18  Now we have 18 bits for Network id and the remaining bits for host id = 32-18 = 14  So now we can make 4 networks and each network will have 214 = 16384 – 2 = 16382 Hosts.
  • 20. Example Cont.  IP address: 141.14.0.0  Binary : 10001101.00001110.00000000.0000000  Network Mask for Class B: 255.255.0.0  Or: 11111111.11111111.00000000.00000000  For Subnetting: for 4 sub networks  IP address: 141.14.0.0/18  Subnet Mask: 11111111.11111111.11000000.00000000  Or: 255.255.192.0
  • 21. Example cont.  First Subnet:  IP address: 141.14.0.0/18  Hosts in each network 214 = 16384 – 2 = 16382  Range:  141.14.0.0 to 141.14.63.255  1st Subnet ID: 141.14.0.0/18
  • 22. Example cont.  2nd Subnet: Range:  141.14.64.0 to 141.14.127.255  2nd Subnet ID: 141.14.64.0/18  3rd Subnet: Range:  141.14.128.0 to 141.14.191.255  3rd Subnet ID: 141.14.128.0/18  4th Subnet: Range:  141.14.192.0 to 141.14.255.255  4th Subnet ID: 141.14.192.0/18
  • 24. Example to Find the Subnet Address of a host IP  A network is divided into four subnets. Since one of the addresses in a subnet is 141.14.120.77, Find the subnet address.  Sol: As the IP is from Class B i.e. 141.14.120.77  Divided into 4 sub networks so 2 bits are reserved.  So the subnet mask is  11111111.11111111.11000000.00000000  Or: 255.255.192.0
  • 25. Example Cont.  IP address: 141.14.120.77  Binary : 10001101.00001110.01111000.01001101  Subnet mask: 255.255.192.0  Or: 11111111.11111111.11000000.00000000  SubnetAddress: IP AND subnet mask:  10001101.00001110.01111000.01001101 AND  11111111.11111111.11000000.00000000  Subnet Address:  10001101.00001110.01000000.00000000 = 141.14.64.0
  • 27. Exercise  What is the subnet address if the IP address is 19.30.84.5 and the mask is 255.255.192.0?
  • 29. Exercise  A company is granted the IP address 201.70.64.0, The company needs six subnets. Design the subnets.
  • 30. Solution  TheAddress is of Class C: 201.70.64.0  The company needs six subnets.This number 6 is not a power of 2. The next number that is a power of 2 is 8 (23 ).  We need 3 more 1s in the subnet mask.The total number of 1s in the subnet mask is 27 (24 + 3).  The total number of 0s is 5 (32 27).The mask is ‐ 11111111 11111111 11111111 11100000 Or 255.255.255.224  The number of subnets is 8.  The number of addresses in each subnet is 25 (5 is the number of 0s) = 32-2 = 30
  • 32. Exercise  A subnet has a subnet address of 141.14.64.0, find the address range in the subnets if its subnet masks are 1. 255.255.224.0 2. 255.255.240.0
  • 33. Solution  Subnet address : 141.14.64.0  Class B: 1. For 255.255.224.0 As 224 = 128 + 64 + 32 So 3 bits are Reserved for Network and 5 for host in 2nd Octat Total Number of Hosts bits = 8 + 5 = 13 Total Number of Host = 213 = 8192 – 2 = 8190
  • 34. Solution cont.  Subnet address : 141.14.64.0  Class B: 2. For 255.255.240.0 As 240 = 128 + 64 + 32 + 16 So 4 bits are Reserved for Network and 4 for host in 2nd Octat Total Number of Hosts bits = 8 + 4 = 12 Total Number of Host = 212 = 4096 – 2 = 4092
  • 36. Yet another Exercise  Mask 255.255.255.192  How many subnets are possible?  How many hosts are there in one subnet?  Is it possible to divide one of the subnet in two? How?
  • 37. Do it (Your Self as follow)
  • 38. Home Work  Do your self of book chapter No. 5  Do the examples and exercise.  Book Name:TCP – IP protocol suite  By: Behrouz A. Forouzan

Editor's Notes

  • #37: Hints: Find Class Assume that class any add. What is 192 ?? Think about a + b = 192 So reserve those a, b bits for network and rest for hosts Then divide the last network into two sub networks.