This article will explain how to calculate the network address and the broadcast address of any given IP address.

In every network, the first and the last IP addresses are not assigned to any host. The first IP address is called the network address and the last IP address is called the broadcast address.

Network Address

The network address is a unique address to identify the network portion of the IP network. The network address is the same for all the hosts within the same IP network. All the bits of the host portion in an IP address are set to zero to identify as the network address of any IP network.

For example, IP address 192.168.5.50 with subnet mask 255.255.255.0 has the following network address.

192.168.5.50 —> 11000000.10101000.00000101.00000000  (Network)

255.255.255.0->  11111111.11111111.11111111.00000000 (Mask) [ All ones represent the network portion and all zeroes represent the host portion]

Network address will be 192.168.5.0/24

Broadcast Address

The Broadcast Address is the last address of an IP network. It is used to address all the nodes at the same time. The IP packet with a broadcast address is sent to all the nodes across the network. All the bits of the host portion in an IP address is set to one to identify as the broadcast address.

For example, IP address 192.168.5.50 with subnet mask 255.255.255.0 has the following broadcast address.

192.168.5.50 —> 11000000.10101000.00000101.11111111  (Broadcast)

255.255.255.0->  11111111.11111111.11111111.00000000 (Mask)[ All ones represent the network portion and all zeroes represent the host portion]

The broadcast will be 192.168.5.255/24

You can easily find out the network address and the broadcast address for classful addressing because, in classful addressing, when all host bits are zero, it represents network address and when the host bits are one it represents the broadcast address.

For Class A address:10.0.0.0/8

Network ID = 10.0.0.0

Broadcast ID = 10.255.255.255

For Class B address : 150.100.0.0/16

Network ID = 150.100.0.0

Broadcast ID = 150.100.255.255

For Class C address: 200.100.100.0/24

Network ID = 200.100.100.0

Broadcast ID = 200.100.100.255

Decimal to Binary  Conversion and vice versa

The calculation of network address and the broadcast address involves decimal to binary conversion or vice versa. Hence, the following method may be helpful in calculating the network address and the broadcast address of an IP address.

To convert the decimal number into binary numbers,

  • Divide the decimal number by 2.
  • Store the remainder ( either 0 or 1) repeatedly until the decimal number is completely divisible by 2.
  • Note down the series of the remainder in 1 or 0 in reverse order.

For Example: Convert (50)10 into binary format

Division by 2 Remainder
50/2 = 25 0
25/2 = 12 1
12/2 = 6 0
6/2 =3 0
3/2 = 1 1
1/2 =0 1

Writing the remainder in reverse order, we get (110010)2

Since, IP address is represented in a block of 8 bits,

(110010)2 is written as (00110010)2

Hence, (50)10 = (00110010)2

To convert binary into decimal format

  • Multiply the binary number with the binary exponential of its place value.
  • Add them all to give the decimal number.

For example, to convert (00110010) into decimal format

Binary Exponents 27 = 128 26 = 64 25 = 32 24 = 16 23 = 8 22 = 4 21 = 2 20 = 1
Binary Number 0 0 1 1 0 0 1 0
128 x 0 64 x 0 32 x 1 16 x 1 8 x 0 4 x 0 2 x 1 1 x 0
Decimal Number 0 + 0 + 32 + 16 + 0 + 0 + 2 + 0 = (50)10

Hence, the decimal equivalent of a binary number  (00110010)2  is  (50)10.

How to Calculate the Network Address and Broadcast Address

As you have seen, it is easier to calculate the network and broadcast id of a classful address with default subnet  But, the IP address with CIDR notation or variable subnet mask, you need a bit of mathematical calculation. There are different methods of calculating network id and broadcast id, however, using with logical ANDing and  ORing operation is more reliable and accurate.

The logical ANDing and ORing method is performed between Network and broadcast ID by comparing the IP address and the subnet mask. ANDing operation is done to calculate the network address and the ORing method is used to calculate the Broadcast address.

Let us understand it with the help of an example.

IP address 192.168.5.50 / 28 will have the network address and the broadcast address as the following.

Here, /28 ( read as slash 28) is the CIDR ( Classless Inter-Domain Routing) notation. The number after the slash (/) is the number of network bits. By changing the network bits, you will have different subnet masks. We will discuss the CIDR and subnetting concepts in the coming articles.

The following steps will illustrate how to calculate the network ID and the broadcast ID.

To calculate the network address

Step1: Write the given IP address in binary format.

Step 2: Write the subnet mask in binary form.

Step: Perform the logical  ANDing operation between the corresponding octets of the IP address and the subnet mask.

Step 4: Convert the result back to the decimal format and this will be the network address.

The following example illustrates the calculation of the network address.

Network address and broadcast address

Therefore the network address will be: 192.168.5.48

To calculate the broadcast address

Step1: Write the given IP address in binary format.

Step 2: Write the inverse of the subnet mask in binary form.

Step: Perform the logical  ORing operation between the corresponding octets of the IP address and the inverse of the subnet mask.

Step 4: Convert the result back to the decimal format and this will be the network address.

The following example illustrates the calculation of the broadcast address.

network address and broadcast address

Therefore, the network address will be: 192.168.5.63

Note:   In the above example, a subnet mask is shown in slash (/) notation or Network Prefix. The number shown after the slash is the number of network bits. In classful addressing, the number of network bits is fixed for each class. For Class A, it 8; for Class B – 16 and Class C -24 respectively, However, the network bits can be varied as per the requirement of the host in a network. In such a case, slash notation is termed as CIDR ( Classless Inter-Domain Routing).

CIDR notation is introduced by IETF (Internet Engineering Task Force) in 1993 to denote the subnetted network in a simpler format. The subnetting is introduced to control the rapid exhaustion of IP v4 addresses using classful addresses. In subnetting, network bits are varied according to the subnets required or the host requirement in each subnet> Hence, it is easier to denote subnetwork addresses and their mask in CIDR notation.

The following tables show the subnet masks their corresponding CIDR values.

Subnet Mask CIDR Value
255.0.0.0 /8
255.128.0.0 /9
255.192.0.0 /10
255.224.0.0 /11
255.240.0.0 /12
255.248.0.0 /13
255.252.0.0 /14
255.254.0.0 /15
255.255.0.0 /16
255.255.128.0 /17
255.255.192.0 /18
255.255.224.0 /19
255.255.240.0 /20
255.255.248.0 /21
255.255.252.0 /22
255.255.254.0 /23
255.255.255.0 /24
255.255.255.128 /25
255.255.255.192 /26
255.255.255.224 /27
255.255.255.240 /28
255.255.255.248 /29
255.255.255.252 /30

Remember: Subnet mask /31 and /32 cannot be assigned to any network. Because we need at least two IP addresses to connect two devices in a network.

10 thoughts on “How to Calculate Network Address and Broadcast Address”

  1. Exceptional read, Positive site, where diyou u come up with all the info on this posting?
    I have read a few of the articles on your website now, and I
    really like your style.
    King regards,
    Abildgaard Hessellund

  2. Cool blog! Is your theme custom made or did you download it from somewhere? A theme like yours with a few simple adjustements would really make my blog jump out. Please let me know where you got your theme. Cheers

  3. Have you ever considered creating an ebook or guest authoring on other blogs? I have a blog based on the same topics you discuss and would really like to have you share some stories/information. I know my audience would value your work. If you’re even remotely interested, feel free to shoot me an e-mail.

  4. Hello just wanted to give you a quick heads up. The text in your content seem to berunning off the screen in Opera. I’m not sure if this is a format issue or something to do with browser compatibility but Ifigured I’d post to let you know. The design look great though!Hope you get the problem fixed soon. Cheers

  5. Thanks a bunch for sharing this with all of us you actually know what you are talking about! Bookmarked. Kindly also visit my site =). We could have a link exchange contract between us!

  6. I’ve been surfing on-line greater than 3 hours today, but I by no means discovered any attention-grabbing article like yours. It抯 lovely worth sufficient for me. In my view, if all site owners and bloggers made excellent content material as you did, the web will likely be a lot more useful than ever before.

Leave a Reply

Your email address will not be published. Required fields are marked *