in Computer Networks edited by
774 views
6 votes
6 votes

IP address of a particular class B host is $152.45.32.14$, what is the broadcast address of the subnet if the subnet mask is $255.255.240.0$?

  1. $152.45.47.255$
  2. $152.45.255.255$
  3. $152.45.53.14$
  4. $152.45.47.256$
in Computer Networks edited by
by
774 views

4 Comments

@priyanka gautam-piya please see below example

we are calculating broadcast address of an entire IPv4 subnet.

RULE :

"The broadcast address for an IPv4 host can be obtained by performing a bitwise OR operation between the bit complement of the subnet mask and the host's IP address.

In other words, take the host's IP address, and set to '1' any bit positions which hold a '0' in the subnet mask."

Means take the subnet mask and set all 0's into 1 . now convert it and add with corresponding IP address value.

Example:

Host ip address 172.16.0.0, which has the subnet mask 255.240.0.0

240 = 128+64+32+16 means 1111 0000 now turn all 0 into 1 it becomes   1111 1111 

last four 1 is 1+2+4+8 = 15

172.16.0.0, so add 16 + 15 = 31 in 3rd octet .

in 2nd octet  flip all 0 into 1 it become 255

and in 1st octet flip all 0 into 1 it become 255

so the broadcast address becomes 172.31.255.255

So finally for ip address 172.16.0.0  subnet mask  255.240.0.0  and the broadcast address is 172.31.255.255

Reference

https://en.wikipedia.org/wiki/Broadcast_address

1
1
Good question
0
0
edited by
first find NID by using given host address and mask.It is 152.45.32.0.

Now to get directed broadcast address for this NID , putting ones in HID part , we get 152.45.47.255.

Is my approach correct ? Please correct me if I am wrong
0
0

1 Answer

4 votes
4 votes
Best answer

IP address of a particular class B host is 152.45.32.14, 16 bits for network part and 16 bits for host part .

need to calculate the broadcast address  of the subnet if the subnet mask is 255.255.240.0 

class B so N N H H , mask is 255.255.240.0  now 240 = 128 + 64 + 32 + 16 ( 2nd octet) 

128  64   32  16   8  4  2  1

 1    1     1     1   0  0   0  0

now turn / flip all 0 into 1 in both 1st and 2nd octet  and it become  1111 means 1 + 2 +4+8 = 15 in 2nd octet and in 1st octet 1111 1111 

now add 15 with 32 ( from ip address host 2nd octet) and it becomes 15 + 32 =  47

so  the broadcast address of  host  152.45.32.14 is  152.45.47.255

152.45.47.255 is option A hence it is the answer.

4 Comments

@Bikram I understood the mistake I was doing. Thanks for correcting me.
2
2

@bikram sir, Here it says "you have to find that your IP address is in which subnet, that subnet's first address is network address and last address is broadcast address." in the link.  So answer becomes B by this logic. Is it incorrectly given here in 5th point of this link? https://www.wikihow.com/Calculate-Network-and-Broadcast-Address

0
0

@shraddha

Subnet mask is indicating that 4 bits of last second octet is the bits used for subnet ID

The ip address is 152.45.32.14   ( 32 - 00100000)   here the subnet id is 0010......for remaining bits u make it 1...therefore u get 47

3
3
Answer:

Related questions