/* -*- Mode:C++; c-basic-offset:8; tab-width:8; indent-tabs-mode:t -*- */ /* * Copyright (c) 1991-1997 Regents of the University of California. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the Computer Systems * Engineering Group at Lawrence Berkeley Laboratory. * 4. Neither the name of the University nor of the Laboratory may be used * to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#) $Header: /space/lmwang/ns-2/ns-allinone-2.1b6/ns-2.1b6/RCS/tcp.h,v 1.1 2000/11/20 00:47:51 lmwang Exp lmwang $ (LBL) */ #ifndef ns_tcp_newvegas_h #define ns_tcp_newvegas_h #include "tcp.h" /* TCP newvegas (NewVegasTcpAgent) works with REM by lmwang@cs.princeton.edu*/ class NewVegasTcpAgent : public virtual TcpAgent { public: NewVegasTcpAgent(); virtual void recv(Packet *pkt, Handler *); virtual void timeout(int tno); protected: double newVegastime() { return(Scheduler::instance().clock() - firstsent_); } virtual void output(int seqno, int reason = 0); virtual void recv_newack_helper(Packet*); int newVegas_expire(Packet*); void reset(); void ecn_handler(int seq_no, int flag); /* react to marking*/ 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_price_sample_; // # of pkts in price estimation double v_phi_; // base of price computation double v_price_; // link price estimation double v_fraction_; // how many pkts are marked in sampled ones double v_alpha_; // specify threshholds in pkts/s double v_beta_; double v_gamma_; 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_markings_; // each acked pkts marking is recorded int earliest_pkts_; // which pkt is the earlies we care about 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) double v_expect_; // optimal send rate double v_rate_alpha_; //lower bound for sending rate double v_rate_beta_; //upper bound for sending rate }; // Local Variables: // mode:c++ // End: #endif