210 likes | 313 Views
By Shobana Padmanabhan Sep 12, 2007 CSE 473. Class #4: P2P Section 2.6 of textbook (some pictures here are from the book). Recap. Links Packet switched networks Store-and-forward routing Delays d prop = distance/ propagation speed d tran = L /R = packet size/ capacity d q d proc
E N D
By Shobana Padmanabhan Sep 12, 2007 CSE 473 Class #4: P2PSection 2.6 of textbook (some pictures here are from the book)
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”
Today’s lecture • Application layer • Applications don’t see links • Client-server or P2P • Today, we focus on P2P
Applications Gmail request response Internet request response New mail: “Watch Federer video. Tell Cathy, Denis, Ed, and Frank also.”
Applications Gmail • Server sends 5 copies • If 50 requests, 50 copies; 5 million requests, 5 million copies! request response Internet request response
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 }
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…
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)}
BitTorrent • P2p protocol for file distribution
BitTorrent • When a peer (Alice) joins a torrent, she registers with a tracker. • Periodically, informs tracker of its presence. • Tracker sends Alice IP addresses of n random participating peers. • Alice tries to establish connection with them all. • All connected peers are neighboring peers. • These peers may leave and others may join over time. • Periodically, Alice asks each neighbor for their list of chunks • Alice then requests chunks that she wants. • Important decisions Alice makes are: • Request “rarest first” chunks • “Trading algo” to determine neighbors to whom to send • Eliminates “free-riding”
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
Indexing • Map info to locations • Centralized index • Query flooding • Hierarchical overlay • DHTs (Distributed Hash Table)
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”
3. Hierarchical overlay index • “Super” peers maintain index for files of their children • Super peers interconnect themselves
4. DHT index • A fully decentralized index • Allows users to determine all locations of a file • Without generating excessive traffic
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
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