21
By Shobana Padmanabhan Sep 12, 2007 CSE 473 Class #4: P2P Section 2.6 of textbook (some pictures here are from the book)

By Shobana Padmanabhan Sep 12, 2007 CSE 473 Class #4: P2P Section 2.6 of textbook (some pictures here are from the book)

Embed Size (px)

Citation preview

Page 1: By Shobana Padmanabhan Sep 12, 2007 CSE 473 Class #4: P2P Section 2.6 of textbook (some pictures here are from the book)

By Shobana Padmanabhan

Sep 12, 2007

CSE 473

Class #4: P2P

Section 2.6 of textbook (some pictures here are from the book)

Page 2: By Shobana Padmanabhan Sep 12, 2007 CSE 473 Class #4: P2P Section 2.6 of textbook (some pictures here are from the book)

2

Recap

• Links• Packet switched networks• Store-and-forward routing• Delays

– dprop = distance/ propagation speed– dtran = L /R = packet size/ capacity– dq

– dproc

• IPv4 address: 32 bits– 172.16.2.15 (roach.int.cec.wustl.edu) – 172.16.2.8 (butterfly.int.cec.wustl.edu)

• 10101100 00010000 00000010 00001000– Subnet mask

• 172.16.2.8/24– First 24 bits constitute “prefix”

Page 3: By Shobana Padmanabhan Sep 12, 2007 CSE 473 Class #4: P2P Section 2.6 of textbook (some pictures here are from the book)

3

Longest-prefix matching

Destination address Link to follow

172.16.2.15/32 Link1

172.16.2.15/24 Link2

172.16.2.8/16 Link3

Page 4: By Shobana Padmanabhan Sep 12, 2007 CSE 473 Class #4: P2P Section 2.6 of textbook (some pictures here are from the book)

4

Today’s lecture

• Application layer– Applications don’t see links– Client-server or P2P

• Today, we focus on P2P

Page 5: By Shobana Padmanabhan Sep 12, 2007 CSE 473 Class #4: P2P Section 2.6 of textbook (some pictures here are from the book)

5

ApplicationsGmail

New mail:

“Watch Federer video.

Tell Cathy, Denis, Ed, and Frank also.”

request

request

response

response

Internet

Page 6: By Shobana Padmanabhan Sep 12, 2007 CSE 473 Class #4: P2P Section 2.6 of textbook (some pictures here are from the book)

6

ApplicationsGmail

request

request

response

response

Internet

• Server sends 5 copies• If 50 requests, 50 copies; 5 million requests, 5 million

copies!

Page 7: By Shobana Padmanabhan Sep 12, 2007 CSE 473 Class #4: P2P Section 2.6 of textbook (some pictures here are from the book)

7

Client-server

• Suppose – File is F bits– N users

– Upload rate of server’s access link is us

– Upload rate of useri’s access link is ui

– Download rate of useri’s access link is di

• Time to distribute a copy to all users– NF/us a

• A user may have very low download rate– Max {NF/us, F/dmin} where dmin= min {d1,d2,…dN }

Page 8: By Shobana Padmanabhan Sep 12, 2007 CSE 473 Class #4: P2P Section 2.6 of textbook (some pictures here are from the book)

8

Client-server

• Other problems– Significant reliance on always-on servers– Multiple copies, along with other traffic, can cause

congestion on links• Longest-prefix matching is not sensitive to traffic load• Queuing delays at routers

– Potential dropping of packets (i.e.) data loss

• Peer-to-peer architecture addresses these…

Page 9: By Shobana Padmanabhan Sep 12, 2007 CSE 473 Class #4: P2P Section 2.6 of textbook (some pictures here are from the book)

9

Peer-to-peer (P2P)

• Pairs of computers, called peers, communicate directly.

Source: wikipedia.org

• Server sends file once.• Peers redistribute file chunks using their upload

capacity.– Max {F/us, F/dmin, NF/(us+u1+u2+…+uN)}

Page 10: By Shobana Padmanabhan Sep 12, 2007 CSE 473 Class #4: P2P Section 2.6 of textbook (some pictures here are from the book)

10

Client-server vs. P2P

Page 11: By Shobana Padmanabhan Sep 12, 2007 CSE 473 Class #4: P2P Section 2.6 of textbook (some pictures here are from the book)

11

BitTorrent

• P2p protocol for file distribution

Page 12: By Shobana Padmanabhan Sep 12, 2007 CSE 473 Class #4: P2P Section 2.6 of textbook (some pictures here are from the book)

12

BitTorrent

1. When a peer (Alice) joins a torrent, she registers with a tracker.

– Periodically, informs tracker of its presence.

2. Tracker sends Alice IP addresses of n random participating peers.

3. Alice tries to establish connection with them all.– All connected peers are neighboring peers.

• These peers may leave and others may join over time.

4. Periodically, Alice asks each neighbor for their list of chunks

– Alice then requests chunks that she wants.

5. Important decisions Alice makes are:– Request “rarest first” chunks– “Trading algo” to determine neighbors to whom to send

– Eliminates “free-riding”

Page 13: By Shobana Padmanabhan Sep 12, 2007 CSE 473 Class #4: P2P Section 2.6 of textbook (some pictures here are from the book)

13

BitTorrent

• Estimated BitTorrent traffic is 18 - 35%• BitTorrent does not offer users anonymity

– obtaining IP addresses exposes users with insecure systems to attacks

• Peers may leave selfishly after downloading a file

• Users with low upload capacity may see slower download speeds until they upload more– Some trackers exempt dial-up users

Source: wikipedia.org

Page 14: By Shobana Padmanabhan Sep 12, 2007 CSE 473 Class #4: P2P Section 2.6 of textbook (some pictures here are from the book)

14

Indexing

• Map info to locations1. Centralized index

2. Query flooding

3. Hierarchical overlay

4. DHTs (Distributed Hash Table)

Page 15: By Shobana Padmanabhan Sep 12, 2007 CSE 473 Class #4: P2P Section 2.6 of textbook (some pictures here are from the book)

15

1. Centralized index

Page 16: By Shobana Padmanabhan Sep 12, 2007 CSE 473 Class #4: P2P Section 2.6 of textbook (some pictures here are from the book)

16

2. Query flooding index

• Limited-scope query flooding• Handling of peers joining and leaving overlay

– Bootstrap, maybe with a tracker

• The new peer tries to setup TCP connections• “Ping”, “pong”

Page 17: By Shobana Padmanabhan Sep 12, 2007 CSE 473 Class #4: P2P Section 2.6 of textbook (some pictures here are from the book)

17

3. Hierarchical overlay index

• “Super” peers maintain index for files of their children

• Super peers interconnect themselves

Page 18: By Shobana Padmanabhan Sep 12, 2007 CSE 473 Class #4: P2P Section 2.6 of textbook (some pictures here are from the book)

18

4. DHT index

• A fully decentralized index• Allows users to determine all locations of a file

– Without generating excessive traffic

Page 19: By Shobana Padmanabhan Sep 12, 2007 CSE 473 Class #4: P2P Section 2.6 of textbook (some pictures here are from the book)

19

Skype

• P2P Internet telephony– P2P techniques for also user location

• Proprietary protocol; all packet transmissions encrypted

• Nodes organized into hierarchical overlay net– Each peer classified as super or ordinary

• Index to map username to current IP address– Distributed over super peers

Page 20: By Shobana Padmanabhan Sep 12, 2007 CSE 473 Class #4: P2P Section 2.6 of textbook (some pictures here are from the book)

Backup

Page 21: By Shobana Padmanabhan Sep 12, 2007 CSE 473 Class #4: P2P Section 2.6 of textbook (some pictures here are from the book)

21

Longest-prefix matching

// insert sorted

if (new_mask == curr_mask) {

if (new_destAddr == curr_destAddr) {

//entry already exists

return 0;

}

return (new_destAddr > curr_destAddr) ? 1 : -1;

}

return (new_mask > curr_mask) ? 1 : -1;

// if return value > 0, insert above current entry