How IP Addressing Works: IPv4 Classes, Private Ranges and CIDR

CCNA 9 min readPublished 19 August 2026

Quick answer

Learn how IPv4 addresses identify networks and hosts. This guide explains address classes, private ranges, CIDR prefixes, commands and common faults.

IP addressing explained simply: an IP address is a logical identifier assigned to a network interface so that devices can send and receive packets. In IPv4, the address and subnet mask work together to identify the network portion and the host portion.

Understanding this relationship is important for router configuration, troubleshooting and route selection. It is also a core skill developed through practical labs in a CCNA course.

What is an IPv4 address?

An IPv4 address is a 32-bit value normally written as four decimal numbers separated by dots. Each number represents eight bits, or one octet, and can have a value from 0 to 255.

Consider this address:

192.168.10.34

Diagram in words:

32-bit IPv4 address

11000000.10101000.00001010.00100010
    192  .   168  .    10   .    34

|-- 8 bits --|-- 8 bits --|-- 8 bits --|-- 8 bits --|

The decimal notation is for human readability. Routers and computers process the address as binary.

An address by itself is incomplete for normal network configuration. A device also needs a subnet mask or CIDR prefix to determine which bits identify its local network.

For example:

IP address:  192.168.10.34
Subnet mask: 255.255.255.0
CIDR form:   192.168.10.34/24

With a /24 prefix, the first 24 bits represent the network. The final eight bits represent the host interface.

192.168.10.34/24
| network  |host|
|192.168.10| 34 |

All devices in the same IP subnet share the same network prefix but must have unique host addresses.

How do the network and host portions work?

The subnet mask marks network bits with binary 1s and host bits with binary 0s. A device performs a logical AND operation between its IP address and mask to calculate the network address.

For 192.168.10.34/24, the calculation produces:

IP address:      192.168.10.34
Subnet mask:     255.255.255.0
Network address: 192.168.10.0

The important addresses in this subnet are:

Address typeAddressPurpose
Network address192.168.10.0Identifies the subnet
First normal host192.168.10.1Can be assigned to an interface
Example host192.168.10.34Identifies one interface
Last normal host192.168.10.254Can be assigned to an interface
Broadcast address192.168.10.255Reaches all IPv4 hosts in the subnet

The network and broadcast addresses are not normally assigned to hosts. A traditional /24 therefore contains 256 total addresses and 254 normal host addresses.

There are exceptions. A /31 can be used on a point-to-point link under RFC 3021, where both addresses act as endpoints and there is no conventional broadcast address. A /32 identifies one exact host or route rather than a multi-host subnet.

What are IPv4 address classes?

IPv4 classes were an early method of dividing the address space into networks of fixed sizes. Classful addressing is no longer used for modern Internet routing, but the classes remain useful historical knowledge and still appear in basic networking discussions.

ClassFirst-octet rangeDefault maskHistorical purpose
A1-126255.0.0.0 or /8Very large networks
B128-191255.255.0.0 or /16Medium-sized networks
C192-223255.255.255.0 or /24Smaller networks
D224-239Not applicableIPv4 multicast
E240-255Not applicableReserved or experimental use

The first-octet ranges need two clarifications. Addresses beginning with 0 are reserved, while 127.0.0.0/8 is reserved for loopback functions and is not a normal Class A network.

Under the classful model, a Class A address implied /8, Class B implied /16, and Class C implied /24. This approach wasted addresses because organisations had to accept one of a few fixed network sizes.

Modern systems use classless addressing. For example, 172.20.40.0/27 is valid even though older terminology would place 172 in Class B. The explicit /27, not the historical class, defines the current network boundary.

What are the private IPv4 address ranges?

Private IPv4 ranges are reserved for internal networks and are not routed across the public Internet. Organisations can use them for user devices, servers, management networks and lab environments without obtaining globally unique public addresses.

RFC 1918 defines three private ranges:

Private rangeCIDR blockAddress span
10.0.0.0/810.0.0.0 to 10.255.255.255
172.16.0.0/12172.16.0.0 to 172.31.255.255
192.168.0.0/16192.168.0.0 to 192.168.255.255

Not every 172.x.x.x address is private. For example, 172.20.5.10 is private, but 172.40.5.10 is not part of the RFC 1918 range.

A home or enterprise router commonly uses Network Address Translation, or NAT, to translate private source addresses to a public address when traffic leaves for the Internet. Private addresses can be reused in separate organisations because they are not globally advertised.

Reusing ranges can still create problems when two networks are connected through a VPN, merger or cloud link. If both sides use 192.168.1.0/24, routers cannot distinguish the destinations without redesign, translation or more specific routing.

Private addressing is also relevant to access control and network monitoring. Students progressing into a Cybersecurity and SOC course need to recognise internal source addresses when analysing firewall and security logs.

Which special IPv4 ranges should engineers recognise?

Several non-public ranges have purposes other than ordinary private addressing. Recognising them prevents incorrect troubleshooting conclusions.

RangePurpose
127.0.0.0/8Local loopback testing
169.254.0.0/16IPv4 link-local addressing
100.64.0.0/10Shared address space, commonly used for carrier-grade NAT
224.0.0.0/4IPv4 multicast
255.255.255.255Limited broadcast
0.0.0.0Unspecified address or default-route notation, depending on context

A host may self-assign an address in 169.254.0.0/16 when automatic configuration is enabled but no DHCP lease is available. This usually indicates a DHCP reachability or service problem; it is not an RFC 1918 private address.

The address 127.0.0.1 tests the local IPv4 stack. A successful ping to it does not prove that the physical interface, switch connection, default gateway or remote network works.

What does CIDR notation mean?

Classless Inter-Domain Routing, or CIDR, writes the number of network bits after a slash. It allows networks and routes to use flexible prefix lengths instead of being limited to Class A, B or C boundaries.

Common prefixes include:

CIDR prefixSubnet maskTotal addressesNormal usable hosts
/8255.0.0.016,777,21616,777,214
/16255.255.0.065,53665,534
/24255.255.255.0256254
/25255.255.255.128128126
/26255.255.255.1926462
/27255.255.255.2243230
/28255.255.255.2401614
/30255.255.255.25242

The host count column applies to conventional subnets after excluding the network and broadcast addresses. /31 and /32 have special use cases and should not be evaluated with the normal subtraction rule.

A shorter prefix represents a larger address block. A /16 contains more addresses than a /24 because it leaves 16 bits for host values rather than eight.

CIDR also enables route summarisation. Instead of storing many individual routes, a router may use one larger prefix when the component networks are contiguous and share the same forwarding path.

For example, 10.20.0.0/16 covers addresses from 10.20.0.0 through 10.20.255.255. It can represent 256 contiguous /24 networks, but it should only be advertised as a summary when doing so will not direct traffic to unavailable subnets incorrectly.

How do you interpret a CIDR address step by step?

To interpret a CIDR address, convert the prefix to a mask, identify the changing octet and find the address block containing the host. This reveals the network address, broadcast address and normal host range.

Take this example:

192.168.10.34/27

A /27 mask is:

255.255.255.224

The block size in the final octet is:

256 - 224 = 32

The subnet boundaries therefore occur at 0, 32, 64, 96 and continue in increments of 32. The host value 34 falls inside the block from 32 to 63.

Network address:  192.168.10.32
First host:       192.168.10.33
Given host:       192.168.10.34
Last host:        192.168.10.62
Broadcast address:192.168.10.63

Diagram in words:

192.168.10.0         192.168.10.32         192.168.10.64
|---- first /27 ----|---- second /27 -----|---- third /27
                     ^ host .34 is here

This method is useful for reading an existing design. A dedicated subnetting lab can then extend it into address planning, variable-length subnet masks and route summarisation.

How does a device decide whether a destination is local?

A host compares its own network prefix with the destination prefix. If the destination is local, the host resolves the destination's MAC address; if it is remote, the host sends the frame to its default gateway.

Suppose a workstation has this configuration:

Address: 192.168.10.34/27
Gateway: 192.168.10.33

A packet for 192.168.10.50 stays in the local subnet because both addresses belong to 192.168.10.32/27. A packet for 192.168.10.100 is sent to the gateway because the destination belongs to a different /27 block.

Routers make a related decision using their routing tables. They choose the matching route with the longest prefix, meaning the most specific matching route. A /24 route is preferred over a matching /16, while 0.0.0.0/0 acts as the least-specific IPv4 default route.

Which commands verify IP addressing?

Use operating-system and router commands to confirm the address, prefix, interface state, default gateway and connected routes. Do not rely on a ping alone because successful communication depends on several layers.

On Cisco IOS, display interface addressing with:

show ip interface brief
show interfaces gigabitEthernet 0/0
show ip route connected
show ip route

A basic routed-interface configuration is:

configure terminal
interface gigabitEthernet 0/0
 ip address 192.168.20.1 255.255.255.0
 no shutdown
end
show ip interface brief

show ip interface brief reports the configured address and both interface states. Status reflects the physical layer, while Protocol reflects the line protocol. For normal operation, both should usually show up.

On Linux, use:

ip -br address
ip route
ip neigh
ping -c 4 192.168.20.1

A temporary Linux address can be added with:

sudo ip address add 192.168.20.10/24 dev ens33
sudo ip link set ens33 up

This change normally does not survive a reboot. Persistent configuration depends on the distribution and its network manager.

On Windows, useful commands include:

ipconfig /all
route print
arp -a
ping 192.168.20.1

How do you troubleshoot an IP addressing problem?

Troubleshoot from the local interface outward: verify link state, address, prefix, gateway, neighbour resolution and routing. Compare the configured values against the intended subnet instead of changing settings at random.

Consider this failed configuration:

PC address:      192.168.50.70/26
Default gateway: 192.168.50.1

A /26 creates blocks of 64 addresses. The PC belongs to 192.168.50.64/26, covering host addresses .65 through .126, but the gateway belongs to 192.168.50.0/26. The PC and gateway are in different subnets.

Possible corrections are to assign a gateway inside 192.168.50.64/26, such as 192.168.50.65, or to change the PC address and design according to the documented network plan.

Use this troubleshooting sequence:

  1. Check the cable, switch port, Wi-Fi connection and interface state.
  2. Confirm that the IP address and prefix are correct.
  3. Calculate whether the gateway belongs to the same local subnet.
  4. Look for 169.254.x.x, which may indicate failed DHCP configuration.
  5. Ping the loopback address, local interface address and default gateway in that order.
  6. Inspect ARP or neighbour entries for local delivery problems.
  7. Check connected, static and dynamic routes on the router.
  8. Look for duplicate IP addresses, overlapping subnets, access lists or NAT faults.

If a router interface is up but no connected route appears, verify that both the interface and line protocol are operational. If local communication works but remote networks fail, inspect the default gateway and routing table before assuming that DNS is responsible.

What should you remember about IPv4 addressing?

An IPv4 address contains 32 bits, and its prefix defines which bits represent the network. Address classes describe an older allocation model, while CIDR prefixes control modern subnet sizes and route matching.

Key points are:

  • RFC 1918 private ranges are 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16.
  • A subnet mask and CIDR prefix express the same network boundary in different notation.
  • The network address identifies the subnet, while the broadcast address reaches all IPv4 hosts in a conventional subnet.
  • Routers use longest-prefix matching when several routes match a destination.
  • Correct troubleshooting starts by checking the actual address, prefix, gateway and route table.

Reviewed by Network Rhinos networking trainers.

To practise IPv4 addressing on Cisco routers and switches, enquire about lab access and upcoming batch details for the Network Rhinos CCNA course.

Related reading: How to Choose the Right CCNA Training Institute in Chennai

Frequently asked questions

What is an IP address in simple terms?

An IP address is a logical identifier assigned to a network interface. It allows devices and routers to identify packet sources and destinations across IP networks.

What are the three private IPv4 ranges?

The private IPv4 ranges are 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. These addresses are intended for internal networks and are not routed directly across the public Internet.

Are IPv4 classes still used?

Classful addressing is no longer used for modern Internet routing. Current networks use CIDR prefixes, although Classes A, B and C remain useful for understanding the history of IPv4 allocation.

What does the slash number in an IP address mean?

The slash number is the CIDR prefix length and shows how many address bits represent the network. For example, /24 means that 24 bits identify the network and eight bits remain for host values.

Is every 172 address private?

No. Only addresses from 172.16.0.0 through 172.31.255.255 are in the private 172.16.0.0/12 block. An address such as 172.40.5.10 is outside that private range.

Why does a device receive a 169.254 address?

A device may self-assign an address from 169.254.0.0/16 when automatic IPv4 configuration is enabled but it cannot obtain a DHCP lease. Check DHCP server availability, relay configuration, VLAN membership and local connectivity.

Related articles

Train with Network Rhinos

Hands-on CCNA, CCNP, AWS, Azure, DevOps and cybersecurity training in Chennai & Bangalore, with placement support. Talk to our team or attend a free demo class.