31.1 Multicast API

Multicast forwarding requires enhancements
to the nodes and links in the topology.
Therefore, the user must specify multicast requirements
to the Simulator class before creating the topology.
This is done in one of two ways:

When multicast extensions are thus enabled, nodes will be created with
additional classifiers and replicators for multicast forwarding, and
links will contain elements to assign incoming interface labels to all
packets entering a node.

A multicast routing strategy is the mechanism by which
the multicast distribution tree is computed in the simulation.
ns supports three multiast route computation strategies:
centralised, dense mode(DM) or shared tree mode(ST).

The method []mrtproto in the Class Simulator specifies either
the route computation strategy, for centralised multicast routing, or
the specific detailed multicast routing protocol that should be used.

The following are examples of valid
invocations of multicast routing in ns:

Notice in the above examples that CtrMcast returns a handle that can
be used for additional configuration of centralised multicast routing.
The other routing protocols will return a null string. All the
nodes in the topology will run instances of the same protocol.

Multiple multicast routing protocols can be run at a node, but in this
case the user must specify which protocol owns which incoming
interface. For this finer control []mrtproto-iifs is used.

New/unused multicast address are allocated using the procedure
[]allocaddr.

The agents use the instance procedures
[]join-group and []leave-group, in
the class Node to join and leave multicast groups. These procedures
take two mandatory arguments. The first argument identifies the
corresponding agent and second argument specifies the group address.