347 views

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$

@priyanka gautam-piya please see below example

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:

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

Reference

Good question
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

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

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

152.45.47.255 is option A hence it is the answer.

by

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

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

1 vote
1
240 views
1 vote