Juniper Cos
Juniper Cos
Juniper Cos
Junos CoS enables prioritization of traffic flows over a common path. It offers a means to recognize and control different types of
traffic, provides the ability for applications to be considered more or less important, and provides mechanisms to manage congestion.
Junos CoS is implemented “hop by hop”, at each device in the data path.
NETWORK DEVICE
CLASSIFICATION POLICING
Class A (Queue 1)
Policer Further
Data
Data Data Data Accept CoS
processing
Class B (Queue 2) Traffic within
Further CoS thresholds
Data Data Data Classifier Data processing
Traffic exceeding
thresholds
Class C (Queue 3)
(make lower priority)
Data
Drop
Classifiers assign inbound traffic to forwarding classes. Policing controls inbound traffic burstiness.
• Forwarding classes are linked to physical queues in the device. • Defines what is considered “too much” traffic.
Classifiers also specify packet loss priority (drop precedence). • Provides first-level congestion management.
• Used by policers and schedulers to help determine which traffic to drop under congestion. Thresholds determine in-profile vs. excess traffic.
Bandwidth
Junos OS includes four default classes: • Bandwidth – data rate for traffic sent through policer (in bps).
• Best effort (BE), Expedited forwarding (EF), Assured forwarding (AF), Network control (NC). • Burst size – number of bytes allowed during a burst (in bytes).
Three methods of classification: • Both thresholds exceeded together = excess traffic.
Burst Size
• Behavior aggregate (BA) – separates incoming traffic based on existing CoS markings. Two policer actions:
• Multifield (MF) – separates incoming traffic based on packet header fields. • ‘Hard’ policer – drops excess traffic.
• Fixed – assigns all of an interface’s incoming traffic to one forwarding class. • ‘Soft’ policer – marks excess traffic with lower priority.
QUEUING/SCHEDULING SHAPING
Class A (Queue 1)
Data
Outbound packets at line rate Outbound packets at sub-line rate
Data
Class B (Queue 2) Further
Further
Scheduler Data Data Data CoS Data Data Data Data Shaper Data Data Data CoS
Data processing processing
Data
Class C (Queue 3)
Data
Queuing and scheduling control the prioritization of traffic flows. Shaping controls outbound traffic flow.
• Defines treatment of packets and queues. • Throttles the amount of traffic passing through an interface or queue to less than line rate.
Each queue has four configurable characteristics: • Provides egress rate-limiting for downstream congestion management.
• Transmission rate – bandwidth assigned to the queue.
• Priority – importance of the queue (relative to other queues).
• Delay buffer – storage space during congestion.
• Congestion management (drop profiles) – amount and type of traffic to drop as
congestion increases.
REMARKING
Rewrite
Data Data Data Data Data Data
rules
Class C Class B Class A DSCP DSCP DSCP
xxxxxx yyyyyy zzzzzz
Identification Flags Fragment Offset Payload Length Next Header Hop Limit
DSCP
Traffic Class
IP DSCP
Precedence (formerly EXP)
Junos CoS
Class of Service Feature Learning Bytes Series: Day One: Deploying Day One: Junos QoS Training Course: Junos Learn About: Juniper Networks
Guide for Routing Devices Class of Service Basics Basic QoS for IOS Engineers Class of Service (JCOS) Quality of Service (QoS) Information and
©2016 by Juniper Networks, Inc. All rights reserved. Juniper Networks assumes no responsibility for any inaccuracies in this document. Juniper Networks reserves the right to change, Learning Experience (iLX)
modify, transfer, or otherwise revise this publication without notice.
www.juniper.net/posters
ISBN: 978-1-941441-33-6 234567
Configuring Junos CoS
This example contains the main CoS configuration elements for a device running the Junos OS: forwarding classes, classifiers,
policers, schedulers, shapers, and rewrite rules. Note that this example is for illustrative purposes only; while functional, there
are many more configuration options and advanced settings not displayed here.
class-of-service {
classifiers { firewall {
dscp DSCP-BA-CLASSIFIER { A family inet {
forwarding-class Voice { filter MF-CLASSIFIER { C
loss-priority low code-points ef; term VOICE {
} from {
forwarding-class Data-1 { protocol udp;
Code Point Aliases port 16384-32767;
loss-priority low code-points af41;
CLASSIFICATION
WRED-DROP-PROFILE-MODERATE { D }
af42 100100 term CALL-SIGNALING {
fill-level 75 drop-probability 20; af43 100110
fill-level 85 drop-probability 35; from {
be 000000 protocol tcp;
fill-level 95 drop-probability 50; cs1 001000
fill-level 100 drop-probability 100; port 1720;
cs2 010000 }
} cs3 011000
WRED-DROP-PROFILE-AGGRESSIVE { D then {
cs4 100000 loss-priority high;
fill-level 50 drop-probability 10; cs5 101000
fill-level 70 drop-probability 40; forwarding-class Data-1;
cs6 110000 accept;
fill-level 85 drop-probability 75; cs7 111000
fill-level 100 drop-probability 100; }
ef 101110 }
} nc1 110000
} term NETWORK-MANAGEMENT-TELNET-SSH {
nc2 111000
CLASSIFICATION
forwarding-classes { from {
queue 0 Data-3-BE; protocol tcp;
queue 2 Voice; port [ telnet ssh ];
E }
queue 3 Network-Control;
queue 4 Data-2; then {
queue 6 Data-1; loss-priority high;
} forwarding-class Network-Control;
interfaces { accept;
ge-* { }
scheduler-map SCHEDULER-MAP-A; F CoS uses a modularized configuration }
unit * { model. Some elements are created and term ICMP-POLICE {
classifiers { then referenced elsewhere. from {
dscp DSCP-BA-CLASSIFIER; A protocol [ icmp icmp6 ];
} Create Reference }
rewrite-rules { then {
dscp DSCP-REMARKING; G policer POLICER-ICMP-5M-DISCARD; B
} forwarding-class Data-2;
A Apply the BA classifier to the desired accept;
} inbound interface(s)
} }
ge-0/0/1 { }
SHAPING
scheduler-map SCHEDULER-MAP-A; F B Apply the policers within the firewall term BEST-EFFORT-INTRANET-TRAFFIC {
shaping-rate 800m; filters (MF classifiers) from {
} protocol tcp;
} C Apply the firewall filter (MF classifier) port 8080;
rewrite-rules { to the desired inbound interface(s) }
dscp DSCP-REMARKING { G then {
forwarding-class Voice { policer POLICER-250M-FC_D3-BE; B
D Apply the drop profiles within the
loss-priority low code-point ef; schedulers forwarding-class Data-2;
} accept;
forwarding-class Data-1 { }
loss-priority low code-point af41; E Use a scheduler-map to apply }
schedulers to traffic classes term BEST-EFFORT-TRAFFIC {
loss-priority medium-high code-point cs4;
REMARKING
policer POLICER-250M-FC_D3-BE { B
transmit-rate percent 10;
if-exceeding {
buffer-size percent 5;
bandwidth-limit 250m;
priority high;
burst-size-limit 625k;
}
}
QUEUING/SCHEDULING
Data-1-Scheduler {
then {
transmit-rate percent 10;
loss-priority low;
buffer-size percent 10;
forwarding-class Data-3-BE;
priority medium-high;
}
}
}
Data-2-Scheduler {
}
transmit-rate percent 40;
buffer-size percent 25;
priority medium-low;
drop-profile-map loss-priority low protocol any drop-profile WRED-DROP-PROFILE-MODERATE; D
Interfaces Stanza
} E
Data-3-Scheduler { interfaces {
transmit-rate { …
remainder; ge-0/0/2 {
} unit 0 {
buffer-size { family inet {
remainder; filter {
} input MF-CLASSIFIER; C
priority low; }
drop-profile-map loss-priority low protocol any drop-profile WRED-DROP-PROFILE-AGGRESSIVE; D address 192.168.1.254/24;
} }
Nwk-Ctl-Scheduler { }
transmit-rate percent 5; }
buffer-size percent 5; …
priority high; }
}
}
©2016 by Juniper Networks, Inc. All rights reserved. Juniper Networks assumes no responsibility for any inaccuracies in this document.
Juniper Networks reserves the right to change, modify, transfer, or otherwise revise this publication without notice.