Visual breakdown of IP address components: Network Prefix, Network ID, Broadcast ID, and Host Address explained with examples.

Mastering Host Address, Network Prefix, Network ID, and Broadcast ID in 2025

This article, “Mastering Prefix, Network ID, Broadcast ID, and Host Address” is the continuation of my previous articles about the IP address, which are the following:

IP address Classes- Exclusive Explanation

Positional Number System and Examples (Updated 2025)

Network and Host Portion of IPv4 Address

So, you need to study the above article to understand it better before reading it. Let’s dive into this article if you have already covered the above topics.

The Prefix Length

Expressing network and host addresses with the dotted decimal subnet mask address is difficult. So, convert the dotted-decimal representation of the subnet mask to binary and count the number of adjacent 1s bits, starting at the most significant bit in the first octet. The number of 1s in the subnet mask is called a prefix. The prefix is written in “slash notation”, a “/” followed by the number of bits set to 1 in the subnet mask. For example, calculate the prefix length if the subnet mask is 255.255.128.0.

255.255.128.0   in binary 11111111.11111111.10000000. 00000000, now count the 1s from the left side, which is 17, so the prefix length is /17. We can easily calculate the subnet mask from the prefix length.  For example, if the prefix length is /20, the total number of 1s in the subnet mask is 20. So write 1 twenty times followed by twelve 0s, 11111111.11111111.11110000. 00000000. Now convert the binary number into a decimal dotted notation, which is 255.255.240.0. We can manage a table for all possible prefixes.

The table below illustrates all possible prefixes for 32-bit addresses, including their subnet mask in binary and decimal. The first column lists all possible prefixes. The second column displays the binary value of the prefix, and the last column shows the resulting subnet mask.

Prefix-lengthBinary value for the prefix-lengthThe Subnet Mask
/811111111.00000000.00000000.00000000255.0.0.0
/911111111.10000000.00000000.00000000255.128.0.0
/1011111111.11000000.00000000.00000000255.192.0.0
/1111111111.1110000.00000000.00000000255.224.0.0
/1211111111.11110000.00000000.00000000255.240.0.0
/1311111111.11111000.00000000.00000000255.248.0.0
/1411111111.11111100.00000000.00000000255.252.0.0
/1511111111.11111110.00000000.00000000255.254.0.0
/1611111111.11111111.00000000.00000000255.255.0.0
/1711111111.11111111.10000000.00000000255.255.128.0
/1811111111.11111111.11000000.00000000255.255.192.0
/1911111111.11111111.11100000.00000000255.255.224.0
/2011111111.11111111.11110000.00000000255.255.240.0
/2111111111.11111111.11111000.00000000255.255.248.0
/2211111111.11111111.11111100.00000000255.255.252.0
/2311111111.11111111.11111110.00000000255.255.254.0
/2411111111.11111111.11111111.00000000255.255.255.0
/2511111111.11111111.11111111.00000000255.255.255.128
/2611111111.11111111.11111111.11000000255.255.255.192
/2711111111.11111111.11111111.11100000255.255.255.224
/2811111111.11111111.11111111.11110000255.255.255.240
/2911111111.11111111.11111111.11111000255.255.255.248
/3011111111.11111111.11111111.11111100255.255.255.252

Network Address

A network address is the first logical address of the network that uniquely identifies a network or a subnet. An IP address combines two separate addresses: the network address and the host address. But if we eliminate the host address from the IP address, the remaining address will be the network address. In other words, a network address is an IP address without a host address or an IP address in which all host bits are turned 0s.

We can find the network address applying the logical AND process between the binary representation of the IP address and subnet mask. Align the bits in both addresses, and perform a logical AND on each pair of the respective bits. Then convert the individual octets of the result back to decimal. For example, if we have a host IP address 172.100.20.50 and the subnet mask is 255.255.128.0 calculate the network address for the IP address. The figure below illustrates the solution to the above example.

An educational diagram explaining the process of determining the network address by converting an IP address and subnet mask to binary, performing a bitwise AND operation, and converting the result back to decimal. The example uses IP address 172.100.50.20 and subnet mask 255.255.128.0, showing calculations step by step. The outcome is a network IP of 172.100.0.0.
Decoding IP addressing: Learn how to calculate the network IP using an IP address and subnet mask.

Broadcast Address

The broadcast address is the last logical address in the network or a subnet, and it is used to address all the nodes in the network simultaneously. This is a unique address that communicates with all hosts in a network. For example, when a host sends a packet to the network broadcast address, all hosts in the network will receive the packet. The broadcast address uses the highest address in the network range. The broadcast address has all 1s in the host portion. For example, find the broadcast address if the IP address is 172.100.20.0 and the subnet mask is 255.255.128.0. The figure below illustrates the solution to the above example.

An image explaining the network calculation process for an IP address (172.100.50.20) and a subnet mask (255.255.128.0). The process includes binary conversion, a bitwise AND operation, and converting the resulting binary back to decimal. The final output is a Network IP of 172.100.0.0.
Decoding IP addressing: Learn how to calculate the network IP using an IP address and subnet mask.

Host Address

The host address uniquely identifies the host in the network. The host portion always contains various 0s and 1s but never all 0s or all 1s.

First Host Address

The network’s first available host IP address has all 0s and ends with a 1 in the host portion. It is also called the first usable IP address.

Example

 Dotted Decimal NotationBinary
Network IP Address172.100.0.0/1710101100.01100100.00000000.00000000
First Usable IP address172.100.0.110101100.01100100.00000000.00000001

Last Host Address

The network’s last available host IP address has 1s and ends with a 0 in the host portion. It is also called the last usable IP address.

Example

 Dotted Decimal NotationBinary
Last Usable IP Address172.100.127.25410101100.01100100.01111111.11111110
Broadcast IP Address172.16.127.25510101100.01100100.01111111.11111111

FAQs

  • How do I calculate the network prefix from an IP address?

    Use the subnet mask (IPv4) or prefix length (IPv6). For IPv4, convert the IP and subnet mask to binary, perform a bitwise AND operation, and convert back to decimal. For IPv6, the first 64 bits are typically the network prefix.

  • Why can’t the host ID be all zeros or ones?

    A host ID of all zeros represents the network itself, while all ones is reserved for broadcast traffic. Assigning these to devices would cause addressing conflicts.

  • How does IPv6 simplify network prefixes compared to IPv4?

    IPv6 uses a fixed 64-bit network prefix, eliminating complex subnet masks. The remaining 64 bits are for the host, often auto-generated from the MAC address.

  • What happens if two devices share the same host address?

    It causes an IP conflict, leading to connectivity issues for both devices. Use DHCP or manual checks to ensure unique host IDs on the same network.

  • How do routers use broadcast addresses?

    Routers forward broadcast traffic to all devices on a network. For example, DHCP requests use broadcast addresses to discover available servers.

  • What is CIDR notation, and why is it important?

    CIDR (Classless Inter-Domain Routing) replaces classful addressing with flexible prefix lengths (e.g., /24). It reduces IP waste and simplifies subnetting.

  • How has IPv6 adoption affected network design?

    IPv6’s larger address space eliminates NAT, simplifies routing, and improves security. However, dual-stack setups (IPv4/IPv6) are still common during transition phases.

Avatar of Asad Ijaz

Asad Ijaz

NetworkUstad's lead networking architect with CCIE certification. Specializes in CCNA exam preparation and enterprise network design. Authored 2,800+ technical guides on Cisco systems, BGP routing, and network security protocols since 2018. Picture this: I'm not just someone who writes about tech; I'm a certified expert in the field. I proudly hold the titles of Cisco Certified Network Professional (CCNP) and Cisco Certified Network Associate (CCNA). So, when I talk about networking, I'm not just whistling in the dark; I know my stuff! My website is like a treasure trove of knowledge. You'll find a plethora of articles and tutorials covering a wide range of topics related to networking and cybersecurity. It's not just a website; it's a learning hub for anyone who's eager to dive into the world of bits, bytes, and secure connections. And here's a fun fact: I'm not a lone wolf in this journey. I'm a proud member and Editor of Team NetworkUstad. Together, we're on a mission to empower people with the knowledge they need to navigate the digital landscape safely and effectively. So, if you're ready to embark on a tech-savvy adventure, stick around with me, Asad Ijaz Khattak. We're going to unravel the mysteries of technology, one article at a time!"