Peer to Peer
Suppose you are just starting to download a 4.2 GB file on a peer to peer network. There are 20 other people also up and/or downloading this same file. Nineteen have 20% and one has 100%, and you of course have 0%. (Assume each 20% is of random sections... none are the exact same sections.)
Everyone can download up to 500 k/sec and will upload 10 k/sec. When they get 100% each will begin uploading at 50k/sec.
You must understand that on peer to peer networks you request a random section of data you need and the request will be put on hold by others who have the data. Later someone will ask if you still need it and if you answer yes, it will be sent.
Assuming everyone stays active till everone reaches 100%, how long will it take for you to reach 100%?
Everyone can download up to 500 k/sec and will upload 10 k/sec. When they get 100% each will begin uploading at 50k/sec.
You must understand that on peer to peer networks you request a random section of data you need and the request will be put on hold by others who have the data. Later someone will ask if you still need it and if you answer yes, it will be sent.
Assuming everyone stays active till everone reaches 100%, how long will it take for you to reach 100%?
Labels: mathschallenge





13 Comments:
i think the answer is:
8808.0384 seconds (or) 146.80064 minutes (oR) 2.44667733333333333 days.
i think the answer is:
8808.0384 seconds (or) 146.80064 minutes (oR) 2.44667733333333333 days.
Assume:
-rate of download must be <= rate of upload
-if requested amount of download > rate of upload then data stream is shared equally amongst downloaders
At first:
Rate of upload: = 1*50+20*10=250 k/s
Rate of download= 250/20=12.5 k/s
Time until 19 users reach 100%= 0.8*(4.2*10^6)/12.5= 268,800 s
(since download rates are =, you reach 80% at this point)
At which time, you can start downloading at 500k/s (500k/s << rate of upload(20*50k/s)=1000k/s)
Time until you reach 100%= 268,800 + 0.2*(4.2*10^6)/500= 268,800 + 1,680= 270,480
Answer:
270,480 s
Cam
If the algorithm is optimized, so as to bring the next possible user up to 100% so they can begin seeding at a higher rate, the results would be as follows.
I don't believe that the algorithm works this way, so don't bother telling me that it doesn't. This is merely for interest.
Amount left----upload rate--N at 50--N at 10-Download Rate---time------
3,360,000.00 -------240-------1-------19-------230------- 14,608.70 ---1
3,213,913.04 -------280-------2-------18-------270------- 11,903.38 ---2
3,240,966.18 -------320-------3-------17-------310------- 10,454.73 ---3
3,255,452.70 -------360-------4-------16-------350------- 9,301.29 ----4
3,266,987.07 -------400-------5-------15-------390------- 8,376.89 ----5
3,276,231.10 -------440-------6-------14-------430------- 7,619.14 ----6
3,283,808.58 -------480-------7-------13-------470------- 6,986.83 ----7
3,290,131.73 -------520-------8-------12-------500------- 6,580.26 ----8
3,228,394.73 -------560-------9-------11-------500------- 6,456.79 ----9
2,972,592.63 -------600-------10-------10-------500------- 5,945.19 ----10
2,765,481.47 -------640-------11-------9-------500------- 5,530.96 -----11
2,585,665.19 -------680-------12-------8-------500------- 5,171.33 -----12
2,429,160.53 -------720-------13-------7-------500------- 4,858.32 -----13
2,291,169.37 -------760-------14-------6-------500------- 4,582.34 -----14
2,168,591.93 -------800-------15-------5-------500------- 4,337.18 -----15
2,058,844.84 -------840-------16-------4-------500------- 4,117.69 -----16
1,959,985.51 -------880-------17-------3-------500------- 3,919.97 -----17
1,870,411.01 -------920-------18-------2-------500------- 3,740.82 -----18
1,788,854.75 -------960-------19-------1-------500------- 3,577.71 -----19
2,554,253.63 -------1000-------20-------0-------500------- 5,108.51 ----20
TOTAL TIME 133,178.03
Notes:
- Download rate = upload rate -10 since you can't seed to yourself
-Next user reduces amount to download by (Upload rate- Download rate) * time to download of previous user
- Last user starts at 4.2 GB before factoring in above
the time would then be reduced to 133,178.03 s
Cam
This post has been removed by a blog administrator.
At 500kB/s a 4.2 gB file takes about 2 1/2 - 3 1/2 hours. Disagree if you want and show math to disprove, but real life events don't always match paper.
I have not seen a comment that resembles how a p2p network might. There is not a holding basket that holds data to be downloaded.
When you are at zero percent, all data in the stream is useable. But as you get closer to 100%, fewer and fewer bits in the stream is usable. If you could get the 100% guy to put the bites you needed into the stream, then it would work similiar to some of the comments so far.
But the 100% guy is like a waiter waiting for 20 people at once, and everyone is summiting different requests. When he uploads a 500 kb/ sec, you will need it all when your zero, and you can download what you can but soon it becomes a "I already have that" stream.
And it will include "I needed that, but it's already left the stream."
Those that had 20% to begin with will be putting data into the stream also, but much you request they will not have. Remember each
one has a different data set, but they will be growing to 100% also.
The solution will involve several probabilities.
I would cancel the download as I don't own the original so it would be illegal.
*sigh*
not only is this a hypothetical situation, there was nothing in the original problem that would lead you to believe that the material being transferred is copyrighted. Therefore, for all you know, this could be 100% legal.
I just pray to God that none of you are Network Engineers.
WHAT?????
This post has been removed by a blog administrator.
Ragknot,
Please post answer. It does not appear as if anyone is making any further attempts at this.
Cam
Post a Comment
Links to this post:
Create a Link
<< Home