## 3 System Design
### Multicast Tree Generation Procedure
#### 3.5.3 Path Calculation  
When calculating multicast routing and constructing multicast delivery tree, four cases should be considered.  
* Case 1: No multicast source, multiple multicast receivers;
* Case 2: One multicast source, multiple multicast receivers;
* Case 3: Multiple multicast sources, multiple multicast receivers;
* Case 4: One or more multicast sources, no multicast receiver.  
In case 1, 2, and 3, CCSM will first elects a root and then constructs the SPT, and forwards the multicast packets along the SPT. When a new multicast source joins the multicast group after it finished the multicast source registration procedure, it will first forward the new multicast packets to the root, and then the root will forward the packets to multicast receivers along the SPT. When the packets from the new multicast source arrive the ASR, ASR will look up its multicast routing table. If this access network exists the receivers of that group, ASR will forward the multicast packets to local receivers. For the receivers in this group who are located in other access networks, ASR will forward the multicast packets to root.  
In case 4, when multicast source joins a multicast group, the related MMC will find out that there is no multicast receiver in the group, and it will then notify the ASR which multicast source attached. The ASR will discard the multicast packets from the multicast source.  
The main work of multicast routing is to calculate the SPT. Figure 8 shows the construction procedure of SPT. For a given multicast group, once the root is selected, the SPT from root to each multicast members is easy to calculate. During the calculation, some QoS requirements such as bandwidth/delay can also be considered to satisfy the different application scenarios.  
The input information include network topology, node states set, group member set and multicast policy set. Node states record the node overload, resource utilization ratio and so on. Multicast policy such as QoS requirement, and security requirement is used to filter the network topology. The changes of network topology, node state, group member and multicast policy will trigger the filter procedure. Group member set is a set of ASRs which have the multicast receivers. Root election performs the procedure as described in Section 3.5.2. Based on the root and group member set, SPT can be computed based on Dijkstra algorithm [67]. After that, MMC generates and distributes the multicast routing table to ASR/CR on the SPT. In fact, CCSM can select several roots and calculate the SPTs to every ASR and store these SPTs. In this way, CCSM can greatly reduce the time cost when constructing paths for multicast groups.  
Once multicast member joins or leaves the group, the SPT will be changed. In this case, MMC has to update the multicast delivery tree. The update procedures are described as follows.  
1. New multicast member join procedure  
When a new multicast member joins the group, it will send a join message to ASR to update the membership in the related MMC (notice that every new multicast member should perform the registration and authentication at first to verify its legality). If the ASR has been included in the SPT, the multicast data will delivery to the new member directly. Otherwise, the MMC has to update the multicast delivery tree by calculating a shortest path between this ASR and multicast delivery tree, and distributes the multicast routing information to related CRs.
2. Multicast member leave procedure  
When a multicast member wants to leave the group, it will send a leave message to ASR. ASR will update the membership at first, and then sends a specific-group query to check whether there are other members in this access network. If the access network does not have other members, it will notify the related MMC to update the multicast delivery tree. Otherwise, it updates the multicast routing lifetime.  
Figure 8: The construction procedure of the path for multicast routing.