Java Bonjour Browser

Denis Abramov
Columbia University
2960 New York, NY 10027-6902
USA
dabramov@optonline.net

Myounghwan Lee
Columbia University
2960 New York, NY 10027-6902
USA
ml2483@columbia.edu

Abstract

The aim of this ptoject is to build a Java Swing application that has all of the functionality in Bonjour Browser. It is able to list all the services that are offered on the network by Bonjour devices.

Table of Contents

1. Introduction and Background
1.1 About Bonjour
1.2 About Bonjour Browser
1.3 About Java Bonjour Browser and and why it was needed
2. System requirements
3. Installation instructions
4. Operation
5. Program stucture and internal operation
5.1 Classes
5.2 Internal operation
6. Useful enhancements
7. Acknowledgements
8. Task List
9. References

1. Introduction and Backgrounds

Bonjour is Apple Computer's trade name for its implementation of Zeroconf, a service discovery protocol used in Apple's Mac OS X operating system from version 10.2 onwards. Intended for use on local area networks, Bonjour uses multicast Domain Name System service records to locate devices such as printers, as well as other computers, and the services that those devices offer. And Bonjour Browser shows us all the known Bonjour services available along with any extra information given with the service. Therefore we tried to make an application to be able to run on any platform on which Bonjour is working.

1.1 About Bonjour

Bonjour [1] is Apple¡¯s proposal for zero-configuration networking over IP. The ZEROCONF Working Group¡¯s requirements and proposed solutions for zero-configuration networking over IP essentially cover three areas:

o addressing (allocating IP addresses to hosts)
o naming (using names to refer to hosts instead of IP addresses)
o service discovery (finding services on the network automatically)

Bonjour has a zero-configuration solution for all three of these areas, as described in the following four sections.

Bonjour allows service providers, hardware manufacturers, and application programmers to support a single network protocol-IP-while breaking new ground in ease of use.

Network users no longer have to assign IP addresses, assign host names, or even type in names to access services on the network. Users simply ask to see what network services are available, and choose from the list.

In many ways, this kind of browsing is even more powerful for applications than for users. Applications can automatically detect services they need or other applications they can interact with, allowing automatic connection, communication, and data exchange, without requiring user intervention.

1.2 About Bonjour Browser

Bonjour Browser [2] is an application that lets you browse all the Bonjour services available on your local network. This application will show you all the known Bonjour services available and what computers have them, along with any extra information given with the service.

1.3 About Java Bonjour Browser and and why it was needed

An application like Bonjour Browser is necessary to view the services that are present and being announced in a network where devices are Bonjour-capable. While Bonjour Browser does a very good job on the Mac OS X platform, we will need an application that can work similarly, display all services and run on several platforms. Hence it was necessary to build a tool like Bonjour Browser in Java that could run on multiple platforms.

A tool like Bonjour Browser is especially helpful while troubleshooting service discovery in the IRT Lab's 7DS research, since the project involves mobile disconnected networks where devices are often very transient and services are announced and disappear shortly afterwards. .

2. System requirements

Mac OS 9, Mac OS X, Linux, BSD, Solaris, VxWorks, and Windows. (Any platform on which Bonjour is working and with a Java 2 Runtime Environment)

3. Installation instructions

4. Operation

¨ç Start Java Bonjour Browser.
¨è Java Bonjour Browser is searching for and listing the Bonjour general services available. (Figure 1)
¨é If we want to see providers given with the general service, expand the tree the service is included. (Figure 2)
¨ê If we want to see the extra information given with the provider, expand the tree the provider is included. (Figure 3)
¨ë If we want to reload the Bonjour services available, we can push the "Reload Services"

Figure 1


Figure 2


Figure 3


5. Program stucture and internal operation

5.1 Classes

o BonjourBrowser -- main class for GUI components/events
o BonjourBrowserElement -- class to encapsulate the structures that Bonjour returns
o BonjourBrowserInterface -- the interface that Bonjour API needs to call to update GUI
o BnjourBrowserImp -- the implementation of the BonjourBrowserInterface
o BonjourBrowserMultiServiceBrowser -- implementation of a listener for general service advertisements
o BonjourBrowserSingleServiceBrowser -- implemenation of a listener for specific service advertisements
o TestRegister -- a sample service to register for testing

5.2 Internal operation

o The GUI starts up by browsing the "_services._dns-sd._udp." service which is a special service that advertises general services like "_http._tcp", "_ssh._tcp".
o When a general service is discovered by bonjour, it is passed to the BonjourBrowserMultiServiceBrowser and in turn added to the GUI tree.
o When a user expands a general service, another request is made to Bonjour to discover all providers of that service.
o The BonjourBrowserSingleServiceBrowser is triggered, when each provider is discovered and the Jtree is updated.
o Each of the providers is then resolved to obtain the ip address as well as other textual representations of the service.
o When services are removed, they are removed from the jtree.

6. Useful enhancements

We made this application by using JAVA, so we can run it on any platform on which Bonjour is working and with a Java 2 Runtime Environment.

7. Acknowledgements for code and ideas borrowed

This document represents ideas and comments about Bonjour and Bonjour Browser from Apple Computer.
Thanks to Professor Henning Schulzrinne, Mentors Suman Srinivasan, Se Gi Hong.

8. Task List

Denis Abramov - Designing the structure of Java Bonjour Browser and communication coding work for Java Bonjour Browser with Bonjour.
Myounghwan Lee - GUI coding work for displaying services in JTree, testing, packaging and compiling into an executable JAR file, and making the report and Javadoc file.

9. References

[1] http://developer.apple.com/documentation/Cocoa/Conceptual/NetServices/index.html
[2] http://www.tildesoft.com/Programs