Determine the sender from a received DatagramPacket in a Multicast group

659 views Asked by At

I am trying to implement a Multicast group in Java whose members can both send and receive DatagramPackets by using MulticastSockets. The sender relies on acknowledgements from the receiving members in order to ensure, say, that all members have received the transmitted file.

My question is whether it is possible for a receiving member to determine the sender of the packet, as all members send and receive packets through the Multicast address they have joined.

This should be possible by assigning each member an ID which will be included (as a sort of preamble) in the first packet of a transmission, but I was wondering whether there is a better solution.

Is any information which could be used to determine the sender stored in the DatagramPacket sent?

1

There are 1 answers

1
KodingKid On

Source addresses are always unicast. In other words, transmission of data always begins from a single source. Hence, no matter which node we consider in a network, the packet it gets will have a source MAC address and a destination MAC address (which will be multicast). Using the source MAC address you should be easily able to tell the sender of the packet. I believe you have improperly modeled your problem. Provide us with your UML diagrams/code so that we can analyse it better.