I find two methods for setting TCP queue.
The first one uses the "set queue" method of point to point helper, the second one uses the traffic control helper and its setqueueDisc method.
What's the main difference between those two ways? Are they equivalent in terms of the result? Are there any things worth paying attention to when implementing them?
The first one uses the "set queue" method, for example:
PointToPointHelper p2p;
p2p.SetQueue ("ns3::DropTailQueue"); // Drop Tail queue set
p2p.SetDeviceAttribute ("DataRate", StringValue ("10Mbps"));
p2p.SetChannelAttribute ("Delay", StringValue ("2ms"));
NetDeviceContainer devn0n2 = p2p.Install (n0, n2) ;
The second one I found in "tcp-variant-comparison.cc" uses queue Disc classes, for example:
TrafficControlHelper tchPfifo;
tchPfifo.SetRootQueueDisc ("ns3::PfifoFastQueueDisc");
Config::SetDefault ("ns3::PfifoFastQueueDisc::MaxSize",
QueueSizeValue (QueueSize (QueueSizeUnit::PACKETS, size / mtu_bytes)));
PointToPointHelper p2p;
p2p.SetDeviceAttribute ("DataRate", StringValue (access_bandwidth)); p2p.SetChannelAttribute ("Delay", StringValue (access_delay));
NetDeviceContainer devices = p2p.Install (n0, n1);
tchPfifo.Install (devices);