IP Addressing and Subnetting for Beginners: IPv4, IPv6, CIDR and Dual Stack Explained

IP Addressing and Subnetting: How IPv4/IPv6 and CIDR Define Network Boundaries

As someone new to networking, IP addresses can initially feel like something you just memorize: numbers starting with 192.168… and then expressions like /24, /26 on top of that. Most of the time, the IP topic is explained as “give the computer an IP and it will work,” and that’s it. But IP addressing — and especially subnetting (splitting into subnets) — is actually one of the most important topics that determines a network’s order. Because while on the Layer 2 side (switching) you manage traffic “within the same environment,” on the Layer 3 side (IP) the question becomes: “Where is this packet going, and what boundaries are we inside?”

For me, the turning point was this: I used to think an IP address was just a device’s identity. But IP also works like a map. Which devices are considered “local” to each other, which ones require “going out to the gateway,” how traffic should be routed in which direction… all of that depends on the IP plan.

In this article, step by step, I’ll build the following flow:

  • What does an IPv4 address actually tell us?
  • What does it mean to be “in the same network”?
  • Why do we need a subnet mask/CIDR?
  • How should I think about subnetting in a practical way?
  • Why did IPv6 emerge and how do we think differently about it?
  • Why is Dual Stack used and what does it look like in practice?

1) Starting to think at Layer 3: what does “the same network” mean?

On the switching side, devices within the same VLAN can somehow find each other. But on the IP side, the thing that decides whether two devices are “local” is the subnet mask (or the prefix written in CIDR form). The essence is this:

  • If two devices are in the same subnet, they try to reach each other directly (over L2): they do ARP, find the MAC address, and communicate.
  • If two devices are in different subnets, the packet is considered “not local,” and the default gateway comes into play.

So on the IP side, one of the most important questions is:
“Is this destination IP local to me, or not?”

And the answer is given by IP + subnet mask.

2) IPv4 address: four numbers, but actually two parts

An IPv4 address is 32 bits and is usually written as 4 octets:
Example: 192.168.10.25

But seeing this address as a single “ID number” makes subnetting harder to understand. A more accurate view is this: an IPv4 address consists of two parts:

  • Network part (the identity of the network)
  • Host part (the identity of the device)

The subnet mask (or CIDR like /24) tells us this separation.

For example:

192.168.10.25/24 means:

  • First 24 bits = network
  • Last 8 bits = host

In that case, other devices in the same network could be:

  • 192.168.10.1
  • 192.168.10.50
  • 192.168.10.200

Because the network portion stays the same: 192.168.10.x

But 192.168.11.25 would be a different subnet and would require a default gateway (in a typical /24 scenario).

What’s important here is to see the subnet mask as the “rule-setter”: the mask determines which bits are network and which are host.

3) Subnet mask/CIDR: its real job is drawing boundaries

When first learning subnet masks, most people (including me) simply memorize “255.255.255.0” and move on. But what the mask does is simple and extremely powerful:

“This part is network, this part is host.”

When written in CIDR, it becomes even clearer:

  • /24 → 24 network bits
  • /26 → 26 network bits
  • /16 → 16 network bits

Why is this so important? Because that boundary line determines how the network behaves:

  • Who is considered “local”?
  • What will the broadcast address be?
  • Which IP range belongs to this subnet?
  • How many devices can connect?

Subnetting is basically changing this boundary intentionally.

4) Why does subnetting exist? “Splitting a big network” is only one outcome

Subnetting is often explained as “dividing the network,” which is true. But its main purposes can be stated more concretely:

A) Managing traffic (especially broadcasts)

In the switching articles, we talked about broadcast domains. VLAN limits broadcasts at Layer 2. At Layer 3, subnetting works with a similar logic: smaller subnets mean more controlled areas.

B) Security and access control

Subnets create clear boundaries for routing and firewall rules. Policies like “this subnet can access that server, the other one cannot” are applied more cleanly with a subnet plan.

C) IP planning and order

In enterprise environments, distributing IP addresses randomly turns into chaos very quickly. Subnetting provides structure like “this department gets this range,” “servers are here,” “clients are there.”

So subnetting is not just math; it is a design decision.

5) Thinking about subnetting practically: moving from /24 to /26

For beginners, subnetting often creates a fear of “doing calculations.” The method that made it easier for me was this: first learn a /24 very well, then split it into parts.

/24 to start

192.168.10.0/24 means:

  • Network address: 192.168.10.0
  • Host range: 192.168.10.1 – 192.168.10.254
  • Broadcast: 192.168.10.255
  • Total usable hosts: 254

Now let’s say this network feels too big and you want to split it into smaller pieces. What happens if you make it /26?

What does /26 bring?

/26 means: I increased the number of network bits by 2 (24 → 26).
The number of host bits decreases, so each subnet has fewer devices — but the number of subnets increases.

When you split a /24 into /26, you generally get:

  • 4 subnets
  • 64 addresses per subnet (62 usable)

In practice, you can think of the ranges like this (blocks of 64 in the last octet):

  • 192.168.10.0/26 → 0–63
  • 192.168.10.64/26 → 64–127
  • 192.168.10.128/26 → 128–191
  • 192.168.10.192/26 → 192–255

In each block:

  • First address = network
  • Last address = broadcast
  • The middle range = usable hosts

This “block” logic turns subnetting from scary math into something manageable. Because what you really need to see is: subnetting is dividing IPs into specific blocks.

A building analogy helped me:

  • /24: one big building
  • /26: like dividing the same building into 4 separate apartments
    Each apartment has its own door and its own rules.

6) Why is the default gateway critical?

When talking about subnetting, you can’t skip the gateway. Because the subnet boundary determines the gateway’s role.

  • Two devices within the same subnet communicate directly.
  • Traffic going to a different subnet is sent to the default gateway.
  • The gateway then forwards the packet to the other subnet according to its routing table.

The classic beginner mistakes are:

  • Wrong gateway
  • Wrong subnet mask (thinking it’s the same network while actually creating different subnets)
  • IP conflict (two devices using the same IP)
  • Wrong DHCP scope (distributing the wrong mask)

That’s why an IP plan is not just “giving an address,” but making it meaningful with the correct mask and the correct gateway.

7) IPv6: why did it happen, and why do we need to “think differently”?

IPv6 is often brushed off as “IPv4 wasn’t enough.” That’s true — but what makes IPv6 harder to understand is trying to force it into an IPv4 mindset. In IPv6, some things were designed differently:

  • Address length is 128 bits (a much larger space)
  • Different notation (hex blocks)
  • In many places there is no “broadcast” concept; multicast is more common
  • Automatic addressing (like SLAAC) is used more widely

For a beginner, the most important idea in IPv6, in my opinion, is this:
IPv6 was built not just with address scarcity in mind, but with the idea of “more modern network behavior.”

But in practice, IPv4 is still everywhere, so we can’t just switch everything to IPv6 overnight. That leads to Dual Stack.

8) Dual Stack: why is “using both” normal?

Dual Stack means devices have both an IPv4 and an IPv6 address at the same time. Why do we need it?

  • Many services on the internet still use IPv4.
  • You want to test/build IPv6 internally, but not everything is IPv6 yet.
  • During the transition period, carrying both is the most practical approach.

In practice, Dual Stack looks like this:

  • Your computer has an IPv4 address (e.g., 192.168.10.50)
  • At the same time, it also has an IPv6 address (e.g., 2001:… )
  • The application uses whichever protocol works (often trying IPv6 first, then falling back to IPv4)

For beginners, the key point is: Dual Stack acts like a bridge between two worlds, but it can confuse troubleshooting. Because sometimes IPv4 works and IPv6 doesn’t — or the reverse. That’s why even in ping tests, seeing separations like “ping -6” is normal.

Closing: what do you gain by mastering IP and subnetting?

In this article, I especially wanted to show this: IP and subnetting are not just exam knowledge. They are a framework you use when designing networks, scaling them, and troubleshooting them.

While on the switching side you think “How does traffic flow?”, here you think “Within which boundaries does traffic stay?”

Once you understand IP and subnetting, these become easier:

  • When asking “Why is there no ping?” first checking mask/gateway/subnet
  • Spotting the wrong mask distributed by DHCP
  • Building the relationship between VLAN and subnet (L2 segment + L3 subnet)
  • Designing firewall/routing rules more logically