NS2 Code For TCP Congestion Control
NS2 Code For TCP Congestion Control
Congestion:
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:
- Congestion control is a mechanism in a telecommunication networks load on the network is detected after congestion and prevented before congestion.
- Two ways of congestion control:
- Congestion avoidance
- Congestion detection
Basic techniques for mange congestion control:
- End-system flow control
- Network congestion control
- Network-based congestion avoidance
- Resource allocation
Congestion avoidance algorithms:
- Additive Increase/Multiplicative Decrease (AIMD)
- Slow Start
- Fast Recovery
- Fast Retransmission
- TCP Tahoe and Reno
- Leaky Bucket Algorithm
- Token bucket Algorithm
Congestion window:
- Congestion window is one of the factors which evaluate number of bytes that can be outstanding at any time.
- Basically congestion window is maintained by the sender.
- A link between the sender and the receiver is stopped by our congestion window.
NS2 Code For TCP Congestion Control:
class TcpAgent : public Agent
{
friend class XcpEndsys;
public:
TcpAgent();
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;
return;
if (cwnd_ < ssthresh_) {
switch (wnd_option_)
}
NS2 Code For TCP Congestion Control