Understanding IP Address Classes and Subnetting: A Complete Guide

In networking, IP addressing is a fundamental concept that ensures devices communicate efficiently over the internet or local networks. One of the core aspects of IP addressing is the classification of IP addresses into different classes. In this guide, we will explore IP address classes (Class A to E), subnet masks, how to calculate subnet mask numbers, and other related topics to ensure you understand the structure of modern networks.

1. How Many IP Address Classes Exist?

IP addresses are divided into five classes: A, B, C, D, and E. These classes are determined based on the range of the first octet (first 8-bit segment) of the IP address. Below is the classification:

Class A

  • Range: 1.0.0.0 to 126.255.255.255
  • Subnet Mask: 255.0.0.0 (/8)
  • Usage: Large networks (e.g., multinational corporations, ISPs, government networks)
  • Supports: 16 million hosts per network

Class A addresses are reserved for the largest networks. A Class A address is typically used by very large organizations that require a lot of devices within their networks. For example, large ISPs (Internet Service Providers) or government agencies use these ranges.

Class B

  • Range: 128.0.0.0 to 191.255.255.255
  • Subnet Mask: 255.255.0.0 (/16)
  • Usage: Medium-sized networks (e.g., universities, large businesses)
  • Supports: 65,536 hosts per network

Class B addresses support medium-sized networks, such as universities or large businesses, which may need thousands of devices to communicate within their network.

Class C

  • Range: 192.0.0.0 to 223.255.255.255
  • Subnet Mask: 255.255.255.0 (/24)
  • Usage: Small networks (e.g., small businesses, home networks)
  • Supports: 254 hosts per network

Class C is the most commonly used class, especially for small organizations or home networks. It’s the default for most consumer-grade routers. It can support up to 254 devices, which is sufficient for typical small office environments or home setups.

Class D (Multicast Addresses)

  • Range: 224.0.0.0 to 239.255.255.255
  • Usage: Used for multicasting, not for assigning to devices

Class D is used for multicast communication, where data is sent to multiple receivers simultaneously. This class is reserved for specialized network configurations, such as streaming media or real-time communications.

Class E (Experimental & Research Use)

  • Range: 240.0.0.0 to 255.255.255.255
  • Usage: Reserved for experimental purposes

Class E is reserved for experimental research purposes and is not typically used for public or private networks. It’s reserved for future developments in IP addressing.

2. Understanding Subnet Masks for All Classes

A subnet mask determines which portion of an IP address belongs to the network and which belongs to the hosts. It allows networks to be subdivided into smaller, more manageable groups.

ClassDefault Subnet MaskCIDR NotationHosts Per Network
A255.0.0.0/816,777,214
B255.255.0.0/1665,534
C255.255.255.0/24254
DNot applicableMulticastNot assigned
ENot applicableExperimentalNot assigned

The CIDR Notation (Classless Inter-Domain Routing) represents the number of bits used for the network portion.

3. Understanding Full Class A and Half Class B Networks

Full Class A Network

A full Class A network includes the entire 16 million usable addresses. When you use a Class A IP range (such as 10.0.0.0/8), you can assign IP addresses to millions of devices without any subnetting. An example would be:

  • Network Address: 10.0.0.0
  • Broadcast Address: 10.255.255.255
  • Usable Range: 10.0.0.1 to 10.255.255.254

This is perfect for organizations with thousands of devices.

Half of Class B Network

A half Class B network typically uses a /17 subnet mask (255.255.128.0), which divides a Class B range into two subnets. The network 172.16.0.0/17 would break into:

  • First subnet: 172.16.0.1 - 172.16.127.254
  • Second subnet: 172.16.128.1 - 172.16.255.254

This division is useful for allocating network resources across different departments or regions of an organization.

4. How to Calculate Subnet Mask Numbers

Understanding how to calculate subnet mask numbers is crucial when setting up custom networks. The subnet mask determines how many subnets and usable hosts you have.

How to Calculate Subnet Mask:

  1. Start with the default subnet mask based on the IP class (Class A, B, or C).
  2. Determine the new subnet mask based on how many subnets you want. For example, if you need more subnets than the default mask provides, you borrow bits from the host portion of the IP address.
  3. Convert to binary and perform the calculation.

For example, let’s say you want to create a subnet from the Class C network 192.168.1.0/24 and borrow 2 bits for subnetting. The new subnet mask would be /26, which is 255.255.255.192.

Example Calculation for a /26 Subnet Mask (255.255.255.192)

  1. Total Bits: 32 (IPv4 has 32 bits)
  2. Network Bits: 26 (because the subnet mask is /26)
  3. Host Bits: 32 - 26 = 6
  4. Usable Hosts: 26−2=622^6 – 2 = 6226−2=62 usable hosts per subnet (subtract 2 for network and broadcast addresses)
  • Network Address: First address (e.g., 192.168.1.0)
  • Broadcast Address: Last address (e.g., 192.168.1.63)
  • Usable Range: 192.168.1.1 to 192.168.1.62

This method works for any subnet mask calculation, whether you are splitting Class A, B, or C networks.

5. How to Find Your Local and Public IP Address

Understanding the difference between your local IP address and public IP address is crucial when managing networks.

Local IP Address (Private IP)

A local IP address is assigned to a device within your private network, such as your home or office network. You can find it by following these steps:

  • Windows: Open Command Prompt and type: shCopyEditipconfig
  • Mac/Linux: Open Terminal and type: shCopyEditifconfig (or ip addr show)

The local IP address will typically be within the ranges:

  • 192.168.x.x
  • 10.x.x.x
  • 172.16.x.x - 172.31.x.x

Public IP Address

Your public IP address is the address assigned by your ISP to your entire network, and it’s used for communication over the internet. You can check it by visiting websites like:

Alternatively, you can use the following command in the terminal or command prompt:

shCopyEditcurl ifconfig.me

Leave a Reply

Your email address will not be published. Required fields are marked *