In this paper a new sliding mode controller for congestion problem in TCP networks has been proposed. Congestion occurs due to high network loads. It affects some aspects of network behavior. Congestion control prevents or reduces loads in bottlenecks and manages traffic. By using control theory, closed loop data transfer processing structure in computer networks can cope with the congestion problem. Sliding mode controller can provide robust behavior in presence of uncertainties and disturbances. In sliding mode control, states should be reached to a predefined surface (sliding surface), in a limited time and remain on the same surface over time. Moving on the sliding surface is independent of the uncertainties, so this technique is an approach of robust control. After applying controller to the system, stability of the system with controller has been studied by Lyapunov stability approach. Simulation results show the efficiency of the sliding mode controller in different scenarios.