DOC PREVIEW
Berkeley COMPSCI 162 - Lecture 23 HTTP and Peer­to­Peer Networks

This preview shows page 1-2-17-18-19-35-36 out of 36 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 36 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 36 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 36 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 36 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 36 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 36 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 36 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 36 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Slide 1Recap: RPC Server CrashesWhy Not Use Logging?Today’s LectureThe WebUniform Record Locator (URL)Hyper Text Transfer Protocol (HTTP)Big PictureHyper Text Transfer Protocol CommandsClient RequestServer ResponseHTTP/1.0 ExampleHTTP/1.0 PerformanceHTTP/1.0 Caching SupportHTTP/1.1 (1996)Persistent ConnectionsPipelined Requests/ResponsesAchieving Scale and Availability“Base-line”Reverse CachesForward ProxiesContent Distribution Networks (CDNs)Example: AkamaiExample: AkamaiPeer-to-Peer Networks & Distributed Hash TablesHow Did it Start?ModelMain ChallengeOther ChallengesNapsterNapster: ExampleGnutellaGnutella: ExampleTwo-Level HierarchySkypeConclusionsCS162Operating Systems andSystems ProgrammingLecture 23HTTP and Peer-to-Peer NetworksApril 20, 2011Ion Stoicahttp://inst.eecs.berkeley.edu/~cs162Lec 23.24/20 Ion Stoica CS162 ©UCB Spring 2011Recap: RPC Server Crashes•Three cases–Crash after execution–Crash before execution–Crash during the execution•Three possible semantics–At least once semantics»Client keeps trying until it gets a reply–At most once semantics»Client gives up on failure–Exactly once semantics»Can this be correctly implemented?Lec 23.34/20 Ion Stoica CS162 ©UCB Spring 2011Why Not Use Logging?•Assume–Server can log either before starting or after executing the operation–Server restarts after crashing•First case:–Server execute operation first, then logs “done”–What semantics does this implement?•Second case:–Server logs “start”, and then execute operation–What semantics does this implement?•So, can you ensure “exactly once” semantics?Lec 23.44/20 Ion Stoica CS162 ©UCB Spring 2011Today’s Lecture•Web–Hypertext Transport Protocol•Peer-to-Peer networks–Distributed Hash Tables (DHTs)Lec 23.54/20 Ion Stoica CS162 ©UCB Spring 2011The Web•Core components:–Servers: store files and execute remote commands–Browsers: retrieve and display “pages” –Uniform Resource Locators (URLs): way to refer to pages•A protocol to transfer information between clients and servers–HTTPLec 23.64/20 Ion Stoica CS162 ©UCB Spring 2011Uniform Record Locator (URL)protocol://host-name:port/directory-path/resource•E.g., http://www-inst.eecs.berkeley.edu/~cs162/sp11/•Extend to program executions as well…–http://www.google.com/#sclient=psy&hl=en&source=hp&q=cs162+berkeley&aq=0&aqi=g5&aql=&oq=&pbx=1&bav=on.2,or.r_gc.r_pw.&fp=1ef120049c3f5a29Lec 23.74/20 Ion Stoica CS162 ©UCB Spring 2011Hyper Text Transfer Protocol (HTTP)•Client-server architecture•Synchronous request/reply protocol –Runs over TCP, Port 80•Stateless–Server does not keep state about client across requests, i.e., after each request the web server forgets about client–Why is this good?Lec 23.84/20 Ion Stoica CS162 ©UCB Spring 2011Big PictureClientServerTCP SynTCP syn + ack TCP ack + HTTP GET...EstablishconnectionRequestresponseClient requestCloseconnectionLec 23.94/20 Ion Stoica CS162 ©UCB Spring 2011Hyper Text Transfer Protocol Commands•GET – transfer resource from given URL•HEAD – GET resource metadata (headers) only•PUT – store/modify resource under given URL•DELETE – remove resource•POST – provide input for a process identified by the given URL (usually used to post CGI parameters)Lec 23.104/20 Ion Stoica CS162 ©UCB Spring 2011Client Request•Steps to get the resource: http://www-inst.eecs.berkeley.edu/~cs162/sp11/ 1. Use DNS to obtain the IP address of www-inst.eecs.berkeley.edu2. Send an HTTP request to IP address and port 80:GET /~cs162/sp11 HTTP/1.0Lec 23.114/20 Ion Stoica CS162 ©UCB Spring 2011Server ResponseHTTP/1.0 200 OKContent-Type: text/htmlContent-Length: 1234Last-Modified: Mon, 19 Nov 2010 15:31:20 GMT<HTML><HEAD><TITLE>EECS Home Page</TITLE></HEAD>…</BODY></HTML>Lec 23.124/20 Ion Stoica CS162 ©UCB Spring 2011HTTP/1.0 ExampleClientServerRequest image 1Transfer image 1Request image 2Transfer image 2Request textTransfer textFinish displaypageLec 23.134/20 Ion Stoica CS162 ©UCB Spring 2011HTTP/1.0 Performance•Create a new TCP connection for each resource–Large number of embedded objects in a web page–Many short lived connections•TCP transfer–Too slow for small object–It takes time to establish a connection and ramp-up (i.e., exit slow-start phase)•Connections may be set up in parallel (5 is default in most browsers)Lec 23.144/20 Ion Stoica CS162 ©UCB Spring 2011HTTP/1.0 Caching Support•A modifier to the GET request:–If-modified-since – return a “not modified” response if resource was not modified since specified time •A response header:–Expires – specify to the client for how long it is safe to cache the resource•A request directive: –No-cache – ignore all caches and get resource directly from server•These features can be best taken advantage of with HTTP proxies–Locality of reference increases if many clients share a proxyLec 23.154/20 Ion Stoica CS162 ©UCB Spring 2011HTTP/1.1 (1996)•Performance: –Persistent connections –Pipelined requests/responses–…•Efficient caching support–Network Cache assumed more explicitly in the design–Gives more control to the server on how it wants data cached•Support for virtual hosting–Allows to run multiple web servers on the same machineLec 23.164/20 Ion Stoica CS162 ©UCB Spring 2011Persistent Connections•Allow multiple transfers over one connection•Avoid multiple TCP connection setups•Avoid multiple TCP slow starts (i.e., TCP ramp ups)Lec 23.174/20 Ion Stoica CS162 ©UCB Spring 2011Pipelined Requests/Responses•Buffer requests and responses to reduce the number of packets•Multiple requests can be contained in one TCP segment•Note: order of responses has to be maintainedClientServerRequest 1Request 2Request 3Transfer 1Transfer 2Transfer 3Lec 23.184/20 Ion Stoica CS162 ©UCB Spring 2011Achieving Scale and Availability•Problem: You are a web content provider –How do you handle millions of web clients?–How do you ensure that all clients experience good performance?–How do you maintain availability in the presence of server and network failures?•Solutions:–Add more servers at different locations  If you are CNN this might work!–Caching–Content Distribution Networks (Replication)Lec 23.194/20 Ion Stoica CS162 ©UCB Spring 2011“Base-line”•Many clients transfer same information –Generate unnecessary server and network load–Clients experience unnecessary


View Full Document

Berkeley COMPSCI 162 - Lecture 23 HTTP and Peer­to­Peer Networks

Documents in this Course
Lecture 1

Lecture 1

12 pages

Nachos

Nachos

41 pages

Security

Security

39 pages

Load more
Download Lecture 23 HTTP and Peer­to­Peer Networks
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Lecture 23 HTTP and Peer­to­Peer Networks and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lecture 23 HTTP and Peer­to­Peer Networks 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?