Skip to main content

What parts does an IPv4 address consist of?

An IPv4 address is divided into two logical parts:

  1. Network Part
  2. Host Part

These parts are defined by the subnet mask or a CIDR prefix (for example, /24).


1. Network Part

The network part determines which network the address belongs to.

  • The same for all devices within one subnet.
  • Used by routers to determine the path.
  • Allows grouping devices into one network.

Examples of the network part:

  • In the 192.168.1.0/24 network: the network part is 192.168.1.
  • In the 10.5.0.0/16 network: the network part is 10.5.
  • In the 172.16.32.0/20 network: the network part is 172.16.32. (plus part of the next octet).

2. Host Part

The host part identifies the specific device within the network.

  • This part is different for every host in the network.
  • Defines the range of possible IP addresses within the subnet.
  • Used only within the network itself (routers do not take it into account when choosing a route).

Examples of the host part:

  • In the 192.168.1.0/24 network: numbers from 1 to 254.
  • In the 10.5.0.0/16 network: numbers from 0.0.1 to 255.255.
  • In the 172.16.32.0/20 network: the last 12 bits of the address.

Important special addresses within a subnet

Every subnet has 2 reserved addresses:

1. Network address

Host part = all 0. Example: 192.168.1.0 in a /24 network.

2. Broadcast address

Host part = all 1. Example: 192.168.1.255 in a /24 network.

They are not assigned to devices.


Example: breaking down a full IPv4 address

Suppose the address is:

192.168.10.25/24

The /24 mask means:

  • the first 24 bits: the network part
  • the last 8 bits: the host part

Breakdown:

  • Network: 192.168.10.0
  • Host part: .25
  • Broadcast: 192.168.10.255
  • Host range: .1 → .254

Why is IPv4 split into two parts?

So that routers can:

  • quickly determine the direction a packet should travel;
  • group hosts into subnets;
  • minimize routing tables.

This is the foundation of routing and network operation.


Ready answer for an interview

An IPv4 address is split into two parts: network and host. The network part defines the subnet itself and is the same for all devices in it. The host part identifies the specific node within the subnet. The split is done using the subnet mask (for example, /24).


Cheat sheet (5 seconds before the interview)

  • IPv4 address = Network + Host.
  • Where the boundary lies is determined by the mask.
  • Network: common for the subnet.
  • Host: unique for each device.
  • Reserved: network address and broadcast.

Short Answer

Interview ready
Premium

A concise answer to help you respond confidently on this topic during an interview.