Internet service providers (ISP) apply traffic engineering (TE) in the underlay network to avoid congestion. On the other hand, content providers (CP) use different server selection (SS) strategies in the overlay network to reduce delay. It has been shown that a joint optimization of TE and SS is beneficial to the performance from both ISP's and CP's perspectives. One challenging issue in such a network is to design a distributed protocol which achieves optimality while revealing as little information as possible between ISP and CP. To address this problem, we propose a distributed protocol termed PETS, in which each router of ISP makes independent traffic engineering decision and each server of CP makes independent server selection decision. We prove that PETS can achieve optimality for the joint optimization of TE and SS. We also show that PETS can significantly reduce message passing and enables ISP to hide important underlay network information (e.g., topology) from CP. Furthermore, PETS can be easily extended to handle the case of multiple CPs in the network.