Evening all
Not so much a black art to enable QOS for Lync 2013, but out on the internet there is to be honest alot of rubbish how NOT to do it.
In this blog post is the correct way to implement QOS for Lync 2013.
All in all its not a difficult job to undertake but you do have to make sure all your ports are correct it simply wont work.
Like many other blog post i will break this down into step by step instructions as a guide to help you along your way.
Information you might find useful can be found here from Microsoft. Personally i think this is more of a hinderance than a help.QoS on Lync 2013
ok lets start with basics which are needed for QOS.
PORT RANGES
Before starting you need to decide on the port ranges you are going to deploy as part of the QOS settings. Whatever you decide ensure these ports arent being used by other areas within your business.
For this blog, im going to use the standard port which are documented by Microsoft.Also as part of this blog guide i will also use the recommended DSCP setting again by Microsoft.
Media Type | Classification |
Queuing and Dropping | Notes |
Audio | EF (DSCP 46) | Priority Queue | Low loss, low latency, low jitter, assured bandwidth (BW) |
Video | AF41 (DSCP 34) | BW Queue + DSCP WRED | Pair with WAN Bandwidth Policies on constrained links |
SIP Signalling | CS3 (DSCP 24) | BW Queue | Class 4. Low drop priority |
Its also worth noting that whatever DSCP classification you choose needs to be mirrored on your core network and switches.
Scenario | Starting port | Ending port |
Client audio | 20000 | 20199 |
Client video | 20200 | 20399 |
Client application sharing | 20400 | 20599 |
Client File Transfer | 20600 | 20799 |
Client Media | 20800 | 20999 |
Server application sharing | 40800 | 41000 |
Server audio | 49000 | 55000 |
Server video | 57000 | 60000 |
Now onto Step 2
Lync 2013 Powershell to add the Port ranges. This is whats known in the Lync world as Inband Provisioning.
Im going to add these items piecemeal into the sections relevant to lync, starting with the Lync Server estate
For me this will be my Lync Standard Edition. However for you, you need to add this to each of your Lync Servers (FE’s, Director’s, Etc)
For the Lync Pool enter the following powershell command within the Lync Management Shell.
Set-CsConferenceServer -Identity lyncse2.northernlync.local -AppSharingPortStart 40800 -AppSharingPortCount 200
Set-CsConferenceServer -Identity lyncse2.northernlync.local -AudioPortStart 49000 -AudioPortCount 6000
Set-CsConferenceServer -Identity lyncse2.northernlync.local -VideoPortStart 57000 -VideoPortCount 3000
——————- Now for the Application Servers————————-
Set-CsApplicationServer -Identity lyncse2.northernlync.local -AppSharingPortStart 40800 -AppSharingPortCount 200
Set-CsApplicationServer -Identity lyncse2.northernlync.local -AudioPortStart 49000 -AudioPortCount 6000
Set-CsApplicationServer -Identity lyncse2.northernlync.local -VideoPortStart 57000 -VideoPortCount 3000
NOTE: Change the -identity to the Pool name of your server
Next the powershell commands are for the Lync Client to communicate using QOS using GPO (ensure you add the same GPO port ranges to each Lync client machine)
Set-CsConferencingConfiguration -ClientAudioPort 20000 -ClientAudioPortRange 199 -ClientVideoPort 20200 -ClientVideoPortRange 199 -ClientAppSharingPort 20400 -ClientAppSharingPortRange 199 -ClientFileTransferPort 20600 -ClientFileTransferPortRange 199 -ClientMediaPort 20800 -ClientMediaPortRange 199
then again enable it via powershell
Set-CsConferencingConfiguration -ClientMediaPortRangeEnabled $True
and last up now for the in band provision for the Lync Phone Edition
Set-CsUCPhoneConfiguration -identity global -VoiceDiffServTag 46
STEP 3 – Adding group polices onto the Windows Machines and the Lync Servers
this is a simple but time consuming piece (And take note, ensure you get it correct as it will stop QOS from working if there is an error)
Lync Server GP First (Also ensure if your running separate Mediation and SBA gateways you will also need to ensure you add the GP’s onto them)
Audio & Video entries for the Lync Servers inc mediation, SBA’s using GPO on the servers
Audio: DSCP 46 for all applications on source TCP/UDP ports 49000:55000
Video: DSCP 34 for all applications on source TCP/UDP ports 57000:60000
For Edge Servers (if applicable), again using GPO
Client audio: DSCP 46 for MediaRelaySvc.exe on destination TCP/UDP ports 20000:20199
Client video: DSCP 34 for MediaRelaySvc.exe on destination TCP/UDP ports 20200:20399
Server audio: DSCP 46 for MediaRelaySvc.exe on destination TCP/UDP ports 49000:55000
Server video: DSCP 34 for MediaRelaySvc.exe on destination TCP/UDP ports 57000:60000
Audio & Video Entries for the Windows client. Pass this information onto your network/deployment team to push the GPO out to all the windows clients
Audio: DSCP 46 for lync.exe on source TCP/UDP ports 20000:20199
Video: DSCP 34 for lync.exe on source TCP/UDP ports 20200:20399
Complete
– I would now recommend running wireshark from the Windows machines running Lync 2013, and also all the Lync Servers to ensure the packets are being marked. Also once you’ve confirmed this is working, do a audio call (peer to peer) and check QOS from both ends to ensure the core switches/routers are allowing the QOS markings and not dropping them on-route. Then do a Audio/Video call and so on until you’ve checked scenarios are working with QOS.
So at the end to summarise, you should have the following
Running Get-CSService -ApplicationServer & Get-CSService -ConferencingServer will tell you the configured ports on the servers. Now on each of your Lync servers, these ranges need to match what you entered into the GPO setting on the servers.
— Lync Clients
Running get-CSConferencingConfiguration will tell you the port ranges the Lync Clients need to communicate on. Now ensure each Lync Client Machines GPO matches the port range details from the get-CS command.
Thanks Iain Smith
Hi, you used AppSharingPortCount for both Audio and Video. Is that correct?
Good catch! No it’s incorrect in my blog. You should not be using the app ports for av
I will amend the post now
Regards
Iain Smith
Hi, what I don’t get is the port ranges from the internal Edge interface back to the Lync servers and clients. Are the QoS port ranges somehow encapsulated within STUN? Otherwise how does QoS get marked on the client and server port ranges if those ports are allowed for between the Edge internal interface >> DMZ firewall >> internal Lync servers and clients?
Great write-up Ian.