7

In order to globally configure Minimum RTO; Delayed Ack Timeout; Congestion algo etc. under Windows 7 and above one is supposed to use network TCP templates. To see those you can use Get-NetTCPSetting powershell cmdlet:

PS C:\Users\Administrator> Get-NetTCPSetting

(...)

SettingName                   : Datacenter
MinRto(ms)                    : 20
InitialCongestionWindow(MSS)  : 4
CongestionProvider            : DCTCP
CwndRestart                   : True
DelayedAckTimeout(ms)         : 10
MemoryPressureProtection      : Enabled
AutoTuningLevelLocal          : Normal
AutoTuningLevelGroupPolicy    : NotConfigured
AutoTuningLevelEffective      : Local
EcnCapability                 : Enabled
Timestamps                    : Disabled
InitialRto(ms)                : 3000
ScalingHeuristics             : Disabled
DynamicPortRangeStartPort     : 49152
DynamicPortRangeNumberOfPorts : 16384

SettingName                   : Internet
MinRto(ms)                    : 300
InitialCongestionWindow(MSS)  : 4
CongestionProvider            : CTCP
CwndRestart                   : False
DelayedAckTimeout(ms)         : 50
MemoryPressureProtection      : Enabled
AutoTuningLevelLocal          : Normal
AutoTuningLevelGroupPolicy    : NotConfigured
AutoTuningLevelEffective      : Local
EcnCapability                 : Enabled
Timestamps                    : Disabled
InitialRto(ms)                : 3000
ScalingHeuristics             : Disabled
DynamicPortRangeStartPort     : 49152
DynamicPortRangeNumberOfPorts : 16384

In order to get individual connection and settings applied to them one can use Get-NetTCPConnection cmdlet:

PS C:\Users\Administrator> Get-NetTCPConnection

LocalAddress                        LocalPort RemoteAddress                       RemotePort State       AppliedSetting
------------                        --------- -------------                       ---------- -----       --------------
(...)
192.168.75.69                       63220     192.168.75.66                       1433       Established Datacenter
192.168.75.69                       63208     192.168.75.61                       445        Established Internet
192.168.101.13                      63061     185.97.X.X                          20467      Established Datacenter
192.168.101.13                      63059     209.191.X.X                         18083      Established Internet
(...)

How do I influence (or at least how is made) the choice of Internet vs Datacenter TCP settings? We have several low latency connections that we would like to treat with Datacentre settings (to speed up recovery from communication glitches), while still I do not want to blindly apply this to all connections.

saucecontrol
  • 1,446
  • 15
  • 17
Jan
  • 1,905
  • 17
  • 41

1 Answers1

11

The settings profile applied to a given connection is based on the matching Transport Filter. By default, there is a single filter that applies the Automatic settings profile to all connections, which is why yours are seemingly random.

PS C:\> Get-NetTransportFilter

SettingName       : Automatic
Protocol          : TCP
LocalPortStart    : 0
LocalPortEnd      : 65535
RemotePortStart   : 0
RemotePortEnd     : 65535
DestinationPrefix : *

The New-NetTransportFilter cmdlet allows you to map connections to specific profiles based on either port numbers or IP address.

You can use something like

New-NetTransportFilter -SettingName Datacenter -DestinationPrefix 192.168.75.0/24

Or

New-NetTransportFilter -SettingName DataCenter -LocalPortStart 0 -LocalPortEnd 65536 -RemotePortStart 1433 -RemotePortEnd 1433
saucecontrol
  • 1,446
  • 15
  • 17
  • Is there a way to do this on non-server versions of WIndows (eg Windows Enterprise)? We have some workstations with this same need, but the above command is blocked on non-servers. How do youy tell a workstation that some connection should be tuned using a different template (not "internet")? – Stilez Feb 08 '18 at 18:28
  • Up until recently, I always ran Windows Server on my workstation machines, but now that I'm on Windows 10, I see what you mean. `New-NetTransportFilter : This feature is available on servers only.` Interesting also that the default filter sets the `Internet` profile instead of `Automatic` even though the others are defined. I don't know of a way to get around that. – saucecontrol Feb 08 '18 at 21:41
  • Struggling with this as well and posted https://github.com/MicrosoftDocs/windows-powershell-docs/issues/2061 – Jan Jul 27 '20 at 19:53