Extracted from http://www.microsoft.com/en-us/download/details.aspx?id=12633


Lync QoS – Compact install Guide

DSCP is usually set for audio, video and app sharing. You could enable it for peer to peer file transfers as well. A combination of EF and AF classes is used by Lync in what is now simply called DSCP
EF class 46 is universal voice DSCP marker (the highest class) and AF class 34 is used for video. Since I want to keep things really simple I will enforce EF class 46 to the application and then specify the port range 49152 – 57500 for Audio. Video will get AF Class 34 using port 57501 – 65535.

To avoid further confusion, AF 46 and EF 36 will simply be refered to as DSCP 46 and DSCP 34.
Let’s get started then…

Setting up Server QoS

By default the App sharing range overlaps both Audio and Video. If QoS is to be enabled on all three types of communication the port overlapping in not allowed. So I split the Video port range into 2 equal parts as below

Communication Type
Default Port Range
New Port Range
Audio
49152-57500
49152-57500
Video
57501-65535
57501-61518
Application Sharing
49152-65535
61519-65535
To show the configured ranges run the command Get-CsService -ConferencingServer


To change the ports as in the table run the following commands:- 


Server
Powershell command
Conferencing Server
Set-CsConferenceServer –Identity: -AudioPortStart 49152 –AudioPortCount 8348 -VideoPortStart 57501 -VideoPortCount 4017 -AppSharingPortStart 61519 -AppSharingPortCount 4016
                              
Mediation Server
Set-CsMediationServer –Identity:  -AudioPortStart 49152 –AudioPortCount 8348
Application Server
Set-CsApplicationServer  –Identity:   -AudioPortStart 49152 –AudioPortCount 8348 -VideoPortStart 57501 -VideoPortCount 4017 -AppSharingPortStart 61519 -AppSharingPortCount 4016

Result below


Now to add the QOS Policies –from Group Policy Management

Policy
DSCP
Executable
Source IP
Protocol
Destination Port Range
Lync Audio Conferencing QoS
46


TCP and UDP
49152:57500
Lync Video Conferencing QoS
34


TCP and UDP
57501:61518
Lync Application Sharing QoS
34


TCP and UDP
61519:65535


On this page we can select the application to add the DSCP markings to, however I have opted to attach the DSCP marking on traffic based on the ports used as a simpler approach.

Now repeat this for all the communication types as below

For the Edge server you will have to do Policy local as it’s not on the domain. You need the following policies
Policy
DSCP
Executable
Source IP
Protocol
Destination Port Range
Lync Edge Peer to Peer Audio
46
MediaRelaySvc.exe
TCP and UDP
20000:20039
Lync Edge Peer to Peer Video
34
MediaRelaySvc.exe
Edge internal IP
TCP and UDP
20040:20079
Lync Edge Conferencing Audio
46
MediaRelaySvc.exe
Edge internal IP
TCP and UDP
49152:57500
Lync Edge Conferencing Video
34
MediaRelaySvc.exe
Edge internal IP
TCP and UDP
57501:61518
Lync Edge Application Sharing
34


TCP and UDP
61519:65535

Configuring Port Ranges on Lync Clients

Firstly the port ranges can be viewed from the command Get-CsConferencingConfiguration
These are not enabled by default (ClientMediaPortRangeEnabled = False) and thus the ranges being used by default are from 1024 – 65535

Once again the communication type is determined based on the port range specified as will be seen later. Also keep in mind that you don’t want these ports overlapping. Client Media ports are used by OCS R2 (as they can’t determine different traffic types) and Lync uses the Audio, Video, App sharing and File transfer Ports. File transfer is only specified in Peer-to-Peer traffic.
So lets lock down the ports with the following commands
Set-CsConferencingConfiguration –ClientMediaPortRangeEnabled 1
Set-CsConferencingConfiguration -ClientAudioPort 20000 -ClientAudioPortRange 40 -ClientVideoPort 20040 -ClientVideoPortRange 40 -ClientAppSharingPort 20080 -ClientAppSharingPortRange 40 -ClientFileTransferPort 20120 -ClientFileTransferPortRange 40 -ClientMediaPort 20160 -ClientMediaPortRange 40
The result


Add the GPO policies for the Client QoS

Policy
DSCP
Executable
Source IP
Protocol
Destination Port Range
Lync Client Audio QoS
46
Communicator.exe

TCP and UDP
20000:20039
Lync Client Video QoS
34
Communicator.exe

TCP and UDP
20040:20079
Lync Client Application Sharing QoS
34
Communicator.exe

TCP and UDP
20080:20119
Lync Client File Transfer QoS
34
Communicator.exe

TCP and UDP
20120:20160

Windows XP

You can’t run policy-based QOS on XP (or Windows Server 2003). For QOS on these clients you need to run QOS Packet Scheduler on the client computer and a Domain policy must allow the computer to use QOS Services.
To install QoS Packet Scheduler on Client
  1. Open Network Connections.
  2. Click any connection, and then, on the File menu, click Properties.
  3. Click Install, click Service, and then click Add.
  4. Click QoS Packet Scheduler, and then click OK
To enable QoS on Windows Server 2003 or Windows XP from Lync Server
  1. Start the Lync Server Management Shell: Click Start, click All Programs, click Microsoft Lync Server 2010, and then click Lync Server Management Shell.
  2. At a command prompt, type the following command, and then press Enter:
 Set-CsMediaConfiguration -EnableQoS $true
  1. Use Group Policy to set Differentiated Services Code Point (DSCP) values that mark the IP packets if you need values other than the defaults to match your environment for Guaranteed service type packets (used for audio) and Controlled load service type packets (used for video). By default, the following settings are applied when you enable QoS:
SERVICETYPE_GUARANTEED (DSCP 40, 0x28)
SERVICETYPE_CONTROLLEDLOAD (DSCP 24, 0x18)
  1. The client must be stopped and restarted for the change to take effect.
Advertisement