You are on page 1of 16

SUBNETTING

Basic and Variable Length Subnet Masks (VLSMs),


and Troubleshooting TCP/IP
Subnet
 Subnets are a subset of the entire network
 Networks can be divided into subnets
 Subnets can be divided into subnets
 Each subnet is treated as a separate network
 A subnet can be a WAN or LAN

Subnetting
 Subnetting is the process of borrowing bits from the HOST bits, in order to divide the
larger network into small subnets.
 Host bits must are reassigned (or “borrowed”) as network bits.
 The starting point is always the leftmost host bit.
 Subnetting does NOT give you more hosts, but actually costs you hosts.
 You lose two host IP Addresses for each subnet, and perhaps one for the subnet IP
address and one for the subnet broadcast IP address.
 In older networks, you would have lost the first subnet, as the subnet IP address is the
same as the network IP address, and last subnet and all of its hosts’ IP addresses as the
broadcast for that subnet is the same as the broadcast for the network. (This subnet can
be used in most networks.)

3 bits borrowed allows 23-2 or 6 subnets

5 bits borrowed allows 25-2 or 30 subnets


1
Page

12 bits borrowed allows 212-2 or 4094 subnets


There are loads of reasons in favor of subnetting, including the following benefits:
 Reduced network traffic
– We all appreciate less traffic of any kind. Networks are no different.
– Without trusty routers, packet traffic could grind the entire network down to
a near standstill.
– With routers, most traffic will stay on the local network; only packets destined
for other networks will pass through the router.
– Routers create broadcast domains. The more broadcast domains you create,
the smaller the broadcast domains and the less network traffic on each network
segment.
 Optimized network performance
– This is a result of reduced network traffic.
 Simplified management
– It’s easier to identify and isolate network problems in a group of smaller
connected networks than within one gigantic network.
 Facilitated spanning of large geographical distances
– Because WAN links are considerably slower and more expensive than LAN
links, a single large network that spans long distances can create problems in
every area previously listed. Connecting multiple smaller networks makes the
system more efficient.

Analogy

Dividing the barrel of apples into small barrels or baskets


does not give us any more apples…

10 barrels x 10 apples = 100 apples

2
Page
Page
3
To create a subnet follow these steps:
1. Determine the number of required network IDs:
 One for each subnet
 One for each wide area network connection
2. Determine the number of required host IDs per subnet:
 One for each TCP/IP host
 One for each router interface
3. Based on the above requirements, create the following:
 One subnet mask for your entire network
 A unique subnet ID for each physical segment
 A range of host IDs for each subnet
Detailed procedures or steps
1. Determine the required number of subnets.
2. Convert the number into binary.
3. Count the number of bits.
4. Verify:
• 2n ≥ no. of subnets required ( n = # of bits to borrow)
• 2m -2 ≥ max. no. of hosts (m = # of bits in the Host portion)
5. Determine the New Subnet Mask (NSM).
6. Determine the incrementing value (Δ).
7. Determine the Addresses.
Establishing the Subnet Mask Address
• Determines which part of an IP address is the network field and which part is the host
field.
• Follow these steps to determine the subnet mask:
1. Express the subnetwork IP address in binary form.
2. Replace the network and subnet portion of the address with all 1s.
3. Replace the host portion of the address with all 0s.
4. Convert the binary expression back to dotted-decimal notation.
• To determine the number of bits to be used, the network designer needs to calculate
how many hosts the largest subnetwork requires and the number of subnetworks
needed.
• The “slash format” is a shorter way of representing the subnet mask:
 /25 represents the 25 one bits in the subnet mask 255.255.255.128
4
Page
Classless Inter-Domain Routing (CIDR)
 It’s basically the method that ISPs (Internet service providers) use to allocate a number
of addresses to a company, a home—a customer.
 When you receive a block of addresses from an ISP, what you get will look something
like this: 192.168.10.32/28. This is telling you what your subnet mask is. The slash
notation (/) means how many bits are turned on (1s).

The /8 through /15 can only be used with Class A network addresses. /16 through /23 can be
5

used by Class A and B network addresses. /24 through /30 can be used by Class A, B, and C
Page

network addresses.
Example:
IP Address: 192.168.50.0/24
No. of Subnets = 10 and Maximum no. of hosts = 8

Solution:
1. Determine the required number of subnets.
• 10 subnets
2. Convert the number into binary.
• 1010 = 10102
3. Count the number of bits.
• n=4
4. Verify:
• 2n ≥ no. of subnets required (n = 4)
24 = 16 ≥ 10 subnets
• 2m -2 ≥ max. no. of hosts (m = 8 – 4 = 4)
24 - 2 = 14 ≥ 8 hosts
2. Determine the New Subnet Mask (NSM).
• 11111111●11111111●11111111●11110000 note: 1 – network and 0 – host
• 255.255.255.240 – NSM
3. Determine the incrementing value (Δ).
• Δ = 16 (128 64 32 16 8 4 2 1)
4. Determine the Addresses.
• 0 – 192.168.50.0 /28 4 – 192.168.50.64 /28 8 – 192.168.50.128 /28
• 1 – 192.168.50.16 /28 5 – 192.168.50.80 /28
• 2 – 192.168.50.32 /28 6 – 192.168.50.96 /28
• 3 – 192.168.50.48 /28 7 – 192.168.50.112 /28 15 – 192.168.50.240 /28

Problems with Subnet Zero and the All-Ones Subnet


 Traditionally, it was strongly recommended that subnet zero and the all-ones subnet
not be used for addressing.
 According to RFC 950,
• "It is useful to preserve and extend the interpretation of these special (network
and broadcast) addresses in subnetted networks. This means the values of all
zeros and all ones in the subnet field should not be assigned to actual (physical)
subnets."
 This is the reason why network engineers required to calculate the number of subnets
obtained by borrowing three bits would calculate 23-2 (6) and not 23 (8).
 The -2 takes into account that subnet zero and the all-ones subnet are not used
traditionally.
6
Page
Using Subnet Zero and the All-Ones Subnet
 It should be noted that even though it was discouraged, the entire address space
including subnet zero and the all-ones subnet have always been usable. The use of the
all-ones subnet was explicitly allowed and the use of subnet zero is explicitly allowed
since Cisco IOS Software Release 12.0. Even prior to Cisco IOS Software Release 12.0,
subnet zero could be used by entering the ip subnet-zero global configuration
command.
 On the issue of using subnet zero and the all-ones subnet, RFC 1878 states,
• "This practice (of excluding all-zeros and all-ones subnets) is obsolete.
Modern software will be able to utilize all definable networks."
 Today, the use of subnet zero and the all-ones subnet is generally accepted and most
vendors support their use. However, on certain networks, particularly the ones using
legacy software, the use of subnet zero and the all-ones subnet can lead to problems.

Subnetting Class A and B Networks


 The available bits for assignment to the subnet field in a Class A address is 22 bits while
a Class B address has 14 bits.

Calculating the Subnetwork With ANDing


 ANDing is a binary process by which the router calculates the subnetwork ID for an
incoming packet.
– 1 AND 1 = 1; 1 AND 0 = 0; 0 AND 0 = 0
 The router then uses that information to forward the packet across the correct interface.
7
Page
Example:
 192.168.1.0 /24
• 24 bit is NW portion
• 8 bits is Host portion
• I can borrow from the Host portion
 How many bits?
• 2n ≥ # of subnets required
• n = # of bits to borrow
 So for our example we need to borrow:
• 2n ≥ 2
• Therefore n=1 (we need to borrow 1 bit)

Solution:
 The borrowed bits become part of my subnet mask/prefix (we borrowed 1 bit)
 Before subnetting /24 (255.255.255.0)
 After subnetting /25 (255.255.255.128)
- 25 bit is NW portion & 7 bits is Host portion
 How many hosts can I have per subnet?
- 2m – 2
- m = # of bits in the Host portion
 So for our example:
- 2m – 2
- m=7
- Therefore we can have 126 hosts (128 – 2)
- (We needed 125)

Subnetting
 Our previous network was 192.168.1.0 /24
 How does our new networks look like?
- 192.168.1.00000000 /25 or 192.168.1.0 /25
- 192.168.1.10000000 /25 or 192.168.1.128 /25
 And there special addresses?
- Network/subnet 192.168.1.0 /25
- Broadcast 192.168.1.01111111 or 192.168.1.127
- Host range 192.168.1.00000001 – 01111110 or .1 - .126
 So how about the other subnet – you calculate:
- Network/subnet 192.168.1.128 /25
- Broadcast 192.168.1.11111111 or 192.168.1.255
- Host range 192.168.1.10000001 – 11111110 or .129 - .254
8
Page
Another Subnetting exercise
 You have 192.168.1.0 /24 and want 6 subnets
 Calculate
- 6 subnets with prefix
- Broadcast address for each subnet
- Host range for each subnet

Subnetting: Variable Length Subnet Masks (VLSM)


 A Variable Length Subnet Mask (VLSM) is a means of allocating IP addressing
resources to subnets according to their individual need rather than some general
network-wide rule.
 VLSM allows an organization to use more than one subnet mask within the same
network address space. It is often referred to as ‘subnetting a subnet’, and can be used
to maximize addressing efficiency.
 Large subnets are created for addressing LANs and small subnets are created for WAN
links (a 30 bit mask is used to create subnets with only two host).

Basic Subnetting vs. VLSM


• Basic subnetting allows you to divide big networks into smaller, equal-sized slices.
• VLSM allows you to divide big networks into smaller, different-sized slices. This
enables you to make maximum use of your valuable IP address space.
• So basically, you are now utilizing subnet masks in the same IP address space.

Implementing VLSM Networks


1. To create VLSMs quickly and efficiently, you need to understand how block sizes and
charts work together to create the VLSM masks.
9
Page
2. The next step is to create a VLSM table.

Example 1:
192.168.10.0/27 192.168.10.32/27

25 hosts 20 hosts
Network A Network B

192.168.10.92/30

192.168.10.88/30
192.168.10.100/30
192.168.10.96/30

6 hosts 12 hosts
Network D Network C

192.168.10.80/29 192.168.10.64/28

Class C Network 192.168.10.0

Network Hosts Block Subnet Masks


A 25 32 /27 224
B 20 32 /27 224
C 12 16 /28 240
D 6 8 /29 248
E 2 4 /30 252
F 2 4 /30 252
10

G 2 4 /30 252
2 4 /30 252
Page

H
Example 2:

Example 3:

Example 4:
Which Network Prefix will work with the IP addressing Scheme shown? 11
Page
Example 5:
Which IPv4 Subnetted addresses represent host addresses?
 192.168.4.127/26
 192.168.4.155/26
 192.168.4.193/26
 192.168.4.95/27
 192.168.4.159/27
 192.168.4.207/27

Example 6:
The Big Five Questions
1. How many Subnets ?
 2n = number of subnets , n = no. of bits borrow
2. How many Hosts per Subnets?
 2m -2 , m = no. of bits in the host portion
3. What are the valid subnets ?
 256 – subnet mask = Block size or increment number
4. What is the broadcast address of each subnet ?
 The number right before the next subnet
5. What are the valid hosts ?
 Valid hosts are the numbers between the subnets , omitting all0’s and all 1’s

Example 7:
Calculate & Assign Addresses

12
Page
Example 8:
Calculate Addresses for Host Requirements.

Example 9:
Using the following options, select the necessary IP addresses that would accurately complete
the network depicted in the exhibit. (Choose three)

Example 10:
You are designing an IP addresses scheme for your brand-new remote office. The vice president
of IT calls to tell you that you will be in charge of the 192.168.1.64/26 subnetwork. This supplies
you with a single subnetwork with 62 hosts. You need to have at least two subsets with 14 host
in each subnet. What custom subnet mask should use?
13
Page
Example 11:
Given the subnet 10.5.12.0/22, which of the following IP addresses residing within the network?
(Choose three)

Example 12:

Example 13:

Example 14:

14
Page
Example 15:
Identify three valid addresses in any subnet of the 201.168.27.0 network, assuming a fixed
subnet mask of 255.255.255.240. (Choose three)

Example 16:
TooCow University has acquired the 150.60.130.0/24 public address from the local ISP to use
in its campus network. Each building has a specific number of devices that are required to be
publicly accessible, as shown in the exhibit.
Which of the following subnets would accommodate the network shown? (choose 4)

Example 17:
You have been allocated the address space 174.82.10.0/24 for the network shown in the exhibit.
All devices in this network are required to use the same subnet mask, and all subnets are
considered usable.
What is the most appropriate subnet mask for the network that is shown?
15
Page
Example 18:
You are a network technician at Acme, Inc. You have subnetted the 192.168.72.0 network with
a /30 mask for connections between your routers. Your boss asks you how many usable
subnetworks and usable host addresses per subnet this will provide.
What should you tell her, assuming your router can use all possible subnets?

Example 19:
After the routers shown in the exhibit have been configured, it is discovered that the hosts in the
branch office network cannot access the internet. Further testing reveals connectivity issues.
What is the most likely solution to this problem?

16
Page

You might also like