The World’s Leading Microsoft .NET Magazine
   
 
The .NET Addict's Blog

My Top Tags

                                                           

My RSS Feeds








Latest Diggs - Programming

Internet Blogs - Blog Top Sites

Site Hits

Total: 2,551,710
since: 19 Jan 2005

Peer Networking Series - A Closer Look at PNRP vs. Bonjour/ZeroConf

posted Fri 09 May 08

It seems as though whenever I bring up PNRP and its benefits, I am immediately inundated with a list of questions or comments indicating that Microsoft is re-inventing the wheel and that PNRP has already been implemented before in the form of ZeroConf and, more specifically, Apple's implementation of it called Bonjour (formerly known as Rendezvous).

Here's the thing - the two services fix two different problems. The issue arises in that their solution has a small area of overlap and that's what confuses people. Because it is possible to use PNRP's basic implementation in the same way that most people use Bonjour, most people (erroneously so) assume that PNRP is nothing more than a proprietary vendor lock-in version of Bonjour.

First, let's take a look at Bonjour. Bonjour is an implementation of dynamic DNS. In previous posts in this series, I discussed the need for dynamic DNS. Traditional DNS is too slow, too bulky, and isn't really designed for the publication of dynamic services that could go offline at a moment's notice. Services like that might be a printer on your local network, an iTunes shared playlist, or a Windows Media Center device, including services offered on your local network by your Xbox 360. Peer applications traditionally use Bonjour because they need a fast, lightweight way to browse for and publish service advertisements on a local network.

At this point, you're probably thinking, "But wait.. Bonjour that shipped with Leopard can have global scope." And you are quite correct, but remember that Bonjour is still a dynamic DNS protocol. As such, it needs a server for global scope. While you can operate serverless when doing local network multicast, Bonjour still requires you to know about a particular server somewhere "out there" on the intertubes that will host your service publication. Additionally, clients that you want to be able to browse for that record must also know the location of that server. This is perfectly fine if you're a large company and you can easily dedicate a machine in your domain as your Bonjour box, allowing your game or LOB app to find other users globally. But what do you do if you really want a truly serverless peer service publication and location service?

This is where the paths of PNRP and Bonjour diverge. PNRP is, by my definition, a truly peer-to-peer protocol. There is no central state server, no central registration server. If you publish a peer name registration globally through PNRP, you do not need to have a single central server on which to place that record.

The other issue is this: what do you do if you want to make sure that you are the sole owner of that peer name? If you want to make sure that your application is the only application in the world that has the ability to publish service locations for a particular peer name... what do you do? Bonjour doesn't have this built into it. PNRP allows you to digitally sign peer names with your own private key. Anywhere else in the world, any application that attempts to manipulate published name registrations for a secured and signed name - will fail. The only application that can manipulate a signed peer name registration is an application that knows your private key. This is tremendously powerful for peer applications that you want to have a large, global reach but you don't want to deploy all kinds of server infrastructure for maintaining your own registrations like many other applications do.

So it basically comes down to this: Sure, you can use PNRP to do the same thing that Bonjour does, but you can also use PNRP to do quite a few things that Bonjour isn't designed to do. This doesn't mean that Bonjour is bad, because it's actually a kickass piece of technology (you'll know how much I love it if you've seen some of my Cocoa posts in the past). However, if you want to do secured peer name registrations, or serverless global peer name registrations, then PNRP is your tool.

I will be posting more and more about peer networks, peer networking, and eventually heading toward a post about Live Mesh and ecosystems/social networks, so stay tuned! 

tags:            

links: digg this    del.icio.us    technorati    reddit




1. Kevin Hoffman left...
Fri 09 May 08 7:43 am

Ok it looks like I might have been a little inaccurate. It appears as though the PNRP Global mesh requires a brief interaction with a global server hosted by Microsoft and also requires fully functioning IPv6 client support - either natively or through Teredo. So, in short, the main difference that I can see is that PNRP supports signed peer names, and Bonjour requires the end user to point at a specific server for global service publication and PNRP hits a Microsoft server.


2. Alex Blewitt left...
Fri 09 May 08 7:53 am :: http://alblue.blogspot.com

Bonjour is multicast DNS - it doesn't need a specific server, as each client is a peer of another.

http://www.multicastdns.org/

Multicast DNS is a way of using familiar DNS programming interfaces, packet formats and operating semantics, in a small network where no conventional DNS server has been installed.

Admitedly, this is only the discovery part of the peer process; it doesn't say what you do when you have discovered it. Also, the multicast (whilst works) typically doesn't tend to go outside a local network, for which you need some kind of other server/peer that you can contact (you need that with PNRP too). There's no reason why each peer can't have its own DNS with SRV records to go further than that; but again, it's all about discovery, not an API to communicate.

Incidentally, the Eclipse Communication Framework (ECF, http://www.eclipse.org/ecf) provides implementations of bonjour and other services (bittorrent, http) via the same interface, with the idea being that you can code your application to the same API but use differing transports/mechanisms underneath. That might be a fairer comparison to PNRP although I'd venture that perhaps ECF is more flexible and can adapt to other protocols rather than only having a single one.


3. Kevin Hoffman left...
Fri 09 May 08 7:57 am

Alex, as my blog post said, Bonjour is multicast DNS. The main difference that I'm seeing between Bonjour and PNRP is that Bonjour is almost completely limited to the local network. Multicast DNS most certainly will not escape the local network, and Bonjour's global name registration requires the end user to go into a configuration panel that you can see on OS X (no idea where it is on Windows) to add the name of a server on which to hang registration records. Microsoft has a central server as well, but PNRP doesn't require end user intervention to manually configure the infrastructure servers.


4. Alex Blewitt left...
Fri 09 May 08 5:40 pm :: http://alblue.blogspot.com

Kevin,

Whilst Bonjour/ZeroConf can use Multicast DNS, it doesn't have to. It can also use standard Unicast DNS to lookup server records as well; and when allocated a DHCP address (for example) the DHCP server can specify domains to search (e.g. .dns-sd.org). Service discovery includes "Domain Enumeration" - it will try and query b._dns-sd._udp.dns-sd.org to see what else to query (which could be a new set of domains to look at).

http://www.dns-sd.org/ClientBrowseOnly.html

Note that the 'search domains' that get appended here are those that are set up automatically in the case of DHCP. They're seen in /etc/resolve.conf on a Linux box, or in the network settings of the adapter in Windows.

It's also possible to point this to a DynDNS server so that clients can auto-register their services (although there's security implications generally). The point is that clients can use wide-area ZeroConf; it doesn't just happen to the local network; in fact, 'local' is just the default domain that's enumerated. As long as you have an appropriate entry set up in your DNS/DHCP setup, it's possible to leap past the boundaries.

Note that Apple uses this for the 'Back to my Mac' for their .mac connections. When you sign up, the OS hooks up the name of the mac by the domain name (host.userid.members.mac.com) into Apple's dynamic DNS service. That's how you can discover services registered from a remote connection.

My main point is that it does work over WAN, albeit as long as your current domain has an appropriate registry flag (dr._dns-sd._udp.domain.com) set up to point to an appropriate dynamic DNS server. It's not just limited to multicast. However, where PNRP has an advantage is having a single global service scope, whereas in the DNS-SD case, it's more on a per-DNS server. That doesn't mean it can't be used globally (like the back to my .mac feature shows), it just means that there's not one place for everything.

And even with that in mind, DNS-SD is about service discovery. The PNRP builds upon that by providing other things as well; but things like ECF build upon ZeroConf to provide that generic communication mechanism.


5. Kevin Hoffman left...
Sat 10 May 08 7:30 am

That's awesome information. Thanks for clarifying things... Information that directly compares PNRP and Bonjour is scarce so I appreciate the info!


Tag Related Posts

MobileMe vs. Live Mesh Throwdown - Round 1

Wed 16 Jul 08 10:33 A GMT-05

Peer Networking Series - What is PNRP?

Wed 30 Apr 08 2:59 P GMT-05

Leopard Code Sample : Sprinkling in some Bonjour

Tue 27 Nov 07 2:32 P GMT-05
tags:        

My TiVo is using Bonjour...

Mon 18 Jun 07 12:57 A GMT-05
tags:    

Orcas' Hidden Gem - The managed PNRP stack

Fri 11 May 07 6:45 P GMT-05
tags: