|
|
| 244 |
cmd.AddValue ("sack", "Enable or disable SACK option", sack); |
244 |
cmd.AddValue ("sack", "Enable or disable SACK option", sack); |
| 245 |
cmd.Parse (argc, argv); |
245 |
cmd.Parse (argc, argv); |
| 246 |
|
246 |
|
|
|
247 |
transport_prot = std::string ("ns3::") + transport_prot; |
| 248 |
|
| 247 |
SeedManager::SetSeed (1); |
249 |
SeedManager::SetSeed (1); |
| 248 |
SeedManager::SetRun (run); |
250 |
SeedManager::SetRun (run); |
| 249 |
|
251 |
|
|
|
| 274 |
Config::SetDefault ("ns3::TcpSocketBase::Sack", BooleanValue (sack)); |
276 |
Config::SetDefault ("ns3::TcpSocketBase::Sack", BooleanValue (sack)); |
| 275 |
|
277 |
|
| 276 |
// Select TCP variant |
278 |
// Select TCP variant |
| 277 |
if (transport_prot.compare ("TcpNewReno") == 0) |
279 |
if (transport_prot.compare ("ns3::TcpWestwoodPlus") == 0) |
| 278 |
{ |
280 |
{ |
| 279 |
Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpNewReno::GetTypeId ())); |
281 |
// TcpWestwoodPlus is not an actual TypeId name; we need TcpWestwood here |
| 280 |
} |
|
|
| 281 |
else if (transport_prot.compare ("TcpHybla") == 0) |
| 282 |
{ |
| 283 |
Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpHybla::GetTypeId ())); |
| 284 |
} |
| 285 |
else if (transport_prot.compare ("TcpHighSpeed") == 0) |
| 286 |
{ |
| 287 |
Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpHighSpeed::GetTypeId ())); |
| 288 |
} |
| 289 |
else if (transport_prot.compare ("TcpVegas") == 0) |
| 290 |
{ |
| 291 |
Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpVegas::GetTypeId ())); |
| 292 |
} |
| 293 |
else if (transport_prot.compare ("TcpScalable") == 0) |
| 294 |
{ |
| 295 |
Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpScalable::GetTypeId ())); |
| 296 |
} |
| 297 |
else if (transport_prot.compare ("TcpHtcp") == 0) |
| 298 |
{ |
| 299 |
Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpHtcp::GetTypeId ())); |
| 300 |
} |
| 301 |
else if (transport_prot.compare ("TcpVeno") == 0) |
| 302 |
{ |
| 303 |
Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpVeno::GetTypeId ())); |
| 304 |
} |
| 305 |
else if (transport_prot.compare ("TcpBic") == 0) |
| 306 |
{ |
| 307 |
Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpBic::GetTypeId ())); |
| 308 |
} |
| 309 |
else if (transport_prot.compare ("TcpYeah") == 0) |
| 310 |
{ |
| 311 |
Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpYeah::GetTypeId ())); |
| 312 |
} |
| 313 |
else if (transport_prot.compare ("TcpIllinois") == 0) |
| 314 |
{ |
| 315 |
Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpIllinois::GetTypeId ())); |
| 316 |
} |
| 317 |
else if (transport_prot.compare ("TcpWestwood") == 0) |
| 318 |
{ // the default protocol type in ns3::TcpWestwood is WESTWOOD |
| 319 |
Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpWestwood::GetTypeId ())); |
282 |
Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpWestwood::GetTypeId ())); |
| 320 |
Config::SetDefault ("ns3::TcpWestwood::FilterType", EnumValue (TcpWestwood::TUSTIN)); |
283 |
// the default protocol type in ns3::TcpWestwood is WESTWOOD |
| 321 |
} |
|
|
| 322 |
else if (transport_prot.compare ("TcpWestwoodPlus") == 0) |
| 323 |
{ |
| 324 |
Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpWestwood::GetTypeId ())); |
| 325 |
Config::SetDefault ("ns3::TcpWestwood::ProtocolType", EnumValue (TcpWestwood::WESTWOODPLUS)); |
284 |
Config::SetDefault ("ns3::TcpWestwood::ProtocolType", EnumValue (TcpWestwood::WESTWOODPLUS)); |
| 326 |
Config::SetDefault ("ns3::TcpWestwood::FilterType", EnumValue (TcpWestwood::TUSTIN)); |
|
|
| 327 |
} |
| 328 |
else if (transport_prot.compare ("TcpLedbat") == 0) |
| 329 |
{ |
| 330 |
Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpLedbat::GetTypeId ())); |
| 331 |
} |
285 |
} |
| 332 |
else |
286 |
else |
| 333 |
{ |
287 |
{ |
| 334 |
NS_LOG_DEBUG ("Invalid TCP version"); |
288 |
TypeId tcpTid; |
| 335 |
exit (1); |
289 |
NS_ABORT_MSG_UNLESS (TypeId::LookupByNameFailSafe (transport_prot, &tcpTid), "TypeId " << transport_prot << " not found"); |
|
|
290 |
Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TypeId::LookupByName (transport_prot))); |
| 336 |
} |
291 |
} |
| 337 |
|
292 |
|
| 338 |
// Create gateways, sources, and sinks |
293 |
// Create gateways, sources, and sinks |
|
|
| 427 |
for (uint16_t i = 0; i < sources.GetN (); i++) |
382 |
for (uint16_t i = 0; i < sources.GetN (); i++) |
| 428 |
{ |
383 |
{ |
| 429 |
AddressValue remoteAddress (InetSocketAddress (sink_interfaces.GetAddress (i, 0), port)); |
384 |
AddressValue remoteAddress (InetSocketAddress (sink_interfaces.GetAddress (i, 0), port)); |
|
|
385 |
Config::SetDefault ("ns3::TcpSocket::SegmentSize", UintegerValue (tcp_adu_size)); |
| 386 |
BulkSendHelper ftp ("ns3::TcpSocketFactory", Address ()); |
| 387 |
ftp.SetAttribute ("Remote", remoteAddress); |
| 388 |
ftp.SetAttribute ("SendSize", UintegerValue (tcp_adu_size)); |
| 389 |
ftp.SetAttribute ("MaxBytes", UintegerValue (int(data_mbytes * 1000000))); |
| 430 |
|
390 |
|
| 431 |
if (transport_prot.compare ("TcpNewReno") == 0 |
391 |
ApplicationContainer sourceApp = ftp.Install (sources.Get (i)); |
| 432 |
|| transport_prot.compare ("TcpWestwood") == 0 |
392 |
sourceApp.Start (Seconds (start_time * i)); |
| 433 |
|| transport_prot.compare ("TcpWestwoodPlus") == 0 |
393 |
sourceApp.Stop (Seconds (stop_time - 3)); |
| 434 |
|| transport_prot.compare ("TcpHybla") == 0 |
|
|
| 435 |
|| transport_prot.compare ("TcpHighSpeed") == 0 |
| 436 |
|| transport_prot.compare ("TcpHtcp") == 0 |
| 437 |
|| transport_prot.compare ("TcpVegas") == 0 |
| 438 |
|| transport_prot.compare ("TcpVeno") == 0 |
| 439 |
|| transport_prot.compare ("TcpBic") == 0 |
| 440 |
|| transport_prot.compare ("TcpScalable") == 0 |
| 441 |
|| transport_prot.compare ("TcpYeah") == 0 |
| 442 |
|| transport_prot.compare ("TcpIllinois") == 0 |
| 443 |
|| transport_prot.compare ("TcpLedbat") == 0) |
| 444 |
{ |
| 445 |
Config::SetDefault ("ns3::TcpSocket::SegmentSize", UintegerValue (tcp_adu_size)); |
| 446 |
BulkSendHelper ftp ("ns3::TcpSocketFactory", Address ()); |
| 447 |
ftp.SetAttribute ("Remote", remoteAddress); |
| 448 |
ftp.SetAttribute ("SendSize", UintegerValue (tcp_adu_size)); |
| 449 |
ftp.SetAttribute ("MaxBytes", UintegerValue (int(data_mbytes * 1000000))); |
| 450 |
|
394 |
|
| 451 |
ApplicationContainer sourceApp = ftp.Install (sources.Get (i)); |
395 |
sinkHelper.SetAttribute ("Protocol", TypeIdValue (TcpSocketFactory::GetTypeId ())); |
| 452 |
sourceApp.Start (Seconds (start_time * i)); |
396 |
ApplicationContainer sinkApp = sinkHelper.Install (sinks); |
| 453 |
sourceApp.Stop (Seconds (stop_time - 3)); |
397 |
sinkApp.Start (Seconds (start_time * i)); |
| 454 |
|
398 |
sinkApp.Stop (Seconds (stop_time)); |
| 455 |
sinkHelper.SetAttribute ("Protocol", TypeIdValue (TcpSocketFactory::GetTypeId ())); |
|
|
| 456 |
ApplicationContainer sinkApp = sinkHelper.Install (sinks); |
| 457 |
sinkApp.Start (Seconds (start_time * i)); |
| 458 |
sinkApp.Stop (Seconds (stop_time)); |
| 459 |
} |
| 460 |
else |
| 461 |
{ |
| 462 |
NS_LOG_DEBUG ("Invalid transport protocol " << transport_prot << " specified"); |
| 463 |
exit (1); |
| 464 |
} |
| 465 |
} |
399 |
} |
| 466 |
|
400 |
|
| 467 |
// Set up tracing if enabled |
401 |
// Set up tracing if enabled |