CMPT 401 2008
Dr. Alexandra Fedorova
Lecture XV: Real P2P Systems
2CMPT 401 2008 © A. Fedorova
Outline
• Skype
• BitTorrent
3CMPT 401 2008 © A. Fedorova
Skype
• IP telephony system
• Allows users to make phone calls
– to Skype users
– to regular ...
4CMPT 401 2008 © A. Fedorova
Skype P2P Network
• Super-nodes are nodes
with powerful CPU and
network bandwidth
• One has t...
5CMPT 401 2008 © A. Fedorova
Skype Components
• Skype client – the client program used to make phone
calls
• Host cache – ...
6CMPT 401 2008 © A. Fedorova
Skype Bootstrap Procedure
• Skype client depends on host cache to find other users
• How does...
7CMPT 401 2008 © A. Fedorova
Skype User Search Procedure
• A Skype client making a phone call needs to find other
users
• ...
8CMPT 401 2008 © A. Fedorova
Outline
• Skype
• BitTorrent
9CMPT 401 2008 © A. Fedorova
10CMPT 401 2008 © A. Fedorova
BitTorrent Overview
• Website allowing peers to share music, video and other media files
• C...
11CMPT 401 2008 © A. Fedorova
BitTorrent Download Mechanism
• Peers download pieces they
need and upload pieces
they have
...
12CMPT 401 2008 © A. Fedorova
Selective Unchoking
• Once in a while selectively unchoke one of the links
• Allow some time...
13CMPT 401 2008 © A. Fedorova
Game Theory on Exchange
• Two traders A and B simultaneously exchange goods
• They have to d...
14CMPT 401 2008 © A. Fedorova
Incentives
• P – payoff
• P(C) – payoff to cooperating player
• P(D) – payoff to defecting p...
15CMPT 401 2008 © A. Fedorova
Strategies Encouraged By Incentives
• Best individual strategy is to defect
• But if both tr...
16CMPT 401 2008 © A. Fedorova
Winning the Exchange Game: TIT-FOR-TAT
• The exchange game:
– Repeat rounds of exchanges wit...
17CMPT 401 2008 © A. Fedorova
Analogy With BitTorrent
• Goods exchange: exchange the piece of file that you have
for the p...
18CMPT 401 2008 © A. Fedorova
Is BitTorrent Using the Winning Strategy?
• Is BitTorrent player NICE?
– No, it may choke an...
19CMPT 401 2008 © A. Fedorova
Improved Incentive Mechanism
• For each link, maintain:
– Download amount d
– Upload amount ...
20CMPT 401 2008 © A. Fedorova
Comparison of the Mechanisms
• Old mechanism: everyone experiences the same download time,
r...
21CMPT 401 2008 © A. Fedorova
Comparison of the Mechanisms (cont.)
• FO – free riders + old players
• FN – free riders + n...
22CMPT 401 2008 © A. Fedorova
Summary
• Skype
– IP telephony system
– Relies on super-nodes, recorded in host cache
– Skyp...
Upcoming SlideShare
Loading in...5
×

pptx - SFU Computing Science Home Page

298
-1

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
298
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

pptx - SFU Computing Science Home Page

  1. 1. CMPT 401 2008 Dr. Alexandra Fedorova Lecture XV: Real P2P Systems
  2. 2. 2CMPT 401 2008 © A. Fedorova Outline • Skype • BitTorrent
  3. 3. 3CMPT 401 2008 © A. Fedorova Skype • IP telephony system • Allows users to make phone calls – to Skype users – to regular phone users • Calls are routed via Skype nodes • Central login server • Super-nodes – Nodes that know about location of other nodes
  4. 4. 4CMPT 401 2008 © A. Fedorova Skype P2P Network • Super-nodes are nodes with powerful CPU and network bandwidth • One has to qualify to become a super-node • Super-nodes know about locations of other nodes • Ordinary nodes contact super-nodes to place calls
  5. 5. 5CMPT 401 2008 © A. Fedorova Skype Components • Skype client – the client program used to make phone calls • Host cache – list of other known Skype users, maintained at each Skype client • Skype login server – a centralized component. Processes account information, authentication
  6. 6. 6CMPT 401 2008 © A. Fedorova Skype Bootstrap Procedure • Skype client depends on host cache to find other users • How does a new Skype client populate its host cache? • There is a list of bootstrap supernodes hard-coded into the Skype client • Skype client contacts them to – Find the login server – Find names of other Skype peers • Skype client continues maintaining and refreshing its host cache throughout its lifetime – It’s a good idea to let Skype running for a while before making a phone call!
  7. 7. 7CMPT 401 2008 © A. Fedorova Skype User Search Procedure • A Skype client making a phone call needs to find other users • It contacts super-nodes from its host cache, asking them to help find the user • Super-nodes return a list of nodes to contact • The client contacts those nodes • If unsuccessful, the client asks for more nodes • Guarantees to find any user that has logged in within the last 72 hours • Not much specific information on Skype protocol is available…
  8. 8. 8CMPT 401 2008 © A. Fedorova Outline • Skype • BitTorrent
  9. 9. 9CMPT 401 2008 © A. Fedorova
  10. 10. 10CMPT 401 2008 © A. Fedorova BitTorrent Overview • Website allowing peers to share music, video and other media files • Central server helps users find initial set of peers that have pieces of the file • Tracker server keeps track of peers possessing content of individual files • Users download the file by participating in exchange: – They exchange pieces that they have – for pieces that they don’t have • Therefore, for the system to work, users must have incentive to give • Users who just get, but do not give are called free riders • Protocol must discourage free riding
  11. 11. 11CMPT 401 2008 © A. Fedorova BitTorrent Download Mechanism • Peers download pieces they need and upload pieces they have • Keep track of download rates from all links • Keep those with highest rate • Keep uploading to those peers • Choke the others (stop upload) fatter link = higher rate
  12. 12. 12CMPT 401 2008 © A. Fedorova Selective Unchoking • Once in a while selectively unchoke one of the links • Allow some time (30 sec.) to see if the download rate will increase • If the download rate becomes greater than the rate at one of the existing links, choke the slowest of the existing links
  13. 13. 13CMPT 401 2008 © A. Fedorova Game Theory on Exchange • Two traders A and B simultaneously exchange goods • They have to decide whether to participate in the exchange without knowing the other person’s decision • If a trader makes the exchange, he cooperates • If a trader does not make the exchange, he defects • Possible outcomes: – A cooperates, B cooperates – both benefit from receiving the other trader’s good – A cooperates, B defects – B benefits by receiving A’s good, by not giving away his own good – A defects, B defects – none receives the other trader’s good, but each gets to keep his own good
  14. 14. 14CMPT 401 2008 © A. Fedorova Incentives • P – payoff • P(C) – payoff to cooperating player • P(D) – payoff to defecting player Cooperate Defect Cooperate P(C) = 3, P(C) = 3 P(C) = 0, P(D) = 5 Defect P(D) = 5, P(C) = 0 P(D) = 1, P(D) = 1
  15. 15. 15CMPT 401 2008 © A. Fedorova Strategies Encouraged By Incentives • Best individual strategy is to defect • But if both traders defect they are worse off than if they both co-operated • So the best strategy is to co-operate, but only if the other player co-operates Cooperate Defect Cooperate P(C) = 3, P(C) = 3 P(C) = 0, P(D) = 5 Defect P(D) = 5, P(C) = 0 P(D) = 1, P(D) = 1
  16. 16. 16CMPT 401 2008 © A. Fedorova Winning the Exchange Game: TIT-FOR-TAT • The exchange game: – Repeat rounds of exchanges with other players – Remember what other players did in previous rounds – Goal: maximize personal payoff • The winning strategy: TIT-FOR-TAT – Cooperate in the first round – In subsequent rounds do that which the other player did • Properties of the winning player: – Nice – he begins by cooperating – Retaliatory – he won’t cooperate with players that do not cooperate with him – Forgiving – will cooperate again if bad players fix their behavior – Clear – clearly communicates his intentions
  17. 17. 17CMPT 401 2008 © A. Fedorova Analogy With BitTorrent • Goods exchange: exchange the piece of file that you have for the piece that you don’t have • Cooperate: upload the piece you have in exchange for downloading the piece you need • Defect: download the piece you need, but don’t upload (free riding) • Payoff: – The piece you download – minus the cost of uploading the file
  18. 18. 18CMPT 401 2008 © A. Fedorova Is BitTorrent Using the Winning Strategy? • Is BitTorrent player NICE? – No, it may choke an existing link upon finding a faster one • Is BitTorrent player RETALIATORY? – No, it uses optimistic unchoking • Is BitTorrent player FORGIVING? – Not necessarily – unchoked links are chosen arbitrarily • Is BitTorrent player CLEAR? • No, unchoked links are chosen arbitrarily
  19. 19. 19CMPT 401 2008 © A. Fedorova Improved Incentive Mechanism • For each link, maintain: – Download amount d – Upload amount u • Upload to the peer as long as: u – d ≤ f * c – c – the fragment size – f – some constant • If u – d is large, the other peer is not cooperating – So you stop cooperating in return u d
  20. 20. 20CMPT 401 2008 © A. Fedorova Comparison of the Mechanisms • Old mechanism: everyone experiences the same download time, regardless of the upload rate they provide • New mechanism: nodes that upload more enjoy faster completion time
  21. 21. 21CMPT 401 2008 © A. Fedorova Comparison of the Mechanisms (cont.) • FO – free riders + old players • FN – free riders + new players • FNO – free riders + new players + old players
  22. 22. 22CMPT 401 2008 © A. Fedorova Summary • Skype – IP telephony system – Relies on super-nodes, recorded in host cache – Skype client learns about initial super-nodes from bootstrap super-nodes – Centralized login server • BitTorrent – Media sharing network – File location is found in a centralized fashion (central server + tracker) – File download is P2P – System must encourage co-operation, discourage free riding – The right incentive mechanism is key
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×