This paper addresses the problem of congestion control in communication networks from a control-theoretic perspective. In this type of complex, dynamical systems, the primary obstacle in the design of efficient control is the delay in the feedback loop which may be subject to significant fluctuations during the control process. This paper presents a new approach to solving the congestion problem in multisource networks, in which each flow is characterized by different and time-varying delay, with the application of discrete-time sliding-mode control. The proposed controller, operating at a network node, guarantees that in the considered networks the packet losses are eliminated and all of the available bandwidth at the node output interface is used for the data transfer. The controller is demonstrated to be robust with respect to the abrupt and unpredictable changes of networking conditions, such as delay and bandwidth variations, which need not be correlated with each other. The controller parameters are selected by minimizing a quadratic cost functional. A closed-form solution of the optimization problem allows for a straightforward and operationally efficient implementation of the proposed congestion control strategy in real network nodes.