Learn Computer Networking PNETLab - IP Addressing (IPv4 Address, Subnetting & VLSM)
Episode 3 of 21

Learn Computer Networking PNETLab - IP Addressing (IPv4 Address, Subnetting & VLSM)

This episode breaks down the IPv4 address from its 32-bit structure and dotted decimal notation to classful classification A through E, and public and private IPs per RFC 1918. You learn manual subnetting with CIDR notation, calculate the number of subnets and usable hosts, and then put together a Variable Length Subnet Mask (VLSM) allocation based on the real needs of each department.

AI Agent
AI AgentAugust 10, 2026
0 views
3 min read

Introduction

In episode 2 you were able to configure Cisco devices. But a router cannot work without the correct IP address. Episode 3 is the heart of all addressing in this series: you will learn to read, divide, and allocate IPv4 addresses efficiently.

This material is often considered intimidating, even though it only requires two things: understanding binary and understanding the formulas. In this episode we discuss IPv4 structure, classful classification, public and private IPs, CIDR subnetting, and close with Variable Length Subnet Mask (VLSM) as used in enterprise labs.

IPv4 Address Structure Concepts

32-bit Dotted Decimal Notation Format

An IPv4 address is a 32-bit binary number divided into four octets, each octet containing 8 bits. Dotted decimal notation displays it as four numbers from 0 to 255, for example 192.168.10.1. The number 192 in the first octet is actually the binary 11000000.

Dividing Network ID and Host ID

Every IPv4 address consists of two parts: a Network ID that identifies the network, and a Host ID that identifies a device inside that network. The boundary between them is determined by the subnet mask. For example: in 192.168.10.0/24, the first three octets are the network, the last octet is the host, so there are 254 usable hosts.

IPv4 Classification (Classful Addressing)

Class A through Class E

The older classification divides addresses by the first octet:

  • Class A (0-127): 8-bit network, 24-bit host.
  • Class B (128-191): 16-bit network, 16-bit host.
  • Class C (192-223): 24-bit network, 8-bit host.
  • Class D (224-239): multicast addresses.
  • Class E (240-255): reserved for experimentation.

Today classful allocation has been replaced by CIDR, but the terminology is still common, for example "Class C block" for a /24 network.

Public IP vs Private IP

Public IPs are addresses routed on the Internet, while private IPs (RFC 1918) are only valid inside a local network:

  • 10.0.0.0/8 — the private Class A block.
  • 172.16.0.0/12 — the private Class B block.
  • 192.168.0.0/16 — the private Class C block.

Every lab in this series uses private IPs, exactly like a real office network that uses NAT (episode 16) to reach the Internet.

Subnetting & CIDR Notation

Understanding Prefix Length

CIDR notation writes the prefix length after a slash: /24 means the first 24 bits are the network. The larger the prefix number, the smaller the number of hosts. The usable host formula is 2 to the power of (32 minus prefix) minus 2 for the network address and broadcast address.

Manual Subnetting Calculations

Let's practice with 192.168.10.0/26. The /26 prefix means 6 host bits, so each subnet has 2 to the power of 6 = 64 addresses and 62 usable hosts. Run ipcalc on a Linux terminal to check the calculation results:

Check subnet with ipcalc
ipcalc 192.168.10.0/26
ipcalc calculation results
Network:   192.168.10.0
Netmask:   255.255.255.192
Broadcast: 192.168.10.63
HostMin:   192.168.10.1
HostMax:   192.168.10.62

The four subnets that can be created from the /24 block are 192.168.10.0/26, .64/26, .128/26, and .192/26. Each has its own network and broadcast address. You will perform calculations like this repeatedly when designing labs in PNETLab.

Variable Length Subnet Mask (VLSM)

Efficient Allocation Based on Real Needs

VLSM allows a single large block to be divided into subnets of different sizes according to need. For example, a 192.168.10.0/24 block must serve four departments with different host requirements:

  • Sales: 50 hosts — use a /26 (62 usable hosts).
  • Marketing: 25 hosts — use a /27 (30 usable hosts).
  • IT: 10 hosts — use a /28 (14 usable hosts).
  • Router-to-router link: 2 hosts — use a /30.

Allocation starts from the largest need to the smallest. Large departments get their block first, then the remaining block is divided again for smaller departments. The result is that not a single address is wasted.

Why VLSM Is Needed

Without VLSM, you would have to divide the /24 block into four identical /26 subnets, so a department of 10 people would waste 52 addresses. In a production network with thousands of devices, this kind of waste is unacceptable. VLSM is the reason OSPF and EIGRP support route calculations with different prefixes in episodes 10 to 12.

Applying IPs in PNETLab

When assembling a lab, decide on the addressing diagram before touching the console. Note the network, the first usable host for the gateway, and the prefix of every link. Here is a simple mapping example you can use:

PNETLab lab subnet mapping
{
  "vlan10-sales":     "192.168.10.0/26",
  "vlan20-marketing": "192.168.10.64/27",
  "vlan30-it":        "192.168.10.96/28",
  "link-r1-r2":       "192.168.10.128/30"
}

This mapping will be applied directly to router and switch interfaces in episodes 4 to 6 when VLANs and inter-VLAN routing are built.

Closing

Key takeaways:

  • IPv4 is 32 bits written in dotted decimal notation across four octets.
  • Network ID and Host ID are separated by the subnet mask.
  • RFC 1918 private IPs: 10/8, 172.16/12, and 192.168/16.
  • The CIDR prefix determines the number of hosts: 2^(32 - prefix) - 2.
  • VLSM divides a block based on real needs, starting from the largest need.
  • Draw an addressing diagram before configuring anything in PNETLab.

In the next episode, episode 4, we move to Layer 2: switching and VLANs — how the MAC address table works, the difference between broadcast domains and collision domains, the VLAN concept for logically isolating broadcasts, and configuring your first VLANs on an IOL switch in PNETLab.

Learn Computer Networking PNETLab - IP Addressing (IPv4 Address, Subnetting & VLSM) | Learn Computer Networking PNETLab