previous next

Chapter 9: Multicasting

Multicasting is another way of reducing the number of streams in use. It requires a specially configured network.

Overview

Multicasting is a way of sending a single live stream to multiple clients, rather than sending a stream to every single client. Clients connect to the stream, rather than to the

Multicasting

In contrast, regular unicasting transmission sends a stream to each client that requests it:

Unicasting

To take advantage of multicasting, both RealServer and clients, as well as the routers between them, must be multicast-enabled. For this reason, multicasting is mostly used with intranets where routers can be configured for multicasts. However, multicast delivery can be done over the Internet where intermediary network devices have been multicast-enabled.

RealServer Multicasting Methods

RealServer includes two methods of multicasting: back-channel multicast, and scalable multicast. You can use both methods at once.

Back-channel multicast maintains an accounting control channel between the client and RealServer. RealServer uses this channel to provide information about the presentation and to query the client for a user name and password, if authentication is in use. The client uses the control channel to send password information and commands such as "play" and "stop". With this information, RealServer can track how many clients are viewing a presentation. Monitoring tools such as the G2 Java Monitor in RealSystem Administrator show client activity.

Scalable multicast does not use this control channel, thus taking up far less bandwidth and administrative overhead. Monitoring tools such as G2 Java Monitor will not track client activity.

Back-Channel Multicasting

Back-channel multicast consists of two types of multicast: RTSP and PNA multicasts. In both RTSP and PNA multicast, authenticated material and client statistics can be sent because the exchange between the client and RealServer is bi-directional.

RTSP Multicast

This method of multicasting uses the RTSP protocol to send control information over a TCP channel. RealServer maintains a control connection for each client. The data channel is multicast to all clients.

RTSP multicast provides these features:

RTSP Multicasting

PNA Multicast

PNA multicast uses the PNA protocol over a TCP connection to exchange information between the client and RealServer.

PNA multicast is used when transmitting to pre-G2 clients. RealServer maintains a control connection for each client. The data channel is multicast to all clients.

PNA multicast provides these features:

PNA Multicasting

Scalable Multicasting

Scalable multicasting allows you to transmit to an unlimited number of clients because the transmission from the RealServer is completely one-way; there is no connection from each client to RealServer at all. All data is multicast on the network once. Each client connected to this multicast receives all data packets.

It is thus suitable for situations that would otherwise consume much bandwidth.

Scalable multicasting uses a different URL format than either RTSP multicast or PNA multicast.

This method supports G2 clients only; clients version 5.0 and older will not receive any presentations, and will receive an error message instead.

Scalable Multicasting

Summary of Multicast Methods

The following table summarizes the benefits of each multicast method.

Multicast Methods
Back-Channel Multicast Scalable Multicast
Feature RTSP PNA
Control channel · ·
Authentication · · ·
Client statistics · · ·
Minimal RealServer resource use ·
RTP enabled ·
SureStream support (without shifting capabilities) · ·
Requires special URL format ·

The following table shows the features of the three multicast methods, as they apply to clients.

Back-Channel Multicast Scalable Multicast
Feature RTSP PNA
RealSystem G2 clients only ·
Older clients ·
RealSystem G2 clients or any RTP-enabled clients ·

Logging Multicasts

Material served via back-channel multicast appears in the access log just like unicast material. The access log shows which method was used to transmit the stream.

Scalable multicasts may be identified in the access log by their mount point in the GET statement.

Combining Splitting and Multicasting

To reach large audiences across a network that includes both Internet and intranet connections, you can use splitters to send data across the Internet to intranet sites, and then use multicast delivery to redistribute the data from splitters to clients. This can be a powerful method of distributing a live stream while still conserving bandwidth.

Additional Reading

RealNetworks' implementation of multicasting is based on open industry standards. You may be interested in the following resources:

Multicasting, General Information

Scalable Multicasting

Setting Up Multicasting

Before you set up either type of multicasting, you need to do two things:

Setting Up the Network for Multicasting

Before setting up RealServer, verify the following items with your network administrator:

In addition to network settings, for clients to take full advantage of multicast transmissions, they must be configured to request multicast transmission of live material. Consult the client's user guide for information on configuring the client.

As noted earlier, both RealServer and clients, as well as the routers between them, must be multicast-enabled in order for you to distribute presentations using the multicast features. This section describes only what is required to enable RealServer for multicast broadcasting.

Allocating Addresses and Port Numbers in RealServer

There are two factors to take into account when establishing the addresses and port numbers that RealServer will use for multicasting:

Although the information in this document will help you calculate the number of addresses and port numbers you'll need for scalable multicasting, you'll still need to consult with your network administrator regarding the actual addresses you'll use.

Calculating the Number of Required Addresses and Port Numbers

For each file that you are transmitting via multicast, you must calculate the number of addresses you'll need. In back-channel multicasting, the number of addresses is based on the number of bit rates in the file. In scalable multicasting, you'll also need to set aside port numbers; these are based on the number of streams per bit rate.

For simple RealVideo files, figuring the number of addresses and port numbers is relatively simple. SureStream files are more complex, as they can contain several bit rates, each with its own number of streams.

If another person is supplying the file to be multicast, that person will need to tell you how many bit rates are in the file. For scalable multicasts, you will also need to know how many streams per bit rate are present.

You can get these numbers yourself if you are encoding the file; look in the encoding software to learn the number of bit rates and streams. For example, in RealProducer Plus, you would click View > Statistics to see the number of bit rates and streams being encoded.

RealProducer Plus Recording Statistics

Once you know the number of bit rates and streams in the file, refer to "Calculating Addresses for Back-Channel Multicasts" or "Calculating Addresses and Ports for Scalable Multicasts".

If you have no way of knowing how many bit rates and streams are in the file, you'll have to guess. A safe number is six; the maximum number of bit rates that would be present in a single SureStream file is 14, yet files prepared for multicasts are likely to include only the higher encoding rates. A non-SureStream file would have at most one bit rate and two streams.

Calculating Addresses for Back-Channel Multicasts

If you are preparing to transmit a file via back-channel multicast, you only need to know the number of bit rates in the file.

Addresses Needed for Back-Channel Multicasts
Bit Rates Addresses
1 1
2 2
3 3
... ...
n bit rates n

Calculating Addresses and Ports for Scalable Multicasts

Figuring the number of addresses and port numbers for scalable multicasts depends on several factors.

An audio presentation consumes one stream; a video presentation uses two streams (one for audio and one for video). For highest quality, and to match the scalable multicast RDT specification, RealServer uses one address for each stream.

RealServer includes a feature that allows you to send the audio and video streams on a single address. Use this feature if you want to conserve the number of addresses you're using. Use the dual address method if you know that clients viewing the presentation may be using a low bandwidth connection and the clients are able to select a single stream, such as just the audio portion of your multicast.

Each address must use a certain range of port numbers. The numbers you choose can begin with any number, but the first port number must be an even number, and you must use a consecutive range. (RTP is used to send the data; the RTP standard requires this format.)

In the table below, n represents the number of bit rates in the file that you'll be multicasting.

Addresses and Ports Needed for Scalable Multicasts
Bit Rates Streams per Bit Rate Reuse Address=False Reuse Address=True
Addresses Ports Addresses Ports
1 1 (audio only) 1 2 1 2
1 2 (audio and video) 2 4 1 4
2 1 (audio only) 2 4 2 4
2 2 (audio and video) 4 8 2 8
3 1 (audio only) 3 6 3 6
3 2 (audio and video) 6 12 3 12
... ... ... ... ... ...
n bit rates 1 (audio only) n 2n n 2n
n bit rates 2 (audio and video) 2n 2n n 4n

Another way of calculating the number of ports needed is as follows:

Publicizing Your Multicasts

You can publicize your multicasts to anyone running a program that listens for the Session Announcement Protocol (SAP). These applications, such as SDR and ICAST Guide, display a list of all multicasts currently playing. RealServer creates the SAP file automatically. Programs that listen for SAP files will show the title, author, and copyright information encoded into the files you are multicasting.

To set up RealServer to create SAP files:

  1. In RealSystem Administrator, click Multicasting. Click SAP.

  2. In the Host Address box, type the IP address of this RealServer. The SAP files will include this address.

  3. From the Enable SAP Service list, select Yes. This instructs RealServer to create and send SAP files.

  4. From the Listen to SAP list, select Yes.

  5. Click Apply.

  6. For back-channel multicasts, use the following steps:

    1. Click Multicasting. Click Back-Channel.

    2. From the Enable SAP list, select Yes.

    3. Click Apply.

      For scalable multicasts, use the following steps:

    4. Click Multicasting. Click Scalable.

    5. Select the Live Channel whose multicasts you want to announce.

    6. From the Enable SAP list, select Yes.

    7. Click Apply.

Setting Up Back-Channel Multicasting

Follow the instructions below to set up back-channel multicasting. After you set it up, you will need to create the links that point to your multicasted events.

To set up back-channel multicasting:

  1. In RealSystem Administrator, click Multicasting. Click Back-Channel.

  2. In the PNA Port box, type the port number to which RealServer will direct its PNA multicast streams. The value in this box refers to the client's port number. A typical value is 7070.

  3. In the RTSP Port box, type the port number to which RealServer will direct its RTSP multicast streams. The value in this box refers to the client's port number. A typical value is 554.

  4. Specify the range of addresses to which you want to multicast streams by filling in the Address Range box. RealServer uses the first available address in this range. If you are also using scalable multicast, be sure that the address ranges are different and do not overlap. If your multicast streams are referenced in SMIL files, you will need one address for each stream.

    Refer to "Calculating Addresses for Back-Channel Multicasts" to calculate the exact number of addresses you'll need.

  5. In the IP Address section, click Add.

  6. In the new window that appears, type a description for this list in the Rule Number box.

  7. In the IP Address box, type an address to the domain address of the client computer or network to which RealServer will permit multicast transmissions.

  8. In the Netmask box, type a netmask that limits the range to a particular subnet.

  9. Click Add.

  10. To require that the client addresses you just listed use multicast only, and not unicast, select Yes from the Delivery Only list. To remove this restriction and permit unicast for clients unable to connect via multicast, set it to No.

  11. Indicate how far multicast packets can travel over a network by typing a value in the Time to Live box. Each time a multicast data packet passes through a multicast-enabled router, its Time to Live is decreased by 1. When the value is decremented to 0, the router discards the data packet.

    The value for Time to Live can range from 0 to 255. The larger the Time to Live, the greater the distance a data packet will travel.

    The default value of 16 is enough to keep multicast packets within a typical internal network.

    Time to Live (TTL) Values
    TTL Value Packet Range
    0 Local host
    1 Local network (subnet)
    32 Site
    64 Region
    128 Continent
    255 World

  12. To allow missing packets to be resent to clients that request them, select True from the Resend list. This setting is optional. It adds some overhead to the traffic on your network; however, clients receive better quality multicasts.

  13. Indicate which clients will be able to view your multicast presentations by configuring the User List.

    To require that clients with IP addresses in the User List must connect in multicast mode, set Deliver Only to Yes. This setting means that clients that are not configured for multicast will not be able to receive the multicast, and will receive an error message instead. Use this feature when you want to restrict the multicast to a limited number of clients, or if you are multicasting a high-bandwidth presentation and do not want unicast to be an option.

    1. In the User List area, select Yes from the Delivery Only list.

    2. Click Add a User List.

    3. In the Rule Name box that appears, type a rule number. The rule number is used by RealServer for sorting the address rules.

    4. Type the IP Address of the client allowed to receive the multicast in the IP Address box. To allow any client to access the multicast, type 0.0.0.0.

    5. Type the subnet mask for the client IP in the Netmask box.

      To indicate a single IP address, type 255.255.255.254 in the Netmask box. If you typed 0.0.0.0 in the To box, type the same thing in the Netmask box.

    6. Click OK.

      Repeat Step b through Step f for each set of clients that will be accessing your multicast.

  14. Click Apply.

    Note
    Access Control rules are enacted before User List rules. A client that is excluded by Access Control will not be able to connect to any multicasts, regardless of the rules you create here. (IP Access Control is described in "Limiting Access Via IP Address".)

Linking to Back-Channel Multicasts from a Web Page

Links to both RTSP and PNA multicast are identical to links for live unicast transmissions. This is convenient, because a single link can serve both multicast-enabled clients and unicast-only clients.

Because multicasts are done with live streams, use the live mount point in the URL. See "Linking a Web Page to a SMIL File or Individual Clip" for instructions on creating links to individual files.

Most clients on a multicast-enabled network are configured to request material via multicast first.

Setting Up Scalable Multicasting

There are four parts to setting up scalable multicasting.

  1. Create the mount point to use for all scalable multicasts.

Perform the following steps for each live source that you will be transmitting via scalable multicast.

  1. Indicate the live channel for each scalable multicast. Each live channel has its own name, address and port numbers, and optional settings.

  2. Create the link for the multicast, since this type of multicast requires a special URL.

In addition, you can configure some optional features:

After changing any scalable multicast settings, you must restart RealServer for the changes to take effect.

Creating General Scalable Multicast Settings

The steps in this section apply to all scalable multicast settings; you only need to perform them once.

To create general scalable multicasting settings:

  1. In RealSystem Administrator, click Multicasting. Click Scalable.

  2. In the Mount Point box, type the mount point that will be included in the links to all scalable multicasts. The default value mount point is scalable.

  3. Click Apply.

Setting Up a Live Channel

The steps in this section set up the live channel. You may want to set up additional features, described in "Optional Scalable Multicast Features". You'll need to know which addresses are available to you and how many to use; see "Calculating the Number of Required Addresses and Port Numbers"

To create a live channel:

  1. In RealSystem Administrator, click Multicasting. Click Scalable.

  2. Click Add a Live Channel.

  3. In the new browser window that appears, type a descriptive name for this multicast session in the Name box.

  4. Type the name of the virtual directory in the Virtual Path box. The virtual directory is the path typed in the production tool that's encoding the live file. The information you enter here, in addition to the scalable mount point, will be included in the link for scalable multicast.

  5. Turn on scalable multicasting for this virtual path by selecting Yes from the Enabled list.

    To make all live broadcasts available via scalable multicast, type an asterisk (*) here.

  6. From the Reuse Addresses list, select False if you want to use a separate address for each stream; select True if you want to use one address for both streams.

  7. In the Port Range boxes, type the port numbers to which clients will listen for streams, in the format port1-port2. The first port number must be an even number, and must be followed by a consecutive port number. Refer to "Calculating Addresses and Ports for Scalable Multicasts" to determine the number of ports to use.

  8. In the AddressRange box, type the range of addresses for RealServer to use. RealServer uses the first available address in this range. When typing in this box, use the form address1-address2. To use a single address instead of a range, type the address in the form address1-address1. Refer to "Calculating Addresses and Ports for Scalable Multicasts" to determine the number of addresses to use.

  9. Indicate how far multicast packets can travel on your network in the Time to Live box. Use the values in the "Time to Live (TTL) Values" table.

  10. Click OK. You are returned to RealSystem Administrator. Click Apply.

Creating the Link for the Multicast

Scalable multicasts use a different URL format than other material; when RealServer receives a request in this format, it sends the material differently and does not expect to establish or maintain a TCP connection.

To create links to scalable multicasts from a web page, Ram File, or SMIL File

All links to scalable multicast content use the same format. Note that they always begin with http://and always end with the .sdp extension:


http://realserver.company.com:HTTPPort/MountPoint/virtual_path/filename.xxx.sdp

RealServer URL Components
Component Meaning
http The protocol used for streaming. Always use http in Web pages.
realserver.company.com Machine and domain name of RealServer
HTTPPort Port number where RealServer listens for requests sent via HTTP. This value is usually 80 or 8080; see "Port Variables".
MountPoint Scalable mount point, usually scalable.
virtual_path The virtual path is any actual directory, relevant to the base path of the mount point. If the file is located in the base path itself, omit virtual_path.
filename The file name itself.
xxx The file type, such as ra, rm, or rt.
sdp The final letters are required for scalable multicast. These are not part of the actual live file name; they only appear in the link.
.

Using an example for RTSP and PNA multicast, a link would look like the following:


<a href="http://realserver.company.com:8080/scalable/vivaldi.ra.sdp">
Click here to listen to today's Vivaldi selection</a>


Optional Scalable Multicast Features

The settings in this section are optional, and can be set for any live channel.

Using Unicast as a Backup Method

When clients that are not multicast-enabled click the link to your scalable multicast presentation, they receive an error message. An error message also appears on a client screen when the multicast itself is interrupted at any point along the network. In both cases, the presentation halts.

The Shift to Unicast feature reconnects the client to a unicast version of the presentation. You can also use this feature to customize the message those clients receive, or even redirect them to a multicast presentation on another RealServer.

You need only supply a single URL for your multicast if you enable this feature, rather than supplying a second URL for the unicast version.

You can enable this feature for individual live sources.

Do not enable this feature if you are multicasting a high bit-rate presentation and switching to unicast would flood your network.

To use unicast as a backup method:

  1. In RealSystem Administrator, click Multicasting. Click Scalable.

  2. From the Shift to Unicast list, select Yes.

  3. Click Apply.

Creating Custom Messages

In cases where clients would receive a generic error message informing them that the multicast was unavailable or available only to multicast-enabled clients, you can instruct RealServer to point the client to your own HTML page, which could contain a custom explanatory message, such as "This presentation is only available to RealPlayers that have been configured to use multicast."

To create a custom message:

  1. Create the Web page that you want clients to see in the event of an error.

  2. In RealSystem Administrator, click Multicasting. Click Scalable.

  3. In the Alternate URL box, type the URL of your Web page. For example, type http://www.mycompany.com/mcast.html.

Establishing Alternate Multicast Servers

If you have a second RealServer which is also transmitting your multicast, or if it is transmitting a backup multicast presentation, you can supply the origin RealServer with the address of the second RealServer, and clients who are unable to receive the multicast presentation from the origin RealServer will automatically be sent to the second RealServer.

Clients whose service is interrupted will be sent to the second RealServer, rather than receiving an error message and then halting the presentation.

To establish an alternate multicast RealServer:

  1. Create the Web page that you want clients to see in the event of an error.

  2. In RealSystem Administrator, click Multicasting.

  3. Click Scalable.

  4. In the Alternate URL box, type the URL of the multicast presentation on the second RealServer. For example, type rtsp://realserver.mycompany.com:8080/scalable/vivaldi.rm.sdp.

    Note
    The steps in this section are the same as in "Creating Custom Messages"; use either an alternate URL or a custom HTML page per scalable multicast.

Controlling Client Statistics

Clients such as RealPlayer have a feature that sends statistics to RealServer about the amount of data they received while playing a presentation.

As in unicast presentations, client statistics are sent to RealServer at the end of a presentation, and are stored in the access log. But scalable multicasts can serve to thousands of clients at the same time, and your RealServer may not be equipped to handle that quantity of simultaneous incoming client statistics.

RealServer includes features that help you manage two aspects of client statistics sent at the end of a scalable multicast:

Controlling Whether Client Statistics Are Sent

When clients initially connect to RealServer for a scalable multicast presentation, RealServer can instruct them not to send any connection statistics at all. This RealServer feature overrides client settings.

Enable this feature if your system cannot handle the volume of packets of data that would be sent simultaneously, or if you are simply not interested in these statistics.

To control whether clients send statistics to RealServer:

  1. In RealSystem Administrator, click Multicasting. Click Scalable.

  2. In the Send Client Statistics box, select True if you want clients to send their connection statistics at the end of a multicast presentation. Select False if you do not want clients to send any connection statistics.

    Warning
    If you set Send Client Statistics to True, be sure your RealServer can process the number of incoming statistics, or configure a Web server to receive the data as described in the next section.

  3. Click Apply.

Controlling Where Client Statistics Are Sent

When clients initially connect to RealServer for a scalable multicast presentation, RealServer can instruct them to send connection statistics to a Web server, rather than to RealServer. Web servers may be better equipped to handle volumes of simultaneously arriving data, since they are often configured to perform load balancing.

To use this feature, you will need to have a Web server available to you, and you will need to create a cgi script to receive the client statistics and to write them to a log file.

Additional Information
The cgi script should create a log file using the same format as the RealServer access log file. See "Access Log Format".

After the multicast event, you can look at the log file created by the cgi script and draw conclusions about the quantity and quality of service.

To control where clients statistics are sent:

  1. In RealSystem Administrator, click Multicasting.

  2. Click Scalable.

  3. In the Web Server Address box, type the address of the Web server that will receive the client statistics at the end of the multicast presentation.

  4. In the Web Server Port box, type the port number of the Web server. If you omit this, RealServer will not multicast the event and will report an error in the error log file.

  5. In the Web Server CGI Path box, type the path of the cgi script that will consolidate the client statistics in a log file on the Web server. For example, type cgi-bin/client-stats/logstat.

  6. Click Apply.

Announcing Your Scalable Multicasts

You can publicize your multicasts to anyone running a program that listens for the Session Announcement Protocol (SAP). These applications, such as SDR and ICAST Guide, display a list of all multicasts currently playing. RealServer creates the SAP file automatically. Programs that listen for SAP files will show the title, author, and copyright information encoded into the files you are multicasting.

  1. In RealSystem Administrator, click Multicasting. Click SAP.

  2. In the Host Address box, type the IP address of this RealServer. The SAP files will include this address.

  3. From the Enable SAP Service list, select Yes. This instructs RealServer to create and send SAP files.

  4. From the Listen to SAP list, select Yes.

  5. Click Apply.

  6. Click Multicasting. Click Scalable.

  7. Select the Live Channel whose multicasts you want to announce.

  8. From the Enable SAP list, select Yes.

  9. Click Apply.


Copyright © 1998-1999 RealNetworks
For information on RealNetworks' technical support, click here.
Comments on this document? Click here.
This file last updated on 05/14/99 at 19:32:19.
previous next