libzmq icon indicating copy to clipboard operation
libzmq copied to clipboard

Problem: No message batching in the UDP engine

Open eponsko opened this issue 7 years ago • 2 comments

Using RADIO/DISH over UDP unicast/multicast results in a fairly low amounts of messages per seconds compared to its TCP counterpart (with about a factor of 10). One reason for this could be the lack of message batching when using UDP.

Current message format on UDP is (in my understanding):

udp-payload = group-name message-body group-name = short-size 1*255 group-name-char

Perhaps it could be modifed to something like this? Reuses the existing stream encoding to fit multiple messages into a single UDP packet, and place group name inside the message-body.

udp-payload = message-more message-last message-more = ( %x01 short-size | %x03 long-size ) message-body message-last = ( %x00 short-size | %x02 long-size ) message-body message-body = group-name body group_name = short-size 115 group-name-char body = *OCTET

I'm not sure how batching is handled for the stream protocols, I guess here we could/should limit the size of the final UDP packet to either maximum UDP payload (~65500 bytes), maximum MTU from the interface (~1500), or something like the typical UDP sizes on the internet (something like 508, 512, 548, depending on who you ask). Currently MAX_UDP_SIZE is set to 8192, not sure what the rationale for that is (since it doesn't avoid fragmentation nor full use of the UDP payload).

long-size being 64 bits is a bit overkill, perhaps a medium-size with 16 bits would make more sense (since thats the maximum UDP payload size).

eponsko avatar Mar 19 '18 17:03 eponsko

This issue has been automatically marked as stale because it has not had activity for 365 days. It will be closed if no further activity occurs within 56 days. Thank you for your contributions.

stale[bot] avatar Mar 20 '19 16:03 stale[bot]

Hi, Any news?

alonbl avatar Mar 13 '23 12:03 alonbl