QoS

=IP Precedence= toc


 * ===Fields===
 * ====Type of Service (TOS) byte====
 * Precedence(3)
 * TOS(4)
 * undefined(1)
 * ===Values===
 * **Routine** - __000__ - 0
 * **Priority** - __001__ - 1
 * **Intermediate** - __010__ - 2
 * **Flash** - __011__ - 3
 * **Flash Override** - __100__ - 4
 * **Critic/Critical** - __101__ - 5
 * **Internetwork Control** - __110__ - 6
 * **Network Control** - __111__ - 7

=DSCP=


 * ===Fields===
 * ====Differentiated Services field====
 * DSCP(6), ECN(2)
 * ===Per-Hop Behaviors (PHB)===
 * **Routine** - __000__ 000 - 0
 * **Priority** - __001__ 000 - 8
 * **Immediate** - __010__ 000 - 16
 * **Flash** - __011__ 000 - 24
 * **Flash Override** - __100__ 000 - 32
 * **Critic/Critical** - __101__ 000 - 40
 * *** Expected Forwarding (EF)** - 101 110 - 46
 * **Internetwork Control** - __110__ 000 - 48
 * **Network Control** - __111__ 000 - 56

=Assured Forwarding (AF)=


 * ===Classes===
 * 1,2,4,5
 * ===Levels===
 * **Low**
 * AF11 - 10-001010
 * AF21 - 18-010010
 * AF31 - 26-011010
 * AF41 - 34-100010
 * **Medium**
 * AF12 - 12-001100
 * AF22 - 20-010100
 * AF32 - 28-011100
 * AF42 - 36-100100
 * **High**
 * AF13 - 14-001100
 * AF23 - 22-010110
 * AF33 - 30-011110
 * AF43 - 38-100110

=Expected Forwarding (EF)=


 * queue packets to get scheduled quickly
 * police packets so they don't consume all bandwidth or starve other queues
 * value 46 - 101110

=LAN=


 * Class of Service
 * **ISL** - User Field (8bits), 3 least significant are CoS
 * **802.1Q** - Tag Control Field(16bits), 3 most significant called User Priority

=WAN=


 * single bit related to drop probability
 * value of 1 are more likely to be dropped
 * **Frame Relay** - Discard Eligibility (DE)
 * **ATM** - Cell Loss Priority (CLP)
 * **MPLS** - Experimental (EXP) 3-bit field

=Fields=


 * **IP Precedence (IPP)** - IP header; 3 bits
 * **IP DSCP** - IP header; 6 bits
 * **DS Field** - IP header; 1 byte
 * **ToS Byte** - IP header; 1 byte
 * **CoS** - ISL & 802.1Q header; 3 bits
 * **Discard Eligibile (DE)** - Frame Relay header; 1 bit
 * **Cell Loss Priority (CLP)** - ATM Cell header; 1 bit
 * **MPLS Experimental (EXP)** - MPLS header; 3 bits

=Modular QoS CLI (MQC)=

=Pre-Classification=
 * ===Class Base (CB)===
 * CB Marking
 * CB Weighted Fair Queuing
 * CB Policing
 * CB Shaping
 * CB Header Compression
 * ===Mechanics===
 * **Classification** - class-map
 * **Action** - policy-map
 * **Interface** - service-policy
 * ===Class Maps===
 * match [not]
 * QoS fields
 * ACLs (access-group)
 * MAC addresses
 * Protocols
 * Network Based Application Recognition (NBAR)
 * RTP audio & video
 * Citrix
 * Hostname, URL, MIME - using regular expressions
 * P2P
 * config-cmap# match protocol rtp audio
 * config-cmap# match protocol http url "*important*"
 * config-cmap# match protocol rtp payload-type 4 (G.723)
 * config-cmap# match protocol rtp payload-type 34 (H.263)
 * "any"
 * [cos | precedence | dscp] (up to 4 CoS & IPP; up to 8 DSCP)
 * Class - match other class maps
 * config# class-map [match-any | match-all] WORD (or | and)
 * ===Marking===
 * requires CEF - config# ip cef
 * classified using logic in class-maps
 * config-pmap# class WORD
 * packets that don't match any class will match class-default
 * set [precedence | dscp | cos | qos-group | atm-clp | fr-de]


 * for encrypted/tunneled traffic
 * VPN endpoint router can take action before encapsulation
 * keeps original, unencrypted traffic in memory until QoS actions
 * qos pre-classify
 * interface tunnel - GRE & IPIP
 * interface virtual-template - L2F & L2TP
 * crypto map - IP Sec

=Policy Routing=


 * route based on info besides destination IP
 * examine as they enter the interface
 * route-map to match subnet
 * mark priority
 * possible define the route

=Auto QoS=


 * simpler
 * less operator error
 * no in-depth knowledge of QoS concepts
 * ===__VoIP__===
 * access ports - use CDP to detect phones
 * uplink/trunk ports - CoS or DSCP values received
 * ====__Switches__====
 * once enabled on interface macro globally enables QoS, configured interface ingress & egress queues, class & policy maps, applies policy maps to interface
 * =====__Access__=====
 * if CDP finds no phone; DSCP set to 0 for best effort
 * Ingress Priority/Expedite Queue
 * Voice & Video control traffic
 * Realtime video traffic
 * Voice traffic
 * Routing Protocol traffic
 * Spanning-Tree BPDU traffic
 * =====__Uplink__=====
 * config-if# auto qos voip trust (trust CoS & DSCP)
 * =====__Global__=====
 * create COS-to-DSCP and vice-versa mappings
 * enters switch, moves CoS to DSCP
 * leave switch, moves DSCP to CoS
 * creates mapping of CoS values to ingress/egress queues/threasholds
 * creates mapping of DSCP values to ingress/egress queues/threasholds
 * config-if# auto qos voip [cisco-phone | cisco-softphone]
 * ====__Routers__====
 * =====__Frame Relay__=====
 * 768k bandwidth or lower
 * compression and fragmentation are enabled
 * =====__Non-Frame Relay Serial Interface__=====
 * 768k bandwidth or lower
 * changes encapsulation to PPP
 * creates PPP multilink interface
 * enables Link Fragmentation and Interleave (LFI)
 * =====__Trust Keyword__=====
 * if not used, ACLs are created to match
 * voice
 * cideo data
 * call control ports
 * all other packets get DSCP 0
 * config-if# auto qos voip [trust]
 * ===__Enterprise__===
 * detects types and amounts of traffic
 * creates recommended policies
 * CEF needs to be enabled
 * uses NBAR to learn types
 * will classify traffic collected into 1 of 10 classes
 * ====__Classes__====
 * **Routing** - CS6 - eigrp; ospf
 * **VoIP** - EF(46) - rtp voice media
 * **Interactive Video** - AF41 - rtp video media
 * **Streaming Video** - CS4 - real audio; netshow
 * **Control** - CS3 - rtcp; h323; sip
 * **Transactional** - AF21 - sap; citris; telnet; ssh
 * **Bulk** - AF11 - ftp; smtp; pop3; exchange
 * **Scavenger** - CS1 - p2p
 * **Management** - CS2 - snmp; syslog; dhcp; dns
 * **Best Effort** - all others
 * config-if# auto gos
 * creates templates of collection
 * creates class maps and policy maps

=Congestion - Queuing=


 * ===Hardware Queues===
 * Tx Queue, Tx Ring
 * when interface finishes sending packets, next packet cant be sent without interrupting the CPU
 * FIFO
 * not affected by IOS queuing tools
 * shrinks length og queue to small-than-default if a queuing tool is present
 * a shorter HW queue gives software queuing more control
 * config-if# tx-ting-limit 1
 * config-if# service-policy out (LLC wont be used until hardware queue is full)
 * ===Queuing Tools===
 * **Classification** - looks at packet headers to choose right queue
 * **Drop Policy** - rules to choose packets to drop when queue gets full
 * **Scheduling** - logic used to determine which packet should be dequeued next
 * **Maximum Number of Queries** - number of unique classes of packets for queuing tool
 * **Maximum Queue Length** - number of packets in single queue
 * ===Class-Based Weighted Fair Queuing (CBWFQ)===
 * bandwidth for queues
 * supports 64 queues/classes
 * ====__Functions & Features__====
 * **Classification** - MCQ matching
 * **Drop Policy** - tail drop of WRED; config per queue
 * **Number of queues** - 64
 * **Maximum queue length** - varies on router model and memory
 * **Scheduling inside single queue** - FIFO on 63 queues; FIFO/FWQ on class-default
 * **Scheduling among all queues** - percent of guaranteed bandwidth to each queue
 * ====__Commands__====
 * config-pmap# bandwidth [ | [ remaining ] percent <%>]
 * config-pmap# queue-limit (maximum length)
 * config-pmap# fair-queue [queue-limit ] (WFQ; class-default)
 * config-if# max-reserved-bandwidth <%> (default 75)
 * config-if# load-interval 30 (counter update interval)
 * config-if# service-policy output WORD
 * ====__Defining & Limiting Bandwidth__====
 * if pmap defines too much bandwidth for interface, service-policy command is rejected
 * allowed bandwidth based on
 * config-if# bandwidth (int-bw)
 * config-if# max-reserved-bandwidth (max-res)
 * example: int-bw = 256 kbps; max-res = 75%
 * policy map can allocate 192 kbps
 * =====__Bandwidth Reservation__=====
 * **Explicit bandwidth** - pmap <= max-res * int-bw
 * **Percent** - pmap <= max-res (percent of int-bw)
 * **Remaining percent** - pmap <= 100 (percent of max-res * int-bw)
 * ===Low-Latency Queuing (LLQ)===
 * for delay (latency) sensitive traffic
 * schedules specific queues as strict-priority queues
 * adds a low-latency queue to CBWFQ
 * prevents queue starvation with legacy PQ
 * polices PQ based on configured bandwidth
 * guaranteed minimum, policed maximum
 * ====__Commands__====
 * config-pmap-c# priority [ | percent <%>] [burst] (burst default is 20%)
 * config-pmap-c# random-detect dscp-based (enables WRED)
 * ====__Defining & Limiting Bandwidth__====
 * example: interface bandwidth is 256 kbps
 * 256 * 0.75 = 192 kbps (max-res * int-bw)
 * Un-reservable Bandwidth = 256-192 = 64 kbps
 * =====__Reservable__=====
 * Class 1 - **priority** 32 = 32 kbps
 * Class 2 - **priority percent** 25 = 256 * 0.25 = 64 kbps
 * ======__Remaining Bandwidth__======
 * Class 3 - **bandwidth remaining percent** 75 = (192 - 32 - 64) * 0.75 = 72 kbps
 * Unallocated = (192 - 32 - 64) - 72 = 24 kbps
 * ====__More Than One Priority Queue__====
 * which one gets scheduled first?
 * all priority queues go into a single internal queue
 * services based on arrival time
 * example: voice and video can be in separate LLQs
 * they can still get high priority
 * they can't consume each other's bandwidth

=Weighted Early Random Detection (WERD)=


 * begins to discard more packets as the queue gets longer
 * tries to prevent queue from filling
 * randomly chooses packets to discard
 * ===Mark Probability Denominator (MPD)===
 * IOS calculates discard percentage used a maximum threshold (1/mpd)
 * the discard rate grows from 0 percent to x percent as the average queue depth grows from minimum to maximum threshold
 * ===Discard Categories===
 * ====__No Drop__====
 * average queue depth less than min threshold
 * ====__Random Drop__====
 * average queue depth greater than min threshold
 * less than maximum threshold
 * percentage of packets dropped
 * ====__Full Drop__====
 * average queue depth is greater than maximum threshold
 * all new packers are discarded
 * similar to tail-drop
 * ===Weights Packets===
 * gives preference to packets with certain IPP or DSCP values
 * ====__Traffic Profiles__====
 * different profiles for packets with different IPP & DSCP values
 * =====__Key Variables__=====
 * minimum threshold
 * maximum threshold
 * mark probability denominator
 * ====__Default Profiles for DSCP-Based WRED__====
 * AFx1 - minimum 33 - maximum 40 - mpd 10
 * AFx2 - minimum 28 - maximum 40 - mpd 10
 * AFx3 - minimum 24 - maximum 40 - mpd 10
 * EF - minimum 37 - maximum 40 - mpd 10
 * ===Configuration===
 * on physical interface with FIFO queuing
 * for a non-LLQ class inside a CBWFQ policy map
 * for an ATM VC
 * config-pmap-c# random-detect (WRED to use IPP)
 * config-pmap-c# random-detect dscp-based
 * config-pmap-c# random-detect precedence   [mpd]
 * config-pmap-c# random-detect exponential-weighting-constant (low means old average is small part of calculation, results in more quickly changing average)

=Modified Deficit Round-Robin (MDRR)=


 * cisco 12k series router family
 * serves in place of CBWFQ & LLQ
 * claims better fairness than legacy methods
 * supports priority queue (like LLQ)
 * seven round-robin queues (0-6) with one additional priority queue
 * with nothing in priority queue, services normal queues with round-robin approach
 * ===Priority Modes===
 * **Strict** - serves the priority queue whenever traffic is present (could starve other queues)
 * **Alternate** - between normal queues the priority queues is served (could create jitters and latency with the priority traffic)
 * ===Quantum Value (QV)===
 * removed packets from a queue until QV for that queue has been removed
 * quantifies number of bytes, used like byte-count by CQ scheduler
 * repeats process for every queue, order 0 to 7, then repeats round-robin
 * each queue gets some percentage bandwidth of the link
 * ===Deficit===
 * extra bytes sent during a cycle
 * if too many taken from queue, more are sent the next cycle

=Switches=


 * ===Ingress===
 * weighted tail drop (WTD)
 * ====__Shared Round-Robin (SRR)__====
 * controls rate of packets sent from ingress queue to internal switch fabric
 * shares bandwidth between 2 queues according to weights configured
 * bandwidth guaranteed but not limited to
 * by default CoS 5 goes into queue 2
 * all other CoS goes into queue 1
 * one of the queues can be a priority queue
 * amount of bandwidth & buffer space for each queue to achieve required traffic split
 * ====__Priority Queue__====
 * config# mls qos ssr-queue input priority-queue  bandwidth 
 * ====__CoS Mapping__====
 * config# mls qos srr-queue input cos-map queue 
 * ====__Queue and Bandwidth__====
 * together they determine how much data the switch can buffer & send before it being dropping
 * =====__Queue Buffers__=====
 * config# mls qos srr-queue input buffers <%1> <%2> (default 90, 10)
 * =====__Bandwidth Percentage__=====
 * config# mls qos srr-queue input bandwidth (default 4, 4)
 * ====__Defaults__====
 * queue 2 is priority
 * queue 2 is allocated 10% of interface bandwidth
 * CoS 5 is placed in queue 2
 * ====__Congestion Avoidance__====
 * =====__Weighted Tail-Drop (WTD)__=====
 * creates 3 thresholds per queue, based on CoS
 * config# mls qos srr-queue input cos-map threshold  cos1...cos8
 * config# mls qos srr-queue input dscp-map threshold  dscp1...dscp8
 * config# mls qos srr-queue input threshold  <%1> <%2>
 * ===Egress===
 * 4 Queues per Interface
 * configure CoS & DSCP
 * configure relative weight
 * configure drop threshold
 * queue 1 must be the priority queue if there is any
 * traffic shaping
 * frames assigned internal DSCP and an egress interface
 * DSCP compared to global DSCP-to-CoS map for CoS value
 * per interface CoS-to-queue map determines queue based on CoS
 * ====__Scheduling__====
 * Shared Round-Robin
 * config-if# srr-queue bandwidth share
 * Shaped Round-Robin
 * config-if# srr-queue bandwidth shape
 * limits to configured percentage of link bandwidth
 * excess gets queued when limited instead of discarding
 * both modes prevent PQ from exceeding when all other queues have frames
 * ====__Mapping__====
 * config# mls qos queue-set output  buffers <1> <2> <3> <4>
 * config# mls qos queue-set output  threshold <1> <2> <3> <4>
 * ====__Rate Limit Bandwidth__====
 * config-if# srr-queue bandwidth limit <%>
 * ====__Configuration__====
 * config-if# queue-set 1
 * config-if# srr-queue bandwidth share 10 10 1 1
 * config-if# srr-queue bandwidth shape 10 0 20 20
 * priority-queue out

=Shaping & Policing=


 * prevent exiting packets from exceeding configured shaping rate
 * if exceeded, delays future packets with a shaping queue
 * Multi-Access Problems Solved
 * if RSVP discards traffic on VC that exceeds CIR
 * use shaping to not exceed CIR
 * provides relief for egress blocking
 * is when sending to slower bandwidth, to queue first
 * Static Time Interval (Tc) - calculates number of bits that can be sent in this time
 * Committed Burst (Bc) - number of bits sent in each Tc
 * Shaped Rate - bits per second to shape at
 * Excess Burst (Be) - number of bits beyond Bc
 * ===__Token Bucket Model__===
 * size of Bc
 * filled with tokens at beginning of each Tc
 * each token buys the right to send 1 bit
 * implements Be by making bucket bigger
 * Steps
 * fill with tokens at start of each interval
 * now tokens can spill over and are wasted
 * take number of tokens equal to number of bits in a packet
 * if no tokens tokens left, wait until next interval to send
 * ===__Shaping__===
 * ====__Frame Relay__====
 * no congestion, shaper uses shaping rate
 * when congestion, lowers shaping rate until minimum
 * minimum can be configured
 * default is 50%
 * lower rate called Minimum Information Rate (MIR or mincir)
 * =====**__Congestion Detection__**=====
 * receipt of frame with Backward Explicit Congestion Notification (BECN) bit
 * receipt of ForeSight congestion message (cisco proprietary)
 * when received, shaper slows down by 25%
 * Bc & Be decreases by 25%, Tc stays the same
 * after no DECN in 16 Tc values
 * increases 1/16 of shaping rate for each Tc until maximum
 * ====__Generic Traffic Shaping (GTS)__====
 * simple form of traffic shaping
 * cannot be used with flow switching
 * config-if# traffic-shape rate  [bc] [be] [buffer-limit]
 * config-if# traffic-shape group  [bc] [be]
 * config-if# traffic-shape adaptive  (BECN response actions)
 * ====__Class-Based__====
 * allows queuing tools for packets delayed by shaping process
 * allows for classification of packets
 * config-pmap-c# shape [average | peak]  [burst-size] [excess-burst]
 * config-if# service-policy output WORD
 * =====**__Calculation__**=====
 * when rate <= 320 kbps
 * Bc = 8000 bits
 * Be = Bc = 8000
 * Tc = Bc / shaping rate
 * when rate > 32 kbps
 * Bc = shaping rate * Tc
 * Be = Bc
 * Tc = 25ms
 * ====__Tuning for Voice__====
 * LLQ & small TC (10ms)
 * small Tc means PQ can send more frequently
 * =====**__Configuration__**=====
 * config# class-map match-all WORD1
 * config-cmap# match ip rtp 16384 16383


 * config# policy-map WORD2
 * config-pmap# class WORD1
 * config-pmap-c# priority 32 (PQ for VoIP)
 * config-pmap# class class-default
 * config-pmap-c# fair-queue (WFQ for default)


 * config# policy-map WORD3
 * config-pmap# class class-default
 * config-pmap-c# shape average 96000 960
 * config-pmap-c# service-policy WORD2


 * config-if# service-policy output WORD3
 * ====__Shaping by Bandwidth Percent__====
 * "shape percent" command uses bandwidth of interface
 * sub-interfaces do not inherit the bandwidth
 * if not set via "bandwidth" command then defaults to 1544
 * =====**__Configuration__**=====
 * config-pmap-c# shape average percent 50 125
 * config-if# bandwidth 128
 * config-if# service-policy output WORD
 * ====__Shaping to a Peak Rate__====
 * calculates Bc, Be and Tc the same way the "shape average" command does
 * refills Bc & Be tokens (instea dof just Bc) into the bucket each interval
 * shaping rate = mean-rate * (1 + Be/Bc)
 * 64(1 + 8000/8000) = 128
 * config-pmap-c# shape peak 
 * ====__Adaptive Shaping__====
 * config-pmap-c# shape adaptive 32000 (responds to BECN)
 * ====__Frame Relay Traffic Shaping (FRTS)__====
 * token-bucket mechanics are identical to CB
 * only on frame relay interfaces
 * allows a large number of queuing tools instead of FIFO queue
 * no fancy queuing tools on physical interface concurrent with FRTS
 * always shapes traffic on each VC separately
 * cannot classify traffic to shape subnet of traffic on a VC
 * =====**__Enhanced Local Management Interface (ELMI)__**=====
 * dynamically learn CIR, Bc and Be from FR switch
 * =====**__Configuration__**=====
 * config# map-class frame-relay WORD1
 * config-if# encapsulation ppp
 * config-if# frame-relay traffic-shaping
 * config-if# frame-relay class WORD1
 * config-if# frame-relay interface-dlci 102
 * config-if-dlci# class WORD2
 * =====**__Defaults__**=====
 * 56 kbps
 * Bc = 7000 bits
 * Tc = 125 ms
 * =====**__Traffic Rate__**=====
 * configures average & peak rates
 * no ability to tune Tc or set Bc and Be
 * Be = Tc * (PIR - CIR)
 * Tc = Bc / CIR
 * config-pmap-c# frame-relay traffic-rate
 * =====**__Configuring Parameters__**=====
 * config-pmap-c# frame-relay [cir | bc | be]
 * =====**__LLQ__**=====
 * config-pmap-c# service-policy output WORD
 * =====**__Adaptive__**=====
 * config-pmap-c# frame-relay adaptive-shaping [becn | foresight]
 * config-pmap-c# frame-relay mincir (default is 50%)
 * =====**__MQC__**=====
 * must create default class in FRTS service policy
 * FRTS & fragmentation on PVC using MQC
 * interface will use dual FIFO queue
 * one queue for voice; other for the rest
 * nested policy maps
 * shaping rate in parent policy represents total available to children
 * if both "shaping average" and "shape adaptive" available bandwidth based off adaptive
 * "frame-relay ip rtp priority" not supported
 * ===__Policing__===
 * ====__Actions__====
 * drop
 * set-dscp-transmit - DSCP
 * set-prec-transmit - IPP
 * set-qos-transmit - QoS group ID
 * set-clp-transmit - ATM CLP bit
 * set-frde-transmit - Frame Relay DE bit
 * transmit - send packet
 * ====__Categories__====
 * conforming
 * exceeding
 * violating
 * ====__Single-Rate, Two-Color Policer__====
 * one bucket
 * single policing rate with no Be
 * =====**__Two Categories__**=====
 * conform - transmit
 * exceed - drop or mark down
 * does not refill bucket based on time interval
 * reacts to arrival of packet by replenishing appropriate number of tokens
 * (current-packet-arrival-time - previous) * police-rate
 * =====**__Categorizing__**=====
 * conform - if packet-size <= tokens then packet-size worth of tokens are drained from bucket
 * exceed - if packet-size > tokens then no tokens are drained
 * ====__Single-Rate, Three-Color Policer__====
 * two buckets (Be & Be)
 * =====**__Categories__**=====
 * conform - packet <= Bc bucket then tokens drained from Bc bucket
 * exceed - packet > Bc bucket and packet <= Be bucket then tokens are drained from Be bucket
 * violate - packet > Bc bucket and packet > Be bucket, then no tokens
 * fills buckets in reaction to packet arrival
 * if Bc bucket has tokens leftover, some will spill into Be bucket
 * ====__Two-Rate, Three-Color Policer__====
 * lower rate is committed Information Rate (CIR)
 * higher rate is Peak Information Rate (PIR)
 * =====**__Categories__**=====
 * conform - packets <= CIR then tokens from Bc & Be buckets
 * exceed - packets > CIR and packets <= PIR then tokens from Be bucket
 * violate - packets > PIR then no tokens
 * Be bucket does not rely on spillage from Bc
 * ====__Class Based__====
 * =====**__Actions__**=====
 * transmit
 * continue
 * set-dscp-transmit
 * set-prec-transmit
 * set-frde-transmit
 * drop
 * =====**__Defaults__**=====
 * Bc = (CIR * 0.25 second) / (8 bits/byte) = CIR / 32
 * if less than 1500, then set to 1500
 * 1 rate 2 colors
 * no violate-action
 * Bc = CIR / 32
 * Be = 0
 * 1 rate 3 colors
 * violate-action
 * Bc = CIR / 32
 * Be = Bc
 * 2 rates 3 colors
 * PIR
 * Bc = CIR / 32
 * Be = PIR / 32
 * =====**__Multi-Action__**=====
 * config-pmap-c# police 128000 256000
 * config-pmap-c-police# conform-action transmit
 * config-pmap-c-police# violate-action set-dscp-transmit (DSCP)
 * config-pmap-c-police# violate-action set-frde-transmit (Frame Relay DE bit)
 * =====**__Percentage__**=====
 * config-pmap-c# police cir percent 25 bc 500 ms pir percent 50 be 500 ms conform transmit exceed transmit violate drop
 * =====**__Committed Access Rate (CAR)__**=====
 * single-rate, two-color policing
 * differs from Class based
 * rate-limit command
 * cascade/nested rate-limit commands (multiple on an interface to process same packet)
 * supports Be but doesnt support violate category
 * with Be configured, internal logic that differs from CB to determine conform & exceed
 * config-if# rate-limit [input | output] [access-group ]  <burst-maximum> conform-action exceed-action
 * "continue" action - conforming packets will be compared to next rate-limit statement
 * config-pmap-c# police cir <rate-bps> bc <burst-normal> be <burst-maximum> conform-action exceed-action violate-action
 * ===__View/Debugging__===
 * ====__Both__====
 * show mls qos
 * show class-map
 * show policy-map
 * show policy-map interface
 * ====__Switch__====
 * show mls qos input-quque
 * show mls qos interface queuing
 * show mls qos maps ...
 * ====__Router__====
 * show mls qos maps
 * show traffic-shape
 * show frame-relay pvc

=Resource Reservation Protocol (RSVP)=


 * provides QoS to traffic flows
 * uni-directional based off source to destination
 * each RSVP enabled router on the flow's path reserves bandwidth
 * flows identified by destination IP, protocol ID and destination port
 * data transmission is delayed by the following steps, waits for ResvConf message
 * ===Steps===
 * first gateway receives first packet of a flow
 * send RSVP PATH message to destination
 * contains IP of previous hop (PHOP)
 * returns messages can follow path back
 * describes bandwidth & QoS needs of traffic
 * next hop router (GW2) receives
 * records current PHOP
 * forwards message on, with updated PHOP as self
 * next hop router (GW3) receives, but isn't configured for RSVP
 * forwards untouched message
 * next hop router (GW4) receives RSVP PATH
 * replies with RESV message to PHOP address
 * requests needed QoS
 * if any PHOP routers don't have sufficient resources, return error
 * initiates RSVP PATH message in other direction
 * GW2 receives RESV
 * checks for requested resource
 * creates reservation for flow
 * forwards RESV
 * GW1 receives RESV
 * knows reservation has succeeded
 * GW1 receives RSVP PATH for other direction
 * responds with RESV to GW4
 * GW4 responds with ResvConf message
 * ===Configuration===
 * config-if# ip rsvp bandwidth <total-kbps> <single-flow-kbps> (default total is 75%; if no single-flow then an flow can reserve all)
 * config-if# ip rsvp signaling dscp (dscp value for rsvp messages)
 * ===Priority Queues===
 * default uses WFQ
 * when using LLQ with CBWFQ, disable RSVP's WFQ
 * config-if# ip rsvp resource-provider none
 * by default will try to process every packet
 * config-if# ip rsvp data-packet classification none (disables)
 * let LLQ & CBWFQ put traffic into priority queue

=Marking=

config# class-map match-[any|all] WORD config-cmap# match protocol ftp (nbar application signatures) config# ip nbar WORD1 (packet description language module file)

=Policy Map=

config# policy-map WORD2 config-pmap# class WORD1 config-pmap-c# set cos (layer 2) config-pmap-c# set precedent (layer 3) config-pmap-c# set dscp (layer 3)

config-if# service-policy input WORD2

=Queuing=

config# class-map WORD1 config-cmap# match ip precedent 1 config# policy-map WORD2 config-pmap# class WORD1 config-pmap-c# bandwidth percent 50 config-pmap-c# bandwidth 100 (kbps min) config-pmap-c# priority 8 (kbps max; has priority; drop if max is reached) config-pmap-c# random-detect precedence 1 20 100 (min, max) config-pmap-c# random-detect precedence 2 40 120 config# interface s0/0 config-if# service-policy output WORD2

=Policing=

config# class-map WORD1 config-cmap# match protocol kazaa2 config# policy-map WORD2 config-pmap# class WORD1 config-pmap-c# police 1000 2000 (conforming bits, exceed bits) config-pmap-c-police# confirm-action transmit config-pmap-c-police# exceed-action drop config-if# service-policy input WORD2 config-if# service-policy output WORD2

=Shaping=

config# class-map WORD1 config-cmap# match protocol http config# policy-map WORD2 config-pmap# class WORD1 config-pmap-c# shape avarage 100000 (cir) config-pmap-c# shape peak 100000 (excess burst) config-if# service-policy output WORD2

=Link Fragmentation and Interleaving=

config# interface multilink 1 config-if# ip address config-if# ppp multilink config-if# ppp multilink fragment delay 10 (ms) config-if# ppp multilink interleave config-if# ppp multilink bandwidth 500 (kbps) config# interface s0/0 config-if# encapsulation ppp multilink group 1

=Compression=

config-pmap-c# compression header ip [rtp|tcp]

=View/Debug Commands=

show policy-map show policy-map interface show class-map show ip nbar protocol-discovery stats bit-rate top-n 10 show mls qos maps [cos-input-q | dscp-input-q] show mls qos input-queue show ip rsvp interface [detail]