Home » Computer Network » IP Addressing Scheme & Classification (IPv4/IPv6)

IP Addressing Scheme & Classification (IPv4/IPv6)

Last updated:

Support this post with a reaction:

4,008 views

IP addressing is the backbone of the modern Internet and computer networks. Every device that communicates over a network—laptops, servers, smartphones, IoT devices—needs a unique identifier to send and receive data. This identifier is called an IP address.

A properly designed IP addressing scheme makes networking efficient, secure, and scalable. In university exams and real-world network design, a strong understanding of IP addressing helps you plan subnets, manage devices, configure routers, and troubleshoot connectivity issues effectively.

This answer explains what an IP address is, how the IP addressing scheme works (for IPv4 and IPv6), and provides a clear classification of different IP address types with examples. It also covers concepts like subnet masks, CIDR, subnetting steps, and special/reserved addresses, accompanied by easy-to-understand examples and practical notes.

What is an IP Address?

An Internet Protocol (IP) address is a logical address assigned to a device on a network to identify it uniquely and enable communication. It functions like a postal address for data packets. Today, two versions are used:

  • IPv4: 32-bit address, written in dotted decimal (e.g., 192.168.1.10)
  • IPv6: 128-bit address, written in hexadecimal (e.g., 2001:db8::1)

IP operates at Layer 3 (Network Layer) of the OSI model. It is connectionless and delivers packets on a best-effort basis. Addressing is essential for routing, which determines how data moves from source to destination across networks.

Key Concepts: Network and Host Portions

Each IP address has two parts:

  • Network part: Identifies the network segment
  • Host part: Identifies a specific device within that network

In IPv4, the split between network and host portions is defined by a subnet mask or prefix length (e.g., /24). Imagine a 32-bit line where the left side (network) is fixed by the mask, and the right side (host) can vary to number devices.

Classful IPv4 Addressing (Traditional Classification)

Historically, IPv4 addresses were divided into classes. Although modern networks use CIDR (classless), the classful model is still widely taught and often examined.

  • Class A
    • Class A format spans 0–127, but usable historical Class A unicast network numbers are 1–126; 0/8 is reserved and 127/8 is loopback.
    • Default mask: 255.0.0.0 (/8)
    • Network bits: 8, Host bits: 24
    • Typical use: Very large networks
    • Example: 10.0.0.1
  • Class B
    • First octet range: 128–191
    • Default mask: 255.255.0.0 (/16)
    • Network bits: 16, Host bits: 16
    • Typical use: Medium-sized networks
    • Example: 172.16.1.1
  • Class C
    • First octet range: 192–223
    • Default mask: 255.255.255.0 (/24)
    • Network bits: 24, Host bits: 8
    • Typical use: Small networks
    • Example: 192.168.1.100
  • Class D
    • First octet range: 224–239
    • Purpose: Multicast (not for normal host addressing)
    • Example: 224.0.0.5 (OSPF routers)
  • Class E
    • First octet range: 240–255
    • Purpose: Experimental, research (not used in public networks)

Special and Reserved IPv4 Ranges

Several IPv4 ranges are reserved for special purposes. Knowing these makes troubleshooting and design easier.

  • Private addresses (RFC 1918) — not routable on the public Internet:
    • 10.0.0.0/8
    • 172.16.0.0/12
    • 192.168.0.0/16
  • Loopback: 127.0.0.0/8 (commonly 127.0.0.1)
  • Link-local (APIPA): 169.254.0.0/16 (auto-assigned when no DHCP)
  • Unspecified: 0.0.0.0 (used as a default route or during bootstrapping)
  • Limited broadcast: 255.255.255.255
  • Directed broadcast: Network with all host bits set (e.g., 192.168.1.255 for /24)
  • Multicast: 224.0.0.0/4 (Class D)
  • Carrier-grade NAT (CGNAT): 100.64.0.0/10 (for ISPs)
  • Documentation ranges (for examples/tutorials):
    • 192.0.2.0/24 (TEST-NET-1)
    • 198.51.100.0/24 (TEST-NET-2)
    • 203.0.113.0/24 (TEST-NET-3)

Public vs Private vs Other Categories (Classification by Usage)

  • Public IP addresses
    • Globally routable on the Internet
    • Assigned by ISPs or regional registries (RIRs such as ARIN, RIPE)
    • Used by servers, gateways, and cloud resources
  • Private IP addresses
    • Used inside local networks (home, office, data centers)
    • Require NAT to access the Internet
    • Examples: 192.168.1.0/24, 10.0.0.0/8
  • Static vs Dynamic
    • Static: Manually configured and fixed; useful for servers
    • Dynamic: Assigned by DHCP; changes over time; useful for clients
  • Unicast vs Broadcast vs Multicast
    • Unicast: One-to-one communication (most IP traffic)
    • Broadcast: One-to-all in a subnet (IPv4 only)
    • Multicast: One-to-many group (e.g., streaming, routing protocols)

Subnet Masks and Prefix Length

The subnet mask defines which bits of the IP address are the network part. Examples:

  • /8 = 255.0.0.0
  • /16 = 255.255.0.0
  • /24 = 255.255.255.0
  • /26 = 255.255.255.192

How to find the network address: Perform a bitwise AND between the IP address and subnet mask. The result is the network ID. The host range lies between the network ID and broadcast address (excluding both for hosts).

Example: Finding Network and Range

Given IP 192.168.10.130/26

  • /26 mask = 255.255.255.192 (last octet block size = 256 − 192 = 64)
  • Subnets in the last octet: 0, 64, 128, 192
  • 130 falls in the 128–191 range
  • Network ID: 192.168.10.128
  • Broadcast: 192.168.10.191
  • Usable hosts: 192.168.10.129 to 192.168.10.190

CIDR (Classless Inter-Domain Routing)

CIDR replaced rigid classful addressing to avoid IPv4 exhaustion and improve routing efficiency. With CIDR, networks are denoted with a prefix length (e.g., 203.0.113.0/27), and routers can aggregate routes (summarization), reducing global routing table size.

  • Benefits of CIDR
    • Efficient allocation of addresses (no wasting entire class blocks)
    • Route aggregation for scalability
    • Supports VLSM (Variable Length Subnet Masking)

Subnetting: Step-by-Step

Subnetting divides a larger network into smaller sub-networks to improve security, performance, and administrative control.

Problem: Subnet 192.168.20.0/24 into at least 6 subnets.

  • Step 1: Determine required subnet bits
    • We need at least 6 subnets. 2^n ≥ 6 → n = 3 (since 2^3 = 8)
  • Step 2: New prefix and mask
    • Original: /24. Borrow 3 bits → New prefix = /27
    • New mask: 255.255.255.224 (block size = 32)
  • Step 3: List subnets
    • 0, 32, 64, 96, 128, 160, 192, 224
  • Step 4: Ranges per subnet
    • 192.168.20.0–31 (hosts 1–30, broadcast .31)
    • 192.168.20.32–63 (hosts 33–62, broadcast .63)
    • 192.168.20.64–95
    • 192.168.20.96–127
    • 192.168.20.128–159
    • 192.168.20.160–191
    • 192.168.20.192–223
    • 192.168.20.224–255
  • Step 5: Assign subnets to departments or VLANs

Subnetting improves broadcast domain control and aligns with VLAN design in switched networks.

IPv6 Addressing Scheme

IPv6 was introduced to overcome IPv4 limitations (address exhaustion) and improve efficiency and security. IPv6 addresses are 128-bit, written as eight groups of four hexadecimal digits, separated by colons. Example: 2001:0db8:0000:0000:0000:8a2e:0370:7334.

  • Zero compression: Replace consecutive groups of zeros with :: once
  • Leading zeros can be omitted in a group
  • Example: 2001:db8::8a2e:370:7334

IPv6 Address Types (Classification)

  • Unicast (one-to-one)
    • Global Unicast Address (GUA): Public, routable on the Internet; typically starts with 2000::/3
    • Unique Local Address (ULA): Private-like; fc00::/7 (commonly fd00::/8). Not routable on the Internet; good for internal networks
    • Link-Local: fe80::/10. Required on all IPv6 interfaces; used for neighbor discovery and local communication. Not routed
  • Multicast (one-to-many)
    • Prefix ff00::/8. Scopes include:
      • ff02:: — link-local scope
      • ff05:: — site-local scope
  • Anycast (one-to-nearest)
    • Same address configured on multiple devices; routers deliver to the nearest instance
    • Used for DNS resolvers, CDNs, and high-availability services

Special IPv6 Addresses

  • Loopback: ::1
  • Unspecified: :: (used by a host before it acquires an address)
  • Documentation: 2001:db8::/32 (used in examples)

Comparing IPv4 and IPv6 (Key Points)

FeatureIPv4IPv6
Address Length32-bit128-bit
NotationDotted decimal (e.g., 192.168.0.1)Hexadecimal colon-separated (e.g., 2001:db8::1)
BroadcastPresentAbsent (uses multicast and anycast)
ConfigurationDHCP commonly usedSLAAC or DHCPv6
NAT UsageWidely used due to address shortageNot required (ample address space)
SecurityIPSec optionalIPSec built-in (native support)

How to Determine the Class of an IPv4 Address (Quick Steps)

  • Look at the first octet (leftmost number):
    • Class A format spans 0–127, but usable historical Class A unicast network numbers are 1–126; 0/8 is reserved and 127/8 is loopback.
    • 128–191 → Class B
    • 192–223 → Class C
    • 224–239 → Class D (multicast)
    • 240–255 → Class E (experimental)
  • Check if it falls in private, loopback, or other reserved ranges

Worked Example: Class, Network, Broadcast, Host Range

Address: 172.20.5.100/20

  • Class: B (first octet 172)
  • /20 means mask 255.255.240.0 (block size in third octet = 16)
  • Third octet is 5 → falls in the 0–15? No, 5 in decimal, but consider combined second+third. Focus: 172.20.[5].100 with /20 → the 20 in second octet stays; the third octet groups are 0–15, 16–31, etc. 5 belongs to 0–15 block, but because the boundary is at the third octet, the network is 172.20.0.0/20
  • Network ID: 172.20.0.0
  • Broadcast: 172.20.15.255
  • Usable range: 172.20.0.1 to 172.20.15.254

Real-World Applications and Design Considerations

  • Enterprise networks
    • Use private IPv4 with VLAN-based subnetting (/24 commonly per VLAN)
    • Use NAT at the edge with one or more public IPs
    • Adopt IPv6 with GUAs per VLAN (e.g., /64) for future-proofing
  • Data centers and cloud
    • Rely on CIDR and route summarization
    • Use anycast for DNS/load balancers
    • Implement dual-stack (IPv4 + IPv6)
  • ISPs
    • Deploy CGNAT for IPv4, assign IPv6 prefixes (/56 or /64) to customers
    • Use BGP with aggregated prefixes for efficient routing
  • IoT and smart homes
    • Private IPv4 with NAT or IPv6 link-local for local communications
    • Security controls to isolate devices

Advantages and Disadvantages of IPv4 and IPv6

  • IPv4 Advantages
    • Simple, widely supported, mature tooling
    • Works well with NAT for address conservation
  • IPv4 Disadvantages
    • Address exhaustion
    • Complex NAT configurations and traversal issues
  • IPv6 Advantages
    • Vast address space eliminates exhaustion
    • Better autoconfiguration, no broadcast, efficient routing
    • End-to-end connectivity without NAT
  • IPv6 Disadvantages
    • Learning curve and transition complexity
    • Legacy applications/devices may lack full support

Common Pitfalls and Best Practices

  • Do not use public IPs inside private networks; use RFC1918 ranges
  • Plan subnets aligned with departments/VLANs to minimize broadcast domains
  • Use CIDR summarization to reduce routing table entries
  • Document IP plans and keep an IPAM (IP Address Management) system
  • In IPv6, prefer /64 per LAN; avoid unnecessarily small subnets
  • Secure router advertisements and DHCP to prevent rogue address assignment

Additional Classification: Operational Roles

  • Gateway addresses
    • Usually the first or last usable IP in a subnet (e.g., .1)
  • Virtual IPs (VIPs)
    • Shared by HA pairs or load balancers to provide resilience
  • Management addresses
    • Dedicated IPs for device management interfaces (out-of-band networks)

Example: Designing a Small Office IP Plan

Requirement: 4 departments—Admin (40 hosts), Engineering (60 hosts), Sales (30 hosts), Guest Wi-Fi (80 hosts). Start from 10.0.0.0/24.

  • Step 1: Sort by host needs and pick subnet sizes
    • Guest: Needs 80 → choose /25 (126 usable hosts)
    • Engineering: Needs 60 → choose /26 (62 usable)
    • Admin: Needs 40 → choose /26 (62 usable)
    • Sales: Needs 30 → choose /27 (30 usable, border case; better /26 for growth)
  • Step 2: Allocate sequentially from 10.0.0.0/24 using VLSM
    • 10.0.0.0/25 → Guest
    • 10.0.0.128/26 → Engineering
    • 10.0.0.192/26 → Admin
    • We need more space for Sales; allocate from another /24, e.g., 10.0.1.0/26 → Sales
  • Step 3: Assign gateways and DHCP scopes
  • Step 4: Apply ACLs/firewall policies per subnet

This example shows how VLSM and CIDR enable flexible, efficient IP plans.

How to Read and Write IPv6 Properly (Step-by-Step)

  • Given: 2001:0db8:0000:0000:0000:0000:0000:0042
    • Drop leading zeros in each group: 2001:db8:0:0:0:0:0:42
    • Compress longest zero sequence once: 2001:db8::42
  • Given expanded form: To ensure correctness, never use :: more than once
  • Check scope of addresses: fe80:: indicates link-local; 2001:db8:: indicates documentation

Security Implications of IP Addressing

  • Segmentation using subnets and VLANs reduces the attack surface
  • Private addressing-plus-NAT hides internal topology from the Internet
  • IPv6 requires careful ACLs; security by NAT is not a substitute for firewalls
  • IP spoofing risks mean routers should implement filtering (BCP 38)

Troubleshooting Tips

  • Verify IP, mask, and gateway are in the same subnet
  • Check for duplicate IPs (ARP inspection, DHCP reservations)
  • Ping loopback and default gateway to isolate issues
  • For IPv6, confirm link-local addresses (fe80::) and neighbor discovery

Conclusion

IP addressing forms the foundation of all network communication. Understanding how IPv4 and IPv6 assign and organize addresses enables efficient design, segmentation, and routing of modern networks. While IPv4 remains widely used through techniques like CIDR, VLSM, and NAT, the future lies with IPv6, offering scalability, simplicity, and global connectivity without address exhaustion.
Mastering both versions empowers network engineers to build reliable, secure, and future-ready infrastructures that keep the Internet seamlessly connected.

The 32-bit address is explained in what IPv4 is.