Subnetting Notes CCNA Prep 1723574040
Subnetting Notes CCNA Prep 1723574040
Subnetting Notes CCNA Prep 1723574040
Subnetting Overview
To subnet the network into smaller subnets, we need to 'borrow' host bits and add them to the network portion of the
address.
To calculate the number of subnets
Subnet bits
• To calculate the number of available subnets, the formula is 2
• If a Class C network uses a /28 subnet mask then we've borrowed 4 bits from the default of /24
• 2 = 16 available subnets
• If a Class B network uses a /28 subnet mask then we've borrowed 12 bits from the default of /16
• 2 = 4096
• Hosts on different subnets need to go via a router if they want to communicate with each other
To Calculate the number of hosts
• To calculate the number of available hosts the formula is 2 to the power of host bits minus 2
• We subtract 2 because the network address and broadcast address cannot be assigned to hosts
• If a Class C network uses /28 subnet mask then we have 4 bits left for hosts
• 2 - 2 = 14
190.12.4.10/31 would only gives us two options for network addresses since the last bit is used
For example
• Address 190.12.4.10
&
• Address 190.12.4.11
Keep in mind
• /31 breaks the standard rules of IP addressing
• /31 subnets are supported on Cisco routers for point to point links (which have no need for a network or broadcast
address).
for example
• 200.15.10.1 to 200.15.1.2 (network .0 broadcast .3)
• 200.15.10.5 to 200.15.1.6 (network .4 broadcast .7)
• Etc
/31 vs /30
• /31 and /30 both accommodate 2 hosts per subnet.
• /31 support 128 subnets, /30 only 64.
• /31 is useful if you need to maximise use of address space.
• /30 is more standard and commonly used.
• For the CCNA exam, use /30 when a subnet to support 2 hosts is required, unless told to use /31
for example
• 200.15.10.1 to 200.15.1.6 (network .0 broadcast .7)
• 200.15.10.9 to 200.15.1.14 (network .8 broadcast .15)
• Etc…
Find the largest segment and allocate a suitable subnet size for it. Allocate this subnet at the start of the address space, then
continue to go down the list
For the IP address 135.15.10.138/29, what is the network address, broadcast a ddress, and range of valid IP addresses?
Adding the network bits together in the last octet gives us a decimal number of 136, so 135.15.10.136/29 would be our
network address.
2^3 - 2 gives us 6 networks. Additionally, if we have the dotted decimal address for the subnet(255.255.255.248), we can use
the magic number method. We subtract the value in the subnetted octet from 256: 256 - 248 = 8, so the network address
goes up in multiples of 8.
If we apply the subnet mask 255.255.255.240, how many subnets do we have and how many hosts do we have per
subnet?
Using the binary solution, we see that the last octet is the same as below. The left side of the red line represents the
network portion, and the right represents the host portion. This shows us that the subnet mask would be /28
128 64 32 16 8 4 2 1
Additionally, using the magic number method used with dotted decimal addresses gives us the same number of hosts.
256 - 240 = 16 - 2 = 14, we subtract 2 in this instance for both the broadcast and network address
Because we were allocated a Class A /8 address range, we have 20 bits in total for network addresses, giving us (2^20) =
1,048,576 subnets.
Following the similar binary process as the last one we notice that the 3rd octet appears as such
128 64 32 16 8 4 2 1
Fourth octet, in this situation
1 1 1 0 0 0 0 0
Would be all 0's since we're subnetting
Into /19 networks
So with 13 bits being used for networks, we have (2^13) = 8,192 - 2 = 8,190 hosts per network
Because we were allocated a class /8 address range, we'd have 19 - 8 = 11 bits for network addresses
Allowing (2^11) = 2,048 subnets
Private Addresses
There is a range of private addresses in each address class, these ranges would be:
• 10.0.0.0 - 10.255.255.255
- 10.0.0.0/8
- 10.0.0.0 255.0.0.0
• 172.16.0.0 - 172.31.255.255
- 172.16.0.0/12
- 172.16.0.0 255.240.0.0
• 192.168.0.0 - 192.168.255.255
- 192.168.0.0/16
- 192.168.0.0 255.255.0.0
Networks Today
Because they have the entire private ip address space to work with, it's common to see /24 subnets being used for end
hosts, /30 for point to point links, and /32 for loopbacks. Complex VLSM(Variable Length Subnet Mask) are more common in
enterprises which use public IP addresses on their inside networks and need to maximise their use.