IPv4 Addressing Fundamentals: Structure, Classes, and Subnet Masks

Every device on an IPv4 network needs a unique address that encodes both which network it belongs to and its specific identity within that network. This article explains the structure of an IPv4 address, the historical concept of address classes, how subnet masks define the boundary between network and host portions, and the essential commands for viewing and verifying IP addressing on a Cisco device.

IPv4 AddressingSubnet MaskNetwork and Host Portion

~4 دقیقه مطالعه · آخرین به‌روزرسانی ۱۸ شهریور ۱۴۰۵

The Structure of an IPv4 Address

An IPv4 Address is a 32-bit number, conventionally written as four decimal numbers separated by dots (called Dotted-Decimal Notation), with each number representing one 8-bit group called an Octet.

Example address: 192.168.1.10

Binary breakdown:
192       .168      .1        .10
11000000  .10101000 .00000001 .00001010

Each octet ranges from 0 to 255,
since 8 bits can represent 2^8 = 256 distinct values

Every IPv4 address logically splits into two parts: a Network Portion, identifying which network the device belongs to, and a Host Portion, identifying the specific device within that network. Where exactly this split occurs is determined by the subnet mask, discussed below.

Historical Address Classes

IPv4 addressing originally used a rigid Classful system, dividing the address space into classes with fixed network/host boundaries. While largely obsolete for modern network design, this classification still influences default behaviors and terminology used throughout networking today.

Class A: 1.0.0.0   - 126.255.255.255  (default mask /8)
Class B: 128.0.0.0 - 191.255.255.255  (default mask /16)
Class C: 192.0.0.0 - 223.255.255.255  (default mask /24)
Class D: 224.0.0.0 - 239.255.255.255  (multicast, not for hosts)
Class E: 240.0.0.0 - 255.255.255.255  (reserved, experimental)

Modern networks almost universally use Classless addressing instead, discussed later in this series regarding VLSM and CIDR, which allows the network/host boundary to fall anywhere rather than being fixed by class — but understanding the classful ranges remains useful for recognizing default behaviors in older configurations and certain protocol defaults.

The Subnet Mask: Defining Network and Host Boundaries

A Subnet Mask is a 32-bit value that marks which bits of an IP address belong to the network portion (represented by binary 1s) and which belong to the host portion (represented by binary 0s).

Address:      192.168.1.10
Subnet Mask:  255.255.255.0
Binary mask:  11111111.11111111.11111111.00000000

The first 24 bits (three full octets) are network bits,
the last 8 bits are host bits

This is commonly written in CIDR notation as /24,
indicating 24 network bits

Performing a bitwise AND between an address and its subnet mask reveals the Network Address — the address representing the network itself, not any specific host on it.

192.168.1.10   AND   255.255.255.0
= 192.168.1.0    (the network address)

This means devices with addresses 192.168.1.1
through 192.168.1.254 all belong to the same
192.168.1.0/24 network

Special Addresses Within Every Subnet

Within any subnet, two addresses are reserved and cannot be assigned to a host device.

For the 192.168.1.0/24 network:

Network Address:   192.168.1.0   (all host bits = 0)
                    identifies the network itself

Broadcast Address: 192.168.1.255 (all host bits = 1)
                    reaches every device on that subnet

Usable host range: 192.168.1.1 - 192.168.1.254

Sending a packet to the broadcast address delivers it to every device on that local subnet simultaneously — a mechanism used by protocols like ARP and DHCP, which require reaching all devices before a specific unicast address is even known.

Configuring and Verifying IP Addressing on a Cisco Device

Router(config)# interface gigabitethernet 0/0
Router(config-if)# ip address 192.168.1.1 255.255.255.0
Router(config-if)# no shutdown

Router# show ip interface brief

Interface              IP-Address      Status    Protocol
GigabitEthernet0/0      192.168.1.1     up        up
GigabitEthernet0/1      unassigned      down      down

show ip interface brief is one of the most frequently used verification commands in daily operations, providing an immediate summary of which interfaces have addresses assigned and whether they are operationally up — the first command most administrators run when checking a device's basic connectivity status.

Private Versus Public Addresses

Certain address ranges are reserved by standard for Private use within internal networks, never routed across the public internet directly.

Private address ranges (RFC 1918):
10.0.0.0        - 10.255.255.255    (10.0.0.0/8)
172.16.0.0      - 172.31.255.255    (172.16.0.0/12)
192.168.0.0     - 192.168.255.255   (192.168.0.0/16)

These ranges are used extensively inside homes and enterprises specifically because their limited global supply of public IPv4 addresses made reusing the same private ranges across countless separate networks necessary — a device using a private address relies on Network Address Translation, covered later in this series, to communicate with the public internet.

Why IPv4 Addressing Fundamentals Underlie Everything That Follows

Every subnetting calculation, routing protocol, and access control list covered later in this series operates directly on the network and host address structure introduced here. Fluently converting between dotted-decimal and binary representations, and immediately recognizing which addresses belong to the same subnet, is a foundational skill that every subsequent networking topic assumes as a prerequisite.

نوشته و پژوهش‌شده توسط دکتر شاهین صیامی

مقالات مرتبط

Systematic Network Troubleshooting: A Methodology Tying Everything Together

Every protocol and technology covered throughout this series is only useful if a problem involving it can actually be diagnosed and fixed efficiently under real-world pressure. This article presents a systematic troubleshooting methodology built around the OSI layers, walks through applying it to a realistic connectivity problem, and shows how the specific verification commands covered throughout this entire series fit into a structured diagnostic process.

ادامه

NETCONF, YANG, and Python: Programmatic Network Configuration at Scale

The REST APIs and JSON/YAML formats covered earlier in this series represent one approach to network automation, but NETCONF and YANG provide a more structured, standards-based alternative purpose-built for network device configuration. This article explains what distinguishes NETCONF from a simple REST API, covers how YANG models define exactly what configuration data looks like, and walks through using Python to programmatically interact with network devices.

ادامه

IPsec VPN Fundamentals: Securing Traffic Across Untrusted Networks

Connecting two sites across the public internet exposes traffic to interception unless it is properly encrypted, and IPsec provides the standard framework for building secure, authenticated tunnels between sites. This article explains the two-phase IKE negotiation process, covers the distinction between AH and ESP protocols, walks through configuring a basic site-to-site IPsec VPN, and covers essential verification commands.

ادامه

MPLS Fundamentals: Label Switching Explained

Traditional IP routing requires every router along a path to perform a full routing table lookup on every packet, but MPLS takes a fundamentally different approach by making that forwarding decision once and attaching a simple label that every subsequent router can use instead. This article explains the core label-switching concept, walks through how the Label Distribution Protocol builds the label forwarding tables that make this possible, and covers the practical benefits MPLS provides in real provider networks.

ادامه

BGP Route Reflectors and Confederations: Scaling iBGP Beyond Full Mesh

The iBGP full-mesh requirement, briefly mentioned earlier in this series, becomes a serious scaling problem as an autonomous system grows, requiring a number of sessions that increases quadratically with router count. This article explains exactly why full mesh does not scale, walks through how route reflectors solve this by relaxing BGP's normal route-propagation rules, and covers confederations as an alternative approach that divides a single AS into smaller sub-autonomous systems.

ادامه

OSPF Area Types Deep Dive: Stub, Totally Stubby, and NSSA

Multi-area OSPF, covered earlier in this series, already reduces database size by separating a network into areas, but OSPF offers further specialized area types that reduce routing table size even more aggressively by filtering out unnecessary external routes entirely. This article explains the LSA types that must be suppressed to create each specialized area type, walks through configuring stub, totally stubby, and not-so-stubby areas, and covers the specific trade-offs each design choice involves.

ادامه