multicast question

yasushi@sirpa-b
Wed, 16 Dec 1998 01:03:37 -0800

Sorry for spamming. I just started learning IP multicast. I managed
to make two machines on the same subnet (sys194 and sys196, both on
the subnet 219) talk to each other using 224.0.0.10. But I can't do
the same between loom22 (128.95.2.147) and sys194 (128.95.2.194). So
I'm wondering what it takes to do a multicast.

I did something like below to set up the socket.

int ttl = 2;
ip_mreq mreq;
inet_aton("224.0.0.10", &mreq.imr_multiaddr);
mreq.imr_interface.s_addr = my_node_id;
setsockopt(udp_sock, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq, sizeof mreq);
setsockopt(udp_sock, IPPROTO_IP, IP_MULTICAST_TTL, &ttl, sizeof ttl);

And to send, I did

inet_aton("224.0.0.10", &sin.sin_addr);
sendto(udp_sock, buf, len);

By the way, all the machines run Linux 2.0.35 or 36

Also, is there a good page for learning multicast?

Thanks,
yasushi