11-12-2014 10:05 PM
Dear all,
I have a case that I must send a data over 64k bytes in a socket with UDP . I got a error-113 shows "A message sent on a datagram socket was larger than the internal message buffer or some other network limit, or the buffer used to receive a datagram was smaller than the datagram itself.".I searched for this issue and got the closest answer as below:
http://digital.ni.com/public.nsf/allkb/D5AC7E8AE545322D8625730100604F2D?OpenDocument
It said I have to change buffer size with Wsock.dll. I used the same mathod to increaes the send buffer to 131072 bytes by choice optionname to so_sndbuf (x1001) and give it value with 131072 and it worked fine without error. However I still got an error 113 while sending data with " UDP Write.vi ". It seems UDP write.vi reset the buffer size? Are there any other things cause the error?
I attached example code. In UDP Sender.vi you can see I change send buffer size to 131072 and send date included a 65536 bytes data.There is also a UDP receiver.vi and there is some missing VI which you can get from the LINK. But it's not necessary.
Solved! Go to Solution.
11-13-2014 06:14 AM
The header for a UDP packet includes a 16 bit field that defines the size of the UDP message (HEADER AND DATA)
16 bits limits you to a total size of 65635 bytes, minus the header sizes; a minimum of 20 bytes are required to define an IP packet and 8 bytes for UDP leaving an effective data payload of 65507
bytes.
LabVIEW is not the issue...
http://en.wikipedia.org/wiki/User_Datagram_Protocol#Packet_structure
11-26-2019 04:27 AM
Hello, may you please give me your Set_Receiver_Buffer.vi, I encountered the same problem as you, this is my email: 1281212249@qq.com
11-26-2019 05:28 AM - edited 11-26-2019 05:34 AM
Did you read the initial post? The VI you ask for is simply attached to that post! Just download it!
But you still can’t send more than 65507 bytes per UDP message. Unlike the stream character of TCP, UDP is a datagram based protocol. It doesn’t implement a fragmented transfer of datagrams, but the underlaying IP dataframe is limited to 65535 bytes in total.