Have just been looking at some old exam papers and came across a question I cannot figure out :
Suppose you have a 2Mbit/s link alone a wire that is 240,000 miles away. The data travels at the speed of light which is 186,000 miles per second. How long does it take to transfer a 30kb file from the moon to the earth ? To transfer the file, an initial 2*Round Trip Time of handshaking must occur.
How can I solve this?
240,000/186,000 = 1.29…secs * 2 =
2.58secs = 2 * Round Trip Time.2MB = 2000Kb.
30/2000 = .015secs + 2.58 = 2.595secs.
Is this anywhere close? I have a feeling I should factor in the time it takes to transfer the 30Kb somehow, but I am unsure where to do this.
Yes your answer is very close. If we ignore the 2*Round Trip time handshaking (which you already calculated correctly, so you can add that later) the last part of the answer is as follows.
As you said it takes 240.000/186.00 = 1.29 second for data send from here to reach the moon. Because all the data is put on the line as fast as possible (so at 2MB/s), after these 1.29 seconds it will only take 30kb/2000kb/s = 0.015 seconds for the last bit to arrive. (Think of a racetrack with 3 cars driving behind each other, which keep driving closely behind each other, but they don’t overtake each other, the last car will arive at point B exactly x-seconds later then the first car. This is the same for all parts of the route).
So the data is fully received in 1.29 + 0.015 seconds = 1.305 seconds.
Now add your round-trip handshaking time (2.58s) the total time is 3.885 seconds.