The inappropriate distribution of traffic in high workload areas leads to congestion, packet loss, and poor service quality provided by data center networks (DCNs). In this paper, we have proposed a new method for traffic engineering (TE) as a modular approach. Based on this algorithm, depending on the type of traffic, when enough resources are not available for routing, the best path for that flow would be chosen. In the proposed algorithm, the less loaded paths for conduction of current are selected with regard to the present conditions as soon as a current is generated between two hosts, their position is identified in the DCN, and the paths between the two are obtained. We have simulated our algorithm by Mininet emulator. The results demonstrated that the SEMTE method performed an average of 30% better in energy consumption and 70% better in increasing maximum link utilization (MLU) compared to the conventional equal cost multi-path (ECMP) algorithm; however, there was some overhead on the system in terms of time of reading information from OpenFlow switches.