traffic-control: Set sane defaults for codel vs pfifo basic test
This commit is contained in:
@@ -84,10 +84,11 @@ int main (int argc, char *argv[])
|
||||
std::string accessDelay = "0.1ms";
|
||||
|
||||
std::string queueDiscType = "PfifoFast"; //PfifoFast or CoDel
|
||||
uint32_t queueSize = 1000; //in packets
|
||||
uint32_t queueDiscSize = 1000; //in packets
|
||||
uint32_t queueSize = 10; //in packets
|
||||
uint32_t pktSize = 1458; //in bytes. 1458 to prevent fragments
|
||||
float startTime = 0.1;
|
||||
float simDuration = 60; //in seconds
|
||||
float simDuration = 60; //in seconds
|
||||
|
||||
bool isPcapEnabled = true;
|
||||
std::string pcapFileName = "pcapFilePfifoFast.pcap";
|
||||
@@ -99,8 +100,9 @@ int main (int argc, char *argv[])
|
||||
cmd.AddValue ("bottleneckDelay", "Bottleneck delay", bottleneckDelay);
|
||||
cmd.AddValue ("accessBandwidth", "Access link bandwidth", accessBandwidth);
|
||||
cmd.AddValue ("accessDelay", "Access link delay", accessDelay);
|
||||
cmd.AddValue ("queueDiscType", "Queue disc type: PfifoFast, CoDel", queueDiscType);
|
||||
cmd.AddValue ("queueSize", "Queue size in packets", queueSize);
|
||||
cmd.AddValue ("queueDiscType", "Bottleneck queue disc type: PfifoFast, CoDel", queueDiscType);
|
||||
cmd.AddValue ("queueDiscSize", "Bottleneck queue disc size in packets", queueDiscSize);
|
||||
cmd.AddValue ("queueSize", "Devices queue size in packets", queueSize);
|
||||
cmd.AddValue ("pktSize", "Packet size in bytes", pktSize);
|
||||
cmd.AddValue ("startTime", "Simulation start time", startTime);
|
||||
cmd.AddValue ("simDuration", "Simulation duration in seconds", simDuration);
|
||||
@@ -126,6 +128,7 @@ int main (int argc, char *argv[])
|
||||
GlobalValue::Bind ("ChecksumEnabled", BooleanValue (true));
|
||||
}
|
||||
|
||||
// Devices queue configuration
|
||||
Config::SetDefault ("ns3::QueueBase::Mode", StringValue ("QUEUE_MODE_PACKETS"));
|
||||
Config::SetDefault ("ns3::QueueBase::MaxPackets", UintegerValue (queueSize));
|
||||
|
||||
@@ -149,11 +152,18 @@ int main (int argc, char *argv[])
|
||||
InternetStackHelper stack;
|
||||
stack.InstallAll ();
|
||||
|
||||
// Access link traffic control configuration
|
||||
TrafficControlHelper tchPfifoFastAccess;
|
||||
tchPfifoFastAccess.SetRootQueueDisc ("ns3::PfifoFastQueueDisc", "Limit", UintegerValue (1000));
|
||||
|
||||
// Bottleneck link traffic control configuration
|
||||
TrafficControlHelper tchPfifo;
|
||||
tchPfifo.SetRootQueueDisc ("ns3::PfifoFastQueueDisc");
|
||||
tchPfifo.SetRootQueueDisc ("ns3::PfifoFastQueueDisc", "Limit", UintegerValue (queueDiscSize));
|
||||
|
||||
TrafficControlHelper tchCoDel;
|
||||
tchCoDel.SetRootQueueDisc ("ns3::CoDelQueueDisc");
|
||||
Config::SetDefault ("ns3::CoDelQueueDisc::Mode", EnumValue (CoDelQueueDisc::QUEUE_DISC_MODE_PACKETS));
|
||||
Config::SetDefault ("ns3::CoDelQueueDisc::MaxPackets", UintegerValue (queueDiscSize));
|
||||
|
||||
Ipv4AddressHelper address;
|
||||
address.SetBase ("10.0.0.0", "255.255.255.0");
|
||||
@@ -165,12 +175,13 @@ int main (int argc, char *argv[])
|
||||
NetDeviceContainer devicesAccessLink, devicesBottleneckLink;
|
||||
|
||||
devicesAccessLink = accessLink.Install (source.Get (0), gateway.Get (0));
|
||||
tchPfifo.Install (devicesAccessLink);
|
||||
tchPfifoFastAccess.Install (devicesAccessLink);
|
||||
address.NewNetwork ();
|
||||
Ipv4InterfaceContainer interfaces = address.Assign (devicesAccessLink);
|
||||
|
||||
devicesBottleneckLink = bottleneckLink.Install (gateway.Get (0), sink.Get (0));
|
||||
address.NewNetwork ();
|
||||
|
||||
if (queueDiscType.compare ("PfifoFast") == 0)
|
||||
{
|
||||
tchPfifo.Install (devicesBottleneckLink);
|
||||
|
||||
Reference in New Issue
Block a user