Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Peer-to-Peer Networks: Lecture 13 of CSE 123b, Assignments of Spanish Language

A set of lecture notes from a university course on communications software (cse 123b) focusing on peer-to-peer (p2p) networks. The basics of p2p systems, their classifications, challenges, and solutions like napster, gnutella, freenet, and chord. It also discusses the lookup problem, routed queries, and consistent hashing.

Typology: Assignments

2009/2010

Uploaded on 03/28/2010

koofers-user-whl
koofers-user-whl 🇺🇸

10 documents

1 / 27

Toggle sidebar

Related documents


Partial preview of the text

Download Peer-to-Peer Networks: Lecture 13 of CSE 123b and more Assignments Spanish Language in PDF only on Docsity! CSE 123b Communications Software Spring 2004 Lecture 13: Peer-to-Peer Networks Stefan Savage Some slides courtesy Ion Stoica and Srini Seshan May 20, 2004 CSE 123b – Lecture 13 – Peer-to-Peer Networks 2 Quick annoucements Homework assignment up on the Web site tonight New (short) project assigned on Tuesday May 20, 2004 CSE 123b – Lecture 13 – Peer-to-Peer Networks 5 Challenges Dynamic availability– machines go up & down Scale – millions of nodes Heterogeneity – some have big CPU/mem Management – each user controls own node Security – what about compromised nodes? Fairness – what about freeloaders? Performance May 20, 2004 CSE 123b – Lecture 13 – Peer-to-Peer Networks 6 The Lookup Problem Internet N1 N2 N3 N6N5 N4 Publisher Key=“title” Value=MP3 data… Client Lookup(“title”) ? May 20, 2004 CSE 123b – Lecture 13 – Peer-to-Peer Networks 7 Centralized Lookup (Napster) Publisher@ Client Lookup(“title”) N6 N9 N7 DB N8 N3 N2N1SetLoc(“title”, N4) Simple, but O(N) state and a single point of failure Key=“title” Value=MP3 data… N4 May 20, 2004 CSE 123b – Lecture 13 – Peer-to-Peer Networks 10 Gnutella Distributed location information Self-organizing ◆ New node joins network by opening TCP sessions to “neighbors” willing to accept connections Idea: multicast the request How to find a file: ◆ Send request to all neighbors ◆ Neighbors recursively forward the request ◆ Eventually a machine that has the file receives the request, and it sends back the answer Advantages: ◆ Totally decentralized, highly robust Disadvantages: ◆ Not scalable as is; the entire network can be swamped with request (can alleviate some of this problem if each request has a TTL) May 20, 2004 CSE 123b – Lecture 13 – Peer-to-Peer Networks 11 Gnutella Details Basic message header ◆ Unique ID, TTL, Hops Message types ◆ Ping – probes network for other nodes ◆ Pong – response to ping, contains IP addr, # of files, # of Kbytes shared ◆ Query – search criteria + speed requirement of node ◆ QueryHit – successful response to Query, contains addr + port to transfer from, speed of node, number of hits, hit results, node ID ◆ Push – request to node ID to initiate connection, used to traverse firewalls Ping, Queries are flooded QueryHit, Pong, Push reverse path of previous message Download content via HTTP May 20, 2004 CSE 123b – Lecture 13 – Peer-to-Peer Networks 12 Routed Queries (Freenet, Chord, etc) N4Publisher Client N6 N9 N7 N8 N3 N2N1 Lookup(“title”) Key=“title” Value=MP3 data… May 20, 2004 CSE 123b – Lecture 13 – Peer-to-Peer Networks 15 Data Structure Each node maintains a common stack ◆ id – file identifier ◆ next_hop – another node that store the file id ◆ file – file identified by id being stored on the local node Forwarding: ◆ Each message contains the file id it is referring to ◆ If file id stored locally, then stop » Forward data back to upstream requestor » Requestor adds file to cache, adds entry in routing table ◆ If not, search for the “closest” id in the stack, and forward the message to the corresponding next_hop id next_hop file … … May 20, 2004 CSE 123b – Lecture 13 – Peer-to-Peer Networks 16 Query Example Note: doesn’t show file caching on the reverse path 4 n1 f4 12 n2 f12 5 n3 9 n3 f9 3 n1 f3 14 n4 f14 5 n3 14 n5 f14 13 n2 f13 3 n6 n1 n2 n3 n4 4 n1 f4 10 n5 f10 8 n6 n5 query(10) 1 2 3 4 4’ 5 May 20, 2004 CSE 123b – Lecture 13 – Peer-to-Peer Networks 17 Freenet Summary Advantages ◆ Totally decentralize architecture robust and scalable Disadvantages ◆ Does not always guarantee that a file is found, even if the file is in the network May 20, 2004 CSE 123b – Lecture 13 – Peer-to-Peer Networks 20 Consistent Hashing costs Every node knows of every other node requires global information Routing tables are large O(N) Lookups are fast O(1) N32 N90 N123 0 Hash(“LetItBe”) = K60 N10 N55 Where is “LetItBe”? “N90 has K60” K60 May 20, 2004 CSE 123b – Lecture 13 – Peer-to-Peer Networks 21 Chord: basic lookup N32 N90 N123 0 Hash(“LetItBe”) = K60 N10 N55 Where is “LetItBe”? “N90 has K60” K60 requires O(N) time May 20, 2004 CSE 123b – Lecture 13 – Peer-to-Peer Networks 22 Improvement: “finger tables” Every node knows m other nodes in the ring Increase distance exponentially N80 80 + 20 N112 N96 N16 80 + 21 80 + 22 80 + 23 80 + 24 80 + 25 80 + 26 May 20, 2004 CSE 123b – Lecture 13 – Peer-to-Peer Networks 25 Chord Summary O(logN) guaranteed lookup performance ◆ Possible to do even better: O(loglogn/logn) Lookup semantics, not search Issues w/simple approach ◆ Reliability & churn (not covered here) ◆ Performance: routing over the p2p network can be more expensive than in the underlying network » Because usually there is no correlation between node ids and their locality; a query can repeatedly jump from Europe to North America, though both the initiator and the node that store the item are in Europe! » Partial solution: Weight neighbor nodes by RTT when routing, choose neighbor who is closer to destination with lowest RTT from me May 20, 2004 CSE 123b – Lecture 13 – Peer-to-Peer Networks 26 Open p2p issues Freeloading problem ◆ Does everyone participate? Trust? Availability/reliability? What can we do with p2p that is useful and legal? May 20, 2004 CSE 123b – Lecture 13 – Peer-to-Peer Networks 27 Summary A key challenge of building wide area P2P systems is a scalable and robust location service Solutions covered in this lecture ◆ Napster: centralized location service ◆ Gnutella: broadcast-based decentralized location service ◆ Freenet: intelligent-routing decentralized solution (but correctness not guaranteed; queries for existing items may fail) ◆ Chord (and others): intelligent-routing decentralized solution » Guarantee correctness » Guaranteed worst-case # of operations » More fragile Lots of open questions
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved