OLD | NEW |
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 * Copyright (c) 2013 ResiliNets, ITTC, University of Kansas | 3 * Copyright (c) 2013 ResiliNets, ITTC, University of Kansas |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 5 * This program is free software; you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 2 as | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 static void | 196 static void |
197 TraceNextRx (std::string &next_rx_seq_file_name) | 197 TraceNextRx (std::string &next_rx_seq_file_name) |
198 { | 198 { |
199 AsciiTraceHelper ascii; | 199 AsciiTraceHelper ascii; |
200 nextRxStream = ascii.CreateFileStream (next_rx_seq_file_name.c_str ()); | 200 nextRxStream = ascii.CreateFileStream (next_rx_seq_file_name.c_str ()); |
201 Config::ConnectWithoutContext ("/NodeList/2/$ns3::TcpL4Protocol/SocketList/1/R
xBuffer/NextRxSequence", MakeCallback (&NextRxTracer)); | 201 Config::ConnectWithoutContext ("/NodeList/2/$ns3::TcpL4Protocol/SocketList/1/R
xBuffer/NextRxSequence", MakeCallback (&NextRxTracer)); |
202 } | 202 } |
203 | 203 |
204 int main (int argc, char *argv[]) | 204 int main (int argc, char *argv[]) |
205 { | 205 { |
206 std::string transport_prot = "TcpWestwood"; | 206 std::string transport_prot = "TcpWestwoodCrb"; |
207 double error_p = 0.0; | 207 double error_p = 0.0; |
208 std::string bandwidth = "2Mbps"; | 208 std::string bandwidth = "2Mbps"; |
209 std::string delay = "0.01ms"; | 209 std::string delay = "0.01ms"; |
210 std::string access_bandwidth = "10Mbps"; | 210 std::string access_bandwidth = "10Mbps"; |
211 std::string access_delay = "45ms"; | 211 std::string access_delay = "45ms"; |
212 bool tracing = false; | 212 bool tracing = false; |
213 std::string prefix_file_name = "TcpVariantsComparison"; | 213 std::string prefix_file_name = "TcpVariantsComparison"; |
214 double data_mbytes = 0; | 214 double data_mbytes = 0; |
215 uint32_t mtu_bytes = 400; | 215 uint32_t mtu_bytes = 400; |
216 uint16_t num_flows = 1; | 216 uint16_t num_flows = 1; |
217 float duration = 100; | 217 float duration = 100; |
218 uint32_t run = 0; | 218 uint32_t run = 0; |
219 bool flow_monitor = false; | 219 bool flow_monitor = false; |
220 bool pcap = false; | 220 bool pcap = false; |
221 bool sack = true; | 221 bool sack = true; |
222 std::string queue_disc_type = "ns3::PfifoFastQueueDisc"; | 222 std::string queue_disc_type = "ns3::PfifoFastQueueDisc"; |
223 | 223 |
224 | 224 |
225 CommandLine cmd; | 225 CommandLine cmd; |
226 cmd.AddValue ("transport_prot", "Transport protocol to use: TcpNewReno, " | 226 cmd.AddValue ("transport_prot", "Transport protocol to use: TcpNewReno, " |
227 "TcpHybla, TcpHighSpeed, TcpHtcp, TcpVegas, TcpScalable, TcpVeno
, " | 227 "TcpHybla, TcpHighSpeed, TcpHtcp, TcpVegas, TcpScalable, TcpVeno
, " |
228 "TcpBic, TcpYeah, TcpIllinois, TcpWestwood, TcpWestwoodPlus, Tcp
Ledbat ", transport_prot); | 228 "TcpBic, TcpYeah, TcpIllinois, TcpWestwood, TcpWestwoodPlus, Tcp
WestwoodCrb, TcpLedbat ", transport_prot); |
229 cmd.AddValue ("error_p", "Packet error rate", error_p); | 229 cmd.AddValue ("error_p", "Packet error rate", error_p); |
230 cmd.AddValue ("bandwidth", "Bottleneck bandwidth", bandwidth); | 230 cmd.AddValue ("bandwidth", "Bottleneck bandwidth", bandwidth); |
231 cmd.AddValue ("delay", "Bottleneck delay", delay); | 231 cmd.AddValue ("delay", "Bottleneck delay", delay); |
232 cmd.AddValue ("access_bandwidth", "Access link bandwidth", access_bandwidth); | 232 cmd.AddValue ("access_bandwidth", "Access link bandwidth", access_bandwidth); |
233 cmd.AddValue ("access_delay", "Access link delay", access_delay); | 233 cmd.AddValue ("access_delay", "Access link delay", access_delay); |
234 cmd.AddValue ("tracing", "Flag to enable/disable tracing", tracing); | 234 cmd.AddValue ("tracing", "Flag to enable/disable tracing", tracing); |
235 cmd.AddValue ("prefix_name", "Prefix of output trace file", prefix_file_name); | 235 cmd.AddValue ("prefix_name", "Prefix of output trace file", prefix_file_name); |
236 cmd.AddValue ("data", "Number of Megabytes of data to transmit", data_mbytes); | 236 cmd.AddValue ("data", "Number of Megabytes of data to transmit", data_mbytes); |
237 cmd.AddValue ("mtu", "Size of IP packets to send in bytes", mtu_bytes); | 237 cmd.AddValue ("mtu", "Size of IP packets to send in bytes", mtu_bytes); |
238 cmd.AddValue ("num_flows", "Number of flows", num_flows); | 238 cmd.AddValue ("num_flows", "Number of flows", num_flows); |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 { // the default protocol type in ns3::TcpWestwood is WESTWOOD | 318 { // the default protocol type in ns3::TcpWestwood is WESTWOOD |
319 Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpWest
wood::GetTypeId ())); | 319 Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpWest
wood::GetTypeId ())); |
320 Config::SetDefault ("ns3::TcpWestwood::FilterType", EnumValue (TcpWestwood
::TUSTIN)); | 320 Config::SetDefault ("ns3::TcpWestwood::FilterType", EnumValue (TcpWestwood
::TUSTIN)); |
321 } | 321 } |
322 else if (transport_prot.compare ("TcpWestwoodPlus") == 0) | 322 else if (transport_prot.compare ("TcpWestwoodPlus") == 0) |
323 { | 323 { |
324 Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpWest
wood::GetTypeId ())); | 324 Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpWest
wood::GetTypeId ())); |
325 Config::SetDefault ("ns3::TcpWestwood::ProtocolType", EnumValue (TcpWestwo
od::WESTWOODPLUS)); | 325 Config::SetDefault ("ns3::TcpWestwood::ProtocolType", EnumValue (TcpWestwo
od::WESTWOODPLUS)); |
326 Config::SetDefault ("ns3::TcpWestwood::FilterType", EnumValue (TcpWestwood
::TUSTIN)); | 326 Config::SetDefault ("ns3::TcpWestwood::FilterType", EnumValue (TcpWestwood
::TUSTIN)); |
327 } | 327 } |
| 328 else if (transport_prot.compare ("TcpWestwoodCrb") == 0) |
| 329 { |
| 330 Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpWest
wood::GetTypeId ())); |
| 331 Config::SetDefault ("ns3::TcpWestwood::ProtocolType", EnumValue (TcpWestwo
od::WESTWOODCRB)); |
| 332 Config::SetDefault ("ns3::TcpWestwood::FilterType", EnumValue (TcpWestwood
::TUSTIN)); |
| 333 } |
328 else if (transport_prot.compare ("TcpLedbat") == 0) | 334 else if (transport_prot.compare ("TcpLedbat") == 0) |
329 { | 335 { |
330 Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpLedb
at::GetTypeId ())); | 336 Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpLedb
at::GetTypeId ())); |
331 } | 337 } |
332 else | 338 else |
333 { | 339 { |
334 NS_LOG_DEBUG ("Invalid TCP version"); | 340 NS_LOG_DEBUG ("Invalid TCP version"); |
335 exit (1); | 341 exit (1); |
336 } | 342 } |
337 | 343 |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
424 Address sinkLocalAddress (InetSocketAddress (Ipv4Address::GetAny (), port)); | 430 Address sinkLocalAddress (InetSocketAddress (Ipv4Address::GetAny (), port)); |
425 PacketSinkHelper sinkHelper ("ns3::TcpSocketFactory", sinkLocalAddress); | 431 PacketSinkHelper sinkHelper ("ns3::TcpSocketFactory", sinkLocalAddress); |
426 | 432 |
427 for (uint16_t i = 0; i < sources.GetN (); i++) | 433 for (uint16_t i = 0; i < sources.GetN (); i++) |
428 { | 434 { |
429 AddressValue remoteAddress (InetSocketAddress (sink_interfaces.GetAddress
(i, 0), port)); | 435 AddressValue remoteAddress (InetSocketAddress (sink_interfaces.GetAddress
(i, 0), port)); |
430 | 436 |
431 if (transport_prot.compare ("TcpNewReno") == 0 | 437 if (transport_prot.compare ("TcpNewReno") == 0 |
432 || transport_prot.compare ("TcpWestwood") == 0 | 438 || transport_prot.compare ("TcpWestwood") == 0 |
433 || transport_prot.compare ("TcpWestwoodPlus") == 0 | 439 || transport_prot.compare ("TcpWestwoodPlus") == 0 |
| 440 || transport_prot.compare ("TcpWestwoodCrb") == 0 |
434 || transport_prot.compare ("TcpHybla") == 0 | 441 || transport_prot.compare ("TcpHybla") == 0 |
435 || transport_prot.compare ("TcpHighSpeed") == 0 | 442 || transport_prot.compare ("TcpHighSpeed") == 0 |
436 || transport_prot.compare ("TcpHtcp") == 0 | 443 || transport_prot.compare ("TcpHtcp") == 0 |
437 || transport_prot.compare ("TcpVegas") == 0 | 444 || transport_prot.compare ("TcpVegas") == 0 |
438 || transport_prot.compare ("TcpVeno") == 0 | 445 || transport_prot.compare ("TcpVeno") == 0 |
439 || transport_prot.compare ("TcpBic") == 0 | 446 || transport_prot.compare ("TcpBic") == 0 |
440 || transport_prot.compare ("TcpScalable") == 0 | 447 || transport_prot.compare ("TcpScalable") == 0 |
441 || transport_prot.compare ("TcpYeah") == 0 | 448 || transport_prot.compare ("TcpYeah") == 0 |
442 || transport_prot.compare ("TcpIllinois") == 0 | 449 || transport_prot.compare ("TcpIllinois") == 0 |
443 || transport_prot.compare ("TcpLedbat") == 0) | 450 || transport_prot.compare ("TcpLedbat") == 0) |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
500 Simulator::Run (); | 507 Simulator::Run (); |
501 | 508 |
502 if (flow_monitor) | 509 if (flow_monitor) |
503 { | 510 { |
504 flowHelper.SerializeToXmlFile (prefix_file_name + ".flowmonitor", true, tr
ue); | 511 flowHelper.SerializeToXmlFile (prefix_file_name + ".flowmonitor", true, tr
ue); |
505 } | 512 } |
506 | 513 |
507 Simulator::Destroy (); | 514 Simulator::Destroy (); |
508 return 0; | 515 return 0; |
509 } | 516 } |
OLD | NEW |