ns-allinone-2.35/ns-2.35/dccp/dccp.cc
void DCCPRetransmitTimer::backOff(){
	if (tot_delay_ == 0){  //first scheduled
	} else 	if (tot_delay_ + delay_ * 2 <= max_tot_delay_){
		//we have not reached max_tot_delay
		delay_ *= 2;    //exp back-off
	} else {  //if we double, we would go beyond max_tot_delay
		delay_ = max_tot_delay_-tot_delay_;
		backoff_failed_ = true;
	}
	tot_delay_ += delay_;
	
	if(delay_ > 0.0)
		resched(delay_);	
}
/* Back off the timer (by a factor of 2)
 * The last back off will reach the max_tot_delay.
 */
Back off the timer (by a factor of 2)
The last back off will reach the max_tot_delay.
Back off the timer ( by a factor of 2 ) The last back off will reach the max_tot_delay .
void DCCPRetransmitTimer::backOff(){
	if (tot_delay_ == 0){  
	} else 	if (tot_delay_ + delay_ * 2 <= max_tot_delay_){
		delay_ *= 2;    
	} else {  
		delay_ = max_tot_delay_-tot_delay_;
		backoff_failed_ = true;
	}
	tot_delay_ += delay_;
	if(delay_ > 0.0)
		resched(delay_);	
}
void DCCPRetransmitTimer :: backOff ( ) { if ( tot_delay_ == 0 ) { } else if ( tot_delay_ + delay_ * 2 <= max_tot_delay_ ) { delay_ *= 2 ; } else { delay_ = max_tot_delay_ - tot_delay_ ; backoff_failed_ = true ; } tot_delay_ += delay_ ; if ( delay_ > 0.0 ) resched ( delay_ ) ; }
Back off the timer (by a factor of 2)
 The last back off will reach the max_tot_delay.
Back off the timer ( by a factor of 2 ) The last back off will reach the max_tot_delay .
//first scheduled //we have not reached max_tot_delay //exp back-off //if we double, we would go beyond max_tot_delay