📄 tcp.h.svn-base
字号:
int delay_growth_; /* delay opening cwnd until 1st data recv'd */ /* End of modeling SYN and SYN/ACK packets. */ /* F-RTO */ int frto_enabled_; /* != 0 to enable F-RTO */ int sfrto_enabled_; /* != 0 to enabled SACK-based F-RTO */ int spurious_response_; /* Response variant to spurious RTO */ /* End of R-RTO */ /* Parameters for backwards compatility with old code. */ int bug_fix_; /* 1 for multiple-fast-retransmit fix */ int less_careful_; /* 1 for Less Careful variant of bug_fix_, */ /* for illustration only */ int exitFastRetrans_; /* True to clean exits of Fast Retransmit */ /* False for buggy old behavior */ int bugfix_ack_; // 1 to enable ACK heuristic, to allow // multiple-fast-retransmits in special cases. // From Andrei Gurtov int bugfix_ts_; // 1 to enable timestamp heuristic, to allow // multiple-fast-retransmits in special cases. // From Andrei Gurtov // Not implemented yet. int old_ecn_; /* For backwards compatibility with the * old ECN implementation, which never * reduced the congestion window below * one packet. */ /* End of parameters for backwards compatility. */ /* Parameters for alternate congestion control mechanisms. */ double k_parameter_; /* k parameter in binomial controls */ double l_parameter_; /* l parameter in binomial controls */ int precision_reduce_; /* non-integer reduction of cwnd */ int maxburst_; /* max # packets can send back-2-back */ int aggressive_maxburst_; /* Send on a non-valid ack? */ /* End of parameters for alternate congestion control mechanisms. */ FILE *plotfile_; /* * Dynamic state. */ TracedInt dupacks_; /* number of duplicate acks */ TracedInt curseq_; /* highest seqno "produced by app" */ TracedInt highest_ack_; /* not frozen during Fast Recovery */ TracedDouble cwnd_; /* current window */ TracedInt ssthresh_; /* slow start threshold */ TracedInt maxseq_; /* used for Karn algorithm */ /* highest seqno sent so far */ int last_ack_; /* largest consecutive ACK, frozen during * Fast Recovery */ int recover_; /* highest pkt sent before dup acks, */ /* timeout, or source quench/ecn */ int last_cwnd_action_; /* CWND_ACTION_{TIMEOUT,DUPACK,ECN} */ int count_; /* used in window increment algorithms */ int rtt_active_; /* 1 if a rtt sample is pending */ int rtt_seq_; /* seq # of timed seg if rtt_active_ is 1 */ double rtt_ts_; /* time at which rtt_seq_ was sent */ double firstsent_; /* When first packet was sent --Allman */ double lastreset_; /* W.N. Last time connection was reset - for */ /* detecting pkts from previous incarnations */ int closed_; /* whether this connection has closed */ /* Dynamic state used for alternate congestion control mechanisms */ double awnd_; /* averaged window */ int first_decrease_; /* First decrease of congestion window. */ /* Used for decrease_num_ != 0.5. */ double fcnt_; /* used in window increment algorithms */ double base_cwnd_; /* base window (for experimental purposes) */ /* End of state for alternate congestion control mechanisms */ /* Dynamic state only used for monitoring */ int trace_all_oneline_; /* TCP tracing vars all in one line or not? */ int nam_tracevar_; /* Output nam's variable trace or just plain text variable trace? */ TracedInt ndatapack_; /* number of data packets sent */ TracedInt ndatabytes_; /* number of data bytes sent */ TracedInt nackpack_; /* number of ack packets received */ TracedInt nrexmit_; /* number of retransmit timeouts when there was data outstanding */ TracedInt nrexmitpack_; /* number of retransmited packets */ TracedInt nrexmitbytes_; /* number of retransmited bytes */ TracedInt necnresponses_; /* number of times cwnd was reduced in response to an ecn packet -- sylvia */ TracedInt ncwndcuts_; /* number of times cwnd was reduced for any reason -- sylvia */ TracedInt ncwndcuts1_; /* number of times cwnd was reduced due to congestion (as opposed to idle periods */ /* end of dynamic state for monitoring */ /* Specifying variants in TCP algorithms. */ int slow_start_restart_; /* boolean: re-init cwnd after connection goes idle. On by default. */ int restart_bugfix_; /* ssthresh is cut down because of timeouts during a connection's idle period. Setting this boolean fixes this problem. For now, it is off by default. */ TracedInt singledup_; /* Send on a single dup ack. */ int LimTransmitFix_; /* To fix a bug in Limited Transmit. */ int noFastRetrans_; /* No Fast Retransmit option. */ int oldCode_; /* Use old code. */ int useHeaders_; /* boolean: Add TCP/IP header sizes */ /* end of specifying variants */ /* Used for ECN */ int ecn_; /* Explicit Congestion Notification */ int cong_action_; /* Congestion Action. True to indicate that the sender responded to congestion. */ int ecn_burst_; /* True when the previous ACK packet * carried ECN-Echo. */ int ecn_backoff_; /* True when retransmit timer should begin to be backed off. */ int ect_; /* turn on ect bit now? */ int SetCWRonRetransmit_; /* True to allow setting CWR on */ /* retransmitted packets. Affects */ /* performance for Reno with ECN. */ /* end of ECN */ /* used for Explicit Loss Notification */ int eln_; /* Explicit Loss Notification (wireless) */ int eln_rxmit_thresh_; /* Threshold for ELN-triggered rxmissions */ int eln_last_rxmit_; /* Last packet rxmitted due to ELN info */ /* end of Explicit Loss Notification */ /* for experimental high-speed TCP */ /* These four parameters define the HighSpeed response function. */ int low_window_; /* window for turning on high-speed TCP */ int high_window_; /* target window for new response function */ double high_p_; /* target drop rate for new response function */ double high_decrease_; /* decrease rate at target window */ /* The next parameter is for Limited Slow-Start. */ int max_ssthresh_; /* max value for ssthresh_ */ /* These two functions are just an easy structuring of the code. */ double increase_param(); /* get increase parameter for current cwnd */ double decrease_param(); /* get decrease parameter for current cwnd */ int cwnd_range_; /* for determining when to recompute params. */ hstcp hstcp_; /* HighSpeed TCP variables */ /* end of section for experimental high-speed TCP */ /* for Quick-Start, experimental. */ int rate_request_; /* Rate request in Kbps, for QuickStart. */ int qs_enabled_; /* to enable QuickStart. */ int qs_requested_; int qs_approved_; int qs_window_; /* >0: there are outstanding non-acked segments from QS window */ int qs_cwnd_; /* Initial window for Quick-Start */ int tcp_qs_recovery_; /* != 0 if we apply slow start on packet losses during QS window */ int qs_request_mode_; /* 1 = Try to avoid unnecessary QS requests for short flows. Use qs_rtt_ as the RTT used in window calculation. 2 = Always request 'rate_request_' bytes, regardless of flow size */ int qs_thresh_; /* Do not use QS if there are less data to send than this. Applies only if qs_request_mode_ == 1 */ int qs_rtt_; /* QS needs some assumption of the RTT in in order to be able to determine how much it needs for rate request with given amount of data to send. milliseconds. */ int ttl_diff_; /* end of section for Quick-Start. */ /* F-RTO: !=0 when F-RTO recovery is underway, N:th round-trip * since RTO. Can have values between 0-2 */ int frto_; int pipe_prev_; /* window size when timeout last occurred */ /* support for event-tracing */ //EventTrace *et_; void trace_event(char *eventtype); /* these function are now obsolete, see other above */ void closecwnd(int how); void quench(int how); /* TCP quiescence, reducing cwnd after an idle period */ void process_qoption_after_send() ; void process_qoption_after_ack(int seqno) ; int QOption_ ; /* TCP quiescence option */ int EnblRTTCtr_ ; /* are we using a corase grained timer? */ int T_full ; /* last time the window was full */ int T_last ; int T_prev ; int T_start ; int RTT_count ; int RTT_prev ; int RTT_goodcount ; int F_counting ; int W_used ; int W_timed ; int F_full ; int Backoffs ; int control_increase_ ; /* If true, don't increase cwnd if sender */ /* is not window-limited. */ int prev_highest_ack_ ; /* Used to determine if sender is */ /* window-limited. */ /* end of TCP quiescence */};/* TCP Reno */class RenoTcpAgent : public virtual TcpAgent { public: RenoTcpAgent(); virtual int window(); virtual double windowd(); virtual void recv(Packet *pkt, Handler*); virtual void timeout(int tno); virtual void dupack_action(); protected: int allow_fast_retransmit(int last_cwnd_action_); unsigned int dupwnd_;};/* TCP New Reno */class NewRenoTcpAgent : public virtual RenoTcpAgent { public: NewRenoTcpAgent(); virtual void recv(Packet *pkt, Handler*); virtual void partialnewack_helper(Packet* pkt); virtual void dupack_action(); protected: int newreno_changes_; /* 0 for fixing unnecessary fast retransmits */ /* 1 for additional code from Allman, */ /* to implement other algorithms from */ /* Hoe's paper, including sending a new */ /* packet for every two duplicate ACKs. */ /* The default is set to 0. */ int newreno_changes1_; /* Newreno_changes1_ set to 0 gives the */ /* Slow-but-Steady variant of NewReno from */ /* RFC 2582, with the retransmit timer reset */ /* after each partial new ack. */ /* Newreno_changes1_ set to 1 gives the */ /* Impatient variant of NewReno from */ /* RFC 2582, with the retransmit timer reset */ /* only for the first partial new ack. */ /* The default is set to 0 */ void partialnewack(Packet *pkt); int allow_fast_retransmit(int last_cwnd_action_); int acked_, new_ssthresh_; /* used if newreno_changes_ == 1 */ double ack2_, ack3_, basertt_; /* used if newreno_changes_ == 1 */ int firstpartial_; /* For the first partial ACK. */ int partial_window_deflation_; /* 0 if set cwnd to ssthresh upon */ /* partial new ack (default) */ /* 1 if deflate (cwnd + dupwnd) by */ /* amount of data acked */ /* "Partial window deflation" is */ /* discussed in RFC 2582. */ int exit_recovery_fix_; /* 0 for setting cwnd to ssthresh upon */ /* leaving fast recovery (default) */ /* 1 for setting cwnd to min(ssthresh, */ /* amnt. of data in network) when leaving */};/* TCP vegas (VegasTcpAgent) */class VegasTcpAgent : public virtual TcpAgent { public: VegasTcpAgent(); ~VegasTcpAgent(); virtual void recv(Packet *pkt, Handler *); virtual void timeout(int tno);protected: double vegastime() { return(Scheduler::instance().clock() - firstsent_); } virtual void output(int seqno, int reason = 0); virtual void recv_newack_helper(Packet*); int vegas_expire(Packet*); void reset(); void vegas_inflate_cwnd(int win, double current_time); virtual void delay_bind_init_all(); virtual int delay_bind_dispatch(const char *varName, const char *localName, TclObject *tracer); double t_cwnd_changed_; // last time cwnd changed double firstrecv_; // time recv the 1st ack int v_alpha_; // vegas thruput thresholds in pkts int v_beta_; int v_gamma_; // threshold to change from slow-start to // congestion avoidance, in pkts int v_slowstart_; // # of pkts to send after slow-start, deflt(2) int v_worried_; // # of pkts to chk after dup ack (1 or 2) double v_timeout_; // based on fine-grained timer double v_rtt_; double v_sa_; double v_sd_; int v_cntRTT_; // # of rtt measured within one rtt double v_sumRTT_; // sum of rtt measured within one rtt double v_begtime_; // tagged pkt sent int v_begseq_; // tagged pkt seqno double* v_sendtime_; // each unacked pkt's sendtime is recorded. int* v_transmits_; // # of retx for an unacked pkt int v_maxwnd_; // maxwnd size for v_sendtime_[] double v_newcwnd_; // record un-inflated cwnd double v_baseRTT_; // min of all rtt double v_incr_; // amount cwnd is increased in the next rtt int v_inc_flag_; // if cwnd is allowed to incr for this rtt double v_actual_; // actual send rate (pkt/s; needed for tcp-rbp) int ns_vegas_fix_level_; // see comment at end of tcp-vegas.cc for details of fixes};// Local Variables:// mode:c++// c-basic-offset: 8// End:#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -