Skip to content

Commit 0480c75

Browse files
committed
examples: Fix curTime format for TraceThroughput in tcp-bbr-example
1 parent e922ae9 commit 0480c75

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

examples/tcp/tcp-bbr-example.cc

+6-3
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
// * bbr-3-0.pcap for the first interface on R2
4242
// * bbr-3-1.pcap for the second interface on R2
4343
// (2) cwnd.dat file contains congestion window trace for the sender node
44-
// (3) throughput.dat file contains sender side throughput trace
44+
// (3) throughput.dat file contains sender side throughput trace (throughput is in Mbit/s)
4545
// (4) queueSize.dat file contains queue length trace from the bottleneck link
4646
//
4747
// BBR algorithm enters PROBE_RTT phase in every 10 seconds. The congestion
@@ -81,9 +81,12 @@ TraceThroughput(Ptr<FlowMonitor> monitor)
8181
{
8282
auto itr = stats.begin();
8383
Time curTime = Now();
84-
throughput << curTime << " "
84+
85+
// Convert (curTime - prevTime) to microseconds so that throughput is in bits per
86+
// microsecond (which is equivalent to Mbps)
87+
throughput << curTime.GetSeconds() << "s "
8588
<< 8 * (itr->second.txBytes - prev) / ((curTime - prevTime).ToDouble(Time::US))
86-
<< std::endl;
89+
<< " Mbps" << std::endl;
8790
prevTime = curTime;
8891
prev = itr->second.txBytes;
8992
}

0 commit comments

Comments
 (0)