The emergence of two new technologies, namely software defined networking (SDN) and 5G networks, has greatly changed the development of network functions and network topologies. These two technologies provide cost benefits for mobile operators, a more flexible and scalable network, and a shorter time to market for new services and applications. Scalability and effectiveness are increased when 5G and SDN are used together. SDN increases the reliability of the 5G network by separating the control plane from the data plane. Incorrect load balancing, a lack of knowledge of network traffic, and other issues make it difficult to provide Quality of Service (QoS) with SDN. This research proposes a unique loadbalancing method to resolve these concerns using Hierarchical Agglomerative Clustering (HAC) and Back Propagation Neural Network (BPNN) algorithms. The proposed method segments the network services into several groups after normalizing data requirements. It consists of two phases: in first phase, there is clustering of bandwidth for different services (e.g., social media, automated homes, and automated cars) inside the network for different data requirements. The agglomerative hierarchical clustering (single link technique) is implemented to make the clusters of bandwidth inside the SDN work based on minimum distance. After clustering, we allotted bandwidths to the respective clusters. In the second phase, the BPNN technique trains the network to choose the optimal path and check the error faults. The proposed approach evaluates the network delay, packet loss, throughput, latency rate, and bandwidth usage to evaluate the performance with Multiple Regression-based Searching (MRBS) and Software-defined Sensor Network Load Balancing (SDSNLB) algorithms. The experimental results of the proposed model are promising as the performance increased by 15%, 23%, 27%, 21%, and 30%, respectively, compared with existing approaches. In addition we compared the computational time complexity with increased the no of nodes and services, when the rate of nodes and services is varying, the proposed solution's efficiency remains constant.