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.34Diagram 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/24With 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.0The important addresses in this subnet are:
| Address type | Address | Purpose |
|---|---|---|
| Network address | 192.168.10.0 | Identifies the subnet |
| First normal host | 192.168.10.1 | Can be assigned to an interface |
| Example host | 192.168.10.34 | Identifies one interface |
| Last normal host | 192.168.10.254 | Can be assigned to an interface |
| Broadcast address | 192.168.10.255 | Reaches 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.
| Class | First-octet range | Default mask | Historical purpose |
|---|---|---|---|
| A | 1-126 | 255.0.0.0 or /8 | Very large networks |
| B | 128-191 | 255.255.0.0 or /16 | Medium-sized networks |
| C | 192-223 | 255.255.255.0 or /24 | Smaller networks |
| D | 224-239 | Not applicable | IPv4 multicast |
| E | 240-255 | Not applicable | Reserved 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 range | CIDR block | Address span |
|---|---|---|
| 10.0.0.0 | /8 | 10.0.0.0 to 10.255.255.255 |
| 172.16.0.0 | /12 | 172.16.0.0 to 172.31.255.255 |
| 192.168.0.0 | /16 | 192.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.
| Range | Purpose |
|---|---|
| 127.0.0.0/8 | Local loopback testing |
| 169.254.0.0/16 | IPv4 link-local addressing |
| 100.64.0.0/10 | Shared address space, commonly used for carrier-grade NAT |
| 224.0.0.0/4 | IPv4 multicast |
| 255.255.255.255 | Limited broadcast |
| 0.0.0.0 | Unspecified 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 prefix | Subnet mask | Total addresses | Normal usable hosts |
|---|---|---|---|
| /8 | 255.0.0.0 | 16,777,216 | 16,777,214 |
| /16 | 255.255.0.0 | 65,536 | 65,534 |
| /24 | 255.255.255.0 | 256 | 254 |
| /25 | 255.255.255.128 | 128 | 126 |
| /26 | 255.255.255.192 | 64 | 62 |
| /27 | 255.255.255.224 | 32 | 30 |
| /28 | 255.255.255.240 | 16 | 14 |
| /30 | 255.255.255.252 | 4 | 2 |
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/27A /27 mask is:
255.255.255.224The block size in the final octet is:
256 - 224 = 32The 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.63Diagram in words:
192.168.10.0 192.168.10.32 192.168.10.64
|---- first /27 ----|---- second /27 -----|---- third /27
^ host .34 is hereThis 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.33A 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 routeA 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 briefshow 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.1A temporary Linux address can be added with:
sudo ip address add 192.168.20.10/24 dev ens33
sudo ip link set ens33 upThis 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.1How 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.1A /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:
- Check the cable, switch port, Wi-Fi connection and interface state.
- Confirm that the IP address and prefix are correct.
- Calculate whether the gateway belongs to the same local subnet.
- Look for
169.254.x.x, which may indicate failed DHCP configuration. - Ping the loopback address, local interface address and default gateway in that order.
- Inspect ARP or neighbour entries for local delivery problems.
- Check connected, static and dynamic routes on the router.
- 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/12and192.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
