So here's the goal. We have an upstream ISP router or some device that's
performing
policing. And we know that if policing is going to decide which packets to drop
, it's
not going to care about the tags. It's just going to drop traffic indiscrim
inately, as
we've said. So what we want to do is we want to be able to configure traffic
shaping on
our router, which essentially means that we are going to drop the packets. But WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
our router, which essentially means that we are going to drop the packets. But
what this
means here, functionally, is that remember, we said we have a 75 megabit
connection,
but it's on a 100 meg line. So we are at risk of sending at 100 megabits per
second. And
that could result in dropped traffic. So what we're going to do instead is make
sure we
never transmit at that rate. Instead, we're going to transmit at 75 megabits
per second.
But what about the situation where we have all of this traffic coming in, and WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
But what about the situation where we have all of this traffic coming in, and
we've got
a bunch more traffic that we have to send than what 75 megabits per second
allows? Well,
that's what shaping is meant to do for us. Shaping is also going to run the
same token
bucket policy. And the general idea here is that we want to match the policy
that's on
the police. If we match the policy, it's on the police, or then we're going to WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
the police. If we match the policy, it's on the police, or then we're going to
only send
when there's a token. And if there are no tokens in the bucket, that means that
we are
going to have to drop a packet. Well, keep in mind, if we have the exact same
policy configured,
that meant that the police also has zero tokens in the bucket, and it would
have dropped the
packet. But we're not going to let it. We're going to drop the packet ourselves
before the
police ever gets a chance to do so. Now, if we wait until the last possible WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
police ever gets a chance to do so. Now, if we wait until the last possible
token is gone,
this might be an AF 41 packet, which we've used as an example to represent a
high priority packet.
And so we'd have to drop the high priority and that's no good. So instead, what
we're going to do
is we're going to rely on our weighted random early detect, because this is
running on the queues
themselves. We know that we can just hold packets in the queue. And so WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
themselves. We know that we can just hold packets in the queue. And so
ultimately, what we're saying
is we're not going to just drop a packet because it's time to send a packet and
there's no tokens.
Instead, what we're going to do is we're going to hold our position. We're just
going to
not transmit a packet if we know that there's no token on the other side. Now,
what happens
eventually if we're just holding and not transmitting packets, well, we know
what's going to happen
is our queues are going to fill up over time. And even though tokens are
getting inserted in at a WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
getting inserted in at a
particular rate, we are going to find that the sending the occasional packet,
if we're overloaded,
is not going to ease up on these queues. This is why red is so important,
because each one of these
queues is going to be performing some amount of that random percentage for
dropping frames,
or dropping packets, which means that as packets are coming into these queues,
we might see that,
hey, I've got a 43 coming in, I'd better drop that. And a 41 is coming in, oh, WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
hey, I've got a 43 coming in, I'd better drop that. And a 41 is coming in, oh,
we're going to place
that into the queue and try to manage our queues as much as possible. So now
red is even more important
with a shaping policy, because as we hold and don't send to the police, or now
we need to still
make sure that on the back end that we're dropping the appropriate packets. So
now because of this,
we're going to find that there is never in theory a reason to drop a packet.
Instead, all drops are
managed by us and by weighted random early detect. Now an important part of all WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
managed by us and by weighted random early detect. Now an important part of all
of this is to think
about the direction of these different policies. So notice, if I'm going to be
shaping
my traffic, this is an outgoing, otherwise known as an egress type of policy. I
'm not going to
shape as I bring packets into my router, it doesn't make any sense, I can't
actually do that. But I
can shape when I'm sending upstream, especially if I know that there's a police WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
can shape when I'm sending upstream, especially if I know that there's a police
or upstream. This
is typically when we want to deploy a shaper. Meanwhile, conversely, our
policing is typically
an ingress policy. Now Cisco does allow us to configure this on an outgoing
interface.
But usually it's better to configure shaping on an outgoing interface. But keep
in mind that just
from a practical real world perspective, that policing maps to ingress or
incoming interfaces, WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
incoming interfaces,
because I'm going to drop traffic that you're sending me if it's too much.
Meanwhile, I'm trying
to match your policy and meet you with traffic shaping. And so ultimately what
we have, if we can
try to visualize this a little bit, is I'm going to allow this much traffic,
whatever this amount
is, this is what's allowed. And so with my shaping policy, I might have this
much traffic.
So this is my packets that I have to send. So what I'm going to do is I'm going WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
So this is my packets that I have to send. So what I'm going to do is I'm going
to shape it down
to meet your restrictions. And yes, if this means that I have to drop my own
traffic in the meantime,
then so be it. But for the most part, my initial desire is just to hold my
transmits,
so that I'm only transmitting such that when you receive a packet, I know that
you're not going
to drop it. So as we see shaping compliments, policing in a very meaningful way WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
to drop it. So as we see shaping compliments, policing in a very meaningful way
, and we should
expect to be deploying shaping on any interface where we expect traffic to be
dropped upstream
if we exceed or violate a policy.