[nanomsg] Re: nanomsg and udp

  • From: Zack Morris <zmorris@xxxxxxxxx>
  • To: nanomsg@xxxxxxxxxxxxx
  • Date: Wed, 21 Aug 2013 14:57:33 -0600

Hmm DCCP looks pretty cool but how supported is it?  Games and p2p just use UDP 
and TCP right now.  Originally I think a mistake was made in the design of the 
internet where it should have gone IP->UDP->TCP instead of IP->UDP and IP->TCP. 
 That way if TCP worked, UDP would have too, and we wouldn't have run into the 
problems with NAT we have now for UDP.  Although NAT issues are by design in 
many ways, so perhaps we still would have.  I realize that TCP header savings 
used to be important but I don't think they are nearly as much now except for 
wireless.

Mainly what I would like is a wrapper that turns an unreliable layer like UDP 
into a reliable one.  Like literally give me a socket that acts like a TCP 
socket but uses UDP internally.  I thought about implementing this somehow as a 
library that returns a pipe to the process but didn't get far with it.  I'm 
still reading about nanomsg and it looks like it doesn't maintain its own 
queues, so I'm wondering if it's even possible.

Zack

On Aug 21, 2013, at 1:05 PM, Martin Sustrik wrote:

> Hi Zack,
> 
> As for L4, it means "transport protocols" as, for example, TCP, UDP, SCTP 
> etc. nanomsg works on layer above that, it delivers transport-idenpendent 
> messaging patterns, look, for example, here: 
> https://raw.github.com/250bpm/nanomsg/master/rfc/sp-request-reply-01.txt
> 
> As for the other stuff, I am not sure what you are looking for. Would, say, 
> adding a DCCP transport solve your problem?
> 
> Martin
> 
>> 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: