title: How does Windows decide which setting/template (Internet vs Datacenter) is applied to TCP connections?
body: <p>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:</p>
  
  <pre><code>PS C:\Users\Administrator&gt; 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
  </code></pre>
  
  <p>In order to get individual connection and settings applied to them one can use Get-NetTCPConnection cmdlet:</p>
  
  <pre><code>PS C:\Users\Administrator&gt; 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
  (...)
  </code></pre>
  
  <p><strong>How do I influence (or at least how is made) the choice of Internet vs Datacenter TCP settings?</strong>
  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.</p>