Serve clients' specific protocol requirements with Brazil, Part 4

Build multicast-aware apps with JRMS

So far in this series, I have discussed how to meet client protocol requirements utilizing Brazil technology. You have learned how to use Java applets, JavaScript, BSL, plain text, Palm query applications, and WML (Wireless Markup Language) to deliver data to recipients using any browser or device. In Part 4, I'll introduce the Java Reliable Multicast Service (JRMS) API, which allows you to develop multicast-aware applications.

Read the whole series on Brazil technology:

The multicast protocol supports simultaneous message transmission to multiple recipients, without having a point-to-point connection with each recipient. The JRMS from Sun Microsystems provides an implementation for building multicast-aware applications. Multicast decreases bandwidth consumption and, with minimal programming and coordination, allows developers to deploy applications in new ways using channels that have current data. Multicast is particularly valuable for satellite providers that use fast, scarce bandwidth to provide news, stock, video, game, and general replication update feeds over single channels to entire cities.

Technologies like JRMS offer the basis to achieve multicast-aware applications. In this article, I will introduce some examples of JRMS that you can use in your own network. Then I will provide sample code for a Brazil handler that creates a weather multicast channel; users can tune to it and select different sources of weather information.

After understanding these small examples, you should be able to develop applications that are multicast-aware -- network topology permitting.

What is multicast?

As mentioned above, the multicast protocol sends a message to multiple receivers, but does not establish a point-to-point connection with each receiver. For example, you could multicast n radio stations on n ports for a large population of Internet users.

Multicast scales without packed duplication; unicast does not. Net applications are mostly unicast. For example, most audio and video applications open point-to-point connections between the client and the server. So 1 million users employing a unicast approach require 1 million different ports, and each packet must be duplicated 1 million times. Using the multicast approach, 1 million users could receive that data using only a fraction of those ports.

Some efforts involving multicast protocols have not yet taken off, like Multicast Backbone (MBONE). (See Resources for a link.) Many vendors of applications and services in the video, audio, and generic data feed market do not use multicast. Their applications often establish point-to-point connections between the clients and servers. Multicast is not something you just use in your application; multicast protocols require support at the protocol stack level and in the network infrastructure.

Multicast is not yet widely available, so the Internet cannot efficiently deliver the same information to many users. As networking technology improves and bandwidth increases, multicast-aware applications may become more common.

What is JRMS?

The JRMS developers page states that the JRMS project mission is to:

Create a network service which enables building multicast-aware applications that distribute information over IP networks.

Sun Labs technical report #TR-98-68 provides a technical explanation of what multicast is and how it can be used (see Resources for link to report).

JRMS examples from Sun JRMS team

Download the JRMS API from Sun and try a few of the examples. I suggest testing the examples on two machines, but if you only have one, you can run the code on your computer using two windows.

Sun's JRMS team provided the examples in the table below. You can run them from various command line shells, such as Unix terminal windows or DOS windows. It can be instructive to see the packets going out on the network; use your favorite TCP/IP analysis tool to display the packets. Windows developers should consider downloading the Cygwin tools to create a more powerful command window-scripting environment. (See Resources.)

The examples in the following table use either lightweight reliable multicast protocol (LRMP) or tree-based reliable multicast protocol (TRAM). LRMP is an implementation that provides multipoint-to-multipoint reliable and ordered delivery for multiple senders. TRAM provides large-scale point-to-multipoint delivery for single senders. Consult the JRMS Website for more details on these protocols (see Resources for a link).

1 2 Page 1
Page 1 of 2