So far, we've discussed how to control the number of sessions allowed between sites (CAC) and how to mark packets based on ports and applications. However, we have not yet discussed how to tell the servers and clients which port ranges it should use for the different types of media. Without doing this, Lync will use the default ports, and our marking and QoS scheme might fail.
Values given here are examples only! Adjustments might be necessary for larger or smaller deployments. The number of available ports can influence the call flows available in a system. Also, remember that the port number assignments must never overlap (how will QoS tagging know the difference between services?).
There are a lot of components in Lync, and we need to address all of those services. Luckily, all the settings are stored in the topology, and we can apply all of the settings through PowerShell from the same management station.
We will configure conferencing services, mediation services, application services, and edge services.
Proceed with the following steps for controlling/limiting the port ranges for traffic:
Set-CsMediaConfiguration -EnableQoS $True
Set-CsConferenceServer -Identity "myconfpool.mydomain.com"` –AudioPortStart "50000" -AudioPortCount "2000"` -VideoPortStart "52000" -VideoPortCount "2000"` -AppSharingPortStart "54000" –AppSharingPortCount "2000"
Set-CsMediationServer -Identity "mymedpool.mydomain.com"` –AudioPortStart "50000" -AudioPortCount "2000"
Set-CsApplicationServer -Identity "myapppool.mydomain.com"` –AudioPortStart "50000" -AudioPortCount "2000"` -VideoPortStart "52000" -VideoPortCount "2000"` -AppSharingPortStart "54000" –AppSharingPortCount "2000"
Set-CsEdgeServer -Identity "myedgepool.mydomain.com"` -MediaCommunicationPortStart "50000"` -MediaCommunicationPortCount "10000"
Set-CsConferencingConfiguration` -ClientMediaPortRangeEnabled $True` -ClientAudioPort "50000" -ClientAudioPortRange "2000"` -ClientVideoPort "52000" -ClientVideoPortRange "2000"` -ClientAppSharingPort "54000"` -ClientAppSharingPortRange "2000" ` -ClientFileTransferPort "56000"* -ClientFileTransferPortRange "2000"