Slight problem with UDP

View: New views
3 Messages — Rating Filter:   Alert me  

Parent Message unknown Slight problem with UDP

by Paolo Simoncelli :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



Hello world,

First of all let me make my congratulations to all those who
are supporting the EN/NutOS project ...

Now, ... since i am quite new to ethernut i am just compiling
example applications (UDP and rs232),
ethernut 4.8.5 compiled with WinAVR under Window$ XP and board rev 1.3h

While playing with "icmp-udp.c", after some packet sniffing with
FreeBSD's tcpdump i have noticed that the first packet sent by the
ethernut was regularly lost.

Wince i am absolutely trusting with FreeBSD's TCP/IP ;-)
and ethernut was tied to a network of just 4 machines the
only culprit had to be ethernut :( ...

The issue seem to be somehow ARP related, just adding a slight
( > 300 ms ) delay before start sending UDP packets to the server
seem solve the problem ...


...

     if (NutThreadCreate("RCV", UDPReceiver, (void*)socket, 1024) == 0) {
             puts("Could not start receiver thread\r\n");
             puts("Demo halted...\r\n");
             while (1);
     } else {
         puts("Receiver thread started\r\n");
     }

     puts("Starting echo test (1 packet / second)\r\n");

     ip_udp_echo = inet_addr(UDP_ECHO_IP);
     packet_nr = 0;

->>>    NutSleep(500);

     for(;;) {
         packet_nr ++;

...


Maybe i am wrong and this could be related to some TCP/IP configuration
that i have missed while building NutOS ?

Netwotk(general) -> TCP -> state machine stack
Netwotk(general) -> ARP -> <various options>

...

Any hint welcome

Ciao!
Paolo


 
 
 --
 Caselle da 1GB, trasmetti allegati fino a 3GB e in piu' IMAP, POP3 e SMTP autenticato? GRATIS solo con Email.it http://www.email.it/f
 
 Sponsor:
 Prova il servizio di Email Marketing di Email.it, incrementi la visibilita' della tua azienda e trovi nuovi clienti.
* Liste a partire da 10.000 contatti per soli 250 Euro
 Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=8351&d=2-11
_______________________________________________
http://lists.egnite.de/mailman/listinfo/en-nut-discussion

Re: Slight problem with UDP

by Ole Reinhardt-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi!

> While playing with "icmp-udp.c", after some packet sniffing with
> FreeBSD's tcpdump i have noticed that the first packet sent by the
> ethernut was regularly lost.
> [...]
> The issue seem to be somehow ARP related, just adding a slight
> ( > 300 ms ) delay before start sending UDP packets to the server
> seem solve the problem ...

Indeed I noticed similar behaviour some time ago with the tftp
bootloader implementations of NutOS. The arp implementation did not
include a arp response. When the PC had sended an arp request and did
not get any reponse, the arp entry was deleted and no more packets were
accepted by the pc.

In your current configuration it might be possible that the first UDP
packet is send out before the arp challenge / response is finished, so
your pc does not have a complete arp table right at the beginning of
your program... (on the pc side).

Bye,

Ole

--
 _____________________________________________________________
|                                                             |
| Embedded-IT                                                 |
|                                                             |
| Ole Reinhardt        Tel. / Fax:        +49 (0)271  7420433 |
| Luisenstraße 29      Mobil:             +49 (0)177  7420433 |
| 57076 Siegen         eMail:    ole.reinhardt@... |
| Germany              Web:         http://www.embedded-it.de |
|_____________________________________________________________|

_______________________________________________
http://lists.egnite.de/mailman/listinfo/en-nut-discussion

Parent Message unknown Re: Slight problem with UDP

by Paolo Simoncelli :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi Ole,

Thanks for your reply,

>In your current configuration it might be possible that the first UDP
>packet is send out before the arp challenge / response is finished, so
>your pc does not have a complete arp table right at the beginning of
>your program... (on the pc side).

So you think that it's a pc-side problem?
things should go like this:

en     pc

ARP whois pc ?
                      ARPr here i am
UDP take this one !
                      ARP whois en ?
ARP let me think ...
                      uhmm ... no one replies drop that %$%ih
ARPr here i am     nice to meet you !

then, they live long and prosper ...



I have not much debugging aid, but i have tried to
"UDP flood" my server, with another pc, and i have lost
no first packet, so it seems more a "slow" reply from ethernut

maybe en ARP replying task is switched too early, before completing
ARP challenge so UDP packet is sent too early to the server

I am not that deep into ARP, so i don't know whether the responding
side knows if the querying side has got his reply or if all is left
to timeouts

next days i will setup a more deep test, anyway this seems a well
known behaviour, with a workaround too ;-) !

sorry for the spam at the end of my messages

Ciao!
Paolo


_______________________________________________
http://lists.egnite.de/mailman/listinfo/en-nut-discussion