0 Replies Latest reply on Aug 6, 2012 8:06 AM by dan_schiro

    Nucleus NET is silently dropping streaming UDP packets

    dan_schiro

      Symptoms

        Nucleus NET may silently discard UDP packets in a stream of  data.  This behavior can be sporadic and result in loss of part of the  data stream.

      Causes

      • Nucleus NET will buffer a configurable number of packets on each  UDP port pending retrieval by the application through the use of the  NU_Recv/NU_Recv_From API's.

      • If the maximum number of allowable buffered packets is reached for a  particular port, Nucleus NET will silently discard subsequent inbound  UDP datagrams for that port until the number of buffered UDP datagrams  falls below the allowable maximum.

       

      Solution

       

      Calling NU_Recv/NU_Recv_From will remove buffered UDP packets  from the inbound port list and free room for additional packets to be  received.

      The allowable maximum of buffered packets per UDP port is controlled  by the define UMAX_DGRAMS in net_cfg.h.  This is set to 5 by default.   Trial and error experimentation with a particular application should  yield a value that provides satisfactory performance.

      It should be noted that increasing the value of UMAX_DGRAMS may  require increasing the number of NET Buffers in the system to compensate  for the number of buffers that may be tied up at any given time pending  receptions on UDP ports.