Abstract. We investigate the interaction between Transmission Control Protocol (TCP) and an Active Queue Management (AQM) router, that are designed to control congestion in the Internet. TCP controls the sending rate with which the data is injected into the network and AQM generates control signals based on the congestion level. For a given TCP version, we define the optimal strategy for the AQM router as a solution of a nonlinear periodic optimization problem, and we find this solution using a linear programming approach. We show that depending on the choice of the utility function for the sending rate, the optimal control is either periodic or steady state. Main attention is paid to a problem with a sigmoidal utility function, in which the evolution of the optimal sending rate resembles a "saw-tooth" behavior of the "instantaneous" TCP sending rate.