It is a challenge to provide service quality features in overlay networks, including Quality of Service (QoS), Traffic Engineering (TE), and Failure Recovery (FR). This is largely due to lack of information about the underlying resource availability and topology. In this paper, we develop a family of optimization-based distributed traffic control laws to meet this challenge. This family of control laws enables QoS, TE, and FR features simultaneously in an overlay environment where the underlying resources and topology are hidden and change from time to time. The approach taken relies on the Sliding Modes technique to solve the resulting time-varying optimization problem. Running at the edge of an overlay network, a set of control laws selected from this family enables class-of-service-based multi-path load balancing and/or rate adaptation to respond to network congestion and link failures. The only nonlocal information needed as input to the control laws is whether an overlay link is congested/broken or not, which, however, can be inferred by the overlay nodes themselves. This makes the family of control laws highly scalable and particularly viable to serve as the theoretical underpinning for the development of distributed traffic control protocols In overlay networks.