Active Queue Management (AQM) applies a suitable control policy upon detecting congestion in networks. In this paper, a Proportional-Integral (PI) controller based on the optimization algorithm of MATLAB/Nonlinear Control Design Blockset (NCD) which is adapted as On-line tuning for controller parameters is applied to AQM for the objective of congestion avoidance and control in middle nodes. To present the methodology, a Proportional Integral (PI) controller is verified with the TCP/AQM model as an Active Queue Management (AQM) in internet routers The analytical results for linearized TCP/AQM model are presented in MATLAB/Simulink. From the obtained results, a faster response time as well as the regulation of the output to a constant value by the PI controller is clearly observed and it is noted that the PI controller based NCD provides good tracking performance for congestion avoidance in computer networks.