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

[ns] confused about the throughput measurement for the TCP traffic.



Dear all,
  I got a problem about the throughput measurement for the TCP traffic.The measurement result is greater than the sending rate.I know it is impossible to set the sending rate of the TCP traffic. 
According to the suggestion I found in ns-mailing list, I attached a CBR source as the application of a TCP agent.Then I set the sending rate of CBR as 27kbps and the packetsize is 1000byte,but I found the measurement result is 122kbps.
when I set the sending rate of CBR as 90kbps, packetsize is 250,the measurement is 127kbps.Since I need to get such measurement result in C++, so I added a counter in the
     TcpSink::recv(packet * pkt, Handler*)
     {
                   pkts_arrival++;
     }
,then I used a timer to caculate the throughout when the timer expires at fixed interval.
I have used the same code in the udp::recv(packet *pkt) to get the throughput of UDP traffic,the result is ok(same with what I have set).

I got confused by this result.Thank for your help very much.

Best Rgds,
 liu yong
 [email protected]