You get the same cable for various speeds. The modem using the cable has to do some handshaking with the remote side. It negotiates the speeds. The remote side can simply says “you get 100 Mbps from me”. Your modem says “ok, I take it”.
A modem can dynamically adjust the speed according to quality of the transmission, but the remote side wouldn’t allow that your modem can negotiate a higher speed than your maximal speed you paid for.
Latest Answers