Configuring Basic Packet Flow Through the Junos OS CoS Process
Figure 1 and Figure 2 show the components of the
Junos OS CoS features, illustrating the sequence in which they interact.
Figure 1: CoS Classifier, Queues,
and Scheduler
Figure 2: Packet Flow Through CoS-
Configurable Components
The following configuration demonstrates the
packet flow through the CoS process:
Define Classifiers
If you trust the CoS values in the packet headers, you can use
behavior aggregate classification to map those values to a forwarding
class and drop priority. For example:
[edit class-of-service]
classifiers {
exp exp_classifier {
forwarding-class data-queue {
loss-priority low code-points 000;
loss-priority high code-points 001;
}
forwarding-class video-queue {
loss-priority low code-points 010;
loss-priority high code-points 011;
}
forwarding-class voice-queue {
loss-priority low code-points 100;
loss-priority high code-points 101;
}
forwarding-class nc-queue {
loss-priority low code-points 110;
loss-priority high code-points 111;
}
}
If you do not trust the CoS values in the packet headers, you
can use the more complex multifield classification to map ingress
traffic to a forwarding class and drop priority. For example:
Apply Classifiers to Incoming Packets on Interfaces
You apply behavior aggregate classifiers to logical interfaces
at the [edit class-of-service interfaces] hierarchy level.
For example:
[edit class-of-service]
interfaces {
so-* {
unit 0 {
classifiers {
exp exp_classifier;
}
}
}
t3-* {
unit 0 {
classifiers {
exp exp_classifier;
}
}
}
}
You apply multifield classifiers as input filters to logical
interfaces at the [edit interfaces] hierarchy level. For
example:
[edit interfaces]
fe-0/0/2 {
unit 0 {
family inet {
filter {
input classify;
}
address 10.12.0.13/30;
}
}
}
Define Policers to Limit Traffic and Control Congestion
If you need to rate-limit a traffic flow, either by discarding
excess traffic (hard policing) or reassign excess traffic to a different
forwarding class and/or loss priority (soft policing), define a policier
and apply the policer to a firewall filter for that traffic flow.
For example: