Let's discuss ways to avoid congestion.
The main mechanism that we'll discuss here is a W read or weighted random early detection w rate is
a way to avoid congestion.
But before we discuss w rate 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 with
switch.
It will started dropping packets when the queue folds up.
All new packets arriving will be dropped.
That's called tailed 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 a 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 tail drop is used it results in wasted bandwidth especially when using TCE P here's an example
of what happens when tailed drop is used and you've got lots of TCB flows the 100 percent is 100 percent
utilization of an interface the y axis is utilization of an interface with 100 percent 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 TTP is that when packets are dropped the TTP senders slow down.
In other words they back off they slow down and then they slowly increase the window size again to increase
the speed of forwarding.
So what happens is the utilization of interface goes down because the three centers back off.
In other words they slow down they then increase they would decide 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 senders 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
are full again.
Packets from all flows are dropped so they all slowed 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 centers back off at the same time and then increase speed
at the same time.
C end up having what's called a global synchronization where multiple centres are increasing their window
size at the same time.
They're 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 w red and congestion avoidance is you randomly drop packets from multiple flows before
the queue folds up so in other words before the bucket is full or the cube is full you are ready 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 center one is slowing down send it to 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 red which introduces this randomness to allow better utilization of an interface interfaces 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 W rate is you have a minimum threshold and a
maximum threshold these valleys are below the size of the full queue.
So the idea is when the average queue size or average queue depth is below the minimum threshold.
Note packets have dropped when the average queue depth goes above the minimum threshold but is below
the maximum threshold.
We have random drops of packets but when it goes over the maximum threshold we have full drops of a
traffic CLOs.
The reason why we have W as in weighted random early detection is you can weight this based on different
classes so you can have different maximum thresholds for different traffic classes.
You may want to start dropping all FCP traffic before you drop HDP traffic so you can create a different
minimum and maximum threshold so that certain traffic types are tailed dropped or fully dropped before
other traffic times that can be based as an example on IP precedents or DCP so the idea with w red is
we started dropping packets before the queue is full.
We are avoiding congestion by pre selecting which packets get dropped and typically only want to drop
DCP packets because TTP flows will read transmit so randomly dropping packets instead of tail dropping
them avoids global synchronization.
Different TTP flows are increasing their speed while others are slowing down so you get better utilization
of a link.
You also ensure that there is buffer space left for your voice packets so you will set your maximum
threshold low enough so that FCP 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 mocking.
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 into leaving the issue a course is only an introduction
to quality of service.
Have a look at the quality of service s or indeed guide for more information about quality of service
and good examples of how to apply quality of service on physical switches and routers.