Introduction of P2P Systems
Introduction of P2P Systems
• Unstructured overlays
– e.g., new node randomly chooses three existing nodes
as neighbors
• Structured overlays
– e.g., edges arranged in restrictive structure
P2P Applications
• P2P File Sharing
– Napster, Gnutella, Kazaa, eDonkey,
BitTorrent
– Chord, CAN, Pastry/Tapestry, Kademlia
• P2P Communications
– MSN, Skype, Social Networking Apps
• P2P Distributed Computing
– Seti@home
P2P File Sharing
Alice runs P2P client Gets new
application on her Asks for
notebook computer IP address “Hey
Intermittently for each
connection Jude”
connects to Internet
Application displays
Alice chooses one
other peers that have
of the peers, Bob.
a copy of Hey Jude.
Maximizing the
utilization of
bandwidth
BitTorrent : Pieces
• File is broken into pieces
– Typically piece is 256 KBytes
– Upload pieces while downloading pieces
• Piece selection
– Select rarest piece
– Except at beginning, select random pieces
• Tit-for-tat
– Bit-torrent uploads to at most four peers
– Among the uploaders, upload to the four that are
downloading to you at the highest rates
– A little randomness too, for probing
– MORE DETAIL…..EXAMPLES….
Structured P2P
• Peer-to-peer hash lookup:
– Node ID(Key) , Object ID(Key)
– Lookup(key) IP address
• How does these route lookups?
• How does these maintain routing tables?
K V
K V
Chord, K V
K V
Pastry, K V
Tepastry, K V K V
Can,
K V
Kademlia, K V
K V
etc insert K V
N105 K20
Circular 7-bit
ID space N32
N90
K80
A key is stored at its successor: node with next higher ID
Chord
112 N5
N120
N10 K19
N110
¼ ½
N20
N99
N32
1/8
Lookup(K19)
1/16
1/32
1/64 N80
1/128
N80
N60
Finger i points to successor Lookups take O(log(N)) hops
of n+2i
CAN
• Virtual Cartesian
coordinate space
• entire space is
partitioned amongst all
the nodes 3
– every node “owns” a zone
in the overall space
• abstraction 1 1 2
– can store data at
“points” in the space
(x,y)