QoS Overview
QoS Overview
- Used to solve intermittent temporary congestion on links
- Not a permanent solution for low bandwidth or constant high utilization
QoS Models
Integrated Services (IntServ)
Integrated Services (IntServ)
- RFC1633
- Every flow of traffic has explicit end-to-end reservation
- Each flow is determined by:
- Source address
- Destination address
- Transport protocol
- Source port
- Destination port
- Connection orientated
- Doesn't scale
- IntServ specifies the following:
- Transmission Specification (TSpec)
- What the sender is sending e.g. rate, MTU etc.
- Receiver Specification (RSpec)
- What the receiver needs e.g. bandwidth, MTU etc.
- Resource Reservation Protocol (RSVP)
- How the signalling is performed on the network by the receiver and the sender
- Describes 3 main classes:
- Guaranteed Services
- RFC2212
- Guarantees both bandwidth and delay end-to-end
- Controlled Load
- RFC2211
- Provides guaranteed delivery even when network is congested
- Uses capacity control to ensure delivery
- Best-effort service
- Offers no service guarantee
[_/su_spoiler]
Differentiated Services (DiffServ)
Differentiated Services (DiffServ)
- RFC2475
- Uses a Per-Hop Behaviour (PHB) method to control traffic flow
- Traffic is grouped into classes
- Connectionless
- Highly scalable
- No state or flow information is required to be maintained
- Describes 4 main classes:
- Expedited Forwarding
- RFC3246
- Strict priority service
- Assured Forwarding
- RFC2597
- Provides guaranteed delivery
- Provisions for over-subscritpion to this service
- e.g. markdown and dropping schemes for excess traffic
- Class Selector
- RFC2474
- Provides code points for backward compatibility with IP Precedence models
- Best-effort service
- Offers no service guarantee
[_/su_spoiler]
QoS DiffServe Classification & Marking
Layer 2 Classification
- MAC address
- 802.1Q/p CoS (Class of Service) (3 bits)
- MPLS EXP (3 bits)
- MAC address
- VLAN ID
[__/su_spoiler]
Layer 3 Classification
- ToS (Type of Service) byte
- IP Precedence (3 bits)
- DiffServe Code Point (DSCP) (6 bits)
- Source address
- Destination address
[__/su_spoiler]
Layer 4 Classification
[__/su_spoiler]
Upper layer Classification
- Application signatures
- NBAR PDLM (Network Based Application Recognition - Protocol Description Language Module)
- URLs (Uniform Resource Locators)
- Deep Packet Inspection (DPI)
[__/su_spoiler]
[_/su_spoiler]
Marking
Field |
OSI Layer |
Location |
Length |
Class of Service (CoS) |
2 |
ISL and 802.1Q header |
3 bits |
Discard Eligible (DE) |
2 |
Frame Relay header |
1 bit |
Cell Loss Priority (CLP) |
2 |
ATM Cell header |
1 bit |
MPLS Experimental (EXP) |
2 |
MPLS header |
3 bits |
IP Precedence (IP Prec) |
3 |
IP header |
3 bits |
IP DSCP |
3 |
IP header |
6 bits |
DS Field |
3 |
IP header |
1 byte |
ToS Byte |
3 |
IP header |
1 byte |
- CEF is required for Class-Based Marking
- Service-policy command would be rejected
Recommended Design for Marking
Recommended Design for Marking
Traffic |
CoS Value |
IP Prec Value |
DSCP Value |
Voice |
5 |
5 |
EF |
Video |
4 |
4 |
AF41 |
Voice/Video Signalling |
3 |
3 |
CS3 |
Mission Critical Data |
3 |
3 |
AF31, AF32, AF33 |
Transactional Data |
2 |
2 |
AF21, AF22, AF23 |
Bulk Data |
1 |
1 |
AF11, AF12, AF13 |
Best Effort |
0 |
0 |
BE |
Scavenger (less than best effort) |
0 |
0 |
2, 4, 6 |
- Mark as close to the ingress edge as possible, from trusted devices
[__/su_spoiler]
Cisco Auto-QoS Default Values
Class |
DSCP/PHB Value |
Traffic |
Routing |
CS6 |
EIGRP, OSPF |
VoIP |
EF |
RTP Voice Media |
Interactive Video |
AF41 |
RTP Video Media |
Streaming Video |
CS4 |
Real Audio, Netshow |
Control |
CS3 |
RTCP, H323, SIP |
Transactional |
AF21 |
SAP, Citrix, Telnet, SSH |
Bulk |
AF11 |
FTP, SMTP, POP3, Exchange |
Scavenger |
CS1 |
Peer-to-Peer applications |
Management |
CS2 |
SNMP, Syslog, DHCP, DNS |
Best Effort |
All Others |
All Others |
- 2 versions of Auto QoS
- Auto QoS for VoIP
- Only enables QoS for voice traffic
- Uses CDP to detect VoIP phones
- 2 types of interface
- Uplink interfaces
- Command:
- (config-if)#auto qos voip trust
- User access interfaces (end devices)
- Command:
- (config-if)#auto qos voip [cisco-phone | cisco-softphone]
- Auto QoS for Enterprise
- Enables QoS for VoIP as well as other enterprise applications
- Can enable discovery of traffic
- Requires CEF
- Uses NBAR
- Command:
- (config-if)#auto discovery qos [trust]
- Troubleshooting Commands:
- #show auto discovery qos
- #show auto qos
- #show policy-map interface
[__/su_spoiler]
Class of Service (CoS)
- Layer 2 marking scheme
- Supports 3-bit marking field
- Only supported when Ethernet header includes 802.1q or ISL trunking header
- 802.1Q defines it as the 3 most significant bits of VLAN Tag field
- Called "user-priority" bits
- 802.1Q bit 4 is used as Frame Relay Discard Eligibility (DE) bit or ATM Cell Loss Priority (CLP) bit
802.1Q/P Header |
|
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
|
|
User Priority (CoS) |
DE |
VLAN ID |
|
Dest |
Src |
EtherType |
802.1Q Tag Field (2 Bytes) |
Layer 3 Header |
- Rules on use:
- Only Classified on ingress, and only if the interface supports that header field (CoS, DE, CLP, EXP)
- Only Marked on egress, and only if the interface supports that header field (CoS, DE, CLP, EXP)
[__/su_spoiler]
IP Precedence (IPPrec)
IP Precedence IP Header |
|
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
|
|
Prec |
TOS |
CU |
|
Byte 1 |
TOS Byte (8 bits) |
Bytes 3-20 |
- 7 Classes
- Higher class is more important
IP Prec Class |
Binary |
IPP Name |
Example |
IP Prec 0 |
000000 |
Routine |
Default |
IP Prec 1 |
001000 |
Priority |
|
IP Prec 2 |
010000 |
Immediate |
|
IP Prec 3 |
011000 |
Flash |
VoIP Signalling |
IP Prec 4 |
100000 |
Flash Override |
|
IP Prec 5 |
101000 |
Critical |
Data Traffic (typically VoIP) |
IP Prec 6 |
110000 |
Internetwork Control |
L3 control: BGP, OSPF, RIP |
IP Prec 7 |
111000 |
Network Control |
L2 Control: STP |
[__/su_spoiler]
Differentiated Services Code Point (DSCP)
Differentiated Services Code Point (DSCP)
DiffServe IP Header |
|
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
|
|
DCSP |
ECN |
|
Byte 1 |
DS Field (8 bits) |
Bytes 3-20 |
- DS - Differentiated Service Field
- ECN - Explicit Congestion Notification
- Comprises of 4 classes:
- Expedited Forwarding (EF)
- Assured Forwarding (AF)
- Class Selector (CS)
- Best Effort (BE)
Expedited Forwarding (EF)
Expedited Forwarding (EF)
- Priority service
- DSCP 46
- Binary value: 101110
- Recommend policing to prevent starvation of other queues or consuming all bandwidth
[___/su_spoiler]
Assured Forwarding (AF)
- Provides guaranteed bandwidth
- To calculate decimal value from Class name:
- AFxy
- 8x + 2y
- e.g. AF22 = (8 * 2) + (2 * 2) = 16 + 4 = 20
Queue Class |
Highest Priority |
Medium-High Priority |
Medium-Low Priority |
Lowest Priority |
DSCP |
Binary |
Decimal |
DSCP |
Binary |
Decimal |
DSCP |
Binary |
Decimal |
DSCP |
Binary |
Decimal |
Highest Drop Preference |
AF43 |
100110 |
38 |
AF33 |
011110 |
30 |
AF23 |
010110 |
22 |
AF13 |
001110 |
14 |
Medium Drop Preference |
AF42 |
100100 |
36 |
AF32 |
011100 |
28 |
AF22 |
010100 |
20 |
AF12 |
001100 |
12 |
Lowest Drop Preference |
AF41 |
100010 |
34 |
AF31 |
011010 |
26 |
AF21 |
010010 |
18 |
AF11 |
001010 |
10 |
[___/su_spoiler]
Class Selector (CS)
- Backwards compatible with IP Precedence values
- Class Selector values map to to IP Prec values
Class Selector Names |
DSCP Binary |
IP Prec |
IP Prec Binary |
IPP Name |
CS0 (Default) |
000000 |
IPP0 |
000 |
Routine |
CS1 |
001000 |
IPP1 |
001 |
Priority |
CS2 |
010000 |
IPP2 |
010 |
Immediate |
CS3 |
011000 |
IPP3 |
011 |
Flash |
CS4 |
100000 |
IPP4 |
100 |
Flash Override |
CS5 |
101000 |
IPP5 |
101 |
Critical |
CS6 |
110000 |
IPP6 |
110 |
Internetwork Control |
CS7 |
111000 |
IPP7 |
111 |
Network Control |
[___/su_spoiler]
Best Effort (BE)
- Default value
- DSCP 0
- Binary Value 000000
[___/su_spoiler]
[__/su_spoiler]
Pre-Classification
- Required on tunnel encapsulated traffic
- Unable to classify traffic within an encrypted tunnel
- Only have access to ToS byte which is copied to the outer header of the tunnel packet
- Pre-classification keeps the original unencrypted traffic in memory until egress QoS actions are taken
- Only on VPN endpoint devices
- Can be enabled on tunnel interface mode, virtual-template configuration, or crypto map configuration mode
- Command:
- (config-if)#qos pre-classify
Configuration Mode |
VPN Type |
interface tunnel |
GRE and IPIP |
interface virtual-template |
L2F and L2TP |
crypto map |
IPSec |
Qos Pre-Classify Modes
[__/su_spoiler]
[_/su_spoiler]
QoS DiffServe Congestion Management
QoS DiffServe Congestion Management
- 2 different queues
- Hardware queues
- Also known as transmit queue (TX queue) or transmit ring (TX ring)
- Is generally a small queue
- Always uses FIFO
- Aren’t effected by queueing tools
- Only length of queue can be configured or changed
- Command:
- (config-if)#tx-ring-limit <queue-limit>
- Software queues
- Controls traffic before being moved to the hardware queue
- Handles congestion using queueing methods
- Queueing:
- Only engaged when congestion appears
- Method of ordering packets to linked output buffers
- Scheduling
- Method of deciding which packet to transmit next
- Engaged if there is congestion or isn’t congestion
- If no congestion, defaults to FIFO
|
FIFO |
PQ |
CQ |
WFQ |
PQ-WFQ |
CBWFQ/HQF |
LLQ |
Classification |
Per interface |
Per protocol
Per interface |
Per protocol
Per interface |
IP PrecRSVPRTPReserve ProtocolL4 Port |
RTP port for PQIP Prec for WFQ |
Class-based |
Class-based |
# of Queues |
1416 |
|
|
Per flow |
1 PQ + WFQ |
Up to 256classes(64 queues) |
1 PQ +CBWFQ(64 queues) |
Scheduling |
FIFO |
Strict Priority |
Round Robin |
Weighted Fairbased on IP Prec |
PQ: Strict |
|
|
DelayGuarantee |
No |
Yes for traffic in highest priorityqueue only |
No |
No |
Yes for PQtraffic |
No |
Yes for PQ traffic |
Bandwidth Guarantee |
No |
No |
Yes |
No |
Yes for PQ |
Yes |
Yes |
First In, First Out (FIFO)
First In, First Out (FIFO)
- Default configuration
- Offers no prioritisation to traffic
- First packing in the queue is the first packet out
- Queue depth can be defined
- Command:
- (config-if)#hold-queue <queue length> out
[_/su_spoiler]
Priority Queueing (PQ)
- Consists of 4 queues
- High, Medium, Normal/Default, Low
- Scheduler empties high queue and only services lower queues when upper queues are completely empty
- Good for real-time traffic
- Causes starvation issues for lower queues
[_/su_spoiler]
Custom Queueing (CQ)
- Consists of up to 16 queues
- Addresses starvation issue with Priority Queueing
- Uses a Round-Robin scheduler
- Provides bandwidth guarantees
- Unable to provide strict priority to real-time traffic
[_/su_spoiler]
Weighted Fair Queueing (WFQ)
Weighted Fair Queueing (WFQ)
- Max-Min scheduling
- Bandwidth allocation done per-flow proportional to weight
- Weight is typically IP Precedence value + 1
- The flow is defined dynamically
- Src/Dst IP + Src/Dst L4 Port + ToS
- Command:
- (config-if)#fair-queue <Congestive Discard Threshold> <Dynamic Conversion Queues>
- Congestive Discard Threshold - Individual queue size threshold
- (config-if)#hold-queue <queue-length> out
- If # flows > # queues
- Flow collision occurs and queues are shared
[_/su_spoiler]
Class Based Weighted Fair Queueing (CBWFQ) / Hierarchical Queueing Framework (HQF)
Class Based Weighted Fair Queueing / Hierarchical Queueing Framework (CBWFQ / HQF)
- Previous to IOS 12.4(20)T was known as Modular QoS CLI (MQC) or CBWFQ
- Allows custom flows to be defined
- Bandwidth is shared proportional to weight
- Absolute bandwidth command:
- (config-pmap-c)#bandwidth <kbps>
- Relative bandwidth command:
- (config-pmap-c)#bandwidth percent <percent>
- The sum of all bandwidth must equal the interface speed
- Interface speed can be manually adjusted to calculate different values
- Command:
- (config-if)#bandwidth <kbps>
- Can set the maximum length of a CBWFQ queue
- Command:
- (config-pmap-c)#queue-limit <queue-limit>
- Default class (class-default) always guaranteed at least 1% of bandwidth
- Can enable WFQ on default class only
- Command:
- (config-pmap-c)#fair-queue [queue-limit <queue-limit>]
Configuration of HQF
- Made up of 3 components
- Class map
- Define interesting traffic
- Policy map
- Define what to do with the interesting traffic, defined in the class map
- Service policy
- Define the interface and direction to ally the policy map
Define Traffic Classes
- Match traffic flows based on criteria
- All traffic
- Access List
- Nested Class map
- Application (Real-time streaming)
- Call Admission Control
- CoS/DSCP/IP Prec marking
- Source/Destination IP
- Input interface
- L3 Packet length
- Protocol (NBAR)
- VLAN ID
- Any of the options above negated
- Class names are case sensitive
- Can have multiple match statements
- Can match-any or match-all (default option) in the criteria
- Can match up to 4 values for match cos or match ip prec
- Can match up to 8 values for match ip dscp
- Commands:
- (config)#class-map [match-all | match-any] <name>
- (config-cmap)#match <criteria>
[___/su_spoiler]
Define Traffic Policy
- Define what actions to take on traffic class
- Mark (DSCP/IP Prec/CoS)
- Bandwidth
- Drop
- Police
- Shape
- Commands:
- (config)#policy-map <name>
- (config-pmap)#class <class name>
- (config-pmap-c)#set <criteria>
[___/su_spoiler]
Apply Policy
- Apply the policy to an interface
- Inbound or outbound direction
- Can't assign different queues to sub-interfaces, only main interface
- To assign queues to sub-interfaces
- Create a parent shaper first and assign bandwidth of link
- Create a sub shaper in the class-default of the parent shaper and assign your HQF configuration there
- Commands:
- (config-if)#service-policy <in | out> <policy name>
[___/su_spoiler]
[__/su_spoiler]
[_/su_spoiler]
Low Latency Queueing (LLQ)
Low Latency Queueing (LLQ)
- Enhanced combination of PQ, CQ and WFQ
- Same as CBWFQ with a strict priority queue
- Only 1 PQ per HQF configuration
- Multiple classes can be assigned to the PQ
- PQ is serviced/cleared first before servicing any other queue
- Command:
- (config-pmap-c)#priority <kbps>
- (config-pmap-c)#priority percent <percent>
[_/su_spoiler]
QoS DiffServe Congestion Avoidance
QoS DiffServe Congestion Avoidance
- Used to prevent TCP Global Synchronisation
Tail Drop
- Default method of dropping packets for all queues
- When a queue becomes full new packets are dropped first
- All packets are treated equally
- Causes TCP Global Synchronisation
Figure 1 - TCP Global Synchronisation
- Large number of senders go into TCP Slow-Start (controls gradual TCP window sizing)
- Tail drop causes large number of senders to reduce their window size to 1 and enter slow-start at the same time
[_/su_spoiler]
Random Early Detection (RED)
Random Early Detection (RED)
- Attempts to counter the effects of TCP Global Synchronisation
- Randomly drops packets from queues before the queue becomes full
- Sends individual senders into TCP Slow-Start depending which flows have had their traffic dropped
- Not supported on Cisco equipment
[_/su_spoiler]
Weighted Early Random Detection (WRED)
Weighted Random Early Detection (WRED)
- Same principle as RED
- Adds weight to calculate which packets should be dropped
- Higher the weight, less likely to be dropped
- Within each weight (or IPPrec value) set a minimum and maximum queue depth threshold
- Minimum threshold
- Determines queue depth which that weight value begins randomly dropping
- Maximum threshold
- Determines the queue depth that all packets of that weight are dropped
- Tracks average queue depth
- avg=(old_avg*(1-1/2^n))+(q_size*1/2^n)
- Drops packets based on Mark Probability Denominator
- Determines how aggressively packets are dropped
- e.g. a mark probability denominator of 10 means that up to 1 in 10 packets of a certain weight is dropped randomly
- Maximum rate of 1 in 10 happens at the maximum threshold
- Drop probability increases as queue depth increases
- If queue depth exceeds maximum, tail-drop used
- Configured on the following locations
- Physical interface (with FIFO queueing)
- Non-LLQ class in CBWFQ policy map
- ATM VC
- Command:
- (config-pmap-c)#random-detect
- To change WRED from the default profile settings
- IP Prec Command:
- (config-pmap-c)#random-detect precedence <ip-prec> <min threshold> <max-threshold> [mark-probability-denominator]
- DSCP Command:
- (config-pmap-c)#random-detect dscp <dscp> <min threshold> <max-threshold> [mark-probability-denominator]
Figure 2 - Weighted Random Early Detection
Queue depth vs Thresholds |
Action |
WRED Action Name |
Average depth < minimum threshold |
No packets dropped |
No Drop |
Min threshold < average deth < max threshold |
Percentage of packets dropped.Drop percentage increases from 0 to max as depth moves frommin to max threshold |
Random Drop |
Average depth > max threshold |
All new packets discarded. Similar to Tail Drop |
Full Drop |
Default WRED Profiles for DSCP based WRED
DSCP |
Min Threshold |
Max Threshold |
MPD |
1/MPD |
AFx1 |
33 |
40 |
10 |
10% |
AFx2 |
28 |
40 |
10 |
10% |
AFx3 |
24 |
40 |
10 |
10% |
EF |
37 |
40 |
10 |
10% |
[_/su_spoiler]
QoS Switch Congestion Management and Avoidance
QoS Switch Congestion Management and Avoidance
- Can perform both ingress and egress queueing
Ingress Queueing
- Commands are applied globally and effect all interfaces
- 2 ingress queues per interface
- 1 can be a priority queue (default)
- Command:
- (config)#mls qos srr-queue input priority-queue <queue-id> bandwidth <weight>
- By default COS 5 traffic is placed in queue 2, all other in queue 1
- Uses Shared Round Robin (SRR) to determine rate at which packet is transferred from ingress queue to internal fabric
- Shares bandwidth according to each queues weight
- Default weight for each queue is 4 and 4
- Traffic is divided evenly
- Number doesn't represent a bit-rate and is only used for weighting
- Command:
- (config)#mls qos srr-queue input bandwidth <weight 1> <weight 2>
- Bandwidth for each queue is guaranteed
- Default is 90% of buffers are assigned to queue 1, 10% to queue 2
- Command:
- (config)#mls qos srr-queue input buffers <percentage 1> <percentage 2>
- Default ingress queue settings:
- Queue 2 is a priority queue
- CoS 5 placed in queue 2
- Queue 2 allocated 10% of interface bandwidth
- Uses Weighted Tail Drop (WTD) to set discard thresholds for each queue
- Default threshold is to drop once queue is 100% full
- Creates 3 thresholds per queue
- Based on CoS value
- Threshold 3 cannot be changed
- Configuration commands:
- (config)#mls qos srr-queue input threshold <queue-id> <threshold 1> <threshold 2>
- Set tail drop percentages on thresholds 1 and 2 (3 can't be changed)
- (config)#mls qos srr-queue input cos-map threshold 1 <cos value>
- Map CoS values to threshold 1
- (config)#mls qos srr-queue input cos-map threshold 2 <cos value>
- Map CoS values to threshold 2
- (config)#mls qos srr-queue input cos-map threshold 3 <cos value>
- Map CoS values to threshold 3
Threshold # |
CoS value |
Percentage |
1 |
0-3 |
40% |
2 |
4-5 |
60% |
3 |
6-7 |
100% |
Default Weighted Tail Drop (WTD) configuration
- Default input queueing configuration commands:
- (config)#mls qos srr-queue input buffers 90 10
- (config)#mls qos srr-queue input bandwidth 4 4
- (config)#mls qos srr-queue input threshold 1 40 60
- (config)#mls qos srr-queue input cos-map threshold 1 0 1 2 3
- (config)#mls qos srr-queue input cos-map threshold 2 4 5
- (config)#mls qos srr-queue input cos-map threshold 3 6 7
[_/su_spoiler]
Egress Queueing
- Commands are applied at the interface level and effect each interface differently
- 4 egress queues per interface
- Can configure which CoS or DSCP values are mapped to each queue
- Can have 1 priority queue
- The internal DSCP is compared to a globally configured DCSP-to-CoS map to determine the CoS value
- The per-interface CoS-to-queue map determines the queue based on the assigned CoS
- Each interface belongs to 1 of 2 egress queue-sets
- Buffer and WTD threshold are globally configured
- Bandwidth weight, SRR scheduling, and priority queueing are configured per interface
- 2 different schedulers used to prevent queue starvation with a priority queue
- Shared Round Robin (SRR)
- Same as ingress queueing
- Command:
- (config-if)#srr-queue bandwidth share <weight 1> <weight 2> <weight 3> <weight 4>
- Shape Round Robin (SRR)
- Rate limits the queue to a configured percentage of the link
- Command:
- (config-if)#srr-queue bandwidth shape <weight 1> <weight 2> <weight 3> <weight 4>
- Both modes of scheduling attempts to service the queues proportionally to their configured bandwidths when more than one queue holds frames
- Both service the PQ as soon as possible if at first the PQ is empty but then frames arrive in the PQ
- Both prevent the PQ from exceeding its configured bandwidth when all other queues have frames waiting to be sent
- Shaped never allows any queue (including PQ) to exceed its configured percentage of link bandwidth, even if it means that link sits idle.
- Configuration commands:
- (config)#mls qos queue-set output 1 buffers <percentage 1> <percentage 2> <percentage 3> <percentage 4>
- Set the assigned buffer levels for each queue in line with the interface link
- (config)#mls qos queue-set output <queue-set-id> threshold <threshold id> <threshold 1> <threshold 2> <threshold 3> <threshold 4>
- Set the queue set's threshold levels for WTD before packets are starting to tail drop
- (config-if)#queue-set <queue-set-id>
- Assign a queue set to an interface
- (config-if)#srr-queue bandwidth share <weight 1> <weight 2> <weight 3> <weight 4>
- Weighted priority of queues 1 to 4 for SRR sharing
- (config-if)#srr-queue bandwidth shape <weight 1> <weight 2> <weight 3> <weight 4>
- Weighted priority of queues 1 to 4 for SRR shaping
- (config-if)#priority-queue out
- Sets queue 1 to a priority queue
[_/su_spoiler]
QoS Admission Control Tools
QoS Admission Control Tools
- Packets are sent out at the physical clock speed of the interface
- e.g. If you have a 1Gb interface and a shaper configured to send at 500Mb, packets will only be sent half of the time
- To work out the intervals packets get serialised on an interface
- Bc (bits) / Tc (ms) = CIR (bits) / 1 second
- Tc = Bc/CIR
Policer |
Shaper |
Causes TCP resends as traffic is dropped |
Typically delays traffic (rather than drops); involves fewer TCP resends |
Inflexible and inadaptable; makes instantaneous packet drop decisions |
Adapts to networkk congestion by queueing excess traffic |
Used on interface ingress or egress |
Used on interface egress |
Rate limiting without buffering |
Rate limiting with buffering |
Terminology
Abbreviation |
Terminology |
Description |
AR |
Access Rate |
- Physical port speed
- Fixed Value
- TxR - Transmission Ring (Hardware Queue)
|
CIR |
Committed Information Rate |
- Measured in bps
- Average rate the shaper/policer is targeting
- CIR = Bc/Tc
|
EIR |
Excessive Information Rate |
- Maximum rate above the CIR on Exceed action, before Violate action
- EIR=AR-CIR
|
PIR |
Peak Information Rate |
- Measured in bps
- Maximum rate above the CIR on Exceed action, before Violate action
|
Tc |
Time Committed |
- Measured in ms
- Time to transmit Bc
- Not manually configurable - however can change Bc and platform will adjust Tc to meet traffic contract rate
- For delay sensitive traffic it is recommended to configure Bc such that Tc is 10ms or below
- Tc = Bc/CIR
|
Bc |
Committed Burst |
- Measured in bits per interval (Tc)
- Number of bits that could be sent during Tc interval
- Called Burst as the traffic is transmitted at the interface line rate, and Committed because if you send this amount per interval you are still adhering to the traffic contract
- Bc = CIR*(Tc/1000) - SHAPER
- Bc = (CIR*(Tc/1000))/8 - POLICER
|
Be |
Committed Burst |
- Measured in bits per interval (Tc)
- Amount of bits over the Bc that could be sent after a period of inactivity
- Credit must be accumulated by idle periods or periods of less activity on Bc
- Makes up previous shaping intervals where didn't meet the average rate
- Can be stopped by setting Be to 0
- Be = EIR*(Tc/1000) - SHAPER
- Be = (EIR*(Tc/1000))/8 - POLICER
|
[_/su_spoiler]
Traffic Policing
- Used on inbound or outbound traffic
- Normally used inbound to match outbound shaper
- Drops, marks or re-marks traffic
- Drop considered mark action
- Uses 2 parameters
- Committed Information Rate (CIR)
- Time Committed (Tc)
- The larger Tc the more bursting is allowed
- Bc (in bytes) = CIR * Tc is max burst allowed
- Bc = (CIR * Tc) /8
- Divide by 8 as Bc Policer in Bytes not bits
- Be only allowed if Bc wasn't fully utilized
Figure 3 - Policing
Single-Rate Policer
- Command:
- (config-pmap-c)#polic cir <bps> [bc <bps>] [be <bps>] [conform-action <action>] [exceed-action <action>] [violate-action <action>]
- 3 actions (referred to as colors)
- Conform
- Exceed
- Exceeds Bc but is below Bc+Be
- Violate
[__/su_spoiler]
Dual-Rate Policer
- Implement two-rate access
- Customer guaranteed CIR
- Allowed to send up to PIR
- Traffic between CIR and PIR remarked to lower value
- Command:
- (config-pmap-c)#police cir <bps> bc <Bc> be <Be> conform-action transmit exceed-action set-prec-transmit <IPPrec value> violate-action set-prec-transmit <IPPrec value>
[__/su_spoiler]
[_/su_spoiler]
Traffic Shaping
- Used on outbound traffic only
- Delays and queues exceeding traffic to normalise flow
- smooths traffic out over time rather than drop
- To shape sub-interfaces, an outer policy must be defined first on the physical interface
- Using a percent value for shaper uses the interface bandwidth configuration
- Command:
- (config-pmap-c)#shape average <cir> [Bc] [Be]
- (config-pmap-c)#shape average percent <%> [Bc] [Be]
Figure 4 - Shaping
Shaping Example 1
Figure 5 - Shaping Example 1
- 256Kbps Access Rate (interface speed) with a CIR traffic contract of 128Kbps
- Traffic can only be set out the interface at the physical clock rate (256Kbps)
- Can not send electrical signals slower down the line than the physical clock rate, therefore must alternate between sending packets and pausing
- For 128K on a 256K link, packets are sent 50% of the time (1/2) to give the average CIR rate
- Tc in this example is set to 125ms with traffic transmitting every 62.5ms
- 1000ms (1 second) / 8 (arbitrary figure for example) = 125ms
- 125ms / 2 (traffic sending at 1/2 Tc) = 62.5ms
- Bc (bits) is calculated using the formula Bc = CIR * (Tc / 1000)
- Bc = 128000(bps) * (125 / 1000) = 128000 * 0.125 = 16,000 bits
- Be (bits) is calculated using the formula Be = EIR*(Tc / 1000)
- EIR = AR-CIR
- EIR = 256000(bps) - 128000(bps) = 128000(bps)
- Be = 128000(bps) * (125 / 1000) = 128000(bps) * 0.125 = 16,000 bits
- In time slot (Tc) 5 there is a period of quiet where not as much traffic was transmitted. This accrues traffic credit which can later be used for Be traffic
- In time slot (Tc) 7 there is more traffic to transmit than usual, therefore can use the credit that was obtained in Tc 5. Can not use more than the credit that has been accrued. This still provides the average shaping rate or CIR of 128Kbps.
[__/su_spoiler]
Shaping Example 2
Figure 6 - Shaping Example 2
- 100Mb Access Rate (interface speed) with a CIR traffic contract of 65Mbps
- Traffic can only be set out the interface at the physical clock rate (100Mbps)
- Can not send electrical signals slower down the line than the physical clock rate, therefore must alternate between sending packets and pausing
- For 65Mb on a 100Mb link, packets are sent 65% of the time (13/20) to give the average CIR rate
- Tc in this example is set to 100ms with traffic transmitting every 65ms
- 65% / 100ms = 0.65 (traffic sending for 13/20th or 65% of Tc) = 65ms
- Bc (measured in bits) is calculated using the formula Bc = CIR * (Tc / 1000)
- Bc = 65,000,000 * (65 / 1000) = 65,000,000 * 0.065 = 4,225,000(bits)
- Be (measured in bits) is calculated using the formula Be = EIR*(Tc / 1000)
- EIR = AR-CIR
- EIR = 100,000,000 - 65,000,000 = 35,000,000(bps)
- Be = 35,000,000 * (100 / 1000) = 35,000,000 * 0.1 = 3,500,000(bits)
- In Tc interval 5 (500ms) there is a period of quiet (marked by the dotted line) where not as much traffic was transmitted, and was below the Bc threshold. This accrues traffic credit which can later be used for Be traffic
- In Tc interval 7 there is more traffic to transmit than usual - maybe a traffic burst, therefore can use the credit that was obtained in Tc 5. Can not use more than the credit that has been accrued. This still provides the average shaping rate or CIR of 65Mbps.
[__/su_spoiler]
Shaping Example 3
Figure 7 - QoS Shaping Example 3
- 128Kbps Access Rate (interface speed) with a CIR traffic contract of 73Kbps
- Traffic can only be set out the interface at the physical clock rate (128Kbps)
- Can not send electrical signals slower down the line than the physical clock rate, therefore must alternate between sending packets and pausing
- For 73Kb on a 128Kb link, packets are sent 57% of the time to give the average CIR rate
- Tc in this example is set to 125ms with traffic transmitting every XXXms
- 57% / 125ms = 0.45 (traffic sending for 57% of Tc) = 45ms
- Bc (measured in bits) is calculated using the formula Bc = CIR * (Tc / 1000)
- Bc = 73,000 * (45 / 1000) = 73,000 * 0.045 = 3,285(bits)
- Bc = 3,285 bits per interval
- Be (measured in bits) is calculated using the formula Be = EIR*(Tc / 1000)
- EIR = AR-CIR
- EIR = 128,000 - 73,000 = 55,000(bps)
- Be = 55,000 * (45 / 1000) = 55,000 * 0.045 = 2,475(bits)
- Be = 2,475 bits per interval
- In Tc interval 4 (500ms) there is a large period of quiet (marked by the dotted line) where not as much traffic was transmitted during the Tc, and was below the Bc threshold. This accrues traffic credit which can later be used for Be traffic
- In Tc interval 5 there is more traffic to transmit than usual - maybe a traffic burst, therefore can use the credit that was obtained in Tc 4. Can not use more than the credit that has been accrued. All the traffic wasn't able to be processed during Tc interval 5 and overflow to Tc interval 6 as there is still enough credit in the token bucket that has been accrued from the previous period of inactivity. This still provides the average shaping rate or CIR of 73Kbps.
[__/su_spoiler]
[_/su_spoiler]
QoS Per Tunnel for DMVPN
QoS Per-Tunnel for DMVPN
- To enable QoS on a Tunnel interface use the QoS Pre-Classify command
- You don’t need to apply a service-policy to the tunnel interface
- Can use the policy applied to the physical interface to classify tunnel traffic
- IOS keeps a temporary copy of the headers in memory before tunnel encapsulation/encryption
- If policy was applied on the hub tunnel interface, all spokes would be effected
- Individual spokes require separate configuration
- Spokes signal to hub which QoS group they are part of
- Group name must match between DMVPN hub and spoke(s)
- Command (Spoke):
- (config-if)#ip nhrp group <group>
- Command (Hub):
- (config-if)#ip nhrp map group <group> service-policy output <policy name>
- Verification command:
- #show policy-map multipoint
QoS Troubleshooting
QoS Troubleshooting
- show class-map
- show run class-map
- show policy-map
- show run policy-map
- show policy-map interface