View Single Post

  #1 (permalink)  
Old 04-06-2004
Juanjo Aparicio Jara
 
Posts: n/a
Default Too much multicasting in Linux

Hello everybody. I've run into something that amazes me.

I've seen some posts from people who can't send/receive datagrams sent
to multicast addresses. I have the opposite problem.

I have a pair of Java classes (hold on, this is not a Java related
question, as you will see...) that do some things with multicast
addresses. One of them is sending some datagram packets to the
multicast address 224.0.1.84, port 4160. The other is listening for
datagram packets sent to the address 224.0.1.85. It listens to port
4160.

Now, see that the latter application has joined the multicast group
224.0.1.85, while the first application has joined no group, it just
sends its data to 224.0.1.84:4160.

I expected the second application NOT to receive the datagrams. But
that's exactly what it does: it is receiving datagrams sent to a
multicast address it's not subscribed to.

I first thought it could be the Java implementation, so I went and
copied a quick multicasting example from the net, in C. The results
are the same.

After some tests, it seems that whenever a UDP socket is created and
it joins ANY multicast group (class D IP address) and that socket is
bound to port A, any datagram sent to any class D IP address and port
A is received by this socket.

Has anybody any idea of what is going on? I can provide source code
if you wish. BTW, linux kernel is 2.4.25. What kernel options would
be useful to know?

I've spent quite a long time (some hours, now) looking for info in the
Internet, but it seems the common problem is the opposite. Moreover,
all tutorials/docs say you MUST join a multicast group before you can
receive udp packets sent to that address.

TIA.

PS: I've had problems with my news reader when posting this message.
You may receive it twice. If so, please accept my apologies for any
inconvenience.

Reply With Quote