Welcome to CS 3516: Computer Networks Prof. Yanhua Li Time: 9:00am 9:50am M, T, R, and F Location: AK219 Fall 2018 A-term 1 Some slides are originally from the course materials of the textbook Computer Networking: A Top Down Approach, 7th edition, by Jim Kurose, Keith Ross, Addison-Wesley March 2016. Copyright 1996-2017 J.F Kurose and K.W. Ross, All Rights Resered.
Quiz 5 on Friday P2P networks Mid-term next Friday (Tentatie) Lab 2 due on Friday Piazza is aailable Application Layer 2-2
Chapter 2: outline 2.6 P2P applications 1. P2P s Client&Serer 2. Unstructured -to- Networks BitTorrent 3. Structured -to- Networks Distributed Hash Table (DHT) Application Layer 2-3
Client-serer s P2P architecture peer-to-peer client/serer Application Layer 2-4
-to- Networks: Unstructured -to- Networks Napster Gnutella BitTorrent 5
Chapter 2: outline 2.6 P2P applications 1. P2P s Client&Serer 2. Unstructured -to- Networks Napster Gnutella BitTorrent 3. Structured -to- Networks Application Layer 2-6
-to- Networks: How Did it Start? A killer application: Napster Free music oer the Internet Key idea: share the content, storage and bandwidth of indiidual (home) users Internet 7
Model Each user stores a subset of files Each user has access (can download) files from all users in the system Challenges Scale: up to hundred of thousands or millions of machines Dynamicity: machines can come and go any time 8
Main Challenge Find where a particular file is stored F E D E? A B C 9
Napster: Example m5 m6 E F E? E E? m5 m1 A m2 B m3 C m4 D m5 E m6 F m4 D m1 A m2 B m3 C 10
-to- Networks: Napster Napster history: the rise January 1999: Napster ersion 1.0 May 1999: company founded September 1999: first lawsuits 2000: 80 million users Napster history: the fall Mid 2001: out of business due to lawsuits Mid 2001: dozens of P2P alternaties that were harder to touch, though these hae gradually been constrained 2003: growth of pay serices like itunes Napster history: the resurrection 2003: Napster reconstituted as a pay serice 2006: still lots of file sharing going on Shawn Fanning, Northeastern freshman 11
Napster: Example m5 m6 E F E? E E? m5 m1 A m2 B m3 C m4 D m5 E m6 F m4 D User installing the software m1 Client contacts Napster (ia TCP) A m2 B m3 C Client searches on a title or performer Client requests the file from the chosen supplier 12
Napster: Limitations of Central Directory Single point of failure Performance bottleneck Copyright infringement File transfer is decentralized, but locating content is highly centralized So, later P2P systems were more distributed 13
-to- Networks: Gnutella Gnutella history 2000: J. Frankel & T. Pepper released Gnutella Soon after: many other clients (e.g., Morpheus, Limewire, Bearshare) 2001: protocol enhancements, e.g., ultrapeers Query flooding Join: contact a few nodes to become neighbors Publish: no need! Search: ask neighbors, who ask their neighbors Fetch: get file directly from another node 14
Gnutella Ad-hoc topology No guarantees on recall xyz xyz Query: xyz Queries are flooded for bounded number of hops 15 (TTL)
Gnutella: Protocol Query message sent oer existing TCP connections s forward Query message QueryHit sent oer reerse path Scalability: limited scope flooding Query QueryHit Query QueryHit Query Query QueryHit Query File transfer: HTTP Oerlay network: graph Edge between peer X and Y if there s a TCP connection 16
Gnutella: Pros and Cons Adantages Fully decentralized Highly robust Disadantages Not scalable; the entire network can be swamped with request Search scope may be quite large, High oerhead Search time may be quite long 17
Chapter 2: outline 2.6 P2P applications 1. P2P s Client&Serer 2. Unstructured -to- Networks BitTorrent Application Layer 2-18
P2P design challenges Scalability Publish/Download Large file Free Riding 19
BitTorrent: Simultaneous Downloading Diide large file into many pieces (256Kbytes) Replicate different pieces on different peers A peer with a complete piece can trade with other peers can (hopefully) assemble the entire file Allows simultaneous downloading Retrieing different parts of the file from different peers at the same time 20
BitTorrent Components Seed with entire file Fragmented in pieces Leech with an incomplete copy of the file Torrent file Passie component Stores summaries of the pieces to allow peers to erify their integrity Tracker Allows peers to find each other Returns a list of random peers 21
BitTorrent: Oerall Architecture Web page with link to.torrent Web Serer Tracker.torrent A [Leech] Downloader US B [Leech] C [Seed] 22
BitTorrent: Oerall Architecture Web page with link A [Leech] to.torrent Downloader US Web Serer Get-announce B [Leech] Tracker C [Seed] 23
BitTorrent: Oerall Architecture Web page with link to.torrent Web Serer Tracker A [Leech] Downloader US Response-peer list B [Leech] C [Seed] 24
BitTorrent: Oerall Architecture Web page with link to.torrent Web Serer Tracker A [Leech] Downloader US Shake-hand Shake-hand B [Leech] C [Seed] 25
BitTorrent: Oerall Architecture Web page with link to.torrent Web Serer Tracker A pieces C [Leech] Downloader US pieces B [Leech] [Seed] 26
BitTorrent: Oerall Architecture Web page with link to.torrent Web Serer Tracker A [Leech] Downloader US pieces pieces B [Leech] pieces C [Seed] 27
BitTorrent: Oerall Architecture Web page with link to.torrent Web Serer Tracker A [Leech] Downloade r US Get-announce Response-peer list pieces pieces B [Leech] pieces C [Seed] 28
Free-Riding Problem in P2P Networks Vast majority of users are free-riders Most share no files and answer no queries Others limit # of connections or upload speed A few peers essentially act as serers A few indiiduals contributing to the public good Making them hubs that basically act as a serer BitTorrent preent free riding Allow the fastest peers to download from you Occasionally let some free loaders download 29
BitTorrent: requesting, sending file chunks requesting chunks: at any gien time, different peers hae different subsets of file chunks periodically, Alice asks each peer for list of chunks that they hae Alice requests missing chunks from peers, rarest first sending chunks: tit-for-tat Alice sends chunks to those four peers currently sending her chunks at highest rate other peers are choked by Alice (do not receie chunks from her) re-ealuate top 4 eery10 secs eery 30 secs: randomly select another peer, starts sending chunks optimistically unchoke this peer newly chosen peer may join top 4 Application Layer 2-30
BitTorrent: tit-for-tat (1) Alice optimistically unchokes Bob (2) Alice becomes one of Bob s top-four proiders; Bob reciprocates (3) Bob becomes one of Alice s top-four proiders higher upload rate: find better trading partners, get file faster! Application Layer 2-31
Chapter 2: summary our study of network apps now complete! application architectures client-serer P2P application serice requirements: reliability, throughput, delay, security Internet transport serice model connection-oriented, reliable: TCP unreliable, datagrams: UDP specific protocols: HTTP SMTP, POP, IMAP DNS P2P: BitTorrent Application Layer 2-32
Questions? Application Layer 2-33