[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: TCP/Fack
Hi,
Thanks a lot! The problem was (2), I think. There is another small problem in
tcp-fack.cc: the variable timeout_ is not being intialized correctly. There
should be a
timeout_ = FALSE;
in FackTcpAgent::FackTcpAgent().
Cheers,
- Jitu
John Heidemann wrote:
>
> On Mon, 07 Dec 1998 16:56:59 EST, Jitendra Padhye wrote:
> >Hi,
> >
> >I am trying to simulate a simple FTP transfer between two nodes using
> >TCP/Fack. I can not get it to work: the problem seems to be that the variable
> >"t_seqno_" is not being initialized correctly:
> >
> >FackTcpAgent::FackTcpAgent() : wintrim_(0), wintrimmult_(.5),
> > rampdown_(0), fack_(-1), retran_data_(0), ss_div4_(0)
> >{
> > bind_bool("ss-div4_", &ss_div4_);
> > bind_bool("rampdown_", &rampdown_);
> > printf ("here1 %d\n", t_seqno_); fflush(stdout);
> >}
> >
> >During execution, ns printed:
> >
> >here1 268573520
> >
> >Even if I try:
> >
> >TcpAgent::FackTcpAgent() : wintrim_(0), wintrimmult_(.5),
> > rampdown_(0), fack_(-1), retran_data_(0), ss_div4_(0)
> >{
> > bind_bool("ss-div4_", &ss_div4_);
> > bind_bool("rampdown_", &rampdown_);
> > t_seqno_ = 0 ;
> > printf ("here2 %d\n", t_seqno_); fflush(stdout);
> >}
> >
> >I get:
> >
> >here2 393216
>
>
>
> (1) Bound variables are supposed to be initialized from TclCL.
> This initilaization happens after the C++ construtor is called.
> (The code is in ns-default.tcl.)
> (Thus putting rampdown_(0) in this constructor is misleading since the
> code in ns-default takes precidence.)
>
> (2) Also, t_seqno_ is of type TracedInt.
> It seems possible that the printf() is not correctly converting it to
> an int. Trying
> printf ("here2 %d\n", int(t_seqno_));
> (But this code would have to go somewhere other than the constructor
> for the reason given in (1).)
>
> -John
>
>