|
|
| 153 |
for (std::map<FlowId, FlowMonitor::FlowStats>::const_iterator i = stats.begin (); i != stats.end (); ++i) |
153 |
for (std::map<FlowId, FlowMonitor::FlowStats>::const_iterator i = stats.begin (); i != stats.end (); ++i) |
| 154 |
{ |
154 |
{ |
| 155 |
// first 2 FlowIds are for ECHO apps, we don't want to display them |
155 |
// first 2 FlowIds are for ECHO apps, we don't want to display them |
|
|
156 |
// |
| 157 |
// Duration for throughput measurement is 9.0 seconds, since |
| 158 |
// StartTime of the OnOffApplication is at about "second 1" |
| 159 |
// and |
| 160 |
// Simulator::Stops at "second 10". |
| 156 |
if (i->first > 2) |
161 |
if (i->first > 2) |
| 157 |
{ |
162 |
{ |
| 158 |
Ipv4FlowClassifier::FiveTuple t = classifier->FindFlow (i->first); |
163 |
Ipv4FlowClassifier::FiveTuple t = classifier->FindFlow (i->first); |
| 159 |
std::cout << "Flow " << i->first - 2 << " (" << t.sourceAddress << " -> " << t.destinationAddress << ")\n"; |
164 |
std::cout << "Flow " << i->first - 2 << " (" << t.sourceAddress << " -> " << t.destinationAddress << ")\n"; |
| 160 |
std::cout << " Tx Bytes: " << i->second.txBytes << "\n"; |
165 |
std::cout << " Tx Bytes: " << i->second.txBytes << "\n"; |
| 161 |
std::cout << " Rx Bytes: " << i->second.rxBytes << "\n"; |
166 |
std::cout << " Rx Bytes: " << i->second.rxBytes << "\n"; |
| 162 |
std::cout << " Throughput: " << i->second.rxBytes * 8.0 / 10.0 / 1000 / 1000 << " Mbps\n"; |
167 |
std::cout << " Throughput: " << i->second.rxBytes * 8.0 / 9.0 / 1000 / 1000 << " Mbps\n"; |
| 163 |
} |
168 |
} |
| 164 |
} |
169 |
} |
| 165 |
|
170 |
|