5

I need to change default value of TCP InitialCongestionWindow

I read this document: https://www.iispeed.com/blog/windows-server-2012-and-tcp-slow-start

I tryed it on our hyper-v hosted virtual server 2012 R2.

PS C:\>Set-NetTCPSetting -SettingName Custom -InitialCongestionWindow 10 -CongestionProvider CTCP

I got error:

Set-NetTCPSetting : No MSFT_NetTCPSetting objects found with property 'SettingName' equal to 'Custom'.  Verify the valu
e of the property and retry.
At line:1 char:1
+ Set-NetTCPSetting -SettingName Custom -InitialCongestionWindow 10 -CongestionPro ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Custom:String) [Set-NetTCPSetting], CimJobException
    + FullyQualifiedErrorId : CmdletizationQuery_NotFound_SettingName,Set-NetTCPSetting

The question is how can I acomplish what that IISspeed document is telling about? If I Change this on Hyper-v machine Do i allso need change this on hypers-v host too to actualy make any difference?

Should I allso make the same change to SSL port 443 ?

I ran this command:

PS C:\Users\Administrator> Get-NetTCPSetting


SettingName                   : Automatic
MinRto(ms)                    :
InitialCongestionWindow(MSS)  :
CongestionProvider            :
CwndRestart                   :
DelayedAckTimeout(ms)         :
DelayedAckFrequency           :
MemoryPressureProtection      :
AutoTuningLevelLocal          :
AutoTuningLevelGroupPolicy    :
AutoTuningLevelEffective      :
EcnCapability                 :
Timestamps                    :
InitialRto(ms)                :
ScalingHeuristics             :
DynamicPortRangeStartPort     :
DynamicPortRangeNumberOfPorts :
AutomaticUseCustom            :
NonSackRttResiliency          :
ForceWS                       :
MaxSynRetransmissions         :

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

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

SettingName                   : Compat
MinRto(ms)                    : 300
InitialCongestionWindow(MSS)  : 2
CongestionProvider            : Default
CwndRestart                   : False
DelayedAckTimeout(ms)         : 200
DelayedAckFrequency           : 2
MemoryPressureProtection      : Enabled
AutoTuningLevelLocal          : Normal
AutoTuningLevelGroupPolicy    : NotConfigured
AutoTuningLevelEffective      : Local
EcnCapability                 : Enabled
Timestamps                    : Disabled
InitialRto(ms)                : 3000
ScalingHeuristics             : Disabled
DynamicPortRangeStartPort     : 49152
DynamicPortRangeNumberOfPorts : 16384
AutomaticUseCustom            : Disabled
NonSackRttResiliency          : Disabled
ForceWS                       : Disabled
MaxSynRetransmissions         : 2

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

SettingName                   : Internet
MinRto(ms)                    : 300
InitialCongestionWindow(MSS)  : 4
CongestionProvider            : CTCP
CwndRestart                   : False
DelayedAckTimeout(ms)         : 50
DelayedAckFrequency           : 2
MemoryPressureProtection      : Enabled
AutoTuningLevelLocal          : Normal
AutoTuningLevelGroupPolicy    : NotConfigured
AutoTuningLevelEffective      : Local
EcnCapability                 : Enabled
Timestamps                    : Disabled
InitialRto(ms)                : 3000
ScalingHeuristics             : Disabled
DynamicPortRangeStartPort     : 49152
DynamicPortRangeNumberOfPorts : 16384
AutomaticUseCustom            : Disabled
NonSackRttResiliency          : Disabled
ForceWS                       : Disabled
MaxSynRetransmissions         : 2
Timo77
  • 111
  • 2
  • 5
  • 13

2 Answers2

4

You need to create the transport filter first, which specifies the TCP settings as a NetTcpSetting object, like in the example below.

New-NetTransportFilter -SettingName Custom -LocalPortStart 80 -LocalPortEnd 80 -RemotePortStart 0 -RemotePortEnd 65535

The Set-NetTCPSetting commandlet is used when you want to modify a setting. Hence why you're receiving the error regarding the custom object not found. After creating the transport filter, your original command to modify the settings should work.

Set-NetTCPSetting -SettingName Custom -InitialCongestionWindow 10 -CongestionProvider CTCP 
bentek
  • 2,205
  • 1
  • 14
  • 23
  • I tryed your first line and got error too: ew-NetTransportFilter : Generic failure t line:1 char:1 New-NetTransportFilter -SettingName Custom -LocalPortStart 80 -LocalPortEnd 80 - ... ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (MSFT_NetTransportFilter:ROOT/StandardCi...TransportFilter) [New-NetTransp ortFilter], CimException + FullyQualifiedErrorId : HRESULT 0x80041001,New-NetTransportFilter – Timo77 Nov 25 '15 at 10:33
  • Did you try it from an elevated PowerShell prompt (run as admin)? – bentek Nov 25 '15 at 11:52
  • Yes I tryed it from Run as admin Power shell – Timo77 Nov 25 '15 at 12:23
  • Server is Hyper-v virtual machine with two virtual NIC:s... could it be something that does thing diffrently...? – Timo77 Nov 25 '15 at 12:24
1

Hi I get the same error when I run:

PS C:\Windows\system32> Get-NetTransportFilter


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

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

In other words there is already a filter for port 80 (DataCenterCustom) and another for the others ports (Automatic) and for some reason I don't have the privileges to edit (I'm part of a domain network and I'm not in the main node).

What I do was change the name of the filter in the Set-NetTCPSetting run the second part:

Set-NetTCPSetting -SettingName DatacenterCustom -InitialCongestionWindow 10 -CongestionProvider CTCP 

And that is the all, now is Works

Adhemar
  • 111
  • 3