"I have a mind like a steel... uh... thingy." Patrick Logan's weblog.

Search This Blog


Saturday, June 09, 2007

Can iTunes Accomplish What Jini Couldn't?

Frank Sommers reflects on Walter Mossberg's. First Mossberg...

Out of the box, each copy of iTunes looks for other shared iTunes music libraries on your local network. It doesn’t share your library unless you authorize it to do so...

If you use Sharing, you’ll see in iTunes’ left-hand panel a list of shared libraries on other iTunes-equipped computers on your local network, whether they reside on Windows or Macintosh computers...

[As] I write this on a Mac laptop in my home office, I am playing a song that resides on a Windows Vista desktop PC in another room. To achieve this feat, I didn’t have to fiddle with the often confusing network settings... I just had to use iTunes on both machines and click a couple of buttons.

In effect, each copy of iTunes, with the user’s permission, broadcasts a sort of beacon that signals its presence to other copies of iTunes on a local network, regardless of the operating system underneath. It makes the operating system irrelevant.

And now on to Frank Sommers...
The notion of network services advertising and discovering each other, forming spontaneous, often impromptu, relationships, was at the heart of the Jini vision. While Jini may well experience a resurgence due to Sun recently donating the Jini codebase to the Apache Foundation, Jini itself never gained the wide distribution that Apple's similarly-purposed network technology already enjoys. The Jini community has debated for a long time Sun's role in Jini's general acceptance, or lack thereof. While licensing may have been an issue, in my opinion there have not been compelling enough Jini services to entice users to install and use Jini. By contrast, iTunes users who care only about being able to listen to or purchase music online, have downloaded and installed Bonjour to the tune of several hundred million hosts.

In addition to all those PCs, and every Mac, hundreds of different types of devices provide Bonjour-based networking capabilities, and new Bonjour devices come to the market all the time. Perhaps the most anticipated one will be Apple's own iPhone. Given all these devices, including a large number of PC desktops, it seems that a widely available spontaneous networking platform is now available. The question now is what developers will do with this new platform...

Adobe's Creative Suite 3 and Skype, to mention two examples, started to use Bonjour to facilitate local-area collaboration and discovery.

As Bonjour inventor Stuart Cheshire demonstrated in an hour-long Google TechTalk presentation (Flash video), Bonjour can be used to advertise and discover networked services over the WAN as well...

Bonjour simply extends the existing DNS mechanisms, and uses a service's protocol type, defined as a string, in service discovery. There are now several hundred service types described this way, from HTTP and SSL to the MYOB accounting software and the Sybase database server. If a client can talk a certain protocol, it can use Bonjour to discover and invoke services capable of communicating over that same protocol.

Bonjour goes beyond Jini's registration and lookup... Bonjour is zero config. Have you seen the Jini configuration mechanism?

Perhaps the next major revision of Jini, should there be one, would use Bonjour at least as an alternative to much of the Jini registration and lookup, and other configuration such as the various HTTP ports, etc. Bonjour uses DNS SRV records to indicate what port to use for what service, and so there is no fighting over port 80, or 8080, etc.

Stuart Cheshire points out in the video linked above, AppleTalk had all this zero configuration for network addressing, naming, and discovery. Bonjour is the result of figuring out that IP has the same capabilities...

And that was the breakthrough: realizing that we can do service discovery using the semantics of DNS queries, and we don't need to invent a new protocol. And then we can run that DNS over the multicast DNS support that we've already created.
Bonjour has each service run just a wee bit of DNS and negotiation among peers to avoid having a DNS server and configuration, etc. Amazing. It's probably time to begin incorporating this stuff into our systems.

And the WAN / unicast stuff can work the same way via the DHCP or other static information. Fun. We can accomplish what Jini couldn't, or hasn't yet.

1 comment:

PetrolHead said...

I doubt Bonjour can replace all of Jini's lookup/discovery - it assumes clients already understand the protocol of the service they're looking for. There's no support for code download.

I could imagine Bonjour being used to replace the discovery element which is all about finding lookup services.

There are also some other implications such as lease lifetimes on registered services - from the relevant IETF spec for Bonjour (excuse the formatting):

" Update Requests contain, in the LEASE field of the OPT RDATA, a
signed 32-bit integer indicating the lease life, in seconds, desired
by the client. In Update Responses, this field contains the actual
lease granted by the server. Note that the lease granted by the
server may be less than, greater than, or equal to the value
requested by the client. To reduce network and server load, a
minimum lease of 30 minutes (1800 seconds) is RECOMMENDED. Note that
leases are expected to be sufficiently long as to make timer
discrepancies (due to transmission latency, etc.) between a client
and server negligible. Clients that expect the updated records to be
relatively static MAY request appropriately longer leases. Servers
MAY grant relatively longer or shorter leases to reduce network
traffic due to refreshes, or reduce stale data, respectively."

Also worth noting the multicast magic requires the presence of a native daemon known as mDNSResponder:

"mDNSResponder is a Bonjour system service that implements Multicast DNS Service Discovery for discovery of services on the local network, and Unicast DNS Service Discovery for discovery of services anywhere in the world. mDNSResponder is built into Mac OS X and can be downloaded as part of Bonjour for Windows. Applications like iTunes, iPhoto, iChat and Safari use mDNSResponder to implement zero-configuration network music sharing, photo sharing, chatting and file sharing, and discovery of remote user interfaces for hardware devices like printers and web cameras. mDNSResponder is also used to discover and print to Bonjour printers and USB printers connected to the AirPort Extreme and Express base stations. mDNSResponder is open source, and hardware device manufacturers are encouraged to embed the mDNSResponder source code directly into their products to benefit from zero-configuration networking."

So Bonjour+Jini not trivial but not impossible either.....


Blog Archive

About Me

Portland, Oregon, United States
I'm usually writing from my favorite location on the planet, the pacific northwest of the u.s. I write for myself only and unless otherwise specified my posts here should not be taken as representing an official position of my employer. Contact me at my gee mail account, username patrickdlogan.