2: Application Layer1 Chapter 2 Application Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012.

Slides:



Advertisements
Similar presentations
Course on Computer Communication and Networks Lecture 10 Chapter 2; peer-to-peer applications (and network overlays) EDA344/DIT 420, CTH/GU.
Advertisements

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.
Peer-to-Peer Networking Marina Papatriantafilou CSE Department, Distributed Computing and Systems group Ack: Many of the slides are adaptation of slides.
Road Map Application basics Web FTP DNS P2P DHT.
No Class on Friday There will be NO class on: FRIDAY 1/30/15.
Application Layer 2-1 Chapter 2 Application Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Application Layer – Lecture.
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.
CS1652 September 10 th, 2013 The slides are adapted from the publisher’s material All material copyright J.F Kurose and K.W. Ross, All Rights.
Lecture 6 Chapter 2 Application Layer
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
Data Communications and Computer Networks Chapter 2 CS 3830 Lecture 10 Omar Meqdadi Department of Computer Science and Software Engineering University.
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 Layer 2-1 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 r 2.1 Principles of network applications  app architectures  app requirements r 2.2 Web and HTTP.
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.
Application layer Zeinab Movahedi Some slides are from Computer networks course thought by Jennifer Rexford at Princeton University.
Content Distribution March 6, : Application Layer1.
Introduction of P2P systems
22-1 Last time □ SMTP ( ) □ DNS This time □ P2P □ Security.
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,
P2P Networking and Content Distribution
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.
2: Application Layer 1 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,
© Janice Regan, CMPT 128, CMPT 371 Data Communications and Networking DNS 0.
Content Distribution March 2, : Application Layer1.
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.
Peer-to-Peer (P2P) networks and applications. What is P2P? r “the sharing of computer resources and services by direct exchange of information”
Peer-to-Peer File Sharing Jennifer Rexford COS 461: Computer Networks Lectures: MW 10-10:50am in Architecture N101
Peer-to-Peer Networks Hongli Luo CEIT, IPFW. r Topics m Application architecture m P2P file sharing m P2P networks: Napster Gnutella KaAzA Bittorrent.
Lecture 2 Distributed Hash Table
CS 3830 Day 10 Introduction 1-1. Announcements r Quiz #2 this Friday r Program 2 posted yesterday 2: Application Layer 2.
2: Application Layer1 Chapter 2 Application Layer Computer Networking: A Top Down Approach, 4 th edition. Jim Kurose, Keith Ross Addison-Wesley, July 2007.
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.
Advance Computer Networks Lecture#06
Peer-to-Peer File Sharing
ADVANCED COMPUTER NETWORKS Peer-Peer (P2P) Networks 1.
Chapter 2 Application Layer Application 2-1. Chapter 2: Application layer 2.1 Principles of network applications 2.2 Web and HTTP 2.3 FTP 2.4 Electronic.
Application Layer 2-1 Chapter 2 Application Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Application Layer – Lecture.
INTERNET TECHNOLOGIES Week 10 Peer to Peer Paradigm 1.
No Class on Friday There will be NO class on: FRIDAY 1/29/15 1.
2: Application Layer 1 CMPT 371 Data Communications and Networking Chapter 2 Application Layer - 2.
PEAR TO PEAR PROTOCOL. Pure P2P architecture no always-on server arbitrary end systems directly communicate peers are intermittently connected and change.
CS1652 September 6 th, 2012 The slides are adapted from the publisher’s material All material copyright J.F Kurose and K.W. Ross, All Rights.
CS Spring 2010 CS 414 – Multimedia Systems Design Lecture 24 – Introduction to Peer-to-Peer (P2P) Systems Klara Nahrstedt (presented by Long Vu)
II -a: Application Layer II. Application Layer (part b) lectured by Chang-jin Suh Soongsil University, Dep. of Computer Science Tel :
05 - P2P applications and Sockets
An example of peer-to-peer application
Chapter 2 Application Layer
Server-client vs. P2P: example
Chapter 2: outline 2.1 principles of network applications
Communication Networks
Part 4: Peer to Peer - P2P Applications
Chapter 2 Application Layer
CMPE 252A : Computer Networks
Pure P2P architecture no always-on server
Chapter 2 Application Layer
Chapter 2 Application Layer - 2
Presentation transcript:

2: Application Layer1 Chapter 2 Application Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 Part 5: P2P

2: Application Layer2 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, POP3, IMAP r 2.5 DNS r 2.6 P2P applications r 2.7 Socket programming with UDP r 2.8 Socket programming with TCP

2: Application Layer3 Pure P2P architecture r no always-on server r arbitrary end systems directly communicate r peers are intermittently connected and change IP addresses r Peers always send entire file to another peer  Some systems (like bit torrent) break files up into pieces. peer-peer

2: Application Layer4 Pure P2P architecture r We’ll consider three examples:  File distribution  Searching for information  Case Study: Skype peer-peer

5 File Distribution: Server-Client vs P2P Question : How much time to distribute file from one server to N peers? Distribution time: the time it takes to get a copy of the file to all N peers. Assumptions: 1. the internet core has abundant bandwidth therefore all bottlenecks are in network access. 2. Server and peers are not doing anything else on the internet.

2: Application Layer6 File Distribution: Server-Client vs P2P Question : How much time to distribute file from one server to N peers? usus u2u2 d1d1 d2d2 u1u1 uNuN dNdN Server Network (with abundant bandwidth) File, size F u s : server upload bandwidth u i : peer i upload bandwidth d i : peer i download bandwidth

File Distribution: Server-Client vs P2P Question : How much time to distribute file from one server to N peers? 2: Application Layer7 Time to upload file from server for first peer: F/u s Time to upload file from server for second peer: F/u s Time to upload file from server for n th peer: F/u s … Time to download file to first peer: F/d 1 (could be long) Time to download file to second peer: F/d 2 The smaller d i the larger F/d i and the longer the download time. Could start downloading before entire file is uploaded by server

2: Application Layer8 File distribution time: server-client usus u2u2 d1d1 d2d2 u1u1 uNuN dNdN Server Network (with abundant bandwidth) F r server sequentially sends N copies:  NF/u s time r client i takes F/d i time to download increases linearly in N (for large N) = d cs >= max { NF/u s, F/min(d i ) } i Time to distribute F to N clients using client/server approach

2: Application Layer9 File distribution time: P2P usus u2u2 d1d1 d2d2 u1u1 uNuN dNdN Server Network (with abundant bandwidth) F r server must send one copy: F/u s time r client i takes F/d i time to download r NF bits must be downloaded (aggregate)  fastest possible upload rate: u s +  u i r In other words, if every node had a copy of the file r And every node uploaded the file simultaneously r Then the total rate of upload would be the sum of all the rates

File Distribution: Server-Client vs P2P Question : How much time to distribute file from one server to N peers? 2: Application Layer10 Time to upload file from server for first peer: F/u s Time to upload file from server for second peer: F/u s Time to upload file from server for n th peer: F/u s … Total Time to download file to first peer (from many other peers): F/d 1 (all the bits have to be downloaded) Time to download file to second peer: F/d 2 The smaller d i the larger F/d i and the longer the download time.

2: Application Layer11 File distribution time: P2P usus u2u2 d1d1 d2d2 u1u1 uNuN dNdN Server Network (with abundant bandwidth) F r server must send one copy: F/u s time r client i takes F/d i time to download r NF bits must be downloaded (aggregate)  fastest possible upload rate: u s +  u i d P2P >= max { F/u s, F/min(d i ), NF/(u s +  u i ) } i

2: Application Layer12 Server-client vs. P2P: example Client upload rate = u, F/u = 1 hour, u s = 10u, d min ≥ u s

2: Application Layer13 File distribution: BitTorrent tracker: tracks peers participating in torrent torrent: group of peers exchanging chunks of a file obtain list of peers trading chunks peer r P2P file distribution

2: Application Layer14 BitTorrent (1) r file divided into 256KB chunks. r peer joining torrent:  has no chunks, but will accumulate them over time  registers with tracker to get list of peers, connects to subset of peers (“neighbors”) r while downloading, peer uploads chunks to other peers. r peers may come and go r once peer has entire file, it may (selfishly) leave or (altruistically) remain

2: Application Layer15 BitTorrent (2) Pulling Chunks r at any given time, different peers have different subsets of file chunks r periodically, a peer (Alice) asks each neighbor for list of chunks that they have. r Alice sends requests for her missing chunks  rarest first Sending Chunks: tit-for-tat r Alice sends chunks to four neighbors currently sending her chunks at the highest rate  re-evaluate top 4 every 10 secs r every 30 secs: randomly select another peer, starts sending chunks  newly chosen peer may join top 4  “optimistically unchoke”

2: Application Layer16 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 With higher upload rate, can find better trading partners & get file faster!

Distributed Hash Table (DHT) r DHT = distributed P2P database r Database has (key, value) pairs;  key: social security number; value: human name E.g., ( , George Bush)  key: content type; value: IP address E.g., (Newsboys Shine, ) r Peers query DB with key  DB returns values that match the key  Example: query with get “George Bush”  Example: query with “Newsboys Shine” get r Peers can also insert (key, value) peers

How do we store the DB? r One central server  Early napster  Defeats the purpose in some ways r Randomly distribute pieces  Each peer maintains a list of the IP addresses of all participating peers.  Not scalable 2: Application Layer18

DHT Identifiers r Better: Assign integer identifier to each peer in range [0,2 n -1].  Each identifier can be represented by n bits. r Require each key in DB to be an integer in same range.  There are different types of keys, e.g., SSN or band name  Doesn’t matter: every key will be an integer in this range. r Problem: keys are not necessarily integers!  To get integer keys, hash original key.  eg, key = h(“Led Zeppelin IV”) = some integer.  Hash function can insure result is in our range  This is why they call it a distributed “hash” table

How to assign keys to peers? r Central issue:  Assigning (key, value) pairs to peers. i.e., which peer will store with (key, value) pairs?  Recall each peer is assigned an identifier r Rule: assign key to the peer that has the closest ID. r Convention in lecture: closest is the immediate successor of the key.

How to assign keys to peers? r Example: n=4;  Then all peer identifiers are in range [0, 15]  peers: 1,3,4,5,8,10,12,14;  key = 13, then successor peer = 14  Key = 8, then successor peer = 8  key = 15, then successor peer = 1

Circular DHT (1) r Each peer only aware of immediate successor and predecessor. r “Overlay network”:  the peers form their own “network”  A successor/predecessor may be many hops away

Circle DHT (2) Who’s resp for key 1110 ? I am Disadv: O(N) messages on avg (actually N/2) to resolve query, when there are N peers 1110 Define closest as closest successor Advantage: little info kept in each peer

Circular DHT with Shortcuts r Each peer keeps track of IP addresses of predecessor, successor, short cuts. r Reduced from 6 to 2 messages. r Possible to design shortcuts so O(log N) neighbors, O(log N) messages in query Who’s resp for key 1110?

Peer Churn r Peer 5 abruptly leaves r Peer 4 detects; makes 8 its immediate successor; asks 8 who its immediate successor is; makes 8’s immediate successor its second successor. r What if peer 13 wants to join? To handle peer churn, require each peer to know the IP address of its two successors. Each peer periodically pings its two successors to see if they are still alive.

2: Application Layer26 P2P Case study: Skype r inherently P2P: pairs of users communicate. r proprietary application-layer protocol (inferred via reverse engineering) r hierarchical overlay with supernodes r Index maps usernames to IP addresses; distributed over SNs r Skype is proprietary but guess is that it uses DHT Skype clients (SC) Supernode (SN) Skype login server

2: Application Layer27 Peers as relays r Problem when both Alice and Bob are behind “NATs”.  NAT prevents an outside peer from initiating a call to insider peer r Solution:  Using Alice’s and Bob’s SNs, Relay is chosen  Each peer initiates session with relay.  Peers can now communicate through NATs via relay