[En-Nut-Discussion] NutUdpSendTo taking too long
Jose Vallet
jose.vallet at hut.fi
Thu Oct 29 23:47:21 CET 2009
Hello Nathan, and thanks for the explanation. It was a shortcut to the
code that explains it. My friend was called "arpcache.c"
I have still some questions.
Nathan Moore escribió:
> Hey José,
> When you send a IP packet over ethernet you have to know the MAC
> address of the recipient. To find this out the ARP (Address Resolution
> Protocol) cache is examined. If no entry for the destination IP address
> is in the ARP cache then an ARP request must be sent over the
> local ethernet and then you have to wait for an ARP reply. If no one
> is there with that IP address then you just wait until you finally give up.
> In NutOS the sending thread is blocked until the IP packet is either sent
> or something goes wrong (in this case no ARP reply).
And in that case the no ARP reply is not considered an error, so
NutUdpSenTo will peacefully return 0. So it seems to me that for an
application there is no straight way to detect when an ARP entry has
been deteled. Perhaps calling directly ArpCacheLookup, or even
NutArpCacheQuery? Anything against this that I should be aware of?
Another way to solve this issue, I guess, could be to mark the ARP entry
as permanent, so it will not be flushed. Is this correct? It seems that
it would require to manipulate the ARP entry manually, as I couldn't
find any function to add/manipulate entries. Anything against this that
I should be aware of? In my case it is assumed that the IP of the
machine that the Ethernut sends the UDP packets to has always the same
private IP
Regards!
José
More information about the En-Nut-Discussion
mailing list