Utility-based Resource and QoS Optimization in Packet Networks