Previous Next Table of Contents

13. Multicast

13.1 What is Multicast?

Multicast is essentially the ability to send one IP packet to multiple receivers. Multicast is often used for audio and video conferencing systems.

You often hear about the Mbone in reference to Multicast. The Mbone is essentially a ``virtual backbone'' which exists in the Internet itself. If you want to send and/or receive Multicast, you need to be ``on the Mbone.''

13.2 How do I know if I'm on the Mbone?

One way is to ask someone who manages your network. If your network manager doesn't know, or looks at you funny, then you are very likely NOT on the Mbone

Another way is to use the mtrace program, which can be found on the Xerox PARC FTP site. Mtrace is similar to traceroute. It will tell you about the multicast path between your site and another. For example:

        > mtrace mbone.ucar.edu
        mtrace: WARNING: no multicast group specified, so no statistics printed
        Mtrace from 128.117.64.29 to 192.172.226.25 via group 224.2.0.1
        Querying full reverse path... * switching to hop-by-hop:
        0  oceana-ether.nlanr.net (192.172.226.25)
        -1  avidya-ether.nlanr.net (192.172.226.57)  DVMRP  thresh^ 1  
        -2  mbone.sdsc.edu (198.17.46.39)  DVMRP  thresh^ 1  
        -3  * nccosc-mbone.dren.net (138.18.5.224)  DVMRP  thresh^ 48  
        -4  * * FIXW-MBONE.NSN.NASA.GOV (192.203.230.243)  PIM/Special  thresh^ 64  
        -5  dec3800-2-fddi-0.SanFrancisco.mci.net (204.70.158.61)  DVMRP  thresh^ 64  
        -6  dec3800-2-fddi-0.Denver.mci.net (204.70.152.61)  DVMRP  thresh^ 1  
        -7  mbone.ucar.edu (192.52.106.7)  DVMRP  thresh^ 64  
        -8  mbone.ucar.edu (128.117.64.29)
        Round trip time 196 ms; total ttl of 68 required.

If you think you need to be on the Mbone, this is how you can join.

13.3 Should I be using Multicast ICP?

Short answer: No, probably not.

Reasons why you SHOULD use Multicast:

  1. It reduces the number of times Squid calls sendto() to put a UDP packet onto the network.
  2. Its trendy and cool to use Multicast.

Reasons why you SHOULD NOT use Multicast:

  1. Multicast tunnels/configurations/infrastructure are often unstable. You may lose multicast connectivity but still have unicast connectivity.
  2. Multicast does not simplify your Squid configuration file. Every trusted neighbor cache must still be specified.
  3. Multicast does not reduce the number of ICP replies being sent around. It does reduce the number of ICP queries sent, but not the number of replies.
  4. Multicast exposes your cache to some privacy issues. There are no special emissions required to join a multicast group. Anyone may join your group and eavesdrop on ICP query messages. However, the scope of your multicast traffic can be controlled such that it does not exceed certain boundaries.

We only recommend people to use Multicast ICP over network infrastructure which they have close control over. In other words, only use Multicast over your local area network, or maybe your wide area network if you are an ISP. We think it is probably a bad idea to use Multicast ICP over congested links or commodity backbones.

13.4 How do I configure Squid to send Multicast ICP queries?

To configure Squid to send ICP queries to a Multicast address, you need to create another neighbour cache entry specified as multicast. For example:

        cache_host 224.9.9.9 multicast 3128 3130 ttl=64
224.9.9.9 is a sample multicast group address. multicast indicates that this is a special type of neighbour. The HTTP-port argument (3128) is ignored for multicast peers, but the ICP-port (3130) is very important. The final argument, ttl=64 specifies the multicast TTL value for queries sent to this address. It is probably a good idea to increment the minimum TTL by a few to provide a margin for error and changing conditions.

You must also specify which of your neighbours will respond to your multicast queries, since it would be a bad idea to implicitly trust any ICP reply from an unknown address. Note that ICP replies are sent back to unicast addresses; they are NOT multicast, so Squid has no indication whether a reply is from a regular query or a multicast query. To configure your multicast group neighbours, use the cache_host directive and the multicast-responder option:

        cache_host cache1 sibling 3128 3130 multicast-responder
        cache_host cache2 sibling 3128 3130 multicast-responder
Here all fields are relevant. The ICP port number (3130) must be the same as in the cache_host line defining the multicast peer above. The third field must either be parent or sibling to indicate how Squid should treat replies. With the multicast-responder flag set for a peer, Squid will NOT send ICP queries to it directly (i.e. unicast).

13.5 How do I know what Multicast TTL to use?

The Multicast TTL (which is specified on the cache_host line of your multicast group) determines how ``far'' your ICP queries will go. In the Mbone, there is a certain TTL threshold defined for each network interface or tunnel. A multicast packet's TTL must be larger than the defined TTL for that packet to be forwarded across that link. For example, the mrouted manual page recommends:

        32   for links that separate sites within an organization.
        64   for links that separate communities or organizations, and are
             attached to the Internet MBONE.
        128  for links that separate continents on the MBONE.

A good way to determine the TTL you need is to run mtrace as shown above and look at the last line. It will show you the minimum TTL required to reach the other host.

If you set you TTL too high, then your ICP messages may travel ``too far'' and will be subject to eavesdropping by others. If you're only using multicast on your LAN, as we suggest, then your TTL will be quite small, for example ttl=4.

13.6 How do I configure Squid to receive and respond to Multicast ICP?

You must tell Squid to join a multicast group address with the mcast_groups directive. For example:

        mcast_groups  224.9.9.9
Of course, all members of your Multicast ICP group will need to use the exact same multicast group address.

NOTE: Choose a multicast group address with care! If two organizations happen to choose the same multicast address, then they may find that their groups ``overlap'' at some point. This will be especially true if one of the querying caches uses a large TTL value. There are two ways to reduce the risk of group overlap:

  1. Use a unique group address
  2. Limit the scope of multicast messages with TTLs or administrative scoping.

Using a unique address is a good idea, but not without some potential problems. If you choose an address randomly, how do you know that someone else will not also randomly choose the same address? NLANR has been assigned a block of multicast addresses by the IANA for use in situations such as this. If you would like to be assigned one of these addresses, please write to us. However, note that NLANR or IANA have no authority to prevent anyone from using an address assigned to you.

Limiting the scope of your multicast messages is probably a better solution. They can be limited with the TTL value discussed above, or with some newer techniques known as administratively scoped addresses. Here you can configure well-defined boundaries for the traffic to a specific address. The Administratively Scoped IP Multicast RFC describes this.


Previous Next Table of Contents