1 00:00:00,460 --> 00:00:03,100 Let's discuss ways to avoid congestion. 2 00:00:03,910 --> 00:00:11,290 The main mechanism that we'll discuss here is w read or weighted random early detection w read is a 3 00:00:11,290 --> 00:00:13,690 way to avoid congestion. 4 00:00:13,690 --> 00:00:17,320 But before we discuss W read, let's look at the problem. 5 00:00:17,680 --> 00:00:20,910 Cues on routers and switches are finite. 6 00:00:20,920 --> 00:00:27,970 In other words, they can only hold or buffer a certain number of packets if there's a burst of traffic 7 00:00:27,970 --> 00:00:29,860 and the buffers are overrun. 8 00:00:29,980 --> 00:00:37,010 In other words, there are more packets arriving than can be transmitted and buffered by a router or 9 00:00:37,010 --> 00:00:37,690 a switch. 10 00:00:38,140 --> 00:00:40,120 It will start dropping packets. 11 00:00:41,380 --> 00:00:46,120 When the queue falls up, all new packets arriving will be dropped. 12 00:00:46,510 --> 00:00:48,490 That's called tail drop. 13 00:00:49,870 --> 00:00:52,570 As an analogy, think of a bucket. 14 00:00:52,930 --> 00:00:56,890 The bucket is filling up with water or packets. 15 00:00:57,340 --> 00:01:02,800 Once the bucket is full, or in the case of a rod or switch, the queue is full. 16 00:01:03,040 --> 00:01:06,130 Any new packets that arrive are dropped. 17 00:01:07,050 --> 00:01:10,530 Because there's no space to buffer them or hold them in memory. 18 00:01:11,040 --> 00:01:18,360 Now, when tale drop is used, it results in wasted bandwidth, especially when using TCP. 19 00:01:19,500 --> 00:01:25,260 Here's an example of what happens when tail drop is used and you've got lots of TCP flows. 20 00:01:25,970 --> 00:01:29,300 This hundred percent is 100% utilization of an interface. 21 00:01:29,600 --> 00:01:36,350 The Y axis is utilization of an interface with 100% indicated by this line. 22 00:01:37,360 --> 00:01:39,280 X-axis is time. 23 00:01:40,060 --> 00:01:44,380 So what happens is if multiple flows start sending traffic. 24 00:01:45,300 --> 00:01:48,090 And tell drop occurs at this point. 25 00:01:48,360 --> 00:01:50,580 Packets from all flows are dropped. 26 00:01:51,200 --> 00:01:54,740 Now what happens with TCP is that when packets are dropped. 27 00:01:55,400 --> 00:01:57,980 The TCP senders slowed down. 28 00:01:58,310 --> 00:02:00,020 In other words, they back off. 29 00:02:00,440 --> 00:02:01,430 They slowed down. 30 00:02:01,430 --> 00:02:07,370 And then they slowly increase the window size again to increase the speed of forwarding. 31 00:02:07,880 --> 00:02:13,470 So what happens is the utilization of the interface goes down because the three senders back off. 32 00:02:13,490 --> 00:02:15,050 In other words, they slow down. 33 00:02:15,860 --> 00:02:21,170 They then increase their window size to increase the number of packets that they are transmitting before 34 00:02:21,170 --> 00:02:22,490 getting an acknowledgement. 35 00:02:22,790 --> 00:02:30,200 But when the buffers are full again, packets are dropped from all these flows, including any new flows 36 00:02:30,200 --> 00:02:32,000 that start sending traffic. 37 00:02:32,720 --> 00:02:36,170 So in this case, we have four centers backing off or slowing down. 38 00:02:36,620 --> 00:02:41,420 Again, they increase their window size and increase the number of packets that they can transmit before 39 00:02:41,420 --> 00:02:42,650 getting an acknowledgement. 40 00:02:43,270 --> 00:02:49,330 And eventually it gets to the point where the buffers of a router or a switch off full again packets 41 00:02:49,330 --> 00:02:52,600 from all flows are dropped, so they all slow down. 42 00:02:53,350 --> 00:02:59,260 So the problem is, is when the bucket is full packets from multiple flows are being received. 43 00:02:59,590 --> 00:03:01,210 There's no space to buffer them. 44 00:03:01,870 --> 00:03:08,950 So packets are dropped from all the flows, all senders back off at the same time and then increase 45 00:03:08,950 --> 00:03:10,690 speed at the same time. 46 00:03:11,290 --> 00:03:17,470 So you end up having what's called global synchronization, where multiple senders are increasing their 47 00:03:17,470 --> 00:03:19,030 window size at the same time. 48 00:03:19,830 --> 00:03:25,350 They are slowing down at the same time, increasing their speed at the same time slowing down at the 49 00:03:25,350 --> 00:03:28,950 same time and so forth and so on over time. 50 00:03:28,980 --> 00:03:32,460 You never get full utilization of the interface. 51 00:03:33,060 --> 00:03:41,940 Now the idea with red and congestion avoidance is you randomly drop packets from multiple flows before 52 00:03:42,060 --> 00:03:43,560 the queue fills up. 53 00:03:44,610 --> 00:03:50,580 So in other words, before the bucket is full or the queue is full, you're already dropping packets 54 00:03:50,580 --> 00:03:53,970 from flows, but you do that randomly. 55 00:03:54,090 --> 00:04:00,360 So you might drop a packet from flow one, which means flow one will slow down. 56 00:04:00,990 --> 00:04:07,920 But while sender one is slowing down, sender two is increasing its speed because its packets haven't 57 00:04:07,920 --> 00:04:08,640 been dropped. 58 00:04:09,680 --> 00:04:13,880 So while one host is slowing down, another one is increasing its speed. 59 00:04:14,540 --> 00:04:16,040 This happens randomly. 60 00:04:16,040 --> 00:04:22,040 So you've got some hosts increasing their speed and some slowing down at the same time, instead of 61 00:04:22,040 --> 00:04:27,170 all of them slowing down and all of them speeding up at the same time. 62 00:04:28,190 --> 00:04:37,730 So Cisco uses W ret, which introduces this randomness to allow better utilization of an interface bandwidth. 63 00:04:37,880 --> 00:04:44,210 Because some are slowing down and some are speeding up at the same time, which in aggregate gives you 64 00:04:44,210 --> 00:04:46,310 a better utilization of the interface. 65 00:04:47,050 --> 00:04:52,240 So the idea with rate is you have a minimum threshold and a maximum threshold. 66 00:04:53,090 --> 00:04:56,960 These values are below the size of the full CU. 67 00:04:57,770 --> 00:05:03,020 So the idea is when the average queue size or average queue depth is below. 68 00:05:03,860 --> 00:05:05,150 The minimum threshold. 69 00:05:05,150 --> 00:05:06,560 No packets are dropped. 70 00:05:07,830 --> 00:05:15,000 When the average Q depth goes above the minimum threshold but is below the maximum threshold, we have 71 00:05:15,000 --> 00:05:16,740 a random drops of packets. 72 00:05:17,740 --> 00:05:23,980 But when it goes over the maximum threshold, we have full drops of a traffic clause. 73 00:05:25,420 --> 00:05:33,070 The reason why we have w as in weighted random early detection is you can wait this based on different 74 00:05:33,070 --> 00:05:34,090 classes. 75 00:05:35,090 --> 00:05:40,280 So you can have different maximum thresholds for different traffic classes. 76 00:05:41,130 --> 00:05:47,700 You may want to start dropping all FTP traffic before you drop http traffic. 77 00:05:48,420 --> 00:05:54,870 So you can create different minimum and maximum thresholds so that certain traffic types are tail dropped 78 00:05:54,870 --> 00:06:02,550 or fully dropped before other traffic types that could be based as an example on IP precedence or DCP. 79 00:06:03,290 --> 00:06:11,030 So the idea with W read is we start dropping packets before the queue is full. 80 00:06:11,540 --> 00:06:19,010 We are avoiding congestion by pre selecting which packets get dropped and typically you only want to 81 00:06:19,010 --> 00:06:23,870 drop TCP packets because TCP flows will retransmit. 82 00:06:23,870 --> 00:06:29,540 So randomly dropping packets instead of tail dropping them avoids global synchronization. 83 00:06:30,080 --> 00:06:34,280 Different TCP flows are increasing their speed while others are slowing down. 84 00:06:34,280 --> 00:06:36,950 So you get better utilization of a link. 85 00:06:37,830 --> 00:06:42,090 You also ensure that there's buffer space left for your voice packets. 86 00:06:43,000 --> 00:06:49,960 So you will set your maximum threshold low enough so that FTP packets are fully dropped. 87 00:06:50,780 --> 00:06:55,820 While ensuring that they still space left in the buffer for voice traffic. 88 00:06:56,960 --> 00:06:58,070 So in summary. 89 00:06:58,600 --> 00:07:01,600 We have multiple quality of service mechanisms. 90 00:07:01,750 --> 00:07:03,970 We have classification and marketing. 91 00:07:04,270 --> 00:07:06,820 We have policing, shaping and remarking. 92 00:07:07,510 --> 00:07:10,600 We have congestion management or scheduling tools. 93 00:07:11,110 --> 00:07:15,640 And we have a link specific tools such as link fragmentation and interleaving. 94 00:07:16,240 --> 00:07:19,960 The CNA course is only an introduction to quality of service. 95 00:07:20,110 --> 00:07:21,910 Have a look at the quality of service. 96 00:07:21,940 --> 00:07:29,200 SR and D Guide for more information about quality of service and good examples of how to apply quality 97 00:07:29,200 --> 00:07:32,290 of service on physical switches and routers.