How Does a Computer Know When Data Transfer Has Ended?

  • Thread starter Bararontok
  • Start date
  • Tags
    Data
In summary: When transferring data from an SSD to an external storage device, the SSD controller can initiate the transfer by sending a "start" command to the external device.
  • #1
Bararontok
298
0
Because digital signaling uses an almost instantaneous transition from a set power level to 0W to represent the '1's and '0's of binary data, how does the computer determine when a file has stopped being copied to its storage device? Because even after the signal has stopped being transmitted, the power level would drop to and remain at 0W, so what is done to prevent the computer from mistaking the 0W power level for a continuous stream of '0' bits and keep saving the '0' bits to the storage device endlessly?
 
Technology news on Phys.org
  • #3
Generally digital signaling involves run length limited transmission or something similar, in order to keep the transmitter and receiver clocks in sync, by limiting the maximum amount of time with no transition in the digital stream. Similar to the "escape characters" mentioned by mfb, special patterns are used to synchronize the clocks and indicate the start of a message. If the length of messages is not fixed, then another special pattern can be used to indicate the end of a message. Wiki article:

http://en.wikipedia.org/wiki/Run_Length_Limited
 
  • #4
Alright, now here is another question. Since the transfer rates of copying or downloading files are not fixed, what is done to prevent a computer from mistaking a slow lower frequency signal with longer periods for the '1's and '0's for a higher frequency signal with shorter periods and with continuous streams of multiple '1's and '0's instead of just long periods of '1's and '0's?

A possible explanation: maybe the reason why transfer rates fluctuate is because when downloading a file from the internet, the server computer has to alternate between requests for data, but the individual packets sent to a specific computer are of fixed length and fixed frequency while when a file is being copied from one local hard drive connected to another local hard drive, the computer performing the copy has to alternate requests between the copy operation and the other processes that are also running so once again the packets of data being transferred are of fixed length and frequency. Perhaps, according to the article on RLL, the clocks of the transmitter and receiver are synchronized to a given frequency before the copying starts, and to prevent the error of saving redundant '0' bits after every packet is downloaded due to the copy process being stalled because other requests are being handled, the file size, escape characters and synchronization data are added to each packet so that the save operation stops if there arises a situation where a packet is sent and the next packets are delayed. The file size, escape characters and synchronization data are once again used for the last packet so that when it is sent, the save operation stops completely.
 
Last edited:
  • #5
Bararontok said:
Since the transfer rates of copying or downloading files are not fixed ...
If transfer rates are not fixed, then a special protocol is used to transition between transfer rates (called negotiation in some cases), generally starting at the slowest rate, then sending messages indicating what the transfer rate should switch to.
 
  • #6
rcgldr said:
If transfer rates are not fixed, then a special protocol is used to transition between transfer rates (called negotiation in some cases), generally starting at the slowest rate, then sending messages indicating what the transfer rate should switch to.

So that means that there should be an allowance for a time interval when the transfer rate remains fixed and then a code indicating what the transfer rate should switch to when the next segment of code is to be copied. Of course, for this to work without errors the switching of transfer rates should not be too frequent or always occurring at random intervals.
 
  • #7
Surely the answer to this question is different depending on storage device type, bus protocol etc. Storage devices could talk to a chip in all kinds of ways, and negotiating this would be the responsibility of the driver for that device (if on a PC).
 
  • #8
Bararontok said:
the switching of transfer rates should not be too frequent or always occurring at random intervals.
In the case of SATA, the bus is allowed to go completely dormant (a sleep state for the bus). To reduce costs, only the SATA host has a very accurate clock, while the SATA device goes through handshake sequence to synchronize it's programmable oscillator with the host clock. There's also a handshake sequence to switch from the default 1.5 gbps to 3.0 gbps or 6.0 gbps.
 

Related to How Does a Computer Know When Data Transfer Has Ended?

1) How can I save my data securely?

There are several ways to save data securely depending on the type of data and the level of security required. Some options include encrypting the data, using secure servers or cloud storage, and regularly backing up the data.

2) What is the best format for saving data?

The best format for saving data depends on the type of data and its intended use. For numerical data, formats like CSV or Excel may be suitable, while for text-based data, formats like JSON or XML may be better. It is important to consider factors such as compatibility, accessibility, and ease of use when choosing a format.

3) How often should I save my data?

The frequency of saving data will depend on the type of data and the importance of the data. In general, it is recommended to save data regularly, especially in real-time applications or when dealing with sensitive information. It is also a good practice to save multiple versions of the data to prevent loss in case of errors or corruption.

4) What are the potential risks of not saving data properly?

The potential risks of not saving data properly include loss of data, unauthorized access, and corruption. Data loss can occur due to hardware or software failure, human error, or cyber attacks. Improperly saved data can also be vulnerable to security breaches and unauthorized access, which can lead to information theft or manipulation. Additionally, not saving data regularly or backing it up can result in data loss or inconsistencies in case of system failures or disasters.

5) How can I retrieve data if it gets lost or corrupted?

The best way to retrieve lost or corrupted data is by having regular backups and versions of the data. This can be done through various methods such as using cloud storage, external hard drives, or backup software. It is also important to have a plan in place for data recovery in case of emergencies, and to regularly test the backups to ensure they are functional.

Similar threads

  • Programming and Computer Science
Replies
10
Views
3K
  • Programming and Computer Science
Replies
29
Views
3K
  • Sticky
  • Programming and Computer Science
Replies
13
Views
4K
Replies
1
Views
950
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
Replies
2
Views
109
Replies
5
Views
963
  • Engineering and Comp Sci Homework Help
Replies
10
Views
1K
Replies
14
Views
3K
Back
Top