Subnetting
Subnetting
IP Addressing
Subnetting
VLSM
CIDR
IP Address Classes
IP Addresses
32 binary bits are broken into four octets (1 octet = 8 bits)
Class A: 255.0.0.0
Class B: 255.255.0.0
Class C: 255.255.255.0
Network Masks
If you do not subnet, you will only be able to use one network from your
Class A, B, or C network, which is unrealistic
Each data link on a network must have a unique network ID and unique
broadcast address.
Subnetting a Class A/B/C Address
How many subnets does the chosen subnet mask produce?
Fig-3
Fig-2
Example
we considered an internetwork that required 3 subnets. To achieve the goal of creating four subnets we
borrowed 2 bits from the 8 hosts bits available with an IP address that has a default mask of
255.255.255.0, or a /24 prefix. The resulting subnet mask was 255.255.255.192, and a total of 4
possible subnets were created.
Practice Example: 255.255.255.128 (/25)
Network 192.168.10.0
How many subnets? Since 128 is 1 bit on (10000000), the answer would be 2 1= 2.
How many hosts per subnet? We have 7 host bits off (10000000), so the equation would be 2 7–
2 = 126 hosts.
What are the valid subnets? 256 – 128 = 128. Remember, we’ll start at zero and count in our
block size, so our subnets are 0, 128.
What’s the broadcast address for each subnet? The number right before the value of the next
subnet is all host bits turned on and equals the broadcast address. For the zero subnet, the next
subnet is 128, so the broadcast of the 0 subnet is 127.
What are the valid hosts? These are the numbers between the subnet and broadcast address
Practice Example: 255.255.255.224 (/27)
Network 192.168.10.0
How many subnets? 224 is 11100000, so our equation would be 23 = 8.
How many hosts? 25– 2 = 30.
What are the valid subnets? 256 – 224 = 32. We just start at zero and count to
the subnet mask value in blocks (increments) of 32: 0, 32, 64, 96, 128, 160,
192, and 224.
What’s the broadcast address for each subnet (always the number right before
the next subnet)?
What are the valid hosts (the numbers between the subnet number and the
broadcast address)?
Practice Example : 255.255.255.224 (/27)
Network 192.168.10.0
Practice Example : 255.255.128.0 (/17)
Network 172.16.0.0
Subnets? 21 = 2
Hosts? 215– 2 = 32,766 (7 bits in the third octet, and 8 in the fourth)
Valid hosts?
Practice Example: 255.255.128.0 (/17)
Network 172.16.0.0
Variable Length Subnet Mask(VLSM)
Subnet with requirements shown?
5 subnets needed
Can be assigned as follows:
Net A: 204.15.5.0/27 host address range 1 to 30
Net B: 204.15.5.32/27 host address range 33 to 62
Net C: 204.15.5.64/27 host address range 65 to 94
Net D: 204.15.5.96/27 host address range 97 to 126
Net E: 204.15.5.128/27 host address range 129 to 158
Example
Given the same network and requirements as in Sample Exercise 1 develop a subnetting scheme
using VLSM, given:
◦ Net A: must support 14 hosts
◦ Net B: must support 28 hosts
◦ Net C: must support 2 hosts
◦ Net D: must support 7 hosts
◦ Net E: must support 28 host
Determine what mask allows the required number of hosts.
◦ Net A: requires a /28 (255.255.255.240) mask to support 14 hosts
◦ Net B: requires a /27 (255.255.255.224) mask to support 28 hosts
◦ Net C: requires a /30 (255.255.255.252) mask to support 2 hosts
◦ Net D: requires a /28 (255.255.255.240) mask to support 7 hosts
◦ Net E: requires a /27 (255.255.255.224) mask to support 28 hosts
CIDR: Classless Interdomain Routing
The lack of a network class of a size which is appropriate for mid-sizes organization;
Issue multiple (block) class C addresses (instead single class B address) solves a running out of
class B address but
Introduces a problem of routing table
By default, a routing table contains an entry for every network
How large a routing table should be for all Class C networks?
Growth of routing table in the Internet routers beyond the ability of current software and
hardware to manage
Route Non-Aggregation
Route Aggregation
Class C address’s concept becomes meaningless on these route between ‘domains’, the technique is
called Classless Interdomain Routing or CIDR (pronounce cider)
Key concept is to allocate multiple IP addresses in the way that allow summarization into a smaller
number of routing table (route aggregate)
CIDR is supported by BGP4 and based on route aggregation e.g 16 class C addresses can be
summarized to a single routing entry (router can hold a single route entry for the main trunks
between these areas
Supernetting
An organization has been allocated a block of class C addresses in 2n with contiguous address space
Archive by using bits which belongs to the network address as host bits.
class C example : altering the default class C subnet mask such that some bit change from 1 to 0
Here we have rules for the supernetting
1) Network should be contiguous
For eg – 192.168.10.0
- 192.168.11.0
- 192.168.12.0
- 192.168.13.0
2) Same of network should be same also with in form 2^n.
- 192.168.10.0/24
- 192.168.11.0/24
- 192.168.12.0/24
- 192.168.13.0/24
here equal value of 2^n
3) Any network address of given is divisible by total number subnet
- 4 * 2^8 = 2^10
192.168.10.0/22