Thanks for visiting! If you're new here, you may want to subscribe to my RSS feed. This blog posts regular tutorials, news, and study tips about networking, especially about Cisco CCIE related topics. Go ahead, subscribe to the rss feed! You can also receive updates from this blog via email. Thanks for visiting!
Fairness for the Little Guy.
Weighted Fair Queue (WFQ) is another congestion management strategy. It is very different from the other two congestion management strategies we have looked at (PQ and CQ), in that it does not need classification options configured. Traffic is automatically sorted and put into different queues without any kind of access-list or protocol matching configured by the user. It all happens automagically.
How does that work? WFQ classifies packets based on flows. What is a flow? Well a flow could be based on a number of things (source and destination address, protocol, source and destination port) but it identifies a train of packets. For example if you are surfing the web, you might have one train of packets coming in for the HTTP request, then another for the response, then another for the graphics and so on. WFQ calls these train of packets separate flows or conversations and puts each one automatically into a separate queue. Thats a whole bunch of queues, and the number of queues is changing dynamically all the time.
So instead of the user manually specifying criteria to manually create queues like CQ and PQ, WFQ uses the concept of flows to create queues on the fly. So that takes care of the classification difference, but what about the actual scheduling algorithm? Well as each flow arrives, the time of the very last bit to arrive is used to calculate a sequence number. The lower the sequence number the higher the chance that that queue will be emptied first. The end result of this is that lower volume traffic gets precedence over higher volume traffic.
The Magic Toll Booth.
Lets try come up with an analogy to explain this. Imagine a traffic toll booth. Okay its a magic traffic toll booth. We have cars of different sizes approaching to traffic toll booth. Cars, trucks, motorbikes, all vehicles of different sizes. As the vehicle approaches this magic toll booth creates a new lane for each of the vehicles. When each of the vehicles enter their own queue, the toll booth record the exact time the last wheel on your vehicle entered the new lane and stamps this time on the vehicle. Motor-cycles because they are smaller, will have their last wheel enter their new lane before a multi trailer truck enters its new lane for example. Who ever has the earliest entry time will get to go through the toll booth first. See how smaller vehicles get priority.
This is the basis of Weighted Fair Queue. It gives the little packets a chance. Without it, you might have lots of ftp traffic going on which would create fairly large packet trains. In a fifo queue a small telnet packet coming along would have to wait till the large ftp packet train is finished before it could go through. With Weighted Fair Queue, the smaller telnet packet would get right of way.
Implementing Weighted Fair Queuing
Weighted Fair Queuing is the default on links that are of E1 speed (2.048 Mbps) or slower. So if you have any of those speed links you don’t have to do anything! On all other links, or if you want more control, you can use the fair-queue command.
fair-queue [congestive-discard-threshold [dynamic-queues [reservable-queues]]]
Let turn on WFQ on an interface.
int serial0/0
fair-queue
This will turn on WFQ on the serial 0/0 interface. In its basic form, that’s it! The WFQ algorithm will automatically distinguish between flows and put them into their own queues, giving precedence to the smaller IP traffic.
We can specify the amount of messages in each queue by setting the congestive-discard-threshold (CDT). Think of this as the maximum size of each individual queue. Why didn’t they just call it a maximum individual queue size then? Well what actually happens is when the congestive-discard-threshold is reached, new arriving packets for the queue might not be dropped. If there is another message in another queue with a worse serial number (think entry time), it might get dropped instead.
int s0/0
fair-queue 2048 1024 0
This changes the CDT to 2048 instead of the default 64. The command above also changes the maximum number of dynamic queues to 1024 (think maximum number of flows at one time). The 0 at the end says that there is no queues being used with RSVP (Resource Reservation Protocol).
We can not only specify the default size of each queue with the CDT but we can specify the overall queue size or all the queue’s with the hold-queue command.
int s0/0
fair-queue 2048 1024 0
hold-queue 4096 out
This will set the maximum limit of one queue to 2048 (CDT), but the overall queue limt on the interface to 4096 (hold-queue). This means that even though one of the queues can have a maximum of 2048 messages, the combined total of all the queues cannot have more than 4096 messages.
Summary
Thats it for part I of WFQ. Yes there is more, which we will look at including QoS-group and ToS based Weighted Fair Queue.
HTH.
Discussion
No comments for “Implementing Weighted Fair Queuing”
Post a comment