Re: Multicast

"Tom Collins tom-lnEA/wrDJtNWk0Htik3J/[email protected] [rabbit-semi]" <[email protected]> Tue, 2 Aug 2016 16:47:24 -0700
Newsgroups gmane.comp.hardware.rabbit-semiconductor
Message-ID <[email protected]>
Steve,

Back from vacation and wanting to follow up on your message.  I'm looking through Dynamic C's TCP/IP stack and have the following to report:

* MAX_UDP_SOCKET_BUFFERS should be equal to the number of UDP sockets you're opening.  There's no benefit to setting it higher than the number of sockets -- it's used to store copies of the udp_Socket pointer passed into udp_open().

* The stack allocates UDP_BUF_SIZE of space for each of the MAX_UDP_SOCKET_BUFFERS.

* As best as I can tell, the UDP sockets each get UDP_BUF_SIZE bytes.  This is good in that a single UDP socket can't starve out other sockets, but it requires you to keep up with datagrams.

* So, I would advise on setting MAX_UDP_SOCKET_BUFFERS based on how many simultaneous UDP sockets you'll have open, and UDP_BUF_SIZE based on how much data you expect to receive between calls to udp_recv().

* If you have just one UDP socket that requires a larger buffer, consider using udp_extopen() to give it a large buffer so you don't waste space by over allocating buffers (via UDP_BUF_SIZE) for your other UDP sockets.

Let me know if you still have any outstanding questions on how the UDP sockets work in Dynamic C, or if the issues you saw were caused by the Wireshark capture bugs you mentioned in another message.

-Tom


On Jul 22, 2016, at 9:19 AM, Steve Trigero seecwriter-/[email protected] [rabbit-semi] wrote:

> Yes, I was referring to MAX_UDP_SOCKET_BUFFERS. I know I need them. I was asking about
> the ratio of sockets to buffers.  Could I get away with a single UDP socket and say 5 buffers without
> dropping datagrams? 
>