[En-Nut-Discussion] UDP Throughput

Harald Kipp harald.kipp at egnite.de
Wed Jul 30 13:43:07 CEST 2008


Omar.Qureshi at L-3com.com wrote:
 > Thanks for the help.. one question that I'm not sure about.
 >
 > You had mentioned setting the UDP socket buffer size.  Do I just set the
 > buffer size by calling the NutUDPSetSockOpt() with SO_RECVBUF?  Or do I
 > also have to manually allocate that space from the memory pool?  I guess
 > what I'm asking is.. where is the udp queue buffer allocated?  In my
 > current configuration my so_rx_bsz is 0, so there's no queueing at all.
 > So I'm dropping UDP packets all over the place, even with the 91c111.

Simply use

     u_short rxsz = 1024;
     sock = NutUdpCreateSocket(disopt.disopt_port);
     NutUdpSetSockOpt(sock, SO_RCVBUF, &rxsz, sizeof(rxsz));

The required buffer will be automatically allocated upto the given 
limit. If this limit is exceeded, packets will be dropped. So make sure 
to call NutUdpReceiveFrom() often and in time. Otherwise increase the 
SO_RCVBUF size.

Harald




More information about the En-Nut-Discussion mailing list