If one attempted to download a file at a speed of 800 Mb/s (100 MB/s) onto a hard drive with a write speed of 500 Mb/s (62.5 MB/s), what would happen? Would the system cap the download speed?
Many protocols, including TCP which is most widely used protocol on the Internet, use something called flow control. Flow control simply means that TCP will ensure that a sender is not overwhelming a receiver by sending packets faster than it can empty its buffer. The idea is that a node receiving data will send some kind of feedback to the node sending the data to let it know about its current condition. So, two way feedback allows both machine to optimally use their resources and prevent any problems due to mismatch in their hardware.
what would happen?
- The bytes that cannot be written to the HDD in time would be buffered temporarily somewhere; very likely some of them would be buffered in the application that "converts" the network traffic into HDD traffic (i.e., your browser), and in cases of longer congestion, the lower level parts of the stack (i.e., the networking subsystem of your PC) would have buffers at lower levels as well, which would fill up until full.
- The information that the data is coming too fast would then propagate back to the sender in some fashion. In the case of TCP/IP, this would mean that there is a part of the TCP protocol which tells the sender that it should stop sending. The Wikipedia page on TCP/IP says it best when it says:
Its [TCP] responsibility includes end-to-end message transfer independent of the underlying network, along with error control, segmentation, flow control, congestion control, and...
- At the end of the day, the "system" (not necessarily the computer of the receipient, but the total system consisting of sender, network and receipient) would indirectly "cap" the download speed. At no point is a "speed" variable in existance, though. Both network traffic and HDD traffic is block-based, that is, the delays between those blocks would get long enough (on the faster network side) until the net "speed" (throughput) is on average the same as the slower speed of your HDD.
Would the system cap the download speed?
Not literally. A few dozen years ago, computers indeed communicated with synchronous speeds (i.e., modems with fixed speed settings). This is, at some relatively low level, also happening today; i.e., your DSL or cable modem will probably have some set speed at which it communicates with its direct physical uplink component. But in 2017, all of this is sufficiently complicated that almost all components are quite dynamic. In the good old days, modems were often physically only able to speak a certain speed, and that even had to be established before dialing in. There are (were) some network protocols like ATM which tried to get a synchronous wide-area network, but they didn't turn out so well, compared to TCP/IP.
Today, the effective speed is usually always implicitely reached by buffering, flow control, and such.
Also note that in your example there can even be more participiants. The network interface could have more work to do (other connections to your PC). Some part of the network along the way could be busy (a family member surfing or watching videos). The HDD might be doing 3 large file writes at the same time. So it would make no sense to specifically set a "speed" which could be capped.
File downloads (usually) happen over a protocol called TCP. In TCP, the sender doesn't send any data until the receiver is ready to receive it.
What will happen is that your computer will reserve some amount of RAM to hold the received data temporarily before writing it to your hard drive (this is called a buffer). Then it will ask the sender for just enough data to fill the buffer. As it receives data, it will start writing data from the buffer to the hard drive - however, it won't ask for more data while the buffer is nearly full.
The overall effect is the sender simply waits for the receiver to catch up before it continues sending.
Try to copy from SSD disk to HDD disk. What will happen? The connection will follow the slowest part. However, I have perceived network bottleneck. Get 10000 torrents to download "1kb/s". What happens? "Error on the disk".... Cause disk head on plate cannot go in so many different places per second. So, I think that HDDs have shown the age of their speed and people with fast internet speed may perceive occasional silent network bottlenecks due to that.
Note that internet network clients may cache files on memory. When Full (doing other things will make mem to get full quicker), both the net clients and other process of machine will be cached in Disk.If only one HDD disk is in place, and network traffic is going on this disk, and temporary cache on the same disk, then it will be further slowed down. A disastrous result.
Net cache on ram --> Ram full -> Cache on Disk -> same disk that net traffic goes also make temp cache of ram -> Further slowed down --> Disastrous result --> the whole system will be slowed down.
(It almost out of question to copy/move files on the same disk that receiving a lot of internet traffic).
SSds is a solution if safety protocols of data loss are in place. But they are sadly, very expensive yet.
So, i believe we live in an epoch that people with fast internet connection silently have Network speed data transfer loss due to plate-HDDs.
I have noticed my mobile phone can download much faster than my computer (SD cards are essentially SSD type).