[nanomsg] Re: accessing control IDs

  • From: Martin Sustrik <sustrik@xxxxxxxxxx>
  • To: nanomsg@xxxxxxxxxxxxx
  • Date: Wed, 07 May 2014 11:20:37 +0200

Hash: SHA1

Hi Drew,

> I’m not necessarily saying that REQ/REP is wrong on principle, but
> I am saying that there should be much clearer documentation on what
> it is for and what it is not for.

man nn_reqrep

The very first sentence is: "This protocol is used to distribute the
workload among multiple stateless workers."

You are welcome to improve!

>> From my point of view, if I wanted to speak to a specific peer,
>> I would use TCP. That's what's it was designed for and what it is
>> good at.
> I think it is self-evident from my reply to the above, but really
> what i want is a request/reply messaging system that doesn’t shoot
> you if your REP involves saving to a database now and again, and
> lends itself to some authentication scheme other than “configure
> your firewall”.  I have actually made a considerable amount of
> progress on the second problem in a private fork, but was hoping
> that a solution on the first problem would be more mergeable and
> keep the topics of my fork to a smaller number.

Yes, sure, as long as it is implemented as a new transport or new
protocol. If you try to violate the boundary between the two layers,
that may be a problem.

> I have come around to your position on implementation, that relying
> on TCP information to derive sessions is not a good approach.  So
> perhaps the solution looks like appending 6 bytes to the message
> (although zero-copy is a bit of an issue).  However I still believe
> that this is a problem for a networking library to solve and not a
> problem for an application.

Well, the functionality is very specific and easy to misuse. People
would immediately use it to identify peers (rather than treat it as a
hint) and complain once they encounter a situation where it doesn't work.

In the end you would probably be the only person to use it correctly
and there would be lot of others being burn by it.

Btw, I wouldn't expect to see any difference in throughput between 4
byte and 10 byte messages. For small messages the throughput is CPU
bound, not IO bound.

>> On a tangent, here's my networking equivalent to the CAP
>> theorem. Sustrik's theorem: You can't have *P*artition, *S*tate
>> and *R*eliability at the same time.
> I’m not totally sure what you mean by “state” here.

Business state. Routing tables in network or routing tables in nn
sockets don't qualify.


Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/


Other related posts: