Congestion in the network layer occurs when the volume of message traffic becomes too heavy, resulting in slower network response times and impacting packet transmission performance. To address congestion, TCP and UDP are used to direct data flow along different paths. The rapid growth of network applications in data centers has led to workload balancing issues. Load balancing aims to distribute traffic across multiple paths, and software-defined networks are highly effective in resolving congestion. In this paper, you will find an IP network algorithm that considers the differences between TCP and UDP, load balancing protocols, and shortest path selection algorithms like Dijkstra's. Our proposed method assesses node congestion by estimating congested links, calculating rerouting links, and balancing the load using the algorithm to select new data flow routes.