亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? tcp-fast.cc

?? 關于ns2的一些源碼和資料
?? CC
?? 第 1 頁 / 共 2 頁
字號:
 				 * and try to resume the sequence.
 				 */
 				   	dupack_action();
 				} else if (dupacks_ < numdupacks(cwnd_) && singledup_ ) {
					send_one();
 				}
			}
		}
        	if (valid_ack || aggressive_maxburst_)
			if (dupacks_ == 0)
				send_much(FALSE, 0, maxburst_);
	} else {
		/* we are in fast recovery */
		cwnd_update_time = currentTime;
		--pipe_;
		if ((int)tcph->seqno() >= recover_) {
			/* ACK indicates fast recovery is over */
			recover_ = 0;
			fastrecov_ = FALSE;
			newack(pkt);
			/* if the connection is done, call finish() */
			if ((highest_ack_ >= curseq_-1) && !closed_) {
				closed_ = 1;
				finish();
			}
			timeout_ = FALSE;
			scb_->ClearScoreBoard();

			/* New window: W/2 - K or W/2? */
		} else if ((int)tcph->seqno() > highest_ack_) {
			/* Not out of fast recovery yet.
			 * Update highest_ack_, but not last_ack_. */
			highest_ack_ = (int)tcph->seqno();
			scb_->UpdateScoreBoard (highest_ack_, tcph);
			if (partial_ack_) {
			  /* partial_ack_ is needed to guarantee that */
			  /*  a new packet is sent in response to a   */
			  /*  partial ack.                            */
				partial_ack_action();
				++pipe_;
				if (firstpartial_ == 0) {
					newtimer(pkt);
					t_backoff_ = 1;
					firstpartial_ = 1;
				}
			} else {
				--pipe_;
				newtimer(pkt);
				t_backoff_ = 1;
 			 /* If this partial ACK is from a retransmitted pkt,*/
 			 /* then we decrement pipe_ again, so that we never */
 			 /* do worse than slow-start.  If this partial ACK  */
 			 /* was instead from the original packet, reordered,*/
 			 /* then this might be too aggressive. */
			}
		} else if (timeout_ == FALSE) {
			/* got another dup ack */
			scb_->UpdateScoreBoard (highest_ack_, tcph);
 		        if(scb_->CheckUpdate()) {
 				if (dupacks_ > 0)
 			        	dupacks_++;
 			}
		}
        	if (valid_ack || aggressive_maxburst_)
			send_much(FALSE, 0, maxburst_);
	}

	Packet::free(pkt);
}

/******************************************************************************/
void
FastTcpAgent::dupack_action()
{
	int recovered = (highest_ack_ > recover_);
	if (recovered || (!bug_fix_ && !ecn_)) {
		goto sack_action;
	}
 
	if (ecn_ && last_cwnd_action_ == CWND_ACTION_ECN) {
		last_cwnd_action_ = CWND_ACTION_DUPACK;
		/*
		 * What if there is a DUPACK action followed closely by ECN
		 * followed closely by a DUPACK action?
		 * The optimal thing to do would be to remember all
		 * congestion actions from the most recent window
		 * of data.  Otherwise "bugfix" might not prevent
		 * all unnecessary Fast Retransmits.
		 */
		reset_rtx_timer(1,0);
		/*
		 * There are three possibilities: 
		 * (1) pipe_ = int(cwnd_) - numdupacks_;
		 * (2) pipe_ = window() - numdupacks_;
		 * (3) pipe_ = maxseq_ - highest_ack_ - numdupacks_;
		 * equation (2) takes into account the receiver's
		 * advertised window, and equation (3) takes into
		 * account a data-limited sender.
		 */
		if (singledup_ && LimTransmitFix_) {
		  pipe_ = maxseq_ - highest_ack_ - 1;
		}
		else {
		  // numdupacks(cwnd_) packets have left the pipe
		  pipe_ = maxseq_ - highest_ack_ - numdupacks(cwnd_);
		}
		fastrecov_ = TRUE;
		scb_->MarkRetran(highest_ack_+1);
		output(last_ack_ + 1, TCP_REASON_DUPACK);
		return;
	}

	if (bug_fix_) {
		/*
		 * The line below, for "bug_fix_" true, avoids
		 * problems with multiple fast retransmits in one
		 * window of data.
		 */
		return;
	}

sack_action:
	// we are now going into fast_recovery and will trace that event
	trace_event("FAST_RECOVERY");

	recover_ = maxseq_;
	last_cwnd_action_ = CWND_ACTION_DUPACK;
	if (oldCode_) {
	 	pipe_ = int(cwnd_) - numdupacks(cwnd_);
	} else if (singledup_ && LimTransmitFix_) {
		  pipe_ = maxseq_ - highest_ack_ - 1;
	}
	else {
		  // numdupacks(cwnd_) packets have left the pipe
		  pipe_ = maxseq_ - highest_ack_ - numdupacks(cwnd_);
	}
	slowdown(CLOSE_SSTHRESH_HALF|CLOSE_CWND_HALF);
	reset_rtx_timer(1,0);
	fastrecov_ = TRUE;
	scb_->MarkRetran(highest_ack_+1);
	output(last_ack_ + 1, TCP_REASON_DUPACK);	// from top
	/*
	 * If dynamically adjusting numdupacks_, record information
	 *  at this point.
	 */
	return;
}

/*
 * Process a packet that acks previously unacknowleges data, but
 * does not take us out of Fast Retransmit.
 *
 * The need for a mechanism to ensure that Sack TCP sends a packet in
 * response to a partial ACK has been discussed in
 * "Challenges to Reliable Data Transport over Heterogeneous
 * Wireless Networks", Hari Balakrishnan, 1998, and in
 * "Responding to Spurious Timeouts in TCP", Andrei Gurtov and 
 * Reiner Ludwig, 2003. 
 */
void
FastTcpAgent::partial_ack_action()
{
	if (next_pkt_ < highest_ack_ + 1) {
		next_pkt_ = highest_ack_ + 1;
	}
	// Output two packets in response to a partial ack,
	//   so as not to do worse than slow-start.
	int i;
	for (i = 1; i<=2; i++) {
		int getNext = scb_->GetNextUnacked(next_pkt_);

		if (getNext > next_pkt_) {
			next_pkt_ = getNext;
		}
		if (t_seqno_ < next_pkt_) {
			t_seqno_ = next_pkt_;
		}
		output(next_pkt_, TCP_REASON_PARTIALACK);	
		scb_->MarkRetran(next_pkt_);
		++next_pkt_; 
	}
	return;
}

void FastTcpAgent::timeout(int tno)
{
	if (tno == TCP_TIMER_RTX) {
		/*
		 * IF DSACK and dynamic adjustment of numdupacks_,
		 *  check whether a smaller value of numdupacks_
		 *  would have prevented this retransmit timeout.
		 * If DSACK and detection of premature retransmit
		 *  timeouts, then save some info here.
		 */ 
		dupacks_ = 0;
		fastrecov_ = FALSE;
		timeout_ = TRUE;
		if (highest_ack_ > last_ack_)
			last_ack_ = highest_ack_;
		recover_ = maxseq_;
		scb_->ClearScoreBoard();
		if (highest_ack_ == maxseq_ && !slow_start_restart_) {
			/*
			 * TCP option:
			 * If no outstanding data, then don't do anything.
			 *
			 * Note:  in the USC implementation,
			 * slow_start_restart_ == 0.
			 * I don't know what the U. Arizona implementation
			 * defaults to.
			 */
			return;
		};
		last_cwnd_action_ = CWND_ACTION_TIMEOUT;
		reset_rtx_timer(0, 0);
		++nrexmit_;
		slowdown(CLOSE_CWND_RESTART|CLOSE_SSTHRESH_HALF);
		cwnd_ = double(slowstart_);
		newcwnd_ = 0;
		send_much(0, TCP_REASON_TIMEOUT, maxburst_);
	} else {
		/* delayed-sent timer, with random overhead to avoid
		 * phase effect. */
		send_much(1, TCP_REASON_TIMEOUT, 3);
	}
}

void FastTcpAgent::send_much(int force, int reason, int maxburst)
{
	register int found, npacket = 0;
	int win = window();
	int xmit_seqno;

	found = 1;
	if (!force && delsnd_timer_.status() == TIMER_PENDING)
		return;
	/* Save time when first packet was sent, for newreno  --Allman */
	if (t_seqno_ == 0)
		firstsent_ = Scheduler::instance().clock();
	/*
	 * as long as the pipe is open and there is app data to send...
	 */
	while (((!fastrecov_ && (t_seqno_ <= last_ack_ + win)) ||
			(fastrecov_ && (pipe_ < int(cwnd_)))) 
			&& t_seqno_ < curseq_ && found) {

		if (overhead_ == 0 || force) {
			found = 0;
			int oldest_unacked_pkt = scb_->GetNextUnacked(last_ack_);
			if (oldest_unacked_pkt != -1 &&
			fasttime() - sendtime_[oldest_unacked_pkt%maxwnd_] > 2*avgRTT_){
				xmit_seqno = oldest_unacked_pkt;
			}
			else
				xmit_seqno = scb_->GetNextRetran ();
			if (xmit_seqno == -1) { 
				if ((!fastrecov_ && t_seqno_<=highest_ack_+win)||
					(fastrecov_ && t_seqno_<=highest_ack_+int(wnd_))) {
					found = 1;
					xmit_seqno = t_seqno_++;
				}
			} else if (recover_>0 && xmit_seqno<=highest_ack_+int(wnd_)) {
				found = 1;
				scb_->MarkRetran (xmit_seqno);
				win = window();
			}
			if (found) {
				output(xmit_seqno, reason);
				if (t_seqno_ <= xmit_seqno)
					t_seqno_ = xmit_seqno + 1;
				npacket++;
				pipe_++;
				if (QOption_)
					process_qoption_after_send () ;
	                        if (qs_approved_ == 1) {
	                                double delay = (double) t_rtt_ * tcp_tick_ / cwnd_;
	                                delsnd_timer_.resched(delay);
	                                return;
	                        }
			}
		} else if (!(delsnd_timer_.status() == TIMER_PENDING)) {
			/*
			 * Set a delayed send timeout.
			 * This is only for the simulator,to add some
			 *   randomization if speficied.
			 */
			delsnd_timer_.resched(Random::uniform(overhead_));
			return;
		}
		if (maxburst && npacket == maxburst)
			break;
	} /* while */
}

void
FastTcpAgent::output(int seqno, int reason)
{
	Packet* p = allocpkt();
	hdr_tcp *tcph = hdr_tcp::access(p);
	double now = Scheduler::instance().clock();
	hdr_flags* hf = hdr_flags::access(p);
	hdr_ip *iph = hdr_ip::access(p);
	int databytes = hdr_cmn::access(p)->size();
	tcph->seqno() = seqno;
	tcph->ts() = now;
	tcph->reason() = reason;
	/* if this is the 1st pkt, setup senttime[] and transmits[]
	 * I alloc mem here, instrad of in the constructor, to cover
	 * cases which windows get set by each different tcp flows */
	if (seqno==0) {
		maxwnd_ = int(wnd_);
		if (sendtime_)
			delete []sendtime_;
        	if (transmits_)
			delete []transmits_;
        	if (cwnd_array_)
			delete []cwnd_array_;
		sendtime_ = new double[maxwnd_];
		transmits_ = new int[maxwnd_];
		cwnd_array_= new double[maxwnd_];
		for(int i=0;i<maxwnd_;i++) {
			sendtime_[i] = -1.;
			transmits_[i] = 0;
			cwnd_array_[i]=-1;
		}
	}

	if (ecn_) {
		hf->ect() = 1; // ECN capable transport.
	}

	/* Check if this is the initial SYN packet. */
	if (seqno == 0) {
		if (syn_) {
			databytes= 0;
			curseq_ += 1;
			hdr_cmn::access(p)->size() = tcpip_base_hdr_size_;
		}
		if (ecn_) {
			hf->ecnecho() = 1;
//			hf->cong_action() = 1;
			hf->ect() = 0;
		}
	}
	else if (useHeaders_ == true) {
		hdr_cmn::access(p)->size() += headersize();
	}

	// record a find grained send time and # of transmits 
	int index = seqno % maxwnd_;
	sendtime_[index] = fasttime(); 
	cwnd_array_[index]=avg_cwnd_last_RTT_; 
	++transmits_[index];
	/* support ndatabytes_ in output - Lloyd Wood 14 March 2000 */
	int bytes = hdr_cmn::access(p)->size(); 
	ndatabytes_ += bytes; 
	ndatapack_++; // Added this - Debojyoti 12th Oct 2000
	send(p, 0);

	if (seqno == curseq_ && seqno > maxseq_)
		idle();  // Tell application I have sent everything so far

	if (seqno > maxseq_) {
		maxseq_ = seqno;
		if (!rtt_active_) {
			rtt_active_ = 1;
			if (seqno > rtt_seq_) {
				rtt_seq_ = seqno;
				rtt_ts_ = now;
			}
		}
	} else {
		++nrexmitpack_;
       		nrexmitbytes_ += bytes;
    	}

	if (!(rtx_timer_.status() == TIMER_PENDING))
		/* No timer pending.  Schedule one. */
		set_rtx_timer();
}

/******************************************************************************/
/* Space out increments to cwnd as acknowledegements arrive */
/* cwndp points to the actual cwnd value */
/* cwnd_incre (0 or 1) specifies the desired amount to increase cwnd by */
/* (eventually) */
void
FastTcpAgent::fast_pace(TracedDouble *cwndp, int incre_4_cwnd)
{
	if ( !avgRTT_ )
		return;

	double acks_per_period = (double)acks_last_rtt * fast_update_cwnd_interval_ / avgRTT_;

	if ( incre_4_cwnd >= 1 )
	{
		cwnd_increments += incre_4_cwnd;
		/* bc_spacing: target number of ACKs between increments */
		bc_spacing = (short unsigned int)(acks_per_period/cwnd_increments);
		/* bc_ack: number of ACKs since last increment */
		bc_ack = 1;
	}
	else { 
		bc_ack ++;
	}

	if (cwnd_increments)
	{
		/* if cwnd small, increment immediately */
		if (*cwndp <= 4) {
		/* if increment would more than double cwnd, do it in stages */
			if (*cwndp < cwnd_increments) {
				cwnd_increments -= (unsigned int)*cwndp;
				*cwndp += *cwndp;
			}
			else {
				*cwndp += cwnd_increments;
				cwnd_increments=0;
				bc_spacing=0;
			}
			bc_ack=0;
		}
		else if (bc_ack >= bc_spacing)
		{
			(*cwndp)++;
			cwnd_increments--;
			bc_ack = 0;
		}
	}
}

/******************************************************************************/
/*
 * return -1 if the oldest sent pkt has not been timeout (based on
 * fine grained timer).
 */
int
FastTcpAgent::fast_expire(Packet* pkt)
{
	hdr_tcp *tcph = hdr_tcp::access(pkt);
	double elapse = fasttime() - sendtime_[(tcph->seqno()+1)%maxwnd_];
	if (elapse >= 2 * avgRTT_) {
		return(tcph->seqno()+1);
	}
	return(-1);
}

/******************************************************************************/
void
FastTcpAgent::fast_recv_newack_helper(Packet *pkt) {
	newack(pkt);

	if (ect_) {
		if (!hdr_flags::access(pkt)->ecnecho())
			ecn_backoff_ = 0;
		if (!ecn_burst_ && hdr_flags::access(pkt)->ecnecho())
			ecn_burst_ = TRUE;
		else if (ecn_burst_ && ! hdr_flags::access(pkt)->ecnecho())
			ecn_burst_ = FALSE;
	}
	if (!ect_ && hdr_flags::access(pkt)->ecnecho() &&
		!hdr_flags::access(pkt)->cong_action())
		ect_ = 1;
	/* if the connection is done, call finish() */
	if ((highest_ack_ >= curseq_-1) && !closed_) {
		closed_ = 1;
		finish();
	}
	if (QOption_ && curseq_ == highest_ack_ +1) {
		cancel_rtx_timer();
	}
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品视频色一区| 欧美电影免费观看高清完整版 | 国产精品成人午夜| 日韩一区二区三免费高清| 99视频在线精品| 韩国精品一区二区| 五月天久久比比资源色| 国产精品高潮久久久久无| 欧美一区二区三区人| 一本大道av伊人久久综合| 国产中文字幕精品| 美腿丝袜亚洲三区| 偷拍自拍另类欧美| 亚洲一区免费在线观看| 亚洲欧洲性图库| 日本一区二区三区高清不卡| 日韩午夜精品电影| 久久久99精品免费观看| 欧美另类z0zxhd电影| 色狠狠色狠狠综合| jvid福利写真一区二区三区| 国产一区二区三区观看| 另类调教123区| 美日韩一区二区三区| 天天av天天翘天天综合网色鬼国产| 亚洲品质自拍视频网站| 国产精品初高中害羞小美女文| 久久网这里都是精品| 精品日韩在线观看| 精品处破学生在线二十三| 日韩一区二区三区电影| 91精品国产品国语在线不卡| 欧美美女视频在线观看| 欧美三级电影一区| 欧美色网一区二区| 欧美群妇大交群中文字幕| 欧美影院一区二区| 欧美日韩一区二区三区四区| 欧美少妇xxx| 欧美一区午夜视频在线观看| 这里只有精品电影| 日韩欧美专区在线| 久久天堂av综合合色蜜桃网| 久久久精品蜜桃| 中文字幕欧美国产| 中文字幕一区二区三| 亚洲免费观看高清完整版在线观看熊| 亚洲天堂免费看| 夜夜精品视频一区二区| 亚洲自拍都市欧美小说| 日韩福利视频网| 美国毛片一区二区三区| 极品美女销魂一区二区三区免费| 国产一区二区三区黄视频| 成人午夜精品一区二区三区| 色综合中文字幕国产| 色综合av在线| 欧美一级精品在线| 久久久91精品国产一区二区精品| 国产精品免费aⅴ片在线观看| 亚洲免费在线看| 奇米影视在线99精品| 国产不卡在线视频| 欧美在线看片a免费观看| 51精品秘密在线观看| 国产亚洲精品精华液| 一区二区三区在线视频观看| 天天色图综合网| 国产一区久久久| 欧美在线观看一区二区| 欧美精品一区二区在线观看| 亚洲欧洲美洲综合色网| 天堂在线一区二区| 国产成人在线免费观看| 色天使久久综合网天天| www欧美成人18+| 亚洲综合视频在线观看| 国产一区二区影院| 欧美性生活久久| 国产视频在线观看一区二区三区| 亚洲一区二区免费视频| 国产剧情av麻豆香蕉精品| 色香蕉久久蜜桃| 久久精品人人爽人人爽| 香蕉久久一区二区不卡无毒影院| 国产一区二区伦理片| 欧美三级在线播放| 中文字幕欧美日韩一区| 天天色天天爱天天射综合| 99久久er热在这里只有精品15| 欧美一区二区三区四区高清| 国产精品福利电影一区二区三区四区| 日韩影院在线观看| av激情综合网| 国产人成一区二区三区影院| 亚洲sss视频在线视频| av在线不卡电影| 精品福利av导航| 日韩福利电影在线| 欧美在线色视频| 最新热久久免费视频| 国内不卡的二区三区中文字幕| 色综合一个色综合亚洲| 久久精品夜夜夜夜久久| 欧美96一区二区免费视频| 欧美中文字幕不卡| 最新久久zyz资源站| 丁香啪啪综合成人亚洲小说| 精品处破学生在线二十三| 日韩精品一二三区| 欧美三区免费完整视频在线观看| 中文字幕亚洲在| 成人午夜视频网站| 国产亲近乱来精品视频| 国内精品写真在线观看| 欧美一二三在线| 日欧美一区二区| 欧美高清激情brazzers| 亚洲自拍偷拍网站| 在线观看日韩高清av| 亚洲日穴在线视频| 99re在线精品| 国产精品久久久久精k8| 成人精品在线视频观看| 欧美高清在线精品一区| 国产精品18久久久| 国产欧美一区二区精品性| 国产精品一二一区| 国产午夜精品久久久久久免费视 | 欧美人与禽zozo性伦| 一区二区三区电影在线播| 99精品国产一区二区三区不卡| 中文字幕在线不卡一区| 成人免费视频caoporn| 国产精品久久久久影院亚瑟 | 欧美一级视频精品观看| 免费成人av资源网| 日韩精品自拍偷拍| 精品亚洲porn| 久久精品一区四区| jlzzjlzz亚洲日本少妇| 亚洲女子a中天字幕| 欧美亚男人的天堂| 蜜桃在线一区二区三区| 久久久欧美精品sm网站 | 日韩一区二区三区在线| 老司机精品视频线观看86| xf在线a精品一区二区视频网站| 国产精品原创巨作av| 国产精品久久久久婷婷二区次| 99国产精品一区| 性欧美疯狂xxxxbbbb| 精品99久久久久久| 成人久久久精品乱码一区二区三区| 亚洲欧洲日韩一区二区三区| 在线精品视频免费观看| 日本vs亚洲vs韩国一区三区二区| www国产成人免费观看视频 深夜成人网| 国产精品自拍三区| 亚洲精品欧美激情| 4438x成人网最大色成网站| 国产麻豆视频一区二区| 亚洲人成7777| 精品欧美一区二区在线观看| 成人国产精品免费| 天堂成人国产精品一区| 久久久久高清精品| 欧美性xxxxx极品少妇| 捆绑调教一区二区三区| 国产精品久久久久一区二区三区| 欧美日韩一区不卡| 国产一区二区0| 亚洲一区二区在线视频| 精品va天堂亚洲国产| 一本色道久久综合亚洲aⅴ蜜桃 | 福利一区福利二区| 亚洲国产精品久久久久婷婷884 | 国产精品日产欧美久久久久| 欧洲另类一二三四区| 精彩视频一区二区| 亚洲午夜精品久久久久久久久| 日韩一区二区三区电影在线观看 | av一本久道久久综合久久鬼色| 五月婷婷欧美视频| 国产精品色婷婷| 欧美成人r级一区二区三区| 99re亚洲国产精品| 国内精品国产成人| 午夜精品久久久| 亚洲三级电影网站| 久久久不卡网国产精品二区| 欧美日韩在线观看一区二区| 懂色av一区二区在线播放| 美腿丝袜亚洲三区| 亚洲主播在线观看| 亚洲欧美在线视频| 国产欧美日韩久久| 日韩精品一区二| 欧美喷水一区二区| 在线精品国精品国产尤物884a|