4

Let's say I have a multicast group 239.0.0.1.

If A and B are members of this group and listening on port 6000, I can send data to (239.0.0.1, 6000) and both A and B will receive. Now, if A is listening on port 6000 and B on port 7000, how to send data to both the members in a single transmission ?

If the above scenario is not possible, then does it mean that a multicast group is not just identified by its multicast group address but by the 2-tuple multicast group address and port number ? I could not find such definition for a multicast group anywhere.

  • If you make the question a general multicast question, I can answer it. I have seen similar setups where there are several sources sending to the same group but different ports. – Daniel Dib Dec 8 '14 at 5:14
4

Subscribing to a multicast group and listening on a multicast address and port are two different things. If you are subscribed to a multicast group all traffic with that destination address should be sent to your host. It is another step to listen on a specific port and process that traffic.

In your example, traffic with destination 239.0.0.1:6000 would be sent to both hosts but since only host A has an application that is listening, only host A will do anything with that traffic.

It is not possible to send to all port numbers or send to the * port. No such concept exists in TCP/UDP. If you were using a different protocol, maybe there is something like that.

| improve this answer | |
  • So, if I have a setup as I mentioned, then I have to send twice, one for (239.0.0.1, 6000) and other for (239.0.0.1, 7000). Is that correct ? Also, is it that no two applications in a same PC can subscribe to same multicast group ? (because different processes cannot listen on same port.) – Ezio Dec 8 '14 at 21:53
  • "Also, is it that no two applications in a same PC can subscribe to same multicast group ? (because different processes cannot listen on same port.)" - I just found that this is possible with "SOL_SOCKET" option. – Ezio Dec 8 '14 at 22:15
  • Yes, if you want to send to two different ports you must send twice. – jamesbtate Dec 12 '14 at 2:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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