A simple & sample config for VOIP via DSCP/CoS Settings.
Step | Explanation | Commands | Comments |
1 | Set queue 5 on all ports to use strict priority mode. This queue shall be used for all VoIP packets. Activate DiffServ for the switch. | Config cos-queue strict 5 diffserv |
Activate strict priority scheduler mode for specified queue |
2 | Create a DiffServ classifier named class_Traffic_VOIP and define a match criterion to detect UDP packets that are already marked with IP DSCP Field value of EF (at an earlier trust boundary e.g. IP Phone). The class type match-all indicates that all match criteria defined for the class must be satisfied in order for a packet to be considered a match. |
class-map match-all class_Traffic_VOIP match protocol udp match ip dscp ef exit |
|
3 | Create a second DiffServ classifier named class_VLAN_VOIP and define match criterion based on VLAN identifier Value. List VOIP VLANs. Use class-type match-any so any of the VOIP VLANs in identifier field will qualify the packet as VOIP. |
class-map match-any class_VLAN_VOIP match vlan 31 match vlan 33 match vlan 35 Exit |
These are all the VOIP VLAN Ranges for network. |
4 | Create a DiffServ policy for inbound traffic named pol_voip, then add the previously created classes ‘ class_Traffic_VOIP’ and ‘ class_VLAN_VOIP’ as instances within this policy.
This policy handles incoming UDP packets already marked with a DSCP value of EF (per class_Traffic_VOIP definition), or marks/over-writes packets from the VOIP VLANs, with a DSCP value of EF (per the class_VLAN_VOIP definition). |
policy-map pol_voip in class class_Traffic_VOIP assign-queue 5 exit |
Matching packets are assigned internally to use queue 5 of the egress port to which they are forwarded. |
class class_VLAN_VOIP mark ip-dscp ef assign-queue 5 exit exit |
In case any traffic received on VOIP VLANs is not already marked with DSCP EF, explicitly mark it with DSCP EF. The service provider in this instance could identify VOIP traffic handed over on the MPLS links at each location, by the DSCP EF values present. They could then expedite this traffic within their network, through to respective egress. |
||
5 | Attach the defined policy to an inbound service interface, or range of interfaces that will be ingress for VOIP related traffic. | interface port-channel 99 service-policy in pol_voipexit |
LAG interface to the VOIP Aggregation switches. VOIP Traffic received on this link would be subjected to the Service Policy, Assigned to strict priority Queue 5 and additionally, marked with DSCP value EF if not already marked. This will require IP Phones to Mark VOIP traffic with DSCP EF, or VOIP Switches to mark traffic received on VOIP VLANs with DSCP EF, before forwarding to the Central Core switches (separate from the VOIP Aggregation). |
interface gig 1/0/48
service-policy in pol_voip exit |
VOIP Traffic also expected on the Service Provider interface as inbound from other locations. The class map “class_Traffic_VOIP” expecting UDP traffic marked with DSCP EF should capture this traffic, as the VOIP vlans themselves do not stretch across. This will require service provider to carry existing DSCP EF Marker in the VOIP traffic header, or re-write to same value, in their policy-map treatment of such traffic. |