[zeromq-dev] protocol design question

Dhammika Pathirana dhammika at gmail.com
Thu Nov 17 07:30:58 CET 2011

Hi Chuck,

On Wed, Nov 16, 2011 at 7:11 AM, Chuck Remes <cremes.devlist at mac.com> wrote:
> On Nov 16, 2011, at 1:19 AM, Martin Sustrik wrote:
>> Hi Chuck,
>>> The UUID would uniquely identify each client.
>> Give some thought to what do you want to uniquely identify. Is it any client ever? If so, UUID is probably the right way to go. However, if all you need is to uniquely identify a client of a particular server instance, 32-bit integer should do.
> I need to uniquely identify the client for the life of the service. I assume the service could live for days, weeks or months (years seems a stretch). How would I choose a 32-bit integer independently from many hosts and avoid collisions?
> The issue of collisions is why I chose UUID. If you have an algorithm for achieving this with a 32-bit integer, please share. I would gladly use it to save 12-bytes out of each message.

If you're in a controlled subnet, you can just use client IP address
or you can hash UUID into a 32bit int. Google jenkin's hash.


More information about the zeromq-dev mailing list