Ns2 Program for congestion control

Ns2 Program for congestion control, Congestion refers to a network state where a node or link carries so much data that it may deteriorate network service quality, resulting in queuing delay, frame or data packet loss and the blocking of new connections.

what is congestion-control?

  • In Congestion-control, end systems throttle back in order to avoid congesting the network. The mechanism is similar to end-to-end flow controls, but the intention is to reduce congestion in the network, not the receiver.
  • Network simulator 2  ( Ns-2 Program for congestion-control outputs better results).

Techniques available in congestion-control:

Open Loop Technique and closed Loop Technique are utilized in ns-2 program for congestion control.

  • Open loop
    • Acknowledgement policy.
    • Retransmission policy.
    • Discarding policy.
    • Window policy.
    • Admission policy.
  • Closed loop
    • Explicit feedback.
    • Back pressure.
    • Implicit feedback.
    • Choke packet.
Architecture-for-control-congestion

Architecture-for-control-congestion

Sample Ns2 program for Congestion control

include <wifi_lte/wifi_lte_rtable.h>
  struct r_hist_entry *elm, *elm2;
int num_later = 1;
elm = STAILQ_FIRST(&r_hist_);
while (elm != NULL && num_later <= num_dup_acks_){
	num_later;
	elm = STAILQ_NEXT(elm, linfo_);
}

       if (elm != NULL){
	elm = findDataPacketInRecvHistory(STAILQ_NEXT(elm,linfo_));

	if (elm != NULL){
		elm2 = STAILQ_NEXT(elm, linfo_);
		while(elm2 != NULL){
			if (elm2->seq_num_ < seq_num && elm2->t_recv_ < time){
				STAILQ_REMOVE(&r_hist_,elm2,r_hist_entry,linfo_);
			        delete elm2;
			} else 
				elm = elm2;
			elm2 = STAILQ_NEXT(elm, linfo_);
		}
	}
}
}
void DCCPTFRCAgent::removeAcksRecvHistory(){
struct r_hist_entry *elm1 = STAILQ_FIRST(&r_hist_);
struct r_hist_entry *elm2;

int num_later = 1;
while (elm1 != NULL && num_later <= num_dup_acks_){
	num_later;
	elm1 = STAILQ_NEXT(elm1, linfo_);
}

if(elm1 == NULL)
	return;

elm2 = STAILQ_NEXT(elm1, linfo_);
while(elm2 != NULL){
	if (elm2->type_ == DCCP_ACK){
		STAILQ_REMOVE(&r_hist_,elm2,r_hist_entry,linfo_);
		delete elm2;
	} else {
		elm1 = elm2;
	}
	elm2 = STAILQ_NEXT(elm1, linfo_);
}
}

 
inline r_hist_entry *DCCPTFRCAgent::findDataPacketInRecvHistory(r_hist_entry *start){
while(start != NULL && start->type_ == DCCP_ACK)
	start = STAILQ_NEXT(start,linfo_);
return start;
}


NS2 Member Accounts | |
© 2005 - 2024 Vanet Projects

© 2005 - 2024 Matlab Projects