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

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

?? tcp-rbp.cc

?? Ns2 TCP 協議改進 版本 提高goodput
?? CC
字號:
/* -*-	Mode:C++; c-basic-offset:8; tab-width:8; indent-tabs-mode:t -*- *//* * tcp-rbp.cc * Copyright (C) 1997 by the University of Southern California * $Id: tcp-rbp.cc,v 1.22 2005/08/25 18:58:12 johnh Exp $ * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License, * version 2, as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * * * The copyright of this module includes the following * linking-with-specific-other-licenses addition: * * In addition, as a special exception, the copyright holders of * this module give you permission to combine (via static or * dynamic linking) this module with free software programs or * libraries that are released under the GNU LGPL and with code * included in the standard release of ns-2 under the Apache 2.0 * license or under otherwise-compatible licenses with advertising * requirements (or modified versions of such code, with unchanged * license).  You may copy and distribute such a system following the * terms of the GNU GPL for this module and the licenses of the * other code concerned, provided that you include the source code of * that other code when and as the GNU GPL requires distribution of * source code. * * Note that people who make modified versions of this module * are not obligated to grant this special exception for their * modified versions; it is their choice whether to do so.  The GNU * General Public License gives permission to release a modified * version without this exception; this exception also makes it * possible to release a modified version which carries forward this * exception. * *//* * Tcp-vegas with Rate-based pacing by John Heidemann <johnh@isi.edu> * and Vikram Visweswaraiah <visweswa@isi.edu>. * The original SunOS implementation was by Vikram Visweswaraiah * and Ashish Savla <asavla@usc.edu>. * * Rate-based pacing is an experimental addition to TCP * to address the slow-start restart problem. * See <http://www.isi.edu/lsam/publications/rate_based_pacing/index.html> * for details. * * A paper analysing RBP performance is in progress (as of 19-Jun-97). */#ifndef lintstatic const char rcsid[] ="@(#) $Header: /nfs/jade/vint/CVSROOT/ns-2/tcp/tcp-rbp.cc,v 1.22 2005/08/25 18:58:12 johnh Exp $ (NCSU/IBM)";#endif#include <stdio.h>#include <stdlib.h>#include <sys/types.h>#include "ip.h"#include "tcp.h"#include "flags.h"#ifndef MIN#define MIN(x, y) ((x)<(y) ? (x) : (y))#endif /* ! MIN */#if 0#define RBP_DEBUG_PRINTF(x) printf x#else /* ! 0 */#define RBP_DEBUG_PRINTF(x)#endif /* 0 */#define RBP_MIN_SEGMENTS 2class RBPVegasTcpAgent;class RBPVegasPaceTimer : public TimerHandler {public:	RBPVegasPaceTimer(RBPVegasTcpAgent *a) : TimerHandler() { a_ = a; }protected:	virtual void expire(Event *e);	RBPVegasTcpAgent *a_;};// Hmmm... ``a is a'' in the construction of the RBPVegasPaceTimer edifice :->class RBPVegasTcpAgent : public virtual VegasTcpAgent {	friend class RBPVegasPaceTimer; public:	RBPVegasTcpAgent();	virtual void recv(Packet *pkt, Handler *);	virtual void timeout(int tno);	virtual void send_much(int force, int reason, int maxburst);	double rbp_scale_;   // conversion from actual -> rbp send rates	enum rbp_rate_algorithms { RBP_NO_ALGORITHM, RBP_VEGAS_RATE_ALGORITHM, RBP_CWND_ALGORITHM };	int rbp_rate_algorithm_;protected:	void paced_send_one();	int able_to_rbp_send_one();	// stats on what we did	int rbp_segs_actually_paced_;	enum rbp_modes { RBP_GOING, RBP_POSSIBLE, RBP_OFF };	enum rbp_modes rbp_mode_;	double rbp_inter_pace_delay_;	RBPVegasPaceTimer pace_timer_;};static class RBPVegasTcpClass : public TclClass {public:	RBPVegasTcpClass() : TclClass("Agent/TCP/Vegas/RBP") {}	TclObject* create(int, const char*const*) {		return (new RBPVegasTcpAgent());	}} class_vegas_rbp;void RBPVegasPaceTimer::expire(Event *) { a_->paced_send_one(); }RBPVegasTcpAgent::RBPVegasTcpAgent() : VegasTcpAgent(),	rbp_mode_(RBP_OFF),	pace_timer_(this){	bind("rbp_scale_", &rbp_scale_);	bind("rbp_rate_algorithm_", &rbp_rate_algorithm_);	bind("rbp_segs_actually_paced_", &rbp_segs_actually_paced_);	bind("rbp_inter_pace_delay_", &rbp_inter_pace_delay_);}voidRBPVegasTcpAgent::recv(Packet *pkt, Handler *hand){	if (rbp_mode_ != RBP_OFF) {		// reciept of anything disables rbp		rbp_mode_ = RBP_OFF;		// Vegas takes care of cwnd.	};	VegasTcpAgent::recv(pkt, hand);}voidRBPVegasTcpAgent::timeout(int tno){	if (tno == TCP_TIMER_RTX) {		if (highest_ack_ == maxseq_) {			// Idle for a while => RBP next time.			rbp_mode_ = RBP_POSSIBLE;			return;		};	};	VegasTcpAgent::timeout(tno);}voidRBPVegasTcpAgent::send_much(int force, int reason, int maxburst){	if (rbp_mode_ == RBP_POSSIBLE && able_to_rbp_send_one()) {		// start paced mode		rbp_mode_ = RBP_GOING; 		rbp_segs_actually_paced_ = 0;		double rbwin_vegas;		switch (rbp_rate_algorithm_) {		case RBP_VEGAS_RATE_ALGORITHM:			// Try to follow tcp_output.c here			// Calculate the vegas window as its reported rate			// times the rtt.			rbwin_vegas = v_actual_ * v_rtt_;			RBP_DEBUG_PRINTF(("-----------------\n"));			RBP_DEBUG_PRINTF(("rbwin_vegas = %g\nv_actual = %g\nv_rtt =%g\nbase_rtt=%g\n",					  rbwin_vegas, v_actual_, v_rtt_, v_baseRTT_));			// Smooth the vegas window			rbwin_vegas *= rbp_scale_;			break;		case RBP_CWND_ALGORITHM:			// Pace out scaled cwnd.			rbwin_vegas = cwnd_ * rbp_scale_;			break;		default:			// quiet the compiler.			rbwin_vegas = 0.0;			abort();		};		rbwin_vegas = int(rbwin_vegas + 0.5);   // round		// Always pace at least RBP_MIN_SEGMENTS		if (rbwin_vegas <= RBP_MIN_SEGMENTS) {			rbwin_vegas = RBP_MIN_SEGMENTS;		};		// Conservatively set the congestion window to min of		// congestion window and the smoothed rbwin_vegas		RBP_DEBUG_PRINTF(("cwnd before check = %g\n", double(cwnd_)));		cwnd_ = MIN(cwnd_,(TracedDouble) rbwin_vegas);		RBP_DEBUG_PRINTF(("cwnd after check = %g\n", double(cwnd_)));		RBP_DEBUG_PRINTF(("recv win = %g\n", wnd_));		// RBP timer calculations must be based on the actual		// window which is the min of the receiver's		// advertised window and the congestion window.		// TcpAgent::window() does this job.		// What this means is we expect to send window() pkts		// in v_rtt_ time.		rbp_inter_pace_delay_ = (v_rtt_)/(window() * 1.0);		RBP_DEBUG_PRINTF(("window is %d\n", window()));		RBP_DEBUG_PRINTF(("ipt = %g\n", rbp_inter_pace_delay_));		paced_send_one();	} else {		VegasTcpAgent::send_much(force,reason, maxburst);	}}voidRBPVegasTcpAgent::paced_send_one(){	if (rbp_mode_ == RBP_GOING && able_to_rbp_send_one()) {		RBP_DEBUG_PRINTF(("Sending one rbp packet\n"));		// send one packet		output(t_seqno_++, TCP_REASON_RBP);		rbp_segs_actually_paced_++;		// schedule next pkt		pace_timer_.resched(rbp_inter_pace_delay_);	};}intRBPVegasTcpAgent::able_to_rbp_send_one(){	return t_seqno_ < curseq_ && t_seqno_ <= highest_ack_ + window();}/*********************************************************************** * * The reno-based version * */class RBPRenoTcpAgent;class RBPRenoPaceTimer : public TimerHandler {public:	RBPRenoPaceTimer(RBPRenoTcpAgent *a) : TimerHandler() { a_ = a; }protected:	virtual void expire(Event *e);	RBPRenoTcpAgent *a_;};// Hmmm... ``a is a'' in the construction of the RBPRenoPaceTimer edifice :->class RBPRenoTcpAgent : public virtual RenoTcpAgent {	friend class RBPRenoPaceTimer; public:	RBPRenoTcpAgent();	virtual void recv(Packet *pkt, Handler *);	virtual void timeout(int tno);	virtual void send_much(int force, int reason, int maxburst);	double rbp_scale_;   // conversion from actual -> rbp send rates	// enum rbp_rate_algorithms { RBP_NO_ALGORITHM, RBP_VEGAS_RATE_ALGORITHM, RBP_CWND_ALGORITHM };	// int rbp_rate_algorithm_;protected:	void paced_send_one();	int able_to_rbp_send_one();	// stats on what we did	int rbp_segs_actually_paced_;	enum rbp_modes { RBP_GOING, RBP_POSSIBLE, RBP_OFF };	enum rbp_modes rbp_mode_;	double rbp_inter_pace_delay_;	RBPRenoPaceTimer pace_timer_;};static class RBPRenoTcpClass : public TclClass {public:	RBPRenoTcpClass() : TclClass("Agent/TCP/Reno/RBP") {}	TclObject* create(int, const char*const*) {		return (new RBPRenoTcpAgent());	}} class_reno_rbp;void RBPRenoPaceTimer::expire(Event *) { a_->paced_send_one(); }RBPRenoTcpAgent::RBPRenoTcpAgent() : TcpAgent(),	rbp_mode_(RBP_OFF),	pace_timer_(this){	bind("rbp_scale_", &rbp_scale_);	// algorithm is not used in Reno	// bind("rbp_rate_algorithm_", &rbp_rate_algorithm_);	bind("rbp_segs_actually_paced_", &rbp_segs_actually_paced_);	bind("rbp_inter_pace_delay_", &rbp_inter_pace_delay_);}voidRBPRenoTcpAgent::recv(Packet *pkt, Handler *hand){	if (rbp_mode_ != RBP_OFF) {		// reciept of anything disables rbp		rbp_mode_ = RBP_OFF;		// reset cwnd such that we're now ack clocked.		hdr_tcp *tcph = hdr_tcp::access(pkt);		if (tcph->seqno() > last_ack_) {			/* reno does not do rate adjustments as Vegas;			 * normally, one wouldn't do any adjustments to			 * cwnd and allow the sliding window to do its job			 * But, if cwnd >> amt_paced, then there's a			 * bunch of data that can be sent asap, plus the			 * two (typically, due to delacks) that get opened			 * up due to the first ack. This would lead to			 * a burst, defeating the purpose of pacing.			 * Ideally, one would want cwnd = amt_paced			 * ALWAYS. Since this doesn't necessarily happen,			 * `cap' cwnd to the amt paced and THEN let			 * sliding windows take over. Note that this			 * mechanism will typically result in 3 segs			 * being sent out when the first ack is received.			 */			cwnd_ = maxseq_ - last_ack_;			RBP_DEBUG_PRINTF(("\ncwnd-after-first-ack=%g\n", (double)cwnd_));		};	};	RenoTcpAgent::recv(pkt, hand);}voidRBPRenoTcpAgent::timeout(int tno){	if (tno == TCP_TIMER_RTX) {		if (highest_ack_ == maxseq_) {			// Idle for a while => RBP next time.			rbp_mode_ = RBP_POSSIBLE;			return;		};	};	RenoTcpAgent::timeout(tno);}voidRBPRenoTcpAgent::send_much(int force, int reason, int maxburst){	if (rbp_mode_ == RBP_POSSIBLE && able_to_rbp_send_one()) {		// start paced mode		rbp_mode_ = RBP_GOING; 		rbp_segs_actually_paced_ = 0;		// Pace out scaled cwnd.		double rbwin_reno;		rbwin_reno = cwnd_ * rbp_scale_;		rbwin_reno = int(rbwin_reno + 0.5);   // round		// Always pace at least RBP_MIN_SEGMENTS		if (rbwin_reno <= RBP_MIN_SEGMENTS) {			rbwin_reno = RBP_MIN_SEGMENTS;		};		// Conservatively set the congestion window to min of		// congestion window and the smoothed rbwin_reno		RBP_DEBUG_PRINTF(("cwnd before check = %g\n", double(cwnd_)));		cwnd_ = MIN(cwnd_,(TracedDouble) rbwin_reno);		RBP_DEBUG_PRINTF(("cwnd after check = %g\n", double(cwnd_)));		RBP_DEBUG_PRINTF(("recv win = %g\n", wnd_));		// RBP timer calculations must be based on the actual		// window which is the min of the receiver's		// advertised window and the congestion window.		// TcpAgent::window() does this job.		// What this means is we expect to send window() pkts		// in v_srtt_ time.		static double srtt_scale = 0.0;		if (srtt_scale == 0.0) {  // yuck yuck yuck!			srtt_scale = 1.0; // why are we doing fixed point?			int i;			for (i = T_SRTT_BITS; i > 0; i--) {				srtt_scale /= 2.0;			};		}		rbp_inter_pace_delay_ = (t_srtt_ * srtt_scale * tcp_tick_) / (window() * 1.0);		RBP_DEBUG_PRINTF(("window is %d\n", window()));		RBP_DEBUG_PRINTF(("ipt = %g\n", rbp_inter_pace_delay_));		paced_send_one();	} else {		RenoTcpAgent::send_much(force,reason, maxburst);	};}voidRBPRenoTcpAgent::paced_send_one(){	if (rbp_mode_ == RBP_GOING && able_to_rbp_send_one()) {		RBP_DEBUG_PRINTF(("Sending one rbp packet\n"));		// send one packet		output(t_seqno_++, TCP_REASON_RBP);		rbp_segs_actually_paced_++;		// schedule next pkt		pace_timer_.resched(rbp_inter_pace_delay_);	};}intRBPRenoTcpAgent::able_to_rbp_send_one(){	return t_seqno_ < curseq_ && t_seqno_ <= highest_ack_ + window();}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲高清视频的网址| 久久精品夜色噜噜亚洲a∨| 99久久精品免费| 久久黄色级2电影| 天天爽夜夜爽夜夜爽精品视频| 一区二区三区视频在线看| 亚洲三级电影全部在线观看高清| 国产欧美在线观看一区| 国产欧美一区二区三区鸳鸯浴| 久久综合九色综合欧美就去吻 | 色综合网站在线| aaa欧美大片| 91麻豆蜜桃一区二区三区| 日本久久一区二区三区| 欧美三级视频在线观看| 欧美日韩国产综合视频在线观看| 欧美日韩在线播放一区| 91精品国产综合久久国产大片| 7777精品伊人久久久大香线蕉的 | 日韩一区二区影院| 日韩精品一区二区在线| 精品91自产拍在线观看一区| 久久这里只有精品首页| 亚洲欧洲色图综合| 亚洲电影一区二区| 免费看欧美女人艹b| 国产精品一二三四| 一道本成人在线| 欧美一区国产二区| 欧美国产精品v| 一区二区三区影院| 秋霞成人午夜伦在线观看| 国产精华液一区二区三区| 国产精品亚洲第一区在线暖暖韩国| 成人av网站免费观看| 欧美色综合影院| 久久久久99精品国产片| 一区二区三区丝袜| 国产专区综合网| 在线免费观看日本欧美| 久久久久久免费| 五月天中文字幕一区二区| 国产精品影视在线观看| 欧美视频自拍偷拍| 欧美国产精品v| 久久国产精品72免费观看| 91一区二区三区在线播放| 日韩欧美亚洲国产另类| 中文字幕一区二区三区蜜月| 久久99热这里只有精品| av电影天堂一区二区在线| 2023国产精华国产精品| 午夜精品视频一区| 色婷婷av一区| 国产精品久久久久一区| 日韩专区一卡二卡| 色婷婷精品久久二区二区蜜臀av | 中文字幕欧美一| 蜜臀av性久久久久蜜臀aⅴ流畅| 成人av动漫网站| 久久伊99综合婷婷久久伊| 婷婷久久综合九色综合绿巨人| 色婷婷精品久久二区二区蜜臀av| 久久影院电视剧免费观看| 亚洲va韩国va欧美va| 在线观看国产精品网站| 综合久久久久久久| 成人免费毛片片v| 久久精品日产第一区二区三区高清版 | 国产精品激情偷乱一区二区∴| 久久99蜜桃精品| 91麻豆精品国产无毒不卡在线观看 | 国产清纯美女被跳蛋高潮一区二区久久w| 视频精品一区二区| 在线观看欧美精品| 亚洲一区免费在线观看| 91小视频在线免费看| 国产精品国产精品国产专区不片| 国产精品一区三区| 久久久久久一二三区| 国产成人啪免费观看软件| 久久精品一区四区| 国产成人av福利| 国产婷婷色一区二区三区在线| 国产一区二区三区久久久| 久久综合丝袜日本网| 国产精品一区三区| 国产精品欧美经典| 99久久国产综合精品色伊| 中文字幕一区二区视频| 欧美在线观看一区| 三级欧美韩日大片在线看| 欧美电视剧在线观看完整版| 麻豆精品国产传媒mv男同| 久久―日本道色综合久久| 成人av资源网站| 亚洲精品成人精品456| 欧美乱妇20p| 精品一区二区三区免费观看| 久久蜜桃av一区精品变态类天堂| 丁香婷婷综合激情五月色| 亚洲欧美在线视频| 欧美伦理电影网| 国产电影精品久久禁18| 亚洲激情一二三区| 日韩亚洲欧美成人一区| 高清在线成人网| 亚洲精品视频在线看| 91精品国产综合久久久久久| 国产制服丝袜一区| 亚洲最大成人网4388xx| 日韩欧美成人激情| 91网站视频在线观看| 亚洲福利视频三区| 国产精品青草综合久久久久99| 欧美伊人久久大香线蕉综合69| 免费一级片91| 国产精品色一区二区三区| 欧美色综合天天久久综合精品| 久久成人免费电影| 亚洲人快播电影网| 日韩欧美中文一区| 97久久精品人人做人人爽| 男女激情视频一区| 亚洲精品中文字幕乱码三区 | 成人免费av资源| 日韩av电影免费观看高清完整版| 国产日韩欧美亚洲| 欧美一区二区三区免费在线看| 国产夫妻精品视频| 美女精品一区二区| 亚洲一区二区在线播放相泽| 国产亚洲精品超碰| 日韩一区二区三区在线视频| 欧美在线综合视频| 高清视频一区二区| 国产在线播放一区三区四| 午夜a成v人精品| 亚洲精品国产成人久久av盗摄 | 91香蕉视频在线| 国产综合色在线视频区| 奇米色777欧美一区二区| 亚洲麻豆国产自偷在线| 欧美激情综合在线| 久久久一区二区| 精品欧美一区二区久久| 91精品免费观看| 欧美日韩亚洲高清一区二区| 97国产精品videossex| 国产91精品在线观看| 国产在线不卡视频| 国产东北露脸精品视频| 国产精品18久久久久久vr| 精品一区二区三区影院在线午夜| 婷婷久久综合九色综合绿巨人| 亚洲综合偷拍欧美一区色| 亚洲激情五月婷婷| 亚洲精品免费播放| 亚洲精品老司机| 亚洲国产视频在线| 石原莉奈在线亚洲二区| 美国精品在线观看| 国内外成人在线| 国产成人精品三级| 99在线精品一区二区三区| www.亚洲人| 在线亚洲欧美专区二区| 欧美性大战久久久久久久蜜臀 | 久久综合精品国产一区二区三区| 日韩午夜三级在线| 日韩久久久久久| 精品少妇一区二区三区在线视频| 欧美岛国在线观看| 国产午夜精品一区二区三区四区| 国产性色一区二区| 中文字幕亚洲不卡| 亚洲一区二区三区视频在线| 天堂影院一区二区| 韩国视频一区二区| 成人h动漫精品一区二| 在线精品视频免费观看| 日韩亚洲欧美成人一区| 欧美激情一区三区| 亚洲一区二区三区激情| 九九国产精品视频| av成人免费在线| 欧美一区二区久久久| 国产欧美精品一区| 亚洲小少妇裸体bbw| 国产在线播放一区二区三区| 99久久久无码国产精品| 欧美一区日本一区韩国一区| 国产欧美一区二区三区鸳鸯浴 | 亚洲18女电影在线观看| 久久99国产精品久久99果冻传媒| 成人晚上爱看视频| 在线观看区一区二| 欧美高清在线精品一区| 亚洲妇女屁股眼交7| 成人深夜视频在线观看|