In Class B IPv4 addressing, the network portion is defined by the first two octets, based on the default subnet mask 255.255.0.0. This explains why 172.16.x.x uses 172.16 as the network and 45.100 as the host, and contrasts with Class A and Class C boundaries, helping you visualize classful boundaries.

Multiple Choice

In a Class B IPv4 address, how many octets identify the network portion?

In classful IPv4 addressing, the boundary between the network and host portions is determined by the address class. For Class B, the default subnet mask is 255.255.0.0, so the first two octets identify the network and the remaining two octets identify hosts within that network. That means the network portion consists of two octets (16 bits). For example, in an address like 172.16.45.100, the network is 172.16 and the host is 45.100. If you think about the other extremes, one octet would correspond to the network portion in Class A, and three octets would correspond to the network portion in Class C, but for Class B the network part is two octets.

IPv4 and the idea of “networks” vs. “hosts” often feels like a puzzle you solve with a map and a lot of color-coded stickers. But at its heart, Class B addressing is a straightforward rule: the network portion of the address, in the classic classful scheme, is defined by the first two octets. That’s 16 bits of network, 16 bits of host. If you picture an IPv4 address as a little four-room apartment, Class B says the first two rooms are the hallway that identifies the building’s network, and the remaining two rooms are the living space for hosts inside that network.

Let’s set the scene with a quick refresher on how Classful addressing used to work. Before the widespread adoption of CIDR (Classless Inter-Domain Routing), IP addresses were divided into five classes—A through E—with each class sporting a default subnet mask. The subnet mask is like a stencil that marks which part of the address pinpoints the network and which part pinpoints the host. Class A had a default mask of 255.0.0.0, meaning the first octet was the network, and the remaining three octets were for hosts within that network. Class C used 255.255.255.0, leaving the first three octets for the network and the last octet for hosts. Class B sits right in the middle with 255.255.0.0, so the first two octets—two octets, 16 bits—identify the network, while the last two octets—two octets—identify the hosts.

Here’s the practical takeaway: for a Class B address, the boundary between network and host is located after the second octet. This means any address that starts with a number in the Class B range has its network portion in the first two octets. The typical example you’ll see is something like 172.16.45.100. In this case, 172.16 is the network, and 45.100 is the host portion. That 172.16 is what a router would look at to decide which network the packet is heading toward, while the 45.100 part tells the devices within that network which specific device should receive the packet.

A little historical context helps you see why this matters. The classful system was simple and didn’t require heavy-duty arithmetic to figure out routing tables, which was kind of perfect when networks were smaller and the internet was a different beast. As the internet grew, the rigid boundaries started to creak. Enter CIDR in the 1990s—a flexible way to define networks of any size by using variable-length subnet masks. CIDR essentially relaxed the hard two-octet network rule. You can, with CIDR notation, carve networks into many shapes: a single /24 (255.255.255.0) for a small network, or a /16 (255.255.0.0) for a larger one, and everything in between. The old Class B rule still pops up in education and legacy documentation, so it’s good to know, but the modern internet mostly operates with CIDR.

If you’re ever confronted with a Class B address in a learning context or in a lab scenario, here are a few practical checks you can run mentally or on paper:

  • Look at the first octet: Class B addresses fall into the range 128.0.0.0 to 191.255.0.0. That range is a quick visual cue that you’re dealing with Class B.

  • Verify the default mask: For Class B, the baseline mask is 255.255.0.0. This is your mental scaffold; it tells you that the network part sits in the first two octets.

  • Extract the network: In 172.16.45.100, the network is 172.16. If you’re given something like 130.45.12.7, the network is 130.45.

  • Think about the host range: The remaining two octets (the last two numbers) identify devices within that network. They can range from 0.0 to 255.255, but in real networks, you’ll see some ranges reserved for special addresses or subnetting rules, depending on the plan.

One fun way to internalize this is to imagine the IPv4 address as a postal address. The first two sections, like “State” and “City,” guide the mail to the correct region. The last two sections—“Street” and “House number”—pinpoint the exact recipient within that region. For Class B, you’re lumping more addresses into a single network region than Class A (where you’d have a wider region with a single octet for the network) but less than Class C (where the network is tighter, with three octets identifying the network). It’s a Goldilocks zone in the old scheme, neither too big nor too small.

Digging a bit deeper, there’s an interesting nuance in how these networks were actually used. In a Class B network, you could have a lot of hosts—up to 65,534 usable addresses per network, because you reserve the all-zero and all-ones host addresses for special purposes in classic implementations. That’s a lot of devices, from workstations to printers to servers, all living inside the same network address space. It makes a certain kind of sense: large organizations didn’t want to fragment into many tiny networks when they didn’t need to, so Class B gave them room to grow without shouting too loudly about subnetting.

Subnets add another layer of flavor to the story. Even though the default for Class B is 255.255.0.0, network engineers often subdivide that big chunk into smaller pieces using subnet masks. This is where the net becomes a little more granular, and the line between network and host doesn’t stay fixed at two octets anymore. For instance, a 172.16.0.0/24 network (mask 255.255.255.0) carves out a chunk where the first three octets identify the network and the last octet is for hosts. It’s like taking that roomy two-bedroom place and partitioning it with a clever floor plan so you can host multiple departments or teams with their own address spaces.

Why does this matter beyond memorizing a fact for a quiz, you might wonder? Because IP addressing shapes how data travels across the internet and local networks. It influences routing decisions, network design, and even how security policies are applied. When you map devices in a Class B environment, you’re laying a mental blueprint of how traffic should flow. If you’ve ever configured a router, you’ve probably encountered the concept of a network ID and host ID staring you in the face, and this is where the old classful intuition resurfaces—still useful as a foundational lens, even if the day-to-day practice uses more flexible masks now.

Let me switch gears briefly and offer a couple of everyday analogies you can carry with you. Think of a Class B network as a city with a big neighborhood. The first two octets—your network part—are like the ZIP code that tells you which neighborhood you’re in. The last two octets are the exact street and house number. In our example, 172.16 is the neighborhood, and 45.100 is the precise home. If you zoom out, you’ll notice that changing the second octet shifts you to a different neighborhood within the same broad city class. That’s the segmenting logic at a glance.

Another angle: in real networks, you’re rarely bound to static, textbook numbers forever. You might see professionals mention “classful addressing” as a historical stepping stone while using CIDR to tailor address space to real needs. CIDR feels a lot like moving from rigid fashion to a more tailored wardrobe. You pick a mask that fits the size of your network, not a one-size-fits-all. And that flexibility is part of why the IPv4 story still matters, even as we talk about IPv6 more these days. It’s good to understand where the two roads diverged: the old two-octet network boundary that defined Class B, and the modern, more fluid approach that helps networks scale in a world with billions of devices.

If you’re teaching this to someone new, or you’re just trying to solidify the concept in your own head, you can test yourself with a few quick exercises. Take an address from the Class B family, like 150.75.20.5. Identify the network portion by the default mask, and then imagine how you’d subnet it if you needed, say, 300 subnets. You’d tweak the mask to borrow bits from the host portion, effectively deciding how many network bits you want to keep and how many you’re comfortable allocating to subnets. It’s like carving a garden plot: you decide how many hedges (subnets) you want, and you shape the rest to fit the plants (hosts).

A gentle reminder as you navigate this topic: the world of IP addressing is as much about rules as it is about pragmatism. The classful framework is a stepping stone—an important one—that helps you understand why things are arranged the way they are. But the actual routing backbone of the internet loves flexibility. CIDR’s arrival didn’t erase the old wisdom; it reframed it. Knowing that Class B uses two octets for the network is like having a reliable compass to orient yourself when you’re learning about networks, configuring equipment, or even just reading technical material that still references the traditional boundaries.

So, to circle back to the core idea in a simple, memorable line: in a Class B IPv4 address, the network portion is identified by the first two octets. It’s 16 bits of network, followed by 16 bits of host. That crisp division kept networks organized for a long stretch of the internet’s early growth, and it still surfaces in education and legacy contexts as a handy mental model. If you picture that address as a two-room network with a two-room living area, the logic becomes almost instinctive.

As you go forward, you’ll see the same pattern reappearing in different forms. You’ll encounter subnetting, route summarization, and the practical realities of IP address allocation. Each layer adds nuance, but the core idea remains a reliable anchor: two octets for the network, two for the hosts, in the classic Class B scheme. And when you pair that anchor with the broader, modern toolkit of networking—CIDR, VLSM, and smart subnet design—you’ve got a robust framework for understanding how devices stay connected, share information, and navigate the digital world.

If you’re curious to explore further, you can look into real-world examples of Class B allocations within organizations, or observe how a lab network is subdivided into practical subnets for different departments. It’s one thing to memorize the rule, another to see how it translates into real traffic patterns, planning, and performance. The two-octet network boundary is more than a trivia item; it’s a window into how early networking thinkers organized the globe of addresses, and how those decisions echo in today’s more nimble, space-efficient addressing schemes.

And that’s the story of Class B: a clean, tidy split that made sense in a world of smaller scales and fewer devices, with a lineage that stretches into the flexible, modern IP world we inhabit now. The network portion is two octets—a simple truth with a long, ongoing lineage in the way networks are designed, documented, and understood. If you remember nothing else, remember this neat fact, and you’ll have a sturdy stepping stone to more advanced subnetting concepts, layered by context, and kept lively by real-world examples and a little bit of curiosity.