0

I was thinking about broadcasting in an ad-hoc local area network, then i asked me a question.Assuming that this LAN is made of 2 pc, if this pc have the same IP address, Can i send udp packet from one to the other, with broadcast address ? I know that a packet send to broadcast address is "catched" by all pc in the network, but , is broadcasting equal to send packet on all address one by one ( mean that a packet send to the IP address "myipaddress" don't go out of my pc) or is it Different ( mean that the packet go out of my pc and all pc on the network consider that it is for theim, no matter if their IP address is different or equal to myipaddress ). Thank.

2
  • Businesses really should not use ad hoc. It is too inconsistent, and your business needs a reliable network. You should use an infrastructure.
    – Ron Maupin
    Feb 26, 2018 at 15:09
  • Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you could provide and accept your own answer.
    – Ron Maupin
    Apr 1, 2018 at 21:19

1 Answer 1

2

There are a couple of issues here.

1) I'm not sure of all IP network stacks, but often the driver will drop packets it perceived to be sent by itself. This can often be got round with listening for raw packets, but this will require a privileged state

2) What address does this get sent back to. Generally applications (and possibly the IP stack), expects to send back to the sending address. If this is it's own address I'm not sure how the stack will cope. Again you could mess with this.

In the end you might be better off just sending raw data out in ethernet packets and listening that way. One major element of this puzzle of this to understand how to solve this, is why are you wanting to do this. Why are you expecting the computers to have the same IP, will this be always true or is it just to cover if two PCs end up picking the same IP address?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.