Presentation is loading. Please wait.

Presentation is loading. Please wait.

Client-Server vs P2P or, HTTP vs Bittorrent. Client-Server Architecture SERVER client.

Similar presentations


Presentation on theme: "Client-Server vs P2P or, HTTP vs Bittorrent. Client-Server Architecture SERVER client."— Presentation transcript:

1 Client-Server vs P2P or, HTTP vs Bittorrent

2 Client-Server Architecture SERVER client

3 CLIENTSERVER Many clientsOne server Program starts and stopsProgram runs continuously Initiates connection – one server at a time. Responds – many clients at a time. Requests servicesResponds to requests (Usually) closes connection Holds the files / data Any port number will doNeeds a well-known port number, well known IP number Clients never communicate with one another.

4 Example: The HTTP Protocol CLIENT: send request message SERVER: respond to request

5 HTTP 1.Client initiates connection by sending a request message, then headers, then a blank line, then an optional message. GET ccm/index.html HTTP/1.1 Accept-Lang: en --no message --

6 HTTP 2. Server responds with a status line (status code and text), headers, a blank line, and optional text or data. Example: HTTP1.1 200 OK Server: Apache/1.3.3.7 (Unix) Content-Length: 345 bytes Content-Type: text/html …the text of the page in html…

7 HTTP Eight types of client request messages: 1.GET: request a file from server 2.HEAD: just send me the headers that would be sent 3.POST: send input to a server program that generates pages 4.PUT: upload a file to server 5.DELETE: delete a file on server 6.TRACE: echo this request 7.OPTIONS: what services does server offer 8.CONNECT: open a TCP-like connection

8 HTTP Five categories of server response: 1xx information 2xx success 3xx redirection 4xx client error 5xx server error Examples: 200 OK 301 Moved Permanently 403 Forbidden 404 Not Found

9 Other Client-Server Protocols TCP DNS eMail (POP/IMAP and SMTP) Amazon, eBay, most sites for commercial transactions Note: Ethernet and IP are in a different category of so-called connectionless protocols: the sender does not contact the receiver before sending the data. Client-server and peer-to-peer are both connection-oriented protocols.

10 Peer to Peer Architecture client server

11 Peer to Peer Network Every node can act as both client and server (called a peer, or client). The ``overlay topology’’ is the topology imposed by the connectivity tables. Nodes communicate directly (usually using http) with neighbors. Data / files are distributed (sometimes in pieces) over all the network Need a directory protocol to find data. Need a transfer protocol to transfer data.

12 Client-Server vs P2p Client-Server Centralized & less robust. Efficiency and reliability depend on server. Popular data = more congestion = slower. Centralized data repository: easier to maintain, more accountability, better security. Server can control and record transactions by clients. One server can work with a wider variety of client capabilities. Server must be easy to find: Hence well- known port numbers. P2P Decentralized & more robust. No single point of failure. Popular data = more distribution = faster. Decentralized data: more redundancy, harder to maintain, less accountability, less security. Transactions are not recorded, harder to trace. Peers need to be fairly compatible. Peers need to find each other.

13 Example: BitTorrent One large file (MB,GB) broken into many pieces (64kB..4MB), pieces broken into blocks. Pieces are distributed to many peers. A block is a unit of file transfer. Peers can run in leech mode (downloading/client) or seed mode (uploading/server). The tracker is a server of directory information (where to find the peers and pieces you want).

14 BitTorrent Protocol Overview 1.Visit website to obtain a.torrent file for the song you want. This file contains info about the pieces. 2.Open the file: This contacts a tracker who gives you a (random) list of peers to connect to. The peers have the pieces you want. 3.Handshake to open a connection to each peer. 4.File transfer: peers send you pieces (leech), or you send complete files in pieces to peers (seed). Possibly both at the same time. 5.Endgame: close connections to peers.

15 BitTorrent Protocol 2.Visit tracker to get a (random) list of peers holding pieces you want. This imposes a random topology on the network, connectivity depending on what files users request. Difficult to model and predict performance. Trackers do not remember peer lists; peers do not reveal their own peer lists. Difficult to trace connectivity.

16 BitTorrent Protocol 4. File transfer: Tit-for-tat philosophy: The more you give, the more you get. The quality of your download experience depends on your quality as an uploader. After you have acquired an entire file, keep the connections open so you can seed to new peers. You can also seed new content by contacting a tracker, which will hook you up with new peers.

17 BitTorrent Protocol 3. File transfer protocol exchanges information about peers. A is Interested. If B has something A does not have, and wants. A is Choked. B may choke A and refuse to send content. (Perhaps A is a seed, or B is busy). A is Snubbed. If B is supposed to be sending but has not communicated for 60 seconds.

18 P2P Problems Lots of malicious code (viruses, worms, Trojan horses, back door…) in P2P sites. Can suck up all the bandwidth in a network. Other network nodes experience slowdown. – Many ISP’s limit download volume per user per month. Some accused of squashing P2P packets. – AC will throttle (slow down) a node that takes a too high percentage of bandwidth. (AC prevents uploading P2P packets from leaving campus.)

19 P2P and Copyright Infringement Sony v. Universal Studios: Sony is not liable if users use Betamax video recorders to infringe. RIAA v. Napster: Shut down because the central server held illegal content, and the site advertised and encouraged infringement. MGM v. Grokster: Non-infringing uses must be significant compared to infringing ones. Grokster induced users to infringe. LimeWire: Users must agree not to use software for infringement before downloading. BitTorrent: Has licenses for all content at the company website. Trackers do not protect anonymity of clients. Other sites using BitTorrent code have been targets of legal action.

20 P2P Legal File Sharing Open source software Publications with Creative Commons license Weedshare files (can play 3 times for free before deciding to buy) Copyright-free songs and recordings Exchanging data within a company or group. Estimate legal use growing by 400 percent per year.


Download ppt "Client-Server vs P2P or, HTTP vs Bittorrent. Client-Server Architecture SERVER client."

Similar presentations


Ads by Google