OSCFormatError: OSC input stream format error: missing padding zeros when receiving blobs


#1

While trying to set up an OSC-based communication between two JUCE-based applications I get tons of OSCFormatError: OSC input stream format error: missing padding zeros exceptions on the receiver side.

I’m creating the OSC messages like that:

juce::OSCMessage message (address);
message.addBlob (memoryBlock);

if (!oscSender.send (message))
    onConnectionError ("Failed to send blob to " + address);

where address is a valid OSC address string and memoryBlock a juce::MemoryBlock of approx. 4000 - 6000 bytes size.

Is there anything wrong with the way I’m creating / sending those blobs so that they are received with missing padding bytes? Not sure where to start searching for the root of this error.


#2

Okay, after investigating a bit it seems that less bytes are received then the blob size are received. Seems related to this topic OSC blobs are lost above certain size.

Just downloaded the test tool posted there by @harryg and found out that the limit on my machine is 4076 bytes.

I’m not 100% sure on which side this error occurs, as WireShark shows UDP packets with the expected size, so to me (with very limited deep networking knowledge) it seems like the OS can handle those packets and the error occurs when processing the packets on the receiver side? However it seems as if I had to split up my data into sub-packets for safe transport for now as my application should run safe on every system anyway.


#3

Hi PluginPenguin,

as quoted in the linked topic, the IPv4 spec says that the destination is the point where data gets lost:

It is recommended that hosts only send datagrams
larger than 576 octets if they have assurance that the destination
is prepared to accept the larger datagrams.

So if you want to be safe on any network setup, you have to stay with 512 bytes unfortunately.

Best,

Harry G.