Mostly it’s handled by your router/modem. The device communicates at startup with your ISP and asks for configuration info. Part of that is speed up and down. Then it limits the data sent and received.
Fiber works a bit different. It’s your ONT (the box in your garage or on the side of your house) that does the speed limiting.
Latest Answers