Part 4: Peer to Peer - P2P Applications

Slides:



Advertisements
Similar presentations
Layered Video for Incentives in P2P Live Streaming
Advertisements

Peer to Peer and Distributed Hash Tables
Course on Computer Communication and Networks Lecture 10 Chapter 2; peer-to-peer applications (and network overlays) EDA344/DIT 420, CTH/GU.
The BitTorrent Protocol. What is BitTorrent?  Efficient content distribution system using file swarming. Does not perform all the functions of a typical.
Chapter 2 Application Layer Computer Networking: A Top Down Approach, 5 th edition. Jim Kurose, Keith Ross Addison-Wesley, April A note on the use.
Application Layer 2-1 Chapter 2 Application Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012.
CompSci 356: Computer Network Architectures Lecture 21: Content Distribution Chapter 9.4 Xiaowei Yang
Peer-to-Peer Networks João Guerreiro Truong Cong Thanh Department of Information Technology Uppsala University.
Road Map Application basics Web FTP DNS P2P DHT.
No Class on Friday There will be NO class on: FRIDAY 1/30/15.
Cis e-commerce -- lecture #6: Content Distribution Networks and P2P (based on notes from Dr Peter McBurney © )
2: Application Layer P2P applications and Sockets.
CSE 124 Networked Services Fall 2009 B. S. Manoj, Ph.D 11/03/2009CSE 124 Network Services FA 2009 Some of these.
Introduction 1 Lecture 8 Application Layer (DNS, p2p) slides are modified from J. Kurose & K. Ross University of Nevada – Reno Computer Science & Engineering.
P2P File Sharing Systems
1 Lecture05: Application layer r Principles of network applications r DNS r P2P and DHT.
By Shobana Padmanabhan Sep 12, 2007 CSE 473 Class #4: P2P Section 2.6 of textbook (some pictures here are from the book)
Application Layer – Peer-to-peer UIUC CS438: Communication Networks Summer 2014 Fred Douglas Slides: Fred, Kurose&Ross (sometimes edited)
Application Layer2-1 Chapter 2: outline 2.1 principles of network applications – app architectures – app requirements 2.2 Web and HTTP 2.3 FTP 2.4 electronic.
1 Telematica di Base Applicazioni P2P. 2 The Peer-to-Peer System Architecture  peer-to-peer is a network architecture where computer resources and services.
Content Distribution March 6, : Application Layer1.
Introduction of P2P systems
Skype P2P Kedar Kulkarni 04/02/09.
Computer Networks CSE 434 Fall 2009 Sandeep K. S. Gupta Arizona State University Research Experience.
Chapter 2: Application layer
2: Application Layer1 Chapter 2: Application layer r 2.1 Principles of network applications r 2.2 Web and HTTP r 2.3 FTP r 2.4 Electronic Mail  SMTP,
2: Application Layer1 Chapter 2 outline r 2.1 Principles of app layer protocols r 2.2 Web and HTTP r 2.3 FTP r 2.4 Electronic Mail r 2.5 DNS r 2.6 Socket.
Application Layer 2-1 Chapter 2 Application Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012.
1 Peer-to-Peer Systems r Application-layer architectures r Case study: BitTorrent r P2P Search and Distributed Hash Table (DHT)
2: Application Layer1 Chapter 2: Application layer r 2.1 Principles of network applications  app architectures  app requirements r 2.2 Web and HTTP r.
Lecture 2 Distributed Hash Table
An analysis of Skype protocol Presented by: Abdul Haleem.
2: Application Layer1 Chapter 2 Application Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012.
2: Application Layer 1 Chapter 2 Application Layer Computer Networking: A Top Down Approach, 5 th edition. Jim Kurose, Keith Ross Addison-Wesley, April.
Computer Networks CSE 434 Fall 2009 Sandeep K. S. Gupta Arizona State University Research Experience.
ADVANCED COMPUTER NETWORKS Peer-Peer (P2P) Networks 1.
Bit Torrent Nirav A. Vasa. Topics What is BitTorrent? Related Terms How BitTorrent works Steps involved in the working Advantages and Disadvantages.
INTERNET TECHNOLOGIES Week 10 Peer to Peer Paradigm 1.
No Class on Friday There will be NO class on: FRIDAY 1/29/15 1.
PEAR TO PEAR PROTOCOL. Pure P2P architecture no always-on server arbitrary end systems directly communicate peers are intermittently connected and change.
Chapter 29 Peer-to-Peer Paradigm Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Lecture XV: Real P2P Systems
05 - P2P applications and Sockets
An example of peer-to-peer application
Introduction to BitTorrent
(slides by Nick Feamster)
Data Communications and Networking DNS
Chapter 2 Application Layer
Server-client vs. P2P: example
Chapter 2: outline 2.1 principles of network applications
EECS 3214: Computer Networks Protocols and Applications
Chapter 2 Introduction Application Requirements VS. Transport Services
Communication Networks
EE 122: Peer-to-Peer (P2P) Networks
CMPE 252A : Computer Networks
Prof. Leonardo Mostarda University of Camerino
Chapter 2 Application Layer
The BitTorrent Protocol
Content Distribution Networks + P2P File Sharing
A day in the life: scenario
Chapter 2 Application Layer
CMPE 252A : Computer Networks
Pure P2P architecture no always-on server
Chapter 2: outline 2.5 DNS 2.6 P2P applications
Chapter 2 Application Layer
Content Distribution Networks + P2P File Sharing
Chapter 2 Application Layer - 2
CSE 486/586 Distributed Systems Peer-to-Peer Architecture --- 1
Presentation transcript:

Part 4: Peer to Peer - P2P Applications IT 424 Networks2 Chapter 2: Application Layer Part 4: Peer to Peer - P2P Applications Ack.: Slides are adapted from the slides of the book: “Computer Networking” – J. Kurose, K. Ross

Database Distribution File Distribution: Client-Server vs P2P BitTorrent File Distribution Database Distribution Overview Skype Application

Learning Outcomes 1 To differentiate between the client-server and the P2P application architectures 2 To analyze the performance of both architectures for file-sharing applications 3 To explain how p2p architecture works 4 To describe the bitTorrent file distribution application 5 To analyze the distributed hash table scheme for database distribution 6 To discuss the structure and operation of skype application

Database Distribution File Distribution: Client-Server vs P2P BitTorrent File Distribution Database Distribution Overview Skype Application

Recap: Application Architectures Application Layer Architectures Recap: Application Architectures Possible structure of applications: Client-server Peer-to-peer (P2P) Hybrid of client-server and P2P

File Distribution: Client-Server vs P2P us: server upload capacity u2 d2 u1 d1 di: peer i download capacity file, size F us server di uN network (with abundant bandwidth) ui dN ui: peer i upload capacity Question: How much time to distribute file (size F) from one server to N peers? Peer upload/download capacity is limited resource

File Distribution Time: Client-Server File Distribution: Client-Server vs P2P File Distribution Time: Client-Server Server transmission: must sequentially send (upload) N file copies: time to send one copy: L/R= F/us time to send N copies: L/R=NF/us F us di network ui increases linearly in N time to distribute F to N clients using client-server approach If N >> then Delayc-s α N

File Distribution Time: P2P File Distribution: Client-Server vs P2P File Distribution Time: P2P Server transmission: must upload at least one copy time to send one copy: F/us Client:s as aggregate must upload NF bits Delay = L/R L α N However R also depends upon N P2P is more scalable F us di network ui … but so does this, as each peer brings service capacity increases linearly in N time to distribute F to N clients using P2P approach DelayP2P α N / (us + ui N)

Client-server vs. P2P: example File Distribution: Client-Server vs P2P Client-server vs. P2P: example

Database Distribution File Distribution: Client-Server vs P2P BitTorrent File Distribution Database Distribution Overview Skype Application

P2P File Distribution: BitTorrent BitTorrent File Distribution P2P File Distribution: BitTorrent tracker: tracks peers participating in torrent torrent: group of peers exchanging chunks of a file Alice arrives … … obtains list of peers from tracker … and begins exchanging file chunks with peers in torrent File divided into 256kb chunks Peers in torrent send/receive file chunks

P2P File Distribution: BitTtorrent Bittorrent File Distribution P2P File Distribution: BitTtorrent Peer joining torrent: Has no chunks, but will accumulate them over time from other peers Registers with tracker to get list of peers, connects to subset of peers (“neighbors”) While downloading, peer uploads chunks to other peers Peer may change peers with whom it exchanges chunks Churn: peers may come and go Once peer has entire file, it may (selfishly) leave or (altruistically) remain in torrent

BitTorrent: Requesting, Sending File Chunks BitTorrent File Distribution – Sending File BitTorrent: Requesting, Sending File Chunks Requesting chunks: At any given time, different peers have different subsets of file chunks Periodically, Alice asks each peer for list of chunks that they have 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 receive chunks from her) Re-evaluate top 4 every10 secs Every 30 secs: randomly select another peer, starts sending chunks “Optimistically unchoke” this peer Newly chosen peer may join top 4

BitTorrent: Tit-For-Tat BitTorrent File Distribution – Sending File BitTorrent: Tit-For-Tat (1) Alice “optimistically unchokes” Bob (2) Alice becomes one of Bob’s top-four providers; Bob reciprocates (3) Bob becomes one of Alice’s top-four providers higher upload rate: find better trading partners, get file faster !

Database Distribution File Distribution: Client-Server vs P2P BitTorrent File Distribution Database Distribution Overview Skype Application

Distributed Hash Table (DHT) Database Distribution Distributed Hash Table (DHT) A critical component of many P2P applications is an information index or a simple database supporting search and update operation. Hash table Distributed Hash Table (DHT) paradigm Circular DHT and overlay networks Peer churn

Simple Database Key Value John Washington 132-54-3570 Database Distribution Simple Database Key Value John Washington 132-54-3570 Diana Louise Jones 761-55-3791 Xiaoming Liu 385-41-0902 Rakesh Gopal 441-89-1956 Linda Cohen 217-66-5609 ……. ……… Lisa Kobayashi 177-23-0199 Simple database with (key, value) pairs: key: human name; value: social security # key: movie title; value: IP address

Hash Table Original Key Key Value John Washington 8962458 132-54-3570 Database Distribution - Hash Table Hash Table Original Key Key Value John Washington 8962458 132-54-3570 Diana Louise Jones 7800356 761-55-3791 Xiaoming Liu 1567109 385-41-0902 Rakesh Gopal 2360012 441-89-1956 Linda Cohen 5430938 217-66-5609 ……. ……… Lisa Kobayashi 9290124 177-23-0199 More convenient to store and search on numerical representation of key key = hash (original key)

Distributed Hash Table (DHT) Database Distribution - Distributed Hash Table Distributed Hash Table (DHT) Distribute (key, value) pairs over millions of peers Pairs are evenly distributed over peers Any peer can query database with a key Database returns value for the key To resolve query, small number of messages exchanged among peers Each peer only knows about a small number of other peers Robust to peers coming and going (churn)

Assign Key-Value Pairs To Peers Database Distribution - Distributed Hash Table Assign Key-Value Pairs To Peers Rule: assign key-value pair to the peer that has the closest ID. Convention: closest is the immediate successor of the key. E.G., ID space {0,1,2,3,…,63} Suppose 8 peers: 1,12,13,25,32,40,48,60 If key = 51, then assigned to peer 60 If key = 60, then assigned to peer 60 If key = 61, then assigned to peer 1

Database Distribution - Circular DHT Each peer only aware of immediate successor and predecessor. 1 12 13 25 32 40 48 60 “overlay network”

Resolving A Query 1 value 12 60 13 48 25 40 32 Database Distribution - Circular DHT Resolving A Query What is the value associated with key 53 ? 1 value 12 O(N) messages On avgerage to resolve Query, when there Are N peers 60 13 48 25 40 32

Circular DHT With Shortcuts Database Distribution - Circular DHT Circular DHT With Shortcuts 1 12 13 25 32 40 48 60 What is the value for key 53 value Each peer keeps track of IP addresses of predecessor, successor, short cuts. Reduced from 6 to 3 messages. Possible to design shortcuts with O(log N) neighbors, O(log N) messages in query

Peer Churn 1 3 15 4 12 5 10 8 Handling peer churn: Database Distribution – Peer Churn Peer Churn 1 3 4 5 8 10 12 15 Handling peer churn: Peers may come and go (churn) Each peer knows address of its two successors Each peer periodically pings its two successors to check aliveness If immediate successor leaves, choose next successor as new immediate successor Example: peer 5 abruptly leaves peer 4 detects peer 5’s departure; makes 8 its immediate successor 4 asks 8 who its immediate successor is; makes 8’s immediate successor its second successor.

Database Distribution File Distribution: Client-Server vs P2P BitTorrent File Distribution Database Distribution Overview Skype Application

Voice-over-IP: Skype Skype clients (SC) Skype Application Voice-over-IP: Skype Skype clients (SC) Proprietary application-layer protocol P2p (PC-to-PC, PC-to-phone, phone-to-PC) Voice-over-IP (VoIP) application Also Instant Messaging Encrypted msgs P2P components: Skype login server supernode (SN) supernode overlay network Clients: skype peers connect directly to each other for voip call Super nodes (SN): skype peers with special functions Overlay network: among SNs to locate SCs Login server

Voice-over-IP: Skype Skype client operation: Skype Application Voice-over-IP: Skype Skype client operation: Skype login server 1. Joins skype network by contacting SN (IP address cached) using TCP 2. Logs-in (usename, password) to centralized skype login server 3. Call: SC contacts SN will callee ID SN contacts other SNs (unknown protocol, maybe flooding) to find addr of callee; returns addr to SC 4. Initiate call directly to callee

Voice-over-IP: Skype Problem: both Alice, Bob are behind NATs Skype Application Voice-over-IP: Skype Problem: both Alice, Bob are behind NATs NAT prevents outside peer from initiating connection to insider peer Inside peer can initiate connection to outside Relay solution: Alice, Bob maintain open connection to their SNs Alice signals her SN to connect to bob Alice’s SN connects to bob’s SN Bob’s SN connects to bob over open connection bob initially initiated to his SN

Conclusion There are three application architectures: Client server (e.g. FTP, Web) Pure HTP (e.g. bitTorrent) Hybrid architecture (e.g skype) File distribution time using P2P architecture is less than using client-server architecture Four paradigm for file distribution: Hash table Distributed Hash Table paradigm Circular DHT and overlay networks Peer churn

References References Computer Networking: A Top-Down Approach Featuring the Internet by James Kurose and Keith Ross, Addison Wesley, 2012 (chapter 2 ) Peer-to-Peer (P2P) Architecture (RFC5694)