-: As I mentioned before, 2 2
we have different ways of categorizing our traffic. 3 3
We can do it through classification, marking, 4 4
utilizing congestion management, congestion avoidance, 5 5
policing and shaping, and link efficiency. 6 6
All of these ways, are ways for us to help implement 7 7
our quality of service and take us from this to this. 8 8
Now, as you can see, 9 9
we want to start shaping out those peaks and valleys 10 10
using these different mechanisms 11 11
to give us a better quality of service. 12 12
Now, when we look at the classification of traffic, 13 13
traffic is going to be placed 14 14
into these different categories. 15 15
Now, this is going to be done 16 16
based on the type of traffic that it is. 17 17
There's email, but even inside of email, 18 18
we have many different classes 19 19
of information inside of an email. 20 20
If you think about email, 21 21
we have POP3 traffic, we have IMAP traffic. 22 22
We have SMTP traffic. We have Exchange traffic. 23 23
Those are four different types right there. 24 24
And so we can look at the headers 25 25
and we can look at the packet type of information 26 26
and we can even use the ports that are being used. 27 27
And then we can determine what services 28 28
need higher or less priority. 29 29
We can then do this, not just across email, 30 30
but across all of our traffic. 31 31
And by doing this, this classification 32 32
doesn't alter any bits in the frame itself or the packet. 33 33
Instead, there is no marking inside of there. 34 34
It's all based on the analysis of the packet itself, 35 35
the ports and the protocols used, 36 36
and our switches and routers are going to implement QoS 37 37
based on that information. 38 38
Now, another way to do this, is by marking that traffic. 39 39
With this, we're going to alter the bits within the frame. 40 40
Now we can do this inside frames, cells, or packets, 41 41
depending on what networks we're using. 42 42
And this will indicate how we handle this piece of traffic. 43 43
Our network tools are going to make decisions 44 44
based on those markings. 45 45
If you look at the type of service header, 46 46
it's going to have a byte of information or eight bits. 47 47
The first three of that eight bits is the IP Precedence. 48 48
The next six of that is going to be 49 49
the differential control protocol or DSP. 50 50
Now you don't need to memorize 51 51
how this type of service is done inside the header. 52 52
But I do want you to remember one of the ways 53 53
that we can do this quality service 54 54
is by marking and altering that traffic. 55 55
Next, we have congestion management. 56 56
And when a device receives traffic 57 57
faster than it can be transmitted, 58 58
it's going to end up buffering that extra traffic 59 59
until bandwidth becomes available. 60 60
This is known as queuing. 61 61
The queuing algorithm is going to empty the packets 62 62
in a specified sequence and ML. 63 63
These algorithms are going to use one of three mechanisms. 64 64
There is a weighted fair queuing. 65 65
There's a low-latency queuing, 66 66
or there is a weighted round-robin. 67 67
Now let's look at this example I have here. 68 68
I have four categories of traffic: 69 69
Traffic 1, 2, 3, and 4. 70 70
It really doesn't matter what kind of traffic it is, 71 71
for our example right now, 72 72
we just need to know that there's four categories. 73 73
Now, if we're going to be using a weighted fair queuing, 74 74
how are we going to start emptying these piles of traffic? 75 75
Well, I'm going to take one from 1, one from 2, 76 76
one from 3, and one from 4. 77 77
Then I'm going to go back to 1 and 2 and 3 and 4. 78 78
And we'll just keep taking turns. 79 79
Now, is that a good mechanism? 80 80
Well, maybe. It depends on what your traffic is. 81 81
If column 1, for example, was representing VoIP traffic, 82 82
this actually, isn't a very good mechanism, 83 83
because it has us to keep waiting for our turn. 84 84
So instead, let's look at this low-latency queuing instead. 85 85
Based on our categories of 1, 2, 3, and 4, 86 86
we're going to assign priorities to them. 87 87
If 1 was a higher priority than 2, 88 88
then all of 1 would get emptied, 89 89
then all of 2 would get emptied, 90 90
and then all 3 and then all of 4. 91 91
Now this works well to prioritize things like 92 92
voice and video. 93 93
But if you're sitting in category 3 or 4, 94 94
you might start really receiving 95 95
a lot of timeouts and drop packets 96 96
because it's never going to be your turn. 97 97
And you're just going to wait and wait and wait. 98 98
Now the next one we have is called the weighted round-robin. 99 99
And this is actually one of my favorites. 100 100
This is kind of a hybrid between the other two. 101 101
Now with a weighted round-robin, 102 102
we might say that category 1 is VoIP, 103 103
and category 2 is video, category 3 is web, 104 104
and category 4 is email. 105 105
And so we might say that in the priority order, 106 106
1 is going to be highest 107 107
and we're going to use a weighted round-robin, 108 108
and we might say, we're going to take three 109 109
out of category 1, two out of category 2, 110 110
and then one out of 3 and one out of 4. 111 111
And we'll keep going around that way. 112 112
We'll take three, two, one, one, three, two, one, one. 113 113
And we keep going. 114 114
That way, VoIP traffic is getting a lot of priority. 115 115
Video is getting the second highest priority. 116 116
And then we start looking at web and email 117 117
at the bottom of the barrel, 118 118
but they're still getting a turn 119 119
every couple of rounds here. 120 120
And so that way it becomes a weighted round-robin. 121 121
As I said, this is the quality of service mechanism 122 122
that I really like to implement inside my own networks. 123 123
Next, we have the idea of congestion avoidance. 124 124
As new packets keep arriving, they can be discarded 125 125
if the output queue is already filled up. 126 126
Now, I like to think about this as a bucket. 127 127
As you can see here, I have a cylinder on the bottom 128 128
and it has a minimum and a maximum. 129 129
Now, if it's already at maximum and you try 130 130
to put more into the bucket, 131 131
it just overflows over the top. 132 132
Now to help prevent this, we have what's called 133 133
the RED or random early detection. 134 134
This is used to prevent this overflow from happening for us. 135 135
As the queue starts approaching that maximum, 136 136
we have this possibility 137 137
that discard is going to happen. 138 138
And so we start doing is we start dropping traffic. 139 139
Instead of just dropping traffic randomly, 140 140
we're going to drop it based on priority, 141 141
with the lowest traffic priority getting dropped first. 142 142
RED is going to drop packets from the selected queues 143 143
based on their defined limits. 144 144
Now I might start dropping TCP traffic first 145 145
because I know it'll retransmit itself. 146 146
Where UDP, if you drop it, it's gone forever. 147 147
And so I might keep that in my queue a little bit longer, 148 148
so it doesn't get dropped. 149 149
Now, that's the idea here with TCP traffic, 150 150
even if I drop it, we're going to get that retransmission 151 151
and we'll try again. 152 152
But with UDP, if it dropped, 153 153
you're never going to know about it, 154 154
and you're going to have loss of service. 155 155
Now, when you're dealing with congestion avoidance, 156 156
we're going to try to use the buffer 157 157
to our advantage, and be able to use it to help us 158 158
get more bandwidth through. 159 159
Now, when we start putting all these things together, 160 160
we start getting into these two concepts, 161 161
known as policing and shaping. 162 162
Policing is going to discard packets 163 163
that exceed the configured rate limit, 164 164
which we like to refer to as our speed limit. 165 165
Just like if you're driving down the highway too fast, 166 166
you're going to get pulled over by a cop 167 167
and you're going to get a ticket. 168 168
That's what policing is going to do for us. 169 169
Now, we're just going to go and drop you off the network 170 170
anytime you're going too fast. 171 171
So, drop packets are going to result in retransmissions, 172 172
which then creates more bandwidth. 173 173
Therefore, policing is only good 174 174
for very high-speed interfaces. 175 175
If you're using a dial up modem or an ISDN connection, 176 176
or even a T1, you probably don't want to use policing. 177 177
You're much better off using our second method, 178 178
which is known as shaping. 179 179
Now, what shaping is going to do for us 180 180
is it's going to allow the buffer 181 181
to delay traffic from exceeding the configured rate. 182 182
Instead of dropping those packets like we did in policing, 183 183
we're just going to hold them in our buffer. 184 184
Then when it's empty and there's space available, 185 185
we're going to start pushing it 186 186
over that empty space and start shaping out the packets. 187 187
This is why we call it shaping or packet shaping. 188 188
Now you can see what this looks like here on the screen. 189 189
I have traffic at the top, 190 190
and you'll see all those jagged lines going down. 191 191
Now, what really happens here in your network 192 192
is there's this high period of time, 193 193
and there's low periods of time, 194 194
because not everything is happening 195 195
all the time in an equal amount. 196 196
If we do policing, all we did was chop off the tops, 197 197
which gave us more retransmissions and was shaping. 198 198
Instead, we're going to start filling 199 199
in from the bottom, from our queue. 200 200
So it keeps up there right towards the speed limit 201 201
without going over it. 202 202
Again, shaping does a better job 203 203
of maximizing your bandwidth, 204 204
especially on slow speed interfaces, 205 205
like a T1 connection, a dial up, 206 206
satellite connections, or ISDN. 207 207
Then the last thing we need to talk about here 208 208
is link efficiency. 209 209
Now there's a couple of things we need to mention 210 210
in regard to link efficiency. 211 211
The first of which is compression. 212 212
To get the most out of your link, 213 213
you want to make it the most efficient possible. 214 214
And so to do that, we can compress our packets. 215 215
If we take our payloads and we compress it down, 216 216
that's going to conserve bandwidth 217 217
because it's less ones and zeros 218 218
that need to go across the wire. 219 219
VoIP is a great thing that you can compress 220 220
because there's so much extra space 221 221
that's wasted inside of voice traffic. 222 222
VoIP payloads can actually be reduced 223 223
by up to 50% of their original space. 224 224
We could take it down from 40 bytes 225 225
down to 20 bytes by using compression. 226 226
If you think that's good, look at the VoIP header. 227 227
I can compress the VoIP header down 228 228
from 90 or 95% of its original value. 229 229
I can take it from 40 bites down to just two to four bytes. 230 230
To do this, we use something called compressed RTP or cRTP. 231 231
Now, when I have the original VoIP payload, 232 232
as you can see here, I have an IP address, 233 233
I have UDP as my packet type, 234 234
and I have RTP for its header. 235 235
And then I have my voice payload. 236 236
I can compress all of that down into just a cRTP, 237 237
which consolidates the IP, the UDP, 238 238
and the RTP altogether into one. 239 239
The voice payload can also be squeezed down 240 240
to about half of its size. 241 241
Now you're not going to notice a big difference 242 242
in your audio quality either by doing this, 243 243
this can be utilized on slower speed links 244 244
to make the most of your limited bandwidth. 245 245
And it's not just for VoIP. 246 246
You can do this with other types of data too. 247 247
Compression is a great thing to use. 248 248
They have devices out there called WAN accelerators. 249 249
That focus specifically on compressing your data 250 250
before sending it out your WAN link. 251 251
The last thing I want to talk about here 252 252
is what we call LFI, which is another method 253 253
to make more efficient use of your links. 254 254
This is known as link fragmentation and interleaving. 255 255
Now what this does is if you have a really big packet, 256 256
it'll start chopping those up 257 257
and take those big packets and fragment them, 258 258
and then interleave smaller packets in between them. 259 259
This way, it's going to allow you to utilize 260 260
those slower speed links to make the most 261 261
of your limited bandwidth. 262 262
Notice here I have three voice packets, 263 263
and one big chunk of data. 264 264
Now what the router would do, is it's going to chop up 265 265
and put that one small voice piece 266 266
and then one small data piece, 267 267
and then one small voice piece, 268 268
and one small data piece. 269 269
That way, the voice doesn't suffer 270 270
from huge latency by waiting for that big piece 271 271
of data to go through first. 272 272
By doing this fragmentation and interleaving, 273 273
it allows you to get some of that high priority traffic out 274 274
in between those larger data structures as well.