Archive for the ‘WAN’ Category

One of the more tedious parts of any phone system deployment is configuring the access layer switches to support said phones.  The configuration in and of itself isn’t complicated, but every port that may receive a phone needs to be setup correctly.  In Cisco parlance, this is accomplished with the switchport voice vlan <ID> command.  I’ve typed that into the CLI a thousand times and never really knew what it did besides “make the phones work”.  After a little research, I finally found some answers.  I thought I’d share them with you.

In the old days, before the Catalyst 2950, configuring a switch port for use by a phone involved creating an explicit 802.1q trunk.  This made sense from the perspective that it allowed traffic from multiple VLANs to pass on a single link.  It also allowed the 802.1p priority bits for Quality of Service (QoS) tagging to be sent with the frames.  The downside is that it was very difficult for phone mobility.  You either needed to provision every phone-facing switchport in your organization to be an 802.1q trunk or you had to leave the phones were they were.  While the latter is usually the case in most of my deployments, the mobility provided by the ability to plug a phone in anywhere in the network and not worry about extra configuration is key to some clients.  Thankfully, Cisco fixed this starting in the 2950 with a little concept known as the Auxiliary VLAN.

The Auxiliary VLAN (AUX VLAN) is a specialized VLAN that sits beside a regular access VLAN configured on a switch (sometimes called a “normal” VLAN).  The purpose of the AUX VLAN is to allow IP phones to transmit their payloads along with the untagged data coming from a PC that might be plugged into a switchport on the back of the phone.  The AUX VLAN allows these two devices to transmit on the same port without the need to use an explicit trunk on the link.  In addition, since the port is not configured explicitly as an 802.1q trunk, extraneous VLANs will not be flooded over the port.  In essence, the port becomes a two VLAN trunk.  All the phone traffic is tagged with the ID of the AUX VLAN and the PC traffic is untagged.  Curiously, according to this document, the traffic in the AUX VLAN must also carry a Class of Service (CoS) of 5 along with the AUX VLAN ID.  Otherwise, the traffic is dropped.  So how does the phone get the ID of the AUX VLAN so it can start sending the traffic?  Ah, that’s where CDP comes in.

Cisco Discovery Protocol (CDP) is very crucial in the operation of a Cisco IP phone.  It not only provides the AUX (Voice) VLAN ID for the phone to being sending traffic on the AUX VLAN, it also allows the phone to automatically negotiate power settings.  This allows the phone to use less than the maximum 15.4 watts of power under the 802.3af PoE standard.  If you disable CDP on the port facing the phone/PC you will likely start pulling your hair out.  Even though the phone might have already assigned itself in the Voice VLAN, removing CDP from the switchport in question causes it to forget where to find the voice VLAN.  You’ll need to re-enable CDP and reboot the phone.  You could also statically configure an 802.1q trunk to fix the issue, but where’s the fun in that?

One other curious note is that I’ve always been told that the connection between the phone and the switch when switchport voice vlan is configured is a “special 802.1q trunk”.  Not that I’ve ever been able to see that configuration, as show interface trunk seems to think that the port isn’t trunking and show interface switchport says that it’s an access port.  The key is in Cisco’s documentation.  The correct term for a port with switchport voice vlan configured is a “multi-VLAN access port”.  The distinction between the two is that only the two vlans (voice and access) configured on the switchport will be accepted on the link.  If you were to do something silly like, oh I don’t know, plug another switch into the back of the phone and configure an access port on that switch to be in a different VLAN than the voice or PC access VLAN, traffic will not pass through the phone port to the switch.  Once again, that’s because this isn’t a real trunk.  The switch will only accept tagged frames from the Voice (AUX) VLAN.

Thanks Networking Nerd for this article.


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