I'm working on a distributed application that uses DDS for messaging. Some parts of the network are separated by a data diode that only allows one-way data flow (i.e. data can go from A => B but not B => A). This is problematic for DDS so we're considering building a proxy Java app either side:
/-----------\ =>=>=>=>=> PROXY #2 /-----------\
¦ MESSAGE ¦ => PROXY #1 => => DATA => => Receives TCP, => ¦ MESSAGE ¦
¦ PUBLISHER ¦ Receives message => DIODE=> converts to message ¦ SUBSCRIBER¦
\-----------/ & converts to TCP =>=>=>=>=> and republishes \-----------/
I'm not very familiar with UDP but my current understanding is a fixed packet size (e.g. 512 bytes) would be desirable. So any messages larger than this would need to be split across multiple datagrams and pieced together by PROXY #2 in whatever order they arrive - and the message only sent when all the pieces have been reassembled.
The question here is how to go about restitching the messages? Am a bit wary about wheel reinvention, e.g. inventing a custom protocol or algorithm if it turns out to already exist.