Setting Queue for TCP Connection

209 views
Skip to first unread message

Keith Jonathan

unread,
Feb 18, 2022, 11:35:08 AM2/18/22
to ns-3-users
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);  

Soulimane Mammar

unread,
Feb 19, 2022, 2:14:01 AM2/19/22
to ns-3-users
Hi,
These are totally different.
First of all, the Tx queue you install using SetQueue member function, is at the netdevice level (and not all netdevices support that function).
The traffic control queuing discipline (notice we are speaking about a discipline and  not queue) lives between L3 and L2 layers and can involve a set of queues. This is just like Linux TC.
At this level, we can  classify traffic using different criteria (application protocols, transport protocols, source/destination ports, source/destination addresses, ToS, ...etc) and then act on those classes (drop, throttle,  shape, prioritize, ...etc)

Regards

Message has been deleted

Keith Jonathan

unread,
Feb 21, 2022, 6:26:36 AM2/21/22
to ns-3-users
So for example, for TCP flows in simple dumbbell topology,  if I want to configure the queue size according to different data rates and delays, which of the two should I configure? By queue size, I mean the TCP mechanism where packets will be dropped if the capacity is exceeded due to congestion. 

To my understanding, because the RxDrop trace belongs to the "netDevice" class, using the setQueue on PointToPoint link and form a netdevice using that link would probably be the most appropriate?

Soulimane Mammar

unread,
Feb 21, 2022, 9:07:12 AM2/21/22
to ns-3-users
Hi,
It depends.  
If you set  a Tx queue on a netdevice, all outgoing packets will be queued on that particular queue (you'll have no power to select which traffic should be queued and how, in other words, all flows will live in the same queue TCP, ARP, UDP... etc)
If that's what you want it's ok to stick only on Tx queue.
Instead, if you want to differentiate between flows and how they must be treated (QoS) then Traffic Control is more appropriate
Regards

Reply all
Reply to author
Forward
0 new messages