Archive for the ‘QOS’ Category

QoS is very important for Voice traffic which is delay sensitive. I won’t go into details of QoS over here and will just explain the configuration we normally use on a Voice gateway for QoS.

class-map match-any Voice-RTP
match ip precedence 5
match ip dscp ef
match ip rtp 16384 16383
class-map match-any Voice-Cntl
match ip precedence 3
match ip dscp af31
match access-group name voice-signal
!
ip access-list extended voice-signal
permit tcp any any range 2000 2002
permit udp any any eq 2427
permit tcp any any eq 2428
permit tcp any any eq 1720
permit tcp any any range 11000 11999
!
!
policy-map QoS-LAN-Policy
class Voice-RTP
set dscp ef
priority 500
class Voice-Cntl
set dscp af31
bandwidth 30
class class-default
fair-queue
!

Apply it on Voice VLAN interface or towards the WAN interface if you are configuring it between sites:

!
interface FastEthernet0/1
ip address 10.0.1.1 255.255.255.0
ip rip advertise 2
ip virtual-reassembly
ip tcp adjust-mss 1360
duplex full
speed 100
service-policy output QoS-LAN-Policy
!

OR

!
interface GigabitEthernet0/0.105
description *** Voice VLAN ***
encapsulation dot1Q 105
ip address 10.60.x.x 255.255.255.0
h323-gateway voip bind srcaddr 10.60.x.x
service-policy output QoS-LAN-Policy

====

Confirmation that the voice packets are hitting the service policy:

GW#sh policy-map int fa0/1
FastEthernet0/1

Service-policy output: QoS-LAN-Policy

Class-map: Voice-RTP (match-any)
55890 packets, 11178000 bytes
5 minute offered rate 0 bps, drop rate 0 bps
Match: ip precedence 5
55890 packets, 11178000 bytes
5 minute rate 0 bps
Match: ip dscp ef (46)
0 packets, 0 bytes
5 minute rate 0 bps
Match: ip rtp 16384 16383
0 packets, 0 bytes
5 minute rate 0 bps
QoS Set
dscp ef
Packets marked 55890
Queueing
Strict Priority
Output Queue: Conversation 264
Bandwidth 500 (kbps) Burst 12500 (Bytes)
(pkts matched/bytes matched) 55890/11960460
(total drops/bytes drops) 0/0

Class-map: Voice-Cntl (match-any)
605 packets, 80661 bytes
5 minute offered rate 0 bps, drop rate 0 bps
Match: ip precedence 3
605 packets, 80661 bytes
5 minute rate 0 bps
Match: ip dscp af31 (26)
0 packets, 0 bytes
5 minute rate 0 bps
Match: access-group name voice-signal
0 packets, 0 bytes
5 minute rate 0 bps
QoS Set
dscp af31
Packets marked 605
Queueing
Output Queue: Conversation 265
Bandwidth 30 (kbps)Max Threshold 64 (packets)
(pkts matched/bytes matched) 605/76019
(depth/total drops/no-buffer drops) 0/0/0

Class-map: class-default (match-any)
1103573 packets, 80456575 bytes
5 minute offered rate 151000 bps, drop rate 0 bps
Match: any
Queueing
Flow Based Fair Queueing
Maximum Number of Hashed Queues 256
(total queued/total drops/no-buffer drops) 0/0/0

QoS for WAN

Posted: May 12, 2012 in QOS, WAN
Tags: , ,

Fair Queueing

fair-queue <congestive discard threshold>

fair-queue 128 <dynamic queues> <reservable queues>

after these many packets (128) in each queue, rest of packets are tail dropped

CBWFQ

class-map <name>
match access-group <number>
or
match ip dscp or match dscp
match ip precedence or match precedence
or
match input-interface
or
match protocol <protocol>

policy-map <name>
class <class1>
bandwidth <kbps> or
bandwidth percent <percent>

class <class2>
bandwidth <kbps>
queue-limit <number of packets> — defines number of packets that may be queued for this class

*** Upto 64 classes may be defined inside a policy map.
*** The total bandwidth allocated to all classes should add to 75%
*** 25% is used for routing and control traffic

This value can be changed using
ints0/0
max-reserved-bandwidth <value>

Random Early Detection

Enabling WRED instead of tail drop (which is the default)

policy-map <name>
class <class1>
bandwidth <kbps>
randmom-detect
random-detect exponential-weighting-constant <value>

The exp. weighting constant is used to find out the avg. length of queues.
The first random-detect command enables WRED for that class.

Configuring LLQ

class-map match-all VoiceB
match dscp ef
class-map match-all VoiceC
match dscp af31
class-map match-all Data
match access-group 101
!
!
policy-map CBWFQ
class VoiceB
priority percent 45
class Data
bandwidth percent 20
class VoiceC
bandwidth percent 10
class class-default
fair-queue 128
!
interface Serial0/0 .

encapsulation frame-relay

service-policy output CBWFQ — LLQ cannot be applied to sub interfaces

If you have sub interfaces use this template:
class-map match-all VoiceB
match dscp ef
class-map match-all VoiceC
match dscp af31
class-map match-all Data
match access-group 101
class-map match-all VoiceBearer
!
!
policy-map CBWFQ
class VoiceB
priority percent 45
class Data
bandwidth percent 20
class VoiceC
bandwidth percent 10
class class-default
fair-queue 128
map-class frame-relay LLQ
service-policy output CBWFQ

int s0/0
encapsulation frame-relay
frame-relay traffic-shaping
———– always enable shaping before applying map-class to subinterface
!

int s0/0.101
frame-relay interface-dlci 101
class LLQ

map-class frame-relay LLQ
service-policy output CBWFQ
frame-relay cir 120000
frame-relay mincir 60000

LLQ – Calculating Total bandwidth:
===========================

*** The bandwidth percent allocates bandwidth as a percentage of total bandwidth on link.

*** For a frame-relay PVC ,if minCIR is configured, total bandwidth = mincir
*** For a frame-relay PVC , if minCIR is not configured, total bandwidth = cir/2

*** Default CIR of 56000 bps is applied if no map-class is configured or a map-class with no cir/mincir settings r configured.
Ways to apply LLQ on a FR sub interface:
——————————————

a. Apply it on main interface and disable Traffic shaping and fair queue.

class-map match-all VoiceB
match dscp ef
class-map match-all VoiceC
match dscp af31
class-map match-all Data
match access-group 101
class-map match-all VoiceBearer
!
!
policy-map CBWFQ
class VoiceB
priority percent 45
class Data
bandwidth percent 20
class VoiceC
bandwidth percent 10
class class-default
fair-queue 128

int s0/0
no frame-relay traffic-shaping
no fair-queue
service-policy output CBWFQ
max-reserved-bandwidth 75 —- this is default. YOu may change this. This command is not supported with FR subinterfaces.

b. Apply on sub interface (point to point) using a map-class directly on the sub int. Enable TS on main interface.

class-map match-all VoiceB
match dscp ef
class-map match-all VoiceC
match dscp af31
class-map match-all Data
match access-group 101
class-map match-all VoiceBearer
!
!
policy-map CBWFQ
class VoiceB
priority percent 45
class Data
bandwidth percent 20
class VoiceC
bandwidth percent 10
class class-default
fair-queue 128
map-class frame-relay LLQ
service-policy output CBWFQ
frame-relay cir 120000
frame-relay mincir 60000

int s0/0
frame-relay traffic-shaping

int s0/0.1 p
frame-relay map-class LLQ
c. Apply at VC level (say point to point or PMP) using a map-class directly on the VC. Enable TS on main interface.

class-map match-all VoiceB
match dscp ef
class-map match-all VoiceC
match dscp af31
class-map match-all Data
match access-group 101
class-map match-all VoiceBearer
!
!
policy-map CBWFQ
class VoiceB
priority percent 45
class Data
bandwidth percent 20
class VoiceC
bandwidth percent 10
class class-default
fair-queue 128

map-class frame-relay LLQ
service-policy output CBWFQ
frame-relay cir 120000
frame-relay mincir 60000

int s0/0
frame-relay traffic-shaping

int s0/0.1 m
frame-relay interface-dlci 101
class LLQ
frame-relay interface-dlci 102
class LLQ

Configuring FRTS
——————–

CIR = Bc/Tc (set it to 95% of the actual link speed)

If the link speed is a full T1 (1,544,000), then set the CIR to 1466800

map-class frame-relay test
frame-relay cir 64000 — set to actual cir.
no frame-relay adaptive-shaping becn
frame-relay bc 1000 — keep this low so that Tc is low. (tc = 10ms)
frame-relay be 0

int s0/0
frame-relay traffic-shaping
int s0/0.1
frame-relay interface dlci
class test

Traffic shaping parameters for Voice

For data Bc = CIR / 8, tc – 125ms
For Voice Bc = CIR/100 tc – 10ms
map-class frame-relay FRTS_Site3
frame-relay cir 768000
frame-relay bc 7680
frame-relay be 0
frame-relay mincir 768000
frame-relay fragment 1000
frame-relay fair-queue
map-class frame-relay FRTS_Site2
frame-relay cir 256000
frame-relay bc 2560
frame-relay be 0
frame-relay mincir 256000
frame-relay fragment 320
frame-relay fair-queue

FRF 12 fragmentation:
====================

FRF12 fragments all packets above the specified size. Specify a size greater than voice packet).
Voice packets wont be fragmented. Long data packets get fragmented. Voice packets will be interleaved
between fragmented data packets…

Default fragment size – 53 bytes
g711 160 bytes (voice payload)
g729 20 bytes (voice payload)

Total size of IP header (IP/UDP/RTP) – (20/8/12)
Total g711 packet size = 160 + 40 = 200 bytes
Total g729 packet size = 20 + 40 = 60 bytes

Set frame-relay fragment > 200 bytes (say 220 bytes)

map-class frame-relay test
frame-relay fragment <bytes>

RTP header compression for frame interfaces:
——————————————-

int s0/0.1
frame-relay ip rtp header-compression
## all outgoing is compressed

frame-relay ip rtp header-compression passive
## all outgoing is compressed only if incoming is compressed. Dont give passive option on both ends.
frame-relay ip rtp header-compression iphc-format
## enables TCP headre and RTP header compression
ip rtp header-compression ietf-format

Calculating fragment size using serialization delay

56kbps 70
64 kbps 80 bytes
128 160
256 320
512 640
768 960

One of the current limitations is that the JTAPI (CTI-quick buffer encoding [QBE]) signaling packets are unmarked (TOS = 0) when the Cisco Unity Express AIM transmits them. In order to correct this, use an access control list (ACL) on the router that has the Cisco Unity Express AIM installed to mark and prioritize the traffic.

The JTAPI signaling from the Cisco CallManager is correctly marked with a differentiated services code point (DSCP) value of CS3.

The JTAPI signaling protocol uses TCP port 2748. Dedicate 20 kbps per Cisco Unity Express site for this traffic.

All Real-Time Protocol (RTP) audio traffic from the Cisco Unity Express AIM or the IP phone is correctly marked with a DSCP value of 0xEF.

This example shows a sample configuration for this on the router where a.b.c.d is the IP address of the Cisco Unity Express AIM:

access-list 101 permit tcp host a.b.c.d any eq 2748
!
class-map match-all cti-qbe
 match access-group 101
!
policy-map cti-qbe
 class cti-qbe
 set dscp af31
 bandwidth 20
!
interface Serial0/1
 service-policy output cti-qbe