[zeromq-dev] Problem in example "A simple client/server application "

Martin Sustrik sustrik at 250bpm.com
Sat Feb 27 21:45:30 CET 2010


Hi Fred,

>>> Just one question remains : were can I grab in the server
>>> environment the IP address and portnumber of the sending client ?
>> No way to do that at the moment, other than doing it at the app level
>> (make up a client ID / use the IP address and stick it in the
>> message).

Let me give some background here.

Simply said: 0MQ should manage connections for you. Your application 
should be agnostic about exact location/identity of the peers. If you 
want to work on the level of individual connections, use BSD sockets 
rather than 0MQ.

More complex answer: The issue has to do with scaling 0MQ into internet 
scales. What you want to know is the identity of the peer who sent the 
message. You are not interested in any middleboxes that may be on the 
way (like zmq_forwarder etc.) Thus, getting IP address we've received 
the message from is useless - it's IP address of the previous hop. Also, 
if IP address is used as the identity, two applications running on the 
same box would look exactly the same. Same application bound to several 
network interfaces would look different depending on how exactly you are 
connected to it. Etc.

At the moment, the only thing you can do is to choose a name for your 
application and fill it into the message. In easy to modify 0MQ to do 
the thing for you, however, it's not a conceptual solution.

Real solution still requires a lot of research work. Feel free to start 
the discussion though.

> OK, but that's (at least for me) not thrustworthy. Like SMTP telling me 
> who they are. ;-)

What you would consider trustworthy, what kind of attacks should it be 
resistent to, etc.

> You don't mind if I take a look at the sources to see whether it is 
> doable for me ?

Sure. Go for it. Any experimentation is valuable! The source is licensed 
under LGPL so you can modify it in any way given that you publish the 
result under LGPL.

Martin



More information about the zeromq-dev mailing list