How to send Multicast packets

How to send Multicast packets

Post by Vish Viswanatha » Tue, 02 Mar 1999 04:00:00



I have a problem sending multicast packets in my linux system. I have a UDP
program which needs to send multicast packets addressed to 224.1.5.1 (which
is a clss D address). If I call 'sendto' with this address, i get a "network
unreachable" error. However, if I add this address to the router table with
the command
        route add -host 224.1.5.1 eth0
then it works ok.
My 'ifconfig' command shows 'multicast' enabled.

Shouldn't the system automatically figure out that this is a multicast
address and do the right thing. Why should I add each multicast address that
I am interested in to the router table.

Thanks
Vish


Could somebody tell me what I am missing here?.

Thanks
Vish

 
 
 

1. Sending multicast packet on a raw socket

Dear all,

I'm currently trying to write a small program which sends igmp query out on
my LAN. It is currently working fine under different version of FreeBSD.
Packets are sent out on the Network and I can see them arriving on my
different routers.
I compiled this program on Solaris 8 (using gcc 2.95.2). So far so good but
when I execute it there are no packets sent out on my networks !!!!

The call I do to send the packets is easy:

nbs = sendto(s,&pkt,sizeof(struct igmp),0,(struct sockaddr *)sa,salen);
  if ( nbs < 0 ) {
    perror("Sending query");
    return FALSE;
  }

and creation of the socket is done like this:

  s = socket(AF_INET,SOCK_RAW,IPPROTO_IGMP);
  if ( lsq < 0 ) {
    perror("Creation of listening socket");
    return NULL;
  }

Has any body any idea what the problem could be ? Should I configure smth
special on the socket in order to make it run under Solaris ?

Thank you in advance for any help

--
Laurent Bourqui
BNC AG
Grubenstrasse 7
CH-3322 Sch?nbhl
Switzerland
+41 (0)31 858 58 58

www.bnc.ch

2. ncurses library

3. SPAK(Send PAcKets)- tools to send arbitrary packets

4. Telnet Problems

5. Sending Arp reply packets using packet-sockets on linux

6. Install on small HDD

7. Promiscious/Multicast Packet reception under DG/UX 5.4

8. IRC client for Solaris x86 2.4

9. multicast packets forwarding status

10. Why isn't my Linux box forwarding multicast packets?

11. routing multicast packets between subnets

12. udp multicast packet leakage out to wrong network

13. Routing Multicast Packets Received on Eth1 out Eth0 unchanged?