QOS notes

The majority of these notes are taken from a class I took at Networld+Interop conference, September 14-16, 1999. Francois Fluckiger (from CERN) was the instructor. They are for my personal reference, nothing more. A lot of these notes are copied directly from his slides. Note that this class was in 1999; standards may have progressed since then. I have updated some things, but not everything...

Table of Contents

L2-802.1p(D)/Q


L3-diffserv


sample cisco router dscp qos cfg section
class-map match-any qos-gw-crit-traf
 match ip dscp cs6
class-map match-any media
 match ip dscp ef
class-map match-any control
 match ip dscp cs3
 match ip dscp af31
!
!
policy-map voip
 class media
  bandwidth percent 50
 class control
  bandwidth percent 5
 class qos-gw-crit-traf
  bandwidth percent 5
 class class-default
  fair-queue
IPv4 packet header (RFC791)

This section needs to be updated...


Precedence and ToS: RFC791 and 1349
Precedence field
(relative discard priority)
ValueRFC791 semantics
110Internetwork Control
101Critical
100Flash Override
011Flash
010Immediate
001Priority
000Routine
ToS field
(relative delay priority)
ValueRFC1349 semantics
1000minimize delay
0100maximize throughput
0010maximize reliability
0001minimize monetary cost
0000normal service


IPv6 packet header





  • DS field (RFC2474) coded in
    • IPv4 ToS octet
    • IPv6 Traffic Class octet
    • 6-bit field to code the DS code point (DSCP field)
    • Incompatable with existing definition of IPv4 ToS


Standardized DHCP markings

Application/Network Service Classes

This table originally taken from Table 4-1 in Nortel VoIP Technologies book
Application Service Class Elasticity DSCP DSCP mark QoS mark Loss Delay
Network Control (net element msging such as routing) Both CS6 48 (dec) 6 Low Low
Telephony (VoIP audio) Inelastic EF 46 (dec) 5 Very Low Very Low
Real-time Interactive (video) Inelastic CS4 32 (dec)   Low Very Low
Multimedia Conferencing (audio-video conferences with rate adaptive CODECs) Rate adaptive AF4x AF41 - 34, AF42 - 36, AF43 - 38   Low/Med Very Low
Signaling (app-signaling such as SIP) Inelastic was CS5, AF31 now CS3 was 40, 26 now 24 (dec) 3 Low Low
Broadcast Video (broadcast-quality trans - IPTV, security video...) Inelastic was CS3 now AF41 was 24 now 34 4 Very Low Med
Multimedia Streaming (audio-video transmissions - podcasts, streaming video...) Elastic AF3x AF31 - 26, AF32 - 28, AF33 - 30   Low/Med Med
Low Latency Data (delay-sensitive apps - client/server, transaction-based svcs Elastic AF2x AF21 - 18, AF22 - 20, AF23 - 22   Low Low/Med
High Throughput Data (file transfers - ftp, http...) Elastic AF1x AF11 - 10, AF12 - 12, AF13 - 14   Low Med/High
OAM (ops data) Both CS2 16   Low Med
Standard (best effort traffic) No spec DF 0   Not specified
Low Priority Data (data that can be starved) Elastic AF1x     High High

ASC to NSC mappings

NSC Traffic Svc Classes

taken from table 4-5 in Nortel VoIP Technologies
Network Control Traffic Category Network Service Class Target Applications Loss Tolerance Delay Tolerance Jitter Tolerance Trafic Profile
Network Control Network
  • Network Control
Low to very low Low NA Variable sized packets
Interactive Premium
  • VoIP Telephony
  • Interactive video (video conferencing)
Very low to low Very low Very low to low Typically varaiable sized packets
Interactive Platinum
  • Multimedia conferencing (rate adaptive)
  • Application Signaling
Low to med Very low to low Low to med Variable sized packets
Responsive Gold
  • Broadcast TV
  • Pay-per-view movies and events
  • Video surveillance and security
  • Web casts - multimedia streaming
  • Interactive gaming
Very low to med Med Low to high Variable sized packets
Responsive Silver
  • Client/Server apps
  • SNA term-to-host transactions (SNA over IP using DLSw)
  • Web-based ordering
  • Credit card transactions
  • Financial wire transfers
  • ERP apps
Low Low to med NA Variable sized packets
Timely Bronze
  • Store and forward apps
  • Email
  • Billing record transfer
  • Non-critical OAM&P (SNMP, TFTP, ...)
Low Med to high NA Variable-sized packets
Timely Standard
  • All traf not in other classes
  • Best Effort traffic
  • Bulk data transfer
Typically not specified Typically not specified NA Variable-sized packets
Timely Custom
  • Customer defined
Custom Defined Custom Defined Custom Defined Specified

RSVP

Resource Reservation Protocol - packets sent to reserve (and tear down) priority path (L3)

Queue Types

FIFO


Simple Priority Queueing (PQ)


Fair Queuing

Weighted Round Robin


Weighted Fair queuing (WFQ)

Congestion Control (including RED and WRED)

Goals Active dropping: RED Weighted RED (WRED)

Cisco Switch Configure QoS - 2960

Taken from 'Catalyst 2960-X Switch QoS Configuration Guide, CIsco IOS Release 15.0(2) EX'

mls qos (turn on QoS globally)
no mls qos rewrite ip dscp (enable DSCP transparency - don't change dscp markings)
show mls qos
show mls qos interface
cdp enable (enable cdp globally)

Trusting port including VoIP phones

interface interface-id
   mls qos trust [cos | dscp | ip-precedence] (trust qos markings coming from this port)
   mls qos cos {default-cos| override} (modify ports cos settings)
   mls qos trust cos (trust cos markings coming from this port - if a phone?)
   mls qos trust dscp (trust dscp markings coming from this port - if a phone?)
   mls qos trust device cisco-phone (trust port markings if device cdp identifies as a cisco phone - switch sets voice packets to COS 5 and data packets to COS 0)

Trust next domain over

mls qos map dscp-mutation dscp-mutation-name in-dscp to out-dscp
interface interface-id
	mls qos trust dscpmls qos dscp-mutation dscp-mutation-name
show mls qos maps dscp-mutation

Configure a QOS Policy

Classify Traffic

access-list access-list-number {deny | permit} source [source-wildcard]
  OR
access-list access-list-number {deny | permit} protocol source source-wildcard destination destination-wildcard

show access-lists
layer 2 MAC ACL
mac access-list extended name
  {permit | deny} {host srsc-MAC-addr mask | any | hosT dst-MAC-addr mask [type mask]

class-map {match-all | match-any} class-map-name
  match {access-group acl-index-or-name | ip dscp dscp-list | ip precedence ip-precedence-list 
  

Policy Maps

class-map [match-all | match-any] class-map-name

policy-map policy-map-name
  class [class-map-name | class-default]
  trust [cos | dscp | ip-precedence]
  set {dscp new-dscp | ip precedence new-precedence}
  police rate-bps burst-byte [exceed-action {drop | policed-dscp-transmit}]

interface (interface-id]
  service-policy input policy-map-name
  
show policy-map [policy-map-name [class class-map-name]]

Aggregate Policer

Aggregate policer is shared by multiple traffic classes eithin same policy map.
mls qos aggregate-policer aggregate-policer-name rate-bps burst-byte exceed-action {drop | policed-dscp-transmit}
(burst-byte is the amount of bytes allowed to burst)

class-map [match-all | match-any] class-map-name

policy-map policy-map-name
  class [class-map-name | class-default]
  police aggregate aggregate-policer-name
interface interface-id
  service-policy input policy-map-name

show mls qos aggregate-policer [aggregate-policer-name]

CoS-to-DSCP Map

mls qos map cos-dscp dscp1...dscp8
(matches 8 COS values (0-7) to DSCP values listed)

show mls qos maps cos-dscp

IP-Precedence-to-DSCP Map

mls qos map ip-prec-dscp dscp1...dscp8
(matches 8 ip precedence values (0-7) to DSCP values listed)

show mls qos maps ip-prec-dscp

policed-dscp map

mls qos map policed-dscp dscp-list to mark-down-dscp

e.g.  policed-dscp 50 51 52 53 54 55 56 57 to 0

show mls maps policed-dscp

DSCP-to-CoS Map

Up to 8 DSCP values
mls qos map dscp-cos dscp-list to cos

e.g. mls qos map dscp-cos 0 8 16 24 32 40 48 50 to 0

show mls qos maps dscp-to_cos

DSCP-to-DSCP Mutation Map

mls qos map dscp-mutation dscp-mutation-name in-dscp to out-dscp
in-dscp can be up to 8 dscp markings
e.g. mls qos map dscp-mutation mutation1 1 2 3 4 5 6 7 to 0

interface interface-id
  mls qos trust dscp
  mls qos dscp-mutation dscp-mutation-name

show mls qos maps dscp-mutation

Cfging Egress Queue Characteristics

mls qos queue-set output qset-id buffers allocation1 ... allocation4
mls qos queue-set output qset-id threshold queue-id drop-threshold1 drop-threshold2 reserved-threshold maximum-threshold
- allocations are percentage applied to each queue
- qset-id is 1 or 2
- drop-thresholds are WTD thresholds as a percentage of queue's allocated memory
- reserved threshold is percentage guaranteed for the queue
- maximum threshold is max percentage memory that queue can have before packets are dropped if  common pool is not empty

interface interface-id
  queue-set qset-id

show mls qos interface [interface-id] buffers

Mapping DSCP or CoS Vals to Egress Queue and Threshold ID

mls qos srr-queue output dscp-map queue queue-id threshold threshold-id dscp1...dscp8
mls qos srr-queue output cos-map queue queue-id threshold threshold-id cos1...cos8

show mls qos maps

By default, DSCP values 0–15 are mapped to queue 2 and threshold 1. DSCP values 16–31 are mapped to queue 3 and threshold 1. DSCP values 32–39 and 48–63 are mapped to queue 4 and threshold 1. DSCP values 40–47 are mapped to queue 1 and threshold 1.

By default, CoS values 0 and 1 are mapped to queue 2 and threshold 1. CoS values 2 and 3 are mapped to queue 3 and threshold 1. CoS values 4, 6, and 7 are mapped to queue 4 and threshold 1. CoS value 5 is mapped to queue 1 and threshold 1.

Cfg SRR Shaped Weights on Egress Queues

Ratio of frequencies that scheduler sends packets from each queue.
interface interface-id
  srr-queue bandwidth shape weight1 weight2 weight3 weight4
   
show mls qos interface interface-id queueing

Weight range is 0 to 65535. 0 means shared mode and srr-queue bandwidth share on interface comes into play. shaped mode overrides shared mode. weight1 default is 25. all others are 0.

Cfg SRR shared Weights on Egress Queues

Shared bandwidth guaranteed but not limited (excess can be used by other queues).
interface interface-id
  srr-queue bandwidth share weight1 weight2 weight3 weight4
 
(weight range is 1 to 255)
show mls qos interface interface-id queueing

Cfg Egress Expedite Queue

This queue gets serviced until empty.
mls qos
interface interface-id
  priority-queue out

NOTE: with expedite queue - weight1 is ignored

Limiting bw on egress intrfce

interface interface-id
  srr-queue bandwidth limit weight1

weight1 is 10 to 90 (default 100)

Cisco Switch Configure QoS - 3850

From QoS Configuration Guide, Cisco IOS XE Release 3SE (Catalyst 3850 Switches)

Overview

Port Policy Format

Default class map

class-map match-any non-client-nrt-class
(puts traffic in Q3 queue)
show class-map

Default policy map

policy-map port_child_policy
	class non-client-nrt-class
		bandwidth remaining ratio 10

System-defined policy map for wireless devices

port-child-policy can be customized
Policy-map policy_map_name
	class class-default
		shape average average_rate
		service-policy port_child_policy

example port child policy
Policy-map port_child_policy
	Class voice-policy-name (match dscp ef)
		Priority level 1
		Police (multicast-policer-name-voice) Multicast Policer
	Class video-policy-name (match dscp af41)
		Priority level 2
		Police (multicast-policer-name-video) Multicast Policer
Class non-client-nrt-class traffic(match non-client-nrt)
		Bandwidth remaining ratio (brr-value-nrt-q2)
	Class class-default (NRT Data)
		Bandwidth remaining ratio (brr-value-q3)
(puts voice and video to Q0 and Q1 queues - strict priority)
(brr-value-nrt-q2 and brr-value-q3 are directed to the Q2 and Q3 specified by class maps class-default and non-client-nrt - round robin)

Hierarchical Wireless QoS

Configuring QoS

Traffic Class

class-map {class-map name | match-any}
	match access-group {index-number | name}
	match class-map class-map-name
	match cos cos-values
	match dscp dscp-values (can be dscp names e.g. af11 af12)
	match ip {dscp dscp-value | precedence precedence-value}
	match non-client-nrt (wireless only - multicast and ap non-client bound traffic)
	match qos-group qos-group-value (0-31)
	match vlan vlan-value
	match wlan user-priority wlan-value (802.11e values 0-7)
		match wlan user-priority 7

Traffic Policy

policy-map policy-map-name
	class {class-name | class-default}
	admit
	bandwidth {kbs-value | percent percentage | remaining {ratio ratio}}
	police {target_bit_rate | cir | rate}
	priority {kbs | level level-value | percent percentage-value}
	queue-buffers ratio ratio-limit
	queue-limit {packets | cos | dscp | percent}
	service-policy policy-map-name
	set {cos | dscp | ip | precedence | qos-group | wlan}
	shape average {target_bit_rate | percent value}

Class-Based Packet Marking

policy-map policy-name
	class class-name
	set cos {cos-value | cos table table-map-name | dscp table table-map-name | 
		 precedence table table-map-name | qos-group table
		 table-map-name | wlan user-priority table table-map-name}
	set dscp {dscp-value | default | dscp table table-map-name | ef | precedence table table-map-name |
		  qos-group table table-map-name | wlan user-priority table table-map-name}
	set ip {dscp | precedence} value
	set precedence {precedence-value | cos table table-map-name | dscp table table-map-name | 
			precedence table table-map-name | qos-group table table-map-name}
	set qos-group {qos-group-value | dscp table table-map-name | precedence table table-map-name}
	set wlan user-priority {wlan-user-priority-value | cos table table-map-name | 
				dscp table table-map-name | qos-group table table-map-name | 
				wlan table table-map-name}

show policy-map

Attaching a traffic policy to an interface

interface type
	service-policy {input policy-map | output policy-map }

show policy map [policy-map-name [class class-map-name]]

Class Maps for Voice/Video

class-map class-map-name
	match dscp dscp-value-for-voice
class-map class-map-name
	match dscp dscp-value-for-video

Configuring Table Maps

enable the mapping and conversion of one field to another using a table (e.g. cos to dscp)
table-map name {default {default-value | copy | ignore} | exit | map {from from-value to to-value } | no}
	map from value to value

show table-map

policy-map
	class class-default
	set cos dscp table table-map-name

Disabling Wireless Traffic Trust

qos wireless-default-untrust

Call Admission Control

class-map class-name
	match dscp dscp-value

table-map name
	default copy

policy-map policy-name
	class class-map-name
	priority level level_value
	police [target_bit_rate | cir | rate ]
	admit cac wmm-tspec
	rate value
	wlan-up value

policy-map policy-name
	class class-map-name
	set dscp dscp table table_map_name
	set wlan user-priority dscp table table_map_name
	shape average {target-bit-rate | percent percentage}
	queue-buffers {ratio ratio-value}
	service-policy policy_map_name

show policy-map

Configuring Bandwidth

policy-map policy-name
	class class-name
	bandwidth {Kb/s | percent percentage | remaining { ratio ratio }}

Configuring Police

policy-map policy-name
	class class-name
	police {target_bit_rate [burst-bytes | bc | confirm-action | pir] | 
		cir {target_bit_rate | percent percentage} | rate {target_bit_rate | 
		percent percentage} conform-action transmit exceed-action {drop [violate action] | 
		set-cos-transmit | set-dscp-transmit | set-prec-transmit | transmit [violate action] }}
	

Configuring Priority

policy-map policy-name
	class class-name
	priority {kbs [burst_in_bytes] | level level-value [burst_in_bytes] | 
	percent percentage-value [burst_in_bytes]}
Priority level 1 is more important than priority level 2. Priority level 1 reserves bandwidth that is processed first for QoS, so its latency is very low. Both priority level 1 and 2 reserve bandwidth.

Configuring Queue Buffers

policy-map policy-name
	class class-name
	bandwidth {kbs-value | percent percentage | remaining {ratio ratio-value}}
	queue-buffers {ratio ratio-value}

Configuring Queue Limits

Weighted Tail Drop. 3 threshold classes. Up to 400% of resrved buffer fr common pool.
policy-map policy-name
	class class-name
	bandwidth {kbs-value | percent percentage | remaining {ratio ratio-value}}
	queue-limit {	packets packets 
			| cos {cos-value { maximum-threshold-value | percent percentage } 
				| values {cos-value | percent percentage } } 
			| dscp {dscp-value {maximum-threshold-value | percent percentage} 
				| match packet {maximum threshold value | percent percentage} 
				| default {maximum-threshold-value | percent percentage} 
				| ef {maximum-threshold-value | percent percentage} 
				| dscp values dscp-value} 
			| percent percentage }}
			
example
-------
queue-limit dscp 3 percent 20
queue-limit dscp 4 percent 30
queue-limit dscp 5 percent 40

Configuring Shaping

policy-map policy-name
	class class-name
	shape average {target-bit-rate | percent percentage}

Monitoring

show class-map [class_map_name]
show policy-map [policy_map_name]
show policy-map interface { Auto-template | Capwap |
	GigabitEthernet | GroupVI | InternalInterface | Loopback | Null |
	Port-channel | TenGigabitEthernet | Tunnel | Vlan | Brief | class |
	input | output | wireless }
show policy-map interface wireless ap [access point]
show policy-map interface wireless ssid [ssid]
show policy-map interface wireless client [client]
show policy-map session [ input | output | uid UUID ]
show table-map
show policy-map interface wireless ssid name ssid-name radio type {24ghz | 5ghz} ap name ap-name

Auto-QoS

Configuring & monitoring

interface interface-id
	auto qos voip {cisco-phone | cisco-softphone | trust}
	auto qos video {cts | ip-camera | media-player}
	auto qos classify [police]
	auto qos trust {cos | dscp}

show autoqos
show running-config | i autoQos
show running-config | i AutoQos	
show auto qos interface interface-id
show policy-map interface interface

Auto-QoS Cos or DSCP generates

auto qos trust cos
	OR
auto qos trust dscp

The following policy maps are created and applied when running this command:
	AutoQos-4.0-Trust-Cos-Input-Policy
		OR
	AutoQos-4.0-Trust-Dscp-Input-Policy
	
	AutoQos-4.0-Output-Policy

The following class maps are created and applied when running this command:
	class-default (match-any)
	AutoQos-4.0-Output-Priority-Queue (match-any)
	AutoQos-4.0-Output-Control-Mgmt-Queue (match-any)
	AutoQos-4.0-Output-Multimedia-Conf-Queue (match-any)
	AutoQos-4.0-Output-Trans-Data-Queue (match-any)
	AutoQos-4.0-Output-Bulk-Data-Queue (match-any)
	AutoQos-4.0-Output-Scavenger-Queue (match-any)
	AutoQos-4.0-Output-Multimedia-Strm-Queue (match-any)

Auto-QoS cisco-phone

auto qos voip cisco-phone
The following policy maps are created and applied when running this command:
	AutoQos-4.0-CiscoPhone-Input-Policy
	AutoQos-4.0-Output-Policy

The following class maps are created and applied when running this command:
	AutoQos-4.0-Voip-Data-CiscoPhone-Class (match-any)
	AutoQos-4.0-Voip-Signal-CiscoPhone-Class (match-any)
	AutoQos-4.0-Default-Class (match-any)
	class-default (match-any)
	AutoQos-4.0-Output-Priority-Queue (match-any)
	AutoQos-4.0-Output-Control-Mgmt-Queue (match-any)
	AutoQos-4.0-Output-Multimedia-Conf-Queue (match-any)
	AutoQos-4.0-Output-Trans-Data-Queue (match-any)
	AutoQos-4.0-Output-Bulk-Data-Queue (match-any)
	AutoQos-4.0-Output-Scavenger-Queue (match-any)
	AutoQos-4.0-Output-Multimedia-Strm-Queue (match-any)

Auto-QoS cisco-softphone

auto qos voip cisco-softphone

The following policy maps are created and applied when running this command:
	AutoQos-4.0-CiscoSoftPhone-Input-Policy
	AutoQos-4.0-Output-Policy
	
The following class maps are created and applied when running this command:
	AutoQos-4.0-Voip-Data-Class (match-any)
	AutoQos-4.0-Voip-Signal-Class (match-any)
	AutoQos-4.0-Multimedia-Conf-Class (match-any)
	AutoQos-4.0-Bulk-Data-Class (match-any)
	AutoQos-4.0-Transaction-Class (match-any)
	AutoQos-4.0-Scavanger-Class (match-any)
	AutoQos-4.0-Signaling-Class (match-any)
	AutoQos-4.0-Default-Class (match-any)
	class-default (match-any)
	AutoQos-4.0-Output-Priority-Queue (match-any)
	AutoQos-4.0-Output-Control-Mgmt-Queue (match-any)
	AutoQos-4.0-Output-Multimedia-Conf-Queue (match-any)
	AutoQos-4.0-Output-Trans-Data-Queue (match-any)
	AutoQos-4.0-Output-Bulk-Data-Queue (match-any)
	AutoQos-4.0-Output-Scavenger-Queue (match-any)
	AutoQos-4.0-Output-Multimedia-Strm-Queue (match-any)

3850 QoS Examples

Endpoint hardphone

interface GigabitEthernet1/0/24
 ...
 trust device cisco-phone
 auto qos voip cisco-phone (configures things below)
 ...
 service-policy input AutoQos-4.0-CiscoPhone-Input-Policy
 service-policy output AutoQos-4.0-Output-Policy

policy-map AutoQos-4.0-CiscoPhone-Input-Policy
 class AutoQos-4.0-Voip-Data-CiscoPhone-Class
   set dscp ef
    police cir 128000 bc 8000
      conform-action transmit
      exceed-action set-dscp-transmit dscp table policed-dscp (cs1 set)
 class AutoQos-4.0-Voip-Signal-CiscoPhone-Class
   set dscp cs3
    police cir 32000 bc 8000
      conform-action transmit
      exceed-action set-dscp-transmit dscp table policed-dscp (cs1 set)

class-map match-any AutoQos-4.0-Voip-Data-CiscoPhone-Class
  match cos  5
class-map match-any AutoQos-4.0-Voip-Signal-CiscoPhone-Class
  match cos  3

policy-map AutoQos-4.0-Output-Policy
 class AutoQos-4.0-Output-Priority-Queue
    priority level 1 percent 30
 class AutoQos-4.0-Output-Control-Mgmt-Queue
    bandwidth remaining percent 10
    queue-limit dscp  cs2 percent 80
    queue-limit dscp  cs3 percent 90
    queue-limit dscp  cs6 percent 100
    queue-limit dscp  cs7 percent 100
    queue-buffers ratio 10
 class AutoQos-4.0-Output-Multimedia-Conf-Queue
    bandwidth remaining percent 10
    queue-buffers ratio 10
 class AutoQos-4.0-Output-Trans-Data-Queue
    bandwidth remaining percent 10
    queue-buffers ratio 10
 class AutoQos-4.0-Output-Bulk-Data-Queue
    bandwidth remaining percent 4
    queue-buffers ratio 10
 class AutoQos-4.0-Output-Scavenger-Queue
    bandwidth remaining percent 1
    queue-buffers ratio 10
 class AutoQos-4.0-Output-Multimedia-Strm-Queue
    bandwidth remaining percent 10
    queue-buffers ratio 10
 class class-default
    bandwidth remaining percent 25
    queue-buffers ratio 25

class-map match-any AutoQos-4.0-Output-Priority-Queue
  match  dscp cs4  cs5  ef
  match cos  5
class-map match-any AutoQos-4.0-Output-Control-Mgmt-Queue
  match  dscp cs2  cs3  cs6  cs7
  match cos  3
class-map match-any AutoQos-4.0-Output-Multimedia-Conf-Queue
  match  dscp af41  af42  af43
  match cos  4
class-map match-any AutoQos-4.0-Output-Trans-Data-Queue
  match  dscp af21  af22  af23
  match cos  2
class-map match-any AutoQos-4.0-Output-Bulk-Data-Queue
  match  dscp af11  af12  af13
  match cos  1
class-map match-any AutoQos-4.0-Output-Scavenger-Queue
  match  dscp cs1
class-map match-any AutoQos-4.0-Output-Multimedia-Strm-Queue
  match  dscp af31  af32  af33
  

Endpoint untrusted

interface GigabitEthernet2/0/28
 ---
 ---
 service-policy input Qos-CompanyUntrusted-Input-Policy
 service-policy output AutoQos-4.0-Output-Policy

table-map dscp-to-default-000000
 default 0

class-map match-any Qos-CompanyRTP-Conf-Class
  match access-group name Qos-CompanyRTP-Conf
ip access-list extended Qos-CompanyRTP-Conf
 permit udp any any range 16384 32767
 permit tcp any any range 16384 32767
class-map match-any Qos-Company-Signaling-Class
  match access-group name Qos-Company-Acl-Signaling
ip access-list extended Qos-Company-Acl-Signaling
 permit tcp any any range 2000 2002
 permit tcp any any range 5060 5061
 permit udp any any range 5060 5061
 permit tcp any any range 1718 1720
 permit udp any any range 1718 1720
class-map match-any Qos-Company-gateway-critical-traffic
 match access-group name Qos-Company-gateway-critical-Conf
ip access-list extended Qos-Company-gateway-critical-Conf
 permit tcp any any eq 22

policy-map Qos-CompanyUntrusted-Input-Policy
class Qos-CompanyRTP-Conf-Class !typical cisco rtp range
   set dscp ef
    police cir 30000000
      conform-action transmit
      exceed-action set-dscp-transmit dscp table dscp-to-default-000000
class Qos-Company-Signaling-Class !sccp sip h323
   set dscp cs3
    police cir 5000000
      conform-action transmit
      exceed-action set-dscp-transmit dscp table dscp-to-default-000000
class Qos-Company-gateway-critical-traffic
   set dscp cs6
    police cir 5000000
      conform-action transmit
      exceed-action set-dscp-transmit dscp table dscp-to-default-000000
class class-default
   set dscp default

Endpoint trusted

class-map match-any Qos-CompanyTrusted-RTPOut-Class
   match dscp ef
class-map match-any Qos-CompanyTrusted-SignalingOut-Class
   match dscp cs3
class-map match-any Qos-CompanyTrusted-gw-crit-traffic
   match dscp cs6

!policy-map Qos-CompanyTrusted-Input-Policy
   !copy dscp and cos is one for one by default

policy-map Qos-CompanyTrusted-Output-Policy
 class Qos-CompanyTrusted-RTPOut-Class !marked media/rtp
   !dscp ef
   !priority level 1
   bandwidth percent 30
   !police cir 30000000
   !   conform-action transmit
   !  exceed-action drop
 class Qos-CompanyTrusted-SignalingOut-Class !marked signalling
   !dscp cs3
   bandwidth percent 5
   ! police cir 5000000
   !   conform-action transmit
   !   exceed-action drop
 class Qos-CompanyTrusted-gw-crit-traffic
   !dscp cs6
   bandwidth percent 5
   ! police cir 5000000
   !   conform-action transmit
   !   exceed-action drop
 class class-default
   !dscp default (0)
   bandwidth percent 60

int TenGigabitEthernet1/1/3
  service-policy output Qos-CompanyTrusted-Output-Policy
int TenGigabitEthernet2/1/3
  service-policy output Qos-CompanyTrusted-Output-Policy