We saw in the last video that QoS is applied at each hop in the network.
However, we still need to consider our strategy across the entire network.
The first critical step to this is marking traffic.
This is where traffic types are classified into categories
and QoS information is added to the the packet header.
It sounds simple, but there is more to it
than you realize.
And quality of service terms when a packet comes into a device
its traffic type is identified and it's given a classification of some sort.
If we want to, we can have this device immediately take action on the packet.
This might include policing, shaping or something else,
or we might decide to mark the packets.
What does this mean and why would we do it?
Imagine a
phone and a branch office when a phone call is made,
packets are sent out of the phone across the WAN link, to the head office.
Before the phone sends these packets, it will add a little extra information
to the IP header.
This identifiers of the packets contain voice data,
so we can say this phone is marking these packets.
When the packets arrive at the router,
The router can take a quick look at this marking.
The next part depends on how the router is configured.
Remember that each device has its own configuration and can make
its own decisions.
Generally, the router will read this marking
see that its voice traffic and realize that this is high priority.
If there's any congestion on the link,
the router will make sure that this packet gets through in a reasonable time.
So marketing packets
close to their source will help other devices along the path
to make smart decisions when they need to forward the packet on.
You can see that many devices are capable of marking packets, not just routers.
If the phone isn't clever enough to do it, perhaps this switch right near it could.
Now, do you think these markings are permanent?
That is, do they stick with the packet for its entire life?
Well, they certainly can, but they don't have to if we want to,
we can remark packets at nearly any point along the network.
Imagine if we have a few public phones, setup on our network,
perhaps in the lobby of our building so people can call a taxi or something.
They still generate voice traffic
and we'll still mark the packets in the same way.
But we would probably consider it to be less important than our other phones.
In this case, the switch or router could identify these packets
by matching this source IP address and remark the packets to a lower priority.
We might also want to remark traffic
if it comes from a source that we don't trust, like the internet.
If we don't trust the source, then we shouldn't trust the markings either.
We could remark this traffic or strip the markings out entirely.
Now that you know that traffic can be remarked,
you might be wondering, can my WAN provider remark my traffic
along the way and link your provider probably has a few network
devices that are completely out of your control.
So what's to stop them from changing your QoS markings?
Nothing
short of encrypting
your traffic will prevent them from being able to change your packet markings.
So this is something that you will need to discuss with them.
But did you know there are different ways we can mark our traffic?
We have class of service which uses layer two traffic.
Then there's
IP precedence, which is the older method for layer three.
We'll take a brief look at that, but we're really going to focus on
DSCP markings, which is the most common method.
But let's start with class of service. Ethernet
frames consist of a header payload and data in the header.
We might have an 802.1q field.
This field is here, if tagging is used,
that is if we're passing tagged frames across a trunk link.
Inside this field are a few sub
fields, one of which is called the PRI field.
This contains three class of service bits.
three bits means we have eight different combinations.
These are known as class selectors, or CS0 through to CS7.
The higher the class selector, the higher priority of the traffic.
We would use class of service markings
if we're dealing with layer-2 only traffic or if we have switches
that aren't able to inspect the IP headers,
usually we would prefer to use the layer-3 markings if we can.
The original type of layer three marking was called IP precedence.
This is now completely outdated, but you will see it in documentation
in various places, so I'll give you the quick overview before we move on.
Originally, the IPv4 header had an eight bit field
called type of service, similar to class of service.
These three bits were used in mark packets.
They were called precedence or precedence
zero through to seven.
But IP precedent is old and outdated.
These days, we use differentiated services code point
or DiffServ, which is also known as DSCP.
Unlike IP precedence, this is compatible
with both IPv4 and IPv6, we'll just assume IPv4 for now.
But the principle is the same for both.
The bits previously used for type of service
have been reallocated to the differentiated services field.
The first six bits are used and the remaining two are not used.
Of these six bits, three are called the class selector.
This makes DSCP backward compatible with IP precedence.
The remaining three are the drop probability.
We'll look at what these are used for soon.
But first, we need to understand classes
which are also known as forwarding classes.
A class is simply a category that we organized traffic into.
For example, we might have a class for Real-Time Traffic like voice and video.
We might have another class for network traffic like OSPF and BGP.
We can have a few classes or many classes.
The idea is that once a packet has been classified
that is assigned to a class our devices
can make decisions based on that class.
For example, a router would probably consider
any traffic that is part of the real time class to be very important,
and we'll take action to make sure that packets in that class
are delivered on time.
When a packet is marked with a DSCP value,
it has essentially already been allocated to a class.
The three code selector bits are used to mark the forwarding class.
This means that there are eight different forwarding classes,
each with their own name.
We often use the CS0 through to CS7 names,
which originally came from IP precedence, which is completely fine.
However,
when DSCP came along, some new names were added.
These are assured forwarding, expedited forwarding and best effort,
you'll see later on how these names make a bit more sense.
So far, this is not any different
to IP precedence, which also had eight categories.
However, we now have the extra three bits from the drop probability field.
You can think of these a bit like a subclass within each forwarding class.
That means that we could have interactive video and streaming video
in the same class, but we could assign them into different drop probabilities.
This would mean that a router could prioritize interactive video
over streaming video if it needed to.
one last thing to notice here is that we don't have multiple drop
probabilities for every class.
The reason
is that we don't really need that many different combinations.
Even the most complicated networks are fine with the classes
and drop probabilities that are shown here.
This might seem a bit intimidating at this point.
You might be thinking which traffic goes into which class.
Where does web browsing go?
What about database transactions, social media or my custom application?
Well, let me help simplify this for you.
You don't need to use every combination of class and drop probability, you might
keep it quite simple with only four or five classes like the model shown here.
In fact, if you're beginning a brand new QoS deployment,
this is a really good place to start.
There is a real time class for voice and interactive video.
Next, a class for critical data.
So this is where you put any of your business applications,
database transactions and business website traffic.
We might split this into two classes.
The point would be to give call signaling traffic like sip a higher priority.
If you're not familiar with it, this is the traffic that sets up
phone calls and video chats.
The next category is the best effort category.
This would be the default category, so any package that didn't get marked
would end up here.
This is for any traffic that doesn't need any special handling.
And finally, the scavenger class,
this is a traffic that we deem even less important than default.
This might include something like online games
that doesn't usually have any business relevance.
Often traffic in this class is limited
to a very small amount of bandwidth.
So what markings might we apply to these categories?
There's only five categories here.
So once again, it's really quite simple.
Real time traffic is marked with expedited forwarding.
This indicates that it needs quick and uninterrupted handling.
Call signaling is also pretty important
as it sets up phone calls in the first place.
So it would get a marking of either A31 or CS3.
Our other critical data would be lower than this,
so we may use CS2 marking for this.
Best effort traffic would have the BE marking.
This is setting the DSCP bits to all zeros.
So that's why we consider it the default class, all zero bits
means that there is really effectively no marking on the traffic.
The scavenger class is
lower again, and we give that the CS1 marking.
Remember that these are all just examples, and you could use different markings
if you want to.
However, doing it this way makes it easier to add more classes in between later on.
The four or five class model is very good
to start with and good for smaller and simpler networks.
A more complicated network may need to grow this
by adding more classes like the one shown here,
we might split real time traffic into voice and video.
We might then split video into interactive video and streaming video.
Full disclosure on this, I didn't design these models.
I can't take credit for that.
These are sample models that I happen to like,
which I originally found Cisco's website.
When it comes to choosing a QoS model.
Just try not to overcomplicate if you can work effectively
with a four class model, then stick with it.
It will make things much easier for you in the long run.
So we've covered packet markings.
We still need to take action on the traffic that belongs to each class.
There are a few considerations here, and we're going to look at those
in the next video. So please join me there.