Related Projects
View All Projects

NS2 Code For TCP Congestion Control

NS2 Code For TCP Congestion Control


  The congestion in network occurs when a link or node is carrying huge amount of data which destroys quality of the network and reduces network response time.

Congestion control:

Basic techniques for mange congestion control:

Congestion avoidance algorithms:

Congestion window:

NS2 Code For TCP Congestion Control:

class TcpAgent : public Agent


friend class XcpEndsys;



virtual ~TcpAgent() {free(tss);}

virtual void recv(Packet*, Handler*);

virtual void timeout(int tno);

virtual void timeout_nonrtx(int tno);

int command(int argc, const char*const* argv);

virtual void sendmsg(int nbytes, const char *flags = 0);

void trace(TracedVar* v);

virtual void advanceby(int delta);


void TcpAgent::opencwnd()


double increment;

cwnd_ = 10;


if (cwnd_ < ssthresh_) {

switch (wnd_option_)


NS2 Code For TCP Congestion Control

Related Pages