I've used the code for my open-source firewall for Windows: [Fort Firewall](https://github.com/tnodir/fort). See User Guide: [Speed limits](https://github.com/tnodir/fort/wiki/User-Guide#speed-limits).