Multicast and multicast in practice by malj


									        Multicast in Theory and Practice

         Ingemar Henriksson                                             Patrick Ilmander
           (                                           (

                                               Spring 2001

Abstract                                                  Experts in the field agree that the solution to the
                                                          problem is something called multicast, and
In this paper we give an introduction to multicast        although some people haven't become aware of
and why the interest for it is growing. We                multicast until recently, it's not a new
compare multicast with unicast and broadcast              phenomenon. It was first proposed by Steve
and we will also try to describe some of the              Deering in 1989 and has since gone through a
protocols that currently exist for multicast              long evolution.
routing. Finally we present some real life
examples and a simple test implementation. Our
conclusion is that even though the infrastructure         What is multicast?
isn‟t ready yet, multicast will be required for the
future Internet to scale.                                 Multicast is a one-to-many architecture, which
                                                          makes it possible to send information to a large
                                                          group of recipients simultaneously. The basic
Introduction                                              idea is to reduce the needed bandwidth near the
                                                          source of the data stream by only sending out a
The need for one-to-many and many-to-many                 single packet, which is then routed over the
communication in networks is growing and                  network and split (copied) when necessary. The
traditional methods of sending and routing data           stream is only forwarded to parts of the network
over a network were not designed with this in             where clients that have requested the stream are
mind. The main reason for this growing interest           located. The amount of bandwidth saved rises
is the emergence of more and more multimedia              with the number of members in the group. In the
content on the Internet, such as audio/video              best-case scenario the traffic is reduced in direct
broadcasts.                                               proportion to the number of recipients.

To distribute a high-quality video stream on the          To only forward the data stream to parts of the
Internet today using a one-to-one approach                network where members of the group are located
requires a new connection to be set up for every          requires a lot of intelligence. When using unicast
end user. This method doesn‟t scale well,                 to send information packets are routed from a
because for every new viewer the amount of                source to a destination along a path. Since a
bandwidth increases linearly. For example, if 55          multicast has many receivers a packet needs to
people simultaneously stream data from a server           branch in the network and follow more than one
using 28.8 modems the server will need a T-1              path. The naive solution to this problem is to
line (1.5 Mbps) to deliver the stream to all users.       flood the network with traffic in all directions. A
For television and other broadcast media‟s to             more efficient way of distributing the data stream
merge with the Internet they will need an                 is to build a path tree. Since knowledge of the
infrastructure that can deliver their content to          network is limited locally it isn‟t possible to find
hundreds of thousands or even millions of people          an optimal path tree. Instead routers have to
simultaneously.                                           communicate to find a shortest path tree. We will
                                                          present different protocols, which have been
                                                          developed to route multicast traffic over the
                                                          Internet later in this article.

MBONE                                                    Comparison
In 1992 the Internet Engineering Task Force              Unicast
(IETF) held an “audiocast” experiment in which
live audio and video were multicast from the             Unicast is currently the most commonly used
IETF site to destinations around the world.              method for sending data over the Internet. It fits
MBONE is an outgrowth of this experiment and             the client/server model of the Web and many
today there exist thousands of MBONE servers             other popular applications well, as data is sent
throughout the world. It is a virtual network            from a single sender to a single receiver.
layered on top of the Internet. It consists of           However, the need to distribute large amounts of
MBONE routers spread all over the world,                 data to many people is growing. To create a new
connected either directly to each other or               connection for every member of a digital
tunneled through non-multicast enabled routers.          audio/video broadcast isn't feasible. Another
MBONE is a voluntary effort, which means that            issue is the amount of bandwidth, which is
every network provider who wants to participate          wasted because of redundant information being
is allowed to contribute by setting up one or            sent.
more MBONE routers on their network. It
requires some specific software and network                                Sender
engineer skills to set up IP multicast tunnels.
You must also be prepared to handle a lot of
traffic. When transmitting IP multicast packets
over non-multicast enabled routers, the sending
multicast router will encapsulate the IP multicast
packet so that intervening routers can handle the
packets. This is done by prepending the IP                                 Router
header with another IP header, which destination
is set to the receiving multicast router in the
other end of the tunnel. It will then be sent as a
normal unicast datagram. The receiving multicast
router strips off the encapsulating IP header and
forwards the packet to its real destination.

                                                                    Members            Non-member

                                                         The figure shows how data is distributed to a
                                                         group of people using unicast. It is easy to see
                                                         that for the same number of viewers as a
                                                         traditional media such as TV, this method
                                                         doesn’t scale.

Broadcast                                                Multicast

Broadcast is an easy way to send information to          Multicast was developed as a compromise,
a group of people in a network. The word                 which combines the best features of the two
“broadcast” means to send something in all               previously mentioned methods of sending data
directions at the same time. To avoid flooding           over a network. It saves a lot of bandwidth by
the network broadcasts are limited to the local          not sending redundant information. By routing
network and won‟t be passed outside by a router.         the multicast traffic through the network and not
This method of sending data saves a lot of               forwarding the traffic to networks without
bandwidth since the sender only needs to send a          members, non-members won‟t get disturbed.
single packet for every broadcast. It is ideal for
information intended for all computers connected                          Sender
to a local area network (LAN).

The limited range of broadcasts makes them
unsuitable for digital audio/video broadcasts over
the Internet. Another problem with broadcasting
information is that people who aren‟t members
of the group still receive a copy of the
information. For them this is an inconvenience                             Router
since they aren‟t interested in the information.


                                                                   Members             Non-member

                                                         The figure shows how data is distributed to a
                                                         group of people using multicast.

                                                         The standard for IP multicast is ready, but
                                                         multicasting won‟t work over the existing
                                                         architecture of the Internet since most routers
                                                         and other network equipment in use don‟t
          Members            Non-member                  support multicast yet. Multicasting requires a
                                                         path of multicast-enabled routers from the source
                                                         to the destination(s), however it is possible to
The figure shows how data is distributed to a            tunnel traffic through regular routers between
group of people using broadcast. This approach           “islands” of multicast-enabled routers. This is
floods the network with traffic and disturbs non-        how the MBONE works.
                                                         The functionality missing in routers today, is the
                                                         ability to route multicast traffic over the Internet
                                                         and to split (duplicate) packets when they need to
                                                         be sent out on more than one port. The routing
                                                         algorithms need to be standardized so that all
                                                         multicast-enabled routers are compatible with
                                                         each other. It is needed before digital audio/video
                                                         broadcasts over the Internet can scale to the same
                                                         amount of viewers as traditional media.

Group management                                           can be extended to also send information about
                                                           group memberships to their neighbors. Every
As proposed in RFC 1112 written by Steve                   router will then have a complete map of the
Deering in 1989, “IP Multicasting is the                   network‟s topology and can with this information
transmission of an IP datagram to a „host group‟,          compute the shortest path tree between senders
a set of zero or more hosts identified by a single         and receivers. However, the periodically sent
IP destination address.”.                                  group membership information to the
                                                           neighboring routers will create a huge amount of
For this purpose all IP addresses in the range             traffic on wide area networks. Also, it would be - have been reserved             very difficult for a router to compute the Dijkstra
for multicast groups. The class D IP addresses             calculation for the shortest path tree for every
can easily be identified by their high-order four          sending source.
bits, which are set to 1110. The rest of the bits
are used to specify an arbitrary multicast group.
Even though no single router in a network has              Distance-Vector routing
knowledge of exactly who the members of a
multicast group are, it has to be possible to join         Since link-state routing doesn‟t scale, multicast
and leave a group at any time. There are no                utilizes distance-vector routing. It works like RIP
restrictions on the location or number of                  (Routing Information Protocol) where each
members in a multicast group and it is possible            router maintains a routing table, containing every
to be a member of more than one group at a time.           reachable destination in the internetwork, where
                                                           a destination can be a single host, a single subnet
Anyone can send data to a multicast group but in           or clusters of subnets. A routing table entry
order to receive the data stream hosts first have          contains information about the distance to a host,
to join the group using the Internet Group                 a next-hop-address that is the address to the next
Management Protocol (IGMP). The protocol                   router in the path to the packet‟s destination. It
makes it possible for hosts to inform local                also contains a next-hop-link, which is a local
multicast routers, that they want to receive               identifier to reach the next-hop-address.
messages addressed to the specified multicast              Furthermore it has an age field, used to timeout
group. The router periodically sends a                     destinations that become unreachable. When
”membership query” to adjacent routers to learn            something happens on the network, the routers
the existence of multicast group members on                inform their neighboring routers, e.g. if a new
their directly attached subnets. It is also possible       shortest path to a destination is offered, the
to leave the group by sending a ”leave group”              router will update its table with this new cost.
message to the router. This message is optional            We will not describe distance-vector routing
since a host‟s membership will eventually                  further, since there are lots of well-written
timeout.                                                   documents about this topic on the Internet.
                                                           Instead we will try to describe some distance-
                                                           vector based multicast protocols.

Multicast routing
Multicast is really all about routing. The goal is
to create an optimal spanning tree of receivers,           RPF, or Reversed Path Forwarding, is a very
but how to achieve this is a completely different          simple technique to send packets to all nodes in
thing. We will now try to describe different               the network. The idea is to forward incoming
techniques trying to achieve this.                         packets on all outgoing links, except the link
                                                           where the packet just arrived on. If an arriving
                                                           packet is not the shortest path from the sender,
Link-State routing                                         the packet has or will pass the router from the
                                                           shortest path and the packet can be discarded.
Routers with link-state functionality periodically         This will avoid cycles. RPF has two major
send and receive information to/from their                 drawbacks, the first is that it generates a lot of
neighbors and then propagate this information              unnecessary traffic. Many of the routers have
throughout the network. The link-state algorithm           probably no members in the group the multicast

packet was addressed to. Secondly, a LAN will             TRPB
be flooded with the same packet by each of the
routers connected to it.                                  Truncated Reversed Path Broadcast is an
                                                          extension to RPB. Neither RPF nor RPB take
                    Host                                  group membership into account, they will simply
                                                          flood all networks whether or not they have hosts
                                                          who are members of the group the multicast was
                   Source                                 sent to. TRPB implements a Group Membership
             1                  2                         Report Protocol (GMRP). This is accomplished
                       2                                  by first recognizing which routers are leafs in the
  Router 1           LAN            Router 2              network. If the previously described parent
                                                          router discovers that it is the only router in the
                                                          network, then the network is a leaf. Each host on
Host issues the multicast and Source is the               the network will have to periodically tell the
Host’s router. From now on we will discard the            router that it is a member of a certain group. The
host, since the exact host is irrelevant. The links       router stores this information and compares it
have been labeled with their cost, so we can see          with incoming multicast packets. If the packet‟s
who the shortest path from the sender is. When            destination matches a group stored in the router,
the packet from Router 1 arrives at Router 2,             the packet will be broadcast on the network.
Router 2 will discard this packet since it’s not          Otherwise, no broadcast will be sent.
the shortest path from the sender and vice versa.         Additionally, one must decide how often to send
                                                          the group membership reports. If they are sent
                                                          often, it will generate extra traffic on the
RPB                                                       network. If they are sent rarely, the network will
                                                          receive unnecessary traffic after no hosts are left
RPB is short for Reversed Path Broadcast, which           who want to receive packets addressed to the
is a small improvement to RPF. It handles the             group. In practice, every few minutes seems like
last mentioned problem, by assigning each link a          a good idea. An optimization is that hosts on the
parent. Only the parent is allowed to send data           same LAN can discover that other hosts are
over the link, so RPB requires some extra                 members in the same group and can discard their
communication between the routers if the link             membership reports, since the router only needs
has two or more routers connected to it. The              one membership report message to keep
routers negotiate who should be the parent. This          broadcasting incoming multicast packets to that
is decided by comparing which of the routers              group.
who has the shortest path to the sender of the
multicast packet. The router with the shortest
path is selected as the parent, since this is the                                 S
optimal router. If there is a tie between the
routers, the one with the lowest address is                           R1                    R2

              1                     2
                                                              R3           R4         R5           R6

   Router 1           LAN           Router 2
                                                          Router 6 is a leaf and has no members in the
                                                          group, which the Source sent the multicast to.
Since Router 1 has the shortest path to the               Therefore it will inform Router 2 to not forward
Source and hence is the parent, only Router 1             packets addressed to this group.
will broadcast to the LAN.

RPM                                                       PIM
Reversed Path Multicast (RPM) is an                       Protocol Independent Multicast or PIM has two
optimization to TRPB. If Router 2 in the                  modes, sparse mode and dense mode. PIM dense
previous example discovers that neither Router 5          mode is designed for many receivers in the
nor Router 6 wants to receive packets to the              local/global network and works like DVMRP
specified group, it can then tell the router higher       with flooding and pruning. PIM sparse mode
up in the shortest path tree to not send messages         (PIM-SM) was developed due to the scaling
destined to the group to Router 2. The routers            problem mentioned earlier. In wide area
higher up in the hierarchy will go through the            networks where a relatively small part of the
same process, and so on. This procedure is                networks want to receive traffic from a specific
known as pruning and will eliminate a lot of              group (which is the most common type of group
unnecessary branches, i.e. traffic. If a host later       in wide area networks), sending traffic to every
joins a group, it will then have to inform the            router until they explicitly ask to be removed is
router, which informs the other routers etc, so           not a very good idea.
they can receive packets from this group again.
This is known as grafting.                                PIM-SM allows routers to explicitly join and
                                                          leave multicast groups by sending the PIM
                                                          protocol messages: Join and Prune. To send
                         S                                those messages the network provider must
                                                          configure one or more special routers within
            R1                      R2                    their network to act as a Rendezvous point (RP).
                                                          The RP will handle the group management
                                                          within the domain.
                                    x      x
                                                          A host on the network, who wants to join a
     R3           R4         R5           R6              group, must send a Join message to the RP to
                                                          receive packets addressed to this group. This can
Pruning example. No packets to the multicast              be compared to PIM-DM and the other multicast
group will be forwarded down the right branch.            protocols, which will send packets to every
                                                          router whether they want to receive packets
                                                          addressed to that group or not. This is a good
DVMRP                                                     idea if most of the hosts in a network want to
                                                          receive packets to that group, but mostly this is
Distance Vector Multicast Routing Protocol                not the case. When the Join message goes
(DVMRP) is based on RIP, but DVMRP is                     through the routers on its way to the RP, a
extended to also be able to manage multicast.             multicast forwarding tree is built. There are two
The multicast algorithm was initially TRPB, but           types of trees. A shared tree, which may be used
is now RPM. When a DVMRP compatible router                by all senders and a source-specific tree, which
receives a unicast packet, RIP will be used as            may only be used by a specific sending host.
routing protocol. If the arriving packet is a             When a router sends a Join message towards the
multicast packet, then the multicast algorithm            RP for a certain group, it is sent by unicast. The
will be used. When we described the tunneling             Join message passes a number or routers on its
technique used in the MBONE routers, we                   way to the RP. Each router looks at which
actually described the tunneling technique in             interface the Join message came in and will now
DVMRP, since the MBONE routers uses                       forward packets sent to this group on that
DVMRP. DVMRP is the most widely used                      interface. It will then send the Join message
multicast protocol in routers today, but like the         toward the RP. When the Join arrives at the RP
other multicast protocols, DVMRP also has some            the tree branch is completed. This is called a
problems. One problem is that it doesn‟t scale            shared tree.
well on sparsely distributed multicast groups.


                                                                   R1                      R2
          R1                      R2

                                                           R3           R4            R5          R6
  R3            R4           R5         R6

                                                         The figure shows the previously described
Router 6 sends a Join message to RP using                tunneling from Router 4 to RP, and then the
normal IP unicast transmission.                          multicast sent from RP out on the shared tree.

                                                         This way we can pretty efficiently send multicast
                       RP                                traffic only to routers that want to receive
                                                         packets destined to the group. However, if
           R1                     R2                     Router 4 is sending a lot of traffic, the tunneling
                                                         procedure is a bit ineffective. RP will make a
                      Join                               decision upon the amount of traffic received
                                                         from Router 4. If the load reaches a certain level,
   R3           R4           R5          R6              the RP will send a Join message to Router 4. As
                                                         this Join message passes the routers on its way
                                                         down, they will learn about this group and set up
If another router, Router 5, wants to join the           forwarding tables for this new group so that
group, it simply sends another Join message to           multicast, instead of tunneling, can be performed
RP. The difference this time, is that Router 2           between Router 4 and RP.
doesn’t have to forward the Join message to RP,
since RP already knows it should forward traffic
destined to this group to Router 2. If Router 6 by
some reason wants to leave the group, it can
send a Prune message to Router 2, which will                         R1                      R2
stop forwarding traffic to the group to Router 6.                             Join
If Router 5 also wishes to leave the group,
Router 2 can send a Prune message to RP.
                                                             R3           R4           R5           R6
The purpose of this process is to build a tree,
where RP is the root.
                                                         RP sends a Join message to Router 4 and Router
Suppose that a host on a LAN belonging to                1 and 4 will set up their forwarding tables. Now
Router 4 wants to send a multicast message to            we have created a specific route for the sending
the group. Since no paths are built between              Router 4 and the new tree is called a source-
Router 4 and the RP, Router 4 can‟t simply send          specific tree as mentioned in our PIM
a multicast message directly to the group. Instead       introduction.
it has to tunnel it to RP. It encapsulates the
multicast packet into another IP packet and sends        The next optimization follows from the new
it to RP with an unicast message. RP looks inside        source-specific tree. The path between Router 4
the packet and knows what to do with it, and             to RP and to Routers 5 and 6 is probably not the
sends it out as a multicast on the shared tree.          shortest path. A router might discover some
                                                         heavy traffic coming from a source and therefore
                                                         sends a Join message towards the source.

                      RP                                 election algorithm and the most suitable client
                                                         would be the new server, based on certain
                                                         requirements, such as uptime, bandwidth, latency
          R1                      R2
                                                         etc. The traffic from the clients would then be
                     Join                                routed through the temporary servers. When a
                                                         client submits a search-request to a server, it
                                                         would increase performance greatly if the server
   R3           R4          R5           R6              could transmit the search-request to all its clients
                                                         by multicast. This would work in a perfect world.
                                                         However, as we will see shortly, this was not the
Router 6 and/or Router 5 send a Join message to          case in the global Internet.
the source, in this case Router 4. The link
between Router 1 and Router 2 will now also be
source-specific. The packets sent to the group           Test implementation
from Router 4 will now no longer go through
RP; instead it will take the new, shorter source-        We have managed to implement two very simple
specific tree between Router 1 and Router 2.             multicast programs by studying various sources
                                                         and more concrete IP multicast information. The
The new tree will spare the RP and the network a         first program (sender.c) sends messages to a
lot of unnecessary traffic. However, we cannot           group and the second program (receiver.c) tries
eliminate the shared tree, since new senders to          to receive messages from that group. We have
the group might show up. We should also note             tested it on Solaris, Linux (Debian) and AIX,
that a shared tree is much more scaleable than           where Solaris would be the preferred OS. The
source-specific trees, since a shared tree allows        Linux machine refused to receive packets unless
the number of states in the routers to be equal to       a Solaris machine on the same subnet also
the number of groups. The same amount of                 received messages from the same group. When
source-specific trees would require the routers to       executed on an AIX machine the program could
have as many states as the number of groups              stall for some time for unknown reasons.
times the number of senders. However, source-
specific trees are still necessary to achieve a          Before we knew how multicast was implemented
more efficient routing.                                  in today‟s routers (or lack of implementation),
                                                         we tried to multicast to different parts of
We can now get a clearer picture of what                 Sweden, Europe and the rest of the world
protocol independent means. How the previously           without any success. The problem was simple:
described tree building is performed, when               most routers didn‟t have support for multicast
choosing the shortest path and sending Join              and didn‟t forward any multicast packets at all.
messages, is up to the unicast routing protocol          Therefore we tried it only within the Swedish
that is used within the domain.                          University Computer Network (SUNET) where
                                                         approximately ten universities support multicast.
                                                         The routers probably utilize DVMRP and
Multicast in practice                                    perform multicast by broadcast as a temporary
                                                         solution, which means that a lot of unnecessary
There has been a lot of talk lately about                traffic will be sent.
multicast, but no one seems to know how it
really works in practice. The main reason why            We were able to send multicast messages
we wanted an answer to that was to see if it was         between the following networks
applicable in our master thesis. We plan to
implement an ad-hoc network, which could                         0 hops
easiest be explained as a mutation between                      2 hops
Napster and Gnutella. With Napster‟s server                      2 hops
thinking and Gnutella‟s decentralized thinking.             7 hops
The plan was to have a decentralized network,
but upgrade some clients to servers if the               Where hops are the number of routers passed.
network required more servers. The new server
would be elected through some distributed

In the program you are allowed to set a Time To          Conclusions
Live (TTL) option, to minimize the multicast
traffic. For simplicity, we chose to set the value       There are still a lot of problems with multicast:
to 255, but the table below shows how to                 End users haven‟t become interested in support
properly choose TTL.                                     for multicast in networks since no killer
                                                         applications require it, and system administrators
TTL table                                                claim that applications aren‟t using multicast
0      restricted to the same host                       anyway, which leads to a Catch 22. If the routers
1      restricted to the same subnet                     don‟t support multicast, software developers
<32    restricted to the same site                       won‟t be able to write applications that utilize
<64    restricted to the same region                     multicasting.
<128   restricted to the same continent
<255   unrestricted                                      Multicast-enabled routers and equipment is
                                                         available but not yet widely in use, due to
The source code is attached as an appendix.              increased hardware costs and extra time for
                                                         technicians     configuring     them.    Another
                                                         configuration problem is that most firewalls deny
Real life examples                                       all UDP traffic (for security reasons), which all
                                                         multicast traffic is sent with. This makes it
The need for multicast is often associated with          possible to multicast in Intranets, but not to
push technologies such as streaming audio/video,         exchange multicast traffic globally.
but we have also found other application areas in
distributed systems, which benefit greatly from          Despite all problems, multicast is a simple, but
multicast and are in use today.                          brilliant idea. It has an enormous potential and
                                                         we believe that multicast is necessary to allow
Toys R Us were able to reduce the time required          the Internet to scale, and to continue its
for sending out software upgrades to their 865           expansion and development.
stores nationwide from 6 hours to 4 minutes,
after switching to multicast.

General Motors reduced the time required for
sending out software upgrades to their 8900 GM
auto dealerships from 3 hours to about 20

The New York Stock Exchange didn't want any
one trader to have information any more than
five to ten milliseconds sooner than any other
trader. In order to meet those requirements they
built a new network, using multicast to distribute
the information.

We don‟t know exactly how every company
have implemented multicast. Maybe they use the
described tunneling technique or have managed
to see that every router on the way have support
for multicast. In any case, it works and has
boosted performance significantly.

Larry L. Peterson & Bruce S. Davie – Computer Networks - a Systems Approach, 2nd edition.

rfc1075 - Distance Vector Multicast Routing Protocol
rfc1112 - Host Extensions for IP Multicasting

Internet Protocol Multicast Technology Overview

How IP Multicast Works

Multicast over TCP/IP HOWTO

Multicast Routing in Internetworks and Extended LANs – Stephen E. Deering.

Multicast Routing in Datagram Internetworks and Extended LANs

Frequently Asked Questions on the Multicast Backbone (MBONE)

News articles
How multicast is changing the world

IP multicast: necessary for the Internet to become a viable broadcast medium


Killer network apps that aren't network killers

Multicast to the masses


To top