Subnetting Notes CCNA Prep 1723574040

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Subnetting

July 27, 2024 11:58 AM

CIDR - Classless Inter-Domain Routing


• CIDR removed the fixed /8, /16 and /24 requirements for the address classes and allowed them to be split or
"subnetted" into smaller networks. For example, 175.10.10.0/20.
• Companies can now be allocated an address range which more closely matches their needs and does not waste space.
• Another benefit of CIDR is that aggregate blocks of networks can be advertised on the internet.
Example of route summarisation

Route Summarisation Benefits


• ISP A does not know about all 256 /24 networks reachable in ISP B.
• It only has the single 175.11.0.0/16 summary route.
• This reduces the size of ISP A's routing table and takes up less memory.
• If an individual link goes down in ISP B, it has no impact on ISP A. The single summary route does not change.
• (Routers in ISP B would have to recalculate their routing table if a link went down)
• This restricts issues to the local part of the network and reduces CPU load

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

Note on command 'ip subnet-zero'


• Just like we have to subtract 2 to get the number of valid hosts, we used to have to subtract 2 to get the number of
available networks also.
• In the original internet standards, it was not allowed to use network bits of all 0's or all 1's (Just like we cant use all
host bits of all 0's or all 1's.
• There wasn't really any practical need for this and it wasted address space.
• The 'ip subnet-zero' command on a router overrides the limitation and is enabled by default.

Class C/31 Subnet


C/31(255.255.255.254) uses all the bits except for the very last bit. It borrows 7 bits for the network address and gives us
128 subnets which accommodate 2 hosts each.

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).

Class C/30 Subnet


Class C/30 (255.255.255.252) would leave two bits for network addresses, leaving the last two bits available for host
addresses, but 2 of the 4 available addresses would need to be allocated for both the network address and the broadcast
address, leaving 2 addresses available for hosts

New Section 1 Page 1


address, leaving 2 addresses available for hosts
Let's say we've been allocated Class C 200.15.10.0/24
• C/30 leaves two bits available for the host address. Giving us = 4, minus two for the network address and
broadcast.
• It borrows 6 bits for the network address
• This gives us 64 subnets ( ) which accommodate 2 hosts each

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

Class C/29 Subnet


Let's say we've been allocated Class C 200.15.10.0/24. We'd allocate all the bits except for the last 3 for the our host
addresses, meaning we'd now be using /29 (or 255.255.255.248)
• This leaves 3 bits for the host address, Possible hosts
• It borrows 5 bits for the network address
• This gives us 32 subnets ( ) which accommodate 6 hosts each

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…

Variable Length Subnet Masks VLSM VLSM - Variable Length Subnet


Early routing protocols only supported Fixed Length Subnet Masking (FLSM) where all subnets had to be the same size. You Masks
couldn't have a subnet with 14 hosts and another subnet with 64 hosts in the same network. All modern routing protocols FLSM - Fixed Length Subnet Masks
support Variable Length Subnet Masking. This allows us to size subnets differently according to how many hosts they have .

Subnet Considerations - Things to Consider During Design


• How many locations do we have in the network
• How many hosts are in each location
• What are the IP addressing requirements for each location?(Should different departments or types of host be in
different subnets?)
• What size is appropriate for each subnet? (Don't waste addresses, but leave room for growth)

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

Subnetting Large Networks


Let's say we've been allocated Class B 135.15.0.0/16
• If we subnet this into /29 subnets, we have 3 bits for host addressing.
• This allows 6 hosts per network (2^3 - 2), the same as if we used /29 with a class C address
• Because we were allocated a Class B /16 address range, we have 13 bits for network addresses
• This allows 8192 subnets (2^13)

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.

• Network address = 135.15.10.136


• Next network address = 135.15.10.144
• Broadcast address = 135.15.10.143
• Valid host range 135.15.10.137 - 142

Let's say we've been allocated Class A 60.0.0.0/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

New Section 1 Page 2


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
1 1 1 1 0 0 0 0
This borrows 4 bits for the network portion of the address, leaving us with 4 bits for the host portion.
Using the previous formula, (2^4) - 2 = 14, which means we'd have 14 valid hosts(the 2 we subtracted would be broadcast
and network addresses).

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.

Example - Class A on 3rd octet


For this example, we're allocated Class A 60.0.0.0/8. If we subnet this into /19 networks, how many subnets do we have and
how many hosts do we have?

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.

New Section 1 Page 3

You might also like