In: Computer Science
In BitTorrent, consider peer A is connected to peers B, C, D and E. A asks the other peers for list of chunks that they have. B, C, D and E have the following chunks that are missing to A: B – C1, C3 C – C1, C3, C5 D – C3, C4, C5 E – C2, C4 Which is the chunk that A requests first, and from which peer?
Peers can be defined as the systems downloading the same data as the user. Now, simultaneously with downloading, uploading can also happen as the system uploads a part of the already downloaded data (we can notice it in the information tab as the upload speed).
From the given scenario we can conclude that peer A required five chunks of data. i.e. C1, C2, C3, C4 and C5.
The missing data chunks for peer B = C2, C3, C4 and C5.
The missing data chunks for peer C = C2, C4 and C5.
The missing data chunks for peer D = C1, C2 and C5.
The missing data chunks for peer E = C1, C3 and C5.
So, B will request peer E for C2.
C will request peer D for C4 (as C2 is already requested and the target is the best utilization of the bandwidth).
D will request peer B for C1.
E will request peer C for C1.
Now, in the beginning A has nothing to upload. So, it will request for the chunks which has less number of downloading request. So, it should request C3 first as no other peer has requested for it. Now, both the peers C and D have the chunk C3. So, A will request that specific peer to which the P2P connection is stronger.
So, A will request for C3 from either C or D.
Please comment in case of any doubt.
Please upvote if this helps.