Left: | ||
Right: |
LEFT | RIGHT |
---|---|
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * This program is free software; you can redistribute it and/or modify | 3 * This program is free software; you can redistribute it and/or modify |
4 * it under the terms of the GNU General Public License version 2 as | 4 * it under the terms of the GNU General Public License version 2 as |
5 * published by the Free Software Foundation; | 5 * published by the Free Software Foundation; |
6 * | 6 * |
7 * This program is distributed in the hope that it will be useful, | 7 * This program is distributed in the hope that it will be useful, |
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 8 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
10 * GNU General Public License for more details. | 10 * GNU General Public License for more details. |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
159 clientApps.Add (clientHelper.Install (d.GetRight (i))); | 159 clientApps.Add (clientHelper.Install (d.GetRight (i))); |
160 } | 160 } |
161 clientApps.Start (Seconds (1.0)); // Start 1 second after sink | 161 clientApps.Start (Seconds (1.0)); // Start 1 second after sink |
162 clientApps.Stop (Seconds (15.0)); // Stop before the sink | 162 clientApps.Stop (Seconds (15.0)); // Stop before the sink |
163 | 163 |
164 Ipv4GlobalRoutingHelper::PopulateRoutingTables (); | 164 Ipv4GlobalRoutingHelper::PopulateRoutingTables (); |
165 | 165 |
166 std::cout << "Running the simulation" << std::endl; | 166 std::cout << "Running the simulation" << std::endl; |
167 Simulator::Run (); | 167 Simulator::Run (); |
168 | 168 |
169 uint32_t totalRxBytesCounter = 0; | 169 uint64_t totalRxBytesCounter = 0; |
170 for (uint32_t i = 0; i < sinkApps.GetN (); i++) | 170 for (uint32_t i = 0; i < sinkApps.GetN (); i++) |
171 { | 171 { |
172 Ptr <Application> app = sinkApps.Get (i); | 172 Ptr <Application> app = sinkApps.Get (i); |
173 Ptr <PacketSink> pktSink = DynamicCast <PacketSink> (app); | 173 Ptr <PacketSink> pktSink = DynamicCast <PacketSink> (app); |
174 totalRxBytesCounter += static_cast<uint32_t>(pktSink->GetTotalRx ()); | 174 totalRxBytesCounter += pktSink->GetTotalRx (); |
Stefano Avallone
2017/12/28 23:55:27
I declared totalRxBytesCounter as uint64_t.
ammo6818-vandals.uidaho.edu
2017/12/29 04:43:18
incorporated change.
| |
175 } | 175 } |
176 NS_LOG_UNCOND ("----------------------------\nQueueDisc Type:"· | 176 NS_LOG_UNCOND ("----------------------------\nQueueDisc Type:"· |
177 << queueDiscType· | 177 << queueDiscType· |
178 << "\nGoodput Bytes/sec:"· | 178 << "\nGoodput Bytes/sec:"· |
179 << totalRxBytesCounter/Simulator::Now ().GetSeconds ());· | 179 << totalRxBytesCounter/Simulator::Now ().GetSeconds ());· |
180 NS_LOG_UNCOND ("----------------------------"); | 180 NS_LOG_UNCOND ("----------------------------"); |
181 | 181 |
182 | 182 |
183 std::cout << "Destroying the simulation" << std::endl; | 183 std::cout << "Destroying the simulation" << std::endl; |
184 Simulator::Destroy (); | 184 Simulator::Destroy (); |
185 return 0; | 185 return 0; |
186 } | 186 } |
LEFT | RIGHT |