MysticFoxDE / WINDOWS-OPTIMIZATIONS

SKRIPTS FOR WINDOWS DESUBOPTIMIZATION
606 stars 54 forks source link

TCP Congestion Control and ECN need different privileges #4

Closed tillewolle closed 1 year ago

tillewolle commented 1 year ago

The TCP Congestion Control change does not apply because of wrong privileges. The script errors out with

The Update of the congestionprovider of the Datacenter TCP profile to DCTCP was NOT successfully. :-( Die angegebene Vorlage konnte vom Befehl zum Festlegen von "supplemental" nicht aktualisiert werden. Für den angeforderten Vorgang sind erhöhte Rechte erforderlich (Als Administrator ausführen).

Provoking it manually with Invoke-Expression -Command "netsh int tcp set supplemental template=Datacenter congestionprovider=DCTCP" -ErrorAction Stop | Out-String -Stream gives the same error message without your custom text.

Similar behaviour for enabling ECN. It errors out with

Try to enable ECN was NOT successfully. :-( Fehler beim Befehl zum Festlegen von global für IPv4 Für den angeforderten Vorgang sind erhöhte Rechte erforderlich (Als Administrator ausführen). TCP congestion controll can't finished successfully. :-(

This error refers to congestion control but also to ECN which I know as Explicit Congestion Notification. Is this right or is the wrong error message displayed? Also please change it to

Try to enable ECN was NOT successful. [...] TCP congestion control can't finish successfully. :-( as far as the relation betwee ECN and TCP is correct.

Trying it manually with

Invoke-Expression -Command "netsh int tcp set global ECN=Enabled" -ErrorAction Stop | Out-String -Stream gives the same error message without your custom text.

I executed the script with powershell as admin on W10 Pro 22H2 (Build 19045.2251). All other changes were successful.

MysticFoxDE commented 1 year ago

Moin tillewolle,

bist du dir sicher, dass du das PowerShell oder ISE als Administrator ausgeführt hast? (Rechte maustaste auf PowerShell oder ISE und dann "als Administrator ausführen" auswählen.) Den laut der Fehlermeldung "... Vorgang sind erhöhte Rechte erforderlich ..." ist das nicht so.

Gruss Alex

ldlx commented 1 year ago

I tried the two commands from above in PowerShell ISE with elevated priviligues in Windows 10 22H2 with no DeSuboptimization script applied:

PS C:\Windows\system32> Invoke-Expression -Command "netsh int tcp set supplemental template=Datacenter congestionprovider=DCTCP" -ErrorAction Stop | Out-String -Stream OK.

PS C:\Windows\system32> Invoke-Expression -Command "netsh int tcp set global ECN=Enabled" -ErrorAction Stop | Out-String -Stream OK.

tillewolle commented 1 year ago

Tried it again in PowerShell as admin and also in PowerShell ISE as admin. Same results for both:

The Update of the congestionprovider of the Datacenter TCP profile to DCTCP was NOT successfully. :-( Die angegebene Vorlage konnte vom Befehl zum Festlegen von "supplemental" nicht aktualisiert werden. Für den angeforderten Vorgang sind erhöhte Rechte erforderlich (Als Administrator ausführen).

The only difference while trying it with PowerShell ISE is that it breaks the umlauts.

MysticFoxDE commented 1 year ago

Hi tillewolle,

can you please run "Get-Netadapter | FL" on your computer and post the output here, thanks. (This option cannot be set for some very special network adapters.)

Best Regards from Germany Alex

tillewolle commented 1 year ago

Get-Netadapter | FL shows:

Name: Ethernet0 InterfaceDescription: Intel(R) 82574L Gigabit Network Connection InterfaceIndex: 8 MacAdress: XX-XX-XX-XX-XX-XX MediaType: 802.3 PhysicalMediaType: 802.3 InterfaceOperationalStatus: Up AdminStatus: Up LinkSpeed(Gbps): 1 MediaConnectionState: Connected ConnectorPresent: True DriverInformation: Driver Date 2018-06-12 Version 12.17.10.8 NDIS 6.50

Tried it with a different Win10 machine and it runs flawlessly on there. Version is Win10 Pro 22H2 Build 19045.2193.

ldlx commented 1 year ago

You can try to run the netsh commands at cmd for testing (minimizes the PowerShell overhead). Monitor it with Procmon and filter for errors (probably registry error). Or try with system rights with PSExec (or ExecTi, RunAsSystem, RunX).

tillewolle commented 1 year ago

Tried the netsh with cmd as administrator and also within the netsh shell but it always tells me that I need higher privileges. On the other machine that worked earlier the same commands work flawlessly in cmd and netsh.

ldlx commented 1 year ago

Tried the netsh with cmd as administrator and also within the netsh shell but it always tells me that I need higher privileges. On the other machine that worked earlier the same commands work flawlessly in cmd and netsh.

Running in cmd just minimizes the overhead of events in ProcMon, but doesn't give you any additional permissions. You still need to track down the permission issues aka errors in ProcMon. Or run with system rights, then there shouldn't be any permission issues.

Karl-WE commented 1 year ago

See #8

MysticFoxDE commented 1 year ago

Moin tillewolle, can you please check whether the problem is solved by Karl's additions, thank you. Best Regards Alex

tillewolle commented 1 year ago

Works like a charm! No errors spotted!

closed