Since the introduction of 5G technology, it has brought ease to many sectors of society and lifestyle. 5G technology has also made major contributions to education, and the help impact for education is extremely considerable, particularly for online learning. The epidemic condition of covid-19 in China is serious in March 2020, and the notion of "classes stopped but learning continues" has become the trend of school instruction. Colleges and universities, in particular, which serve a diverse population, mostly use online learning methods to conduct instructional activities. As a result, traditional classroom teaching no longer satisfies modern teaching demands, and online learning has established itself as the norm. Due to network speed and latency, online learning has several issues when compared to traditional face-to-face education. This article examines the online learning system based on the 5G mobile communication technology network, as well as conventional face-to-face teaching and online learning under other networks, and analyses the students' mastery of knowledge under different teaching methods through assessment. This study aims to minimize network latency by detecting and correcting the main energy-consuming activities of the 5G network in order to deliver effective online training to students utilizing 5G basket ball teaching (5G_BBT). We use the features of 5G network nodes and channel characteristics based on actual route loss measurements for diverse settings to build a comprehensive model of basket ball training. Initially from the teaching database the information that can be send to the user protocol for that the process of cluster formation was done using Crossover Swarm Optimization based on passive clustering. Estimate basket ball teaching data transmission probability by maximum likelihood naïve bayes function. Then the Calculation of optimal cluster path for sending the training material with border gateway algorithm where distance and residual energy have to considered as constraints. Finally, the performance analyses are carried out in terms of latency energy efficiency, and speed to prove the effectiveness of the proposed 5G Networking scheme.