This is a discussion on Too much multicasting in Linux within the Linux Networking forums, part of the Linux Forums category; Hello everybody. I've run into something that amazes me. I've seen some posts from people who can't ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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. |
|
|||
|
Juanjo Aparicio Jara <bnt@fastpace.org> wrote
news:slrnc75nup.1df.bnt@bitbucket.fastpace.org: > 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? What do you mean by received ? At the application level or at NIC level (using a network sniffer) ? For your information, the "registry" process of multicast socket consist to send IGMP packets when a NIC join or quit a multicast group. But this information is used by ethernet swith only (in ethernet LAN) to maintain a list of multicast subscriber and so to optimized paket switching. (There is also IGMRP to route IGMP between two networks) A range of ethernet mac address are reserved for multicast address. But the NIC of your hosts don't maintain a mapping list of <Host ip>- <multicast group>, and so when a NIC use at least one multicast address, the NIC start to receive any multicast ethernet packet and so all the multicast packet are process. But only revelante packets should be route to the application level. So, and because your 2 applications are on the same host, if you listen to a multicast address, even without any IGMP registration process, you will receive packet send from your host to this multicast address. Regards |