Hello! Welcome back to our exploration of the internet's core protocols.
In our last lesson, you mastered the essential skill of converting IPv4 addresses between the dotted-decimal notation we use and the binary format that computers understand. This is the foundation for everything that comes next.
Today, we'll build directly on that knowledge to address the learning outcome: Describe the structure of an IPv4 address (network and host portions). You'll discover that an IP address isn't just a single unique identifier; it's a structured address with two distinct parts. Understanding this structure is fundamental to how devices find each other on a local network versus across the vast internet.
The Two-Part Address: Street and House Number
An IP address works much like a postal address. A postal address has two main parts: the street name, which identifies a whole street, and the house number, which pinpoints a specific house on that street.
Similarly, an IPv4 address has two parts:
- The Network Portion: Identifies the specific network a device belongs to (the "street").
- The Host Portion: Identifies the specific device on that network (the "house number").
All devices on the same local network, like the computers, phones, and smart devices in your home, will share the same network portion in their IP addresses. They will each have a unique host portion.

To get a more intuitive feel for this, let's watch a video that uses this exact analogy.
what is an IP Address? // You SUCK at Subnetting // EP 1
This segment from NetworkChuck uses a great analogy of a street address to explain why the network and host portions are important for communication.
Watch the segment from 07:17 to 10:14. Pay close attention to how the video differentiates between communicating with a device on the same 'street' (network) versus a device on a different 'street'.
The Subnet Mask: Revealing the Structure
Looking at an IP address alone, there's no way to know where the network portion ends and the host portion begins. Is it after the first number? The second? The third?
This is where the subnet mask comes in. A subnet mask is a 32-bit number that accompanies an IP address. Its sole purpose is to "mask" the IP address to reveal which part is the network and which is the host.
Let's start with a simple rule of thumb.
what is an IP Address? // You SUCK at Subnetting // EP 1
The same video from NetworkChuck also provides a great introductory 'hack' to understanding how a subnet mask works at a high level.
Now, watch the segment from 05:04 to 07:17. This part explains the simple rule for interpreting a subnet mask: where you see 255, the corresponding part of the IP address is 'locked in' as the network portion. Where you see 0, that part is the host portion.
As the video explained, if your IP address is 192.168.1.100 and your subnet mask is 255.255.255.0:
- The first three
255s in the mask tell us that the first three octets of the IP (192.168.1) are the network portion. - The
0in the mask tells us that the last octet (100) is the host portion.
This means any device on this network will have an IP address that starts with 192.168.1.x.

The Binary Truth of the Mask
The 255.0.0.0 logic is a helpful simplification, but the real operation happens at the binary level. This is where your computer science background and our previous lesson on binary conversion come into play.
A subnet mask is a 32-bit binary number consisting of a continuous string of 1s followed by a continuous string of 0s.
- The
1s in the mask correspond to the network bits in the IP address. - The
0s in the mask correspond to the host bits in the IP address.
Let's watch a short video that visualizes this binary relationship perfectly.
This video from PowerCert Animated Videos clearly demonstrates how to align the binary IP address and subnet mask to see the network and host parts.
Watch these three short clips: 00:06 - 01:15: This introduces the concept and sets up the problem. 01:15 - 02:14: This explains the role of the subnet mask and the importance of binary. 04:44 - 06:15: This is the key part. It shows how the 1s and 0s in the mask's binary form directly identify the network and host portions of the IP's binary form.
Finding the Network Address with a Logical AND
Computers determine the network address (the "street name" itself, with the host part set to all zeros) by performing a bitwise logical AND operation between the IP address and the subnet mask.
Given your background, you're likely familiar with logical operators. In a bitwise AND:
1 AND 1 = 11 AND 0 = 00 AND 1 = 00 AND 0 = 0
When a computer performs this operation on a 32-bit IP address and its 32-bit subnet mask, the result is the 32-bit Network ID.
Let's see an example:
- IP Address:
192.168.1.65->11000000.10101000.00000001.01000001 - Subnet Mask:
255.255.255.0->11111111.11111111.11111111.00000000
Performing a bitwise AND:
11000000.10101000.00000001.01000001 (IP Address)
& 11111111.11111111.11111111.00000000 (Subnet Mask)
-------------------------------------
11000000.10101000.00000001.00000000 (Resulting Network ID)
Converting the result back to decimal gives us 192.168.1.0. This is the Network ID, or the address of the network itself.
The following reading explains this formal process in detail.
IPv4 Addressing – A Very Brief Review
This resource, 'IPv4 Addressing – A Very Brief Review', provides a clear, step-by-step guide on how the logical AND operation is used to find the Network ID. This formalizes the process we've been discussing.
Read the sections titled 'Phase I – A Very Brief Review' (starting from the paragraph 'Subnet masks use a continuous string of 1s...') through the end of the section that defines Network ID, Host ID, and Broadcast ID. Focus on how the logical AND operation is used to derive the Network ID from the IP address and subnet mask.
A quick note on history: this flexible system of using masks is called Classless Inter-Domain Routing (CIDR). It replaced an older, rigid system called Classful Addressing (Class A, B, C) where the network/host split was inflexibly determined by the first few bits of the IP address itself. CIDR and subnet masks give network engineers the power to create networks of almost any size, which is essential for the modern internet.
Conclusion
In this lesson, we dissected the structure of an IPv4 address, revealing the two fundamental components that govern how network traffic is routed.
Key Takeaways:
- An IPv4 address is divided into a network portion (the street) and a host portion (the house number).
- The subnet mask is a required companion to an IP address that defines the boundary between these two portions.
- In binary, the
1s in the subnet mask align with the network bits, and the0s align with the host bits. - A computer formally identifies the network address by performing a bitwise logical AND between the IP address and the subnet mask.
Preview of the Next Lesson:
Now that you understand the structure, we can explore its implications. In the next lesson, we will focus on the learning outcome: Explain the role of subnet masks in defining network boundaries. We will delve into how changing the subnet mask carves up the vast IP address space into smaller, manageable networks, a process known as subnetting. We'll also formally introduce the "slash notation" (e.g., /24) you may have seen, which is a shorthand for writing subnet masks.