Mastering IP Subnetting
Introduction to IP Addressing
Your Device's Mailing Address
Every device connected to a network, from your laptop to your smart fridge, needs a unique identifier to send and receive information. This identifier is called an Internet Protocol (IP) address. Think of it as a mailing address for your device in the digital world.
An IP address ensures that the cat videos you requested from a server in California find their way to your specific phone, and not your neighbor's.
The most common version you'll see is IPv4 (IP version 4). An IPv4 address is a 32-bit number, but to make it easier for humans to read, it's written as four numbers separated by dots. This is called dotted-decimal notation.
Anatomy of an IPv4 Address
Each of the four numbers in an IPv4 address is called an octet, because it represents eight bits of the full 32-bit address. Since eight bits can represent 256 different values, each octet can be a number from 0 to 255.
octet
noun
A group of eight binary digits or bits. In the context of IPv4, it refers to one of the four numbers that make up the address.
Let's look at a typical IP address: 192.168.1.10. In binary, it looks much more complex.
Network vs. Host
An IP address isn't just one long, random number. It's split into two distinct parts: the network portion and the host portion.
- Network Portion: This identifies the specific network the device is on. It's like the street name and zip code of a physical address.
- Host Portion: This identifies the individual device on that network. It's like the house number.
This division is critical for routing. When a data packet is sent across the internet, routers only need to read the network portion to get it to the correct neighborhood. Once it arrives at the local network, the host portion is used to deliver it to the specific device.
The Role of the Subnet Mask
How does a computer know where the network portion ends and the host portion begins? It can't tell just by looking at the IP address. It needs a helper called a subnet mask.
A subnet mask looks just like an IP address (e.g., 255.255.255.0), but its job is to act like a filter. It tells the device which bits of the IP address belong to the network and which belong to the host.
In a subnet mask's binary form, the 1s correspond to the network portion of the IP address, and the 0s correspond to the host portion.
For example, the common subnet mask 255.255.255.0 is 11111111.11111111.11111111.00000000 in binary. The first 24 bits are 1s, and the last 8 bits are 0s. This tells a device that for any IP address it's paired with, the first three octets are the network address and the last octet is the host address.
| Item | Dotted-Decimal | Binary Representation |
|---|---|---|
| IP Address | 192.168.1.10 | 11000000.10101000.00000001.00001010 |
| Subnet Mask | 255.255.255.0 | 11111111.11111111.11111111.00000000 |
| Result | ||
| Network Portion | 192.168.1.0 | 11000000.10101000.00000001 |
| Host Portion | 10 | 00001010 |
By applying the subnet mask, the device can instantly determine that its network is 192.168.1 and its unique identifier on that network is 10. This simple mechanism is the foundation of how data gets routed correctly across billions of devices.
What is the primary function of an Internet Protocol (IP) address?
An IPv4 address is composed of four numbers separated by dots. What is each of these numbers called?