[nanomsg] nanomsg and udp

  • From: Zack Morris <zmorris@xxxxxxxxx>
  • To: nanomsg@xxxxxxxxxxxxx
  • Date: Wed, 21 Aug 2013 11:26:39 -0600

I saw nanomsg mentioned on Hacker News and it looks great, especially things 
like asynchronous DNS lookups.  However, this line in the announcement at 
//www.freelists.org/post/nanomsg/nanomsg-01alpha-released concerned me:

- There's no generic UDP-like socket (ZMQ_ROUTER), you should use L4 protocols 
for that kind of functionality.

The main use case I have in mind is connecting several clients behind typical 
broadband routers using STUN/UPnP/NAT-PMP etc, and then allowing the peers to 
communicate with one another over UDP, where each peer has some sort of token 
to identify the other peers.  This is extremely useful for gaming and p2p 
networks.

It's unclear from the announcement if this is possible with nanomsg as it 
stands now, so I was wondering if you could update the documentation to show an 
example, perhaps with AF_SP_RAW, or elaborate on what you mean by L4 protocols 
with regard to UDP.

I apologize in advance if my question is naive, but it seems to me that without 
this functionality, nanomsg is not really ZeroMQ, it's just another TCP library 
with some convenience functions to implement pub sub and other patterns.  It 
would be incredibly useful to have something like nn_udp except with the same 
reliability guarantees of nn_tcp.  Some things to keep in mind would be 
implementing a 32 bit checksum above the 16 bit UDP checksum and also handling 
network changes, perhaps referring to peers through tokens or references 
instead of IP address, in case users move between networks.

Disclaimer: I have not used either library directly but have only perused their 
documentation.  I am fairly familiar with the terminology though and have 
written windowing functions above UDP, so I know how useful they can be.

Thanks!

Zack Morris

Other related posts: