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.
I think you should double the file sending time, given it costs the same to receive file at the other end.
Besides, transferring the file through link also need time. The '2Mb' here representing time required to send file from local into the link. So I think at least your equation should be like this:
signle_trip_delay = 240,000/186,000 round_trip_delay = single_trip_delay * 2 file_sending_time = 30/2000 file_receiving_time_at_the_other_end = 30/2000
time = round_trip_delay(for hand shaking) + file_sending_time + file_receiving_time + single_trip_delay(file travels through the link)
UPDATE: no need to take file_receiving_time into consideration. Sorry for my carelessness. Now time = round_trip_delay(for hand shaking) + file_sending_time + single_trip_delay(file travels through the link)
精彩评论