2
votes

This may be a silly question (but I'm new to multicast). I have a process that spawns two threads -- one for listening to a multicast IP (listener) and one for broadcasting to it (speaker). I'm planning on introducing many of these processes.

My question is, if a listener receives a multicast packet, can it send a unicast response to whichever process' speaker sent it without opening a new unicast-style socket?

EDIT: at the very least, I can pull the IP address of the speaker's multicast packet and connect to some unicast-style port that process may be listening on, right?

1
I believe the answers are No, and Yes.500 - Internal Server Error
Does multicast actually have a notion of a connection? I somehow doubt it, because the whole point of MC is that the sender doesn't care about who's listening.Kerrek SB

1 Answers

3
votes

EDIT: at the very least, I can pull the IP address of the speaker's multicast packet and connect to some unicast-style port that process may be listening on, right?

Multicast packets (actually any IP packets) have source and destination IP, the only difference in multicast is that destination addresses are of groups and not computers , starting with 224.0.x.x. The source is always the real IP of the sender (unless it's behind NAT, in this case it will be the gateway's IP address).

This means that you can extract the IP of the sender, and IF this sender has a server (==listening) socket, and all network configurations (Forwarding table & Firewall) allow access to that socket, you will be able to initiate a TCP Session with it...