Software-defined networks is an emerging architecture that separates the control plane and data plane. This paradigm enables flexible network resource allocations for traffic engineering, which aims to gain better network capacity and improved delay and loss performance. As we know, many heuristic algorithms have been developed to solve the dynamic routing problem. Whereas they lead to a high computational time cost, which results in a crucial problem whether such a heuristic approach to this NP-complete problem is of any use in practice. This paper proposes a framework with supervised machine learning based meta-layer to solve the dynamic routing problem in real time. We construct multiple machine learning modules in meta-layer, whose training set is consist of heuristic algorithm's input and its corresponding output. We show that after training process, the meta-layer will give heuristic-like results directly and independently, substituting for the time-consuming heuristic algorithm. We demonstrate, by analysis and simulation, our framework effectively enhance the network performance. Finally, the meta-layer architecture is quite universal and can be extended in numerous ways to accommodate a variety of traffic engineering scenarios in the network.