11. Detailed description of multicast datagram forwarding
This section describes in detail the way MOSPF forwards a multicast datagram. The forwarding process has already been informally presented in Section 2.2. However, there are several obscure configuration options (e.g., the IPMulticastForwarding interface parameter) that have been presented elsewhere in this document, which may influence the forwarding process. This section gathers together all the influencing factors into a single algorithm.
It is assumed in the following that the datagram under consideration has actually be received on one of the router's interfaces. Locally generated datagrams (i.e., originated by one of the router's internal applications) are handled instead by the algorithm in Section 11.3. Assume that the datagram's IP destination is Group G. The forwarding process then consists of the following steps:
(1) Upon reception of the datagram, the MOSPF router notes the following parameters. These parameters are examined in later steps, to determine whether the datagram should be forwarded.
a. The receiving MOSPF interface associated with the datagram. Based on the receiving physical interface, the receiving MOSPF interface is selected by the algorithm in Section 11.1.
b. Whether the datagram was received as a link-level multicast/broadcast or as a link-level unicast. This information is used later in Step 7 to help determine whether the datagram should be forwarded.
(2) A copy of the datagram should be passed to each internal application that has joined Group G on the receiving MOSPF interface (see Section 5).
(3) If the datagram's IP source address matches the receiving MOSPF interface's IP address, the datagram should not be forwarded further, and should instead be discarded, completing the forwarding process. This keeps the router's own locally originated datagrams from being mistakenly replicated, in those cases where the receiving MOSPF interface receives its own multicast transmissions.
(4) If Group G falls into the range 224.0.0.1 through 224.0.0.255 inclusive, the datagram should not be forwarded further. This range of addresses has been dedicated for use on a local network segment only.
(5) Associate a source network (SourceNet) with the multicast datagram, as described in Section 11.2. If SourceNet cannot be determined (i.e., there is no available unicast route back to the datagram source), the datagram should not be forwarded further.
(6) Look up the forwarding cache entry (see Section 8.5) matching the datagram's [SourceNet, Group G, TOS] combination. If the cache entry does not yet exist, one is built by the calculation in Section 12. In order for the datagram to be forwarded, the contents of the forwarding cache entry must be further verified against the received datagram's characteristics as follows: a. If the forwarding cache entry's upstream node is unspecified (i.e., NULL), then the datagram should not be forwarded further.
b. Otherwise, suppose that the forwarding cache entry's upstream node is set to EXTERNAL. In this case, the datagram is forwarded further if and only if the receiving MOSPF interface is set to NULL (i.e., if and only if the datagram was received on a non-MOSPF interface).
c. Otherwise, if the datagram's receiving MOSPF interface does not attach to the forwarding cache entry's upstream node, the datagram should not be forwarded further.
(7) If the receiving MOSPF interface's IPMulticastForwarding parameter is set to data-link unicast, the datagram should be forwarded further only if it was received as a data-link unicast.
(8) At this point the datagram is eligible for further forwarding. Before forwarding, the router checks to see whether it has any internal applications that have joined Group G on an interface-independent basis. If so, a copy of the datagram should be passed to each such requesting application process.
(9) Examine each of the downstream interfaces listed in the forwarding cache entry. If the TTL in the datagram is greater than or equal to the TTL specified for the downstream interface, a copy of the datagram should be forwarded out the downstream interface. Before forwarding the datagram copy, the copy's TTL should be decremented by 1. On most interfaces, the datagram is forwarded as a data-link multicast/broadcast. The exact data-link encapsulation is dependent on the attached network's type:
-
On ethernet and IEEE 802.3 networks, the datagram is forwarded as a data-link multicast. The destination data-link multicast address is selected as an algorithmic translation of the IP multicast destination. See [RFC 1112] for details.
-
On FDDI networks, the datagram is forwarded as a data-link multicast. The destination data-link multicast address is selected as an algorithmic translation of the IP multicast destination. See [RFC 1390] for details.
-
On SMDS networks, the datagram is forwarded using the same SMDS address that is used by IP broadcast datagrams. See [RFC 1209] for details.
-
On networks that support broadcast, but not multicast (e.g., the Experimental Ethernet), the datagram is forwarded as a data-link broadcast. See [RFC 1112] for details.
-
On point-to-point networks, the datagram is forwarded in the same way that unicast datagrams are forwarded. See [RFC 1112] for details.
(10) Examine each of the downstream neighbors listed in the forwarding cache entry. If the TTL in the datagram is greater than or equal to the TTL specified for the downstream neighbor, a copy of the datagram should be forwarded to the downstream neighbor (as a data-link unicast). Before forwarding the datagram copy, the copy's TTL should be decremented by 1.
ICMP error messages are never generated in response to received IP multicasts. In particular, ICMP destination unreachables and ICMP TTL expired messages are not generated by the above procedure if the router refuses to forward a multicast datagram.
11.1. Associating a MOSPF interface with a received datagram
A MOSPF interface must be associated with a received multicast datagram before it is forwarded (see Step 1a of Section 11), and with received IGMP Host Membership Reports before they are processed (see Section 9.2).
When there is only a single IP network assigned to the physical interface that received the datagram, the choice of receiving MOSPF interface is clear. When there are multiple logical IP networks attached to the receiving physical interface, the receiving MOSPF interface is selected as follows. Examine all of the MOSPF interfaces associated with the receiving physical interface. Discard those interfaces whose IPMulticastForwarding parameter has been set to disabled. The receiving MOSPF interface is then the remaining interface having the highest IP interface address (or NULL if there are no remaining interfaces)[19].
11.2. Locating the source network
MOSPF forwarding cache entries are indexed by the datagram's source IP network/subnet/supernet. For this reason, whenever an IP multicast datagram is received, the IP network belonging to the datagram's IP source address must be found. This is accomplished by the following algorithm: Look up the OSPF TOS 0 routing table entry[20] corresponding to the datagram's IP source address, as described in Section 11.1 of [OSPF]. If this routing table entry describes an OSPF intra-area or inter-area route, the source network is set to be the network defined by the routing table entry's Destination ID and Address Mask (see Section 11 of [OSPF]). Otherwise (i.e., the routing table entry specifies an external route, or there is no matching routing table entry), the list of matching AS external-link-LSAs is examined. A matching AS external-link-LSA is one that describes a network which contains the datagram's IP source address. The list of matching AS external-link-LSAs is pruned in the following steps to determine the source network:
(1) Those AS external-link-LSAs with MC-bit clear (see Section A.1), or with LS age set to MaxAge, or which have been originated by unreachable AS boundary routers are discarded.
(2) AS external-link-LSAs specifying Type 1 external metrics are always preferred over those specifying Type 2 external metrics.
(3) If there are still multiple AS external-link-LSAs remaining, those specifying the best matching (i.e., most specific) network are selected. The source network is then set to the network/subnet/supernet (possibly even the default route) described by the best matching AS external-link-LSAs. Note that AS external-link-LSAs specifying a cost of LSInfinity are eligible for this best match, as long as their MC-bit is set.[21]
It is possible that two different MOSPF routers may calculate the same multicast datagram's source network differently. For example, consider the network configuration shown in Figure 4. When calculating the source network for a datagram whose source is Network N10 and destination is Group Ma, Router RT11 would calculate the source network as Network N10 itself, while Router RT10 would calculate the source network as the aggregate of Networks N9-N11 and Host H1 (advertised in a single summary-link-LSA by Router RT11). However, despite the possibility of routers selecting different source networks, all routers will still agree on the datagram's shortest-path tree.
External sources are treated differently in the above calculation since it is likely that the Internet will have separate multicast and unicast topologies for some time to come. When the multicast and unicast topologies do merge, the MC-bit will be set on all AS external-link-LSAs and the above use of the LSInfinity metric (to indicate a route that is to be used for multicast traffic, but not unicast traffic), will no longer be necessary. At that time, the determination of source network for external sources will revert to the same simple routing table lookup that is used for internal sources.
As an example of the logic for external sources, suppose a multicast datagram is received having the IP source address 10.1.1.1. Suppose also that the three AS external-link-LSAs shown in Table 3 are in the router's OSPF database. The OSPF routing table lookup would yield the network 10.1.1.0 with a mask of 255.255.255.0, however the above calculation would choose a source network of 10.1.0.0 with a mask of 255.255.0.0, despite the fact that its matching LSA has a cost of LSInfinity.
11.3. Forwarding locally originated multicasts
This section describes how a MOSPF router forwards a multicast datagram that has been originated by one of the router's own internal applications. The process begins with one of the router's internal applications formatting and addressing the datagram. Forwarding the locally originated multicast then consists of the following steps:
(1) Find the router interface whose IP address matches the datagram's source address. Multicast the datagram out that interface, according to the Host extensions for IP multicasting specified in [RFC 1112].
(2) If the router interface found in the previous step has been configured for MOSPF, and if its IPMulticastForwarding parameter is not equal to disabled, then set the receiving MOSPF interface to that interface. Otherwise, set the receiving MOSPF interface to NULL.
(3) Execute the MOSPF forwarding process described in Section 11, beginning with its Step 4.
Network Mask Cost MC-bit ______________________________________________________ 10.1.1.0 255.255.255.0 Type 1: 10 clear 10.1.0.0 255.255.0.0 Type 2: LSInfinity set 10.0.0.0 255.0.0.0 Type 2: 1 set
Table 3: Sample AS external-link-LSAs The above algorithm amounts to the router always multicasting the datagram out the source interface, and the executing the basic forwarding algorithm (in Section 11) as if the datagram had actually been received on the source interface. In those cases where the router receives its own multicast transmissions, unwanted replication is prevented by Step 3 of Section 11. In fact, this specification has purposely presented the forwarding algorithm (both for received and for locally originated datagrams) so that the correct forwarding actions are taken independent of whether the router receives its own multicast transmissions.