Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS522: Algorithmic and Economic Aspects of the Internet Instructors: Nicole Immorlica Mohammad Mahdian

Similar presentations


Presentation on theme: "CS522: Algorithmic and Economic Aspects of the Internet Instructors: Nicole Immorlica Mohammad Mahdian"— Presentation transcript:

1 CS522: Algorithmic and Economic Aspects of the Internet Instructors: Nicole Immorlica (nickle@microsoft.com) Mohammad Mahdian (mahdian@microsoft.com)

2 Peer-To-Peer Networks A network in which nodes employ distributed resources to accomplish critical task Nodes are typically equals, i.e. (approximately) indistinguishable in functionality System is highly dynamic, nodes frequently come and go

3 P2P Definition Distributed systems consisting of interconnected nodes able to self-organize into network topologies with the purpose of sharing resources such as content, CPU cycles, storage and bandwidth, capable of adapting to failures and accommodating transient populations of nodes while maintaining acceptable connectivity and performance, without requiring the intermediation or support of a global centralized server or authority. – A Survey of Peer-To-Peer Content Distribution Technologies, Androutsellis-Theotokis and Spinellis

4 Peer-To-Peer Applications Direct real-time communication: instant messaging Combine processing power of multiple distributed machines to perform complex computations: analysis of SETI data, prime computation Store and distribute digital content: mp3 file sharing

5 Peer-To-Peer Benefits Self-organized and adaptive Easily scalable Fault-tolerant and load balanced Resistant to censorship

6 P2P Construction MIT Clients Servers SPRINT UUNET AOL P2P overlay network

7 P2P Classification Unstructured Loosely Structured Highly Structured HybridNapster, IM PartialKazaa, Gia NoneGnutellaFreenetChord, CAN Centralization Data organization

8 Napster, IM Centralized servers maintain list of files and peer at which file is stored Peers join, leave, and query network via direct communication with servers File transfers occur directly between peers Server 7 1 6 5 4 3 2 Query: U2 Reply: 6 File Transfer

9 Napster, IM Advantages:  Highly efficient data lookup  Rapidly adapts to changes in network Disadvantages:  Questionable scalability  Vulnerable to censorship, failure, attack

10 Gnutella All peers, called servents, are identical and function as both servers and clients A peer joins network by contacting existing servents (chosen from online databases) using PING messages A servent receiving a PING message replies with a PONG message and forwards PING to other servents Peer connects to servents who send PONG

11 Gnutella A servent queries network by sending a QUERY message A servent receiving a QUERY message replies with a QUERYHIT message if he can answer the query. If not, he forwards QUERY message to other servents

12 Routing in Gnutella How PING/QUERY messages are forwarded affects network topology, search efficiency/accuracy, and scalability Proposals  Breadth-First-Search: flooding, iterative deepening, modified random BFS  Depth-First-Search: random walk, k-walker random walks, two-level random walk, dominating set based search

13 Hybrid Search Random walk with lookahead: short random walks with shallow local flooding Takes advantage of “supernodes” or nodes of high degree  Stationary dist. of random walk is naturally biased towards supernodes  Lookahead allows search to quickly discover content stored at all neighbors of these high- degree nodes

14 Supernodes Improve scalability and performance of Gnutella-like systems via supernodes Supernodes are special peers with high degree, elected dynamically according to bandwidth and other considerations Supernodes maintain a list of content stored at peers Advantages:  Searches propagate on supernodes, 3 to 5 times faster  Takes advantage of heterogeneity in network

15 Gnutella Advantages  Entirely decentralized, pure P2P network  Highly resistant to failure Disadvantages  Search is time-consuming  Network typically scales poorly

16 Chord Distributed hash table (DHT) implementation Each node/piece of content has an ID Content IDs are deterministically mapped to node IDs so a searcher knows exactly where data is located, a content addressable network Efficient: O(log n) messages per lookup Scalable: O(log n) state per node

17 Keys in Chord m bit identifier space for both nodes and content keys Content ID = hash(content) Node ID = hash(IP address) Both are uniformly distributed How to map content IDs to node IDs?

18 N32 N90 N123 K20 K5 Circular 7-bit ID space 0 IP=“198.10.10.1” K101 K60 Content = “U2” Mapping Content to Nodes Content is stored at successor node, node with next higher ID Figure adapted from Stoica et al.

19 Routing Every node knows of every other node  Routing tables O(n), lookup O(1) N32 N90 N123 Hash(“U2”) = K60 N10 N55 Where is “U2”? “N90 has K60” K60 Figure adapted from Stoica et al.

20 Routing Every node knows its successor in ring  Routing tables O(1), lookup O(n) N32 N90 N123 Hash(“U2”) = K60 N10 N55 Where is “U2”? “N90 has K60” K60 Figure adapted from Stoica et al.

21 Routing Every node knows m others Distances increase exponentially, node i points to node whose ID is successor of i + 2 j for j from 1 to m. These pointers are called fingers. The finger (routing) table and search time are both O(log n)

22 Finger Tables N80 80 + 2 0 N112 N96 N16 80 + 2 1 80 + 2 2 80 + 2 3 80 + 2 4 80 + 2 5 80 + 2 6 Figure adapted from Stoica et al.

23 Routing with Finger Tables N32 N10 N5 N20 N110 N99 N80 N60 Lookup(K19) K19 Figure adapted from Stoica et al.

24 Chord Dynamics When a node joins  Initialize all fingers of new node  Update fingers of existing nodes  Transfer content from successor to new node When a node leaves  Transfer content to successor

25 Chord Failures Churn rate is very high (on average, nodes are in system for only 60 minutes) and events happen concurrently Churn (esp. ungraceful departures or simultaneous joins/departures) can failure states, e.g. inconsistencies in successor relationships or, worse, loopy states Requires a lot of maintenance messages to preserve ideal state

26 Maintenance in P2P Maintenance protocol ensures global connectivity and efficient lookup by continuously repairing overlay network and routing tables Maintenance is essential, e.g. when a node  Joins and announces presence  Updates routing table to ensure efficient search  Monitors neighbors for failures/departures Cost of maintenance protocol can be measured in terms of the rate of maintenance messages

27 Half Life Defn. Suppose there are N t nodes at time t. Let the doubling time  t be such that at time t +  t, N t new nodes have arrived. Similarly let halving time  t be such that at time t +  t, N t /2 nodes have departed. Then the half life of a system is min t (  t,  t ).  The half life is the average amount of time until half the system has been replaced.  Measures rate of change of system.

28 Example Nodes arrive according to Poisson with rate : prob. k arrivals in time t proportional to e - t Nodes remain for duration exponential rate  : prob. node stays for  amount of time is e  If system in steady state, then arrival rate must equal departure rate  N, so N = / . Doubling time   = N/ = 1/ , halving time   = (ln 2)/ , and so half life = (ln 2)/ .

29 Bounding Maintenance Costs Thm. There exists a sequence of joins and leaves such that any node that, at any time, has received an average of fewer than k notifications per half-life will be disconnected from the network with prob. at least (1 – 1/e) k. Cor. Any N-node P2P network that remains connected with prob. at least 1 – 1/N must generate an average of  (log N) notifications per node per half life.

30 Proof of Bound Consider Poisson arrival rate, exponential waiting time  =1 in system. Suppose node n averages fewer than k notifications per half life and so there is a minimum time t such that at time t, n has received less than kt notifications. Observe n is isolated at time t with probability at least (1 – 1/(e-1)) k.

31 Maintenance in Chord Liben-Nowell, Balakrishnan, Karger: (Modified) Chord requires only O(log 2 n) maintenance messages per half life to maintain efficiency and correctness of search.

32 Chord Advantages:  Highly efficient search  Good load balancing Disadvantages:  Locality of data is destroyed  Only handles exact match queries, but keyword queries are more prevalent  Most requests are for highly replicated files (needles vs haystack)

33 Conclusion Saw several representative P2P systems, each with advantages and disadvantages Many important issues  Efficiency of search  Ability to adapt to dynamics of system  Security: Malicious peers, Spread of worms  Free riding: Reputation mechanisms, Micro- payment mechanisms Legality


Download ppt "CS522: Algorithmic and Economic Aspects of the Internet Instructors: Nicole Immorlica Mohammad Mahdian"

Similar presentations


Ads by Google