We consider the network with two kinds of traffic: inelastic and elastic traffic. The inelastic traffic requires fixed throughput, high priority while the elastic traffic has controllable rate and low priority. Giving the fixed rate of inelastic traffic, how to inject the elastic traffic into the network to achieve the maximum utility of elastic traffic is solved in this paper. The Lagrangian Duality method is applied to solve the optimization problem. We decompose the Lagrangian into subproblems, and each sub-problem associates with each layer. The convexity of the primal problem guarantees the duality gap between primal and dual solutions is zero. The Lagrange multipliers, which are indeed the queue length on nodes for every destinations, implicitly update according to subgradient algorithm. The joint algorithm for rate control, routing, and scheduling is proposed. However, the scheduling is Max-weight scheduling and centralized algorithm actually. The Greedy distributed scheduling is introduced to implement scheduling in a distributed sense.