Achievable logoAchievable logo
CCNA
Sign in
Sign up
Purchase
Textbook
Practice exams
Support
How it works
Exam catalog
Mountain with a flag at the peak
Textbook
Introduction
1. Introduction to networking
2. Administering Ethernet LANs
3. IP connectivity
3.1 Understanding IP addresses
3.1.1 IPv4 addressing
3.1.2 IPv4 network addresses vs. host addresses
3.1.3 Public vs. private IP addresses
3.2 Calculating networks and hosts
3.3 Routers and IPv4 routing fundamentals
3.4 Static routing
3.5 Static vs. dynamic routing and OSPF fundamentals
3.6 Router redundancy in an Ethernet LAN using First Hop Redundancy Protocols (FHRPs)
3.7 Configuring Cisco Routers
4. Network services
5. IPv6
6. Wireless networking
7. Network management and administering network devices
8. Network security fundamentals
9. Network automation and programmability
Wrapping up
Achievable logoAchievable logo
3.1.2 IPv4 network addresses vs. host addresses
Achievable CCNA
3. IP connectivity
3.1. Understanding IP addresses
Our CCNA course is currently in development and is a work-in-progress.

IPv4 network addresses vs. host addresses

6 min read
Font
Discuss
Share
Feedback

IP network addresses and IP host addresses

Every IP address is split into two parts:

  • The network section
  • The host section

The network section (network ID)

The first section of an IP address identifies the network the address belongs to. This section is often called the network ID.

A helpful analogy is a phone number:

  • The area code tells you which city or region the number belongs to.
  • In the same way, the network section tells you which network an IP address belongs to.

The host section

The second section of an IP address identifies a specific device (a host) on that network. This is the part that’s assigned to a device.

Using the phone number analogy again:

  • The host section is like the actual phone number assigned to a specific phone.

(Image 126)

Image Title - IP Network Address vs Host Address compared to area codes and phone numbers

The subnet mask

A subnet mask is another 32-bit number, written in dotted decimal notation, that is used alongside an IP address. Its job is to show:

  • where the network section of the IP address ends, and
  • where the host section begins.

In other words, the subnet mask marks the boundary between the network and host portions of an IP address. Once you know that boundary, you can also calculate how many IP addresses a network can hold.

How the subnet mask marks network vs. host bits

A subnet mask is also split into two sections:

  • The network section is made of all “on” bits (1s).
    • Wherever the subnet mask has a 1, that bit position belongs to the network portion of the IP address.
  • The host section is made of all “off” bits (0s).
    • Wherever the subnet mask has a 0, that bit position belongs to the host portion of the IP address.

It is important to stress that Subnet Masks consist of contiguous 1s followed by all zeroes wherever the 1s end. Subnet Masks never have 0s in between the 1s.

Just like with IP addresses, to convert the binary value of an octet to decimal, you add the positional values wherever there is a “1” in that octet.

(Image 127)

Image Title - Subnet Mask Network and Host bits

In the image above, we end up with a subnet mask of 255.255.255.0 in dotted decimal notation.

Applying a subnet mask to an IP address

When you apply the subnet mask to an IP address, you can see which bits are network bits and which bits are host bits.

For example, take the IP address 192.168.1.2 with a subnet mask of 255.255.255.0:

(Image 128)

Image Title - 192.168.1.2 compared to the Subnet Mask

Here, the network section (the network bits) is 192.168.1.

The host section is the .2 portion. The boundary between network and host is between the third and fourth octet. That means:

  • The entire fourth octet can be used for host addresses (assigned to devices such as NIC cards on computers and servers, or router interfaces).
  • The network section tells you which network those host addresses belong to.

Network address (network ID)

You can derive the network address (also called the network ID) from the subnet mask.

For this network, the network address is 192.168.1.0. This happens because:

  • the network bits stay the same, and
  • all host bits are set to 0.

When all the host bits in an IP address are 0, that IP address is the network address.

(Image 129)

Image Title - Network Address of 192.168.1.0 with Subnet Mask of 255.255.255.0

Host addresses

The moment you have any bit turned “on” (1) in the host section of an IP address, you’re looking at a host address.

(Image 130)

Image Title - Host Address of 192.168.1.2 due to having bits turned “on” in the Host bits section

Finding the last address in the network

To find how many IP addresses the 192.168.1.0 network can hold, you can turn on all the 1s in the host section.

(Image 131)

Image Title - Turning on all of the 1s in the Host section of the 192.168.1.0 Network

That gives 192.168.1.255 in dotted decimal. This is the last possible IP address in the network, so the full network range is:

  • 192.168.1.0 - 192.168.1.255

But there is one important rule in IP Networking to be aware of. You cannot assign the Network Address (Network ID) to a host, since that is reserved for defining the Network and you cannot use the very last IP Address in any Network. The last IP Address is reserved as the Broadcast Address. As the name suggests, this Address is used whenever an IP Packet should be forwarded to every IP Address within the Network.

So, the usable host range is:

  • 192.168.1.1 - 192.168.1.254

Out of the 256 total addresses in the network (192.168.1.0 - 192.168.1.255), only 254 can be assigned to hosts (.1 - .254).

This is because we can’t use the Network Address and we can’t use the Broadcast Address 256−2=254.

Comparing two similar-looking IP addresses

Compare these two IP addresses, both using a subnet mask of 255.255.255.0:

  • 192.168.1.1
  • 192.168.2.2

(Image 133)

Image Title - 192.168.1.1 vs. 192.168.2.2 with a Subnet Mask of 255.255.255.0 in Dotted Decimal and Binary

These two IPs can look like they belong to the same network because the first two octets match. But the subnet mask shows that the third octet is part of the network section, and the third octet is different:

  • 192.168.1.x is one network
  • 192.168.2.x is a different network

Because the network portion produces different values, these are separate networks.

Another example with a different subnet mask

Now compare 172.16.1.4 and 172.16.2.8 using a subnet mask of 255.255.0.0.

(Image 134)

Image Title - 172.16.1.4 vs. 172.16.2.8 with a Subnet Mask of 255.255.0.0 in Dotted Decimal and Binary

Are these two IP Addresses within the same Network?

(spoiler)

Yes, because they both have the same value for the Network bits section of the Subnet Mask therefore, they are in the same Network.

As long as the network bits align between IP addresses, those IP addresses are part of the same network.

IP address structure

  • Split into network section (network ID) and host section
  • Network ID = identifies the network (like area code)
  • Host section = identifies specific device (like phone number)

The subnet mask

  • 32-bit number in dotted decimal, paired with IP address
  • Marks boundary between network bits and host bits
  • Network bits = contiguous 1s; host bits = contiguous 0s
    • No 0s allowed between 1s
  • Used to calculate total addresses in a network

Applying subnet mask to an IP address

  • Bits under mask’s 1s = network portion
  • Bits under mask’s 0s = host portion
  • Example: 192.168.1.2 with mask 255.255.255.0
    • Network = 192.168.1
    • Host = last octet (.2)

Network address (network ID)

  • Derived by setting all host bits to 0
  • Example: 192.168.1.0 = network address for that subnet
  • Any IP with all host bits = 0 is the network address, not assignable to a host

Host addresses

  • Any IP with at least one host bit turned on = valid host address
  • Example: 192.168.1.2

Finding network range and broadcast address

  • Turn on all host bits to find last address (broadcast address)
  • Example: 192.168.1.255 = broadcast address
  • Full network range: 192.168.1.0 – 192.168.1.255
  • Broadcast address reserved for sending to all hosts on network
  • Cannot assign network address or broadcast address to hosts
  • Usable host range for the 192.168.1.0 network: 192.168.1.1 – 192.168.1.254
  • Formula to calculate usable host addresses: n−2, where n = the total number of IPs in the the network. For example, on a network with 256 total IP addresses: 256−2=254, there are 254 usable host addresses

Comparing IP addresses for same/different networks

  • Must compare only the network bits (per subnet mask) to determine same network
  • Example: 192.168.1.1 vs 192.168.2.2 with mask 255.255.255.0
    • Third octet differs → different networks despite similar appearance
  • Example: 172.16.1.4 vs 172.16.2.8 with mask 255.255.0.0
    • Only first two octets are network bits → same network since they match

Sign up for free to take 5 quiz questions on this topic

Previous
Next  | 3.1.3 Public vs. private IP addresses
All rights reserved ©2016 - 2026 Achievable, Inc.

IPv4 network addresses vs. host addresses

IP network addresses and IP host addresses

Every IP address is split into two parts:

  • The network section
  • The host section

The network section (network ID)

The first section of an IP address identifies the network the address belongs to. This section is often called the network ID.

A helpful analogy is a phone number:

  • The area code tells you which city or region the number belongs to.
  • In the same way, the network section tells you which network an IP address belongs to.

The host section

The second section of an IP address identifies a specific device (a host) on that network. This is the part that’s assigned to a device.

Using the phone number analogy again:

  • The host section is like the actual phone number assigned to a specific phone.

(Image 126)

Image Title - IP Network Address vs Host Address compared to area codes and phone numbers

The subnet mask

A subnet mask is another 32-bit number, written in dotted decimal notation, that is used alongside an IP address. Its job is to show:

  • where the network section of the IP address ends, and
  • where the host section begins.

In other words, the subnet mask marks the boundary between the network and host portions of an IP address. Once you know that boundary, you can also calculate how many IP addresses a network can hold.

How the subnet mask marks network vs. host bits

A subnet mask is also split into two sections:

  • The network section is made of all “on” bits (1s).
    • Wherever the subnet mask has a 1, that bit position belongs to the network portion of the IP address.
  • The host section is made of all “off” bits (0s).
    • Wherever the subnet mask has a 0, that bit position belongs to the host portion of the IP address.

It is important to stress that Subnet Masks consist of contiguous 1s followed by all zeroes wherever the 1s end. Subnet Masks never have 0s in between the 1s.

Just like with IP addresses, to convert the binary value of an octet to decimal, you add the positional values wherever there is a “1” in that octet.

(Image 127)

Image Title - Subnet Mask Network and Host bits

In the image above, we end up with a subnet mask of 255.255.255.0 in dotted decimal notation.

Applying a subnet mask to an IP address

When you apply the subnet mask to an IP address, you can see which bits are network bits and which bits are host bits.

For example, take the IP address 192.168.1.2 with a subnet mask of 255.255.255.0:

(Image 128)

Image Title - 192.168.1.2 compared to the Subnet Mask

Here, the network section (the network bits) is 192.168.1.

The host section is the .2 portion. The boundary between network and host is between the third and fourth octet. That means:

  • The entire fourth octet can be used for host addresses (assigned to devices such as NIC cards on computers and servers, or router interfaces).
  • The network section tells you which network those host addresses belong to.

Network address (network ID)

You can derive the network address (also called the network ID) from the subnet mask.

For this network, the network address is 192.168.1.0. This happens because:

  • the network bits stay the same, and
  • all host bits are set to 0.

When all the host bits in an IP address are 0, that IP address is the network address.

(Image 129)

Image Title - Network Address of 192.168.1.0 with Subnet Mask of 255.255.255.0

Host addresses

The moment you have any bit turned “on” (1) in the host section of an IP address, you’re looking at a host address.

(Image 130)

Image Title - Host Address of 192.168.1.2 due to having bits turned “on” in the Host bits section

Finding the last address in the network

To find how many IP addresses the 192.168.1.0 network can hold, you can turn on all the 1s in the host section.

(Image 131)

Image Title - Turning on all of the 1s in the Host section of the 192.168.1.0 Network

That gives 192.168.1.255 in dotted decimal. This is the last possible IP address in the network, so the full network range is:

  • 192.168.1.0 - 192.168.1.255

But there is one important rule in IP Networking to be aware of. You cannot assign the Network Address (Network ID) to a host, since that is reserved for defining the Network and you cannot use the very last IP Address in any Network. The last IP Address is reserved as the Broadcast Address. As the name suggests, this Address is used whenever an IP Packet should be forwarded to every IP Address within the Network.

So, the usable host range is:

  • 192.168.1.1 - 192.168.1.254

Out of the 256 total addresses in the network (192.168.1.0 - 192.168.1.255), only 254 can be assigned to hosts (.1 - .254).

This is because we can’t use the Network Address and we can’t use the Broadcast Address 256−2=254.

Comparing two similar-looking IP addresses

Compare these two IP addresses, both using a subnet mask of 255.255.255.0:

  • 192.168.1.1
  • 192.168.2.2

(Image 133)

Image Title - 192.168.1.1 vs. 192.168.2.2 with a Subnet Mask of 255.255.255.0 in Dotted Decimal and Binary

These two IPs can look like they belong to the same network because the first two octets match. But the subnet mask shows that the third octet is part of the network section, and the third octet is different:

  • 192.168.1.x is one network
  • 192.168.2.x is a different network

Because the network portion produces different values, these are separate networks.

Another example with a different subnet mask

Now compare 172.16.1.4 and 172.16.2.8 using a subnet mask of 255.255.0.0.

(Image 134)

Image Title - 172.16.1.4 vs. 172.16.2.8 with a Subnet Mask of 255.255.0.0 in Dotted Decimal and Binary

Are these two IP Addresses within the same Network?

(spoiler)

Yes, because they both have the same value for the Network bits section of the Subnet Mask therefore, they are in the same Network.

As long as the network bits align between IP addresses, those IP addresses are part of the same network.

Key points

IP address structure

  • Split into network section (network ID) and host section
  • Network ID = identifies the network (like area code)
  • Host section = identifies specific device (like phone number)

The subnet mask

  • 32-bit number in dotted decimal, paired with IP address
  • Marks boundary between network bits and host bits
  • Network bits = contiguous 1s; host bits = contiguous 0s
    • No 0s allowed between 1s
  • Used to calculate total addresses in a network

Applying subnet mask to an IP address

  • Bits under mask’s 1s = network portion
  • Bits under mask’s 0s = host portion
  • Example: 192.168.1.2 with mask 255.255.255.0
    • Network = 192.168.1
    • Host = last octet (.2)

Network address (network ID)

  • Derived by setting all host bits to 0
  • Example: 192.168.1.0 = network address for that subnet
  • Any IP with all host bits = 0 is the network address, not assignable to a host

Host addresses

  • Any IP with at least one host bit turned on = valid host address
  • Example: 192.168.1.2

Finding network range and broadcast address

  • Turn on all host bits to find last address (broadcast address)
  • Example: 192.168.1.255 = broadcast address
  • Full network range: 192.168.1.0 – 192.168.1.255
  • Broadcast address reserved for sending to all hosts on network
  • Cannot assign network address or broadcast address to hosts
  • Usable host range for the 192.168.1.0 network: 192.168.1.1 – 192.168.1.254
  • Formula to calculate usable host addresses: n−2, where n = the total number of IPs in the the network. For example, on a network with 256 total IP addresses: 256−2=254, there are 254 usable host addresses

Comparing IP addresses for same/different networks

  • Must compare only the network bits (per subnet mask) to determine same network
  • Example: 192.168.1.1 vs 192.168.2.2 with mask 255.255.255.0
    • Third octet differs → different networks despite similar appearance
  • Example: 172.16.1.4 vs 172.16.2.8 with mask 255.255.0.0
    • Only first two octets are network bits → same network since they match

More from Understanding IP addresses

  • IPv4 addressing
  • Public vs. private IP addresses