wangyu- / udp2raw-multiplatform

multi-platform(cross-platform) version of udp2raw-tunnel, which supports Windows/Mac/BSD natively. Client-Only at the moment.
MIT License
641 stars 145 forks source link

LocalServiceNoNetworkFirewall high CPU Usage on Windows 8 and later #54

Open Mukou-Aoi opened 2 years ago

Mukou-Aoi commented 2 years ago

When using udp2raw + udpspeeder on Windows 10 the CPU usage is almost always 100% with LocalServiceNoNetworkFirewall consuming a huge trunk (about 25%) of it. If I disable Windows Defender Firewall I get similar CPU usage comparing to Windows 7 (~50%). Firewall rules added are the same across both OS.

I've tried to use different Windows 10 version (LTSC2021/LTSC2019), both with or without updates, switch between winpcap/npcap (PS: Win10Pcap produce BAD MEMORY message in udp2raw log), same behavior.

The issue doesn't occur if I remove udp2raw and use only udpspeeder. Removing udpspeeder and use udp2raw only causes overall CPU usage to drop, but LocalServiceNoNetworkFirewall (Base Filtering Engine & Windows Defender Firewall) still consumes a huge amount of CPU. Both service consumes about 0% CPU most of the time on Windows 7 while consuming >10% on Windows 10. The CPU usage for the two services are 0% when there's no traffic going through udp2raw.

Mukou-Aoi commented 2 years ago

This doesn't seem to be Windows 10 specific, I can reproduce this behavior with Windows 8.1 with Update within VMware as well, and I've confirmed this doesn't happen with a fresh Windows 7 SP1 installation (kb4474419 is necessary to support newer version npcap driver).

If you have a high performance PC, you can reproduce this behavior with a low spec VM. I've managed to reproduce this in Windows 8.1 with Update / Windows 10 LTSC 2019 / Windows 10 LTSC 2021 within VMware.

wangyu- commented 1 year ago

Sorry for the late reply. I couldn't reproduce this problem on the lastest windows 10 (22H2).

I guess this problem was from that windows service itself (there are alot of complaints of LocalServiceNoNetworkFirewall on google), which seems to have already been fixed in new windows versions.