🟣 Phase 4 · IP Addressing 🟡 Intermediate MODULE 11

IPv4 Addressing

⏱️ 25 min
📖 8 sections
🧩 10 Questions
📊 Intermediate
CCNA Module 11 of 1764%
🎯 What you'll learn: IPv4 address structure and binary representation, subnet masks and the AND operation, network/host/broadcast addresses, unicast vs broadcast vs multicast, public and private address ranges, basic subnetting, VLSM (Variable Length Subnet Masking), and a subnet mask quick-reference guide.

IPv4 Address Structure

An IPv4 address is a 32-bit binary value used to uniquely identify a device on a network. To make it human-readable, these 32 bits are divided into four groups of 8 bits called octets, written in dotted decimal notation as W.X.Y.Z. Each octet can range from 0 to 255, since 8 bits can represent 2^8 = 256 values.

An IPv4 address has two portions: the network portion, which identifies which network the device belongs to, and the host portion, which identifies the specific device within that network. The subnet mask defines the boundary between these two portions.

The subnet mask can be written in two equivalent ways. Dotted decimal notation looks like an IP address: 255.255.255.0. Prefix length (CIDR) notation uses a forward slash followed by the count of network bits: /24. Both mean the same thing — the first 24 bits are the network portion.

32 bits / 4 Octets
Binary Foundation
192.168.10.50 = 11000000.10101000.00001010.00110010 — each octet is 8 binary bits
Dotted Decimal
Human-Readable Format
Four decimal numbers (0–255) separated by dots. Example: 10.0.0.1, 192.168.1.254, 172.16.5.100
Network + Host
Two-Part Structure
Subnet mask divides the address. 255.255.255.0 (/24) means first 3 octets = network, last octet = host
🟣
Reading an IPv4 Address in Binary
192.168.10.50 in binary: 192 = 11000000, 168 = 10101000, 10 = 00001010, 50 = 00110010. The full 32-bit address is 11000000.10101000.00001010.00110010. Routers and switches work with these binary values internally — the dotted decimal is just for human convenience.

Subnet Mask and Logical AND

The subnet mask is also a 32-bit value. It has all 1s in the network portion and all 0s in the host portion. This binary structure is what makes the Logical AND operation work — ANDing any bit with 1 preserves it, and ANDing any bit with 0 forces a 0.

Common subnet masks: /8 = 255.0.0.0 (Class A), /16 = 255.255.0.0 (Class B), /24 = 255.255.255.0 (Class C). The Logical AND of an IP address and its subnet mask always produces the Network Address.

Logical AND — Finding the Network Address
Binary
IP Address:    192.168.10.50
Binary:        11000000.10101000.00001010.00110010

Subnet Mask:   255.255.255.0
Binary:        11111111.11111111.11111111.00000000

AND Result:    (keep bits where mask=1, zero bits where mask=0)
Network Addr:  11000000.10101000.00001010.00000000
               = 192.168.10.0   (Network Address)

The AND operation is straightforward: 1 AND 1 = 1, 1 AND 0 = 0, 0 AND 1 = 0, 0 AND 0 = 0. The host portion bits are all zeroed out, leaving only the network address. This is how routers determine which network a packet belongs to before making forwarding decisions.

Network, Host, and Broadcast Addresses

Within any subnet, three address types are reserved and cannot be assigned to hosts. Understanding these is essential for correct IP planning and is tested heavily on the CCNA exam.

The network address has all host bits set to 0. It identifies the subnet itself — for example, 192.168.10.0/24. The broadcast address has all host bits set to 1 — for example, 192.168.10.255/24. Every host on the subnet receives a packet sent to the broadcast address. The usable host range is everything between these two.

The formula for usable hosts is 2^n − 2, where n is the number of host bits. For a /24 subnet: 2^8 − 2 = 254 usable hosts. The −2 accounts for the network address and the broadcast address.

256
2^8 Total Addresses (/24)
254
Usable Host Addresses
1
Network Address (.0)
1
Broadcast Address (.255)
⚠️
Network and Broadcast Cannot Be Assigned to Hosts
In the 192.168.10.0/24 subnet: the network address is 192.168.10.0 and the broadcast address is 192.168.10.255. Neither can be configured on a host or router interface. The usable range is 192.168.10.1 through 192.168.10.254 — exactly 254 addresses.

Unicast, Broadcast, and Multicast

IPv4 supports three types of communication, each designed for different traffic patterns. Understanding these distinctions is important for network design and for the CCNA exam.

Unicast is one-to-one communication — a packet sent from one specific host to one specific destination host. This is the most common form of IPv4 traffic (web browsing, file transfer, SSH). Broadcast sends a packet to all hosts on a network segment. Multicast enables one-to-many communication where only subscribed hosts receive the traffic.

Broadcast has two sub-types: the limited broadcast address 255.255.255.255 is never forwarded by routers and reaches only the local subnet. The directed broadcast (e.g., 192.168.10.255 for the /24 subnet) can theoretically cross routers but is disabled by default on Cisco routers for security reasons. Multicast addresses fall in the range 224.0.0.0 – 239.255.255.255. Well-known multicast addresses include 224.0.0.5 (OSPF routers), 224.0.0.9 (RIP routers), and 224.0.0.18 (VRRP).

Unicast
One-to-One
Single source to single destination. Uses specific host IP. Most common traffic type — web, email, SSH, file transfers
Broadcast
One-to-All
255.255.255.255 = limited (not forwarded by routers). Directed broadcast = host bits all 1s. Used by ARP, DHCP discovery
Multicast
One-to-Many
Range 224.0.0.0–239.255.255.255. Only subscribed hosts receive it. Used by OSPF (224.0.0.5), RIP (224.0.0.9), video streaming

Public and Private IPv4 Addresses

Not all IPv4 addresses are routable on the public internet. RFC 1918 defines three private address ranges that organisations can use internally without registration. These addresses are deliberately non-routable on the internet — ISP routers drop packets with private source addresses. NAT (Network Address Translation) bridges the gap, translating private addresses to a public IP for internet access.

Class A private range: 10.0.0.0 – 10.255.255.255 (/8) — over 16 million addresses, used by large enterprises. Class B private range: 172.16.0.0 – 172.31.255.255 (/12) — about 1 million addresses. Class C private range: 192.168.0.0 – 192.168.255.255 (/16) — 65,536 addresses, the most common in homes and small offices.

Special-purpose addresses you must know: Loopback 127.0.0.0/8 (127.0.0.1 is localhost — used to test the TCP/IP stack on the local device). APIPA 169.254.0.0/16 — automatically assigned when DHCP fails. Shared/CGNAT 100.64.0.0/10 — used by ISPs for Carrier-Grade NAT.

💡
Private Addresses Are Reused Globally — NAT Makes This Work
The same 192.168.1.0/24 subnet exists in millions of homes and offices worldwide. This works because private addresses are never routed on the internet — NAT translates them to the ISP-assigned public IP. Without NAT and private addressing, the 4.3 billion IPv4 addresses would have run out far sooner than they did.

Subnetting — Basic Concepts

Subnetting divides a larger network into smaller subnetworks (subnets). This reduces broadcast domains (keeping broadcasts contained to smaller groups), improves security (separate subnets for different departments), and makes more efficient use of IP addresses by sizing subnets to actual host requirements.

Subnetting works by borrowing bits from the host portion of an address to extend the network portion. Each borrowed bit doubles the number of subnets but halves the number of hosts per subnet. The formula for number of subnets is 2^s where s = number of borrowed bits, and hosts per subnet is 2^h − 2 where h = remaining host bits.

Example: Take 192.168.1.0/24 and subnet it into /26 networks. We borrow 2 bits (26 − 24 = 2), creating 2^2 = 4 subnets. Each subnet has 6 host bits remaining: 2^6 − 2 = 62 usable hosts.

192.168.1.0/24 Subnetted to /26 — Four Subnets
Subnetting
Network           Usable Range              Broadcast
192.168.1.0/26   192.168.1.1  – 192.168.1.62   192.168.1.63
192.168.1.64/26  192.168.1.65 – 192.168.1.126  192.168.1.127
192.168.1.128/26 192.168.1.129– 192.168.1.190  192.168.1.191
192.168.1.192/26 192.168.1.193– 192.168.1.254  192.168.1.255

Block size = 64 (2^6). Subnets start at 0, 64, 128, 192.
Each subnet: 62 usable hosts. Total: 4 × 62 = 248 hosts.

VLSM — Variable Length Subnet Masking

VLSM (Variable Length Subnet Masking) allows a network administrator to use different subnet sizes within the same address block. Without VLSM (fixed-length subnetting), every subnet must be the same size — this wastes addresses when subnets have very different host requirements. VLSM solves this by tailoring each subnet exactly to its needs.

The critical rule of VLSM: always allocate the largest subnet first, then progressively smaller ones. This prevents overlapping address spaces. Starting with the next available address block after each allocation ensures subnets never collide.

Example: A company needs 4 LANs with 50, 25, 10, and 2 hosts respectively, plus a WAN link. Starting address: 192.168.5.0/24.

VLSM Design — 192.168.5.0/24
VLSM
Requirement   Need Prefix   Subnet Assigned          Hosts Available
LAN1 (50 h)  /26           192.168.5.0/26           62 hosts  (.0–.63)
LAN2 (25 h)  /27           192.168.5.64/27          30 hosts  (.64–.95)
LAN3 (10 h)  /28           192.168.5.96/28          14 hosts  (.96–.111)
WAN  (2 h)   /30           192.168.5.112/30         2 hosts   (.112–.115)

Remaining free space: 192.168.5.116 – 192.168.5.255 (140 addresses)
Always Allocate Largest Subnet First
In VLSM design, always start with the subnet requiring the most hosts. Assign it the appropriate prefix, note where it ends, then begin the next subnet at the next available address. Working largest-to-smallest guarantees no overlapping address spaces and maximises remaining free space for future growth.

Subnet Mask Quick Reference

The table below shows the most common prefix lengths used in subnetting. Notice how each step up in prefix length (more network bits) halves the number of available hosts. The /30 prefix is the standard choice for point-to-point WAN links between two routers, providing exactly 2 usable addresses.

Usable Hosts per Prefix Length
/24 (255.255.255.0)
254
254 hosts
/25 (255.255.255.128)
126
126 hosts
/26 (255.255.255.192)
62
62 hosts
/27 (255.255.255.224)
30
30 hosts
/28 (255.255.255.240)
14
14 hosts
/29 (255.255.255.248)
6
6 hosts
/30 (255.255.255.252)
2
2 hosts
🔬
Challenge — VLSM Design for 172.16.0.0/16
Apply VLSM to allocate subnets for multiple departments
Scenario: Your organisation has been assigned 172.16.0.0/16. Design VLSM subnets for the following requirements:

   • Engineering dept: 500 hosts
   • Sales dept: 200 hosts
   • HR dept: 100 hosts
   • Management dept: 50 hosts
   • WAN Link 1 (HQ to Branch 1): 2 hosts
   • WAN Link 2 (HQ to Branch 2): 2 hosts
   • WAN Link 3 (Branch 1 to Branch 2): 2 hosts

Task: For each subnet, determine the correct prefix length, the subnet address, the usable host range, and the broadcast address. Work from largest to smallest requirement.
💡 Show hints & approach
  • 500 hosts → need /23 (2^9−2=510 usable). Start: 172.16.0.0/23
  • 200 hosts → need /24 (2^8−2=254 usable). Next: 172.16.2.0/24
  • 100 hosts → need /25 (2^7−2=126 usable). Next: 172.16.3.0/25
  • 50 hosts → need /26 (2^6−2=62 usable). Next: 172.16.3.128/26
  • Each WAN link → /30 (2 usable hosts). Next three /30s after the /26
  • Remember: block size for /23 is 512, /24 is 256, /25 is 128, /26 is 64, /30 is 4
🧩 Knowledge Check
10 questions — IPv4 Addressing
1. What is the default subnet mask for a Class C address?
2. How many usable host addresses are available in a /26 subnet?
3. What is the broadcast address of 192.168.5.64/26?
4. Which private IP range belongs to Class B (RFC 1918)?
5. What does VLSM allow you to do?
6. The IPv4 loopback address is:
7. What binary operation determines the network address from an IP and subnet mask?
8. How many subnets are created when borrowing 3 bits from the host portion?
9. An APIPA address falls in which range?
10. For a point-to-point WAN link between two routers, which prefix length is most efficient?
Finished this module?
Mark it complete to track your CCNA progress.
🎉
Module 11 Complete!
You've mastered IPv4 addressing — structure, subnet masks, AND operations, public/private ranges, subnetting, and VLSM. Next up: IPv6 Addressing!
← Course Home
Phase 4 · CCNAModule 11 of 17
🗒 Cheat Sheet 📝 Worksheet