+++ title = "Traffic analysis for 5G network" date = "2021-10-04T13:39:46+02:00" tags = ["5G"] categories = ["5G"] banner = "https://i.imgur.com/sYF31pa.jpg" +++ The Internet of things and 5G have been gradually popularized in the daily life of the general public. More and more intelligent home appliances have entered the family. Coupled with the frequent use of the Internet in life, network slice is becoming more and more mature, and the data traffic has increased dramatically. This paper selects the family as the research scene, combined with the Internet of things, and designs the family traffic analysis system, which can help family members understand the family's Internet traffic statistics, identify the invasion of malware or attacks and can also judge whether there is abnormal according to the sensor traffic data uploaded by home appliances, and solve the problem of traffic island. It has good expansibility, high recognition accuracy and easy integration. In this paper, we use experiment to compare different machine learning algorithms in feature selection. Different algorithms perform differently in different datasets. There is no absolutely good algorithm, but in this paper, because the dataset is not nonlinear, the Chi-square filtering algorithm has obvious advantages. In this paper, the accuracy rate is almost 100%, which provides a good model reference for the later actual traffic classification. At present, there are few studies on the combination of machine learning, traffic analysis, network slice and the Internet of things, and the function of adding sensor data to the Internet traffic participation classification is not implemented \[[1](https://jwcn-eurasipjournals.springeropen.com/articles/10.1186/s13638-021-01991-7#ref-CR1 "Y. Sun, S. Qin, G. Feng,L. Zhang, M.A. Imran, Service provisioning framework for RAN slicing: user admissibility, slice association and bandwidth allocation. IEEE Trans. Mob. Comput. pp. 99 (2020) "),[2](https://jwcn-eurasipjournals.springeropen.com/articles/10.1186/s13638-021-01991-7#ref-CR2 "G. Zhao, S. Qin, G. Feng, Y. Sun, Network slice selection in softwarization-based mobile networks. Trans. Emerg. Telecommun. Technol. 31(1), e3617 (2020)"),[3](https://jwcn-eurasipjournals.springeropen.com/articles/10.1186/s13638-021-01991-7#ref-CR3 "Y.J. Liu, G. Feng, Y. Sun, S. Qin, Y.C. Liang, Device association for RAN slicing based on hybrid federated deep reinforcement learning. IEEE. Trans. Veh. Technol. pp. 99 (2020)"),[4](https://jwcn-eurasipjournals.springeropen.com/articles/10.1186/s13638-021-01991-7#ref-CR4 "Y. Sun, W. Jiang, G. Feng, P.V. Klaine, L. Zhang, M.A. Imran, Y.C. Liang, Efficient handover mechanism for radio access network slicing by exploiting distributed learning. IEEE Trans. Netw. Serv. Manag. 17, 2620–2633 (2020)")\]. To solve this problem, under the background of 5G network slice, this paper proposes a home traffic analysis system combined with Internet of things \[[5](https://jwcn-eurasipjournals.springeropen.com/articles/10.1186/s13638-021-01991-7#ref-CR5 "Y. Mu, G. Feng, J.H. Zhou, Y. Sun, Y.C. Liang, Intelligent resource scheduling for 5G radio access network slicing. IEEE Trans. Veh. Technol. 68, 7691–7703 (2019)"), [6](https://jwcn-eurasipjournals.springeropen.com/articles/10.1186/s13638-021-01991-7#ref-CR6 "L.F. Yang, J.Y. Luo, Y. Xu, Z.R. Zhang, Z.Y. Dong, A distributed dual consensus ADMM based on partition for DC-DOPF with carbon emission trading. IEEE Trans. Ind. Inform. 16, 1858–1872 (2020)")\]. Firstly, this paper introduces the network slice of key role in 5G technology. Around the key concepts of machine learning and traffic analysis, it includes origin, development, features and forms \[[7](https://jwcn-eurasipjournals.springeropen.com/articles/10.1186/s13638-021-01991-7#ref-CR7 "Z.R. Zhang, Y. Yu, S.N. Fu, Broadband on-chip mode-division multiplexer based on adiabatic couplers and symmetric Y-junction. IEEE Photonics J. 9, 1–6 (2017)"),[8](https://jwcn-eurasipjournals.springeropen.com/articles/10.1186/s13638-021-01991-7#ref-CR8 "Z. Zhang, J. Li, Y. Wang, Y. Qin, Direct detection of pilot carrier-assisted DMT signals with pre-phase compensation and imaginary noise suppression. J. Lightwave Technol. 39, 1611–1618 (2020)"),[9](https://jwcn-eurasipjournals.springeropen.com/articles/10.1186/s13638-021-01991-7#ref-CR9 "H.M. Huang, Y. Yu, L.J. Zhou, Y.Y. Tao, J.B. Yang, Z.R. Zhang, Whispering gallery modes in a microsphere attached to a side-polished fiber and their application for magnetic field sensing. Opt. Commun. 478, 126366 (2020)"),[10](https://jwcn-eurasipjournals.springeropen.com/articles/10.1186/s13638-021-01991-7#ref-CR10 "H. Li, K. Ota, M. Dong, Learning IoT in edge: deep learning for the Internet of Things with edge computing. IEEE Netw. 32(1), 96–101 (2018)")\]. With the wide application of artificial intelligence in various industries, people can use the high-speed processing ability of computers to train a large amount of data, get a model to achieve traffic classification and finally apply it in practical situations \[[11](https://jwcn-eurasipjournals.springeropen.com/articles/10.1186/s13638-021-01991-7#ref-CR11 "S. Eugene, T. Thanassis, H. Wendy, Analytics for the Internet of Things. ACM Comput. Surv. 51(4), 1–36 (2018)")\]. This paper introduces the design and implementation of the home traffic analysis system combined with the Internet of things in detail and demonstrates its characteristics in the process of explaining it. The first is to create the Internet of things inside the smart home, using the sensor network architecture of ZigBee, collect data through the ZigBee node for each sensor device and finally collect data through the coordinator to the gateway, which forward the data to the server, thus realizing the traffic classification \[[12](https://jwcn-eurasipjournals.springeropen.com/articles/10.1186/s13638-021-01991-7#ref-CR12 "L. Yu, W. Wang, C. Runze, Zigbee-based IoT smart home system% the design of internet of things smart home system based on zigbee. Electron. Test. 000(005), 71–75 (2016)"),[13](https://jwcn-eurasipjournals.springeropen.com/articles/10.1186/s13638-021-01991-7#ref-CR13 "C. Mingwu, T. Guilin, Non-contact monitoring system for high-temperature industrial furnace based on internet of things technology. J. Hebei North Univ. (Natural Science Edition) 035(005), 42–45 (2019)"),[14](https://jwcn-eurasipjournals.springeropen.com/articles/10.1186/s13638-021-01991-7#ref-CR14 "Z. Kaisheng, T. Kaiyuan, L. Ming, L. Chao, Design of agricultural greenhouse environment monitoring system based on internet of things technology. J. Xi’an Univ. Sci. Technol. 035(006), 805–811 (2015)"),[15](https://jwcn-eurasipjournals.springeropen.com/articles/10.1186/s13638-021-01991-7#ref-CR15 "Z.H. Wu, Research on the application of internet of things technology to digital museum construction. Acta Geosci. Sin. 38(2), 293–298 (2017)")\]. In order to design and implement the system, this paper establishes a related experimental study. In the experiment, the flow dataset used for training is obtained, its data characteristics are analyzed by statistical analysis, it is filtered and cleaned, and the related algorithms of machine learning, including decision tree, random forest and regression, are used to train the flow data samples, and then, the test is carried out. Samples assess model performance. In order to verify the actual effect of the model, this paper uses the package software to capture the actual traffic data and send it to the model for evaluation and judgment, to measure the effect of the model according to the accuracy of the judgment. In order to compare the performance differences of different machine learning algorithms in the process of feature selection, this paper describes the feature selection of two different algorithms and measures them through experiments. The experimental data show that the Chi-square filter method can get better accuracy and better comprehensive performance.