Let's discuss ways to avoid congestion.
The main mechanism that we'll discuss here is w read or weighted random early detection w read is a
way to avoid congestion.
But before we discuss W read, let's look at the problem.
Cues on routers and switches are finite.
In other words, they can only hold or buffer a certain number of packets if there's a burst of traffic
and the buffers are overrun.
In other words, there are more packets arriving than can be transmitted and buffered by a router or
a switch.
It will start dropping packets.
When the queue falls up, all new packets arriving will be dropped.
That's called tail drop.
As an analogy, think of a bucket.
The bucket is filling up with water or packets.
Once the bucket is full, or in the case of a rod or switch, the queue is full.
Any new packets that arrive are dropped.
Because there's no space to buffer them or hold them in memory.
Now, when tale drop is used, it results in wasted bandwidth, especially when using TCP.
Here's an example of what happens when tail drop is used and you've got lots of TCP flows.
This hundred percent is 100% utilization of an interface.
The Y axis is utilization of an interface with 100% indicated by this line.
X-axis is time.
So what happens is if multiple flows start sending traffic.
And tell drop occurs at this point.
Packets from all flows are dropped.
Now what happens with TCP is that when packets are dropped.
The TCP senders slowed down.
In other words, they back off.
They slowed down.
And then they slowly increase the window size again to increase the speed of forwarding.
So what happens is the utilization of the interface goes down because the three senders back off.
In other words, they slow down.
They then increase their window size to increase the number of packets that they are transmitting before
getting an acknowledgement.
But when the buffers are full again, packets are dropped from all these flows, including any new flows
that start sending traffic.
So in this case, we have four centers backing off or slowing down.
Again, they increase their window size and increase the number of packets that they can transmit before
getting an acknowledgement.
And eventually it gets to the point where the buffers of a router or a switch off full again packets
from all flows are dropped, so they all slow down.
So the problem is, is when the bucket is full packets from multiple flows are being received.
There's no space to buffer them.
So packets are dropped from all the flows, all senders back off at the same time and then increase
speed at the same time.
So you end up having what's called global synchronization, where multiple senders are increasing their
window size at the same time.
They are slowing down at the same time, increasing their speed at the same time slowing down at the
same time and so forth and so on over time.
You never get full utilization of the interface.
Now the idea with red and congestion avoidance is you randomly drop packets from multiple flows before
the queue fills up.
So in other words, before the bucket is full or the queue is full, you're already dropping packets
from flows, but you do that randomly.
So you might drop a packet from flow one, which means flow one will slow down.
But while sender one is slowing down, sender two is increasing its speed because its packets haven't
been dropped.
So while one host is slowing down, another one is increasing its speed.
This happens randomly.
So you've got some hosts increasing their speed and some slowing down at the same time, instead of
all of them slowing down and all of them speeding up at the same time.
So Cisco uses W ret, which introduces this randomness to allow better utilization of an interface bandwidth.
Because some are slowing down and some are speeding up at the same time, which in aggregate gives you
a better utilization of the interface.
So the idea with rate is you have a minimum threshold and a maximum threshold.
These values are below the size of the full CU.
So the idea is when the average queue size or average queue depth is below.
The minimum threshold.
No packets are dropped.
When the average Q depth goes above the minimum threshold but is below the maximum threshold, we have
a random drops of packets.
But when it goes over the maximum threshold, we have full drops of a traffic clause.
The reason why we have w as in weighted random early detection is you can wait this based on different
classes.
So you can have different maximum thresholds for different traffic classes.
You may want to start dropping all FTP traffic before you drop http traffic.
So you can create different minimum and maximum thresholds so that certain traffic types are tail dropped
or fully dropped before other traffic types that could be based as an example on IP precedence or DCP.
So the idea with W read is we start dropping packets before the queue is full.
We are avoiding congestion by pre selecting which packets get dropped and typically you only want to
drop TCP packets because TCP flows will retransmit.
So randomly dropping packets instead of tail dropping them avoids global synchronization.
Different TCP flows are increasing their speed while others are slowing down.
So you get better utilization of a link.
You also ensure that there's buffer space left for your voice packets.
So you will set your maximum threshold low enough so that FTP packets are fully dropped.
While ensuring that they still space left in the buffer for voice traffic.
So in summary.
We have multiple quality of service mechanisms.
We have classification and marketing.
We have policing, shaping and remarking.
We have congestion management or scheduling tools.
And we have a link specific tools such as link fragmentation and interleaving.
The CNA course is only an introduction to quality of service.
Have a look at the quality of service.
SR and D Guide for more information about quality of service and good examples of how to apply quality
of service on physical switches and routers.