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

Re: [ns] Need help for LossMonitor



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!