Home
Support

Knowledge Base

BSPs and drivers
Community resources
Product documentation
Questions?
Contact us

Information about UDP Packet sizes and handling
 
________________________________________________________________________

Applicable Environment
________________________________________________________________________
  • Topic: Information about UDP packet sizes and handling
  • SDP: 6.4.1
  • Target: Any supported target
________________________________________________________________________

Recommendation
________________________________________________________________________

The maximal transferable data size with one packet is 65507 Bytes.
How big the udp - packets exchanged between 2 boxes are effectively allowed to be , is controlled by the sysctl vars

net.inet.udp.sendspace on sender"s side

and
net.inet.udp.recvspace on receiver"s side.

sendto( nbytes ) will fail with "Inappropriate message buffer length" (EMSGSIZE), if <nbytes> is greater then <net.inet.udp.sendspace>

Sender"s <net.inet.udp.sendspace> should be smaler/equal
(best would be exactly) <net.inet.udp.recvspace> - 16
of the Receiver

Pakets with data volume more than <net.inet.udp.recvspace> - 16
Bytes will be dropped without comment from the udp stack.

recvfrom( nbytes ) blocks, until a paket was accessed/taken from the stack .
recvfrom( nbytes) gives the number of the overtaken/absorbed data bytes in the accessed packet.
That means the result can _never_ be bigger than <nbytes>
Too short packets can be detected directly.

To be able to detect too long packets effectively you would have to execute recvfrom( expected_nbytes + 1 ); Cause longer packets (as mentioned above) are either dropped without comment (if they are longer than <net.inet.udp.recvspace> - 16 Bytes) or will be truncated/clipped during receiving on maximal (<expected_nbytes> + 1) Bytes. So the detection of those manifests in having received that max number of bytes.

________________________________________________________________________
NOTE: This entry has been validated against the SDP version listed above. Use caution when considering this advice for any other SDP version. For supported releases, please reach out to QNX Technical Support if you have any questions/concerns.
________________________________________________________________________


Related Attachments
 None Found





Please contact us with your questions or concerns.