0

I have some doubt in the problem which follows:

Suppose a host with IP address 19.121.202.123 wants to send a packet to all the hosts in the same network. Then, what destination address should it use?


I think it should be 19.255.255.255, but I am not getting the meaning of "same network" here?

Can anyone help?

Ron Maupin
  • 99,565
  • 26
  • 120
  • 195
Garrick
  • 103
  • 1
  • 4
  • You don't provide enough information to answer the question. It depends on the network mask used for the network. You either need the specific mask, or you need the mask length. – Ron Maupin Nov 05 '16 at 17:56
  • @RonMaupin, it is 255.0.0.0 – Garrick Nov 05 '16 at 17:57

1 Answers1

1

See this answer, and understand that you need both an address and mask to determine the network, then the broadcast address is the last address in the network.

Mask the address with the mask (logical AND) to get the network, and you set all the host bits to 1 to get the broadcast address. You need to convert the address and mask to binary, do your calculations, the convert it back to decimal. Not everything will line up nicely with the decimal points in a text representation of an IPv4 address, and not doing it in binary will cause you problems.

The network is any address with the same networks bits. Any combinations of host bits with the same network bits are in the same network.

Ron Maupin
  • 99,565
  • 26
  • 120
  • 195
  • Thanks for the help ! Just a doubt, why dont we use 255.255.255.0 here ? – Garrick Nov 05 '16 at 18:09
  • You may use many different network masks. It depends on the context. If you are looking to configure a site, you may be given a network with a mask like 255.255.192.0, and it would be your job to divide that network into smaller networks. You may need to conserve addresses, and end up with various sized networks to use for different things. – Ron Maupin Nov 05 '16 at 18:11