# M-Emu: A Platform for Multicast Emulation
## 4 Validation
### Case Study
#### 4.2.6 Code Complexity

In this section, we make a comparison between M-Emu and NS4 in terms of the code complexity (number of lines of code). Since M-Emu is an improvement on NS4, M-Emu has much more code on both the control plane and data plane than does NS4. The results are shown in Figure 4:6

Figure 4:7 Packet process time. Figure 4:8 Execution time. We only counted the amount of code in the source file. It can be seen that the code quantity of M-Emu is larger than that of NS4 in all modules. In the forwarding module, because M-Emu only adds ports to the service module, there is not much more code than for NS4. As NS4 has no service module, the code quantity of its service module is 0. However, M-Emu has the multicast simulation function deployed in the service module, and thus the code quantity is much larger than NS4. ## 5 Conclusions

We designed and implemented a multicast emulation platform M-Emu based on NS4. M-Emu contains the Service-Forwarding Architecture, which enabled the data plane of M-Emu to process multicast scheduling tasks and deploy complex protocols and functions. A Multicast-Emulation Framework was deployed in M-Emu, which had a complete multicast tree construction and maintenance mechanism. The framework constructed all existing network layer multicast tree structures and flexibly adjusted the position of RPs and GPs to support more complex tree structures. M-Emu mainly provides the DR and cRP deployment interface, GP-selection method interface, RP-selection method interface, state reduction interface, etc., which enable users to examine the multicast algorithm conveniently. We took the emulation of PIM-SM as an example to explain in detail how the various parts of M-Emu cooperate to complete the multicast emulation, and we proved that M-Emu is efficient in CPU utilization, memory consumption, etc., through a large number of experiments. In the future, we will further improve the function of the service module to provide support for the experiment of multicast security and reliability. Conceptualization, Z.T., J.Y. and H.N. ; methodology, Z.T. and J.Y. ; software, Z.T. ; writing--original draft preparation, Z.T. ; writing--review and editing, Z.T. and J.Y. ; supervision, J.Y. and H.N. ; project administration, J.Y. and H.N. ; funding acquisition, J.Y. and H.N. All authors have read and agreed to the published version of the manuscript. This work was funded by (1) the National Key R&D Program of China: Polymorphic Intelligent Network Environment (PINE) for Testing and Demonstrations (Project No.2020 YFB1806402); (2) the Strategic Leadership Project of the Chinese Academy of Sciences: SEANET Technology Standardization Research System Development (Project No. XDC02070100). Not applicable. Data Availability Statement: Data sharing is not applicable to this article. We would like to express our gratitude to [PERSON], [PERSON] and [PERSON] for their support of this work. The authors declare no conflict of interest. ## References

* [PERSON] and [PERSON] (2002) [PERSON]; [PERSON] Survey of multicast routing algorithms and protocols. In Proceedings of the Fifteenth International Conference on Computer Communication (ICCC 2002), Mumbai, India, 12-14 August 2002; pp. 902-926. * [PERSON] et al. (2000) [PERSON]; [PERSON]; [PERSON]; [PERSON] [PERSON]; [PERSON] [PERSON] A Survey of Multicast Technologies; Work in Progress; Chicago, IL, USA, 2000. Available online: [[https://home.nr.no/~abie/Papers/sota_mcast.pdf](https://home.nr.no/~abie/Papers/sota_mcast.pdf)]([https://home.nr.no/~abie/Papers/sota_mcast.pdf](https://home.nr.no/~abie/Papers/sota_mcast.pdf)) (accessed on 1 March 2022). * [PERSON] et al. (2018) [PERSON]; [PERSON]; [PERSON] Multicasting in software defined networks: A comprehensive survey. _J. Netw. Comput. Appl._**2018**, _104_, 61-77. [CrossRef] \begin{table}
\begin{tabular}{c c c c} \hline
**Emulators** & **Control Plane** & **Forwarding Module** & **Service Module** \\ \hline NS4 & 360 & 265 & 0 \\ M-Emu & 1210 & 350 & 2045 \\ \hline \end{tabular}
\end{table} 
Table 3: Code complexity.