Skip to content

INTERCEPT·DOC-2026-004-subnet

Subnetting Masterclass

FILED 2026-05-14·7 min read·NETWORK · TUTORIAL

IP addressing, MAC addresses, subnet masks, CIDR notation, and the math behind dividing networks.

Introduction to IP Addressing

An Internet Protocol (IP) address is a numerical label assigned to each device connected to a computer network that uses the Internet Protocol for communication. An IP address serves two main functions: host or network interface identification and location addressing.

IPv4 vs IPv6

IPv4 (Internet Protocol version 4)

  • Most widely used version.
  • 32-bit address, represented in dotted-decimal notation (e.g., 192.168.1.1).
  • Supports approximately $4.3 \times 10^9$ unique addresses.
  • Running out of addresses, leading to the need for IPv6 and techniques like NAT.

IPv6 (Internet Protocol version 6)

  • Newer version designed to replace IPv4.
  • 128-bit address, represented in hexadecimal notation separated by colons (e.g., 2001:0db8:85a3:0000:0000:8a2e:0370:7334).
  • Supports a vast number of addresses ($3.4 \times 10^{38}$), solving the address exhaustion problem.
  • Offers improved security features and more efficient routing.

Types of IP Addresses

IP addresses can be categorized based on their scope and assignment method.

. Public IP Address

A public IP address is a globally unique IP address assigned to a network device (like a router) that directly connects to the internet. These addresses are routable on the internet and are used to identify your network to the rest of the world.

. Private IP Address

Private IP addresses are used within a private network (like your home or office LAN) and are not routable on the internet. They are defined by RFC 1918. Devices within the same private network can communicate using these addresses. Common private IP ranges include:

  • 10.0.0.0 to 10.255.255.255
  • 172.16.0.0 to 172.31.255.255
  • 192.168.0.0 to 192.168.255.255

. Static IP Address

A static IP address is manually configured for a device and remains constant. It's often used for servers, printers, or other devices that need a consistent address for easy access.

. Dynamic IP Address

A dynamic IP address is automatically assigned to a device by a DHCP (Dynamic Host Configuration Protocol) server. These addresses can change over time. Most consumer devices (laptops, phones) use dynamic IPs.

MAC Address (Media Access Control Address)

While an IP address identifies a device on a network at the network layer (Layer 3 of the OSI model), a MAC address identifies a device at the data link layer (Layer 2).

  • A MAC address is a unique hardware identifier assigned to network interfaces (like an Ethernet card or Wi-Fi adapter) by the manufacturer.
  • It is a 48-bit address, typically displayed as six groups of two hexadecimal digits separated by hyphens or colons (e.g., 00-1A-2B-3C-4D-5E or 00:1A:2B:3C:4D:5E).
  • MAC addresses are "burned in" to the network interface card (NIC) and are generally considered permanent.
  • They are crucial for local network communication (e.g., within a LAN) and for protocols like ARP (Address Resolution Protocol) to map IP addresses to MAC addresses.

IP Address vs. MAC Address

CharacteristicIP AddressMAC Address
LayerNetwork Layer (Layer 3)Data Link Layer (Layer 2)
Format32-bit (IPv4) or 128-bit (IPv6) numerical48-bit hexadecimal
UniquenessLogically unique within a network segment; globally unique for public IPsPhysically unique to each network interface card (NIC) globally
Assigning AuthorityNetwork administrator (static) or DHCP server (dynamic) / ISPHardware manufacturer
ChangeabilityCan be changedGenerally fixed (burned into hardware), though can be spoofed
Primary UseIdentifies devices for routing across networksIdentifies devices for local communication within a single network segment
AnalogyHouse addressRoom number within a house

Subnetting Basics

Subnetting is the process of dividing a large network into smaller, more efficient subnetworks (subnets). This division helps in managing IP addresses more effectively, improving network performance, and enhancing security.

Why Subnet?

  • Reduce Network Traffic: By creating smaller broadcast domains, subnetting reduces unnecessary traffic on the network.
  • Improve Performance: Smaller networks mean less congestion and faster data transmission.
  • Efficient IP Address Utilization: Subnetting allows for more granular allocation of IP addresses, preventing waste, especially in large organizations.
  • Enhance Security: Isolating different departments or types of traffic into separate subnets can improve security.
  • Simplify Management: Smaller, more manageable segments are easier to troubleshoot and administer.

How Subnetting Works

Subnetting involves "borrowing" bits from the host portion of an IP address to create a new subnet portion. This is done using a subnet mask.

An IP address is divided into two parts:

  • Network Portion: Identifies the network the device belongs to.
  • Host Portion: Identifies the specific device within that network.

Subnetting extends the network portion by taking bits from the host portion. The subnet mask helps the router distinguish between the network, subnet, and host parts of an IP address.

Network Mask & CIDR

The network mask (or subnet mask) is a 32-bit number that distinguishes the network portion of an IP address from the host portion. It consists of a series of ones (1s) followed by a series of zeros (0s). The 1s represent the network and subnet bits, and the 0s represent the host bits.

Default Subnet Masks (Classful Addressing - Historical Context)

ClassDefault MaskBinary Mask
A255.0.0.011111111.00000000.00000000.00000000
B255.255.0.011111111.11111111.00000000.00000000
C255.255.255.011111111.11111111.11111111.00000000

CIDR (Classless Inter-Domain Routing)

CIDR is a method for allocating IP addresses and routing Internet Protocol packets. It was introduced to slow down the exhaustion of IPv4 addresses and to improve routing efficiency.

  • Instead of classful addressing (A, B, C), CIDR uses a prefix length to indicate the network portion of an IP address.
  • The prefix length is the number of consecutive '1' bits in the subnet mask. It is denoted by a slash (/) followed by a number (e.g., /24).
  • For example, 192.168.1.0/24 means that the first 24 bits of the IP address represent the network portion, and the remaining 8 bits are for hosts. This corresponds to a subnet mask of 255.255.255.0.
  • CIDR allows for more flexible and efficient allocation of IP address blocks, moving away from the rigid class boundaries.

Common CIDR Notations and Corresponding Subnet Masks

CIDR NotationDecimal Subnet MaskNetwork BitsHost BitsTotal AddressesUsable Hosts
/8255.0.0.082416,777,21616,777,214
/16255.255.0.0161665,53665,534
/24255.255.255.0248256254
/25255.255.255.128257128126
/26255.255.255.1922666462
/27255.255.255.2242753230
/28255.255.255.2402841614
/29255.255.255.24829386
/30255.255.255.25230242

Practice Questions

Test your knowledge with these quick questions!

Q1: Which of the following is a private IP address range?

  • 11.0.0.0 - 11.255.255.255
  • 172.16.0.0 - 172.31.255.255
  • 193.0.0.0 - 193.255.255.255

Q2: What is the primary purpose of subnetting?

  • To increase the total number of available IP addresses globally.
  • To divide a large network into smaller, more manageable segments.
  • To convert IPv4 addresses to IPv6 addresses.

Q3: How many bits are in an IPv4 address?

  • 64 bits
  • 128 bits
  • 32 bits

Glossary of Terms

$

${item.definition}

Welcome! Select a section from the navigation.

// END OF INTERCEPT //