Skip to content

IPv4 Address Structure — Understanding How IPv4 Addresses Are Organised

Every device connected to an IPv4 network requires an IPv4 Address to communicate. An IPv4 address is much more than four decimal numbers separated by dots—it is a carefully structured 32-bit logical address that identifies both the network and the host. Understanding the IPv4 address structure is essential before learning subnetting, Classless Inter-Domain Routing (CIDR), routing, Variable Length Subnet Masking (VLSM), and enterprise network design. Every Linux administrator, DevOps engineer, Cloud Architect, Platform Engineer, Site Reliability Engineer (SRE), and Network Engineer should master IPv4 addressing.


Learning Path

Networking Mastery → Module 2: IPv4 Addressing → Lesson 2

Difficulty: Beginner

Reading Time: 90 Minutes

Course Progress

Course: Networking Mastery

Module: IPv4 Addressing

Lesson: 2 of 10


What You'll Learn

After completing this lesson, you'll be able to:

  • Understand the structure of an IPv4 address
  • Explain octets and bytes
  • Identify network and host portions
  • Understand subnet masks
  • Explain default gateways
  • Read IPv4 addresses in binary and decimal
  • Understand how IPv4 addresses enable communication

Prerequisites

Complete:


Why Learn IPv4 Address Structure?

Every network device needs an IPv4 address.

Examples:

  • Laptop
  • Mobile Phone
  • Linux Server
  • Router
  • Firewall
  • Kubernetes Node
  • Virtual Machine

Without understanding IPv4 structure, it is impossible to learn:

  • Subnetting
  • CIDR
  • Routing
  • VLSM
  • Supernetting

What is an IPv4 Address?

An IPv4 Address is a 32-bit logical address assigned to a network interface.

Example:

192.168.1.10

It uniquely identifies a device within an IPv4 network.


IPv4 Address Format

An IPv4 address consists of four decimal numbers separated by periods.

Example:

192.168.1.10

Each number is called an Octet.


Structure of an IPv4 Address

192 . 168 . 1 . 10

 │      │     │     │

Octet Octet Octet Octet

There are:

  • 4 Octets
  • 32 Bits
  • 4 Bytes

Why is it Called an Octet?

Each section contains 8 bits.

Example:

192


11000000

Since:

8 Bits

=

1 Octet

The address contains four octets.


IPv4 in Binary

Example:

192.168.1.10

Binary representation:

11000000

10101000

00000001

00001010

Total:

32 Bits

Networking devices process this binary representation internally.


IPv4 Layout

+--------+--------+--------+--------+
| Octet1 | Octet2 | Octet3 | Octet4 |
+--------+--------+--------+--------+

8 Bits    8 Bits   8 Bits   8 Bits

Total:

32 Bits

Valid IPv4 Range

Each octet can have a decimal value from:

0

to

255

Examples of valid addresses:

10.0.0.1

172.16.10.25

192.168.1.100

Examples of invalid addresses:

300.1.1.1

192.168.500.10

10.-1.5.8

Why 0–255?

Each octet contains 8 bits.

Maximum binary value:

11111111

Decimal equivalent:

255

Minimum value:

00000000

=

0

Total Number of IPv4 Addresses

Since IPv4 uses 32 bits:

2³²

=

4,294,967,296

Approximately 4.3 billion unique addresses are available (before accounting for reserved ranges).


Network and Host Portions

Every IPv4 address consists of:

  • Network Portion
  • Host Portion

Example:

192.168.1.25/24

Representation:

192.168.1 | 25

 Network   Host

The network identifies the subnet.

The host identifies the specific device.


Why Split the Address?

Suppose:

Office A


192.168.1.0

Every computer belongs to the same network.

Individual hosts:

192.168.1.10

192.168.1.20

192.168.1.30

The network portion remains the same while the host portion changes.


Subnet Mask

The Subnet Mask determines which bits belong to:

  • Network
  • Host

Example:

255.255.255.0

Binary:

11111111

11111111

11111111

00000000

Meaning:

Network


24 Bits

Host


8 Bits

CIDR Notation

Instead of writing:

255.255.255.0

Modern networks use:

/24

Meaning:

24 Network Bits

8 Host Bits

CIDR notation simplifies subnet representation.


Example Address

IP Address

192.168.1.50

Subnet

255.255.255.0

Gateway

192.168.1.1

This device belongs to the:

192.168.1.0/24

network.


Default Gateway

A Default Gateway is the router used to reach other networks.

Example:

Laptop


192.168.1.10


Gateway

192.168.1.1


Internet

If the destination is outside the local network, packets are sent to the gateway.


Broadcast Address

Every subnet has a broadcast address.

Example:

Network

192.168.1.0/24

Broadcast:

192.168.1.255

Broadcast packets are delivered to every host in the subnet.


Network Address

The network address identifies the subnet itself.

Example:

192.168.1.0/24

This address is reserved and cannot be assigned to a host.


Host Address

Host addresses identify individual devices.

Examples:

192.168.1.10

192.168.1.20

192.168.1.50

Each host must have a unique address within the subnet.


IPv4 Communication Example

Suppose:

Laptop:

192.168.1.10

Server:

192.168.1.100

Both belong to:

192.168.1.0/24

Communication:

Laptop


Switch


Server

No router is required because both devices are on the same network.


Communication Across Networks

Suppose:

Laptop:

192.168.1.10

Website:

142.250.183.110

Communication:

Laptop


Switch


Router


Internet


Website

The router forwards packets to another network.


Viewing IPv4 Information in Linux

Display IP addresses.

ip addr

Display routing table.

ip route

Display hostname and IP.

hostname -I

Legacy command.

ifconfig

Production Perspective

Every enterprise network uses IPv4 addressing for:

  • Servers
  • Firewalls
  • Routers
  • Switch Management
  • Cloud Virtual Machines
  • Databases
  • Kubernetes Nodes
  • Storage Systems

Accurate IP planning prevents conflicts and simplifies troubleshooting.


Cloud Perspective

Cloud providers assign IPv4 addresses to:

  • Virtual Machines
  • Load Balancers
  • Network Address Translation (NAT) Gateways
  • Kubernetes Nodes
  • Managed Databases

Private IP addresses are commonly used inside cloud Virtual Private Clouds (VPCs), while public IP addresses are assigned to Internet-facing resources.


Kubernetes Perspective

Kubernetes uses IPv4 addresses for:

  • Nodes
  • Pods
  • Services
  • Ingress Controllers

Cluster networking depends on proper IP allocation and routing.


Hands-on Lab

Task 1

Display IPv4 addresses.

ip addr

Task 2

Display the routing table.

ip route

Task 3

Display assigned IP addresses.

hostname -I

Task 4

Write the binary representation of:

192.168.10.25

Task 5

Identify:

  • Network Address
  • Host Address
  • Broadcast Address

for:

192.168.1.50/24

Task 6

Determine whether the following addresses are valid or invalid:

192.168.1.256

10.0.0.15

172.20.5.100

300.1.1.1

Task 7

Identify the default gateway on your Linux system.


Task 8

Draw a network containing:

  • Router
  • Switch
  • Three computers

Assign IPv4 addresses and identify:

  • Network
  • Hosts
  • Gateway

Linux Commands

Command Purpose
ip addr Display IP addresses
hostname -I Display assigned IPv4 addresses
ip route Display routing table
ping Test connectivity
ip link Display interfaces

Common Mistakes

❌ Assuming every number is a separate address.

✅ The four octets together form one IPv4 address.


❌ Confusing the network address with a host address.

✅ Network addresses identify the subnet, not individual devices.


❌ Assigning the broadcast address to a host.

✅ Broadcast addresses are reserved.


❌ Ignoring the subnet mask.

✅ Always evaluate an IP address together with its subnet mask.


❌ Forgetting the default gateway.

✅ Devices need a gateway to reach other networks.


Best Practices

  • Always document IP addressing schemes.
  • Use consistent subnet sizes where practical.
  • Avoid duplicate IP addresses.
  • Reserve static IP addresses for infrastructure devices.
  • Verify network and broadcast addresses before assigning hosts.
  • Understand both decimal and binary representations.

Interview Questions

Beginner

  1. What is an IPv4 address?
  2. How many bits are in an IPv4 address?
  3. What is an octet?
  4. What is the valid range of an IPv4 octet?

Intermediate

  1. Explain the difference between the network and host portions of an IP address.
  2. What is the purpose of a subnet mask?
  3. What is the default gateway?
  4. Why can't the network or broadcast address be assigned to a host?

Architect Level

  1. How would you design an IPv4 addressing scheme for a large enterprise?
  2. Explain how subnet masks influence routing decisions.
  3. Why is understanding IPv4 structure essential for cloud networking and Kubernetes?

Summary

In this lesson, you learned:

  • The structure of an IPv4 address
  • Octets and bytes
  • Binary representation
  • Network and host portions
  • Subnet masks
  • CIDR notation
  • Default gateways
  • Network and broadcast addresses
  • Linux commands for viewing IPv4 configuration

Understanding the IPv4 address structure is the foundation of subnetting, routing, and enterprise network design. Every IPv4 address combines a network identifier and a host identifier, allowing devices to communicate efficiently across local networks and the Internet.


Key Takeaways

  • An IPv4 address consists of 32 bits (4 octets).
  • Each octet contains 8 bits and ranges from 0 to 255.
  • Every IPv4 address contains a network portion and a host portion.
  • The subnet mask determines where the network ends and the host begins.
  • Routers use IPv4 addresses to forward packets between networks.

What's Next?

IPv4 Classes