# An Adaptive Hierarchical Hybrid Multicast Based on Information-Centric Networking
## 4 Multicast Mechanism
### MJN Selection  
In AHHM, NRS maintains the mapping between each MGEID and NAs of the corresponding MJNs. When the RER is notified that the receiver connected to it wants to join a multicast group, it can obtain MJNs through NRS and then select a suitable MJN to join according to different strategies. For example, the RER can simply select the nearest MJN from the resolved MJNs to join. To balance distance, forwarding state, and link load, we also designed a minimum cost MJN selection strategy. The comprehensive cost is expressed as Equation (1). \[\text{cost}=\alpha.\frac{D}{D_{max}}+\beta.\frac{PS}{S_{max}}+\gamma.\frac{PT} {T_{max}},\ (\alpha+\beta+\gamma=1) \tag{1}\]  
\(D\) is the distance from the user to the MJN. \(D_{max}\) is the network diameter that is defined as the distance between the two farthest nodes in the network. \(S_{max}\) is the maximum number of entries that the NFT of the router can support. \(T_{max}\) is the bandwidth of the link. We traverse the routers on the path from the MJN to the RER until the NFT load of a router reaches the threshold. The maximum NFT entry number of the traversed routers is defined as the value of the path states (PS). We use the maximum link load on the path from the MJN to the RER as the value of the path traffic (PT). The RER can select the MJN with the minimum comprehensive cost according to Algorithm 1. For each MJN, the RER first calculates the path from MJN to it (line 4). Second, the RER checks whether intermediate nodes of the path contain the MJN corresponding to the multicast group. If so, the RER discards the MJN (lines 5-10). Third, the RER calculates the PS (lines 12-18) and PT (lines 19-23) corresponding to the MJN. Fourth, the RER calculates the cost corresponding to the MJN according to the given parameters (line 24). Finally, the RER chooses the MJN with the minimum cost as the target MJN to join. ```
**Algorithm 1**Minimum Cost MJN Selection Algorithm
``` Input: \(\{MN\}\) Output: \(M\)\(N_{sel}\)
1:Initialization:\(M\)\(N_{sel}=\varnothing,C_{min}=\infty\), \(D_{max}\), \(S_{max}\), \(T_{max}\), \(\alpha\), \(\beta\), \(\gamma\),
2:for each \(MTN\) in \(\{MN\}\)do
3: Initialize \(C=0\), \(PS=0\), \(PT=0\), \(Flag=\) True
4: Obtain the path from the \(M\)\(J\)\(N\) to the user
5:for each router on the path do
6:if the router in the \(\{MN\}\)then
7:\(Flag=\) False
8: break
9:endif
10:endfor
11:if\(Flag=\) True then
12:for each router on the path do
13:if the NFT entry number of the router reaches the threshold then
14: Break
15:elseif the NFT entry number of the router is larger than \(PS\)then
16: Set the \(PS\) to the NFT entry number of the router
17:endif
18:endfor
19:for each link on the path do
20:if the load of the link is larger than \(PT\)then
21: Set the \(PT\) to the load of the link
22:endif
23:endfor
24:\(C=\alpha\cdot\frac{D}{D_{max}}+\beta\cdot\frac{PS}{S_{max}}+\gamma\cdot\frac{PT} {T_{max}}\)
25:if\(C<C_{min}\)then
26:\(C_{min}=C\), \(M\)\(J\)\(N_{sel}=M\)\(J\)\(N\)
27:endif
28:endif
29:endfor
30: return \(M\)\(J\)\(N_{sel}\) ```  
**Algorithm 1**Minimum Cost MJN Selection Algorithm  
However, RER needs to detect the status of routers and links when using the maximum cost MJN selection strategy, which will increase signaling overhead. Therefore, this strategy is more suitable for use in the Software-Defined Network (SDN) environment, where the controller has global network status information. We took the scenario shown in Figure 4 as an example to describe the minimum cost MJN selection strategy in detail. The receiver R informs N4 that it wants to join the multicast group identified by MGEID\({}_{1}\). Since N4 does not maintain the NFT entry corresponding to MGEID\({}_{1}\), N4 queries the NRS for the MJN list of the group. NRS returns N\({}_{M\text{JN1}}\) and N\({}_{M\text{JN2}}\) to N4. Then, N4 selects a suitable MJN to join according to the given MJN selection strategy.