arduino_uip icon indicating copy to clipboard operation
arduino_uip copied to clipboard

reception of multicast UDP message

Open JBLSteeve opened this issue 10 years ago • 14 comments

Hi, I use the udpserver example and i can receive UDP message address to my IP, but if i send an UDP broadcast message, i can't receive it ?

JBLSteeve avatar Jul 26 '14 11:07 JBLSteeve

receiving UDP-broadcast is supposed to work. The UIPDhcp.cpp makes use of it. Can you show me both your code that is to receive the broadcast-message and the code that generates it?

regards,

Norbert

ntruchsess avatar Jul 31 '14 14:07 ntruchsess

Hi,

I attach the quick example that i use for test. for sending the message i use a tool name SocketTest. (http://sockettest.sourceforge.net)

I have a custom board with enc28j60 for ethernet controller. I know that enc28j60 have one register to activate the receive of broadcast message. (before i use the lib etherCard and i find something in the data sheet).

Thanks for your help.

Le 31 juil. 2014 à 16:52, Norbert Truchsess [email protected] a écrit :

receiving UDP-broadcast is supposed to work. The UIPDhcp.cpp makes use of it. Can you show me both your code that is to receive the broadcast-message and the code that generates it?

regards,

Norbert

— Reply to this email directly or view it on GitHub.

JBLSteeve avatar Jul 31 '14 16:07 JBLSteeve

Hi,

I find a mistake on my side, after my udp.stop, i forget to restart the udp.

Thanks for your help.

Do you know if i can use the telnet,webserver and udp at the same time ? I use your lib and the FULLIP lib.

Regards,

2014-07-31 18:57 GMT+02:00 [email protected]:

Hi,

I attach the quick example that i use for test. for sending the message i use a tool name SocketTest. (http://sockettest.sourceforge.net)

I have a custom board with enc28j60 for ethernet controller. I know that enc28j60 have one register to activate the receive of broadcast message. (before i use the lib etherCard and i find something in the data sheet).

Thanks for your help.

Le 31 juil. 2014 à 16:52, Norbert Truchsess [email protected] a écrit :

receiving UDP-broadcast is supposed to work. The UIPDhcp.cpp makes use of it. Can you show me both your code that is to receive the broadcast-message and the code that generates it?

regards,

Norbert

— Reply to this email directly or view it on GitHub https://github.com/ntruchsess/arduino_uip/issues/76#issuecomment-50769728 .

Merci


Steeve Vermeersch [email protected]

JBLSteeve avatar Aug 05 '14 09:08 JBLSteeve

Besides the llimited amount of free ram available on the Arduino there's no hard-coded restriction in the library to use TCP and UDP at the same time. You can configure the number of concurrent connections for both TCP and UDP in https://github.com/ntruchsess/arduino_uip/blob/master/utility/uipethernet-conf.h. In fact the limitation in terms of ram mostly affects your own code as UIPEthernet makes use of ENC28J60 internal memory for stream packets from/to. That implies than while sending/receiving very large packets there's limitied amount of RAM available in ENC28J60 to do other processing so packets to be received eventually get dropped. (That is not issue with TCP as they get retransmitted).

ntruchsess avatar Aug 06 '14 08:08 ntruchsess

Thanks for your feedback,

for webserver and telnet server do you think i can keep the fullip library or use another way like the example of the standard library ? For the moment i have some freeze on my program when i activate the httpserver.

For your information, I'm in the project XplDuino, more information here. ( http://xplduino.org/fr/)

Thanks

2014-08-06 10:44 GMT+02:00 Norbert Truchsess [email protected]:

Besides the llimited amount of free ram available on the Arduino there's no hard-coded restriction in the library to use TCP and UDP at the same time. You can configure the number of concurrent connections for both TCP and UDP in https://github.com/ntruchsess/arduino_uip/blob/master/utility/uipethernet-conf.h. In fact the limitation in terms of ram mostly affects your own code as UIPEthernet makes use of ENC28J60 internal memory for stream packets from/to. That implies than while sending/receiving very large packets there's limitied amount of RAM available in ENC28J60 to do other processing so packets to be received eventually get dropped. (That is not issue with TCP as they get retransmitted).

— Reply to this email directly or view it on GitHub https://github.com/ntruchsess/arduino_uip/issues/76#issuecomment-51308304 .

Merci


Steeve Vermeersch [email protected]

JBLSteeve avatar Aug 06 '14 09:08 JBLSteeve

you are talking about this library: https://github.com/bibi21000/arduino-fullip? From what I know it is meant to be compatible with UIPEthernet - the author (bibi21000) was in contact with me last year when he was writing the lib, but I have no own handson-experience with it. Maybe you get in contact with him to resolve the issues? I'm also willing to assist if I have access to code that easily reproduces issues you run into.

ntruchsess avatar Aug 06 '14 10:08 ntruchsess

HI,

I finnally, do on module for telnet et another for webclient. I don’t want to send you my complete code we have now a lots of module, but maybe you can advice me. I have 2 server on Telnetserver on port 23 and one Webserver on port 80. I have one client for each, named TelnetClient and Webclient, but i receive my ethernet buffer in my Telnetclient. Do you know can i check if it’s a request for telnet or Web ?

Thanks

Steeve

Le 6 août 2014 à 12:35, Norbert Truchsess [email protected] a écrit :

you are talking about this library: https://github.com/bibi21000/arduino-fullip? From what I know it is meant to be compatible with UIPEthernet - the author (bibi21000) was in contact with me last year when he was writing the lib, but I have no own handson-experience with it. Maybe you get in contact with him to resolve the issues? I'm also willing to assist if I have access to code that easily reproduces issues you run into.

— Reply to this email directly or view it on GitHub.

JBLSteeve avatar Aug 08 '14 18:08 JBLSteeve

I'd need to see at least some minimal code that allows to reproduce your issue.

ntruchsess avatar Aug 12 '14 13:08 ntruchsess

Hi,

I send you the code, but you have the whole code of our projet, so the ethernet configuration is inside "eth_com.cpp" . I explain that i have 2 client, one client for webserver (port80) see "webserver.cpp" another client for telnet (port21) see "telnet.cpp".

We use an atmega 1284, so i’m not sur that you can load the code. Thanks for your help. Regards, Steeve

Le 12 août 2014 à 15:14, Norbert Truchsess [email protected] a écrit :

I'd need to see at least some minimal code that allows to reproduce your issue.

— Reply to this email directly or view it on GitHub.

JBLSteeve avatar Aug 13 '14 08:08 JBLSteeve

It's easy: you post a sketch (or a deep-link to your website to the sketch) that allows to reproduce what you are talking about and then I have a look at it. I ain't guess how you combined the code of examples, and I will not try to debug your whole project at once.

ntruchsess avatar Aug 14 '14 08:08 ntruchsess

Hi with this code multicast reception does not work for me. Could anyone help me to get it work?

# nc -uvv 239.255.255.250 1900 < msearch.txt

#include <UIPEthernet.h>

EthernetUDP myUDP;

void setup() {
    Serial.begin(9600);

    uint8_t mac[6] = {0x00,0x01,0x02,0x03,0x04,0x05};
    IPAddress ipaddr(192, 168, 10, 8);
    IPAddress netmask(255, 255, 255, 0);
    IPAddress gateway(192, 168, 10, 1);
    IPAddress dns(192, 168, 10, 1);

    Ethernet.begin(mac, ipaddr, dns, gateway, netmask);
    myUDP.begin(1900);

    Serial.println("Setup completed");
}

void loop(){
    while(myUDP.parsePacket() <= 0){
        delay(50);
    }
    Serial.println("UDP Packet"); 
    myUDP.stop();
    myUDP.begin(1900);
}

tonyputi avatar Sep 09 '14 10:09 tonyputi

there's no support for multicast in UIPEthernet and I've never tried to do that.

From my understanding it might work on the local ethernet-segment if you assign the right mac-address (see http://tools.ietf.org/html/rfc1112 chapter 5 for details) that mapps to the multicast-address to be used so any UDP-packet sent to this multicast-address would both received by the mac and processed by the stack. As there is no support for IGMP in UIPEthernet it cannot work beyond local network boundaries. And I don't know whether a host would even send a multicast-packet to local ethernet-segment if there was no prior announcement by IGMP before but I'd be glad to know if you find out.

ntruchsess avatar Sep 17 '14 11:09 ntruchsess

Thank you for your reply but I know that ethercard library support it or at least support sending of multicast packet.

Do you think to add this feature or can you give me some information about sending multicast udp packet?

Rgds Il 17/Set/2014 13:33 "Norbert Truchsess" [email protected] ha scritto:

there's no support for multicast in UIPEthernet and I've never tried to do that.

From my understanding it might work on the local ethernet-segment if you assign the right mac-address (see http://tools.ietf.org/html/rfc1112 chapter 5 for details) that mapps to the multicast-address to be used so any UDP-packet sent to this multicast-address would both received by the mac and processed by the stack. As there is no support for IGMP in UIPEthernet it cannot work beyond local network boundaries. And I don't know whether a host would even send a multicast-packet to local ethernet-segment if there was no prior announcement by IGMP before.

— Reply to this email directly or view it on GitHub https://github.com/ntruchsess/arduino_uip/issues/76#issuecomment-55881292 .

tonyputi avatar Sep 17 '14 11:09 tonyputi

I currently neither have the plan nor the time to implement that. You can use UipUDP.cpp code to generate the payload and use UIPEthernet.cpp (with some extensions) to send it. You have to write your own code to add appropriate IP and Ethernet-header before sending as uip.c doesn't do that for multicast. Read rfc1112 for details.

ntruchsess avatar Sep 17 '14 12:09 ntruchsess