IP/MPLS over WDM is regarded as the best solution for NGN (next generation network), but in current and future for a long time, network architecture is still three-layer of IP/MPLS over SDH over WDM. In order to make full use of resources and reduce the blocking probability in three-layer dynamic network, an integrated resources optimization algorithm is proposed. We propose two optimization modes in our algorithm: in optimization mode 1, the service blocked in upper layer can be transmitted in lower layer by its idle resources; in optimization mode 2, we regard the three-layer network as an integrated network and search route for each service in the integrated network. In order to transport each service in synchronous manner, an ACO-based routing approach is adopted in these two modes. The simulation results show that compared with other algorithms, our algorithm gets better performance than other routing approaches in terms of service blocking probability.