Jun 07

Class Maps Using NBAR

Below I will show an example of creating a class map that is to match SCCP, SIP and JTAPI using only nbar.

By default Class Maps use match-all statement. So if you you need to match multiple protocols, you must enter match-any when defining a class-map.

(config)#class-map CM-SIG
(config-cmap)#match protocol sip

(config-cmap)#match protocol skinny *NOTE we use the term skinny and not SCCP

By default nbar has existing port-mappings for SIP and SCCP(Skinny), but not for Jtapi. If we try to add match protocol jtapi, the IOS will throw an error.

To view the default nbar port mappings use the following command:

#show ip nbar port-map

We need to create a custom nbar port map for jtapi. To do this enter the below command:

(config)#ip nbar custom name tcp|udp portnumber

(config)#ip nbar custom jtapi tcp 2748

To verify the custom nbar port-map exists, enter the below:

#show run | i nbar

After this is defined in nbar, we can now use the match protocol jtapi in the class-map configuration.

(config-cmap)#match protocol jtapi

Note: To match traffic using nbar in class-maps, you do not need to enable nbar on any interface.


May 27

Call Control QoS – IOS

Just a brief note to mention QoS for call control and media flow on ISRs. Three areas are Dial Peers, MGCP Gateways (IOS Only) and SCCP controlled resources. Its important to understand where to find the QoS related configuration for each of the above not only for the CCIE Voice exam but for real-world projects aswell.


The default QoS markings are the same for both H323 (Default) and SIP dialpeers on an ISR. The RTP or Media is marked as EF, while the Signalling is marked at AF31. Remember Industry best practices for RTP/Media is EF and for signalling is CS3. To find this information on a Cisco ISR, enter the following command.

#Show dial-peer voice dialpeer number | i DSCP

Output from the above command:

ip media DSCP = ef, ip media rsvp-pass DSCP = ef
ip media rsvp-fail DSCP = ef, ip signaling DSCP = af31,
ip video rsvp-none DSCP = af41,ip video rsvp-pass DSCP = af41
ip video rsvp-fail DSCP = af41,

To change the default QoS markings, entering the Dial-Peer config mode and use the below commands:

  • ip qos dscp ef media
  • ip qos dscp cs3 signalling

I realise we are not changing the EF marking, but this is just to give you an example of where and how to change the markings.

You can find all the QoS DSCP Values and their relating Binary numbers if enter the ? after dscp:

(config-dial-peer)# ip qos dscp ?

<0-63>   DSCP value
af11     Sets DSCP to assured forwarding (af11) bit pattern 001010
af12     Sets DSCP to assured forwarding (af12) bit pattern 001100
af13     Sets DSCP to assured forwarding (af13) bit pattern 001110
af21     Sets DSCP to assured forwarding (af21) bit pattern 010010
af22     Sets DSCP to assured forwarding (af22) bit pattern 010100
af23     Sets DSCP to assured forwarding (af23) bit pattern 010110
af31     Sets DSCP to assured forwarding (af31) bit pattern 011010
af32     Sets DSCP to assured forwarding (af32) bit pattern 011100
af33     Sets DSCP to assured forwarding (af33) bit pattern 011110
af41     Sets DSCP to assured forwarding (af41) bit pattern 100010
af42     Sets DSCP to assured forwarding (af42) bit pattern 100100
af43     Sets DSCP to assured forwarding (af43) bit pattern 100110
cs1      Sets DSCP to class selector codepoint 1 (precedence 1)
cs2      Sets DSCP to class selector codepoint 2 (precedence 2)
cs3      Sets DSCP to class selector codepoint 3 (precedence 3)
cs4      Sets DSCP to class selector codepoint 4 (precedence 4)
cs5      Sets DSCP to class selector codepoint 5 (precedence 5)
cs6      Sets DSCP to class selector codepoint 6 (precedence 6)
cs7      Sets DSCP to class selector codepoint 7 (precedence 7)
default  Sets DSCP to default bit pattern of 000000
ef       Sets DSCP to expedited forwarding bit pattern 101110

MGCP Controlled Resources

MGCP has the same defaults as Dial Peers, so I won’t go in too deep. To find the what QoS values have been configured for MGCP resources enter the command:

#Show mgcp | i DSCP

To change the DSCP Values for media and signalling in MGCP, enter the following commands:

(config)#mgcp ip qos dscp ef media

(config)#mgcp ip qos dscp cs3 signalling

SCCP Controlled Resources

QoS default markings for SCCP are EF for RTP/Media and CS3 for signalling, so in effect SCCP meets the industry best practices. However dont assume these values are configured correctly for the CCIE Voice lab exam. SCCP QoS config is found in the SCCP CCM Group configuration.

#Show sccp ccm group 1

To configure QoS markings for SCCP CCM Groups enter the following:

(config-sccp-ccm)#audio dscp ef

(config-sccp-ccm)#signalling dscp cs3

I hope this clarifies a little for you, now knowing exactly where to go find and change DSCP Values for call controll resources on an ISR Voice Gateway.

May 23

LAN QoS Information for CCIE Voice Lab

Referenced Documents for studying

Recommended to read the following guides prior to Lab Exam:

  • Medianet  Campus QoS Design 4.0
  • SRND CUCM 7.0 -> Under Network Infrastructure Chapter
  • Enterprise Qos Solution Reference Network Design Guide Version 3.3

Basic QoS Marking

Per Hop Behaviour (PHB) splits the 6 most left bits in the ToS Byte into two. First half is the CS or IP Precedence bits, the second half is used for the Drop Probability. PHB uses EF, AF and CS terminology. DSCP spans 6 bits in the ToS Byte and is shown in binary format. ECN are the two right most bits in the ToS Byte

ToS Byte

Tos Byte : Reference from Cisco.com

Industry Defaults as it pertains to Voice

  • EF – DSCP 46 is used for Voice Traffic | Layer 2 CoS Map is 5
  • AF41 – DSCP 34 is used for Video | Layer 2 CoS Map is 4
  • CS3 – DSCP 24 is used for Voice Signalling | Layer 2 CoS Map is 3
  • Scavenger – DSCP 8 is used for malformed traffic ie worms | Layer 2 CoS Map is 1

3750 Priority Queuing

Priority queuing is disabled by default and all queues are equal. The 3750 switch has 2 Ingress Queues and 4 Egress Queues. If Priority queuing is enabled for ingress/ egress queue the Egress Priority Queue is Queue 1 and the Ingress Priority Queue is Queue 2. The priority queue will empty first before any other queue is looked at.

DSCP PHB values are assigned to Queues, a DSCP PHB Value can only be assigned to one queue for the egress and ingress.

If conflicting ToS values exist between the Layer 3 and Layer2 headers, then the DSCP value is preferred over the CoS value on the 3750 Switch. Based on the DSCP value is what determines which queue the packet is to be placed into.

Priority-queue out interface command configures the Priority Queue.

Buffer and Memory Allocation

We can determine how much memory can be allocated per queue. ie. determine how big the queue can be. Memory allocation is Ratio driven. Eg. Queue 1 is configured at 10%, hence Queue 1 can used 10% of the memory that is assigned to the entire port (Reserved Pool).

The queue can utilise memory from the Common Pool buffer and/or from reserved buffers if they are not being used by other queues on the switch. This allows the queue buffer to expand over configured reserved buffer and up to the maximum allocated buffer for the queue.

Configured via the mls qos queue-set output qset-id threshold queue-id drop-threshold1 drop-threshold2 reserved-threshold maximum-threshold command. The reserved-threshold is the total reserved memory for the queue (100%/T3) and the maximum-threshold is the absolute maximum memory the queue can use including from the Common Pool memory

mls qos queue-set output qset-id buffers allocation1 allocation2…allocation4. The total amount of allocated buffer equals the Reserved Pool. Unused memory from the reserved pool is returned to the Switch Common Pool for other queues to potentially use.

Weighted Tail Drop

3750 switch has 3 WTD Thresholds for each queue. T3 (Tail Drop Threshold 3) is always 100%. eg. Because the memory allocation for the queue is full, then 100% of the incoming frames will be dropped.

This leaves 2 configurable WTD Thresholds. We can configure any threshold for each queue. Eg. T1 for Q1 equals 40%(400 frames), T2 for Q1 equals 60% (600 frames). If we were to apply this to PHB, we configure PHB to WTD Thresholds. So if we configured CoS 0-3 in Q1/T1 then when the memory allocation for Q1 reaches 40%,the switch will proceed to tail drop CoS 0-4 traffic, but not touch other PHB traffic configured in the queue for example EF Q1/T2 which is CoS 4-5 or Q1/T3 which is CoS 6-7.

Weighted Threshold Drop

Reference from Cisco.com

Note: T1 and T2 can be equal to T3

Shaped Round Robin (SRR) & Shared Round Robin (SRR)

SRR Controls the rate at which packets are sent. The SRR on the ingress queue sends packets to the Stack Ring and the SRR on the egress queue sends the packets to the egress port. The ingress Queue only supports Sharing Round Robin. The egress Queue supports both Shaping and Sharing Round Robin.

Shaped mode guarantees a percentage of bandwidth for the egress queue. The egress queue is rate-limited to the configured amount. Shaped traffic does not use more than its allocated bandwidth even if the interface/link is idle.

In shared mode, the queue shares the bandwidth among themselves. The bandwidth is guaranteed but not limited for each queue. Ie. If the interface/link was idle a single queue can use more than its configured bandwidth amount.

Interface commands:

  • srr-queue bandwidth share weight1 weight2 wieght3 weight4
  • srr-queue bandwidth shape weight1 weight2 wieght3 weight4



Mar 21


RSVP is a topology aware Call Admission Control (CAC) mechanism. As with any CAC mechanism the main purpose is to determine whether a call has enough bandwidth to proceed. RSVP supports any network topology and can pass through non-rsvp aware routers. Non-rsvp aware router will ignore and forward all rsvp messages.

RSVP signalling uses the same IP route as the media stream would take. If bandwidth on any link throughout the network is not sufficient, the reservation fails. If there is sufficient bandwidth throughout the network the reservation succeeds.

RSVP calculation

Lets work with G729 codec. Now before I get into how RSVP calculates bandwidth requirements, let do a quick refresher on payload sizes, and rtp stream size requirements for G729.

Below is a quick calculation on the three sampling sizes available for configuration in CUCM and CME.

10ms sampling size
IP Header = 20bytes
UDP Header = 8bytes
RTP Header = 12bytes
Payload = 10bytes
Total 50bytes per packet

1000ms / 10ms (sampling size)  = 100packets per seconds (pps)

100pps x 50bytes = 5000bytes per second

Convert to kbps = 40kbps. This is needed to for a single call with G729 with 10ms sampling size.

20ms sampling (Default for both CUCM and CME)

IP Header 20bytes
UDP Header 8bytes
RTP Header 12bytes
Payload 20bytes
Total 60bytes per packet.

1000ms / 20ms = 50pps

50pps x 60bytes = 3000bytes per second

Convert to kbps = 24kbps. This is needed to for a single call with G729 with 20ms sampling size.

30ms Sampling size

IP Header 20bytes
UDP Header 8bytes
RTP Header 12bytes
Payload 30bytes
Total 70bytes per packet

1000ms / 30ms = 33pps

33pps x 70bytes = 2310bytes per second

Convert to kbps = 18.4kbps. This is needed to for a single call with G729 with 30ms sampling size.

As we can see the 10ms sampling size requires the highest amount of bandwidth being 40kbps. Keep that in mind for a later discussion.

RSVP bandwidth pool is configured on each router’s interface with the ip rsvp bandwidth bandwidth command.

The bandwidth entered should equal the number of calls that is allowed to stream across the interface simultaneously. Working from the default (20ms sampling size), if we want to restrict calls to a maximum of 5 calls, we would enter 136kbps for the bandwidth. You are probably saying, the bandwidth should be 120kbps as 5 x 24kbps equals 120kbps. BUT RSVP doesn’t know the sampling size when the its setting up the reservation. All RSVP knows is the codec type, in this case its G729 which uses a maximum of 40kbps, remember going back to the previous discussion, a 10ms smapling size equals 40kbps. RSVP allows for the maximum size for a G729 call initially, until the rsvp process can look inside the voice stream and determine what sampling size the codec is using. Generally default is left, there the size is 24kbps, RSVP then throttles down the bandwidth needed to 24kbps. Therefore we always add 16kbps (the difference between a 20mx sampling size packet to a 10ms sampling size packet) to the rsvp bandwidth. This allows the last call to be initiated at 40kbps, before being throttled down. If we didn’t add the 16kbps onto the bandwidth needed, the last call would never be allowed to be setup as the RSVP process would have 24kbps left in the bandwidth pool, but 40kbps is needed to initially setup the reservation.

RSVP for CAC purposes is a DiffServ Model, not InetServ model. Yes RSVP traditionally speaking is an InetServ model as the RSVP process sits on the Control and Data Plane of the router. However RSVP used by CUCM sits only on the Control Plane, hence controls the Call Admission Component and not the actual QoS which runs on the Data Plane level. The QoS is left up to the LLQ mechanism.

Configuring RSVP


Interface G0/0
ip rsvp bandwidth kbps
 Dspfarm profile 2 mtp
Codec g729
Codec pass-through
Maximum sessions software 4 (Ensure this number is greater than or equal to the number of  calls desired.

 Sccp local Loopback 0
Sccp ccm identifier 1 version 7+
Sccp ccm identifier 2 version 7+

 Sccp ccm group 1
 Bind interface loopback 0
 Associate ccm 1 priority 1
 Associate ccm 2 priority 2
 Associate profile 2 register HQ-RSVP


*Can only use one codec assigned to an MTP resource, although you can have variations of the codec in same MTP resource. Eg G729a G729ab etc

*The MTP resource can also be used for other purposes, not just rsvp. So its always a good idea to allow maximum sessions higher to what is allowed by RSVP CAC as other process maybe using ghe MTP resource and consuming a session.