[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ns] Need help for LossMonitor



On Thu, 11 May 2000, Jacki wrote:

> In
> > http://www-mash.cs.berkeley.edu/dist/archive/ns-users/0003/0069.html
> > which was my solution for goodput - tedious but accurate.
> > (parsing the standard ns tracefile will give you traffic.)
> > I think that there should be a default recvBytes with bound variable
> > in TcpSink, so that capturing goodput is commonplace and widely
> > understood as just something you sample a la cwnd_.
> > L.
> >> // added by Lloyd 
> >> void TcpSink::recvBytes(int bytes) 
> >> { 
> >> double now = Scheduler::instance().clock(); 
> >> printf("%f\t%d\n",now,bytes); 
> >> } 
> 
> Sorry, But I am cofused.
> According to "ns-2.16/tcp-sink.cc"  line300
> 
> void DelAckSink::recv(Packet* pkt, Handler*)
> {
>  int numToDeliver;
>  int numBytes = ((hdr_cmn*)pkt->access(off_cmn_))->size();
>  hdr_tcp *th = hdr_tcp::access(pkt);
>  acker_->update_ts(th->seqno(),th->ts());
>  numToDeliver = acker_->update(th->seqno(), numBytes);
>  if (numToDeliver)
>   recvBytes(numToDeliver);
>                  ^^^^^^^^^^^^^^^^^^
> It pass "numToDeliver" not the "numBytes"!!!
> 
> The value of these two intergers will not be the same sometimes!!
> so which one is the correct received bytes??
> thanks!

numBytes is the number of bytes received in the current packet. That
packet may not be providing new information (an unnecessary resend
due to acks being lost in the network, say), or it may be providing
very new information with a gap between it and the left edge of the
window. In those cases, there's no change in the window edge and no
new data to pass up to the application.

If the left edge of the window can be moved along (the numBytes in the
packet adds directly to it, or fills in a gap in the receiver buffer)
then data in the virtual-circuit stream can be delivered to the
application, and numToDeliver represents that.

numToDeliver is correct.

L.

<[email protected]>PGP<http://www.ee.surrey.ac.uk/Personal/L.Wood/>