[zeromq-dev] Design problem of distributed environment

Matej Puk puk.matej at gmail.com
Wed Nov 15 17:42:40 CET 2017

Thanks for the answer. ZeroMQ is something new for me and I had no idea
something like Zyre existed so thanks for bringing it up. It looks like
best solution for my problem so far.

To your question of how am I defining a neighbor. Well this simulator which
I am developing is supposed to simulate distributed environment on single
or more machines. It is actually a diploma thesis
so there is not so much time for developing it to be able to simulate
environment on more machines but assumption is that in some distant future
it will.

Now I am focused to develop version which will correctly simulate
environment on single machine. Entities in this environment are threads.
Every thread represent single entity and have behavior.
At beginning I should say that this project is a simulator for distributed
algorithms. So in basic user writes algorithm in simplified language that I
developed than compiler compiles this language and creates
data about behavior of entities described in algorithm. Part of compiling
is also processing file with environment topology where every entity has
it's own id, ip, port and neighbors.

So every entity know whom are it's neighbors thus knowing ip addresses and

But problem was that I think I can not approach this problem via patterns.
Because user has ability to enter whatever algorithm he decides which means
behavior of entities is not predictable and must be flexible.

I will look into Zyre documentation but at first glance I think it offers
everything that I need. I wanted some simple solution because someone for
example suggested that every entity should have socket for each neighbor,
but I do not think that when I have environment where are 20 entities and
every one of them has 19 sockets on single machine is right approach.

2017-11-15 15:10 GMT+01:00 Wes Young <wes at barely3am.com>:

> I am currently fighting with some design issues for my project and as
> newbie to zeroMQ I am here to look for advice. My project should simulate
> distributed algorithm in distributed environment.
> welcome :)
> For example algorithm like brodcasting. I need to implement communication
> between nodes in this environment and I chose to use zeroMq.
> My question is what do you think is the best approach when you want to
> design environment where entity must do following:
>    - be able to receive messages from neighbours,
>    - be able to send message to all or maybe few selected neighbours.
> some of this may depend how you define “a neighbor” (e.g.: pre-configured
> env, or zero-conf env). if you’re looking for little-to-zero configuration,
> may wanna checkout zyre:
> https://rfc.zeromq.org/spec:36/ZRE
> https://github.com/zeromq/zyre
> My first idea was to give very entity a ROUTER socket. Is it possible to
> achieve it with only routers?
> I believe so- but you may wanna start by reading about the different
> patterns first and prototyping some simple one to one, one to two patterns
> to get your hands dirty first, get a feel for the different socket types:
> http://zguide.zeromq.org/page:all#Messaging-Patterns
> You probably start out with REQ/REP which is easy- then move into async
> (router/dealer) then into something like Zyre where the learning curve is a
> little steeper (but probably closer to what you want long term if I’m
> understanding your question).
> As I looked at ROuter it can send message to multiple nodes and also can
> receive messages from multiple nodes.
> Every entity knows who is it's neoghbor and have information about IP's
> and ports.
> Yea, sounds like a problem ZYRE solves- but if you’re new may wanna work
> your way into it a bit with some of the simpler types first..
> make sense?
>> wes
> wesyoung.me
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> https://lists.zeromq.org/mailman/listinfo/zeromq-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20171115/109ef2f8/attachment.htm>

More information about the zeromq-dev mailing list