lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: RE : RE : [lwip-users] Multi-cast UDP messages?


From: Robert Morse
Subject: Re: RE : RE : [lwip-users] Multi-cast UDP messages?
Date: Tue, 15 May 2007 10:00:35 -0400

Thanks,
        That netif_set_default() did the trick.

Robert

On May 14, 2007, at 6:15 PM, Frédéric BERNON wrote:

Sending a datagram to a multicast group doesn't really need any route: the lower 23bits of IP address are "mapped" on 23bits of MAC address. See etharp_output :

  /* multicast destination IP address? */
  } else if (ip_addr_ismulticast(ipaddr)) {
    /* Hash IP multicast address to MAC address.*/
    mcastaddr.addr[0] = 0x01;
    mcastaddr.addr[1] = 0x00;
    mcastaddr.addr[2] = 0x5e;
    mcastaddr.addr[3] = ip4_addr2(ipaddr) & 0x7f;
    mcastaddr.addr[4] = ip4_addr3(ipaddr);
    mcastaddr.addr[5] = ip4_addr4(ipaddr);
    /* destination Ethernet address is multicast */
    dest = &mcastaddr;

But ,the problem you got is like you don't have defined an default network interface :

struct netif *
ip_route(struct ip_addr *dest)
{
  struct netif *netif;

  /* iterate through netifs */
  for(netif = netif_list; netif != NULL; netif = netif->next) {
    /* network mask matches? */
    if (ip_addr_netcmp(dest, &(netif->ip_addr), &(netif->netmask))) {
      /* return netif on which to forward IP packet */
      return netif;
    }
  }
  /* no matching netif found, use default netif */
  return netif_default;
}

So, to fix this problem, check you call in your code the function :

void
netif_set_default(struct netif *netif)

====================================
Frédéric BERNON
HYMATOM SA
Chef de projet informatique
Microsoft Certified Professional
Tél. : +33 (0)4-67-87-61-10
Fax. : +33 (0)4-67-70-85-44
Email : address@hidden
Web Site : http://www.hymatom.fr
====================================
P Avant d'imprimer, penser à l'environnement



-----Message d'origine-----
De : address@hidden [mailto:address@hidden De la part de Robert Morse
Envoyé : lundi 14 mai 2007 23:03
À : Mailing list for lwIP users
Objet : Re: RE : [lwip-users] Multi-cast UDP messages?


Hi,
        After fixing a issue with a library, that was doing a
disable_preemption, when sending out
Multi-cast UDP packets, I finally have Multi-Cast UDP packets at least
getting to the TCP thread.
But still have a problem where they are not getting out on the network.
(I use the standard lwip_sendto()).

Turning on UDP debugging I am seeing the following:

        udp_connect: connected to 239.192.254.60 port 2222
        udp_send
        udp_send: No route to [239.192.254.60]  // It just displays the long.

Now, my units IP address is 89.89.200.201 with a netmask of 255.0.0.0,
So yes
the 239 address is not in my network.  Looking where it is trying to
figure out
the correct netif to use, it does just compare the IP Addresses against
the netmask
for a match.  I do not even see where it would take into an account a
gateway, to
route the packet through, (Though that might be at a higher level??)

I do see that it looks like multi-cast input is supported (Though I
don't know how much),
along with IGMP. I cannot figure out how to do the Multi-cast output.

Any help on where to look, or any other suggestions.

Thanks
        Robert


On May 11, 2007, at 10:33 AM, Robert Morse wrote:

Ya,
        That what I would of thought.
        I get no other messages after the lwip_sendto().  I am looking at if
something is wrong
with the mailbox going to the TCP thread, as that is all that I can
see it should be doing
is posting a message after that log.  I have traced to never returning
from netconn_connect(..).

        Thanks, at least I know that the stack supports it so I will keep
looking.

Robert

On May 11, 2007, at 10:24 AM, Frédéric BERNON wrote:

Hi,

I know that even before 1.1.0, we could send UDP on multicast address
(when I start with lwIP, that was one of first tests I did). From
memory, nothing was necessary to patch. Recv multicast was a little
bit difficult (because IGMP wasn't available), but if you get last
CVS release, IGMP is now supported.

Can you add some traces after :

lwip_sendto(2, data=007A977E, size=22, flags=0x0 to=239.192.26.32
port=2222

Before netconn_connect, and before lwip_send, to see where the stack
hang  ?


====================================
Frédéric BERNON
HYMATOM SA
Chef de projet informatique
Microsoft Certified Professional
Tél. : +33 (0)4-67-87-61-10
Fax. : +33 (0)4-67-70-85-44
Email : address@hidden
Web Site : http://www.hymatom.fr ====================================
P Avant d'imprimer, penser à l'environnement



-----Message d'origine-----
De : address@hidden
[mailto:address@hidden De
la part de Robert Morse
Envoyé : vendredi 11 mai 2007 15:52
À : Mailing list for lwIP users
Objet : [lwip-users] Multi-cast UDP messages?


Hi,
        I am trying to get version 1.2 of the lwip stack going, and while I
am having no problems with Webservers, an normal upd traffice.  But I
have the need to send multi-cast UDP packets and running into the
whole stack locking up, and causing a reboot.

        My question, is does the stack support sending out Multi-cast UDP
packets.
I see comments in the code about receiving, and I would think sending
would
be easier.

        I have attached a detailed log starting where the lwip gets the
lwip_sendto
call. I have every debug item turned on except a few dealing with ppp
and slip.

        The strange part is after the lwip_sendto(...)
        I never see a tcpip_thread: API message
        then a udp_connect: connected message.



<Frédéric BERNON.vcf>_______________________________________________
lwip-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-users


_______________________________________________
lwip-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-users




_______________________________________________
lwip-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-users
<Frédéric BERNON.vcf>_______________________________________________
lwip-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-users




reply via email to

[Prev in Thread] Current Thread [Next in Thread]