TechKnowSurge
Cisco CCNA 1.6 CompTIA Network+ 1.7 Cisco CCST Networking 2.2
VideoNetworkFree

DEMO: How Many Bits to Borrow

Subnetting requires choosing the right number of bits to borrow based on how many networks and hosts are needed. This topic covers how to use subnet reference tables to find that number for Class B and Class C addresses across a range of real scenarios.

Complete this video to capture a CTF flag worth 1 point.

About this video

Subnetting a network requires a deliberate decision about how many bits to borrow from the host portion of an address, and that decision is driven entirely by two factors: the number of networks needed and the number of hosts required per network. A standard reference table maps each possible borrowing value to a corresponding subnet mask, network count, and host count, making it possible to evaluate options side by side. The goal is to find the smallest value in each column that meets or exceeds the actual requirement, then place the network-host boundary at a point that satisfies both conditions simultaneously. When no single line can meet both needs at once, that address class cannot support the design and an alternative must be considered. In many cases, more than one borrowing value will satisfy the requirements, which introduces a planning decision. If host counts are expected to grow, borrowing fewer bits preserves more address space per subnet. If the number of network segments is more likely to expand, borrowing more bits provides that headroom instead. When growth direction is uncertain, a middle option often offers the best balance. This same evaluation process applies consistently across Class B and Class C address spaces, and building fluency with it is foundational to all subnetting work that follows.

What you'll learn

What's covered

Determining Bits to Borrow

Aligned to

Cisco CCNA
1.6 Configure and verify IPv4 addressing and subnetting
CompTIA Network+
1.7 Given a scenario, use appropriate IPv4 network addressing
Cisco CCST Networking
2.2 Identify IPv4 addresses and subnet formats

Key terms

Subnet
A logical subdivision of an IP network, used to organize and segment network traffic.
Subnet Mask
A 32-bit number that divides an IP address into network and host portions.
IP Address
A numerical label assigned to each device connected to a network that uses the Internet Protocol.
Classful Addressing
An early IPv4 addressing scheme that divided the address space into fixed classes (A, B, and C for hosts; D for multicast; E reserved) based on the leading bits of the address, with each class defining a fixed boundary between the network and host portions. Classful addressing was replaced by CIDR because it wasted large blocks of address space.
Bits Borrowed
The number of bits taken from the host portion of an IP address to create additional subnet identifiers, directly controlling the trade-off between number of subnets and number of hosts per subnet.
Network Growth
The anticipated increase in the number of subnets or hosts on a network, used as a factor when selecting how many bits to borrow during subnetting.

Transcript

Up until now we've talked a lot about borrowing these bits and seen what that looks like, but what we haven't talked about is how many bits do we borrow. Let's talk about how we determine how many bits to borrow.

This is one of the tables we created earlier. We have the number of bits borrowed for a class address, the subnet mask, the number of networks that gives us, and the number of hosts. We really adjust this based off of the number of networks it's going to give us and the number of hosts that it's going to give us, and what our needs are is going to determine how many bits we borrow.

This table right here gives us some of the exact same information. If we look at this, it has the number of bits borrowed, it shows us the mask that that would be, it shows us how many hosts that would render and how many networks that would render. This is the table that we're going to use moving forward.

If I were to borrow zero, then that would give me 254 hosts — that's that 256 possibilities minus the network and the broadcast, which gives us 254 hosts. If I were to move the line and borrow one bit right here, then that would give us 2 networks and 126 hosts. If I were to move the line again, that would give us 4 networks and 62 hosts. So you can see, by moving this line I can determine how many networks and how many hosts we can get out of wherever we put that line.

Working through scenarios

Here's a table with a lot of different scenarios. Here is a different amount of networks that we're going to need, and a different amount of hosts that we're going to need. We're going to determine, for each one of these, how many bits are we going to borrow.

If I need to borrow to meet 23 networks, I'm going to look at this: 2 wouldn't cut it, 4 wouldn't cut it, 8 wouldn't cut it, 16 wouldn't cut it, 32 is the magic number here. Since 23 fits into 32, 32 would cover us for those 23 networks. I also need 4 hosts, so if I look at this, 2 wouldn't cut it, 6 would though. So this is where I want to draw the line between how many networks that we have or need and how many hosts that we need. So I'm borrowing five bits for the network. This is going to be the network portion right here, and these are going to be the host portions right there. So how many bits am I going to borrow? I'm going to borrow five.

Let's do one more. In this case I just need 1 network and I need 130 hosts. If I look at hosts, I've got to go all the way over: 126 wouldn't cut it, so I'd have to go to 254. I'd have to draw the line right here, which would still give me my one network. So how many bits would I borrow? This would be zero.

I do want to point out one thing. Here at the last part right here, we say that we want 9 networks, and if I were to pick that out I would need at least the 16. And I need 18 hosts, so 14 wouldn't cut it — that would be this 30 right here. So in that scenario I can't draw the line. I can't use this class C address and draw a line that meets both needs, so I put an X in that last one.

Scenarios with more than one answer

There are some other scenarios. Let's look at this first scenario. In this first scenario I need 2 networks, and so what I'm going to do is find what meets that need, which is just borrowing one bit. I could draw the line right there. Also, I need at least 15 hosts. 14 wouldn't cut it, so I couldn't draw the line there; 30 would work, so I could draw the line there. So I've got two options. In fact, I actually have a third option, because I could draw the line right there as well. So in here I can draw the line so that I can borrow one, two or three bits and still meet this condition.

Choosing which line to use

At some point in time we are going to need to make a decision on how many bits we're going to borrow. In this first scenario I needed 2 networks and I needed at least 15 hosts, and so I could draw the line here, here or here. So which line do I actually choose when I go to subnet?

In this scenario right here, if I thought the number of hosts were going to grow and I needed more flexibility with that, I would choose this line right here, because that would give me growth — I could grow to 62 or even 126 and still be fine. So therefore I'm going to borrow one bit in that scenario.

But let's say I think that my hosts aren't going to grow, and instead I'm actually going to grow the number of networks that I have. In that scenario right there, what I might need to do is grow to four or six or eight networks, and so therefore I would choose three instead.

Or, if I think that I just want to leave room for either one — whether I want to grow how many networks I have or grow how many hosts I have — then I'm going to choose the in-between option, number two, and go with that one. So there is some flexibility with this. In fact, most of the time what I would probably do is shoot for growth on either side. That would be the answer of two here, allowing for growth for the number of hosts and for the number of networks.

Class B and Class C

When we're talking about a Class B and a Class C, really the scenario is no different — you're going to go through the same process. Let's take a look at what it looks like with a Class B. Here we're shooting for 8 networks, so I can circle this; this is one way, we can draw the line right here. I'm also looking for 4,100 hosts. 4,094 is just under, so I can't use that one, but this 8,190 works right here. So the answer to this is three bits. I can only borrow three bits.

Hopefully you're doing really well with this. If not, I would recommend you continue to practice this and get this down. These are going to be very critical moving forward; you need to understand these concepts.

About TechKnowSurge

TechKnowSurge builds IT and cybersecurity professionals through hands-on, concept-first training built around real understanding — not memorization. Free interactive tools, structured programs, and 25+ years of real-world experience, all in one place.

Explore free tools and programs →